|
|
@@ -131,9 +131,14 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="下单部门" prop="userDept">
|
|
|
- <el-select v-model="form.userDept" placeholder="请选择" style="width: 100%" :disabled="!form.customerId">
|
|
|
- <el-option v-for="dept in customerDeptList" :key="dept.deptId" :label="dept.deptName" :value="dept.deptId" />
|
|
|
- </el-select>
|
|
|
+ <el-tree-select
|
|
|
+ v-model="form.userDept"
|
|
|
+ :data="customerDeptList"
|
|
|
+ :props="{ value: 'deptId', label: 'deptName', children: 'children' } as any"
|
|
|
+ value-key="deptId"
|
|
|
+ placeholder="选择下单部门"
|
|
|
+ check-strictly
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -294,7 +299,7 @@
|
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
<div class="text-center mt-4">
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
+ <!-- <el-button @click="cancel">取消</el-button> -->
|
|
|
<el-button type="primary" :loading="buttonLoading" @click="submitForm">确定</el-button>
|
|
|
</div>
|
|
|
|
|
|
@@ -316,8 +321,7 @@
|
|
|
import { listOrderMain, getOrderMain, delOrderMain, addOrderMain, updateOrderMain } from '@/api/order/orderMain';
|
|
|
import { OrderMainVO, OrderMainQuery, OrderMainForm } from '@/api/order/orderMain/types';
|
|
|
import { listCompany } from '@/api/company/company';
|
|
|
-import { listCustomerDept } from '@/api/customer/customerFile/customerDept';
|
|
|
-import { CustomerDeptVO } from '@/api/customer/customerFile/customerDept/types';
|
|
|
+import { listCustomerDept } from '@/api/system/dept';
|
|
|
import { CompanyVO } from '@/api/company/company/types';
|
|
|
import { listWarehouse, getWarehouse } from '@/api/company/warehouse';
|
|
|
import { WarehouseVO, WarehouseQuery } from '@/api/company/warehouse/types';
|
|
|
@@ -329,7 +333,6 @@ import ChooseAddress from './components/chooseAddress.vue';
|
|
|
import AddAddress from './components/addressDialog.vue';
|
|
|
import ChooseProduct from './components/chooseProduct.vue';
|
|
|
import SelectProductDetail from './components/selectProductDetail.vue';
|
|
|
-import { BaseVO } from '@/api/product/base/types';
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { order_status, fee_type, pay_method } = toRefs<any>(proxy?.useDict('order_status', 'fee_type', 'pay_method'));
|
|
|
@@ -348,6 +351,12 @@ const dialog = reactive<DialogOption>({
|
|
|
title: ''
|
|
|
});
|
|
|
|
|
|
+interface DeptOptionsType {
|
|
|
+ deptId: number | string;
|
|
|
+ deptName: string;
|
|
|
+ children: DeptOptionsType[];
|
|
|
+}
|
|
|
+
|
|
|
// 商品列表数据
|
|
|
const productList = ref([]);
|
|
|
|
|
|
@@ -407,7 +416,7 @@ const customerList = ref<CustomerInfoVO[]>([]);
|
|
|
const customerLoading = ref(false);
|
|
|
|
|
|
// 客户部门列表
|
|
|
-const customerDeptList = ref<CustomerDeptVO[]>([]);
|
|
|
+const customerDeptList = ref<DeptOptionsType[]>([]);
|
|
|
|
|
|
const addressList = ref<ShippingAddressVO[]>([]);
|
|
|
|
|
|
@@ -894,10 +903,9 @@ const handleCustomerChange = async (customerId: string | number) => {
|
|
|
/** 获取客户部门列表 */
|
|
|
const getCustomerDeptList = async (customerId: string | number) => {
|
|
|
try {
|
|
|
- const res = await listCustomerDept({
|
|
|
- customerId: customerId
|
|
|
- });
|
|
|
- customerDeptList.value = res.rows || [];
|
|
|
+ const res = await listCustomerDept(customerId);
|
|
|
+ const data = proxy?.handleTree<DeptOptionsType>(res.data, 'deptId');
|
|
|
+ customerDeptList.value = data;
|
|
|
} catch (error) {
|
|
|
console.error('获取客户部门列表失败:', error);
|
|
|
customerDeptList.value = [];
|