diff --git a/src/api/erp/finance/account/index.ts b/src/api/erp/finance/account/index.ts index 85b90080..a62b1807 100644 --- a/src/api/erp/finance/account/index.ts +++ b/src/api/erp/finance/account/index.ts @@ -18,6 +18,11 @@ export const AccountApi = { return await request.get({ url: `/erp/account/page`, params }) }, + // 查询结算账户精简列表 + getAccountSimpleList: async () => { + return await request.get({ url: `/erp/account/simple-list` }) + }, + // 查询结算账户详情 getAccount: async (id: number) => { return await request.get({ url: `/erp/account/get?id=` + id }) diff --git a/src/views/erp/sale/order/SaleOrderForm.vue b/src/views/erp/sale/order/SaleOrderForm.vue index 16e7ffbd..fab99f59 100644 --- a/src/views/erp/sale/order/SaleOrderForm.vue +++ b/src/views/erp/sale/order/SaleOrderForm.vue @@ -29,6 +29,7 @@ + + + + + + + formType.value === 'detail') const formRef = ref() // 表单 Ref const customerList = ref([]) // 客户列表 +const accountList = ref([]) // 账户列表 /** 子表的表单 */ const subTabsName = ref('item') @@ -189,6 +211,12 @@ const open = async (type: string, id?: number) => { } // 加载客户列表 customerList.value = await CustomerApi.getCustomerSimpleList() + // 加载账户列表 + accountList.value = await AccountApi.getAccountSimpleList() + const defaultAccount = accountList.value.find((item) => item.defaultStatus) + if (defaultAccount) { + formData.value.accountId = defaultAccount.id + } } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 @@ -222,6 +250,7 @@ const resetForm = () => { formData.value = { id: undefined, customerId: undefined, + accountId: undefined, orderTime: undefined, remark: undefined, fileUrl: undefined, diff --git a/src/views/erp/sale/order/components/SaleOrderItemForm.vue b/src/views/erp/sale/order/components/SaleOrderItemForm.vue index 4b034ac6..0422dc75 100644 --- a/src/views/erp/sale/order/components/SaleOrderItemForm.vue +++ b/src/views/erp/sale/order/components/SaleOrderItemForm.vue @@ -15,6 +15,7 @@ - +