Просмотр исходного кода

售后管理新增解决字段回显问题

hezhanp 8 месяцев назад
Родитель
Сommit
86a7b5a076

+ 43 - 15
src/views/salesServiceManagement/components/info.vue

@@ -335,13 +335,20 @@
       </el-col>
     </el-row>
 
-    <spareInfo
+    <!-- <spareInfo
       ref="spareInfoRef"
       :types="type"
       v-if="form.part == 1"
       title="配件信息"
       :detailList="detailList"
-    />
+    /> -->
+    <spareParts
+  ref="sparePartsRef"
+  :type="type"    
+  :source="source"      
+  obtain="仓库"        
+  v-if="form.part == 1"
+/>
     <div class="after_sales_target" v-if="salesShow">
       <headerTitle
         title="售后对象"
@@ -863,7 +870,9 @@ import parentList from '@/views/saleManage/contact/components/parentList.vue';
 import invoiceDialog from './invoiceDialog.vue';
 import SaleorderDialog from './saleorderDialog.vue';
 import ProductDialog from './productDialog.vue';
-import spareInfo from '@/views/salesServiceManagement/accessory/components/spareInfo.vue';
+// import spareInfo from '@/views/salesServiceManagement/accessory/components/spareInfo.vue';
+
+import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
 import { getToken } from '@/utils/token-util';
 
 import processSubmitDialog from '@/views/salesServiceManagement/components/processSubmitDialog/processSubmitDialog.vue';
@@ -876,8 +885,9 @@ export default {
     SaleorderDialog,
     fileMain,
     ProductDialog,
-    spareInfo,
-    processSubmitDialog
+    // spareInfo,
+    processSubmitDialog,
+    spareParts
   },
   computed: {
     ...mapGetters(['getDictValue']),
@@ -1288,12 +1298,19 @@ export default {
   },
   created() {},
   methods: {
+    // getSpareInfoData() {
+    //   if (this.$refs.spareInfoRef) {
+    //     return this.$refs.spareInfoRef.getSpareData() || [];
+    //   }
+    //   return [];
+    // },
     getSpareInfoData() {
-      if (this.$refs.spareInfoRef) {
-        return this.$refs.spareInfoRef.getSpareData() || [];
-      }
-      return [];
-    },
+  if (this.$refs.sparePartsRef) {
+    // 调用spareParts的getTableValue获取配件列表数据
+    return this.$refs.sparePartsRef.getTableValue() || [];
+  }
+  return [];
+},
     async init(res) {
       // 原有字段初始化
       let productDetail = res.productDetail ? res.productDetail : [];
@@ -1319,15 +1336,26 @@ export default {
         this.isOrder = true;
       }
 
-      // 核心修复:回显字段赋值
-      this.$set(this.form, 'aftertype', res.afterSalesType ?? '');
+      this.$set(
+        this.form,
+        'aftertype',
+        res.afterSalesType ? String(res.afterSalesType) : ''
+      );
       this.$set(this.form, 'charge', res.isFee ?? '');
       this.$set(this.form, 'part', res.isWithAccessories ?? '');
       this.$set(this.form, 'car', res.isPieCar ?? '');
-      this.$set(this.form, 'pietype', res.pieCarType ?? '');
-      
-      // 配件数据回显:从后端res.costListVOS获取并赋值给detailList
+      this.$set(
+        this.form,
+        'pietype',
+        res.pieCarType ? String(res.pieCarType) : ''
+      );
+
       this.$set(this, 'detailList', res.costListVOS || []);
+       this.$nextTick(() => {
+    if (this.$refs.sparePartsRef && this.detailList.length > 0) {
+      this.$refs.sparePartsRef.setTableValue(this.detailList);
+    }
+  });
     },
     getValue() {
       return this.form;

+ 1 - 1
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -83,7 +83,7 @@
               size="small"
               type="primary"
               style="margin-left: 4px"
-              @click.native="addEquipment(row, scope.$index)"
+              @click.native="addEquipment(scope.row, scope.$index)"
               >选择</el-button
             >
           </el-form-item>

+ 1 - 0
src/views/salesServiceManagement/toDoList/components/plan-search.vue

@@ -124,6 +124,7 @@
     methods: {
       /* 搜索 */
       search(e) {
+        console.log(e)
         this.$emit('search', {
           ...e
         });

+ 1 - 1
src/views/salesServiceManagement/toDoList/index.vue

@@ -242,7 +242,7 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return getSalesPlan({ pageNum: page, size: limit, ...where });
+        return getSalesPlan({ pageNum: page, size: limit, });
       },
       /* 刷新表格 */
       reload(where) {

+ 17 - 0
src/views/salesServiceManagement/vehiclerecord/index.vue

@@ -36,6 +36,23 @@ export default {
       pietypeList: [],
       deptResList: [], // 部门
       deptIdToNameMap: {},
+      statusList:[
+        {
+          value:1,
+          label:'处理中'
+        },
+        
+        {
+          value:2,
+          label:'通过'
+        },
+        
+        {
+          value:3,
+          label:'不通过'
+        },
+        
+      ],
       // 加载状态
       loading: false
     };