budgetList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  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 class="font-ui">部门预算模板管理</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-01 HH:mm:ss">
  215. </el-date-picker>
  216. </el-form-item>
  217. <el-form-item label="接收人" prop="sendNoArr">
  218. <el-select
  219. placeholder="选择接收人"
  220. v-model="formData.sendNoArr"
  221. multiple
  222. filterable
  223. style="width: 100%"
  224. >
  225. <el-option
  226. v-for="items in options"
  227. :key="items.value"
  228. :label="items.label"
  229. :value="items.value"
  230. >
  231. </el-option>
  232. </el-select>
  233. </el-form-item>
  234. <el-form-item label="需要回复" prop="needReply">
  235. <el-select
  236. style="width: 100% !important"
  237. v-model="formData.needReply"
  238. placeholder="请选择是否需要回复">
  239. <el-option label="是" value="是"> </el-option>
  240. <el-option label="否" value="否"> </el-option>
  241. </el-select>
  242. </el-form-item>
  243. </el-form>
  244. <div slot="footer" class="dialog-footer">
  245. <el-button @click="resetUser('ruleForm')">取 消</el-button>
  246. <el-button @click="subUser('ruleForm')">确 定</el-button>
  247. </div>
  248. </el-dialog>
  249. </div>
  250. </template>
  251. <script>
  252. import mySearch from "../../../components/search";
  253. import myMessage from "../../../components/myMessage.vue";
  254. export default {
  255. components: {
  256. mySearch,
  257. myMessage,
  258. },
  259. data() {
  260. return {
  261. centerDialogVisible: false,
  262. messTit: "",
  263. dataId: "",
  264. typeFlag: "",
  265. value1: "",
  266. options: [],
  267. dialogStatus: false,
  268. formData: {
  269. woTitle: "",
  270. woDesc: "",
  271. requiredTime: "",
  272. sendNoArr: "",
  273. sendYear: "",
  274. sendMonth: "",
  275. sendQuarter: "",
  276. needReply: "是",
  277. },
  278. rules: {
  279. woTitle: [
  280. { required: true, message: "请输入预算标题", trigger: "blur" },
  281. ],
  282. woDesc: [
  283. { required: true, message: "请输入预算备注", trigger: "change" },
  284. ],
  285. requiredTime: [
  286. {
  287. required: true,
  288. message: "请选择反馈时间",
  289. trigger: "change",
  290. },
  291. ],
  292. sendNoArr: [
  293. {
  294. required: true,
  295. message: "请选择接收人",
  296. trigger: "change",
  297. },
  298. ],
  299. sendYear: [
  300. {
  301. required: true,
  302. message: "请选择下发年份",
  303. trigger: "change",
  304. },
  305. ],
  306. sendMonth: [
  307. {
  308. required: true,
  309. message: "请选择下发月份",
  310. trigger: "change",
  311. },
  312. ],
  313. sendQuarter: [
  314. {
  315. required: true,
  316. message: "请选择下发季度",
  317. trigger: "change",
  318. },
  319. ],
  320. },
  321. headers: {
  322. agileauthtoken: sessionStorage.agileauthtoken.replace(/"/g, ""),
  323. },
  324. fullscreen: false,
  325. total: 0,
  326. pageSize: 1,
  327. tableData: [
  328. {
  329. name: "黑龙江公司移动成本预算简表",
  330. cNo: "admin",
  331. cUser: "admin",
  332. ctime: "2021-03-10",
  333. status: "已下发",
  334. },
  335. {
  336. name: "黑龙江公司移动成本预算简表1",
  337. cNo: "admin",
  338. cUser: "admin",
  339. ctime: "2021-03-10",
  340. status: "草稿",
  341. },
  342. ],
  343. searchList: [
  344. {
  345. type: "input",
  346. tit: "模板名称",
  347. value: "",
  348. width: "100%",
  349. options: [],
  350. },
  351. // {
  352. // type: "input",
  353. // tit: "创建时间",
  354. // value: "",
  355. // width: "100%",
  356. // options: [],
  357. // },
  358. // {
  359. // type: "input",
  360. // tit: "模板状态",
  361. // value: "",
  362. // width: "100%",
  363. // options: [],
  364. // },
  365. ],
  366. params: {
  367. tempName: "",
  368. },
  369. loading: false,
  370. fileList: [],
  371. fileName: "",
  372. };
  373. },
  374. methods: {
  375. chenckType(val) {
  376. if (val.tempStsDesc == "草稿") {
  377. this.$http({
  378. url: "/market/pre/updateType",
  379. method: "post",
  380. headers: {
  381. "Content-Type": "application/json",
  382. },
  383. data: {
  384. id: val.id,
  385. tempType: val.tempType,
  386. tempTypeDesc: val.tempTypeDesc,
  387. },
  388. }).then((res) => {
  389. this.$message({
  390. message: "操作成功",
  391. type: "success",
  392. });
  393. this.getList(this.params, this.pageSize);
  394. });
  395. }
  396. },
  397. chenck(val) {
  398. if (val.tempStsDesc == "草稿") {
  399. this.$http({
  400. url: "/market/pre/updatePower",
  401. method: "post",
  402. headers: {
  403. "Content-Type": "application/json",
  404. },
  405. data: { id: val.id },
  406. }).then((res) => {
  407. this.$message({
  408. message: "操作成功",
  409. type: "success",
  410. });
  411. this.getList(this.params, this.pageSize);
  412. });
  413. }
  414. },
  415. detailes(val) {
  416. this.$router.push("/initExcelsee?status=see&id=" + val.id + "");
  417. },
  418. // 增加表单处理
  419. subUser(formName) {
  420. let sendNoArr = [];
  421. this.$refs[formName].validate((valid) => {
  422. if (valid) {
  423. this.formData.sendNoArr.map((item) => {
  424. this.options.map((row) => {
  425. if (item == row.value) {
  426. sendNoArr.push({
  427. receiveNo: item,
  428. receiveName: row.label,
  429. deptCode: row.deptCode,
  430. deptName: row.deptName,
  431. });
  432. }
  433. });
  434. });
  435. let data = {
  436. woTitle: this.formData.woTitle,
  437. woDesc: this.formData.woDesc,
  438. requiredTime: this.formData.requiredTime,
  439. sendNoArr: JSON.stringify(sendNoArr),
  440. needReply: this.formData.needReply,
  441. preTempId: this.preTempId,
  442. sendYear: this.typeFlag == "1" ? "" : this.formData.sendYear,
  443. sendMonth: this.formData.sendMonth,
  444. sendQuarter:
  445. this.typeFlag == "1"
  446. ? this.formData.sendYear + "-" + this.formData.sendQuarter
  447. : "",
  448. tempType: this.typeFlag,
  449. funcCode:
  450. this.typeFlag == "0"
  451. ? "1000"
  452. : this.typeFlag == "1"
  453. ? "1004"
  454. : this.typeFlag == "2"
  455. ? "1001"
  456. : this.typeFlag == "3"
  457. ? "1003"
  458. : "",
  459. };
  460. // console.log(data);
  461. this.$http({
  462. url: "/market/pre/pub",
  463. method: "post",
  464. headers: {
  465. "Content-Type": "application/json",
  466. },
  467. data: data,
  468. }).then((res) => {
  469. if (res.data.result == 0) {
  470. this.$message({
  471. type: "success",
  472. message: "下发成功",
  473. });
  474. } else {
  475. this.$message({
  476. type: "error",
  477. message: res.data.desc,
  478. });
  479. }
  480. this.resetUser(formName);
  481. this.dialogStatus = false;
  482. this.getList(this.params, this.pageSize);
  483. });
  484. }
  485. });
  486. },
  487. // 取消提交
  488. resetUser(formName) {
  489. this.$refs[formName].resetFields();
  490. this.dialogStatus = false;
  491. },
  492. closeDialog() {
  493. this.dialogStatus = false;
  494. },
  495. issue(val) {
  496. this.typeFlag = val.tempType;
  497. console.log(this.typeFlag);
  498. this.preTempId = val.id;
  499. this.dialogStatus = true;
  500. },
  501. defaultMenu(path, name) {
  502. let defaults = this.$store.state.tabList.filter((item) => {
  503. if (item.rountPath == path) {
  504. return item;
  505. }
  506. });
  507. if (defaults.length == 1) {
  508. return;
  509. }
  510. let params = {
  511. children: "",
  512. name: name,
  513. rountPath: path,
  514. target: "_self",
  515. };
  516. let set = new Set([...this.$store.state.tabList, params]);
  517. this.$store.commit("setDefaultActive", path);
  518. this.$store.commit("setTabList", Array.from(set));
  519. },
  520. deletes(val) {
  521. this.centerDialogVisible = true;
  522. this.messTit = "即将作废绩效模板, 是否确定?";
  523. this.dataId = val.id;
  524. // this.$confirm("即将作废部门预算模板, 是否确定?", "提示", {
  525. // confirmButtonText: "确定",
  526. // cancelButtonText: "取消",
  527. // type: "warning",
  528. // })
  529. // .then(() => {
  530. // this.$http({
  531. // url: "/market/pre/cancelPre",
  532. // method: "post",
  533. // headers: {
  534. // "Content-Type": "application/json",
  535. // },
  536. // data: { id: val.id },
  537. // }).then((res) => {
  538. // this.$message({
  539. // message: "删除成功",
  540. // type: "success",
  541. // });
  542. // this.getList(this.params, this.pageSize);
  543. // });
  544. // })
  545. // .catch(() => {});
  546. },
  547. closeMessage(v) {
  548. this.centerDialogVisible = false;
  549. if (v === 1) {
  550. this.$http({
  551. url: "/market/pre/cancelPre",
  552. method: "post",
  553. headers: {
  554. "Content-Type": "application/json",
  555. },
  556. data: { id: this.dataId },
  557. }).then((res) => {
  558. if (res.data.result == "0") {
  559. this.$message({
  560. message: "删除成功",
  561. type: "success",
  562. });
  563. }
  564. this.getList(this.params, this.pageSize);
  565. });
  566. }
  567. },
  568. addExcel() {
  569. this.$router.push("/initExceladd?status=add");
  570. // this.defaultMenu("/initExceladd?status=add", "新增预算模板");
  571. },
  572. updates(val) {
  573. this.$router.push("/initExcelupdate?status=update&id=" + val.id + "");
  574. // this.defaultMenu("/initExcelupdate?status=update", "修改预算模板");
  575. },
  576. //搜索数据
  577. searchInfo(v) {
  578. this.params = {};
  579. v[0] ? (this.params.tempName = v[0]) : "";
  580. this.getList(this.params, this.pageSize);
  581. },
  582. //获取列表
  583. getList(v, n) {
  584. this.loading = true;
  585. this.pageSize = n;
  586. this.$http({
  587. url: "/market/pre/queryPage",
  588. method: "post",
  589. headers: {
  590. "Content-Type": "application/json",
  591. page: '{"pageNo":"' + n + '","pageSize":"10"}',
  592. },
  593. data: v,
  594. }).then((res) => {
  595. this.loading = false;
  596. this.tableData = res.data.data;
  597. this.total = res.data.totalRecord;
  598. });
  599. },
  600. //功能栏
  601. iconCli(v) {
  602. if (v === 1) {
  603. this.getList(this.params, this.pageSize);
  604. }
  605. if (v === 2) {
  606. this.fullscreen = !this.fullscreen;
  607. }
  608. },
  609. // 分页
  610. currchange(v) {
  611. this.pageSize = v;
  612. this.getList(this.params, this.pageSize);
  613. },
  614. getOpations() {
  615. this.$http({
  616. url: "/sysmgr/sys/mk/offices/queryList",
  617. method: "post",
  618. headers: {
  619. "Content-Type": "application/json",
  620. },
  621. data: {},
  622. }).then((res) => {
  623. res.data.body.map((item) => {
  624. this.options.push({
  625. label: item.loginName,
  626. value: item.loginNo,
  627. deptCode: item.groupId,
  628. deptName: item.groupName,
  629. });
  630. });
  631. });
  632. },
  633. },
  634. mounted() {
  635. this.getOpations();
  636. this.getList(this.params, this.pageSize);
  637. // this.getList(this.params, this.pageSize);
  638. },
  639. watch: {
  640. $route() {
  641. this.getList(this.params, this.pageSize);
  642. },
  643. },
  644. };
  645. </script>
  646. <style scoped>
  647. .el-upload-list {
  648. float: right;
  649. }
  650. .el-input__suffix {
  651. cursor: pointer;
  652. }
  653. .container .el-upload {
  654. width: auto !important;
  655. }
  656. </style>
  657. <style scoped lang="scss">
  658. .btn-default {
  659. display: inline;
  660. margin-left: 10px;
  661. }
  662. .titbox {
  663. div {
  664. float: right;
  665. i {
  666. font-size: 22px;
  667. margin-left: 20px;
  668. cursor: pointer;
  669. }
  670. }
  671. }
  672. .tabbox {
  673. margin-top: 15px;
  674. }
  675. .pageBox {
  676. text-align: right;
  677. margin-top: 10px;
  678. }
  679. </style>