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

产品检验管理明细新建调整

qymljy пре 7 месеци
родитељ
комит
fe2f375ba1

+ 13 - 5
src/HDrpManagement/productInspectionMag/modules/checkInfo.vue

@@ -23,6 +23,7 @@
                 v-model="scope.column.data[scope.column.columnname]"
                 size="small"
                 :placeholder="$t('请选择检验项目')"
+                @change="selectChange"
                 style="width: 100%"
             >
               <el-option
@@ -49,9 +50,9 @@
             >
               <el-option
                   v-for="item in askList"
-                  :key="item.value"
-                  :label="$t(item.value)"
-                  :value="item.value"
+                  :key="item.index"
+                  :label="$t(item)"
+                  :value="item"
               >
               </el-option>
             </el-select>
@@ -161,9 +162,9 @@ export default {
     },
     async queryType(){
       const res = await this.$store.dispatch("optiontypeselect", "inspectionitems")
-      const res1 = await this.$store.dispatch("optiontypeselect", "technicalrequirements")
+      // const res1 = await this.$store.dispatch("optiontypeselect", "technicalrequirements")
       this.optionnameList = res.data
-      this.askList = res1.data
+      // this.askList = res1.data
     },
     async delInfo(data){
       const res = await this.$api.requested({
@@ -226,6 +227,13 @@ export default {
     onEdit(data){
       this.nowIndex = data.rowindex
       this.isAdd = true
+    },
+    selectChange(val){
+      this.optionnameList.forEach(item=>{
+        if (val == item.value){
+          this.askList = item.subvalues
+        }
+      })
     }
   },
   mounted() {

+ 14 - 4
src/HDrpManagement/productInspectionMag/modules/edit.vue

@@ -33,7 +33,8 @@
               <el-form-item :label="$t('适用介质') + ':'" prop="medium">
                 <el-select
                     v-model="form.medium"
-                    :placeholder="$t('请选择领域')"
+                    multiple
+                    :placeholder="$t('请选择适用介质')"
                     style="width: 100%"
                 >
                   <el-option
@@ -79,7 +80,7 @@ export default {
       form:{
         "itemid": '',
         "temperature":"10℃-50℃",
-        "medium":"油"
+        "medium":[]
       },
       rules:{
         temperature: [
@@ -92,7 +93,7 @@ export default {
         medium: [
           {
             required: true,
-            message: this.$t("请填写适用介质"),
+            message: this.$t("请选择适用介质"),
             trigger: "blur",
           },
         ],
@@ -108,13 +109,22 @@ export default {
     onShow(){
       this.dialogFormVisible = true
       this.mediumList()
-      this.form.medium = this.data.medium
+      this.form.medium = this.data.medium.split(',')
       this.form.temperature = this.data.temperature
     },
     onSave(){
       this.form.itemid = this.$route.query.id
       this.$refs.form.validate(async(valid)=>{
         if (!valid) return false
+        let newMedium = ''
+        this.form.medium.forEach((item,index)=>{
+          if (index == 0){
+            newMedium = item
+          }else {
+            newMedium = newMedium + ',' + item
+          }
+        })
+        this.form.medium = newMedium
         this.loading = true
         const res = await this.$api.requested({
           id:2025101415125402,