receivableDialog.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="receivableDialogFlag"
  6. :title="title"
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. width="60%"
  10. :before-close="cancel"
  11. >
  12. <!-- 数据表格 -->
  13. <ele-pro-table
  14. ref="table"
  15. :columns="columns"
  16. :datasource="datasource"
  17. tool-class="ele-toolbar-form"
  18. cache-key="eomContactPageTable"
  19. :page-size="20"
  20. >
  21. <!-- 操作 -->
  22. <template v-slot:action="{ row }">
  23. <el-link
  24. type="primary"
  25. :underline="false"
  26. icon="el-icon-plus"
  27. @click="handleDetail(row, 'view')"
  28. >
  29. 新增发票
  30. </el-link>
  31. </template>
  32. </ele-pro-table>
  33. <detail-dialog
  34. ref="detailDialogRef"
  35. v-if="detailDialogFlag"
  36. :detail-dialog-flag.sync="detailDialogFlag"
  37. @done="done"
  38. :isPay="true"
  39. ></detail-dialog>
  40. <div slot="footer">
  41. <el-button @click="cache">返回</el-button>
  42. </div>
  43. </ele-modal>
  44. </template>
  45. <script>
  46. import { finReceivablePageListAPI } from '@/api/financialManage/receivableManage';
  47. import detailDialog from './detailDialog.vue';
  48. export default {
  49. name: 'collectionDialog',
  50. components: { detailDialog },
  51. computed: {
  52. columns() {
  53. return [
  54. {
  55. width: 60,
  56. label: '序号',
  57. type: 'index',
  58. columnKey: 'index',
  59. align: 'center'
  60. },
  61. {
  62. minWidth: 130,
  63. prop: 'code',
  64. label: '应收编码',
  65. align: 'center',
  66. slot: 'code',
  67. showOverflowTooltip: true
  68. },
  69. {
  70. minWidth: 130,
  71. prop: 'contactName',
  72. label: '单位名称',
  73. align: 'center',
  74. slot: 'contactName',
  75. showOverflowTooltip: true
  76. },
  77. {
  78. minWidth: 140,
  79. prop: 'receivableDate',
  80. label: '应收日期',
  81. slot: 'receivableDate',
  82. align: 'center',
  83. showOverflowTooltip: true
  84. },
  85. {
  86. minWidth: 100,
  87. prop: 'receivableTotalPrice',
  88. label: '应收金额',
  89. align: 'center',
  90. slot: 'receivableTotalPrice',
  91. showOverflowTooltip: true
  92. },
  93. {
  94. minWidth: 100,
  95. prop: 'receivedTotalPrice',
  96. label: '已收金额',
  97. align: 'center',
  98. slot: 'receivedTotalPrice',
  99. showOverflowTooltip: true
  100. },
  101. {
  102. minWidth: 100,
  103. prop: 'unreceiveTotalPrice',
  104. label: '未收金额',
  105. align: 'center',
  106. slot: 'unreceiveTotalPrice',
  107. showOverflowTooltip: true
  108. },
  109. {
  110. minWidth: 100,
  111. prop: 'sourceCode',
  112. label: '来源编码',
  113. align: 'center',
  114. slot: 'sourceCode',
  115. showOverflowTooltip: true
  116. },
  117. {
  118. minWidth: 100,
  119. prop: 'accountingSubjectName',
  120. label: '会计科目',
  121. align: 'center',
  122. slot: 'accountingSubjectName',
  123. showOverflowTooltip: true
  124. },
  125. {
  126. minWidth: 100,
  127. prop: 'status',
  128. label: '收款状态',
  129. align: 'center',
  130. slot: 'status',
  131. showOverflowTooltip: true,
  132. formatter: (_row, _column, cellValue) => {
  133. return this.statusList.find((item) => item.value === cellValue)
  134. .label;
  135. }
  136. },
  137. {
  138. minWidth: 130,
  139. prop: 'remark',
  140. label: '备注',
  141. align: 'center',
  142. showOverflowTooltip: true
  143. },
  144. {
  145. minWidth: 100,
  146. prop: 'createUserName',
  147. label: '创建人',
  148. align: 'center',
  149. slot: 'createTime',
  150. showOverflowTooltip: true
  151. },
  152. {
  153. minWidth: 100,
  154. prop: 'createTime',
  155. label: '创建时间',
  156. align: 'center',
  157. slot: 'createTime',
  158. showOverflowTooltip: true
  159. },
  160. {
  161. columnKey: 'action',
  162. label: '操作',
  163. width: 150,
  164. align: 'center',
  165. resizable: false,
  166. slot: 'action',
  167. showOverflowTooltip: true,
  168. fixed: 'right'
  169. }
  170. ];
  171. }
  172. },
  173. data() {
  174. return {
  175. detailDialogFlag: false,
  176. statusList: [
  177. {
  178. label: '未收款',
  179. value: 0
  180. },
  181. {
  182. label: '部分收款',
  183. value: 1
  184. },
  185. {
  186. label: '已收全款',
  187. value: 2
  188. }
  189. ]
  190. };
  191. },
  192. created() {},
  193. methods: {
  194. handleDetail(row = {}, type) {
  195. this.detailDialogFlag = true;
  196. this.$nextTick(() => {
  197. this.$refs.detailDialogRef.init(row.id);
  198. });
  199. },
  200. done(data){
  201. this.$emit('payableManage',data)
  202. this.cache()
  203. },
  204. cache(){
  205. this.$emit('update:receivableDialogFlag', false)
  206. },
  207. /* 表格数据源 */
  208. datasource({ page, limit, where, order }) {
  209. return finReceivablePageListAPI({
  210. pageNum: page,
  211. size: limit,
  212. approvalStatus:2,
  213. ...where
  214. });
  215. }
  216. }
  217. };
  218. </script>
  219. <style scoped lang="scss"></style>