page.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <template>
  2. <div>
  3. <page-search-table @search="reload"></page-search-table>
  4. <!-- 数据表格 -->
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :datasource="datasource"
  9. height="calc(100vh - 430px)"
  10. full-height="calc(100vh - 116px)"
  11. tool-class="ele-toolbar-form"
  12. :selection.sync="selection"
  13. :page-size="20"
  14. @columns-change="handleColumnChange"
  15. :cache-key="cacheKeyUrl"
  16. >
  17. <!-- 表头工具栏 -->
  18. <template v-slot:toolbar>
  19. <el-button
  20. size="small"
  21. type="primary"
  22. icon="el-icon-plus"
  23. class="ele-btn-icon"
  24. @click="handleAddOrEdit('', 'add')"
  25. >
  26. 新建
  27. </el-button>
  28. <el-button
  29. size="small"
  30. type="danger"
  31. el-icon-delete
  32. class="ele-btn-icon"
  33. @click="allDelBtn"
  34. :disabled="selection?.length === 0"
  35. >
  36. 批量删除
  37. </el-button>
  38. </template>
  39. <!-- 操作 -->
  40. <template v-slot:action="{ row }">
  41. <el-link
  42. type="primary"
  43. v-if="isNeed_process_is_close && [0, 3].includes(row.approvalStatus)"
  44. :underline="false"
  45. icon="el-icon-plus"
  46. @click="sub(row)"
  47. >
  48. 提交
  49. </el-link>
  50. <el-link
  51. type="primary"
  52. v-if="
  53. (isNeed_process_is_close && [0, 3].includes(row.approvalStatus)) ||
  54. !isNeed_process_is_close
  55. "
  56. :underline="false"
  57. icon="el-icon-edit"
  58. @click="handleAddOrEdit(row, 'update')"
  59. >
  60. 修改
  61. </el-link>
  62. <el-popconfirm
  63. v-if="
  64. isNeed_process_is_close &&
  65. [0, 3].includes(row.approvalStatus) &&
  66. !isNeed_process_is_close
  67. "
  68. class="ele-action"
  69. title="确定要删除此信息吗?"
  70. @confirm="remove([row.id])"
  71. >
  72. <template v-slot:reference>
  73. <el-link type="danger" :underline="false" icon="el-icon-delete">
  74. 删除
  75. </el-link>
  76. </template>
  77. </el-popconfirm>
  78. </template>
  79. <template v-slot:applyUserName="{ row }">
  80. <el-link
  81. type="primary"
  82. :underline="false"
  83. @click="handleDetail(row, 'view')"
  84. >
  85. {{ row.applyUserName }}
  86. </el-link>
  87. </template>
  88. </ele-pro-table>
  89. <!-- 多选删除弹窗 -->
  90. <pop-modal
  91. :visible.sync="delVisible"
  92. content="是否确定删除?"
  93. @done="commitBtn"
  94. />
  95. <!-- 新增/修改 -->
  96. <add-or-edit-dialog
  97. v-if="addOrEditDialogFlag"
  98. :addOrEditDialogFlag.sync="addOrEditDialogFlag"
  99. ref="addOrEditDialogRef"
  100. @reload="reload"
  101. ></add-or-edit-dialog>
  102. <detail-dialog
  103. v-if="detailDialogFlag"
  104. :detail-dialog-flag.sync="detailDialogFlag"
  105. ref="detailDialogRef"
  106. ></detail-dialog>
  107. <process-submit-dialog
  108. api-fun-name="finfeeapplyStatusAPI"
  109. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  110. isCloseRefresh="false"
  111. v-if="processSubmitDialogFlag"
  112. ref="processSubmitDialogRef"
  113. @reload="reload"
  114. ></process-submit-dialog>
  115. </div>
  116. </template>
  117. <script>
  118. import popModal from '@/components/pop-modal';
  119. import { reviewStatus } from '@/enum/dict';
  120. import dictMixins from '@/mixins/dictMixins';
  121. import pageSearchTable from './pageSearchTable.vue';
  122. import {
  123. feeApplyPageListAPI,
  124. feeApplyRemoveAPI,
  125. finFeeApplySubmit
  126. } from '@/api/financialManage/fee-manage/fee-application';
  127. import addOrEditDialog from './addOrEditDialog.vue';
  128. import detailDialog from './detailDialog.vue';
  129. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  130. import tabMixins from '@/mixins/tableColumnsMixin';
  131. export default {
  132. mixins: [dictMixins, tabMixins],
  133. components: {
  134. processSubmitDialog,
  135. addOrEditDialog,
  136. pageSearchTable,
  137. popModal,
  138. detailDialog
  139. },
  140. data() {
  141. return {
  142. selection: [],
  143. delVisible: false,
  144. // 加载状态
  145. loading: false,
  146. addOrEditDialogFlag: false,
  147. detailDialogFlag: false,
  148. processSubmitDialogFlag: false,
  149. cacheKeyUrl: 'eos-ef52b03f-feeManage',
  150. columnsVersion: 1
  151. };
  152. },
  153. computed: {
  154. getDicts() {
  155. return (dictName, val) => {
  156. return this.getDictValue(dictName, val);
  157. };
  158. },
  159. columns() {
  160. // 当columnsVersion变化时会重新计算,用作更新列配置
  161. const version = this.columnsVersion;
  162. return [
  163. {
  164. width: 45,
  165. type: 'selection',
  166. columnKey: 'selection',
  167. align: 'center'
  168. },
  169. {
  170. columnKey: 'index',
  171. label: '序号',
  172. type: 'index',
  173. width: 55,
  174. align: 'center',
  175. showOverflowTooltip: true,
  176. fixed: 'left'
  177. },
  178. {
  179. prop: 'applyUserName',
  180. label: '申请人名称',
  181. align: 'center',
  182. showOverflowTooltip: true,
  183. minWidth: 120,
  184. slot: 'applyUserName'
  185. },
  186. {
  187. prop: 'applyDeptName',
  188. label: '申请人部门',
  189. align: 'center',
  190. showOverflowTooltip: true,
  191. minWidth: 130
  192. },
  193. {
  194. prop: 'documentType',
  195. label: '单据类型',
  196. align: 'center',
  197. slot: 'documentType',
  198. showOverflowTooltip: true,
  199. formatter: (_row, _column, cellValue) => {
  200. return this.getDicts('单据类型', cellValue + '');
  201. },
  202. minWidth: 120
  203. },
  204. // {
  205. // prop: 'feeTypeName',
  206. // label: '费用类型',
  207. // align: 'center',
  208. // slot: 'feeType',
  209. // showOverflowTooltip: true,
  210. // minWidth: 120,
  211. // },
  212. // {
  213. // prop: 'accountingSubjectName',
  214. // label: '会计科目名称',
  215. // align: 'center',
  216. // showOverflowTooltip: true,
  217. // minWidth: 140
  218. // },
  219. {
  220. prop: 'amount',
  221. label: '金额',
  222. align: 'center',
  223. showOverflowTooltip: true,
  224. minWidth: 140
  225. },
  226. {
  227. prop: 'approvalStatus',
  228. label: '审核状态',
  229. align: 'center',
  230. showOverflowTooltip: true,
  231. minWidth: 100,
  232. formatter: (_row, _column, cellValue) => {
  233. return reviewStatus[_row.approvalStatus];
  234. }
  235. },
  236. {
  237. prop: 'createUserName',
  238. label: '创建人',
  239. align: 'center',
  240. showOverflowTooltip: true,
  241. minWidth: 80
  242. },
  243. {
  244. prop: 'createTime',
  245. label: '创建时间',
  246. align: 'center',
  247. showOverflowTooltip: true,
  248. minWidth: 160,
  249. formatter: (_row, _column, cellValue) => {
  250. return this.$util.toDateString(cellValue);
  251. }
  252. },
  253. {
  254. columnKey: 'action',
  255. label: '操作',
  256. width: 300,
  257. align: 'center',
  258. resizable: false,
  259. slot: 'action',
  260. showOverflowTooltip: true,
  261. fixed: 'right'
  262. }
  263. ];
  264. }
  265. },
  266. created() {
  267. this.requestDict('客户状态');
  268. },
  269. methods: {
  270. //新增、修改
  271. handleAddOrEdit(row = {}, type) {
  272. this.addOrEditDialogFlag = true;
  273. this.$nextTick(() => {
  274. this.$refs.addOrEditDialogRef.init(row, type);
  275. });
  276. },
  277. //详情
  278. handleDetail(row = {}, type) {
  279. this.detailDialogFlag = true;
  280. this.$nextTick(() => {
  281. this.$refs.detailDialogRef.init(row, type);
  282. });
  283. },
  284. /* 表格数据源 */
  285. datasource({ page, limit, where, order }) {
  286. return feeApplyPageListAPI({
  287. pageNum: page,
  288. size: limit,
  289. ...where
  290. });
  291. },
  292. /* 刷新表格 */
  293. reload(where) {
  294. this.$nextTick(() => {
  295. this.$refs.table.reload({ page: 1, where });
  296. });
  297. },
  298. //批量删除
  299. allDelBtn() {
  300. if (this.selection.length === 0) return;
  301. let flag = this.selection.some((item) =>
  302. [1, 2].includes(item.approvalStatus)
  303. );
  304. if (flag)
  305. return this.$message.warning(
  306. '抱歉已审核、审核中的数据不能删除,请检查'
  307. );
  308. this.delVisible = true;
  309. },
  310. commitBtn() {
  311. const dataId = this.selection.map((v) => v.id);
  312. feeApplyRemoveAPI(dataId).then((res) => {
  313. this.$message.success('删除成功!');
  314. this.reload();
  315. });
  316. },
  317. remove(row) {
  318. feeApplyRemoveAPI(row).then((res) => {
  319. this.$message.success('删除成功!');
  320. this.reload();
  321. });
  322. },
  323. sub(res) {
  324. this.processSubmitDialogFlag = true;
  325. this.$nextTick(() => {
  326. let params = {
  327. businessId: res.id,
  328. businessKey: 'fin_fee_apply',
  329. formCreateUserId: res.createUserId,
  330. variables: {
  331. businessName: this.getDicts('单据类型', res.documentType + ''),
  332. businessType: this.getDicts('单据类型', res.documentType + '')
  333. }
  334. // callBackMethodType : '1',
  335. // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
  336. // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
  337. // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
  338. // miniHandle : '',
  339. // miniView : '',
  340. };
  341. this.$refs.processSubmitDialogRef.init(params);
  342. });
  343. // finFeeApplySubmit({
  344. // businessId: res.id
  345. // })
  346. // .then((res) => {
  347. // this.$message.success('提交成功');
  348. // this.reload();
  349. // })
  350. // .catch((e) => {
  351. // this.$message.error(e.message);
  352. // });
  353. }
  354. }
  355. };
  356. </script>
  357. <style lang="scss" scoped>
  358. :deep(.el-link--inner) {
  359. margin-left: 0px !important;
  360. }
  361. .sys-organization-list {
  362. height: calc(100vh - 264px);
  363. box-sizing: border-box;
  364. border-width: 1px;
  365. border-style: solid;
  366. overflow: auto;
  367. }
  368. .sys-organization-list :deep(.el-tree-node__content) {
  369. height: 40px;
  370. & > .el-tree-node__expand-icon {
  371. margin-left: 10px;
  372. }
  373. }
  374. </style>