瀏覽代碼

修改单位回显

hurx 3 月之前
父節點
當前提交
bedd9c802e

+ 2 - 2
src/api/customer/customerFile/customerDept/types.ts

@@ -2,7 +2,7 @@ export interface CustomerDeptVO {
   /**
    * ID
    */
-  id: string | number;
+  deptId: string | number;
 
   /**
    * 部门编号
@@ -114,7 +114,7 @@ export interface CustomerDeptForm extends BaseEntity {
   /**
    * ID
    */
-  id?: string | number;
+  deptId?: string | number;
 
   /**
    * 部门编号

+ 1 - 1
src/views/order/orderMain/components/chooseProduct.vue

@@ -60,7 +60,7 @@
       <el-table-column label="税率" width="100">
         <template #default="scope"> 增值税{{ formatTaxRate(scope.row.taxRate) }}% </template>
       </el-table-column>
-      <el-table-column prop="unit" label="单位" width="80" />
+      <el-table-column prop="unitName" label="单位" width="80" />
       <el-table-column prop="minSellingPrice" label="最低售价" width="100" />
       <el-table-column prop="minOrderQuantity" label="起订量" width="100" />
       <el-table-column prop="memberPrice" label="含税单价" width="100" />

+ 9 - 8
src/views/order/orderMain/index.vue

@@ -132,7 +132,7 @@
           <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.id" :label="dept.deptName" :value="dept.id" />
+                <el-option v-for="dept in customerDeptList" :key="dept.deptId" :label="dept.deptName" :value="dept.deptId" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -175,8 +175,8 @@
         <div class="card-header">
           <span>收货地址</span>
           <div>
-            <el-button type="primary" plain @click="addAddress">添加收货地址</el-button>
             <el-button type="primary" plain @click="chooseAddress">选择收货地址</el-button>
+            <el-button type="primary" plain @click="addAddress">添加收货地址</el-button>
           </div>
         </div>
       </template>
@@ -237,7 +237,7 @@
         <el-table-column prop="taxRate" label="税率" align="center">
           <template #default="scope"> 增值税{{ scope.row.taxRate }}% </template>
         </el-table-column>
-        <el-table-column prop="unit" label="单位" align="center" />
+        <el-table-column prop="unitName" label="单位" align="center" />
         <el-table-column prop="certificatePrice" label="最低售价" align="center" />
         <el-table-column prop="minOrderQuantity" label="起订量" align="center" />
         <el-table-column prop="unitPrice" label="含税单价" align="center">
@@ -266,7 +266,7 @@
         <el-table-column label="操作" align="center">
           <template #default="scope">
             <el-button link type="danger" size="small" @click="handleDeleteProduct(scope.$index)">删除</el-button>
-            <el-button link type="danger" size="small" @click="handleSelect(scope.$index)">查询</el-button>
+            <el-button link type="primary" size="small" @click="handleSelect(scope.$index)">查询</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -482,6 +482,7 @@ const initFormData: OrderMainForm = {
   userNo: undefined,
   status: undefined,
   remark: undefined,
+  isSplitChild: '1',
   customerSalesInfoVo: {
     salesPerson: '',
     serviceStaff: '',
@@ -616,7 +617,7 @@ const submitForm = () => {
           productId: product.id,
           productNo: product.productCode, // 产品编号
           productName: product.productName, // 产品名称
-          productUnit: product.unit, // 产品单位
+          productUnit: product.unitName, // 产品单位
           productImage: product.productImage, // 产品图片
           platformPrice: product.price, // 平台价格(单价)
           marketPrice: product.marketPrice,
@@ -714,7 +715,7 @@ const handleAddProduct = () => {
 };
 
 /** 确认选择商品 */
-const handleProductConfirm = (product: BaseVO) => {
+const handleProductConfirm = (product: any) => {
   // 将商品添加到商品列表,按照新的字段映射
   const newProduct = {
     id: product.id,
@@ -723,13 +724,13 @@ const handleProductConfirm = (product: BaseVO) => {
     productName: product.itemName, // 产品信息
     taxRate: product.taxRate || 0, // 税率
     marketPrice: product.marketPrice || 0,
-    unit: product.unitId, // 单位
+    unitName: product.unitName, // 单位
     price: product.standardPrice || 0, // 单价(使用平档价)
     certificatePrice: product.minSellingPrice || 0, // 最低售价
     minOrderQuantity: product.minOrderQuantity || 1, // 起订量
     unitPrice: product.memberPrice || 0, // 含税单价(默认使用最低售价)
     quantity: product.minOrderQuantity || 1, // 数量(默认使用起订量)
-    amount: ((product.certificatePrice || 0) * (product.minOrderQuantity || 1)).toFixed(2) // 小计 = 含税单价 × 数量
+    amount: ((product.memberPrice || 0) * (product.minOrderQuantity || 1)).toFixed(2) // 小计 = 含税单价 × 数量
   };
   productList.value.push(newProduct);
   proxy?.$modal.msgSuccess('添加商品成功');