✨ 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 })
|
return await request.get({ url: `/erp/account/page`, params })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 查询结算账户精简列表
|
||||||
|
getAccountSimpleList: async () => {
|
||||||
|
return await request.get({ url: `/erp/account/simple-list` })
|
||||||
|
},
|
||||||
|
|
||||||
// 查询结算账户详情
|
// 查询结算账户详情
|
||||||
getAccount: async (id: number) => {
|
getAccount: async (id: number) => {
|
||||||
return await request.get({ url: `/erp/account/get?id=` + id })
|
return await request.get({ url: `/erp/account/get?id=` + id })
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
<el-form-item label="客户" prop="customerId">
|
<el-form-item label="客户" prop="customerId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.customerId"
|
v-model="formData.customerId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择客户"
|
placeholder="请选择客户"
|
||||||
class="!w-1/1"
|
class="!w-1/1"
|
||||||
@ -93,6 +94,24 @@
|
|||||||
<el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
|
<el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-col :span="8">
|
||||||
<el-form-item label="收取订金" prop="depositPrice">
|
<el-form-item label="收取订金" prop="depositPrice">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
@ -119,7 +138,8 @@
|
|||||||
import { SaleOrderApi, SaleOrderVO } from '@/api/erp/sale/order'
|
import { SaleOrderApi, SaleOrderVO } from '@/api/erp/sale/order'
|
||||||
import SaleOrderItemForm from './components/SaleOrderItemForm.vue'
|
import SaleOrderItemForm from './components/SaleOrderItemForm.vue'
|
||||||
import { CustomerApi, CustomerVO } from '@/api/erp/sale/customer'
|
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 销售订单表单 */
|
/** ERP 销售订单表单 */
|
||||||
defineOptions({ name: 'SaleOrderForm' })
|
defineOptions({ name: 'SaleOrderForm' })
|
||||||
@ -134,6 +154,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
customerId: undefined,
|
customerId: undefined,
|
||||||
|
accountId: undefined,
|
||||||
orderTime: undefined,
|
orderTime: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
fileUrl: '',
|
fileUrl: '',
|
||||||
@ -151,6 +172,7 @@ const formRules = reactive({
|
|||||||
const disabled = computed(() => formType.value === 'detail')
|
const disabled = computed(() => formType.value === 'detail')
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const customerList = ref<CustomerVO[]>([]) // 客户列表
|
const customerList = ref<CustomerVO[]>([]) // 客户列表
|
||||||
|
const accountList = ref<AccountVO[]>([]) // 账户列表
|
||||||
|
|
||||||
/** 子表的表单 */
|
/** 子表的表单 */
|
||||||
const subTabsName = ref('item')
|
const subTabsName = ref('item')
|
||||||
@ -189,6 +211,12 @@ const open = async (type: string, id?: number) => {
|
|||||||
}
|
}
|
||||||
// 加载客户列表
|
// 加载客户列表
|
||||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
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 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
@ -222,6 +250,7 @@ const resetForm = () => {
|
|||||||
formData.value = {
|
formData.value = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
customerId: undefined,
|
customerId: undefined,
|
||||||
|
accountId: undefined,
|
||||||
orderTime: undefined,
|
orderTime: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
fileUrl: undefined,
|
fileUrl: undefined,
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.productId"
|
v-model="row.productId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="onChangeProduct($event, row)"
|
@change="onChangeProduct($event, row)"
|
||||||
placeholder="请选择产品"
|
placeholder="请选择产品"
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
<el-form-item label="客户" prop="customerId">
|
<el-form-item label="客户" prop="customerId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.customerId"
|
v-model="queryParams.customerId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择供客户"
|
placeholder="请选择供客户"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -62,6 +63,7 @@
|
|||||||
<el-form-item label="创建人" prop="creator">
|
<el-form-item label="创建人" prop="creator">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.creator"
|
v-model="queryParams.creator"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择创建人"
|
placeholder="请选择创建人"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.warehouseId"
|
v-model="row.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库名字"
|
placeholder="请选择仓库名字"
|
||||||
@change="onChangeWarehouse($event, row)"
|
@change="onChangeWarehouse($event, row)"
|
||||||
@ -38,6 +39,7 @@
|
|||||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.productId"
|
v-model="row.productId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="onChangeProduct($event, row)"
|
@change="onChangeProduct($event, row)"
|
||||||
placeholder="请选择产品"
|
placeholder="请选择产品"
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
<el-form-item label="仓库" prop="warehouseId">
|
<el-form-item label="仓库" prop="warehouseId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.warehouseId"
|
v-model="queryParams.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -62,6 +63,7 @@
|
|||||||
<el-form-item label="创建人" prop="creator">
|
<el-form-item label="创建人" prop="creator">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.creator"
|
v-model="queryParams.creator"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择创建人"
|
placeholder="请选择创建人"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
<el-form-item label="供应商" prop="supplierId">
|
<el-form-item label="供应商" prop="supplierId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.supplierId"
|
v-model="formData.supplierId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择供应商"
|
placeholder="请选择供应商"
|
||||||
class="!w-1/1"
|
class="!w-1/1"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.warehouseId"
|
v-model="row.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
@change="onChangeWarehouse($event, row)"
|
@change="onChangeWarehouse($event, row)"
|
||||||
@ -38,6 +39,7 @@
|
|||||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.productId"
|
v-model="row.productId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="onChangeProduct($event, row)"
|
@change="onChangeProduct($event, row)"
|
||||||
placeholder="请选择产品"
|
placeholder="请选择产品"
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
<el-form-item label="供应商" prop="supplierId">
|
<el-form-item label="供应商" prop="supplierId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.supplierId"
|
v-model="queryParams.supplierId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择供应商"
|
placeholder="请选择供应商"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -62,6 +63,7 @@
|
|||||||
<el-form-item label="仓库" prop="warehouseId">
|
<el-form-item label="仓库" prop="warehouseId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.warehouseId"
|
v-model="queryParams.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -77,6 +79,7 @@
|
|||||||
<el-form-item label="创建人" prop="creator">
|
<el-form-item label="创建人" prop="creator">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.creator"
|
v-model="queryParams.creator"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择创建人"
|
placeholder="请选择创建人"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.fromWarehouseId"
|
v-model="row.fromWarehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择调出仓库"
|
placeholder="请选择调出仓库"
|
||||||
@change="onChangeWarehouse($event, row)"
|
@change="onChangeWarehouse($event, row)"
|
||||||
@ -40,7 +41,12 @@
|
|||||||
:rules="formRules.toWarehouseId"
|
:rules="formRules.toWarehouseId"
|
||||||
class="mb-0px!"
|
class="mb-0px!"
|
||||||
>
|
>
|
||||||
<el-select v-model="row.toWarehouseId" filterable placeholder="请选择调入仓库">
|
<el-select
|
||||||
|
v-model="row.toWarehouseId"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择调入仓库"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in warehouseList"
|
v-for="item in warehouseList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@ -56,6 +62,7 @@
|
|||||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.productId"
|
v-model="row.productId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="onChangeProduct($event, row)"
|
@change="onChangeProduct($event, row)"
|
||||||
placeholder="请选择产品"
|
placeholder="请选择产品"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<el-form-item label="产品" prop="productId">
|
<el-form-item label="产品" prop="productId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.productId"
|
v-model="queryParams.productId"
|
||||||
productId
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择产品"
|
placeholder="请选择产品"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -47,6 +47,7 @@
|
|||||||
<el-form-item label="仓库" prop="fromWarehouseId">
|
<el-form-item label="仓库" prop="fromWarehouseId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.fromWarehouseId"
|
v-model="queryParams.fromWarehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -62,6 +63,7 @@
|
|||||||
<el-form-item label="创建人" prop="creator">
|
<el-form-item label="创建人" prop="creator">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.creator"
|
v-model="queryParams.creator"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择创建人"
|
placeholder="请选择创建人"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
<el-form-item label="客户" prop="customerId">
|
<el-form-item label="客户" prop="customerId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.customerId"
|
v-model="formData.customerId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择客户"
|
placeholder="请选择客户"
|
||||||
class="!w-1/1"
|
class="!w-1/1"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.warehouseId"
|
v-model="row.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
@change="onChangeWarehouse($event, row)"
|
@change="onChangeWarehouse($event, row)"
|
||||||
@ -38,6 +39,7 @@
|
|||||||
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
<el-form-item :prop="`${$index}.productId`" :rules="formRules.productId" class="mb-0px!">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.productId"
|
v-model="row.productId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="onChangeProduct($event, row)"
|
@change="onChangeProduct($event, row)"
|
||||||
placeholder="请选择产品"
|
placeholder="请选择产品"
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
<el-form-item label="客户" prop="customerId">
|
<el-form-item label="客户" prop="customerId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.customerId"
|
v-model="queryParams.customerId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择供客户"
|
placeholder="请选择供客户"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -62,6 +63,7 @@
|
|||||||
<el-form-item label="仓库" prop="warehouseId">
|
<el-form-item label="仓库" prop="warehouseId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.warehouseId"
|
v-model="queryParams.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@ -77,6 +79,7 @@
|
|||||||
<el-form-item label="创建人" prop="creator">
|
<el-form-item label="创建人" prop="creator">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.creator"
|
v-model="queryParams.creator"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择创建人"
|
placeholder="请选择创建人"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
<el-form-item label="仓库" prop="warehouseId">
|
<el-form-item label="仓库" prop="warehouseId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.warehouseId"
|
v-model="queryParams.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
<el-form-item label="仓库" prop="warehouseId">
|
<el-form-item label="仓库" prop="warehouseId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.warehouseId"
|
v-model="queryParams.warehouseId"
|
||||||
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
|
Loading…
Reference in New Issue
Block a user