Эх сурвалжийг харах

工艺管理-物料选择与筛选

damon227 1 жил өмнө
parent
commit
61c2a9c817

+ 13 - 2
src/views/modules/tech/ctafts-add-or-detail.vue

@@ -32,13 +32,15 @@
                 v-model="dataForm.productId"
                 :disabled="display || isEdit"
                 remote
+                filterable 
                 placeholder="请选择"
                 style="width:100%"
+                @change="productIdChangeHandle"
               >
                 <el-option
                   v-for="item in optionLevel"
                   :key="item.productId"
-                  :label="item.productName"
+                  :label="item.productNameStr"
                   :value="item.productId"
                 >
                 </el-option>
@@ -203,7 +205,7 @@ export default {
         if (data && data.code === '200') {
           this.optionLevel = data.data.records
           this.optionLevel.forEach(item => {
-            item.productName = item.productName + '-' + item.mapNumber + '-' + (item.techId && item.techId !== 0 ? '有' : '无')
+            item.productNameStr = item.productName + '-' + item.mapNumber + '-' + (item.techId && item.techId !== 0 ? '有' : '无')
           })
         }
       })
@@ -231,6 +233,15 @@ export default {
 
       this.refreshTable()
     },
+    productIdChangeHandle (val) {
+      if (val) {
+        // this.dataForm.productId = val.productId
+        // this.dataForm.techName = val.productName
+        let item = this.optionLevel.find(t => t.productId === val)
+        this.dataForm.techName = item.productName
+      }
+      console.log(111, val)
+    },
     handleRemove (file, fileList) {
       this.fileList = fileList
     },