budgetList.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. <template>
  2. <!-- <div style="height: 95%"> -->
  3. <div class="container" style="margin: 15px 0 0 0">
  4. <fullscreen
  5. :fullscreen.sync="fullscreen"
  6. class="container-box"
  7. style="margin: 0 !important; padding: 0 !important"
  8. >
  9. <div class="titbox">
  10. <h2>部门预算模板管理</h2>
  11. <div>
  12. <i class="el-icon-refresh" @click="iconCli(1)"></i>
  13. <i class="el-icon-full-screen" @click="iconCli(2)"></i>
  14. <!-- <i class="el-icon-folder-opened"></i>-->
  15. <!-- <i class="el-icon-view"></i>-->
  16. <!-- <i class="el-icon-more"></i>-->
  17. </div>
  18. </div>
  19. <div class="search">
  20. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  21. <el-button size="small" @click="addExcel" type="primary"
  22. >新增模板</el-button
  23. >
  24. </div>
  25. <div class="tabbox">
  26. <el-table
  27. height="calc(100% - 40px)"
  28. v-loading="loading"
  29. class="com-table"
  30. ref="multipleTable"
  31. :data="tableData"
  32. tooltip-effect="dark"
  33. size="small"
  34. border
  35. style="width: 100%"
  36. >
  37. <el-table-column
  38. align="center"
  39. prop="tempName"
  40. label="模板名称"
  41. show-overflow-tooltip
  42. >
  43. </el-table-column>
  44. <el-table-column
  45. align="center"
  46. prop="opTime"
  47. show-overflow-tooltip
  48. label="配置时间"
  49. >
  50. </el-table-column>
  51. <el-table-column
  52. align="center"
  53. prop="opNo"
  54. show-overflow-tooltip
  55. label="配置工号"
  56. >
  57. </el-table-column>
  58. <el-table-column
  59. align="center"
  60. prop="opName"
  61. show-overflow-tooltip
  62. label="配置姓名"
  63. >
  64. </el-table-column>
  65. <el-table-column
  66. align="center"
  67. prop="tempStsDesc"
  68. show-overflow-tooltip
  69. label="模板状态"
  70. >
  71. </el-table-column>
  72. <el-table-column align="center" prop="tempTypeDesc" label="模板类型">
  73. </el-table-column>
  74. <el-table-column
  75. align="center"
  76. prop="tempStsDesc"
  77. show-overflow-tooltip
  78. label="权限状态"
  79. >
  80. <template slot-scope="scope">
  81. {{ scope.row.powerFlag == 0 ? "开" : "关" }}
  82. </template>
  83. </el-table-column>
  84. <el-table-column
  85. align="center"
  86. prop="hotline"
  87. width="200"
  88. label="操作"
  89. >
  90. <template slot-scope="scope">
  91. <el-button
  92. :disabled="scope.row.tempStsDesc == '作废'"
  93. size="mini"
  94. type="primary"
  95. plain
  96. @click="issue(scope.row)"
  97. >下发</el-button
  98. >
  99. <el-button
  100. size="mini"
  101. type="primary"
  102. plain
  103. @click="detailes(scope.row)"
  104. >查看</el-button
  105. >
  106. <el-button
  107. size="mini"
  108. type="primary"
  109. plain
  110. @click="updates(scope.row)"
  111. >修改</el-button
  112. >
  113. <el-button
  114. :disabled="scope.row.tempStsDesc == '作废'"
  115. size="mini"
  116. type="danger"
  117. plain
  118. @click="deletes(scope.row)"
  119. >作废</el-button
  120. >
  121. </template>
  122. </el-table-column>
  123. </el-table>
  124. <el-pagination
  125. class="pageBox"
  126. @current-change="currchange"
  127. layout="prev, pager, next"
  128. background
  129. :total="total"
  130. >
  131. </el-pagination>
  132. </div>
  133. <myMessage
  134. :messTit="messTit"
  135. @closeMessage="closeMessage"
  136. :centerDialogVisible="centerDialogVisible"
  137. v-if="centerDialogVisible"
  138. ></myMessage>
  139. </fullscreen>
  140. <el-dialog
  141. title="下发预算"
  142. :visible.sync="dialogStatus"
  143. width="50%"
  144. :close-on-press-escape="false"
  145. :show-close="false"
  146. :destroy-on-close="true"
  147. :modal-append-to-body="false"
  148. :close-on-click-modal="false"
  149. >
  150. <el-form
  151. ref="ruleForm"
  152. :rules="rules"
  153. :model="formData"
  154. label-width="80px"
  155. >
  156. <el-form-item label="预算标题" prop="woTitle">
  157. <el-input
  158. placeholder="请输入预算标题"
  159. v-model="formData.woTitle"
  160. ></el-input>
  161. </el-form-item>
  162. <el-form-item label="预算说明" prop="woDesc">
  163. <el-input
  164. placeholder="请输入预算说明"
  165. v-model="formData.woDesc"
  166. ></el-input>
  167. </el-form-item>
  168. <el-form-item v-if="typeFlag == '2'" label="下发月份" prop="sendMonth">
  169. <el-date-picker
  170. style="width: 100% !important"
  171. v-model="formData.sendMonth"
  172. value-format="yyyy-MM"
  173. type="month"
  174. placeholder="选择月份"
  175. >
  176. </el-date-picker>
  177. </el-form-item>
  178. <el-form-item
  179. v-if="typeFlag == '0' || typeFlag == '1' || typeFlag == '3'"
  180. label="下发年份"
  181. prop="sendYear"
  182. >
  183. <el-date-picker
  184. style="width: 100% !important"
  185. v-model="formData.sendYear"
  186. value-format="yyyy"
  187. type="year"
  188. placeholder="选择年份"
  189. >
  190. </el-date-picker>
  191. </el-form-item>
  192. <el-form-item
  193. v-if="typeFlag == '1'"
  194. label="下发季度"
  195. prop="sendQuarter"
  196. >
  197. <el-select
  198. style="width: 100% !important"
  199. v-model="formData.sendQuarter"
  200. placeholder="请选择季度"
  201. >
  202. <el-option label="一季度" value="01"> </el-option>
  203. <el-option label="二季度" value="02"> </el-option>
  204. <el-option label="三季度" value="03"> </el-option>
  205. <el-option label="四季度" value="04"> </el-option>
  206. </el-select>
  207. </el-form-item>
  208. <el-form-item label="反馈时间" prop="requiredTime">
  209. <el-date-picker
  210. style="width: 100%"
  211. v-model="formData.requiredTime"
  212. type="datetime"
  213. placeholder="选择反馈时间"
  214. value-format="YYYY-MM-DD"
  215. >
  216. </el-date-picker>
  217. </el-form-item>
  218. <el-form-item label="接收人" prop="sendNoArr">
  219. <el-select
  220. placeholder="选择接收人"
  221. v-model="formData.sendNoArr"
  222. multiple
  223. filterable
  224. style="width: 100%"
  225. >
  226. <el-option
  227. v-for="items in options"
  228. :key="items.value"
  229. :label="items.label"
  230. :value="items.value"
  231. >
  232. </el-option>
  233. </el-select>
  234. </el-form-item>
  235. </el-form>
  236. <div slot="footer" class="dialog-footer">
  237. <el-button @click="resetUser('ruleForm')">取 消</el-button>
  238. <el-button @click="subUser('ruleForm')">确 定</el-button>
  239. </div>
  240. </el-dialog>
  241. </div>
  242. </template>
  243. <script>
  244. import mySearch from "../../../components/search";
  245. import myMessage from "../../../components/myMessage.vue";
  246. export default {
  247. components: {
  248. mySearch,
  249. myMessage,
  250. },
  251. data() {
  252. return {
  253. centerDialogVisible: false,
  254. messTit: "",
  255. dataId: "",
  256. typeFlag: "",
  257. value1: "",
  258. options: [],
  259. dialogStatus: false,
  260. formData: {
  261. woTitle: "",
  262. woDesc: "",
  263. requiredTime: "",
  264. sendNoArr: "",
  265. sendYear: "",
  266. sendMonth: "",
  267. sendQuarter: "",
  268. },
  269. rules: {
  270. woTitle: [
  271. { required: true, message: "请输入预算标题", trigger: "blur" },
  272. ],
  273. woDesc: [
  274. { required: true, message: "请输入预算备注", trigger: "change" },
  275. ],
  276. requiredTime: [
  277. {
  278. required: true,
  279. message: "请选择反馈时间",
  280. trigger: "change",
  281. },
  282. ],
  283. sendNoArr: [
  284. {
  285. required: true,
  286. message: "请选择接收人",
  287. trigger: "change",
  288. },
  289. ],
  290. sendYear: [
  291. {
  292. required: true,
  293. message: "请选择下发年份",
  294. trigger: "change",
  295. },
  296. ],
  297. sendMonth: [
  298. {
  299. required: true,
  300. message: "请选择下发月份",
  301. trigger: "change",
  302. },
  303. ],
  304. sendQuarter: [
  305. {
  306. required: true,
  307. message: "请选择下发季度",
  308. trigger: "change",
  309. },
  310. ],
  311. },
  312. headers: {
  313. agileauthtoken: sessionStorage.agileauthtoken.replace(/"/g, ""),
  314. },
  315. fullscreen: false,
  316. total: 0,
  317. pageSize: 1,
  318. tableData: [
  319. {
  320. name: "黑龙江公司移动成本预算简表",
  321. cNo: "admin",
  322. cUser: "admin",
  323. ctime: "2021-03-10",
  324. status: "已下发",
  325. },
  326. {
  327. name: "黑龙江公司移动成本预算简表1",
  328. cNo: "admin",
  329. cUser: "admin",
  330. ctime: "2021-03-10",
  331. status: "草稿",
  332. },
  333. ],
  334. searchList: [
  335. {
  336. type: "input",
  337. tit: "模板名称",
  338. value: "",
  339. width: "100%",
  340. options: [],
  341. },
  342. // {
  343. // type: "input",
  344. // tit: "创建时间",
  345. // value: "",
  346. // width: "100%",
  347. // options: [],
  348. // },
  349. // {
  350. // type: "input",
  351. // tit: "模板状态",
  352. // value: "",
  353. // width: "100%",
  354. // options: [],
  355. // },
  356. ],
  357. params: {
  358. tempName: "",
  359. },
  360. loading: false,
  361. fileList: [],
  362. fileName: "",
  363. };
  364. },
  365. methods: {
  366. chenckType(val) {
  367. if (val.tempStsDesc == "草稿") {
  368. this.$http({
  369. url: "/market/pre/updateType",
  370. method: "post",
  371. headers: {
  372. "Content-Type": "application/json",
  373. },
  374. data: {
  375. id: val.id,
  376. tempType: val.tempType,
  377. tempTypeDesc: val.tempTypeDesc,
  378. },
  379. }).then((res) => {
  380. this.$message({
  381. message: "操作成功",
  382. type: "success",
  383. });
  384. this.getList(this.params, this.pageSize);
  385. });
  386. }
  387. },
  388. chenck(val) {
  389. if (val.tempStsDesc == "草稿") {
  390. this.$http({
  391. url: "/market/pre/updatePower",
  392. method: "post",
  393. headers: {
  394. "Content-Type": "application/json",
  395. },
  396. data: { id: val.id },
  397. }).then((res) => {
  398. this.$message({
  399. message: "操作成功",
  400. type: "success",
  401. });
  402. this.getList(this.params, this.pageSize);
  403. });
  404. }
  405. },
  406. detailes(val) {
  407. this.$router.push("/initExcelsee?status=see&id=" + val.id + "");
  408. },
  409. // 增加表单处理
  410. subUser(formName) {
  411. let sendNoArr = [];
  412. this.$refs[formName].validate((valid) => {
  413. if (valid) {
  414. this.formData.sendNoArr.map((item) => {
  415. this.options.map((row) => {
  416. if (item == row.value) {
  417. sendNoArr.push({
  418. receiveNo: item,
  419. receiveName: row.label,
  420. deptCode: row.deptCode,
  421. deptName: row.deptName,
  422. });
  423. }
  424. });
  425. });
  426. let data = {
  427. woTitle: this.formData.woTitle,
  428. woDesc: this.formData.woDesc,
  429. requiredTime: this.formData.requiredTime,
  430. sendNoArr: JSON.stringify(sendNoArr),
  431. preTempId: this.preTempId,
  432. sendYear: this.typeFlag == "1" ? "" : this.formData.sendYear,
  433. sendMonth: this.formData.sendMonth,
  434. sendQuarter:
  435. this.typeFlag == "1"
  436. ? this.formData.sendYear + "-" + this.formData.sendQuarter
  437. : "",
  438. tempType: this.typeFlag,
  439. funcCode:
  440. this.typeFlag == "0"
  441. ? "1000"
  442. : this.typeFlag == "1"
  443. ? "1004"
  444. : this.typeFlag == "2"
  445. ? "1001"
  446. : this.typeFlag == "3"
  447. ? "1003"
  448. : "",
  449. };
  450. console.log(data);
  451. this.$http({
  452. url: "/market/pre/pub",
  453. method: "post",
  454. headers: {
  455. "Content-Type": "application/json",
  456. },
  457. data: data,
  458. }).then((res) => {
  459. if (res.data.result == 0) {
  460. this.$message({
  461. type: "success",
  462. message: "下发成功",
  463. });
  464. } else {
  465. this.$message({
  466. type: "error",
  467. message: res.data.desc,
  468. });
  469. }
  470. this.resetUser(formName);
  471. this.dialogStatus = false;
  472. this.getList(this.params, this.pageSize);
  473. });
  474. }
  475. });
  476. },
  477. // 取消提交
  478. resetUser(formName) {
  479. this.$refs[formName].resetFields();
  480. this.dialogStatus = false;
  481. },
  482. closeDialog() {
  483. this.dialogStatus = false;
  484. },
  485. issue(val) {
  486. this.typeFlag = val.tempType;
  487. console.log(this.typeFlag);
  488. this.preTempId = val.id;
  489. this.dialogStatus = true;
  490. },
  491. defaultMenu(path, name) {
  492. let defaults = this.$store.state.tabList.filter((item) => {
  493. if (item.rountPath == path) {
  494. return item;
  495. }
  496. });
  497. if (defaults.length == 1) {
  498. return;
  499. }
  500. let params = {
  501. children: "",
  502. name: name,
  503. rountPath: path,
  504. target: "_self",
  505. };
  506. let set = new Set([...this.$store.state.tabList, params]);
  507. this.$store.commit("setDefaultActive", path);
  508. this.$store.commit("setTabList", Array.from(set));
  509. },
  510. deletes(val) {
  511. this.centerDialogVisible = true;
  512. this.messTit = "即将作废绩效模板, 是否确定?";
  513. this.dataId = val.id;
  514. // this.$confirm("即将作废部门预算模板, 是否确定?", "提示", {
  515. // confirmButtonText: "确定",
  516. // cancelButtonText: "取消",
  517. // type: "warning",
  518. // })
  519. // .then(() => {
  520. // this.$http({
  521. // url: "/market/pre/cancelPre",
  522. // method: "post",
  523. // headers: {
  524. // "Content-Type": "application/json",
  525. // },
  526. // data: { id: val.id },
  527. // }).then((res) => {
  528. // this.$message({
  529. // message: "删除成功",
  530. // type: "success",
  531. // });
  532. // this.getList(this.params, this.pageSize);
  533. // });
  534. // })
  535. // .catch(() => {});
  536. },
  537. closeMessage(v) {
  538. this.centerDialogVisible = false;
  539. if (v === 1) {
  540. this.$http({
  541. url: "/market/pre/cancelPre",
  542. method: "post",
  543. headers: {
  544. "Content-Type": "application/json",
  545. },
  546. data: { id: this.dataId },
  547. }).then((res) => {
  548. if (res.data.result == "0") {
  549. this.$message({
  550. message: "删除成功",
  551. type: "success",
  552. });
  553. }
  554. this.getList(this.params, this.pageSize);
  555. });
  556. }
  557. },
  558. addExcel() {
  559. this.$router.push("/initExceladd?status=add");
  560. // this.defaultMenu("/initExceladd?status=add", "新增预算模板");
  561. },
  562. updates(val) {
  563. this.$router.push("/initExcelupdate?status=update&id=" + val.id + "");
  564. // this.defaultMenu("/initExcelupdate?status=update", "修改预算模板");
  565. },
  566. //搜索数据
  567. searchInfo(v) {
  568. this.params = {};
  569. v[0] ? (this.params.tempName = v[0]) : "";
  570. this.getList(this.params, this.pageSize);
  571. },
  572. //获取列表
  573. getList(v, n) {
  574. this.loading = true;
  575. this.pageSize = n;
  576. this.$http({
  577. url: "/market/pre/queryPage",
  578. method: "post",
  579. headers: {
  580. "Content-Type": "application/json",
  581. page: '{"pageNo":"' + n + '","pageSize":"10"}',
  582. },
  583. data: v,
  584. }).then((res) => {
  585. this.loading = false;
  586. this.tableData = res.data.data;
  587. this.total = res.data.totalRecord;
  588. });
  589. },
  590. //功能栏
  591. iconCli(v) {
  592. if (v === 1) {
  593. this.getList(this.params, this.pageSize);
  594. }
  595. if (v === 2) {
  596. this.fullscreen = !this.fullscreen;
  597. }
  598. },
  599. // 分页
  600. currchange(v) {
  601. this.pageSize = v;
  602. this.getList(this.params, this.pageSize);
  603. },
  604. getOpations() {
  605. this.$http({
  606. url: "/sysmgr/sys/mk/offices/queryList",
  607. method: "post",
  608. headers: {
  609. "Content-Type": "application/json",
  610. },
  611. data: {},
  612. }).then((res) => {
  613. res.data.body.map((item) => {
  614. this.options.push({
  615. label: item.loginName,
  616. value: item.loginNo,
  617. deptCode: item.groupId,
  618. deptName: item.groupName,
  619. });
  620. });
  621. });
  622. },
  623. },
  624. mounted() {
  625. this.getOpations();
  626. this.getList(this.params, this.pageSize);
  627. // this.getList(this.params, this.pageSize);
  628. },
  629. watch: {
  630. $route() {
  631. this.getList(this.params, this.pageSize);
  632. },
  633. },
  634. };
  635. </script>
  636. <style scoped>
  637. .el-upload-list {
  638. float: right;
  639. }
  640. .el-input__suffix {
  641. cursor: pointer;
  642. }
  643. .container .el-upload {
  644. width: auto !important;
  645. }
  646. </style>
  647. <style scoped lang="scss">
  648. .btn-default {
  649. display: inline;
  650. margin-left: 10px;
  651. }
  652. .titbox {
  653. div {
  654. float: right;
  655. i {
  656. font-size: 22px;
  657. margin-left: 20px;
  658. cursor: pointer;
  659. }
  660. }
  661. }
  662. .tabbox {
  663. margin-top: 15px;
  664. }
  665. .pageBox {
  666. text-align: right;
  667. margin-top: 10px;
  668. }
  669. </style>