receivableDialog.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. :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="[2].includes(row.approvalStatus)"
  30. @click="handleDetail(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 { finReceivablePageListAPI } from '@/api/financialManage/receivableManage';
  50. import detailDialog1 from './detailDialog1.vue';
  51. export default {
  52. name: 'collectionDialog',
  53. components: { detailDialog1 },
  54. computed: {
  55. columns() {
  56. return [
  57. {
  58. width: 60,
  59. label: '序号',
  60. type: 'index',
  61. columnKey: 'index',
  62. align: 'center'
  63. },
  64. {
  65. minWidth: 130,
  66. prop: 'code',
  67. label: '应收编码',
  68. align: 'center',
  69. slot: 'code',
  70. showOverflowTooltip: true
  71. },
  72. {
  73. minWidth: 130,
  74. prop: 'contactName',
  75. label: '单位名称',
  76. align: 'center',
  77. slot: 'contactName',
  78. showOverflowTooltip: true
  79. },
  80. {
  81. minWidth: 140,
  82. prop: 'receivableDate',
  83. label: '应收日期',
  84. slot: 'receivableDate',
  85. align: 'center',
  86. showOverflowTooltip: true
  87. },
  88. {
  89. minWidth: 100,
  90. prop: 'receivableTotalPrice',
  91. label: '应收金额',
  92. align: 'center',
  93. slot: 'receivableTotalPrice',
  94. showOverflowTooltip: true
  95. },
  96. {
  97. minWidth: 100,
  98. prop: 'receivedTotalPrice',
  99. label: '已收金额',
  100. align: 'center',
  101. slot: 'receivedTotalPrice',
  102. showOverflowTooltip: true
  103. },
  104. {
  105. minWidth: 100,
  106. prop: 'unreceiveTotalPrice',
  107. label: '未收金额',
  108. align: 'center',
  109. slot: 'unreceiveTotalPrice',
  110. showOverflowTooltip: true
  111. },
  112. {
  113. minWidth: 100,
  114. prop: 'sourceCode',
  115. label: '来源编码',
  116. align: 'center',
  117. slot: 'sourceCode',
  118. showOverflowTooltip: true
  119. },
  120. {
  121. minWidth: 100,
  122. prop: 'accountingSubjectName',
  123. label: '会计科目',
  124. align: 'center',
  125. slot: 'accountingSubjectName',
  126. showOverflowTooltip: true
  127. },
  128. {
  129. minWidth: 100,
  130. prop: 'status',
  131. label: '收款状态',
  132. align: 'center',
  133. slot: 'status',
  134. showOverflowTooltip: true,
  135. formatter: (_row, _column, cellValue) => {
  136. return this.statusList.find((item) => item.value === cellValue)
  137. .label;
  138. }
  139. },
  140. {
  141. minWidth: 130,
  142. prop: 'remark',
  143. label: '备注',
  144. align: 'center',
  145. showOverflowTooltip: true
  146. },
  147. {
  148. minWidth: 100,
  149. prop: 'createUserName',
  150. label: '创建人',
  151. align: 'center',
  152. slot: 'createTime',
  153. showOverflowTooltip: true
  154. },
  155. {
  156. minWidth: 100,
  157. prop: 'createTime',
  158. label: '创建时间',
  159. align: 'center',
  160. slot: 'createTime',
  161. showOverflowTooltip: true
  162. },
  163. {
  164. columnKey: 'action',
  165. label: '操作',
  166. width: 150,
  167. align: 'center',
  168. resizable: false,
  169. slot: 'action',
  170. showOverflowTooltip: true,
  171. fixed: 'right'
  172. }
  173. ];
  174. }
  175. },
  176. data() {
  177. return {
  178. detailDialogFlag1: false,
  179. statusList: [
  180. {
  181. label: '未收款',
  182. value: 0
  183. },
  184. {
  185. label: '部分收款',
  186. value: 1
  187. },
  188. {
  189. label: '已收全款',
  190. value: 2
  191. }
  192. ]
  193. };
  194. },
  195. props: {
  196. receivableDialogFlag: {
  197. type: Boolean,
  198. default: false,
  199. },
  200. },
  201. created() {},
  202. methods: {
  203. handleDetail(row = {}, type) {
  204. this.detailDialogFlag1 = true;
  205. this.$nextTick(() => {
  206. this.$refs.detailDialogRef.init(row.id);
  207. });
  208. },
  209. done(data){
  210. console.log(data,'data')
  211. this.$emit('receivableDone',data)
  212. this.cache()
  213. },
  214. cache(){
  215. this.$emit('update:receivableDialogFlag', false)
  216. },
  217. /* 表格数据源 */
  218. datasource({ page, limit, where, order }) {
  219. return finReceivablePageListAPI({
  220. pageNum: page,
  221. size: limit,
  222. // approvalStatus:2,
  223. ...where
  224. });
  225. }
  226. }
  227. };
  228. </script>
  229. <style scoped lang="scss"></style>