ERP:增加 ERP 销售订单的实现 90%

(cherry picked from commit f7c5266015)
This commit is contained in:
YunaiV 2024-02-10 21:48:15 +08:00 committed by shizhong
parent 03c7e2167e
commit f8b686fbc4
16 changed files with 67 additions and 3 deletions

View File

@ -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 })

View File

@ -29,6 +29,7 @@
<el-form-item label="客户" prop="customerId">
<el-select
v-model="formData.customerId"
clearable
filterable
placeholder="请选择客户"
class="!w-1/1"
@ -93,6 +94,24 @@
<el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结算账户" prop="accountId">
<el-select
v-model="formData.accountId"
clearable
filterable
placeholder="请选择结算账户"
class="!w-1/1"
>
<el-option
v-for="item in accountList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收取订金" prop="depositPrice">
<el-input-number
@ -119,7 +138,8 @@
import { SaleOrderApi, SaleOrderVO } from '@/api/erp/sale/order'
import SaleOrderItemForm from './components/SaleOrderItemForm.vue'
import { CustomerApi, CustomerVO } from '@/api/erp/sale/customer'
import { erpPriceInputFormatter, erpPriceMultiply, getSumValue } from '@/utils'
import { AccountApi, AccountVO } from '@/api/erp/finance/account'
import { erpPriceInputFormatter, erpPriceMultiply } from '@/utils'
/** ERP 销售订单表单 */
defineOptions({ name: 'SaleOrderForm' })
@ -134,6 +154,7 @@ const formType = ref('') // 表单的类型create - 新增update - 修改
const formData = ref({
id: undefined,
customerId: undefined,
accountId: undefined,
orderTime: undefined,
remark: undefined,
fileUrl: '',
@ -151,6 +172,7 @@ const formRules = reactive({
const disabled = computed(() => formType.value === 'detail')
const formRef = ref() // Ref
const customerList = ref<CustomerVO[]>([]) //
const accountList = ref<AccountVO[]>([]) //
/** 子表的表单 */
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,

View File

@ -15,6 +15,7 @@
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
<el-select
v-model="row.productId"
clearable
filterable
@change="onChangeProduct($event, row)"
placeholder="请选择产品"

View File

@ -47,6 +47,7 @@
<el-form-item label="客户" prop="customerId">
<el-select
v-model="queryParams.customerId"
clearable
filterable
placeholder="请选择供客户"
class="!w-240px"
@ -62,6 +63,7 @@
<el-form-item label="创建人" prop="creator">
<el-select
v-model="queryParams.creator"
clearable
filterable
placeholder="请选择创建人"
class="!w-240px"

View File

@ -19,6 +19,7 @@
>
<el-select
v-model="row.warehouseId"
clearable
filterable
placeholder="请选择仓库名字"
@change="onChangeWarehouse($event, row)"
@ -38,6 +39,7 @@
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
<el-select
v-model="row.productId"
clearable
filterable
@change="onChangeProduct($event, row)"
placeholder="请选择产品"

View File

@ -47,6 +47,7 @@
<el-form-item label="仓库" prop="warehouseId">
<el-select
v-model="queryParams.warehouseId"
clearable
filterable
placeholder="请选择仓库"
class="!w-240px"
@ -62,6 +63,7 @@
<el-form-item label="创建人" prop="creator">
<el-select
v-model="queryParams.creator"
clearable
filterable
placeholder="请选择创建人"
class="!w-240px"

View File

@ -29,6 +29,7 @@
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="formData.supplierId"
clearable
filterable
placeholder="请选择供应商"
class="!w-1/1"

View File

@ -19,6 +19,7 @@
>
<el-select
v-model="row.warehouseId"
clearable
filterable
placeholder="请选择仓库"
@change="onChangeWarehouse($event, row)"
@ -38,6 +39,7 @@
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
<el-select
v-model="row.productId"
clearable
filterable
@change="onChangeProduct($event, row)"
placeholder="请选择产品"

View File

@ -47,6 +47,7 @@
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="queryParams.supplierId"
clearable
filterable
placeholder="请选择供应商"
class="!w-240px"
@ -62,6 +63,7 @@
<el-form-item label="仓库" prop="warehouseId">
<el-select
v-model="queryParams.warehouseId"
clearable
filterable
placeholder="请选择仓库"
class="!w-240px"
@ -77,6 +79,7 @@
<el-form-item label="创建人" prop="creator">
<el-select
v-model="queryParams.creator"
clearable
filterable
placeholder="请选择创建人"
class="!w-240px"

View File

@ -19,6 +19,7 @@
>
<el-select
v-model="row.fromWarehouseId"
clearable
filterable
placeholder="请选择调出仓库"
@change="onChangeWarehouse($event, row)"
@ -40,7 +41,12 @@
:rules="formRules.toWarehouseId"
class="mb-0px!"
>
<el-select v-model="row.toWarehouseId" filterable placeholder="请选择调入仓库">
<el-select
v-model="row.toWarehouseId"
clearable
filterable
placeholder="请选择调入仓库"
>
<el-option
v-for="item in warehouseList"
:key="item.id"
@ -56,6 +62,7 @@
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
<el-select
v-model="row.productId"
clearable
filterable
@change="onChangeProduct($event, row)"
placeholder="请选择产品"

View File

@ -20,7 +20,7 @@
<el-form-item label="产品" prop="productId">
<el-select
v-model="queryParams.productId"
productId
clearable
filterable
placeholder="请选择产品"
class="!w-240px"
@ -47,6 +47,7 @@
<el-form-item label="仓库" prop="fromWarehouseId">
<el-select
v-model="queryParams.fromWarehouseId"
clearable
filterable
placeholder="请选择仓库"
class="!w-240px"
@ -62,6 +63,7 @@
<el-form-item label="创建人" prop="creator">
<el-select
v-model="queryParams.creator"
clearable
filterable
placeholder="请选择创建人"
class="!w-240px"

View File

@ -29,6 +29,7 @@
<el-form-item label="客户" prop="customerId">
<el-select
v-model="formData.customerId"
clearable
filterable
placeholder="请选择客户"
class="!w-1/1"

View File

@ -19,6 +19,7 @@
>
<el-select
v-model="row.warehouseId"
clearable
filterable
placeholder="请选择仓库"
@change="onChangeWarehouse($event, row)"
@ -38,6 +39,7 @@
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
<el-select
v-model="row.productId"
clearable
filterable
@change="onChangeProduct($event, row)"
placeholder="请选择产品"

View File

@ -47,6 +47,7 @@
<el-form-item label="客户" prop="customerId">
<el-select
v-model="queryParams.customerId"
clearable
filterable
placeholder="请选择供客户"
class="!w-240px"
@ -62,6 +63,7 @@
<el-form-item label="仓库" prop="warehouseId">
<el-select
v-model="queryParams.warehouseId"
clearable
filterable
placeholder="请选择仓库"
class="!w-240px"
@ -77,6 +79,7 @@
<el-form-item label="创建人" prop="creator">
<el-select
v-model="queryParams.creator"
clearable
filterable
placeholder="请选择创建人"
class="!w-240px"

View File

@ -28,6 +28,7 @@
<el-form-item label="仓库" prop="warehouseId">
<el-select
v-model="queryParams.warehouseId"
clearable
filterable
placeholder="请选择仓库"
class="!w-240px"

View File

@ -28,6 +28,7 @@
<el-form-item label="仓库" prop="warehouseId">
<el-select
v-model="queryParams.warehouseId"
clearable
filterable
placeholder="请选择仓库"
class="!w-240px"