Преглед изворни кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into dev

yusheng пре 1 година
родитељ
комит
f7176c2df3
1 измењених фајлова са 41 додато и 12 уклоњено
  1. 41 12
      src/views/salesServiceManagement/components/sparePartsList.vue

+ 41 - 12
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,9 +277,9 @@ export default {
       default: () => []
     },
     obtain: {
-      type: '',
+      type: String,
       default: '主数据'
-    }
+    },
   },
   data() {
     return {
@@ -429,6 +433,9 @@ export default {
         if (this.source == '配件回收') {
           return true;
         }
+        if (scope.row.demandId && this.state == '可操作') {
+          return false;
+        }
         let flag =
           scope.row.typeId == 2 &&
           scope.row.isApply != 1 &&
@@ -445,19 +452,40 @@ export default {
       let flag = this.type != 'view' && this.source != '报工信息';
       return flag;
     },
-    // 故障列表删除权限
+    // 方案列表删除权限
     schemeOperate() {
       return (row) => {
         if (this.source == '配件回收') {
           return true;
         }
-        if (row.id && this.state == '可操作') {
+        if (row.demandId && this.state == '可操作') {
           return false;
         }
         let flag =
           this.type != 'view' && row.isApply != 1 && this.source != '报工信息';
         return flag;
       };
+    },
+    // 方案表格操作权限
+    schemeTableTool() {
+      return (row) => {
+        if (row.demandId && this.state == '可操作') {
+          return true;
+        }
+
+        let flag = this.type == 'view' || row.isApply == 1;
+        return flag;
+      };
+    },
+    // input输入权限
+    inputOperate() {
+      return (row) => {
+        if (row.demandId && this.state == '可操作') {
+          return true;
+        }
+        let flag = this.type == 'view';
+        return flag;
+      };
     }
   },
   watch: {
@@ -470,7 +498,7 @@ export default {
   },
   created() {},
   mounted() {
-    console.log(this.obtain,'obtain')
+    console.log(this.obtain, 'obtain');
     if (this.source == '配件回收') {
       this.typeIdList = [
         {
@@ -570,7 +598,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) {
@@ -631,6 +659,7 @@ export default {
       }
 
       this.$set(this.form.tableList[this.currentIndex], 'typeId', '2');
+      console.log(this.form.tableList,'----------------')
       this.$forceUpdate();
     },
     async warehouseChange(item, row, index) {