✨ ERP:增加 ERP 销售订单的实现 90%
This commit is contained in:
parent
b25d9c0f09
commit
f7c5266015
@ -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 })
|
||||
|
@ -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,
|
||||
|
@ -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="请选择产品"
|
||||
|
@ -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"
|
||||
|
@ -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="请选择产品"
|
||||
|
@ -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"
|
||||
|
@ -29,6 +29,7 @@
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select
|
||||
v-model="formData.supplierId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择供应商"
|
||||
class="!w-1/1"
|
||||
|
@ -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="请选择产品"
|
||||
|
@ -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"
|
||||
|
@ -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="请选择产品"
|
||||
|
@ -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"
|
||||
|
@ -29,6 +29,7 @@
|
||||
<el-form-item label="客户" prop="customerId">
|
||||
<el-select
|
||||
v-model="formData.customerId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择客户"
|
||||
class="!w-1/1"
|
||||
|
@ -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="请选择产品"
|
||||
|
@ -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"
|
||||
|
@ -28,6 +28,7 @@
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="queryParams.warehouseId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择仓库"
|
||||
class="!w-240px"
|
||||
|
@ -28,6 +28,7 @@
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select
|
||||
v-model="queryParams.warehouseId"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择仓库"
|
||||
class="!w-240px"
|
||||
|
Loading…
Reference in New Issue
Block a user