page.vue 8.1 KB

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