Jelajahi Sumber

售后工单 修改据 不能修改方案已存在数据 善据

8521520123jsy 1 tahun lalu
induk
melakukan
347a9488d4
1 mengubah file dengan 43 tambahan dan 10 penghapusan
  1. 43 10
      src/views/salesServiceManagement/components/sparePartsList.vue

+ 43 - 10
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -25,8 +25,9 @@
               placeholder="请选择"
               class="w100"
               @change="typeIdChange(scope.row, scope.$index)"
-              :disabled="type == 'view' || scope.row.isApply == 1"
+              :disabled="schemeTableTool(scope.row)"
             >
+              <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
               <el-option
                 v-for="item in typeIdList"
                 :key="item.value"
@@ -115,7 +116,7 @@
             style="margin-bottom: 20px"
             :prop="'tableList.' + scope.$index + '.content'"
           >
-            <el-input v-model="scope.row.content" :disabled="type == 'view'"></el-input>
+            <el-input v-model="scope.row.content" :disabled="inputOperate(scope.row)"></el-input>
           </el-form-item>
         </template>
         <template v-slot:totalCount="scope">
@@ -126,10 +127,11 @@
             <el-input
               v-model="scope.row.totalCount"
               @input="totalCountChange(scope.$index,scope.row,'totalCount')"
-              :disabled="type == 'view' || scope.row.isApply == 1"
+              :disabled="schemeTableTool(scope.row)"
               type="number"
               :min="1"
             ></el-input>
+            <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
           </el-form-item>
         </template>
         <template v-slot:measureUnit="scope">
@@ -157,7 +159,7 @@
             <el-input
               v-model="scope.row.singlePrice"
               @input="totalCountChange(scope.$index,scope.row,'singlePrice')"
-              :disabled="type == 'view'"
+              :disabled="inputOperate(scope.row)"
               type="number"
               :min="0"
             ></el-input>
@@ -175,7 +177,7 @@
               v-model="scope.row.warehouseId"
               placeholder="请选择仓库"
               class="w100"
-              :disabled="type == 'view' || scope.row.isApply == 1"
+              :disabled="schemeTableTool(scope.row)"
             >
               <el-option
                 v-for="item in scope.row.warehouseList"
@@ -184,6 +186,7 @@
                 :label="item.warehouseName"
                 :value="item.warehouseId"
               ></el-option>
+              <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
             </el-select>
             <el-input v-model="scope.row.warehouseName" disabled v-else></el-input>
           </el-form-item>
@@ -196,8 +199,9 @@
               v-model="scope.row.warehouseId"
               placeholder="请选择仓库"
               class="w100"
-              :disabled="type == 'view' || scope.row.isApply == 1"
+              :disabled="schemeTableTool(scope.row)"
             >
+              <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
               <el-option
                 v-for="item in scope.row.warehouseList"
                 @click="warehouseChange(item, scope.row, scope.$index)"
@@ -273,8 +277,13 @@ export default {
       default: () => []
     },
     obtain: {
-      type: '',
+      type: String,
       default: '主数据'
+    },
+    // 是否是报工修改进入
+    isReportEdit: {
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -429,6 +438,9 @@ export default {
         if (this.source == '配件回收') {
           return true;
         }
+        if (scope.row.id && this.state == '可操作') {
+          return false;
+        }
         let flag =
           scope.row.typeId == 2 &&
           scope.row.isApply != 1 &&
@@ -445,7 +457,7 @@ export default {
       let flag = this.type != 'view' && this.source != '报工信息';
       return flag;
     },
-    // 故障列表删除权限
+    // 方案列表删除权限
     schemeOperate() {
       return (row) => {
         if (this.source == '配件回收') {
@@ -458,6 +470,27 @@ export default {
           this.type != 'view' && row.isApply != 1 && this.source != '报工信息';
         return flag;
       };
+    },
+    // 方案表格操作权限
+    schemeTableTool() {
+      return (row) => {
+        if (row.id && this.state == '可操作') {
+          return true;
+        }
+
+        let flag = this.type == 'view' || row.isApply == 1;
+        return flag;
+      };
+    },
+    // input输入权限
+    inputOperate() {
+      return (row) => {
+        if (row.id && this.state == '可操作') {
+          return true;
+        }
+        let flag = this.type == 'view';
+        return flag;
+      };
     }
   },
   watch: {
@@ -470,7 +503,7 @@ export default {
   },
   created() {},
   mounted() {
-    console.log(this.obtain,'obtain')
+    console.log(this.obtain, 'obtain');
     if (this.source == '配件回收') {
       this.typeIdList = [
         {
@@ -570,7 +603,7 @@ export default {
       // ***
       this.calculatePrice();
     },
-    totalCountChange(index,data,name) {
+    totalCountChange(index, data, name) {
       data[name] = data[name].replace(/[^\d]/g, '').replace(/^0+/, '') || '0';
       let row = this.form.tableList[index];
       if (row.totalCount && row.singlePrice) {