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

解决售后服务页面报错

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

+ 7 - 10
src/views/salesServiceManagement/components/info.vue

@@ -869,7 +869,6 @@ import ProductDialog from './productDialog.vue';
 import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
 import { getToken } from '@/utils/token-util';
 import processSubmitDialog from '@/views/salesServiceManagement/components/processSubmitDialog/processSubmitDialog.vue';
-// 新增:导入字典接口(用于获取售后/派车类型)
 import { getByCode } from '@/api/system/dictionary-data';
 
 export default {
@@ -1202,10 +1201,9 @@ export default {
       type: Array,
       default: () => []
     }
-    // 删除:不再接收父组件传递的 aftertypeList 和 pietypeList
   },
   watch: {
-    // 保留:仅监听需求名称列表(父组件仍传递)
+    // 仅监听需求名称列表
     demandList: {
       handler(val) {
         this.demandList = val;
@@ -1213,7 +1211,6 @@ export default {
       deep: true,
       immediate: true
     }
-    // 删除:删除对 aftertypeList 和 pietypeList 的监听(已自行维护)
   },
   data() {
     return {
@@ -1224,7 +1221,7 @@ export default {
           return time.getTime() < new Date().setHours(0, 0, 0, 0);
         }
       },
-      detailList: [], // 配件数据列表(用于回显)
+      detailList: [], // 配件数据列表
       chargeList: [
         { label: '是', value: 1 },
         { label: '否', value: 0 }
@@ -1270,18 +1267,18 @@ export default {
       processSubmitDialogFlag: false,
       formSchema: {},
       carFormData: {},
-      // 新增:自行维护售后类型和派车类型列表
+      // 自行维护售后类型和派车类型列表
       aftertypeList: [],
       pietypeList: []
     };
   },
   created() {
-    // 新增:页面创建时主动获取售后类型和派车类型
+    // 页面创建时主动获取售后类型和派车类型
     this.getAftertypeCode('after_sales_type');
     this.getPietypeCode('pie_car_type');
   },
   methods: {
-    // 新增:获取售后类型字典(原父组件的 getaftertypeCode 逻辑)
+    // 获取售后类型字典
     async getAftertypeCode(code) {
       try {
         const res = await getByCode(code);
@@ -1297,7 +1294,7 @@ export default {
         this.$message.error(err.message);
       }
     },
-    // 新增:获取派车类型字典(原父组件的 getpietypeCode 逻辑)
+    // 获取派车类型字典
     async getPietypeCode(code) {
       try {
         const res = await getByCode(code);
@@ -1586,7 +1583,7 @@ export default {
       );
       this.$set(this.form, 'tableList', list);
     },
-    // 添加故障(独立故障列表)
+    // 添加故障
     addFaults() {
       this.form.faultDetailList.push({
         maintenanceProcess: '',

+ 2 - 12
src/views/salesServiceManagement/demandList/components/addDialog.vue

@@ -10,7 +10,6 @@
     append-to-body
     @close="handleClose"
   >
-    <!-- 移除:不再传递 aftertypeList 和 pietypeList  props -->
     <info
       ref="infoRef"
       :demandList="demandList"
@@ -51,7 +50,6 @@ import modalTitle from '@/BIZComponents/modalTitle.vue';
 import customerDialog from '@/views/financialManage/components/customerListDialog.vue';
 import SubmitDialog from './submitDialog.vue';
 import dispatchDialog from './dispatchDialog.vue';
-// 删除:不再导入 getByCode(info 组件已自行导入)
 import {
   saveSalesDemand,
   updateSalesDemand,
@@ -59,6 +57,7 @@ import {
 } from '@/api/salesServiceManagement/index';
 
 import info from '@/views/salesServiceManagement/components/info.vue';
+import { getByCode } from '@/api/system/dictionary-data';
 
 export default {
   components: {
@@ -78,19 +77,16 @@ export default {
       addRepairNotesDialog: false,
       type: 'add',
       form: {},
-      // 删除:不再维护 aftertypeList 和 pietypeList(info 组件自行维护)
       demandList: [],
       loading: false
     };
   },
   created() {
-    // 保留:仅获取需求名称字典
     this.getLevelCode('requirement_name');
-    // 删除:删除售后类型和派车类型的获取调用
   },
   methods: {
-    // 保留:获取需求名称字典(原逻辑不变)
     async getLevelCode(code) {
+      console.log(code)
       try {
         const res = await getByCode(code);
         if (res.code == 0) {
@@ -108,10 +104,6 @@ export default {
         this.$message.error(err.message);
       }
     },
-    // 删除:删除 getaftertypeCode 方法(info 组件已自行实现)
-    // 删除:删除 getpietypeCode 方法(info 组件已自行实现)
-
-    // 初始化弹窗(父组件调用)
     init(row, type) {
       this.addRepairNotesDialog = true;
       this.type = type;
@@ -122,7 +114,6 @@ export default {
       }
     },
 
-    // 提交(打开提交弹窗)
     async submit() {
       let pData = await this.handleParameter();
       if (!pData) {
@@ -130,7 +121,6 @@ export default {
       }
       this.$refs.submitRef.open(pData, this.type);
     },
-    // 派单(打开派单弹窗)
     async dispatch() {
       let pData = await this.handleParameter();
       if (!pData) {