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

提交修改质检计划与工单功能

PC-202503171525\Administrator 1 год назад
Родитель
Сommit
05fce9575a

+ 8 - 0
src/api/inspectionPlan/index.js

@@ -126,3 +126,11 @@ export async function getInventoryListByPlanId(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 根据物品id 查询 仓库信息
+export async function getByCategoryId(data) {
+  const res = await request.post(`/qms/quality_plan/categoryId`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 1
src/api/samplemanagement/index.js

@@ -2,7 +2,7 @@ import request from '@/utils/request';
 
 // 列表
 export async function getList(data) {
-  const res = await request.post(`/qms/quality_plan/page`, data);
+  const res = await request.get(`/qms/sample/page`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 3 - 2
src/views/inspectionPlan/components/baseInfo.vue

@@ -414,10 +414,11 @@ export default {
       this.form.inspectionStandards = val.inspectionStandards;
       let receiveNo = val.receiveNo;
       let categoryCode = val.productCode;
+      let categoryid = val.productId;
       let productCategoryId = val.productCategoryId;
       let productCategoryName = val.productCategoryName;
-      if (receiveNo && categoryCode) {
-        this.$emit('getList', receiveNo, categoryCode,productCategoryId,productCategoryName);
+      if (receiveNo && categoryCode && categoryid) {
+        this.$emit('getList', receiveNo, categoryCode,productCategoryId,productCategoryName,categoryid);
       }
     },
 

+ 28 - 12
src/views/inspectionPlan/components/edit.vue

@@ -89,14 +89,15 @@
 import baseInfo from './baseInfo.vue';
 
 import { getCode } from '@/api/login';
-import { save, update, planIssued, } from '@/api/inspectionPlan';
+import {save, update, planIssued} from '@/api/inspectionPlan';
 import {
   getPurchaseWarehouseGoods,
   getQualityTemplateList,
   getTemplateListByPlanId,
   getSampleListByPlanId,
   getInventoryListByPlanId,
-  outInRecordsPage
+  outInRecordsPage,
+  getByCategoryId
 } from '@/api/inspectionPlan/index.js';
 export default {
   components: {
@@ -330,9 +331,10 @@ export default {
       this.schemePagination.currentPage = 1;
       this.schemePagination.total = this.schemeList.length;
     },
-    async getList(receiveNo, productCode, productCategoryId, productCategoryName) {
+    async getList(receiveNo, productCode, productCategoryId, productCategoryName,categoryid) {
       //通过来源和产品 获取来料清单
-      await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName);
+      await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName,categoryid);
+
       //通过抽样方式获取样品列表 全检 样品列表等于来料清单列表
       if (this.baseForm.qualityMode == 1) {
         this.sampleList = this.packingList;
@@ -342,14 +344,28 @@ export default {
       //通过来源和产品 获取质检方案
       this.getQualityTemplate(productCode);
     },
-    async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName) {
-      let res = await outInRecordsPage({
-        // receiveNo: receiveNo,
-        sourceBizNo: receiveNo,
-        categoryCode: productCode,
-        qualityQlanId: ids,
-        size:-1
-      });
+    async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName,categoryid) {
+      let res;
+      // 根据物品id 编码查询主数据中物品编码是否需要拆包 是走 包装明细表  否 走获取产品表
+      let cateRes = await getByCategoryId({
+        categoryId: categoryid
+      })
+      if (cateRes) {
+        if (cateRes.isUnpack == 1) {
+          res = await outInRecordsPage({
+            // receiveNo: receiveNo,
+            sourceBizNo: receiveNo,
+            categoryCode: productCode,
+            categoryId: categoryid,
+            qualityQlanId: ids,
+            size:-1
+          });
+        }else{
+          // 获取没有拆包的产品数据 --- 等接口
+
+        }
+      }
+
       console.log(res, '来料清单');
       if (Array.isArray(res?.list)) {
         let _arr1 = [];

+ 34 - 1
src/views/inspectionWork/components/baseInfo.vue

@@ -143,6 +143,24 @@
       </el-col>
     </el-row>
     <el-row>
+      <el-col :span="6">
+        <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-col :span="6">
         <el-form-item label="检验方式:" prop="qualityMode">
           <DictSelection dictName="取样类型" v-model="form.qualityMode" disabled></DictSelection>
@@ -187,6 +205,7 @@ import EquipmentDialog from './EquipmentDialog.vue';
 import { getUserPage } from '@/api/system/organization';
 
 import { getProduceTaskList } from '@/api/aps';
+import {getByCode} from "@/api/system/dictionary-data";
 
 export default {
   components: {
@@ -234,10 +253,24 @@ export default {
           { required: true, message: '请选择质检状态', trigger: 'change' }
         ]
       },
-      produceTaskList: []
+      produceTaskList: [],
+      inspectionStandardsList: [],
     };
   },
+  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]]
+        };
+      });
+    },
     // 打开工艺路线弹窗
     openVersion() {
       this.$refs.versionRefs.open();

+ 15 - 9
src/views/inspectionWork/components/sampleListDialog.vue

@@ -7,7 +7,7 @@
             <el-table-column type="expand">
                 <template slot-scope="props">
                     <div style="padding: 10px;">
-                        <el-table :data="props.row.children" border>
+                        <el-table :data="props.row.children" border >
                             <el-table-column label="质检方案编码" prop="qualitySchemeTemplateCode" align="center">
                             </el-table-column>
                             <el-table-column label="质检方案名称" prop="qualitySchemeTemplateName"
@@ -129,16 +129,14 @@ export default {
 
     created() { },
     methods: {
-        async openDia(index, row, type, list) {
+        async openDia(index, row, type, list,isStatus) {
             this.rowIndex = index
             this.type = type;
-            if (row.isStatus) {
-              for (let i = 0; i < list.length; i++) {
-                const arr = list[i].children
-                for (let j = 0; j < arr.length; j++) {
-                  arr[j].qualityResults = 1
-                }
-
+            if (row != null && row.isStatus) {
+              this.tableDataUpdate(list);
+            }else{
+              if (isStatus){
+                this.tableDataUpdate(list);
               }
             }
             this.tableData = list;
@@ -158,6 +156,14 @@ export default {
             this.visible = false;
             this.$emit('handleConfirm', this.tableData, this.rowIndex);
         },
+      tableDataUpdate(list) {
+        for (let i = 0; i < list.length; i++) {
+          const arr = list[i].children
+          for (let j = 0; j < arr.length; j++) {
+            arr[j].qualityResults = 1
+          }
+        }
+      }
     }
 };
 </script>

+ 17 - 6
src/views/inspectionWork/edit.vue

@@ -9,7 +9,7 @@
       <base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type"></base-info>
       <el-row>
         <header-title title="质检内容">
-          <el-button type="primary" :loading="loading">批量报工</el-button>
+          <el-button type="primary" :loading="loading" @click="batchQuality(null,null,'report')">批量质检</el-button>
         </header-title>
         <el-tabs v-model="activeName" @tab-click="handleClick">
           <el-tab-pane label="来源清单" name="1"></el-tab-pane>
@@ -244,6 +244,7 @@ export default {
         total: 0
       },
       isValid: true,
+      isStatus: true,
       SampleListbyReportList: [],
 
     };
@@ -433,7 +434,7 @@ export default {
         children: [...this.schemeList]
       }];
       console.log(index, row, type, mergedData, 'index, row, type, mergedData')
-      this.$refs.detailRef.openDia(index, row, type, mergedData);
+      this.$refs.detailRef.openDia(index, row, type, mergedData,null);
     },
     // 报工
     handleReporting(index, row) {
@@ -444,11 +445,11 @@ export default {
         let params = {
           ...this.form,
           sampleList: this.sampleList,
-          schemeList: this.schemeList,
-          planTemplateList: this.SampleListbyReportList
+          planTemplateList: this.schemeList,
+          qualityInventoryList: this.packingList
         }
         console.log(params, 'params')
-        return;
+        // return;
         exeReportWork(params)
           .then((msg) => {
             this.loading = false;
@@ -510,9 +511,19 @@ export default {
 
       console.log(this.sampleList, processedList, '222表')
 
-      this.SampleListbyReportList = processedList;
+      // this.SampleListbyReportList = processedList;
 
     },
+    // 批量质检
+    batchQuality(index, row,type){
+      if (!this.isStatus){
+        this.isStatus = false;
+      }
+      this.sampleList.forEach((item) => {
+        item.children=this.schemeList;
+      });
+      this.$refs.detailRef.openDia(null, null,type, this.sampleList, this.isStatus)
+    }
   }
 };
 </script>

+ 23 - 6
src/views/samplemanagement/components/search.vue

@@ -3,19 +3,36 @@
 <template>
   <el-form label-width="77px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
     <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 8 } : { span: 4 }">
         <el-form-item label="编码:">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-input clearable v-model="where.sampleCode" placeholder="请输入" />
         </el-form-item>
       </el-col>
 
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6 }">
-        <el-form-item label="名称:">
-          <el-input clearable v-model="where.name" placeholder="请输入" />
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 8 } : { span: 4 }">
+        <el-form-item label="物品编码:">
+          <el-input clearable v-model="where.categoryCode" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 8 } : { span: 4 }">
+        <el-form-item label="物品名称:">
+          <el-input clearable v-model="where.categoryName" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 8 } : { span: 4 }">
+        <el-form-item label="样品状态:">
+          <el-select
+            v-model="where.status"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option label="已处理" :value="1" />
+            <el-option label="未处理" :value="2" />
+          </el-select>
         </el-form-item>
       </el-col>
       <el-col style="display: flex; justify-content: flex-end"
-        v-bind="styleResponsive ? { lg: 12, md: 6 } : { span: 12 }">
+        v-bind="styleResponsive ? { lg: 4, md: 6 } : { span: 12 }">
         <div class="ele-form-actions">
           <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
             查询

+ 15 - 19
src/views/samplemanagement/index.vue

@@ -40,24 +40,20 @@ export default {
     data() {
         return {
             columns: [
-                {
-                    type: 'index',
-                    columnKey: 'index',
-                    align: 'center',
-                    label: '序号',
-                    width: 55,
-                    showOverflowTooltip: true,
-                    fixed: 'left'
-                },
-                {
-                    prop: 'code',
-                    label: '编码',
-                    slot: 'code',
-                    align: 'center',
-                    width: 180,
-                    showOverflowTooltip: true,
-                    fixed: 'left'
-                },
+                {type: 'index',columnKey: 'index',align: 'center',label: '序号',width: 55,showOverflowTooltip: true},
+                {prop: 'sampleCode',label: '编码',slot: 'sampleCode',align: 'center',width: 160,showOverflowTooltip: true},
+                {prop: 'categoryCode',label: '物品编码',slot: 'categoryCode', align: 'center',width: 160,showOverflowTooltip: true},
+                {prop: 'categoryName',label: '物品名称',slot: 'categoryName', align: 'center',width: 160,showOverflowTooltip: true},
+                {prop: 'specification',label: '规格',slot: 'specification', align: 'center',width: 100,showOverflowTooltip: true},
+                {prop: 'brandNum',label: '牌号',slot: 'brandNum', align: 'center',width: 100,showOverflowTooltip: true},
+                {prop: 'modelType',label: '型号',slot: 'modelType', align: 'center',width: 160,showOverflowTooltip: true},
+                {prop: 'unit',label: '计量单位',slot: 'unit', align: 'center',width: 100,showOverflowTooltip: true},
+                {prop: 'batchNo',label: '批次号',slot: 'batchNo', align: 'center',width: 100,showOverflowTooltip: true},
+                {prop: 'weight',label: '重量',slot: 'weight', align: 'center',width: 100,showOverflowTooltip: true},
+                {prop: 'weightUnit',label: '重量单位',slot: 'weightUnit', align: 'center',width: 100,showOverflowTooltip: true},
+                {prop: 'weightUnit',label: '重量单位',slot: 'weightUnit', align: 'center',width: 100,showOverflowTooltip: true},
+                {prop: 'disposeTime',label: '处置时间',slot: 'disposeTime', align: 'center',width: 180,showOverflowTooltip: true},
+                {columnKey: 'action',label: '操作',align: 'center',width: 120,resizable: false,slot: 'action',fixed: 'right'}
             ]
         };
     },
@@ -81,4 +77,4 @@ export default {
         },
     }
 };
-</script>
+</script>