| | |
| | | import { useUserStore } from '@vben/stores'; |
| | | |
| | | import { getContractSimpleList } from '#/api/crm/contract'; |
| | | import { getSaleOrderPage } from '#/api/erp/sale/order'; |
| | | import { getSimpleUserList } from '#/api/system/user'; |
| | | import CrmCustomerSelect from '#/components/crm-customer-select.vue'; |
| | | |
| | | import PaymentNodesEditor from './modules/payment-nodes-editor.vue'; |
| | | import SaleOutSelect from './modules/sale-out-select.vue'; |
| | | |
| | | import { markRaw } from 'vue'; |
| | | |
| | |
| | | { |
| | | fieldName: 'saleOrderId', |
| | | label: '销售订单号', |
| | | component: 'Input', |
| | | componentProps: { placeholder: '请输入或关联销售订单号' }, |
| | | component: 'ApiSelect', |
| | | componentProps: (_values, form) => ({ |
| | | placeholder: '请选择已审核的销售订单', |
| | | allowClear: true, |
| | | showSearch: true, |
| | | api: async () => { |
| | | const result = await getSaleOrderPage({ |
| | | pageNo: 1, |
| | | pageSize: 200, |
| | | status: 20, |
| | | customerId: form.getValues().customerId, |
| | | }); |
| | | return result.list; |
| | | }, |
| | | labelField: 'no', |
| | | valueField: 'id', |
| | | onChange: () => { |
| | | form.setFieldValue('saleOutId', undefined); |
| | | }, |
| | | }), |
| | | }, |
| | | { |
| | | fieldName: 'saleOutId', |
| | | label: '出库单号', |
| | | component: 'Input', |
| | | componentProps: { placeholder: '请输入或关联出库单号' }, |
| | | component: markRaw(SaleOutSelect), |
| | | help: '选择销售订单后,从该订单已完成出库的单据中选择;不选也可保存', |
| | | componentProps: (values) => ({ |
| | | saleOrderId: values.saleOrderId, |
| | | id: values.id, |
| | | placeholder: '请选择出库单', |
| | | }), |
| | | }, |
| | | { |
| | | fieldName: 'contractAmount', |
| | |
| | | label: '验收款金额', |
| | | component: 'InputNumber', |
| | | componentProps: { class: '!w-full', min: 0, precision: 2 }, |
| | | }, |
| | | { |
| | | fieldName: 'paymentNodes', |
| | | label: '款项时间节点', |
| | | component: markRaw(PaymentNodesEditor), |
| | | formItemClass: 'md:col-span-2', |
| | | help: '按合同约定填写各阶段计划金额与计划回款时间,录入发票时还能补填已回款情况', |
| | | }, |
| | | { |
| | | fieldName: 'invoiceTime', |
| | |
| | | minWidth: 150, |
| | | }, |
| | | { |
| | | title: '发票录入', |
| | | field: 'entryStatus', |
| | | minWidth: 110, |
| | | slots: { default: 'entryStatus' }, |
| | | }, |
| | | { |
| | | title: '开票金额(元)', |
| | | field: 'price', |
| | | minWidth: 150, |