Просмотр исходного кода

修改质检方案和质检计划

wsx 11 месяцев назад
Родитель
Сommit
3b67a32245

+ 1 - 1
src/styles/transition/common.scss

@@ -61,7 +61,7 @@
 
 
 .el-dialog {
-  margin-top: 5vh !important;
+  // margin-top: 5vh !important;
 }
 
 .el-table--medium .el-table__cell {

+ 17 - 6
src/views/inspectionPlan/components/new-baseInfo.vue

@@ -353,10 +353,11 @@
         </el-col>
       </el-row>
     </div>
-
+    <!-- 采购收货单 -->
     <warehousing ref="warehousingRef" @choose="handleChoose" />
     <productionPlan ref="productionPlanRef" @choose="handleChoose" />
     <workOrder ref="workOrderRef" @choose="handleChoose" />
+    <!-- 生产工单 -->
     <produceOrder ref="produceOrderRef" @choose="handleChoose" />
     <EquipmentDialog
       ref="equipmentRefs"
@@ -364,6 +365,7 @@
       :type="2"
       :treeIds="['9']"
     />
+    <!-- 成品检验 -->
     <stokledger ref="stokledgerRef" @choose="handleStokledgerChoose" />
   </el-form>
 </template>
@@ -385,6 +387,8 @@
 
   import { getDetailInfo } from '@/api/inspectionPlan/index.js';
 
+  import { getQualityTemplateList } from '@/api/inspectionPlan/index.js';
+
   export default {
     components: {
       EquipmentDialog,
@@ -644,8 +648,8 @@
         }
       },
 
-      //库存台账根据来源得到产品
-      handleStokledgerChoose(list, dimension) {
+      //库存台账根据来源得到产品,选择
+      async handleStokledgerChoose(list, dimension) {
         let val = list[0];
         console.log(val, '库存台账根据来源得到产品');
         if (!val) return;
@@ -676,9 +680,11 @@
         this.$emit('changesStokledgerNumberModal', list, dimension, 'type');
         // }
         // this.$emit('changesStokledgerNumberModal', list, dimension);
-        if (this.form.type != 3) {
+        if (this.form.type) {
           this.$emit('getQualityTemplate', val.categoryCode);
         }
+
+       
       },
 
       //   根据来源得到产品
@@ -724,8 +730,13 @@
         let productCategoryId = val.productCategoryId;
         let productCategoryName = val.productCategoryName;
 
-        console.log(this.form.productId, batchNo, productionCode);
-
+        console.log(this.form.type, batchNo, productionCode);
+        // 普通的时候receiveNo就是val.receiveNo,categoryCode是val.productCode,categoryid是val.productId
+        // 生产检验时receiveNo没有,  categoryid是val.categoryId
+        // 成品检验时
+        if (this.form.type == 2) {
+          receiveNo = productionCode;
+        }
         if (receiveNo && categoryCode && categoryid) {
           this.$emit(
             'getList',

+ 34 - 5
src/views/inspectionPlan/components/new-edit.vue

@@ -33,7 +33,6 @@
     ></base-info>
     <el-row>
       <header-title title="质检内容"></header-title>
-
       <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tab-pane label="来源清单" name="1">
           <!-- <ele-pro-table
@@ -207,7 +206,7 @@
         </el-tab-pane>
         <el-tab-pane label="质检方案" name="3">
           <el-button
-            @click="addInspectionTemplate"
+            @click="addInspectionTemplate(baseForm.type)"
             type="primary"
             style="margin-top: 5px"
             >选择质检方案</el-button
@@ -256,6 +255,7 @@
               label="质检项名称"
               prop="inspectionName"
               align="center"
+              width="150"
             ></el-table-column>
             <el-table-column
               label="工艺参数"
@@ -289,6 +289,26 @@
                 </div>
               </template>
             </el-table-column>
+
+            <el-table-column fixed="right" label="操作" width="80">
+              <template slot-scope="scope">
+                <el-popconfirm
+                  class="ele-action"
+                  title="确定要删除当前方案吗?"
+                  @confirm="handDel(scope.$index)"
+                >
+                  <template v-slot:reference>
+                    <el-link
+                      type="danger"
+                      :underline="false"
+                      icon="el-icon-delete"
+                    >
+                      删除
+                    </el-link>
+                  </template>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
           </el-table>
           <el-pagination
             v-show="activeName === '3' && schemeList.length > 0"
@@ -321,7 +341,10 @@
         @click="handleIssued"
         >下发</el-button
       >
+      <!-- 选择质检方案 -->
       <inspectionTemplateDialog
+        v-if="baseForm"
+        :type="baseForm.type"
         ref="inspectionTemplateRef"
         @choose="inspectionTemplateSuccess"
       ></inspectionTemplateDialog>
@@ -332,6 +355,7 @@
 <script>
   // import baseInfo from './baseInfo.vue';
   import baseInfo from './new-baseInfo.vue';
+  // 质检方案的弹窗
   import inspectionTemplateDialog from '@/views/inspectionTemplate/components/inspectionTemplateDialog.vue';
   import { getCode } from '@/api/login';
   import { save, update, planIssued } from '@/api/inspectionPlan';
@@ -620,7 +644,7 @@
 
       //分页后的来源列表
       paginatedSourceList() {
-        console.log('分页');
+        console.log('分页', this.sourceList);
         const { currentPage, pageSize } = this.sourcePagination;
         const start = (currentPage - 1) * pageSize;
         const end = start + pageSize;
@@ -900,8 +924,8 @@
           await this.handleEditOrDetail(row);
         }
       },
-      addInspectionTemplate() {
-        this.$refs.inspectionTemplateRef.open();
+      addInspectionTemplate(type) {
+        this.$refs.inspectionTemplateRef.open(type);
       },
       async inspectionTemplateSuccess(select) {
         let data = await getQualityTemplateByIds({
@@ -1425,6 +1449,7 @@
       },
       async getQualityTemplate(productCode, ids) {
         await getQualityTemplateList({
+          type: this.baseForm.type,
           productCode: productCode,
           qualityQlanId: ids
         }).then((res) => {
@@ -2455,6 +2480,10 @@
         } else {
           await this.updatePackingList(list);
         }
+      },
+      handDel(index) {
+        console.log(index);
+        this.schemeList.splice(index,1)
       }
     }
   };

+ 46 - 6
src/views/inspectionTemplate/AddorUpdate.vue

@@ -22,8 +22,24 @@
       @keyup.enter.native="dataFormSubmit()"
       label-width="80px"
     >
-      <el-row>
-        <el-col :span="8">
+      <el-row style="margin-bottom: 10px">
+        <el-col :span="6"
+          ><el-form-item label="类型 " prop="type">
+            <el-select
+              clearable
+              class="ele-block"
+              v-model="dataForm.type"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in typeList"
+                :label="item.label"
+                :value="+item.value"
+                :key="item.value"
+              />
+            </el-select> </el-form-item
+        ></el-col>
+        <el-col :span="6">
           <el-form-item label="名称" prop="qualitySchemeTemplateName">
             <el-input
               v-model="dataForm.qualitySchemeTemplateName"
@@ -31,7 +47,7 @@
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="8">
+        <el-col :span="6">
           <el-form-item label="编码" prop="qualitySchemeTemplateCode">
             <el-input
               v-model="dataForm.qualitySchemeTemplateCode"
@@ -40,7 +56,7 @@
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="8"
+        <el-col :span="6"
           ><el-form-item label="状态 " prop="status">
             <el-select
               clearable
@@ -162,7 +178,7 @@
           </template>
         </ele-pro-table>
       </el-row>
-      <el-row>
+      <el-row v-if="dataForm.type !== 2">
         <ele-pro-table
           ref="table"
           :columns="categoryColumns"
@@ -216,6 +232,7 @@
 <script>
   import termPop from '@/views/inspectionTemplate/inspectionClassify/index.vue';
   import EquipmentDialog from '@/views/unqualifiedProduct/unqualifiedList/components/EquipmentDialog.vue';
+  import { getByCode } from '@/api/system/dictionary-data';
 
   import {
     save,
@@ -231,6 +248,7 @@
         visible: false,
         dataForm: {
           id: 0,
+          type: null,
           qualitySchemeTemplateName: '',
           qualitySchemeTemplateCode: '',
           inspectionItemVOList: [],
@@ -360,6 +378,7 @@
           }
         ],
         dataRule: {
+          type: [{ required: true, message: '请选择类型', trigger: 'blur' }],
           qualitySchemeTemplateName: [
             { required: true, message: '请输入质检方案名称', trigger: 'blur' }
           ],
@@ -372,10 +391,21 @@
           ]
         },
         list: [],
-        templateCategoryList: []
+        templateCategoryList: [],
+        typeList: []
       };
     },
     methods: {
+      async getTnspectionPlanType() {
+        let res = await getByCode('inspection_plan_type');
+        if (res?.code == 0) {
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: key, label: item[key] };
+          });
+          this.typeList = list;
+        }
+      },
       handAdd(type) {
         if (type == 1) {
           this.$refs.termRef.open(this.list);
@@ -410,6 +440,7 @@
         this.templateCategoryList.push(...categoryList);
       },
       init(id) {
+        this.getTnspectionPlanType();
         this.dataForm.id = id || 0;
         this.visible = true;
         this.$nextTick(async () => {
@@ -487,6 +518,15 @@
           }
         });
       }
+    },
+    watch: {
+      'dataForm.type': {
+        handler(val) {
+          if (val == 2) {
+            this.templateCategoryList = [];
+          }
+        }
+      }
     }
   };
 </script>

+ 6 - 3
src/views/inspectionTemplate/components/inspectionTemplateDialog.vue

@@ -38,6 +38,7 @@
 
     data() {
       return {
+        type: '',
         equipmentdialog: false,
         selection: [],
         columns: [
@@ -102,10 +103,12 @@
         return getList({
           ...where,
           pageNum: page,
-          size: limit
+          size: limit,
+          type: this.type
         });
       },
-      open() {
+      open(type) {
+        this.type = type;
         this.equipmentdialog = true;
       },
       handleClose() {
@@ -114,7 +117,7 @@
       // 选择
       selected() {
         if (!this.selection.length) {
-            this.$message.error('至少选择一条数据');
+          this.$message.error('至少选择一条数据');
 
           return;
         }