Sfoglia il codice sorgente

修改质检计划页面

PC-202503171525\Administrator 1 anno fa
parent
commit
97099fedb0

+ 37 - 5
src/views/inspectionPlan/components/baseInfo.vue

@@ -20,8 +20,24 @@
         </el-form-item>
       </el-col>
       <el-col :span="6">
-        <el-form-item label="检验标准:" prop="inspectionStandards">
-          <el-select v-model="form.inspectionStandards" placeholder="请选择" style="width: 100%" clearable></el-select>
+<!--        <el-form-item label="检验标准:" prop="inspectionStandards">-->
+<!--          <el-select v-model="form.inspectionStandards" placeholder="请选择" style="width: 100%" clearable></el-select>-->
+<!--        </el-form-item>-->
+        <el-form-item label="检验标准" prop="inspectionStandards">
+          <!-- 计量 计重 -->
+          <el-select
+            style="width: 100%"
+            v-model="form.inspectionStandards"
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in inspectionStandardsList"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            >
+            </el-option>
+          </el-select>
         </el-form-item>
       </el-col>
     </el-row>
@@ -189,7 +205,7 @@ import EquipmentDialog from '@/views/inspectionWork/components/EquipmentDialog';
 
 //接口
 import { getUserPage } from '@/api/system/organization';
-
+import { getByCode } from '@/api/system/dictionary-data';
 import { rules } from 'eslint-config-prettier';
 
 export default {
@@ -285,6 +301,7 @@ export default {
     return {
       executorList: [],
       sourceList: [],
+      inspectionStandardsList: [],
       rules: {
         name: [{ required: true, message: '请输入', trigger: 'blur' }],
         qualityMode: [
@@ -300,7 +317,20 @@ export default {
       }
     };
   },
+  created() {
+    this.getDictListIqoCode('iqo_code');
+  },
   methods: {
+    async getDictListIqoCode(code) {
+      let { data: res } = await getByCode(code);
+      this.inspectionStandardsList = res.map((item) => {
+        let values = Object.keys(item);
+        return {
+          value: Number(values[0]),
+          label: item[values[0]]
+        };
+      });
+    },
     //质检计划类型
     planChange(value) {
       if (value == 1) {
@@ -381,11 +411,13 @@ export default {
       this.form.qualificationRate = val.qualificationRate;
       this.form.totalWeight = val.totalWeight;
       this.form.sampleNumber = val.sampleNumber;
-
+      this.form.inspectionStandards = val.inspectionStandards;
       let receiveNo = val.receiveNo;
       let categoryCode = val.productCode;
+      let productCategoryId = val.productCategoryId;
+      let productCategoryName = val.productCategoryName;
       if (receiveNo && categoryCode) {
-        this.$emit('getList', receiveNo, categoryCode);
+        this.$emit('getList', receiveNo, categoryCode,productCategoryId,productCategoryName);
       }
     },
 

+ 7 - 5
src/views/inspectionPlan/components/edit.vue

@@ -315,9 +315,9 @@ export default {
       this.schemePagination.currentPage = 1;
       this.schemePagination.total = this.schemeList.length;
     },
-    async getList(receiveNo, productCode) {
+    async getList(receiveNo, productCode,productCategoryId,productCategoryName) {
       //通过来源和产品 获取来料清单
-      await this.getGoodsList(receiveNo, productCode);
+      await this.getGoodsList(receiveNo, productCode,null,productCategoryId,productCategoryName);
       //通过抽样方式获取样品列表 全检 样品列表等于来料清单列表
       if (this.baseForm.qualityMode == 1) {
         this.sampleList = this.packingList;
@@ -327,7 +327,7 @@ export default {
       //通过来源和产品 获取质检方案
       this.getQualityTemplate(productCode);
     },
-    async getGoodsList(receiveNo, productCode, ids) {
+    async getGoodsList(receiveNo, productCode, ids,productCategoryId,productCategoryName) {
       let res = await getPurchaseWarehouseGoods({
         receiveNo: receiveNo,
         categoryCode: productCode,
@@ -339,6 +339,8 @@ export default {
 
         _arr1 = res.list.map((m) => {
           m.sourceId = m.id;
+          m.productCategoryId = productCategoryId;
+          m.productCategoryName = productCategoryName;
           delete m.id;
           return {
             ...m
@@ -501,9 +503,9 @@ export default {
 
         let params = {
           ...this.baseForm,
-          packingList: this.packingList,
+          qualityInventoryList: this.packingList,
           sampleList: this.sampleList,
-          planTemplateList: this.schemeList
+          planTemplateList: this.schemeList,
         };
 
         console.log(params, 'params');