Ver código fonte

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt

huang_an 1 ano atrás
pai
commit
f4f0023490

+ 11 - 0
src/api/bpm/components/saleManage/saleorder.js

@@ -424,3 +424,14 @@ export async function getReturnTableList(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+/**
+ * ids 查询生产计划
+ */
+export async function productionplanByIds(data) {
+  const res = await request.post(`/aps/productionplan/listByIds`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -426,8 +426,8 @@
         :sourceBizNo="form.returnHandleNo"
         :detailList="detailList"
       ></add>
-  
-      <inboundDetails :businessId="form.outinCode"      v-if="isShowReturnOrder&&taskDefinitionKey!='storeman'" ></inboundDetails>
+
+      <inboundDetails :businessId="form.returnInReceiptId"  :isInterior="true"    v-if="isShowReturnOrder&&taskDefinitionKey!='storeman'" ></inboundDetails>
       </el-tab-pane>
     </el-tabs>
 

+ 7 - 1
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrderDialog.vue

@@ -61,6 +61,11 @@
         dialogType: 'add',
         pageName: '',
         repairTabsOptions: [
+        {
+            label: '生产计划审核',
+            name: 'Activity_1lfkrs6',
+            isOutOrIn: 'innerStore'
+          },
           {
             label: '内部生产物品入库',
             name: 'innerStoremanIn',
@@ -222,7 +227,8 @@
     },
     methods: {
       getTableValue() {
-        return this.$refs.componentRef.getTableValue();
+        
+        return this.$refs.componentRef.getTableValue&&this.$refs.componentRef.getTableValue();
       },
       handleCard(val) {
         this.activeComp = val.key;

+ 263 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/productionPlanList.vue

@@ -0,0 +1,263 @@
+<template>
+  <div>
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :datasource="tableList"
+      :columns="columns"
+    >
+    </ele-pro-table>
+  </div>
+</template>
+<script>
+  import { productionplanByIds } from '@/api/bpm/components/saleManage/saleorder';
+  export default {
+    props: {
+      ids: {
+        default: () => []
+      }
+    },
+    watch: {
+      ids(val) {
+        // alert(1)
+        if (val.length) {
+          this.productionplanByIds();
+        }
+      }
+    },
+    data() {
+      return {
+        tableList:[],
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            slot: 'batchNo',
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 140,
+            sortable: true
+          },
+
+          {
+            slot: 'code',
+            prop: 'code',
+            action: 'code',
+            label: '计划编号',
+            align: 'center',
+
+            minWidth: 160,
+            sortable: true
+          },
+
+          {
+            prop: 'salesCode',
+            action: 'salesCode',
+            label: '销售订单号',
+            align: 'center',
+            minWidth: 160
+          },
+
+          {
+            prop: 'productCode',
+            label: '编码',
+            align: 'center',
+
+            minWidth: 140
+          },
+          {
+            prop: 'productName',
+            label: '名称',
+            align: 'center',
+
+            minWidth: 140
+          },
+
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 150,
+
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center',
+            width: 140,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'productNum',
+            label: '计划数量',
+            align: 'center',
+
+            slot: 'productNum'
+          },
+          {
+            prop: 'productWeight',
+            label: '计划重量',
+            align: 'center',
+
+            slot: 'productWeight'
+          },
+          {
+            prop: 'requiredFormingNum',
+            label: '要求生产数量',
+            align: 'center',
+
+            slot: 'requiredFormingNum'
+          },
+
+          {
+            prop: 'newSumOrderWeight',
+            label: '要求生产重量',
+            align: 'center',
+
+            slot: 'newSumOrderWeight'
+          },
+
+          {
+            prop: 'scheduleStatusName',
+            label: '进度状态',
+            align: 'center',
+            minWidth: 100
+          },
+
+          {
+            prop: '',
+            label: '已排产数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: '',
+            label: '未排产数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: '',
+            label: '已生产数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: '',
+            label: '未生产数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'factoryName',
+            label: '所属工厂',
+            align: 'center'
+          },
+
+          {
+            prop: '',
+            label: '合格品数',
+            align: 'center'
+          },
+
+          {
+            prop: '',
+            label: '不合格品数',
+            align: 'center'
+          },
+
+          {
+            prop: '',
+            label: '合格率',
+            align: 'center'
+          },
+
+          {
+            prop: 'reqMoldTime',
+            label: '计划完成日期',
+            align: 'center',
+            width: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'startTime',
+            label: '计划开始日期',
+            align: 'center',
+            width: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'endTime',
+            label: '计划结束日期',
+            align: 'center',
+            width: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+
+            minWidth: 80
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            width: 110,
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'status',
+            slot: 'status',
+            label: '状态',
+            align: 'center'
+          }
+        ]
+      };
+    },
+    computed: {},
+    created() {
+      this.productionplanByIds()
+    },
+    methods: {
+      productionplanByIds(){
+        
+        productionplanByIds({ids:this.ids}).then(res=>{
+          this.tableList=res
+        })
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped></style>

+ 99 - 29
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/repair-tabs-page.vue

@@ -11,7 +11,7 @@
     <keep-alive>
       <component
         v-if="activeName && isValidComponent(activeName)"
-        :is="activeName"
+        :is="componentVal"
         ref="componentRef"
         v-bind="activeNameProps"
       />
@@ -31,8 +31,12 @@
       // outerStoremanOut: () => import('./outboundToOutsourcing.vue'),
       outerStoremanOut: () =>
         import('@/views/bpm/outgoingManagement/outbound.vue'),
+      outerStoremanOutDetails: () =>
+        import('@/views/bpm/outgoingManagement/details.vue'),
       // outerStoremanIn: () => import('./interiorStorageToOutsourcing.vue'),
       outerStoremanIn: () => import('@/views/bpm/stockManagement/storage.vue'),
+      outerStoremanInDetails: () =>
+        import('@/views/bpm/stockManagement/details.vue'),
       // outerInQC: () => import('./interiorStorageToOutsourcingQuality.vue'),
       outerInQC: () => import('@/views/bpm/stockManagement/quality.vue'),
       // innerStoremanIn: () => import('./interiorProductionStorage'),
@@ -40,7 +44,11 @@
       // innerInQC: () => import('./interiorProductionStorageQuality'),
       innerInQC: () => import('@/views/bpm/stockManagement/quality.vue'),
       innerFillWeight: () => import('@/views/bpm/stockManagement/quality.vue'),
-      outerFillWeight: () => import('@/views/bpm/stockManagement/quality.vue')
+      outerFillWeight: () => import('@/views/bpm/stockManagement/quality.vue'),
+      Activity_1lfkrs6: () =>
+        import(
+          '@/views/bpm/handleTask/components/saleOrder/customerReturnGoods/productionPlanList.vue'
+        )
     },
     props: {
       taskDefinitionKey: {
@@ -69,12 +77,38 @@
         form: {},
         warehouseInfoString: '',
         activeName: '',
-        outList:[]
+        componentVal: '',
+        outList: [],
+        detailList: []
       };
     },
+    watch: {
+      activeName(val) {
+        let componentName = val;
+        const detailsArr = ['outerStoremanOut', 'outerStoremanIn'];
+        if (
+          detailsArr.includes(componentName) &&
+          componentName != this.taskDefinitionKey
+        ) {
+          componentName = componentName + 'Details';
+        }
+        console.log(
+          detailsArr.includes(componentName) &&
+            !detailsArr.includes(this.taskDefinitionKey),
+          'sss'
+        );
+        console.log(componentName, 'componentName');
+        this.componentVal = componentName;
+      }
+    },
     computed: {
       tabOption() {
         let list = [
+          {
+            label: '生产计划审核',
+            name: 'Activity_1lfkrs6',
+            isOutOrIn: 'innerStore'
+          },
           {
             label: '内部生产物品入库',
             name: 'innerStoremanIn',
@@ -114,7 +148,13 @@
         return list.filter((item) => item.isOutOrIn == this.activeComp);
       },
       activeNameProps() {
-        switch (this.activeName) {
+        switch (this.componentVal) {
+          case 'Activity_1lfkrs6':
+            return {
+              ids: this.form.detailList
+                .filter((item) => item.inOrOut == 1)
+                .map((item) => item.producePlanId)
+            };
           case 'innerStoremanIn':
             return {
               form: this.form,
@@ -125,18 +165,30 @@
             return {
               form: this.form,
               bizType: 6,
-              sourceBizNo: this.form.returnHandleNo
+              sourceBizNo: this.form.returnHandleNo,
+              detailList: this.detailList
+            };
+          case 'outerStoremanInDetails':
+            return {
+              businessId: this.form.outerInReceiptId,
+              isInterior: true
             };
           case 'outerStoremanOut':
             return {
               form: this.form,
               bizType: 7,
-              sourceBizNo: this.form.returnHandleNo,
-              // detailList:this.outList
+              sourceBizNo: this.form.returnHandleNo
+            };
+          case 'outerStoremanOutDetails':
+            return {
+              businessId: this.form.outerOutReceiptId,
+              isInterior: true
             };
+
           case 'outerInQC':
             return {
-              businessId: this.businessId
+              businessId: this.form.outerInReceiptId,
+              isInterior:true,
             };
           case 'innerInQC':
             return {
@@ -144,7 +196,8 @@
             };
           case 'outerFillWeight':
             return {
-              businessId: this.businessId,
+              businessId: this.form.outerInReceiptId,
+              isInterior:true,
               qualityInspectionItems: ['weight']
             };
           case 'innerFillWeight':
@@ -158,24 +211,33 @@
     async created() {
       this.form = await saleReturnGetByIdAPI(this.businessId);
       let totalCount = 0;
-      this.outList = this.form.detailList.filter((item) => { //外协
-        item['outType'] = item.outboundType;
-        item['categoryName'] = item.productName;
-        item['categoryCode'] = item.productCode;
-        item['packingQuantity'] = item.packageCount;
-        item['quantity'] = item.measurementCount;
-        item['measuringUnit'] = item.measurementUnit;
-        item['categoryId'] = item.productCategoryId;
-        item['engrave'] = item.carveCode;
-        item['categoryName'] = item.productCategoryName;
-        if (item.inOrOut == 2) {
+      this.form.productList = this.form.detailList
+        .filter((item) => item.inOrOut == 2)
+        .map((item) => {
+          totalCount += item.packageCount;
+          //外协
+          item['totalCount'] = item.packageCount;
+          item['quantity']=item.measurementCount
+          item['measuringUnit']=item.measurementUnit
+          
           return item;
-        }
-      });
-      // this.form.totalCount=totalCount
-      // this.form['warehouseId']=this.detailList[0].warehouseId
-      // this.form['warehouseName']= this.detailList[0].warehouseName
-      let innerStoreList = ['innerStoremanIn', 'innerFillWeight', 'innerInQC'];
+        });
+      this.detailList = this.form.detailList.filter(
+        (item) => item.inOrOut == 2
+      );
+      if (this.detailList.length) {
+        
+        this.form.totalCount = totalCount;
+        this.form['warehouseId'] = this.detailList[0].warehouseId;
+        this.form['warehouseName'] = this.detailList[0].warehouseName;
+      }
+
+      let innerStoreList = [
+        'Activity_1lfkrs6',
+        'innerStoremanIn',
+        'innerFillWeight',
+        'innerInQC'
+      ];
       let outerStoreList = [
         'outerStoremanOut',
         'outerStoremanIn',
@@ -183,6 +245,7 @@
         'outerInQC'
       ];
       if (this.activeComp === 'innerStore') {
+        console.log(this.taskDefinitionKey, 'dsdsd');
         // 内部处理流程
         if (innerStoreList.includes(this.taskDefinitionKey)) {
           this.activeName = this.taskDefinitionKey;
@@ -206,6 +269,7 @@
     methods: {
       isValidComponent(componentName) {
         const validComponents = [
+          'Activity_1lfkrs6',
           'outerStoremanOut',
           'outerStoremanIn',
           'outerInQC',
@@ -214,6 +278,7 @@
           'innerFillWeight',
           'outerFillWeight'
         ];
+
         return validComponents.includes(componentName);
       },
       handleClick(val) {
@@ -232,10 +297,15 @@
           let params = {
             returnRecordId: this.form.returnRecordId,
             id: this.form.id,
-            returnStorageData: await this.$refs.componentRef.getReturnStorage(),
-            qualityInspectionStatus: this.$refs.componentRef.getStatus&&await this.$refs.componentRef.getStatus(),
+            returnStorageData:
+              this.$refs.componentRef.getReturnStorage &&
+              (await this.$refs.componentRef.getReturnStorage()),
+            qualityInspectionStatus:
+              this.$refs.componentRef.getStatus &&
+              (await this.$refs.componentRef.getStatus()),
             qualityInspector:
-              ((this.$refs.componentRef&&this.$refs.componentRef.getQualityFile) &&
+              (this.$refs.componentRef &&
+                this.$refs.componentRef.getQualityFile &&
                 this.$refs.componentRef.getQualityFile()) ||
               {}
           };

+ 3 - 1
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/submit.vue

@@ -273,7 +273,7 @@
         let storageData = data.returnStorageData;
         // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
         storageData.isSkip = 1;
-        console.log(storageData);
+        console.log(storageData,'dasdsa');
         try {
           this.isLoading = true;
           const res = await outin.saveNew(storageData);
@@ -411,6 +411,8 @@
         try {
           this.isLoading = true;
           const res = await storageApi.storage(storageData);
+     
+          
           data.returnInReceiptId = res.data[0];
           await saleReturnUpdateAPI(data);
           approveTaskWithVariablesAPI({

+ 0 - 1
src/views/bpm/handleTask/components/saleOrder/returnGoods/submit.vue

@@ -185,7 +185,6 @@
           if (data.code != '0') {
             return;
           }
-
         }
         this.approveTaskWithVariables(status, returnType);
       },

+ 10 - 1
src/views/bpm/stockManagement/quality.vue

@@ -627,6 +627,10 @@
         default: () => {
           return ['result'];
         }
+      },
+      isInterior: {
+        type: Boolean,
+        default: false
       }
     },
     data() {
@@ -998,7 +1002,12 @@
       },
       async _getInfo(id) {
         if (!id) return;
-        const res = await storageApi.getInfoBySourceBizNo(id);
+        let res = null;
+        if (this.isInterior) {
+          res = await storageApi.getInboundDetailsById(id);
+        } else {
+          res = await storageApi.getInfoBySourceBizNo(id);
+        }
         console.log('===', res);
         this.infoData = res;
         this.extInfo = res.extInfo;

+ 1 - 2
src/views/bpm/stockManagement/storage.vue

@@ -1320,7 +1320,7 @@
                   this.packingSpecificationOption[index], // 包装规格选项
                 packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
                 // minPackingQuantity: 1, // 最小包装单元数量
-                packingQuantity: this.form.detailList.length, // 包装数量
+                packingQuantity: this.detailList.length||this.form.detailList.length, // 包装数量
                 packingUnit: item.packingUnit, // 单位
                 measureQuantity: this.form.totalCount, // 计量数量
                 measureUnit: item.measuringUnit, // 计量单位
@@ -1389,7 +1389,6 @@
                 purchaseDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`;
                 this.curDateType = 'purchaseDate';
               }
-
               return {
                 index: this.productList[0].index + '-' + index, // 包装索引
                 warehouseId: this.productList[0].warehouseIds[index], // 仓库id