Browse Source

修改bug

lichao 3 years ago
parent
commit
f349c4f8e3

+ 8 - 0
src/views/workManagement/requisition/config/commodity.json

@@ -92,6 +92,14 @@
       "index": 9,
       "minWidth": 80,
       "overHidden": true
+    },
+    {
+      "label": "库区",
+      "prop": "storageId",
+      "search": false,
+      "index": 10,
+      "minWidth": 80,
+      "overHidden": true
     }
   ]
 }

+ 14 - 6
src/views/workManagement/requisition/detail.vue

@@ -239,10 +239,10 @@
           </template>
           <template slot="storageId" slot-scope="{ row, index }">
             <el-select
-              v-if="row.$cellEdit"
               v-model="row.storageId"
               filterable
               @change="storageChange(row)"
+              disabled
             >
               <el-option
                 v-for="(item, index) in storageOptions"
@@ -251,7 +251,6 @@
                 :label="item.cname"
               ></el-option>
             </el-select>
-            <span v-else>{{ row.storageName }}</span>
           </template>
           <template slot="remarks" slot-scope="{ row, index }">
             <el-input
@@ -320,6 +319,9 @@
                 >移除
                 </el-button>
               </template>
+              <template slot="storageId" slot-scope="scope">
+                <span>{{scope.row.storageId | storageFormat(storageOptions)}}</span>
+              </template>
             </avue-crud>
       </span>
 
@@ -610,6 +612,9 @@ export default {
     },
     decimalFormat(num) {
       return num ? Number(num).toFixed(2) : "0.00";
+    },
+    storageFormat(row, storageOptions) {
+      return row = storageOptions.find(item => item.id == row).cname
     }
   },
   methods: {
@@ -907,6 +912,7 @@ export default {
                 item.unit = e.unit;
                 item.priceCategory = e.goodsTypeName;
                 item.price = e.unitPrice;
+                item.storageId = e.storageId;
                 item.$cellEdit = true;
               }
             });
@@ -925,8 +931,9 @@ export default {
               price: e.unitPrice,
               amount: 0,
               orderQuantity: 0,
-              storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
-              storageName: this.storageOptions.length > 0? this.storageOptions[0].cname: null,
+              storageId: e.storageId,
+              // storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
+              // storageName: this.storageOptions.length > 0? this.storageOptions[0].cname: null,
               $cellEdit: true
             });
           });
@@ -942,8 +949,9 @@ export default {
               amount: 0,
               orderQuantity: 0,
               price: e.unitPrice,
-              storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
-              storageName: this.storageOptions.length > 0? this.storageOptions[0].cname: null,
+              // storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
+              // storageName: this.storageOptions.length > 0? this.storageOptions[0].cname: null,
+              storageId: e.storageId,
               $cellEdit: true
             });
           });

+ 0 - 1
src/views/workManagement/warehousing/detail.vue

@@ -239,7 +239,6 @@
               v-if="row.$cellEdit"
               v-model="row.storageId"
               filterable
-              clearable
               @change="storageChange(row)"
             >
               <el-option