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

提交修改质检计划和质检工单页面内容以及新增样品管理页面

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

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

@@ -134,3 +134,14 @@ export async function getByCategoryId(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 清单列表接口 3
+export async function getBatchInfoData(params) {
+  const res = await request.get(`/wms/outindetailtwo/getBatchInfo`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

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

@@ -2,7 +2,17 @@ import request from '@/utils/request';
 
 // 列表
 export async function getList(data) {
-  const res = await request.get(`/qms/sample/page`, data);
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/sample/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 列表
+export async function getSampleQWorkOrderIdPage(data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/sample/getSampleQWorkOrderId?`+ par, {});
   if (res.data.code == 0) {
     return res.data.data;
   }

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

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

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

@@ -97,7 +97,8 @@ import {
   getSampleListByPlanId,
   getInventoryListByPlanId,
   outInRecordsPage,
-  getByCategoryId
+  getByCategoryId,
+  getBatchInfoData
 } from '@/api/inspectionPlan/index.js';
 export default {
   components: {
@@ -331,9 +332,9 @@ export default {
       this.schemePagination.currentPage = 1;
       this.schemePagination.total = this.schemeList.length;
     },
-    async getList(receiveNo, productCode, productCategoryId, productCategoryName,categoryid) {
+    async getList(receiveNo, productCode, productCategoryId, productCategoryName,categoryid,batchNo) {
       //通过来源和产品 获取来料清单
-      await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName,categoryid);
+      await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName,categoryid,batchNo);
 
       //通过抽样方式获取样品列表 全检 样品列表等于来料清单列表
       if (this.baseForm.qualityMode == 1) {
@@ -344,7 +345,7 @@ export default {
       //通过来源和产品 获取质检方案
       this.getQualityTemplate(productCode);
     },
-    async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName,categoryid) {
+    async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName,categoryid,batchNo) {
       let res;
       // 根据物品id 编码查询主数据中物品编码是否需要拆包 是走 包装明细表  否 走获取产品表
       let cateRes = await getByCategoryId({
@@ -362,7 +363,12 @@ export default {
           });
         }else{
           // 获取没有拆包的产品数据 --- 等接口
-
+         let resData = await getBatchInfoData({
+            sourceBizNo: receiveNo,
+            categoryCode: productCode,
+            batchNo: batchNo,
+          });
+         res.list = resData;
         }
       }
 

+ 6 - 6
src/views/inspectionWork/components/baseInfo.vue

@@ -59,7 +59,7 @@
       </el-col>
       <el-col :span="6">
         <el-form-item label="总数量:" prop="total">
-          <el-input type="number" v-model="form.total" @input="inputTotal" />
+          <el-input type="number" v-model="form.total" @input="inputTotal" disabled/>
         </el-form-item>
       </el-col>
     </el-row>
@@ -119,12 +119,12 @@
     <el-row>
       <el-col :span="6">
         <el-form-item label="合格率:" prop="qualificationRate">
-          <el-input type="number" v-model="form.qualificationRate" />
+          <el-input type="number" v-model="form.qualificationRate" disabled/>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="不合格率:" prop="noQualificationRate">
-          <el-input type="number" v-model="form.noQualificationRate" />
+          <el-input type="number" v-model="form.noQualificationRate" disabled/>
         </el-form-item>
       </el-col>
       <el-col :span="6">
@@ -163,13 +163,13 @@
       </el-col>
       <el-col :span="6">
         <el-form-item label="检验方式:" prop="qualityMode">
-          <DictSelection dictName="取样类型" v-model="form.qualityMode" disabled></DictSelection>
+          <DictSelection dictName="取样类型" v-model="form.qualityMode" ></DictSelection>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="质检状态:" prop="qualityResults">
           <el-select v-model="form.qualityResults" placeholder="请选择" style="width: 100%"
-                     :disabled="btnType == 'detail' || btnType == 'issued'" clearable>
+                     :disabled="btnType == 'issued'" clearable>
             <el-option label="合格" :value=1 />
             <el-option label="不合格" :value=2 />
           </el-select>
@@ -180,7 +180,7 @@
       <el-col :span="24">
         <el-form-item label="备注:" prop="remark">
           <el-input type="textarea" v-model="form.remark" placeholder="请输入"
-            :disabled="btnType == 'detail' || btnType == 'issued'" />
+            :disabled="btnType == 'issued'" />
         </el-form-item>
       </el-col>
     </el-row>

+ 16 - 15
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.qualitySampleTemplateList" border >
                             <el-table-column label="质检方案编码" prop="qualitySchemeTemplateCode" align="center">
                             </el-table-column>
                             <el-table-column label="质检方案名称" prop="qualitySchemeTemplateName"
@@ -130,26 +130,27 @@ export default {
     created() { },
     methods: {
         async openDia(index, row, type, list,isStatus) {
+          this.tableData = [];
             this.rowIndex = index
             this.type = type;
-            if (row != null && row.isStatus) {
-              this.tableDataUpdate(list);
-            }else{
-              if (isStatus){
-                this.tableDataUpdate(list);
-              }
-            }
-            this.tableData = list;
+            // if (row != null && row.isStatus) {
+            //   this.tableDataUpdate(list);
+            // }else{
+            //   if (isStatus){
+            //     this.tableDataUpdate(list);
+            //   }
+            // }
+            this.tableData.push(row);
 
             this.visible = true;
         },
         handleClose() {
-            this.tableData.forEach((item) => {
-                item.children.forEach((child) => {
-                    child.qualityResultContent = '';
-                    child.qualityResults = ''
-                })
-            })
+            // this.tableData.forEach((item) => {
+            //     item.children.forEach((child) => {
+            //         child.qualityResultContent = '';
+            //         child.qualityResults = ''
+            //     })
+            // })
             this.visible = false;
         },
         handleConfirm() {

+ 27 - 16
src/views/inspectionWork/edit.vue

@@ -51,19 +51,34 @@
               </template>
             </el-table-column>
           </template>
-          <el-table-column label="重量" prop="weight" align="center" width="100" fixed="right">
+          <el-table-column label="重量" prop="weight" align="center" width="100" fixed="right" :show-overflow-tooltip="true">
             <template slot-scope="scope">
               <el-input type="number" v-model="scope.row.weight" :min="0"></el-input>
             </template>
           </el-table-column>
-          <el-table-column label="重量单位" prop="weightUnit" align="center" width="80" fixed="right"></el-table-column>
-          <el-table-column label="质检状态" prop="qualityStatus" align="center" width="120" fixed="right">
+          <el-table-column label="重量单位" prop="weightUnit" align="center" width="80" fixed="right" :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column label="处置状态" prop="disposalStatus" align="center" width="80" fixed="right" :show-overflow-tooltip="true">
             <template slot-scope="scope">
-              <span v-if="scope.row.qualityStatus == 0 ">未质检</span>
-              <span v-if="scope.row.qualityStatus == 1 ">已质检</span>
+              <span v-if="scope.row.disposalStatus == 1 ">返工</span>
+              <span v-if="scope.row.disposalStatus == 2 ">返修</span>
+              <span v-if="scope.row.disposalStatus == 3 ">报废</span>
+              <span v-if="scope.row.disposalStatus == 4 ">降级使用</span>
+              <span v-if="scope.row.disposalStatus == 5 ">让步接收</span>
+              <span v-if="scope.row.disposalStatus == 6 ">留样</span>
+              <span v-if="scope.row.disposalStatus == 7 ">消耗</span>
+              <span v-if="scope.row.disposalStatus == 8 ">回用</span>
             </template>
           </el-table-column>
-          <el-table-column label="质检结果" prop="qualityResults" align="center" width="120" fixed="right">
+          <el-table-column label="处置时间" prop="disposeTime" align="center" width="100" fixed="right" :show-overflow-tooltip="true">
+          </el-table-column>
+          <el-table-column label="质检状态" prop="qualityStatus" align="center" width="120" fixed="right" :show-overflow-tooltip="true">
+            <template slot-scope="scope">
+              <span v-if="scope.row.qualityStatus == 0 ">未检</span>
+              <span v-if="scope.row.qualityStatus == 1 ">已检</span>
+              <span v-if="scope.row.qualityStatus == 2 ">待检</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="质检结果" prop="qualityResults" align="center" width="110" fixed="right" :show-overflow-tooltip="true">
             <template slot-scope="scope">
               <el-select v-model="scope.row.qualityResults" placeholder="请选择" style="width: 100%;"
                 :disabled="type == 'detail'" size="mini">
@@ -334,11 +349,8 @@ export default {
     },
     async queryQualitySamplContent() {
       const res = await queryQualitySamplContent({ qualityWorkerId: this.$route.query.id })
-
       let addStatus = res.map((item) => {
         item.isValid = true;
-        item.qualityResults = 1;
-        item.qualityStatus = 0;
         return {
           ...item
         }
@@ -468,7 +480,7 @@ export default {
 
       // 检查有效性
       for (const item of list) {
-        for (const child of item.children) {
+        for (const child of item.qualitySampleTemplateList) {
 
           console.log(child, 'child')
           if (!child.qualityResultContent || !child.qualityResults) {
@@ -480,18 +492,18 @@ export default {
 
       // 处理数据
       const hasInvalidItem = list.some(item =>
-        item.children.some(child => child.qualityResults === 2)
+        item.qualitySampleTemplateList.some(child => child.qualityResults === 2)
       );
       console.log('是否有不合格数据', hasInvalidItem)
 
       for (const item of list) {
-        const filteredData = item.children.filter((item) =>
+        const filteredData = item.qualitySampleTemplateList.filter((item) =>
           item.qualityResults == 2
         );
         console.log(filteredData, '不合格数据')
         if (filteredData.length > -1) {
           this.form.noQualifiedNumber = filteredData.length;
-          this.form.qualifiedNumber = item.children.length - filteredData.length;
+          this.form.qualifiedNumber = this.form.total - filteredData.length;
         }
       }
       console.log(list, 'listlistlistlist')
@@ -499,14 +511,13 @@ export default {
       const processedList = list.map(item => {
         item.qualityResults = hasInvalidItem ? 2 : 1;
         item.qualityStatus = 1;
-        item.qualitySampleTemplateList = item.children;
+        // item.qualitySampleTemplateList = item.children;
         item.isValid = !hasInvalidItem
-        delete item.children;
+        // delete item.children;
         return {
           ...item,
         }
       });
-
       this.$set(this.sampleList, index, processedList[0]);
 
       console.log(this.sampleList, processedList, '222表')

+ 77 - 0
src/views/samplemanagement/components/baseInfo.vue

@@ -0,0 +1,77 @@
+<template>
+  <el-form ref="form1" :model="form"  label-width="120px">
+    <el-row>
+      <el-col :span="6">
+        <el-form-item label="编码:" prop="code">
+          <el-input clearable v-model="form.code" placeholder="请输入" disabled />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="物品名称:" prop=" categoryName">
+          <el-input v-model="form.categoryName" disabled />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="物品编码:" prop=" categoryCode">
+          <el-input v-model="form.categoryCode" disabled />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="批次号:" prop=" batchNo">
+          <el-input v-model="form.batchNo" disabled />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="6">
+        <el-form-item label="规格:" prop=" specification">
+          <el-input v-model="form.specification" disabled />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="型号:" prop=" modelType">
+          <el-input v-model="form.modelType" disabled />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="牌号:" prop=" brandNo">
+          <el-input v-model="form.brandNo" disabled />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="重量:" prop="weight">
+          <el-input type="number" v-model="form.weight" disabled/>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+//接口
+import { rules } from 'eslint-config-prettier';
+
+export default {
+  components: {
+  },
+  props: {
+    form: {
+      type: Object,
+      default: () => { }
+    },
+    btnType: {
+      type: String,
+      default: ''
+    }
+  },
+  watch: {},
+  data() {
+    return {
+    };
+  },
+  created() {
+  },
+  methods: {
+  }
+};
+</script>
+<style lang="scss" scoped></style>

+ 148 - 0
src/views/samplemanagement/components/edit.vue

@@ -0,0 +1,148 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal :title="title" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+    :close-on-press-escape="false" append-to-body width="80%" :maxable="true">
+    <header-title title="基本信息"></header-title>
+    <base-info ref="baseInfoRefs" v-if="baseForm" :form="baseForm" :btnType="btnType" ></base-info>
+    <ele-pro-table ref="table" :columns="tableColumns" :datasource="datasource">
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+      </template>
+      <template v-slot:code="{ row }">
+        <el-link type="primary" :underline="false">
+          {{ row.code }}
+        </el-link>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link type="primary" :underline="false">
+          处置
+        </el-link>
+      </template>
+    </ele-pro-table>
+
+    <template v-slot:footer>
+      <el-button @click="handleClose">取消</el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+import {getSampleQWorkOrderIdPage} from "@/api/samplemanagement";
+import baseInfo from './baseInfo.vue';
+
+export default {
+  components: {
+    baseInfo
+  },
+  data() {
+    const defaultForm = function () {
+      return {
+      };
+    };
+    return {
+      defaultForm,
+      // 表单数据
+      baseForm: { ...defaultForm() },
+      title: null,
+      btnType: null,
+      visible: false,
+      qualityWorkOrderId: '',
+      qualitySampleList: [],
+      tableColumns: [
+        { label: '编码',prop: 'categoryCode', width: '150',align: 'center',showOverflowTooltip: true},
+        {label: '名称',prop: 'categoryName',width: '150',align: 'center',showOverflowTooltip: true},
+        { label: '批次号', prop: 'batchNo', align: 'center' ,showOverflowTooltip: true},
+        { label: '发货条码', prop: 'barcodes', align: 'center' ,showOverflowTooltip: true},
+        { label: '包装编码', prop: 'packageNo', align: 'center' ,showOverflowTooltip: true},
+        { label: '包装数量', prop: 'packingQuantity', align: 'center' ,showOverflowTooltip: true},
+        { label: '包装单位', prop: 'packingUnit', align: 'center' ,showOverflowTooltip: true},
+        { label: '计量数量', prop: 'measureQuantity', align: 'center' ,showOverflowTooltip: true},
+        { label: '计量单位', prop: 'measureUnit', align: 'center' ,showOverflowTooltip: true},
+        { label: '物料代号', prop: 'materielDesignation', align: 'center' ,showOverflowTooltip: true},
+        { label: '客户代号', prop: 'clientCode', align: 'center' ,showOverflowTooltip: true},
+        { label: '刻码', prop: 'engrave', align: 'center' ,showOverflowTooltip: true},
+        { label: '重量', prop: 'weight', align: 'center' ,showOverflowTooltip: true},
+        { label: '重量单位', prop: 'weightUnit', align: 'center' ,showOverflowTooltip: true},
+        { label: '仓库', prop: 'warehouseName', align: 'center' ,showOverflowTooltip: true},
+        { label: '货区', prop: 'areaName', align: 'center' ,showOverflowTooltip: true},
+        { label: '货架', prop: 'goodsShelfName', align: 'center' ,showOverflowTooltip: true},
+        { label: '货位', prop: 'goodsAllocationName', align: 'center' ,showOverflowTooltip: true},
+        { label: '生产日期', prop: 'productionDate', align: 'center' ,showOverflowTooltip: true},
+        { label: '采购日期', prop: 'purchaseDate', align: 'center' ,showOverflowTooltip: true},
+        { label: '样品状态', prop: 'disposalStatus', align: 'center' ,showOverflowTooltip: true ,fixed: 'right'},
+        {columnKey: 'action',label: '操作',align: 'center',width: 120,resizable: false,slot: 'action',fixed: 'right'}
+      ],
+    };
+  },
+  computed: {
+  },
+  watch: {
+  },
+
+  created() { },
+  methods: {
+    datasource({ page, where, limit }) {
+      where.qualityWorkOrderId = this.qualityWorkOrderId;
+      return getSampleQWorkOrderIdPage({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    async open(type, row) {
+      this.btnType = type;
+      this.title =type == 'add'? '新增': type == 'edit'? '编辑': '详情';
+      if (this.btnType != 'add') {
+        this.qualityWorkOrderId = row.qualityWorkOrderId;
+        this.baseForm = JSON.parse(JSON.stringify(row));
+      }
+      this.visible = true;
+    },
+    resetForm() {
+      this.baseForm = { ...this.defaultForm() };
+    },
+    handleClose() {
+      this.resetForm();
+      // this.resetTable();
+      this.visible = false;
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.location-warp {
+  display: flex;
+
+  .detail {
+    margin-left: 10px;
+  }
+}
+
+:deep(.el-form-item__content .el-input-group__prepend) {
+  background-color: #fff;
+}
+
+:deep(.el-dialog:not(.ele-dialog-form) .el-dialog__body .el-form .el-form-item:last-child) {
+  margin-bottom: 22px;
+}
+
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+
+.el-pagination {
+  padding: 12px 16px;
+  background: #fff;
+  border: 1px solid #ebeef5;
+  border-top: none;
+}
+</style>

+ 13 - 5
src/views/samplemanagement/index.vue

@@ -14,19 +14,22 @@
                     </el-link>
                 </template>
 
+
                 <!-- 操作列 -->
                 <template v-slot:action="{ row }">
-                    <el-link type="primary" :underline="false" @click="processingMethod">
+                    <el-link type="primary" :underline="false" @click="processingMethod('process', row)">
                         处理
                     </el-link>
                 </template>
             </ele-pro-table>
             <!-- <processingInfo ref="processingRefs"></processing> -->
         </el-card>
+      <edit ref="edit" ></edit>
     </div>
 </template>
 <script>
 import search from './components/search.vue';
+import edit from './components/edit.vue';
 
 import { getList } from '@/api/samplemanagement';
 
@@ -35,7 +38,8 @@ import dictMixins from '@/mixins/dictMixins';
 export default {
     mixins: [dictMixins],
     components: {
-        search
+      search,
+      edit
     },
     data() {
         return {
@@ -51,8 +55,12 @@ export default {
                 {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},
+                {prop: 'status',label: '状态',align: 'center',width: 80,fixed: 'right',
+                  formatter: (row, column, cellValue) => {
+                    return cellValue == 1 ? '已处置' : cellValue == 2 ? '未处置' : '';
+                  }
+                },
                 {columnKey: 'action',label: '操作',align: 'center',width: 120,resizable: false,slot: 'action',fixed: 'right'}
             ]
         };
@@ -72,8 +80,8 @@ export default {
         reload(where) {
             this.$refs.table.reload({ page: 1, where });
         },
-        processingMethod() {
-            this.$refs.processingRefs.open()
+        processingMethod(type, row) {
+            this.$refs.edit.open(type, row)
         },
     }
 };