gaoluyang
9 天以前 173855b299e89930b5ea2ff9a9295fde9d0f55b5
src/views/crm/invoice/data.ts
@@ -6,8 +6,12 @@
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';
@@ -146,14 +150,37 @@
    {
      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',
@@ -178,6 +205,13 @@
      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',
@@ -286,6 +320,12 @@
      minWidth: 150,
    },
    {
      title: '发票录入',
      field: 'entryStatus',
      minWidth: 110,
      slots: { default: 'entryStatus' },
    },
    {
      title: '开票金额(元)',
      field: 'price',
      minWidth: 150,