paymentListDialog.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="paymentListDialogFlag"
  6. :title="title"
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. width="60%"
  10. :before-close="cache"
  11. :maxable="true"
  12. :resizable="true"
  13. >
  14. <!-- 数据表格 -->
  15. <ele-pro-table
  16. ref="table"
  17. :columns="columns"
  18. :datasource="datasource"
  19. tool-class="ele-toolbar-form"
  20. cache-key="eomContactPageTable"
  21. :page-size="20"
  22. >
  23. <!-- 操作 -->
  24. <template v-slot:action="{ row }">
  25. <el-link
  26. type="primary"
  27. :underline="false"
  28. icon="el-icon-plus"
  29. v-if="canAddInvoice(row)"
  30. @click="done(row, 'view')"
  31. >
  32. 新增发票
  33. </el-link>
  34. </template>
  35. </ele-pro-table>
  36. <detail-dialog1
  37. ref="detailDialogRef"
  38. v-if="detailDialogFlag1"
  39. :detail-dialog-flag1.sync="detailDialogFlag1"
  40. @done="done"
  41. :isPay="true"
  42. ></detail-dialog1>
  43. <div slot="footer">
  44. <el-button @click="cache">返回</el-button>
  45. </div>
  46. </ele-modal>
  47. </template>
  48. <script>
  49. import { finPayablePageListAPI } from '@/api/financialManage/payableManage';
  50. import detailDialog1 from './detailDialog1.vue';
  51. import { paymentStatus, invoiceStatusOp, transactionMethodsOp } from '@/enum/dict.js';
  52. import { reviewStatus } from '@/enum/dict';
  53. export default {
  54. name: 'collectionDialog',
  55. components: { detailDialog1 },
  56. computed: {
  57. columns() {
  58. // 当columnsVersion变化时会重新计算,用作更新列配置
  59. // const version = this.columnsVersion;
  60. return [
  61. {
  62. width: 45,
  63. type: 'selection',
  64. columnKey: 'selection',
  65. align: 'center'
  66. },
  67. {
  68. width: 60,
  69. label: '序号',
  70. type: 'index',
  71. columnKey: 'index',
  72. align: 'center'
  73. },
  74. {
  75. minWidth: 150,
  76. prop: 'code',
  77. label: '应收编码',
  78. align: 'center',
  79. // slot: 'code',
  80. showOverflowTooltip: true
  81. },
  82. {
  83. minWidth: 160,
  84. prop: 'receiptPlanOrderNo',
  85. label: '收款计划编码',
  86. align: 'center',
  87. slot: 'receiptPlanOrderNo',
  88. showOverflowTooltip: true
  89. },
  90. {
  91. minWidth: 160,
  92. prop: 'saleOrderNo',
  93. label: '订单编码',
  94. align: 'center',
  95. slot: 'saleOrderNo',
  96. showOverflowTooltip: true
  97. },
  98. {
  99. minWidth: 150,
  100. prop: 'contractCode',
  101. label: '合同编码',
  102. align: 'center',
  103. slot: 'contractCode',
  104. showOverflowTooltip: true
  105. },
  106. {
  107. minWidth: 150,
  108. prop: 'contractNo',
  109. label: '合同编号',
  110. align: 'center',
  111. slot: 'contractNo',
  112. showOverflowTooltip: true
  113. },
  114. {
  115. minWidth: 150,
  116. prop: 'contractName',
  117. label: '合同名称',
  118. align: 'center',
  119. slot: 'contactName',
  120. showOverflowTooltip: true
  121. },
  122. {
  123. minWidth: 150,
  124. prop: 'invoiceCode',
  125. label: '关联发票编码',
  126. slot: 'invoiceCode',
  127. align: 'center',
  128. showOverflowTooltip: true
  129. },
  130. {
  131. minWidth: 150,
  132. prop: 'invoiceNos',
  133. label: '发票号',
  134. align: 'center',
  135. slot: 'invoiceNos',
  136. showOverflowTooltip: true
  137. },
  138. {
  139. minWidth: 150,
  140. prop: 'customerNo',
  141. label: '客户编码',
  142. align: 'center',
  143. slot: 'customerNo',
  144. showOverflowTooltip: true
  145. },
  146. {
  147. minWidth: 150,
  148. prop: 'contactName',
  149. label: '客户名称',
  150. align: 'center',
  151. slot: 'contactName',
  152. showOverflowTooltip: true
  153. },
  154. {
  155. minWidth: 130,
  156. prop: 'paymentTypeName',
  157. label: '款项类型',
  158. align: 'center',
  159. slot: 'paymentTypeName',
  160. showOverflowTooltip: true
  161. },
  162. {
  163. minWidth: 100,
  164. prop: 'receivableTotalPrice',
  165. label: '应付金额',
  166. align: 'center',
  167. slot: 'receivableTotalPrice',
  168. showOverflowTooltip: true
  169. },
  170. {
  171. minWidth: 100,
  172. prop: 'receivedTotalPrice',
  173. label: '已付金额',
  174. align: 'center',
  175. slot: 'receivedTotalPrice',
  176. showOverflowTooltip: true
  177. },
  178. {
  179. minWidth: 100,
  180. prop: 'unreceiveTotalPrice',
  181. label: '未付金额',
  182. align: 'center',
  183. slot: 'unreceiveTotalPrice',
  184. showOverflowTooltip: true
  185. },
  186. {
  187. minWidth: 100,
  188. prop: 'invoiceAmount',
  189. label: '已开票金额',
  190. align: 'center',
  191. slot: 'invoiceAmount',
  192. showOverflowTooltip: true
  193. },
  194. {
  195. minWidth: 100,
  196. prop: 'unInvoiceAmount;',
  197. label: '未开票金额',
  198. align: 'center',
  199. slot: 'unInvoiceAmount;',
  200. showOverflowTooltip: true
  201. },
  202. {
  203. minWidth: 140,
  204. prop: 'receivableDate',
  205. label: '实际付款日期',
  206. slot: 'receivableDate',
  207. align: 'center',
  208. showOverflowTooltip: true
  209. },
  210. {
  211. minWidth: 120,
  212. prop: 'createUserName',
  213. label: '创建人',
  214. align: 'center',
  215. slot: 'createUserName',
  216. showOverflowTooltip: true
  217. },
  218. {
  219. minWidth: 120,
  220. prop: 'createTime',
  221. label: '创建时间',
  222. align: 'center',
  223. slot: 'createTime',
  224. showOverflowTooltip: true
  225. },
  226. {
  227. minWidth: 120,
  228. prop: 'accountingSubjectName',
  229. label: '会计科目',
  230. align: 'center',
  231. slot: 'accountingSubjectName',
  232. showOverflowTooltip: true
  233. },
  234. {
  235. prop: 'transactionMode',
  236. label: '交易方式',
  237. align: 'center',
  238. showOverflowTooltip: true,
  239. minWidth: 200,
  240. formatter: (row) => {
  241. return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
  242. }
  243. },
  244. {
  245. prop: 'invoiceStatus',
  246. label: '开票状态',
  247. align: 'center',
  248. showOverflowTooltip: true,
  249. minWidth: 100,
  250. formatter: (_row, _column, cellValue) => {
  251. return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
  252. }
  253. },
  254. {
  255. minWidth: 100,
  256. prop: 'status',
  257. label: '付款状态',
  258. align: 'center',
  259. slot: 'status',
  260. showOverflowTooltip: true,
  261. formatter: (_row, _column, cellValue) => {
  262. return this.paymentType.find((item) => item.value == cellValue)
  263. .label;
  264. }
  265. },
  266. {
  267. minWidth: 130,
  268. prop: 'remark',
  269. label: '备注',
  270. align: 'center',
  271. showOverflowTooltip: true
  272. },
  273. {
  274. prop: 'externalId',
  275. label: '是否推送',
  276. align: 'center',
  277. showOverflowTooltip: true,
  278. minWidth: 120,
  279. formatter: (_row, _column, cellValue) => {
  280. return _row.externalId? '已推送' : '未推送';
  281. }
  282. },
  283. {
  284. minWidth: 100,
  285. prop: 'approvalStatus',
  286. label: '审核状态',
  287. align: 'center',
  288. slot: 'approvalStatus',
  289. formatter: (_row, _column, cellValue) => {
  290. return reviewStatus[_row.approvalStatus];
  291. }
  292. },
  293. {
  294. columnKey: 'action',
  295. label: '操作',
  296. width: 150,
  297. align: 'center',
  298. resizable: false,
  299. slot: 'action',
  300. showOverflowTooltip: true,
  301. fixed: 'right'
  302. }
  303. ];
  304. },
  305. canAddInvoice() {
  306. return function(row) {
  307. if (!row) return false;
  308. return [2].includes(row.approvalStatus) && row.transactionMode == 2 && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
  309. };
  310. }
  311. },
  312. data() {
  313. return {
  314. title: '应付列表',
  315. transactionMethodsOp,
  316. detailDialogFlag1: false,
  317. paymentType,
  318. invoiceStatusOp,
  319. statusList: [
  320. {
  321. label: '未付款',
  322. value: 0
  323. },
  324. {
  325. label: '部分付款',
  326. value: 1
  327. },
  328. {
  329. label: '已付全款',
  330. value: 2
  331. }
  332. ],
  333. };
  334. },
  335. props: {
  336. paymentListDialogFlag: {
  337. type: Boolean,
  338. default: false,
  339. },
  340. },
  341. created() {},
  342. methods: {
  343. handleDetail(row = {}, type) {
  344. this.detailDialogFlag1 = true;
  345. this.$nextTick(() => {
  346. this.$refs.detailDialogRef.init(row.id);
  347. });
  348. },
  349. done(data){
  350. console.log(data,'data')
  351. this.$emit('receivableDone',[data])
  352. this.cache()
  353. },
  354. cache(){
  355. this.$emit('update:paymentListDialogFlag', false)
  356. },
  357. /* 表格数据源 */
  358. datasource({ page, limit, where, order }) {
  359. return finPayablePageListAPI({
  360. pageNum: page,
  361. size: limit,
  362. approvalStatus:2,
  363. transactionMode:2,
  364. ...where
  365. });
  366. }
  367. }
  368. };
  369. </script>
  370. <style scoped lang="scss"></style>