|
|
@@ -188,7 +188,7 @@
|
|
|
<div class="form-item-tip">A10产品名称由系统自动拼接:品牌 + 规格型号 + 【描述】 + (单位:单位),无需手动填写</div>
|
|
|
</el-form-item>
|
|
|
|
|
|
-
|
|
|
+
|
|
|
<!-- 商品描述 -->
|
|
|
<el-form-item label="商品描述:">
|
|
|
<el-input
|
|
|
@@ -389,18 +389,6 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <!-- 主供应商 -->
|
|
|
- <el-form-item label="主供应商:" prop="supplierNo" required>
|
|
|
- <el-select v-model="(productForm as any).supplierNo" placeholder="请选择" clearable class="w-full" value-key="id">
|
|
|
- <el-option
|
|
|
- v-for="option in supplierOptions"
|
|
|
- :key="option.id"
|
|
|
- :label="`${option.supplierNo},${option.enterpriseName}`"
|
|
|
- :value="String(option.id)"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
<!-- 售后服务 -->
|
|
|
<el-form-item label="售后服务:">
|
|
|
<el-select v-model="productForm.afterSalesService" placeholder="请选择" clearable class="w-full">
|
|
|
@@ -520,41 +508,6 @@
|
|
|
</el-form>
|
|
|
</el-card>
|
|
|
|
|
|
- <!-- 采购信息 -->
|
|
|
- <el-card v-show="currentStep === 1" shadow="never" class="step-card mt-3">
|
|
|
- <template #header>
|
|
|
- <span class="text-lg font-bold">采购信息</span>
|
|
|
- </template>
|
|
|
-
|
|
|
- <el-form ref="purchaseInfoFormRef" :model="productForm" :rules="productRules" label-width="120px" class="product-info-form">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="产品经理:" prop="purchaseManagerNo" required>
|
|
|
- <el-select v-model="productForm.purchaseManagerNo" placeholder="请选择" clearable class="w-full" value-key="staffId">
|
|
|
- <el-option
|
|
|
- v-for="option in staffOptions"
|
|
|
- :key="option.staffId"
|
|
|
- :label="`${option.staffCode},${option.staffName}`"
|
|
|
- :value="String(option.staffId)"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="采购人员:" prop="purchaseNo" required>
|
|
|
- <el-select v-model="productForm.purchaseNo" placeholder="请选择" clearable class="w-full" value-key="staffId">
|
|
|
- <el-option
|
|
|
- v-for="option in staffOptions"
|
|
|
- :key="option.staffId"
|
|
|
- :label="`${option.staffCode},${option.staffName}`"
|
|
|
- :value="String(option.staffId)"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </el-card>
|
|
|
<!-- 自定义属性 -->
|
|
|
<el-card v-show="currentStep === 1" shadow="never" class="step-card mt-3">
|
|
|
<template #header>
|
|
|
@@ -1089,7 +1042,6 @@ const productRules = {
|
|
|
// productNo: [{ required: true, message: '商品编号不能为空', trigger: 'blur' }],
|
|
|
itemName: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
|
|
|
brandId: [{ required: true, message: '商品品牌不能为空', trigger: 'change' }],
|
|
|
- supplierNo: [{ required: true, message: '主供应商不能为空', trigger: 'change' }],
|
|
|
marketPrice: [{ required: true, message: '市场价不能为空', trigger: 'blur' }],
|
|
|
memberPrice: [{ required: true, message: '官网价不能为空', trigger: 'blur' }],
|
|
|
minSellingPrice: [{ required: true, message: '最低售价不能为空', trigger: 'blur' }],
|
|
|
@@ -1108,8 +1060,6 @@ const productRules = {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
],
|
|
|
- purchaseNo: [{ required: true, message: '采购人员不能为空', trigger: 'change' }],
|
|
|
- purchaseManagerNo: [{ required: true, message: '产品经理不能为空', trigger: 'change' }],
|
|
|
taxRate: [{ required: true, message: '税率不能为空', trigger: 'change' }],
|
|
|
minOrderQuantity: [{ required: true, message: '最低起订量不能为空', trigger: 'blur' }]
|
|
|
};
|
|
|
@@ -1131,8 +1081,6 @@ const serviceGuaranteeOptions = ref<any[]>([]);
|
|
|
// 单位选项
|
|
|
const unitOptions = ref<any[]>([]);
|
|
|
|
|
|
-// 主供应商选项
|
|
|
-const supplierOptions = ref<InfoVO[]>([]);
|
|
|
|
|
|
// 自定义属性列表
|
|
|
const diyAttributesList = ref<ClassificationDiyForm[]>([]);
|
|
|
@@ -1147,8 +1095,6 @@ const removeDiyAttribute = (index: number) => {
|
|
|
diyAttributesList.value.splice(index, 1);
|
|
|
};
|
|
|
|
|
|
-// 采购人员选项
|
|
|
-const staffOptions = ref<ComStaffVO[]>([]);
|
|
|
|
|
|
// 搜索关键词
|
|
|
const searchLevel1 = ref('');
|
|
|
@@ -1299,8 +1245,6 @@ const selectLevel3 = async (item: categoryTreeVO) => {
|
|
|
categoryForm.bottomCategoryId = item.id;
|
|
|
selectedLevel3Name.value = item.label;
|
|
|
|
|
|
- // 联动填充产品经理与采购人员(从三级分类详情获取)
|
|
|
- await fillPurchaseFromCategory(item.id);
|
|
|
|
|
|
// 加载该分类下的属性列表
|
|
|
await loadCategoryAttributes(item.id);
|
|
|
@@ -1320,7 +1264,7 @@ const fillPurchaseFromCategory = async (categoryId: string | number, category?:
|
|
|
productForm.purchaseManagerNo = detail.purchaseManagerNo || undefined;
|
|
|
productForm.purchaseManagerName = detail.purchaseManagerName || undefined;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
} catch (e) {
|
|
|
console.error('获取三级分类采购信息失败:', e);
|
|
|
}
|
|
|
@@ -1804,41 +1748,7 @@ const getUnitOptions = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-// 获取主供应商列表
|
|
|
-const getSupplierOptions = async () => {
|
|
|
- try {
|
|
|
- const res = await listInfo();
|
|
|
- console.log('供应商接口返回:', res);
|
|
|
- // 处理可能的数据结构: res.data 或 res.rows
|
|
|
- const dataList = res.data || res.rows || [];
|
|
|
- supplierOptions.value = dataList;
|
|
|
- console.log('供应商列表:', supplierOptions.value);
|
|
|
- // 如果有选项且当前没有选中值,设置第一个为默认值
|
|
|
- if (supplierOptions.value.length > 0 && !(productForm as any).supplierNo) {
|
|
|
- (productForm as any).supplierNo = String(supplierOptions.value[0].id);
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('获取主供应商列表失败:', error);
|
|
|
- }
|
|
|
-};
|
|
|
|
|
|
-// 获取采购人员列表
|
|
|
-const getStaffOptions = async () => {
|
|
|
- try {
|
|
|
- const res = await listComStaff();
|
|
|
- console.log('采购人员接口返回:', res);
|
|
|
- // 处理可能的数据结构: res.data 或 res.rows
|
|
|
- const dataList = res.data || res.rows || [];
|
|
|
- staffOptions.value = dataList;
|
|
|
- console.log('采购人员列表:', staffOptions.value);
|
|
|
- // 如果有选项且当前没有选中值,设置第一个为默认值
|
|
|
- if (staffOptions.value.length > 0 && !productForm.purchasingPersonnel) {
|
|
|
- productForm.purchasingPersonnel = String(staffOptions.value[0].staffId);
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('获取采购人员列表失败:', error);
|
|
|
- }
|
|
|
-};
|
|
|
|
|
|
// 加载分类属性列表
|
|
|
const loadCategoryAttributes = async (categoryId: string | number) => {
|
|
|
@@ -1902,10 +1812,6 @@ const loadProductDetail = async () => {
|
|
|
const res = await getBase(id as string);
|
|
|
Object.assign(productForm, res.data);
|
|
|
|
|
|
- // 回显产品经理 - 确保转换为字符串类型以匹配下拉框的value
|
|
|
- if (res.data.productNature !== undefined && res.data.productNature !== null) {
|
|
|
- productForm.productNature = String(res.data.productNature);
|
|
|
- }
|
|
|
|
|
|
// 回显采购人员 - 确保转换为字符串类型以匹配下拉框的value
|
|
|
if (res.data.purchasingPersonnel !== undefined && res.data.purchasingPersonnel !== null) {
|