index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading" style="width: 100%">
  4. <search-table @search="reload"></search-table>
  5. <!-- 数据表格 -->
  6. <ele-pro-table
  7. ref="table"
  8. :columns="columns"
  9. :datasource="datasource"
  10. height="calc(100vh - 375px)"
  11. full-height="calc(100vh - 116px)"
  12. tool-class="ele-toolbar-form"
  13. :selection.sync="selection"
  14. :page-size="20"
  15. @columns-change="handleColumnChange"
  16. :cache-key="cacheKeyUrl"
  17. >
  18. <!-- 表头工具栏 -->
  19. <template v-slot:toolbar>
  20. <el-button
  21. v-if="$hasPermission('eom:finreceivable:push')"
  22. size="small"
  23. type="primary"
  24. class="ele-btn-icon"
  25. @click="allPushBtn"
  26. :disabled="selection?.length === 0"
  27. >
  28. 批量推送
  29. </el-button>
  30. </template>
  31. <!-- 操作 -->
  32. <template v-slot:action="{ row }">
  33. <!-- <el-link
  34. type="primary"
  35. v-if="[2].includes(row.approvalStatus)&&!row.invoiceId"
  36. :underline="false"
  37. icon="el-icon-plus"
  38. @click="handleDetail(row, 'view')"
  39. >
  40. 新增发票
  41. </el-link> -->
  42. <el-link
  43. type="primary"
  44. v-if="[2].includes(row.approvalStatus)"
  45. :underline="false"
  46. icon="el-icon-plus"
  47. @click="handleCollection(row, 'update')"
  48. >
  49. 收款
  50. </el-link>
  51. <el-link
  52. type="primary"
  53. :underline="false"
  54. icon="el-icon-plus"
  55. @click="sub(row)"
  56. v-if="[0, 3].includes(row.approvalStatus)"
  57. >
  58. 提交
  59. </el-link>
  60. </template>
  61. <!-- 收款信息 -->
  62. <template v-slot:code="{ row }">
  63. <el-link
  64. type="primary"
  65. :underline="false"
  66. @click="handleDetail(row, 'view')"
  67. >
  68. {{ row.code }}
  69. </el-link>
  70. </template>
  71. <!-- 开票信息 -->
  72. <template v-slot:invoiceCode="{ row }">
  73. <el-link
  74. type="primary"
  75. :underline="false"
  76. @click="handleInvoiceDetail(row, 'view')"
  77. >
  78. {{ row.invoiceCode }}
  79. </el-link>
  80. </template>
  81. </ele-pro-table>
  82. </el-card>
  83. <!-- 收款信息-->
  84. <collection-dialog
  85. ref="collectionDialogRef"
  86. v-if="collectionDialogFlag"
  87. :collection-dialog-flag.sync="collectionDialogFlag"
  88. @reload="reload"
  89. ></collection-dialog>
  90. <detail-dialog
  91. ref="detailDialogRef"
  92. v-if="detailDialogFlag"
  93. :detail-dialog-flag.sync="detailDialogFlag"
  94. ></detail-dialog>
  95. <!--开票详情-->
  96. <invoice-detail-dialog
  97. ref="invoiceDetailDialogRef"
  98. v-if="invoiceDetailDialogFlag"
  99. :detailDialogFlag.sync="invoiceDetailDialogFlag"
  100. ></invoice-detail-dialog>
  101. <process-submit-dialog
  102. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  103. isCloseRefresh="false"
  104. v-if="processSubmitDialogFlag"
  105. ref="processSubmitDialogRef"
  106. @reload="reload"
  107. ></process-submit-dialog>
  108. </div>
  109. </template>
  110. <script>
  111. import { reviewStatus } from '@/enum/dict';
  112. import dictMixins from '@/mixins/dictMixins';
  113. import { finReceivablePageListAPI, receivableBill } from '@/api/financialManage/receivableManage';
  114. import collectionDialog from './components/collectionDialog.vue';
  115. import searchTable from './searchTable.vue';
  116. import detailDialog from './components/detailDialog.vue';
  117. import invoiceDetailDialog from '../invoiceManage/components/detailDialog.vue';
  118. import processSubmitDialog from "@/BIZComponents/processSubmitDialog/processSubmitDialog.vue";
  119. import tabMixins from '@/mixins/tableColumnsMixin';
  120. export default {
  121. mixins: [dictMixins,tabMixins],
  122. components: {
  123. searchTable,
  124. collectionDialog,
  125. detailDialog,
  126. invoiceDetailDialog,processSubmitDialog
  127. },
  128. //客户管理数据
  129. props: {
  130. contactData: {
  131. type: Object,
  132. default: () => {
  133. return {};
  134. }
  135. },
  136. saleOrderData: {
  137. type: Object,
  138. default: () => {
  139. return {};
  140. }
  141. }
  142. },
  143. data() {
  144. return {
  145. // 加载状态
  146. loading: false,
  147. collectionDialogFlag: false,
  148. detailDialogFlag: false,
  149. invoiceDetailDialogFlag: false,
  150. processSubmitDialogFlag: false,
  151. selection: [],
  152. statusList: [
  153. {
  154. label: '未收款',
  155. value: 0
  156. },
  157. {
  158. label: '部分收款',
  159. value: 1
  160. },
  161. {
  162. label: '已收全款',
  163. value: 2
  164. }
  165. ],
  166. cacheKeyUrl:'eos-03850924-receivableManage',
  167. columnsVersion:1,
  168. };
  169. },
  170. computed: {
  171. columns() {
  172. // 当columnsVersion变化时会重新计算,用作更新列配置
  173. const version = this.columnsVersion;
  174. return [
  175. {
  176. width: 45,
  177. type: 'selection',
  178. columnKey: 'selection',
  179. align: 'center'
  180. },
  181. {
  182. width: 60,
  183. label: '序号',
  184. type: 'index',
  185. columnKey: 'index',
  186. align: 'center'
  187. },
  188. {
  189. minWidth: 130,
  190. prop: 'code',
  191. label: '应收编码',
  192. align: 'center',
  193. slot: 'code',
  194. showOverflowTooltip: true
  195. },
  196. {
  197. minWidth: 120,
  198. prop: 'invoiceCode',
  199. label: '发票编码',
  200. slot: 'invoiceCode',
  201. align: 'center',
  202. showOverflowTooltip: true
  203. },
  204. {
  205. minWidth: 130,
  206. prop: 'contactName',
  207. label: '公司名称',
  208. align: 'center',
  209. slot: 'contactName',
  210. showOverflowTooltip: true
  211. },
  212. {
  213. minWidth: 140,
  214. prop: 'receivableDate',
  215. label: '应收日期',
  216. slot: 'receivableDate',
  217. align: 'center',
  218. showOverflowTooltip: true
  219. },
  220. {
  221. minWidth: 100,
  222. prop: 'receivableTotalPrice',
  223. label: '应收金额',
  224. align: 'center',
  225. slot: 'receivableTotalPrice',
  226. showOverflowTooltip: true
  227. },
  228. {
  229. minWidth: 100,
  230. prop: 'receivedTotalPrice',
  231. label: '已收金额',
  232. align: 'center',
  233. slot: 'receivedTotalPrice',
  234. showOverflowTooltip: true
  235. },
  236. {
  237. minWidth: 100,
  238. prop: 'unreceiveTotalPrice',
  239. label: '未收金额',
  240. align: 'center',
  241. slot: 'unreceiveTotalPrice',
  242. showOverflowTooltip: true
  243. },
  244. {
  245. minWidth: 100,
  246. prop: 'sourceCode',
  247. label: '来源编码',
  248. align: 'center',
  249. slot: 'sourceCode',
  250. showOverflowTooltip: true
  251. },
  252. {
  253. minWidth: 100,
  254. prop: 'accountingSubjectName',
  255. label: '会计科目',
  256. align: 'center',
  257. slot: 'accountingSubjectName',
  258. showOverflowTooltip: true
  259. },
  260. {
  261. minWidth: 100,
  262. prop: 'status',
  263. label: '收款状态',
  264. align: 'center',
  265. slot: 'status',
  266. showOverflowTooltip: true,
  267. formatter: (_row, _column, cellValue) => {
  268. return this.statusList.find((item) => item.value === cellValue)
  269. .label;
  270. }
  271. },
  272. {
  273. minWidth: 130,
  274. prop: 'remark',
  275. label: '备注',
  276. align: 'center',
  277. showOverflowTooltip: true
  278. },
  279. {
  280. minWidth: 100,
  281. prop: 'createUserName',
  282. label: '创建人',
  283. align: 'center',
  284. slot: 'createTime',
  285. showOverflowTooltip: true
  286. },
  287. {
  288. prop: 'externalId',
  289. label: '是否推送',
  290. align: 'center',
  291. showOverflowTooltip: true,
  292. minWidth: 120,
  293. formatter: (_row, _column, cellValue) => {
  294. return _row.externalId? '已推送' : '未推送';
  295. }
  296. },
  297. {
  298. minWidth: 100,
  299. prop: 'createTime',
  300. label: '创建时间',
  301. align: 'center',
  302. slot: 'createTime',
  303. showOverflowTooltip: true
  304. },
  305. {
  306. minWidth: 100,
  307. prop: 'approvalStatus',
  308. label: '审核状态',
  309. align: 'center',
  310. slot: 'approvalStatus',
  311. formatter: (_row, _column, cellValue) => {
  312. return reviewStatus[_row.approvalStatus];
  313. }
  314. },
  315. {
  316. columnKey: 'action',
  317. label: '操作',
  318. width: 150,
  319. align: 'center',
  320. resizable: false,
  321. slot: 'action',
  322. showOverflowTooltip: true,
  323. fixed: 'right'
  324. }
  325. ];
  326. }
  327. },
  328. created() {},
  329. methods: {
  330. allPushBtn() {
  331. const dataId = this.selection.map((v) => v.id);
  332. receivableBill(dataId).then((res) => {
  333. this.$message.success('推送成功!');
  334. this.reload();
  335. });
  336. },
  337. handleCollection(row = {}, type) {
  338. this.collectionDialogFlag = true;
  339. this.$nextTick(() => {
  340. this.$refs.collectionDialogRef.init(row, type);
  341. });
  342. },
  343. handleDetail(row = {}, type) {
  344. this.detailDialogFlag = true;
  345. this.$nextTick(() => {
  346. this.$refs.detailDialogRef.init(row.id);
  347. });
  348. },
  349. handleInvoiceDetail(row = {}, type) {
  350. this.invoiceDetailDialogFlag = true;
  351. this.$nextTick(() => {
  352. let params = {
  353. id: row.invoiceId
  354. };
  355. this.$refs.invoiceDetailDialogRef.init(params, type);
  356. });
  357. },
  358. /* 表格数据源 */
  359. datasource({ page, limit, where, order }) {
  360. console.log(this.saleOrderData, 'this.saleOrderData');
  361. if (this.contactData.id) {
  362. where['contactId'] = this.contactData.id;
  363. }
  364. if (this.saleOrderData.id) {
  365. where['saleOrderCode'] = this.saleOrderData.orderNo;
  366. }
  367. return finReceivablePageListAPI({
  368. pageNum: page,
  369. size: limit,
  370. ...where
  371. });
  372. },
  373. sub(res) {
  374. this.processSubmitDialogFlag = true;
  375. let params = {
  376. businessId: res.id,
  377. businessKey: 'fin_receivable_approve',
  378. formCreateUserId: res.createUserId,
  379. variables: {
  380. businessCode: res.code,
  381. businessName: res.contactName,
  382. businessType: '应收'
  383. }
  384. };
  385. this.$nextTick(() => {
  386. this.$refs.processSubmitDialogRef.init(params);
  387. });
  388. },
  389. /* 刷新表格 */
  390. reload(where) {
  391. this.$nextTick(() => {
  392. this.$refs.table.reload({ page: 1, where });
  393. });
  394. }
  395. }
  396. };
  397. </script>
  398. <style lang="scss" scoped>
  399. :deep(.el-link--inner) {
  400. margin-left: 0px !important;
  401. }
  402. .sys-organization-list {
  403. height: calc(100vh - 264px);
  404. box-sizing: border-box;
  405. border-width: 1px;
  406. border-style: solid;
  407. overflow: auto;
  408. }
  409. .sys-organization-list :deep(.el-tree-node__content) {
  410. height: 40px;
  411. & > .el-tree-node__expand-icon {
  412. margin-left: 10px;
  413. }
  414. }
  415. </style>