Explorar el Código

质检计划增加受托检验类型

jingshuyong hace 9 meses
padre
commit
92d5acc582

+ 18 - 2
src/api/classifyManage/index.js

@@ -75,8 +75,6 @@ export async function getInfoById(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
-
 // 物品信息列表
 export async function getList(params) {
   const res = await request.get('/main/category/getList', {
@@ -96,4 +94,22 @@ export async function getTreeByGroup(data) {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+// 销售受托收货单记录
+export async function entrustedList(params) {
+  const res = await request.get(`/eom/saleentrustedreceive/listForQms`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 查询受托收货详情 entrustedReceiveCode productId productCode
+export async function entrustedDetails(id) {
+  const res = await request.get(`/eom/saleentrustedreceive/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 18 - 28
src/api/inspectionClassify/index.js

@@ -1,11 +1,8 @@
 import request from '@/utils/request';
 
+// 列表
 
-
-
-// 列表 
-
-export async function getList (data) {
+export async function getList(data) {
   let par = new URLSearchParams(data);
   const res = await request.get(`/qms/qualitylevel/page?` + par, {});
   if (res.data.code == 0) {
@@ -14,31 +11,25 @@ export async function getList (data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
-  
-
-  export async function getById(id) {
-    const res = await request.get(`/qms/qualitylevel/getById/${id}`);
-    if (res.data.code == 0) {
-      return res.data;
-    }
-    return Promise.reject(new Error(res.data.message));
+export async function getById(id) {
+  const res = await request.get(`/qms/qualitylevel/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
   }
+  return Promise.reject(new Error(res.data.message));
+}
 
-
-
-
-  // 编辑
-  export async function update (data) {
-    const res = await request.put(`/qms/qualitylevel/update`, data);
-    if (res.data.code == 0) {
-      return res.data.message;
-    }
-    return Promise.reject(new Error(res.data.message));
+// 编辑
+export async function update(data) {
+  const res = await request.put(`/qms/qualitylevel/update`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
   }
-  
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 删除
-export async function removeItem (data) {
+export async function removeItem(data) {
   const res = await request.delete('/qms/qualitylevel/delete', { data });
   if (res.data.code == 0) {
     return res.data.message;
@@ -46,9 +37,8 @@ export async function removeItem (data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 批量保存
-export async function saveBatch (data) {
+export async function saveBatch(data) {
   const res = await request.post(`/qms/qualitylevel/saveBatch`, data);
   if (res.data.code == 0) {
     return res.data;

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

@@ -718,6 +718,7 @@
       },
       //根据类型获取计划来源下拉
       typeChange(val) {
+        console.log(val,'34567')
         if (val == 1) {
           this.sourceList = [{ label: '采购收货单', value: '1' }];
         } else if (val == 2) {

+ 1 - 3
src/views/inspectionPlan/components/edit.vue

@@ -4,10 +4,8 @@
     :title="title"
     :visible.sync="visible"
     :before-close="handleClose"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
     append-to-body
-    width="80%"
+    width="80vw"
     :maxable="true"
   >
     <header-title title="基本信息"></header-title>

+ 270 - 0
src/views/inspectionPlan/components/entrustedDialog.vue

@@ -0,0 +1,270 @@
+<template>
+  <el-dialog
+    title="受托收货单"
+    :visible.sync="entrustedVisible"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="60%"
+    @onDone="onDone"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="topsearch">
+          <el-form :inline="true" :model="formInline" class="demo-form-inline">
+            <el-form-item label="产品名称:">
+              <el-input
+                clearable
+                v-model="formInline.productName"
+                placeholder="产品名称"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="产品编码:">
+              <el-input
+                clearable
+                v-model="formInline.productCode"
+                placeholder="产品编码"
+              ></el-input>
+            </el-form-item>
+            <el-button
+              type="primary"
+              size="small"
+              @click="reload"
+              style="margin-top: 4px"
+              >搜索</el-button
+            >
+            <el-button style="margin-top: 4px" size="small" @click="reset"
+              >重置</el-button
+            >
+          </el-form>
+        </el-col>
+        <el-col :span="24" class="table_col">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            cache-key="systemRoleTable3"
+            row-key="id"
+            height="50vh"
+          >
+          </ele-pro-table>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  const reviewStatus = {
+    0: '未提交',
+    1: '审核中',
+    2: '已审核',
+    3: '审核不通过',
+    7: '作废'
+  };
+  //   import AssetTree from '@/components/AssetTree/index.vue';
+  import { entrustedList } from '@/api/classifyManage';
+  export default {
+    // components: {
+    //   AssetTree
+    // },
+    props: {
+      selectList: Array,
+      type: {
+        default: 2 //1多选 2单选
+      },
+      isAll: {
+        default: false
+      },
+      entrustedVisible: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data() {
+      return {
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'orderNo',
+            label: '销售订单编码',
+            align: 'center',
+            slot: 'orderNo',
+            showOverflowTooltip: true,
+            sortable: true,
+            minWidth: 200
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 190
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'orderTotalCount',
+            label: '订单总数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+
+          {
+            prop: 'produceType',
+            label: '生产类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+            prop: 'productBrand',
+            label: '产品牌号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          }
+        ],
+        tableList: [],
+        selection: [],
+        formInline: {
+          productCode: '',
+          productName: ''
+        }
+      };
+    },
+
+    watch: {},
+    mounted() {
+      console.log(this.entrustedVisible, '12345');
+      // this.entrustedVisible = true;
+    },
+    methods: {
+      async datasource({ page, limit }) {
+        const params = {
+          pageNum: page,
+          size: limit,
+          ...this.formInline
+        };
+        const data = await entrustedList(params);
+        console.log(data, 'data');
+        this.tableList = data.list;
+        return data;
+      },
+      //   open(ids) {
+      //     this.entrustedVisible = true;
+      //     if (ids) {
+      //       this.ids = ids;
+      //     }
+      //   },
+      reload() {
+        this.$refs.equiTable.reload();
+      },
+      handleClose() {
+        // this.entrustedVisible = false;
+        this.formInline = {
+          productCode: '',
+          productName: ''
+        };
+        this.$emit('closeEntrusted');
+        // this.$refs.equiTable.clearSelection();
+      },
+      reset() {
+        this.formInline = {
+          productCode: '',
+          productName: ''
+        };
+        this.reload();
+      },
+      onDone() {
+        this.$nextTick(() => {
+          this.$refs.equiTable.setSelectedRowKeys(this.ids);
+        });
+      },
+      // 选择
+      selected() {
+        if (this.selection.length == 0) {
+          return this.$message.warning('请选择一条数据');
+        }
+        if (this.selection.length > 1 && this.type == 2) {
+          return this.$message.warning('只能选择一条数据');
+        }
+        this.formInline = {
+          productCode: '',
+          productName: ''
+        };
+
+        this.$emit('choose', this.selection[0]);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    max-height: 530px;
+    overflow: auto;
+  }
+  .table_col {
+    padding-left: 10px;
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+  .btns {
+    text-align: right;
+    padding: 10px 0;
+  }
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 78 - 9
src/views/inspectionPlan/components/new-baseInfo.vue

@@ -416,18 +416,28 @@
     <workOrder ref="workOrderRef" @choose="handleChoose" />
     <!-- 生产工单 -->
     <produceOrder ref="produceOrderRef" @choose="handleChoose" />
-    <EquipmentDialog
+    <!-- <EquipmentDialog
       ref="equipmentRefs"
       @choose="handleMainChoose"
       :type="2"
       :treeIds="['9']"
-    />
+    /> -->
     <!-- 成品检验 -->
     <stokledger ref="stokledgerRef" @choose="handleStokledgerChoose" />
     <ProductionVersion ref="versionRefs" @changeProduct="changeProduct" />
+    <!-- 受托收货单 -->
+    <entrustedDialog
+      :type="2"
+      @choose="entrustedChoose"
+      @closeEntrusted="closeEntrusted"
+      v-if="entrustedVisible"
+      :entrustedVisible="entrustedVisible"
+    />
   </el-form>
 </template>
 <script>
+  import { entrustedDetails } from '@/api/classifyManage';
+  import entrustedDialog from './entrustedDialog.vue';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import fileUpload from '@/components/addDoc/index.vue';
   import ProductionVersion from '@/views/inspectionWork/components/ProductionVersion.vue';
@@ -435,7 +445,7 @@
   import productionPlan from './productionPlan';
   import workOrder from './workOrder';
   import produceOrder from './produceOrder';
-  import EquipmentDialog from './equipmentDialog';
+  // import EquipmentDialog from './equipmentDialog';
   import stokledger from './stokledger';
 
   //接口
@@ -449,7 +459,7 @@
   import { getProduceTaskList } from '@/api/aps';
   export default {
     components: {
-      EquipmentDialog,
+      // EquipmentDialog,
       produceOrder,
       workOrder,
       productionPlan,
@@ -457,7 +467,8 @@
       deptSelect,
       fileUpload,
       stokledger,
-      ProductionVersion
+      ProductionVersion,
+      entrustedDialog
     },
     props: {
       form: {
@@ -575,7 +586,8 @@
         isInfoChangeModel: true,
         isOnce: true,
         isListData: [{}],
-        produceTaskList: []
+        produceTaskList: [],
+        entrustedVisible: false
       };
     },
     created() {
@@ -676,12 +688,14 @@
       },
       //计划来源选择
       planSourceChange(val) {
+        console.log(val, 'val 333');
         if (val) {
           this.addProduct();
           this.$emit('changeSource');
         }
       },
       addProduct() {
+        console.log(this.form.planSource, '00000000000000');
         if (this.form.planSource == 1) {
           this.$refs.warehousingRef.open();
         } else if (this.form.planSource == 2) {
@@ -691,15 +705,70 @@
         } else if (this.form.planSource == 4) {
           this.$refs.produceOrderRef.open();
         } else if (this.form.planSource == 5) {
-          //主数据
-          this.$refs.equipmentRefs.open();
+          //受托收货单
+          // this.$refs.equipmentRefs.open();
+          // this.$refs.entrustedRef.open();
+          this.entrustedVisible = true;
+          console.log(this.entrustedVisible, '00000');
         } else if (this.form.planSource == 6) {
           //库存台账
           this.$refs.stokledgerRef.open();
         }
       },
+      // 受托收货单选择
+      async entrustedChoose(val) {
+        this.fieldAssig(val);
+        const data = await getDetailInfo(val.productId);
+        this.categoryInfo = data.category;
+        // *** 新增 批次号,来源单据 字段传递
+        this.form.inspectionStandards = this.categoryInfo.measureType;
+        this.$emit('setSourceData', val);
+        let categoryQms = data.categoryQms;
+        if (!categoryQms || categoryQms.length == 0) {
+          return;
+        }
+        let obj = categoryQms.find((el) => el.dataType == 3);
+        if (!obj) return;
+        if (obj.checkFormula == 0) {
+          this.changeQualityMode(0);
+        }
+        if (obj.checkFormula == 1) {
+          this.changeQualityMode(1);
+        }
+        console.log(val, 'val 3');
+      },
+      fieldAssig(val) {
+        this.form.planSourceCode = val.entrustedReceiveCode;
+        this.form.planSourceId = val.entrustedReceiveId;
+        this.form.supplierName = val.supplierName;
+        this.form.supplierMark = val.supplierMark;
+        this.form.productName = val.productName;
+        this.form.productCode = val.productCode;
+        this.form.batchNo = val.batchNo;
+        this.form.specification = val.specification;
+        this.form.modelType = val.modelType;
+        this.form.brandNo = val.productBrand;
+        this.form.productNumber = val.totalCount;
+        this.form.qualifiedNumber = val.qualifiedNumber;
+        this.form.unqualifiedNumber = val.unqualifiedNumber;
+        this.form.qualificationRate = val.qualificationRate;
+        this.form.totalWeight = val.totalWeight;
+        this.form.sampleNumber = val.sampleNumber;
+        this.form.inspectionStandards = val.inspectionStandards;
+        this.form.produceTaskName = val.taskName;
+        this.form.produceTaskId = val.taskId;
+        this.form.productId = val.productId;
+      },
+      closeEntrusted() {
+        this.entrustedVisible = false;
+      },
       //根据类型获取计划来源下拉
       typeChange(val, type) {
+        console.log(val, 'val 3456');
+        if (val == 5) {
+          this.sourceList = [{ label: '受托收货单', value: '5' }];
+          return;
+        }
         if (val != 2) {
           this.form.produceRoutingId = '';
           this.form.produceRoutingName = '';
@@ -869,7 +938,7 @@
         taskId = '',
         source
       ) {
-        console.log('执行了没 333');
+        console.log('执行了没 333', val);
         const data = await getDetailInfo(val);
         this.categoryInfo = data.category;
 

+ 19 - 4
src/views/inspectionPlan/components/new-edit.vue

@@ -30,6 +30,7 @@
       @changeProductNumberModel="changeProductNumberModel"
       @changesStokledgerNumberModal="changesStokledgerNumberModal"
       @getQualityTemplate="getQualityTemplate"
+      @setSourceData="setSourceData"
     ></base-info>
     <header-title title="样品信息"></header-title>
     <el-form label-width="110px">
@@ -69,7 +70,7 @@
       </el-row>
       <el-row>
         <el-col :span="6">
-          <el-form-item label="样品类型:">
+          <el-form-item label="样品类型:"> 
             <el-input disabled :value="sampletypeVal(baseForm.conditionType)" />
           </el-form-item>
         </el-col>
@@ -499,7 +500,6 @@
         defaultForm,
         // 表单数据
         baseForm: { ...defaultForm() },
-
         tableColumns2: [
           {
             label: '样品编码',
@@ -522,7 +522,7 @@
           { label: '批次号', prop: 'batchNo', align: 'center', width: 120 },
           { label: '发货条码', prop: 'barcodes', align: 'center' },
           { label: '包装编码', prop: 'packageNo', align: 'center' },
-          { label: '包装数量', prop: 'packingQuantity', align: 'center' },
+          { label: '包装数量', prop: ' ', align: 'center' },
           { label: '包装单位', prop: 'packingUnit', align: 'center' },
           { label: '计量数量', prop: 'measureQuantity', align: 'center' },
           { label: '计量单位', prop: 'measureUnit', align: 'center' },
@@ -964,6 +964,7 @@
         console.log('数据22222');
         console.log(this.isOrder);
         // this.$refs.table12.setData(list);
+        console.log(list, 'list');
         this.sourceList = list;
         this.packingList = list;
 
@@ -979,6 +980,19 @@
         console.log(this.baseForm, 'form --');
       },
 
+      // 受托收货单
+      async setSourceData(data) {
+        let params = {
+          sourceBizNo: data.entrustedReceiveCode,
+          categoryCode: data.productCode,
+          categoryId: data.productId,
+          size: -1
+        };
+        const res = await outInRecordsPage(params);
+        this.sourceList = res.list || [];
+        console.log(res, 'list333');
+      },
+
       //成品类型检验类型,计划来源库存台账, 生成来源清单
       async changesStokledgerNumberModal(val, dimension, type) {
         val.map((el) => (el.sourceId = el.id));
@@ -1206,7 +1220,7 @@
           await this.getTemplateList(row.id);
         }
 
-        console.log(this.baseForm,'00000000')
+        console.log(this.baseForm, '00000000');
       },
       reload(where) {
         this.$nextTick(() => {
@@ -2011,6 +2025,7 @@
         console.log(this.baseForm.type, this.baseForm.planSource);
         // this.baseForm.isUnpack = val.categoryWms.isUnpack;
         console.log(val, '产品信息');
+        console.log(this.baseForm, 'baseForm');
         if (this.baseForm.type == 2 && this.baseForm.planSource == '4') {
           if (val.category.id) {
             const res1 = await getProductSteup(val.category.id);