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

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

lucw 1 год назад
Родитель
Сommit
db363ad455

+ 5 - 0
src/BIZComponents/inventoryTable.vue

@@ -432,6 +432,7 @@
           <el-date-picker
             style="width: 140px"
             v-model="scope.row.produceDeliveryDeadline"
+             value-format="yyyy-MM-dd"
             @change="
               setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
             "
@@ -456,6 +457,7 @@
           <el-date-picker
             style="width: 140px"
             v-model="scope.row.customerExpectDeliveryDeadline"
+             value-format="yyyy-MM-dd"
             @change="
               setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
             "
@@ -473,6 +475,7 @@
           <el-date-picker
             style="width: 140px"
             v-model="scope.row.guaranteePeriodDeadline"
+             value-format="yyyy-MM-dd"
             type="date"
             placeholder="选择日期"
           >
@@ -1247,6 +1250,8 @@
       // 返回列表数据
       getTableValue() {
         let comitDatasource = copyObj(this.form.datasource);
+        console.log(comitDatasource, 'comitDatasource');
+        
         if (comitDatasource.length === 0) return [];
         comitDatasource.forEach((v) => {
           if (v.guaranteePeriodUnitCode) {

+ 1 - 1
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -741,7 +741,7 @@ this.postOptions.push(...response.data);
   }
 
   .form-box {
-    max-height: 500px;
+    // max-height: 500px;
     min-width: 400px;
     overflow: auto;
     background: #4298fd0d;

+ 3 - 2
src/utils/util.js

@@ -37,14 +37,15 @@ export function randomString(len) {
 export function copyObj(obj) {
   //变量先置空
   let newobj = null;
-
   //判断是否需要继续进行递归
   if (typeof obj == 'object' && obj !== null) {
     newobj = obj instanceof Array ? [] : {}; //进行下一层递归克隆
     for (const i in obj) {
       newobj[i] = copyObj(obj[i]);
     } //如果不是对象直接赋值
-  } else newobj = obj;
+  } else {
+    newobj = obj;
+  }
   return newobj;
 }
 

+ 20 - 7
src/views/bpm/collaborative/detail.vue

@@ -1,11 +1,12 @@
 <template>
   <ele-modal
     :visible="formDetailDialogFlag"
-    width="400px"
+    :width="outgoingData?.id ? '80%' : '400px'"
     :centered="true"
     :close-on-click-modal="false"
     append-to-body
     :before-close="cancel"
+    :maxable="true"
   >
     <template slot="title">
       <div>
@@ -54,7 +55,11 @@
         </template>
       </fm-generate-form>
     </div>
-
+    <outgoingDetails
+      v-if="outgoingData.id"
+      :business-id="outgoingData.id"
+      :isInterior="true"
+    ></outgoingDetails>
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
     </div>
@@ -63,10 +68,12 @@
 <script>
   import dictMixins from '@/mixins/dictMixins';
   import { getToken } from '@/utils/token-util';
+  import outgoingDetails from '@/views/bpm/outgoingManagement/details.vue';
+  import storageApi from '@/api/warehouseManagement';
 
   export default {
     name: 'formDetailDialog',
-    components: {},
+    components: {outgoingDetails},
     props: {
       formDetailDialogFlag: {
         type: Boolean,
@@ -77,12 +84,18 @@
     data() {
       return {
         form: {},
-        jsonData: {}
+        jsonData: {},
+        outgoingData:{}
       };
     },
     methods: {
-      open(row) {
+       open(row) {
         this.form = _.cloneDeep(row);
+        if(this.form.id){
+          storageApi.getInfoBySourceBizNo(this.form.id).then(res=>{
+          this.outgoingData=res
+        })
+        }
         this.jsonData = JSON.parse(this.form.formJson.makingJson);
         this.jsonData.config.dataSource &&
           this.jsonData.config.dataSource.forEach((item) => {
@@ -116,7 +129,7 @@
 </script>
 <style scoped lang="scss">
   .eleModalBox {
-    max-height: 500px;
+    height: 100%;
     min-width: 300px;
     overflow: auto;
   }
@@ -125,7 +138,7 @@
     display: flex;
     justify-content: space-between;
   }
-    .blank_adopzrdd {
+  .blank_adopzrdd {
     display: flex;
     align-items: center;
     > span {

+ 12 - 0
src/views/bpm/handleTask/components/contractBook/detailDialog.vue

@@ -40,6 +40,13 @@
           >
             {{ form.sourceName }}
           </el-form-item>
+          <el-form-item
+            label="销售订单:"
+            prop="sourceName"
+            v-if="form.sourceType == 7"
+          >
+            {{ form.sourceName }}
+          </el-form-item>
           <el-form-item label="合同名称:" prop="contractName">
             {{ form.contractName }}
           </el-form-item>
@@ -256,6 +263,11 @@
             code: 6,
             name: '客户',
             parentId: '1'
+          },
+          {
+            code: 7,
+            name: '销售订单',
+            parentId: '1'
           }
         ],
         receiptPaymentListcolumns: [

+ 19 - 3
src/views/bpm/handleTask/components/productionWarehousing/detailDialog.vue

@@ -69,10 +69,18 @@
         ref="add"
         :form="form"
         :bizType="taskDefinitionKey == 'wmsBizType4' ? 4 : 1"
-        v-if="form.code"
+        v-if="form.code && !isDetail"
         :sourceBizNo="form.code"
         :detailList="form.detailList"
       ></add>
+      <add
+        ref="add"
+        :form="form"
+        :bizType="taskDefinitionKey == 'wmsBizType4' ? 4 : 1"
+        v-if="form.code && isDetail"
+        :sourceBizNo="form.code"
+        :saleProductList="form.detailList"
+      ></add>
     </keep-alive>
   </div>
 </template>
@@ -112,7 +120,8 @@
         form: {},
         detailData: {},
         totalPackage: '',
-        totalCount: ''
+        totalCount: '',
+        isDetail: false
       };
     },
     async created() {
@@ -171,8 +180,15 @@
             );
           }
 
+          this.isDetail =
+            this.form.detailList[0].isAllPackageData == 1 ? true : false;
+
           this.totalPackage =
-            this.form.detailList.length + this.form?.detailList[0]?.packingUnit;
+            this.form.detailList[0].isAllPackageData == 1
+              ? this.form.detailList[0].packingCount +
+                this.form?.detailList[0]?.packingUnit
+              : this.form.detailList.length +
+                this.form?.detailList[0]?.packingUnit;
           this.totalCount =
             this.form.totalCount + this.form?.detailList[0]?.measuringUnit;
           this.detailData = data;

+ 210 - 195
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -15,20 +15,39 @@
       <div v-for="item in tabOptions" :label="item.name" :name="item.name">
         <headerTitle :title="item.name"></headerTitle>
         <div v-if="item.key == 'main'">
-          <receiptInfo ref="modalRefs" :businessId="businessId" :form="form" :detailData="detailData">
+          <receiptInfo
+            ref="modalRefs"
+            :businessId="businessId"
+            :form="form"
+            :detailData="detailData"
+          >
           </receiptInfo>
         </div>
         <div v-if="item.key == 'inoutBound'">
-          <add ref="inoutBoundRef" :form="form" :sourceBizNo="form.receiveNo" :saleProductList="form.productList"
-            :bizType="form.outsourceSendCode?10:2" :detailProductList="detailData.productList"></add>
+          <add
+            ref="inoutBoundRef"
+            :form="form"
+            :sourceBizNo="form.receiveNo"
+            :saleProductList="form.productList"
+            :bizType="form.outsourceSendCode ? 10 : 2"
+            :detailProductList="detailData.productList"
+          ></add>
         </div>
         <div v-if="item.key == 'inoutBoundView'">
-          <detailDialog ref="inoutBoundViewRef"  :bizType="form.outsourceSendCode?10:2" :businessId="form.receiveNo" :isUpload="isUpload">
+          <detailDialog
+            ref="inoutBoundViewRef"
+            :bizType="form.outsourceSendCode ? 10 : 2"
+            :businessId="form.receiveNo"
+            :isUpload="isUpload"
+          >
           </detailDialog>
         </div>
         <div v-if="item.key == 'inoutBoundEdit'">
-          <procurementWarehousing :businessId="form.receiveNo" :qualityInspectionItems="qualityInspectionItems"
-            ref="inoutBoundEditRef">
+          <procurementWarehousing
+            :businessId="form.receiveNo"
+            :qualityInspectionItems="qualityInspectionItems"
+            ref="inoutBoundEditRef"
+          >
           </procurementWarehousing>
         </div>
       </div>
@@ -37,216 +56,212 @@
 </template>
 
 <script>
-import dictMixins from '@/mixins/dictMixins';
+  import dictMixins from '@/mixins/dictMixins';
 
-import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
+  import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
 
-import detailDialog from '@/views/bpm/stockManagement/details.vue';
+  import detailDialog from '@/views/bpm/stockManagement/details.vue';
 
-import procurementWarehousing from '@/views/bpm/stockManagement/quality.vue';
+  import procurementWarehousing from '@/views/bpm/stockManagement/quality.vue';
 
+  import receiptInfo from './receiptInfo.vue';
+  import add from '@/views/bpm/stockManagement/storage.vue';
 
+  import storageApi from '@/api/warehouseManagement';
+  // import fileMain from '@/components/addDoc/index.vue';
 
-import receiptInfo from './receiptInfo.vue';
-import add from '@/views/bpm/stockManagement/storage.vue';
-
-import storageApi from '@/api/warehouseManagement';
-// import fileMain from '@/components/addDoc/index.vue';
-
-export default {
-  props: {
-    businessId: {
-      default: ''
+  export default {
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
     },
-    taskId: {
-      default: ''
+    components: {
+      // fileMain,
+      detailDialog,
+      procurementWarehousing,
+      add,
+      receiptInfo
     },
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  components: {
-    // fileMain,
-    detailDialog,
-    procurementWarehousing,
-    add,
-    receiptInfo
-  },
-  mixins: [dictMixins],
-  data() {
-    return {
-      qualityInspectionItems: [
-        'materielDesignation',
-        'clientCode',
-        'engrave',
-        'weight',
-        'result'
-      ],
-      isUpload: false,
-      activeComp: 'main',
-      tabOptions: [{ key: 'main', name: '收货单详情' }],
-
-      visible: false,
-      detailId: '',
-      title: '详情',
-      row: {},
-      activeName: 'base',
-      form: {
-        orderFiles: [{ name: '222' }]
-      },
-      detailData: {},
-
-    };
-  },
-  async created() {
-    await this.getDetailData(this.businessId);
-    // getOutInBySourceBizNoOrError(this.form.receiveNo)
-    await storageApi
-      .getInfoBySourceBizNo(this.form.receiveNo)
-      .then((res) => {
-        if (JSON.stringify(res) == '{}') {
-          // 未查询到相关信息(未入库)
-          if (this.taskDefinitionKey == 'storeManagerApprove') {
-            this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
-            this.activeComp = 'inoutBound';
-            this.$emit('activeCompChange', 'inoutBound');
-            // this.$nextTick(() => {
-            //   this.$refs.add.pickerSuccess(this.form);
-            // });
-          }
-        } else {
-          if (this.taskDefinitionKey == 'qualityInspection') {
-            this.tabOptions.push({
-              key: 'inoutBoundEdit',
-              name: '入库单详情(已入库)'
-            });
-            this.activeComp = 'inoutBoundEdit';
-          } else if (this.taskDefinitionKey == 'qualityInspectionFeedback') {
-            this.tabOptions.push({
-              key: 'inoutBoundView',
-              name: '入库单详情'
-            });
-            this.isUpload = true;
-            this.activeComp = 'inoutBoundView';
+    mixins: [dictMixins],
+    data() {
+      return {
+        qualityInspectionItems: [
+          'materielDesignation',
+          'clientCode',
+          'engrave',
+          'weight',
+          'result'
+        ],
+        isUpload: false,
+        activeComp: 'main',
+        tabOptions: [{ key: 'main', name: '收货单详情' }],
+
+        visible: false,
+        detailId: '',
+        title: '详情',
+        row: {},
+        activeName: 'base',
+        form: {
+          orderFiles: [{ name: '222' }]
+        },
+        detailData: {}
+      };
+    },
+    async created() {
+      await this.getDetailData(this.businessId);
+      // getOutInBySourceBizNoOrError(this.form.receiveNo)
+      await storageApi
+        .getInfoBySourceBizNo(this.form.receiveNo)
+        .then((res) => {
+          if (JSON.stringify(res) == '{}') {
+            // 未查询到相关信息(未入库)
+            if (this.taskDefinitionKey == 'storeManagerApprove') {
+              this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
+              this.activeComp = 'inoutBound';
+              this.$emit('activeCompChange', 'inoutBound');
+              // this.$nextTick(() => {
+              //   this.$refs.add.pickerSuccess(this.form);
+              // });
+            }
           } else {
-            this.tabOptions.push({
-              key: 'inoutBoundView',
-              name: '入库单详情'
-            });
-            this.isUpload = false;
-            this.activeComp = 'inoutBoundView';
+            if (this.taskDefinitionKey == 'qualityInspection') {
+              this.tabOptions.push({
+                key: 'inoutBoundEdit',
+                name: '入库单详情(已入库)'
+              });
+              this.activeComp = 'inoutBoundEdit';
+            } else if (this.taskDefinitionKey == 'qualityInspectionFeedback') {
+              this.tabOptions.push({
+                key: 'inoutBoundView',
+                name: '入库单详情'
+              });
+              this.isUpload = true;
+              this.activeComp = 'inoutBoundView';
+            } else {
+              this.tabOptions.push({
+                key: 'inoutBoundView',
+                name: '入库单详情'
+              });
+              this.isUpload = false;
+              this.activeComp = 'inoutBoundView';
+            }
+            // if (
+            //   ![
+            //     'starter',
+            //     'deptLeaderApprove',
+            //     'storeManagerApprove',
+            //     'qualityInspection'
+            //   ].includes(this.taskDefinitionKey)
+            // ) {
+            //   this.tabOptions.push({
+            //     key: 'inoutBoundView',
+            //     name: '入库单详情'
+            //   });
+            //   this.isUpload = true;
+            //   this.activeComp = 'inoutBoundView';
+            // } else {
+            //   this.tabOptions.push({
+            //     key: 'inoutBoundEdit',
+            //     name: '入库单详情(已入库)'
+            //   });
+            //   this.activeComp = 'inoutBoundEdit';
+            // }
           }
-          // if (
-          //   ![
-          //     'starter',
-          //     'deptLeaderApprove',
-          //     'storeManagerApprove',
-          //     'qualityInspection'
-          //   ].includes(this.taskDefinitionKey)
-          // ) {
-          //   this.tabOptions.push({
-          //     key: 'inoutBoundView',
-          //     name: '入库单详情'
-          //   });
-          //   this.isUpload = true;
-          //   this.activeComp = 'inoutBoundView';
-          // } else {
-          //   this.tabOptions.push({
-          //     key: 'inoutBoundEdit',
-          //     name: '入库单详情(已入库)'
-          //   });
-          //   this.activeComp = 'inoutBoundEdit';
-          // }
-        }
-      })
-      .catch(() => {
-        this.$message.error('获取入库单详情失败');
-      });
-    console.log(this.tabOptions, 'this.tabOptions')
-
-
-  },
-
-  methods: {
-
-    changeActive(item) {
-      this.activeComp = item.key;
-      this.$emit('activeCompChange', item.key);
-      // if (
-      //   this.taskDefinitionKey == 'storeManagerApprove' &&
-      //   item.key == 'inoutBound'
-      // ) {
-      //   this.$nextTick(() => {
-      //     this.$refs.add.pickerSuccess(this.form);
-      //   });
-      // }
-    },
-    save(data) {
-      this.$refs.inoutBoundRef?.[0].handleSave(data);
+        })
+        .catch(() => {
+          this.$message.error('获取入库单详情失败');
+        });
+      console.log(this.tabOptions, 'this.tabOptions');
     },
-    success() {
-      // this.$parent.handleClose()
 
-      this.$emit('handleClose');
-    },
+    methods: {
+      changeActive(item) {
+        this.activeComp = item.key;
+        this.$emit('activeCompChange', item.key);
+        // if (
+        //   this.taskDefinitionKey == 'storeManagerApprove' &&
+        //   item.key == 'inoutBound'
+        // ) {
+        //   this.$nextTick(() => {
+        //     this.$refs.add.pickerSuccess(this.form);
+        //   });
+        // }
+      },
+      save(data) {
+        this.$refs.inoutBoundRef?.[0].handleSave(data);
+      },
+      success() {
+        // this.$parent.handleClose()
 
-    // 判断质检状态是否全部已检
-    allListChecked() {
-      return (
-        this.$refs.inoutBoundEditRef?.[0] &&
-        this.$refs.inoutBoundEditRef[0].getStatus()
-      );
-    },
-    async getTableValue() {
-      console.log(this.$refs)
-      return {
-        form: this.form,
-        returnStorageData: this.$refs.inoutBoundRef?.[0]&& await this.$refs.inoutBoundRef[0].getReturnStorage(),
-        isAllChecked:
+        this.$emit('handleClose');
+      },
+
+      // 判断质检状态是否全部已检
+      allListChecked() {
+        return (
           this.$refs.inoutBoundEditRef?.[0] &&
-          (await this.$refs.inoutBoundEditRef[0].getStatus()),
-
-        qualityInspector:
-          (this.$refs.inoutBoundViewRef?.[0] &&
-            this.$refs.inoutBoundViewRef[0].getQualityFile()) ||
-          {}
-        // qualityInspector:
-        //   (this.$refs.detailDialog &&
-        //     this.$refs.detailDialog.getQualityFile()) ||
-        //   {}
-      };
-    },
-    async getDetailData(id) {
-      this.loading = true;
-      const data = await getReceiveSaleOrderrecordDetail(id);
-      this.loading = false;
-      if (data) {
-        console.log(data, '1111111111111111111111');
-
-        this.form = data;
-        this.detailData = data;
+          this.$refs.inoutBoundEditRef[0].getStatus()
+        );
+      },
+      async getTableValue() {
+        console.log(this.$refs);
+        return {
+          form: this.form,
+          returnStorageData:
+            this.$refs.inoutBoundRef?.[0] &&
+            (await this.$refs.inoutBoundRef[0].getReturnStorage()),
+          isAllChecked:
+            this.$refs.inoutBoundEditRef?.[0] &&
+            (await this.$refs.inoutBoundEditRef[0].getStatus()),
+
+          qualityInspector:
+            (this.$refs.inoutBoundViewRef?.[0] &&
+              this.$refs.inoutBoundViewRef[0].getQualityFile()) ||
+            {}
+          // qualityInspector:
+          //   (this.$refs.detailDialog &&
+          //     this.$refs.detailDialog.getQualityFile()) ||
+          //   {}
+        };
+      },
+      async getDetailData(id) {
+        this.loading = true;
+        const data = await getReceiveSaleOrderrecordDetail(id);
+        this.loading = false;
+        if (data) {
+          console.log(data, '1111111111111111111111');
+
+          this.form = data;
+          this.detailData = data;
+        }
       }
     }
-  }
-};
+  };
 </script>
 
 <style scoped lang="scss">
-.ele-dialog-form {
-  .el-form-item {
-    margin-bottom: 10px;
+  .ele-dialog-form {
+    .el-form-item {
+      margin-bottom: 10px;
+    }
   }
-}
 
-.headbox {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
-    margin-right: 20px;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
 </style>

+ 6 - 0
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/boxTabPage.vue

@@ -170,6 +170,12 @@
         const data = await getPSaleEntrustedReceiveDetailAPI(id);
         if (data) {
           this.form = deepClone(data);
+          this.form.supplierId = data.contactId;
+          this.form.supplierName = data.contactName;
+          this.form.productList = this.form.productList.map((item) => {
+            item.supplierMark = item.customerMark;
+            return item;
+          });
           console.log(this.form);
         }
       }

+ 21 - 21
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/detailDialog.vue

@@ -170,13 +170,13 @@
             slot: 'productCode',
             align: 'center'
           },
-          {
-            minWidth: 100,
-            prop: 'productCategoryName',
-            label: '类型',
-            slot: 'productCategoryName',
-            align: 'center'
-          },
+          // {
+          //   minWidth: 100,
+          //   prop: 'productCategoryName',
+          //   label: '类型',
+          //   slot: 'productCategoryName',
+          //   align: 'center'
+          // },
           {
             width: 160,
             prop: 'productBrand',
@@ -229,13 +229,13 @@
             align: 'center'
           },
 
-          {
-            width: 110,
-            prop: 'orderTotalCount',
-            label: '订单总数量',
-            slot: 'orderTotalCount',
-            align: 'center'
-          },
+          // {
+          //   width: 110,
+          //   prop: 'orderTotalCount',
+          //   label: '订单总数量',
+          //   slot: 'orderTotalCount',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'totalCount',
@@ -244,13 +244,13 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 100,
-            prop: 'receiveTotalCount',
-            label: '已收货总数',
-            slot: 'receiveTotalCount',
-            align: 'center'
-          },
+          // {
+          //   width: 100,
+          //   prop: 'receiveTotalCount',
+          //   label: '已收货总数',
+          //   slot: 'receiveTotalCount',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'measuringUnit',

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -228,7 +228,7 @@
         detailData: {},
         childrenColumns: [
           {
-            width: 65,
+            width: 80,
             type: 'index',
             columnKey: 'index',
             align: 'center',
@@ -261,7 +261,7 @@
         let columnsVersion = this.columnsVersion;
         return [
           {
-            width: 45,
+            width: 65,
             type: 'index',
             columnKey: 'index',
             align: 'center',

+ 4 - 4
src/views/bpm/handleTask/components/saleOrder/returnGoods/detailDialog.vue

@@ -12,8 +12,8 @@
             {{ form.contactName }}
           </el-form-item>
           <el-form-item
-            label="退货类型:"
-            prop="contactName"
+            label="退货方式:"
+            prop="typeName"
             style="margin-bottom: 16px"
           >
             {{ form.typeName }}
@@ -116,10 +116,10 @@
     </ele-pro-table>
     <headerTitle
       title="退货物品明细"
-      v-show="['10', '20', '30'].includes(form.type)"
+      v-show="!['40', '50'].includes(form.type)"
     ></headerTitle>
     <ele-pro-table
-      v-show="['10', '20', '30'].includes(form.type)"
+      v-show="!['40', '50'].includes(form.type)"
       ref="table"
       :needPage="false"
       :columns="competAnalysisListcolumns"

+ 63 - 5
src/views/bpm/handleTask/formParser/formParserDialog.vue

@@ -2,11 +2,13 @@
   <ele-modal
     :visible="formParserDialogFlag"
     title="审批"
-    width="30%"
+    :width="width"
     :centered="true"
     :close-on-click-modal="false"
     append-to-body
     :before-close="cancel"
+    :maxable="true"
+    :resizable="true"
   >
     <fm-generate-form
       v-if="Object.keys(form?.formJson || {}).length !== 0"
@@ -36,6 +38,13 @@
         </div>
       </template>
     </fm-generate-form>
+
+    <outboundXTBG
+      v-if="form.taskDefinitionKey == 'CGYSP'"
+      :biz-type="4"
+      :source-biz-no="form?.processInstance.id"
+      ref="outboundXTBGRef"
+    ></outboundXTBG>
     <div slot="footer" class="dialog-footer">
       <el-form label-width="100px" ref="formRef" :model="form">
         <!-- prop="reason" -->
@@ -60,9 +69,18 @@
         type="success"
         size="mini"
         @click="handleAudit(1)"
+        v-if="form.taskDefinitionKey != 'CGYSP'"
         >通过
       </el-button>
-
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="storemanApprove(1)"
+        v-if="form.taskDefinitionKey == 'CGYSP'"
+        >出库
+      </el-button>
       <el-button
         icon="el-icon-circle-close"
         type="danger"
@@ -87,17 +105,18 @@
 </template>
 <script>
   import Parser from '@/components/FormGenerator/components/parser/Parser.vue';
-  import { projectsUpdateAPI } from '@/api/bpm/components/project-manage';
+  import outboundXTBG from '@/views/bpm/outgoingManagement/outboundXTBG.vue';
   import {
     approveTaskWithVariables,
     cancelTask,
     rejectTask
   } from '@/api/bpm/task';
   import { getToken } from '@/utils/token-util';
+  import storageApi from '@/api/warehouseManagement';
 
   export default {
     name: 'formParserDialog',
-    components: { Parser },
+    components: { Parser, outboundXTBG },
     props: {
       businessId: {
         default: ''
@@ -111,12 +130,18 @@
       return {
         form: {},
         index: '',
-        jsonData: {}
+        jsonData: {},
+        width: '30%',
+        isSaveLoading: false
       };
     },
     methods: {
       open(row) {
         this.form = _.cloneDeep(row);
+        console.log(this.form.taskDefinitionKey, 'this.form.taskDefinitionKey');
+        if (this.form.taskDefinitionKey == 'CGYSP') {
+          this.width = '70%';
+        }
         this.jsonData = JSON.parse(this.form.formJson.makingJson);
         this.jsonData.config.dataSource &&
           this.jsonData.config.dataSource.forEach((item) => {
@@ -132,6 +157,39 @@
       async handleAudit(status) {
         await this._approveTaskWithVariables(status);
       },
+
+      async storemanApprove(status) {
+        let storageData = await this.$refs.outboundXTBGRef.getReturnStorage();
+        console.log(storageData);
+
+        // 出库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+        storageData.isSkip = 1;
+        storageData.isMes = 1;
+        try {
+          this.isSaveLoading = true;
+          await storageApi.outStorage(storageData);
+          approveTaskWithVariables({
+            id: this.form.id,
+            reason: this.form.reason,
+            businessId: this.businessId,
+            variables: {
+              pass: true
+            }
+          }).then((res) => {
+            if (res.data.code != '-1') {
+       
+              this.$message.success(`出库成功!`);
+              this.$emit('reload');
+              this.cancel();
+            }
+            this.isSaveLoading = false;
+          });
+        } catch (error) {
+          this.isSaveLoading = false;
+          console.error('出库失败:', error);
+        }
+      },
+
       async _approveTaskWithVariables(status) {
         let variables = {
           pass: !!status

+ 11 - 1
src/views/bpm/outgoingManagement/details.vue

@@ -53,6 +53,11 @@
                   <span>{{ infoData.fromUserPhone }}</span>
                 </el-form-item>
               </el-col>
+              <el-col :span="8">
+                <el-form-item label="出库时间">
+                  <span>{{ infoData.storageTime||infoData.createTime }}</span>
+                </el-form-item>
+              </el-col>
               <el-col :span="8">
                 <el-form-item label="出库登记人">
                   <span>{{ infoData.extInfo?.createUserName }}</span>
@@ -520,7 +525,12 @@
         //多个出库单ID
         type: Boolean,
         default: false
-      }
+      },
+      XTBG: {
+        //协同办公进来的
+        type: Boolean,
+        default: false
+      },
     },
     data() {
       return {

+ 38 - 0
src/views/bpm/outgoingManagement/outbound.vue

@@ -87,6 +87,16 @@
               </el-select> -->
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="出库时间">
+              <el-date-picker
+                v-model="formData.storageTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="选择日期时间"
+              >
+              </el-date-picker></el-form-item
+          ></el-col>
           <el-col :span="6">
             <el-form-item label="出库登记人">
               <el-input
@@ -571,6 +581,7 @@
         qualityResults, // 质检结果
         treeList: [],
         formData: {
+          storageTime:"",
           extInfo: {
             assetType: [], //物品类型id
             assetTypeName: '', //物品类型名称
@@ -633,9 +644,36 @@
       this.getListItems();
       this.initDeptData().then(() => {
         this.initFormData();
+        this.getNowFormatDate()
+
       });
     },
     methods: {
+      // 获取当前时间函数
+      getNowDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        return obj;
+      },
+      // 赋值入库时间
+      getNowFormatDate() {
+        const obj = this.getNowDate();
+        const defaultTime = '00:00:00';
+        const currentTime = `${obj.hour}:${obj.minute}:${obj.second}`;
+
+        this.formData.storageTime = `${obj.year}-${obj.month}-${obj.strDate} ${currentTime}`;
+      },
+
       // 获取动态表头
       getFieldModel() {
         storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {

+ 1387 - 0
src/views/bpm/outgoingManagement/outboundXTBG.vue

@@ -0,0 +1,1387 @@
+<!-- 协同办公使用 -->
+<template>
+  <div>
+    <el-card shadow="never">
+      <header-title title="基本信息"></header-title>
+      <el-form
+        :model="formData"
+        ref="formName"
+        label-width="110px"
+        :rules="rules"
+      >
+        <el-row :gutter="20">
+          <el-col :span="6">
+            <el-form-item label="出库场景" prop="bizType">
+              <!-- <el-select
+                filterable
+                placeholder="请选择"
+                v-model="formData.bizType"
+                clearable
+                @change="handleBizSceneChange"
+                :disabled="!!(productList && productList.length)"
+              >
+                <el-option
+                  v-for="item in outputSceneState"
+                  :key="item.code"
+                  :value="item.code"
+                  :label="item.label"
+                ></el-option>
+              </el-select> -->
+              <el-select
+                filterable
+                placeholder="请选择"
+                v-model="formData.bizType"
+                clearable
+                @change="handleBizSceneChange"
+              >
+                <el-option
+                  v-for="item in outputSceneState"
+                  :key="item.code"
+                  :value="item.code"
+                  :label="item.label"
+                ></el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item label="单据来源" prop="documentSource">
+              <el-input
+                placeholder="请选择"
+                disabled
+                v-model="formData.sourceBizNo"
+                @click.native="openDocumentSourceDialog"
+              >
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="出库物品类型" prop="extInfo.assetType">
+              <el-select
+                style="width: 100%"
+                multiple
+                v-model="formData.extInfo.assetType"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in goodsLists"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <!-- <el-select
+                style="width: 100%"
+                multiple
+                :disabled="!!(productList && productList.length)"
+                v-model="formData.extInfo.assetType"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in goodsLists"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select> -->
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="出库时间">
+              <el-date-picker
+                v-model="formData.storageTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="选择日期时间"
+              >
+              </el-date-picker></el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item label="出库登记人">
+              <el-input
+                placeholder="登记人"
+                disabled
+                v-model="formData.extInfo.createUserName"
+                clearable /></el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item
+              :label="this.bizType == 10 ? '申请人部门' : '领料人部门'"
+              prop="extInfo.verifyDeptCode"
+            >
+              <selectTree
+                ref="tree"
+                class="form-ipt"
+                size="medium"
+                style="width: 100%"
+                clearable
+                :value="formData.extInfo.verifyDeptCode"
+                :options="treeList"
+                :props="{
+                  value: 'id',
+                  label: 'name',
+                  children: 'children'
+                }"
+                @getValue="auditorDeptClick"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item
+              :label="this.bizType == 10 ? '申请人' : '领料人'"
+              prop="fromId"
+            >
+              <el-select
+                v-model="formData.fromId"
+                filterable
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in llrLsit"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                  @click.native="userSlected(item)"
+                >
+                </el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <!-- <el-col :span="6">
+            <el-form-item label="领料人联系方式" prop="fromUserPhone">
+              <el-input
+                placeholder="请输入"
+                disabled
+                v-model="formData.extInfo.fromUserPhone"
+                clearable /></el-form-item
+          ></el-col> -->
+          <el-col :span="12">
+            <el-form-item label="备注" prop="remark">
+              <el-input
+                v-model="formData.remark"
+                placeholder="请详细说明"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div>
+        <el-button
+          style="margin-bottom: 20px; float: right; margin-right: 20px"
+          type="primary"
+          @click="addStock"
+          >添加</el-button
+        >
+      </div>
+      <div class="material">
+        <div>
+          <header-title title="物品清单"></header-title>
+          <div class="mt10 form-table">
+            <el-table
+              ref="productListTable"
+              :data="productList"
+              tooltip-effect="dark"
+              :max-height="300"
+              :header-cell-style="rowClass"
+              border
+            >
+              <el-table-column label="序号" type="index" width="50">
+              </el-table-column>
+              <el-table-column
+                label="编码"
+                prop="categoryCode"
+                align="center"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="名称"
+                align="center"
+                prop="categoryName"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                v-if="clientEnvironmentId == 4"
+                label="级别"
+                prop="level"
+                align="center"
+              >
+              </el-table-column>
+              <el-table-column
+                label="型号"
+                align="center"
+                prop="categoryModel"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="规格"
+                align="center"
+                prop="specification"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="牌号"
+                align="center"
+                prop="brandNum"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                v-for="(item, index) in newColumns"
+                :label="item.label"
+                :align="item.align"
+                :key="item.prop"
+                :prop="item.prop"
+                :show-overflow-tooltip="item.showOverflowTooltip"
+              ></el-table-column>
+              <el-table-column
+                label="批次号"
+                prop="batchNo"
+                align="center"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="包装数量"
+                prop="packingQuantity"
+                width="80"
+              ></el-table-column>
+              <el-table-column
+                label="单位"
+                prop="packingUnit"
+              ></el-table-column>
+              <el-table-column
+                label="计量数量"
+                prop="measureQuantity"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="计量单位"
+                prop="measureUnit"
+              ></el-table-column>
+              <el-table-column
+                label="重量"
+                prop="weight"
+                align="center"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="重量单位"
+                prop="weightUnit"
+                align="center"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column label="机型" prop="modelKey" width="200">
+              </el-table-column>
+              <el-table-column label="颜色" prop="colorKey" width="200">
+              </el-table-column>
+              <el-table-column
+                label="库存"
+                prop="stockNum"
+                align="center"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="单价"
+                prop="price"
+                align="center"
+                v-if="isPrice == 1"
+              >
+                <template slot-scope="{ row }">
+                  <template>
+                    {{ row.price ? row.price : ' ' + '元' }}/{{
+                      row.measureUnit
+                    }}
+                  </template>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                label="金额"
+                align="center"
+                prop="totalMoney"
+                :show-overflow-tooltip="true"
+                v-if="isPrice == 1"
+              >
+                <template slot-scope="{ row, $index }">
+                  {{ row.totalMoney ? row.totalMoney : 0 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-if="clientEnvironmentId == 4"
+                label="采购原因"
+                align="center"
+                prop="purpose"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="仓库"
+                prop="warehouseName"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="supplierName"
+                label="供应商"
+                min-width="200"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                prop="supplierCode"
+                label="供应商代号"
+                min-width="200"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column label="操作" width="120" align="center">
+                <template slot="header" slot-scope="scope"> 操作 </template>
+                <template slot-scope="{ row, $index }">
+                  <el-link type="danger" @click="deleteProductList(row, $index)"
+                    >删除</el-link
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+          <header-title class="mt20" title="包装清单"></header-title>
+          <div class="mt10 form-table">
+            <el-table
+              ref="showPackingListTable"
+              :data="showPackingList"
+              tooltip-effect="dark"
+              :max-height="300"
+              :row-class-name="tableRowClassName"
+              :header-cell-style="rowClass"
+              border
+              v-el-table-infinite-scroll="pickingHandleScroll"
+            >
+              <el-table-column label="序号" type="index" width="50">
+              </el-table-column>
+              <el-table-column
+                label="编码"
+                prop="categoryCode"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="名称"
+                prop="categoryName"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="批次号"
+                prop="batchNo"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="发货条码"
+                prop="barcodes"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="包装编码"
+                prop="packageNo"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="包装数量"
+                prop="packingQuantity"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="单位"
+                prop="packingUnit"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="计量数量"
+                prop="measureQuantity"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="计量单位"
+                prop="measureUnit"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                label="物料代号"
+                prop="materielDesignation"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="客户代号"
+                prop="clientCode"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="刻码"
+                prop="engrave"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="重量"
+                prop="weight"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="重量单位"
+                prop="weightUnit"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column label="机型" prop="modelKey" width="200">
+              </el-table-column>
+              <el-table-column label="颜色" prop="colorKey" width="200">
+              </el-table-column>
+              <el-table-column
+                label="质检结果"
+                prop="result"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row }">
+                  <span>{{ qualityResults[row.result] }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="质检状态"
+                prop="status"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row }">
+                  <span>{{ qualityStatus[row.status] }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="生产日期"
+                prop="productionDate"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                label="采购日期"
+                prop="purchaseDate"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="supplierName"
+                label="供应商"
+                min-width="200"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column
+                prop="supplierCode"
+                label="供应商代号"
+                min-width="200"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+            </el-table>
+          </div>
+        </div>
+        <!-- <div class="mt20">
+          <header-title class="mt20" title="物料明细"></header-title>
+          <el-table ref="multipleTable" :data="showMaterialList" tooltip-effect="dark" :max-height="300"
+            :row-class-name="tableRowClassName" :header-cell-style="rowClass" border style="width: 100%" stripe
+            height="300px" v-el-table-infinite-scroll="materielHandleScroll">
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column label="编码" prop="categoryCode" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="名称" prop="categoryName" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="批次号" prop="batchNo"></el-table-column>
+            <el-table-column label="物料编码" prop="materialCode" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="发货条码" prop="barcodes" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="计量数量" prop="minPackingQuantity"></el-table-column>
+            <el-table-column label="计量单位" prop="measureUnit"></el-table-column>
+            <el-table-column label="物料代号" prop="materielDesignation">
+            </el-table-column>
+            <el-table-column label="客户代号" prop="clientCode">
+            </el-table-column>
+            <el-table-column label="刻码" prop="engrave"> </el-table-column>
+            <el-table-column width="100" label="重量" prop="weight">
+            </el-table-column>
+            <el-table-column label="重量单位" prop="weightUnit">
+            </el-table-column>
+            <el-table-column label="质检结果" prop="result" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="质检状态" prop="status" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div> -->
+      </div>
+    </el-card>
+    <AssetsDialog
+      ref="assetsDialogRef"
+      :treeIds="formData.extInfo?.assetType"
+      @detailData="detailData"
+      :productLists="this.productList"
+    />
+  </div>
+</template>
+
+<script>
+  import storageApi from '@/api/warehouseManagement/index.js';
+  import elTableInfiniteScroll from 'el-table-infinite-scroll';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { getTreeByGroup } from '@/api/classifyManage';
+  import {
+    outputSceneState,
+    qualityResults,
+    qualityStatus
+  } from '@/utils/dict/index';
+
+  import selectTree from '@/components/selectTree';
+  import AssetsDialog from './components/AssetsDialog.vue';
+  import { deepClone } from '@/components/FormGenerator/utils/index';
+  import { mapGetters } from 'vuex';
+  import { parameterGetByCode } from '@/api/main/index.js';
+
+  export default {
+    components: {
+      selectTree,
+      AssetsDialog
+    },
+    props: {
+      form: { type: Object, default: {} },
+      bizType: { type: Number, default: 1 },
+      sourceBizNo: { type: String, default: '' },
+      type: { type: String, default: '正常出库' },
+      detailList: { type: Array, default: () => [] },
+      saleProductList: { type: Array, default: () => [] },
+      extractedList: { type: Array, default: () => [] },
+      wwType: { type: Number, default: null }
+    },
+    directives: {
+      'el-table-infinite-scroll': elTableInfiniteScroll
+    },
+    data() {
+      return {
+        newColumns: [], // 动态表头
+        goodsLists: [], // 商品列表
+        productList: [], // 产品列表
+        showPackingList: [], // 展示的包装列表
+        packingList: [], // 包装列表
+        showMaterialList: [], // 展示物料列表
+        materialList: [], // 物料列表
+        extInfo: {}, // 扩展信息
+        pageSize: 20,
+        pickingPageNum: 1,
+        materielPageNum: 1,
+        dimension: '3',
+        outputSceneState,
+        qualityStatus, // 质检状态
+        qualityResults, // 质检结果
+        treeList: [],
+        formData: {
+          storageTime: '',
+          extInfo: {
+            assetType: [], //物品类型id
+            assetTypeName: '', //物品类型名称
+            deptCode: '', //部门code
+            deptName: '', //部门名称
+            verifyDeptCode: '', //审核部门编码
+            verifyDeptName: '', //审核部门名称
+            deliveryName: '', //送货人名称
+            fromUserPhone: '', //送货人电话
+            sourceBizNo: '', //销售订单
+            urgent: '', //紧急状态
+            supplierId: '', //供应商ID
+            supplierName: '', //供应商名称
+            createUserName: '', //创建人名字
+            contentImage: [] //图片数组
+          },
+          fromId: '', //领料人
+          fromUser: '', //送货人
+          bizType: '', //物品类型
+          verifyId: '', //审核人Id
+          verifyName: '', //审核人名称
+          createUserId: '',
+          remark: ''
+        },
+        rules: {
+          bizType: {
+            required: true,
+            message: '请选择出库场景',
+            trigger: 'change'
+          },
+          'extInfo[verifyDeptCode]': {
+            required: true,
+            message: '请选择领料人部门',
+            trigger: ['change', 'blur']
+          },
+          fromId: {
+            required: true,
+            message: '请选择',
+            trigger: 'change'
+          }
+        },
+        llrLsit: [],
+        isPrice: 1
+      };
+    },
+    computed: {
+      ...mapGetters(['user']),
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    async created() {
+      //仓库出入库是否显示金额(0:不显示 1:显示)
+      parameterGetByCode({
+        code: 'wms_price'
+      }).then((res) => {
+        this.isPrice = res.value;
+      });
+      this.getFieldModel();
+      this.getListItems();
+      this.initDeptData().then(() => {
+        this.initFormData();
+        this.getNowFormatDate();
+      });
+    },
+    methods: {
+      // 获取当前时间函数
+      getNowDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        return obj;
+      },
+      // 赋值入库时间
+      getNowFormatDate() {
+        const obj = this.getNowDate();
+        const defaultTime = '00:00:00';
+        const currentTime = `${obj.hour}:${obj.minute}:${obj.second}`;
+
+        this.formData.storageTime = `${obj.year}-${obj.month}-${obj.strDate} ${currentTime}`;
+      },
+
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
+      userSlected(data) {
+        this.formData.fromId = data.id;
+        this.formData.fromUser = data.name;
+        this.formData.fromUserPhone = data.phone;
+      },
+      openDocumentSourceDialog() {
+        console.log('打开单据来源弹窗');
+      },
+      clearDocumentSource() {
+        console.log('清空');
+      },
+      pickingHandleScroll() {
+        console.log('---------pickingHandleScroll------------');
+        if (this.showPackingList.length < this.packingList.length) {
+          if (this.packingList.length > this.pageSize) {
+            this.pickingPageNum += 1;
+          }
+          this.pickingFetchData();
+        }
+      },
+      pickingFetchData() {
+        const start = (this.pickingPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showPackingList = this.showPackingList.concat(
+          this.packingList.slice(start, end)
+        );
+      },
+      materielHandleScroll() {
+        console.log('---------materielHandleScroll------------');
+        if (this.showMaterialList.length < this.materialList.length) {
+          if (this.materialList.length > this.pageSize) {
+            this.materielPageNum += 1;
+          }
+          this.materielFetchData();
+        }
+      },
+      materielFetchData() {
+        const start = (this.materielPageNum - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        this.showMaterialList = this.showMaterialList.concat(
+          this.materialList.slice(start, end)
+        );
+        console.log(this.showMaterialList);
+      },
+      // 获取物品列表
+      async getListItems() {
+        const { data } = await getTreeByGroup({});
+        this.goodsLists = data;
+      },
+      // 打开单据来源弹窗
+      openDocumentSourceDialog() {
+        console.log('打开单据来源弹窗');
+      },
+      tableRowClassName({ row, rowIndex }) {
+        console.log(row);
+        if (row.result == 1) {
+          return 'warning-row';
+        } else {
+          return '';
+        }
+      },
+      detailData(data, dimension) {
+        this.dimension = dimension;
+
+        const mergedData = [...(this.formData.outInDetailList || []), ...data];
+        this.formData.outInDetailList = mergedData;
+
+        this.productList = data.map((productItem) => {
+          return {
+            ...productItem,
+            outInDetailRecordRequestList:
+              productItem.outInDetailRecordRequestList.map((packingItem) => {
+                return {
+                  ...packingItem,
+                  workOrderId:
+                    this.type === '自选领用出库'
+                      ? this.form.detailList[0].workOrderId
+                      : '',
+                  pickOrderId:
+                    this.type === '自选领用出库'
+                      ? this.form.detailList[0].pickOrderId
+                      : '',
+                  taskId:
+                    this.type === '自选领用出库'
+                      ? this.form.detailList[0].taskId
+                      : '',
+                  categoryName: productItem.categoryName,
+                  categoryCode: productItem.categoryCode,
+                  supplierCode: productItem.supplierCode,
+                  supplierName: productItem.supplierName,
+                  materialDetailList: packingItem.materialDetailList.map(
+                    (materialItem) => {
+                      return {
+                        ...materialItem,
+                        categoryName: productItem.categoryName,
+                        categoryCode: productItem.categoryCode,
+                        supplierCode: productItem.supplierCode,
+                        supplierName: productItem.supplierName
+                      };
+                    }
+                  )
+                };
+              })
+          };
+        });
+
+        const newProducts = mergedData.map((productItem) => ({
+          ...productItem,
+          outInDetailRecordRequestList:
+            productItem.outInDetailRecordRequestList.map((packingItem) => ({
+              ...packingItem,
+              categoryName: productItem.categoryName,
+              categoryCode: productItem.categoryCode,
+              supplierCode: productItem.supplierCode,
+              supplierName: productItem.supplierName,
+              workOrderId:
+                this.type === '自选领用出库'
+                  ? this.form.detailList[0].workOrderId
+                  : '',
+              pickOrderId:
+                this.type === '自选领用出库'
+                  ? this.form.detailList[0].pickOrderId
+                  : '',
+              taskId:
+                this.type === '自选领用出库'
+                  ? this.form.detailList[0].taskId
+                  : '',
+              materialDetailList: packingItem.materialDetailList.map(
+                (materialItem) => ({
+                  ...materialItem,
+                  categoryName: productItem.categoryName,
+                  categoryCode: productItem.categoryCode,
+                  supplierCode: productItem.supplierCode,
+                  supplierName: productItem.supplierName
+                })
+              )
+            }))
+        }));
+
+        // 去重合并产品列表和新产品列表
+        const uniqueProducts = [
+          ...new Map(
+            [...this.productList, ...newProducts].map((item) => [item.id, item])
+          ).values()
+        ];
+        this.productList = uniqueProducts;
+        // 排序
+        this.productList.sort((a, b) => a.categoryCode - b.categoryCode);
+
+        // 获取包装维度数据
+        const arr = [];
+        for (const key in this.productList) {
+          for (const k in this.productList[key].outInDetailRecordRequestList) {
+            arr.push({
+              ...this.productList[key].outInDetailRecordRequestList[k]
+            });
+          }
+        }
+        this.packingList = arr;
+
+        const newPacking = [];
+        newProducts.forEach((item) => {
+          newPacking.push(...item.outInDetailRecordRequestList);
+        });
+        //去重
+        const newPackingList = [
+          ...new Map(
+            [...this.packingList, ...newPacking].map((item) => [item.id, item])
+          ).values()
+        ];
+        this.packingList = newPackingList;
+
+        this.packingList.sort((a, b) => a.categoryCode - b.categoryCode);
+
+        // 获取物料维度数据
+        let iArr = [];
+        arr.forEach((item) => {
+          item.materialDetailList.forEach((ele) => {
+            iArr.push({ ...ele });
+          });
+        });
+        this.materialList = iArr;
+
+        const newMaterial = [];
+        newPacking.forEach((item) => {
+          newMaterial.push(...item.materialDetailList);
+        });
+        this.materialList = [...this.materialList, ...newMaterial];
+        // 触发分页更新
+        this.pickingPageNum = 1;
+        this.materielPageNum = 1;
+        this.pickingFetchData();
+        this.materielFetchData();
+
+        this.formData.outInDetailList = this.productList;
+
+        console.log(this.productList, 'this.productList');
+        console.log(this.packingList, 'this.packingList');
+      },
+      async getReturnStorage() {
+        return new Promise((resolve) => {
+          console.log(this.formData);
+          this.$refs.formName.validate((valid) => {
+            let isPass = true;
+            if (!this.productList?.length) {
+              isPass = false;
+              this.$message.error('请添加出库明细!');
+            }
+            if (!valid) {
+              isPass = false;
+            }
+            let obj = deepClone({ ...this.formData, type: 2 });
+
+            obj.extInfo.sourceBizNo = obj.sourceBizNo;
+            obj.fromType = obj.type;
+            // 处理物品类型assetType
+            obj.extInfo.assetType = obj.extInfo?.assetType.join(',');
+            // 处理仓库id
+            let warehouseId = [];
+            let warehouseName = [];
+            let warehouseIds = this.productList
+              .map((item) => item.warehouseId)
+              .flat();
+            let warehouseNames = this.productList
+              .map((item) => item.warehouseName)
+              .flat();
+            warehouseIds.forEach((item, index) => {
+              if (!warehouseId.includes(item)) {
+                warehouseId.push(item);
+                warehouseName.push(warehouseNames[index]);
+              }
+            });
+            obj.warehouseIds = warehouseId;
+            obj.warehouseNames = warehouseName;
+            console.log('2222', obj);
+
+            // // 1按数量计费 2按重量计费
+            // if (this.form.pricingWay == 2) {
+            //   if (this.materialList.length > 0) {
+            //     // 判断物料
+            //     isPass = this.materialCodeReqList.every(
+            //       (item) => item.weight > 0
+            //     );
+            //   } else {
+            //     // 判断包装重量是否全部大于0
+            //     isPass = this.packingList.every((item) => item.weight > 0);
+            //   }
+            // } else {
+            //   isPass = true;
+            // }
+            console.log(isPass,'isPass')
+            if (isPass) {
+              resolve(obj);
+            } else {
+              resolve(false);
+            }
+          });
+        });
+      },
+
+      onClear() {
+        this.formData.sourceBizNo = '';
+        this.warehousingMaterialList = [];
+        this.$refs.trees.valueTitle = '';
+        this.formData.clientName = '';
+        this.formData.clientUser = '';
+        this.formData.clientPhone = '';
+        this.$forceUpdate();
+      },
+
+      rowClass({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 1) {
+          return {
+            display: 'none',
+            background: '#EEEEEE'
+          };
+        }
+        return { background: '#0000' };
+      },
+      // 部门点击事件
+      async auditorDeptClick(data) {
+        console.log(data);
+        this.formData.extInfo.verifyDeptCode = data?.id;
+        this.formData.extInfo.verifyDeptName = data?.name;
+        this.formData.verifyId = '';
+        this.formData.verifyName = '';
+        this.$refs.formName.validateField('verifyDeptName');
+        if (data) {
+          this.getStaffList(data);
+        }
+      },
+
+      getStaffList(data) {
+        return new Promise(async (resolve) => {
+          let res = await warehouseDefinition.getUserPage({
+            groupId: data.id,
+            size: 9999,
+            page: 1
+          });
+          this.llrLsit = res.list;
+          resolve();
+        });
+      },
+      // 初始化用户信息
+      async initFormData() {
+        console.log(this.form, 'ddddddddddddddddddddddddddddd123form');
+        // const res = await warehouseDefinition.tree();
+        // let obj = res.find(
+        //   (item) =>
+        //     item.id ===
+        //     this.user.info.deptIds[this.user.info.deptIds.length - 1]
+        // );
+        // if (!obj) return;
+        // this.formData.extInfo.deptCode = obj.id;
+        // this.formData.extInfo.deptName = obj.name;
+        // this.formData.extInfo.createUserName = this.user.info.name;
+        // this.formData.createUserId = this.user.info.userId;
+
+        this.formData.extInfo.assetType = Array.from(
+          new Set(this.form.categoryLevelTopId?.split(','))
+        );
+
+        //委外出库
+        if (this.bizType == 7 && this.form.productList) {
+          const categoryids = this.form.productList.map(
+            (p) => p.categoryLevelTopId
+          );
+          console.log(categoryids, '委外出库的物品id');
+          this.formData.extInfo.assetType = categoryids;
+        }
+
+        // 出库类型
+        this.formData.bizType = this.bizType;
+        // 添加单据来源
+        this.formData.sourceBizNo = this.sourceBizNo || this.form?.code;
+        // 将出库状态改成出库状态 2出库 1入库
+        this.formData.type = 2;
+        // 入库登记人
+        this.formData.extInfo.createUserId = this.$store.state.user.info.userId;
+        this.formData.extInfo.createUserName = this.$store.state.user.info.name;
+        this.formData.createUserId = this.$store.state.user.info.userId;
+
+        await this.initDeptData(); // 确保部门树加载
+        if (this.form.makerId) {
+          warehouseDefinition.getGroupById(this.form.makerId).then((res) => {
+            console.log(res, 'makerId');
+            this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
+            this.$set(this.formData.extInfo, 'verifyDeptName', res.groupName);
+          });
+        }
+
+        // 生产相关逻辑
+        console.log(this.detailList, 'this.detailList');
+        console.log(this.saleProductList, 'this.saleProductList');
+        console.log(this.productList, 'this.productList');
+
+        if (this.detailList?.length > 0) {
+          // 获取领料人列表
+          if (this.form.executorDeptId) {
+            this.getStaffList({ id: this.form.executorDeptId }).then(() => {
+              // 获取领料人和领料部门
+              this.formData.fromId = this.form.executorId;
+              this.formData.fromUser = this.form.executorName;
+              this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
+              this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
+            });
+          } else {
+            this.formData.fromId = this.form.createUserId;
+            warehouseDefinition
+              .getGroupById(this.form.createUserId)
+              .then((res) => {
+                console.log(res, 'form没有executorDeptId有createUserId');
+                this.$set(this.formData, 'fromUser', res.name);
+                this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
+                this.$set(
+                  this.formData.extInfo,
+                  'verifyDeptName',
+                  res.groupName
+                );
+              });
+          }
+          let pData = {
+            type: '1',
+            builders: this.detailList.map((item) => {
+              return {
+                categoryId:
+                  item.instanceId || item.categoryId || item.productId,
+                num: item.demandQuantity || item.measurementCount,
+                warehouseId: this.bizType == 11 ? item.warehouseId : ''
+              };
+            })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          let pData3 = {
+            //销售退货处理 外协出库
+            type: 3,
+            outInIds: this.form?.returnInReceiptId?.split(','),
+            packageNos: this.detailList.map((item) => item.packageNo)
+          };
+          let pData4 = {
+            //受托退货
+            type: 3,
+            ids: this.detailList.map((item) => item.packageId)?.toString()
+          };
+          let api = this.bizType == 8 ? 'getHierarchyList' : 'getHierarchyFifo';
+
+          storageApi[api](
+            this.wwType == 3
+              ? pData2
+              : this.bizType == 6
+              ? pData3
+              : this.bizType == 8
+              ? pData4
+              : pData
+          )
+            .then((data) => {
+              this.detailData(data, this.dimension);
+            })
+            .catch((err) => {
+              console.log(err);
+            });
+          return;
+        }
+        // 销售相关逻辑
+        if (this.saleProductList?.length > 0) {
+          // 获取领料人列表
+          this.getStaffList({ id: this.form.deptId }).then(() => {
+            // 获取领料人和领料部门
+            this.formData.fromId = this.form.makerId;
+            this.formData.fromUser = this.form.makerName;
+            this.formData.extInfo.verifyDeptCode = this.form.deptId;
+            this.formData.extInfo.verifyDeptName = this.form.deptName;
+          });
+          let pData = {
+            type: '1',
+            builders: this.saleProductList.map((item) => {
+              return {
+                categoryId: item.productId || item.categoryId,
+                num: item.totalCount,
+                batchNo: item.batchNo || ''
+                // warehouseId: this.bizType == 3 ? item.warehouseId : ''
+                // batchNo: item.batchNo || '',
+              };
+            })
+          };
+          let pData2 = {
+            type: this.wwType,
+            taskIds: this.extractedList.map((item) => item.taskId),
+            workOrderIds: this.extractedList.map((item) => item.workOrderId)
+          };
+          storageApi
+            .getHierarchyFifo(this.wwType == 3 ? pData2 : pData)
+            .then((data) => {
+              this.detailData(data, this.dimension);
+            })
+            .catch((err) => {
+              console.log(err);
+            });
+          return;
+        }
+        //采购委外
+        if (this.form.productList?.length > 0) {
+          this.getStaffList({ id: this.form.deptId }).then(() => {
+            this.formData.fromId = this.form.makerId;
+            this.formData.fromUser = this.form.makerName;
+            this.formData.extInfo.verifyDeptCode = this.form.deptId;
+            this.formData.extInfo.verifyDeptName = this.form.deptName;
+          });
+          let pData = {
+            type: '1',
+            builders: this.form.productList.map((item) => {
+              return {
+                categoryId: item.productId,
+                num: item.totalCount,
+                price: item.totalPrice,
+                unitPrice: item.singlePrice,
+                weight: item.singleWeight * item.totalCount || 0,
+                batchNo: item.batchNo || '',
+                taskId: item.taskId || ''
+              };
+            })
+          };
+          let pData2 = {
+            type: 3,
+            taskIds: this.form.productList.map((item) => item.taskId),
+            workOrderIds: [this.form.sourceId]
+          };
+
+          storageApi
+            .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
+            .then((data) => {
+              this.detailData(data, this.dimension);
+            })
+            .catch((err) => {
+              console.log(err);
+            });
+        }
+        // if (this.form.productList?.length > 0) {
+        //   this.getStaffList({ id: this.form.deptId }).then(() => {
+        //     this.formData.fromId = this.form.makerId;
+        //     this.formData.fromUser = this.form.makerName;
+        //     this.formData.extInfo.verifyDeptCode = this.form.deptId;
+        //     this.formData.extInfo.verifyDeptName = this.form.deptName;
+        //   });
+        //   let pData = {
+        //     type: '1',
+        //     builders: this.form.productList.map((item) => {
+        //       return {
+        //         categoryId: item.productId,
+        //         num: item.totalCount,
+        //         price: item.totalPrice,
+        //         unitPrice: item.singlePrice,
+        //         weight: item.singleWeight * item.totalCount || 0,
+        //         batchNo: item.batchNo || '',
+        //         taskId: item.taskId || ''
+        //       };
+        //     })
+        //   };
+        //   let pData2 = {
+        //     type: 3,
+        //     taskIds: this.form.productList.map((item) => item.taskId),
+        //     workOrderIds: [this.form.sourceId]
+        //   };
+
+        //   storageApi
+        //     .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
+        //     .then((data) => {
+        //       this.detailData(data, this.dimension);
+        //     })
+        //     .catch((err) => {
+        //       console.log(err);
+        //     });
+        // }
+      },
+
+      // 初始化部门数据
+      initDeptData() {
+        return new Promise(async (resolve) => {
+          const res = await warehouseDefinition.tree();
+          this.treeList = this.$util.toTreeData({
+            data: res,
+            idField: 'id',
+            parentIdField: 'parentId'
+          });
+          this.$nextTick(() => {
+            resolve();
+          });
+        });
+      },
+      addStock() {
+        console.log(this.formData.extInfo.assetType);
+        if (
+          !(
+            this.formData.extInfo.assetType &&
+            this.formData.extInfo.assetType.length > 0
+          )
+        )
+          return this.$message.error('请选择出库产品类型');
+        if (!this.formData.bizType && this.formData.bizType !== 0)
+          return this.$message.error('请选择出库场景');
+
+        this.$refs.assetsDialogRef.open(this.productList);
+      },
+      handleBizSceneChange() {
+        if (this.formData.extInfo.assetType == 7) {
+          this.formData.extInfo.sourceBizNo = '';
+        }
+        this.formData.sourceBizNo = '';
+      },
+      deleteProductList(row, index) {
+        // 1. 获取当前物料的所有包装列表
+        const targetPackages = row.outInDetailRecordRequestList || [];
+        const packageIds = new Set(targetPackages.map((p) => p.id));
+
+        console.log('targetPackages', targetPackages);
+        console.log('packageIds包装的id', packageIds);
+
+        // 从packingList中移除相关包装
+        this.packingList = this.packingList.filter(
+          (p) => !packageIds.has(p.id) && p.categoryCode !== row.categoryCode
+        );
+        console.log('包装列表', this.packingList);
+
+        // 从materialList中移除关联物料
+        const materialIds = new Set();
+        targetPackages.forEach((packageItem) => {
+          packageItem.materialDetailList.forEach((material) => {
+            materialIds.add(material.id);
+          });
+        });
+        this.materialList = this.materialList.filter(
+          (m) => !materialIds.has(m.id) && m.categoryCode !== row.categoryCode
+        );
+
+        this.productList.splice(index, 1);
+
+        // this.$nextTick(() => {
+        //   this.$refs.productListTable?.doLayout()
+        //   this.$refs.showPackingListTable?.doLayout()
+        //   this.$refs.multipleTable?.doLayout()
+        // })
+      }
+    },
+    watch: {
+      packingList: {
+        handler(newVal) {
+          console.log('包装列表', newVal);
+          console.log('当前包装列表加载页数2', this.pickingPageNum);
+          this.showPackingList = newVal.slice(
+            0,
+            this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
+          );
+        },
+        deep: true
+      },
+      materialList: {
+        handler(newVal) {
+          console.log('物料列表', newVal);
+          console.log('当前物料列表加载页数', this.materielPageNum);
+          this.showMaterialList = newVal.slice(
+            0,
+            this.pageSize *
+              (this.materielPageNum > 0 ? this.materielPageNum : 1)
+          );
+        },
+        deep: true
+      }
+      // detailList: {
+      //   handler(newVal) {
+      //     if (newVal.length) {
+      //       this.initFormData();
+      //     }
+      //   },
+      //   deep: true
+      // }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .el-row {
+    display: flex;
+    flex-wrap: wrap;
+  }
+
+  ::v-deep.form-table {
+    .el-form-item {
+      margin-bottom: 0;
+    }
+
+    .el-input__inner {
+      padding: 0 10px;
+    }
+  }
+
+  .p20 {
+    padding: 20px;
+  }
+
+  .el-select,
+  .el-date-editor {
+    width: 100%;
+  }
+
+  .el-form-item {
+    margin-bottom: 22px;
+  }
+
+  .material {
+    margin-top: 20px;
+
+    .flex {
+      display: flex;
+      justify-content: space-between;
+      font-size: 14px;
+      align-items: center;
+
+      .red {
+        color: #ff4949;
+      }
+    }
+  }
+
+  .mt10 {
+    margin-top: 10px;
+  }
+
+  .mt20 {
+    margin-top: 20px;
+  }
+
+  .center {
+    text-align: center;
+  }
+</style>

+ 39 - 9
src/views/bpm/stockManagement/storage.vue

@@ -1488,7 +1488,7 @@
 
           // 物品列表
           let codeList = this.saleProductList.map((item) => {
-            return item.productCode;
+            return item.productCode || item.categoryCode;
           });
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
             if (res.length <= 0) {
@@ -1522,7 +1522,8 @@
 
             this.productList = res.map((item, index) => {
               let filtersItem = this.saleProductList.filter(
-                (detailItem) => detailItem.productCode == item.code
+                (detailItem) =>
+                  detailItem.productCode || detailItem.categoryCode == item.code
               )[0];
 
               // 显示规格
@@ -1541,6 +1542,8 @@
               );
               console.log(newSpecificationOption, '啵啵啵啵啵啵啵啵啵啵啵啵2');
 
+              console.log(filtersItem, 'filtersItemfiltersItemfiltersItem');
+
               let warehouseId = filtersItem.warehouseId;
               let warehouseName = filtersItem.warehouseName;
               let measureQuantity = filtersItem.totalCount || 0;
@@ -1591,7 +1594,7 @@
                 supplierListOptions: supplierList[item.id], // 供应商列表
                 supplierId: this.form.supplierId, // 供应商id
                 supplierCode:
-                  this.bizType == 2
+                  this.bizType == 2 || this.bizType == 7
                     ? filtersItem.supplierMark
                     : item.supplierCode, // 供应商代号
                 supplierName: this.form.supplierName, // 供应商名称
@@ -1600,10 +1603,30 @@
                 packingSpecificationOption: newSpecificationOption[index], // 包装规格选项
                 packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
                 // minPackingQuantity: minPackingQuantity, // 最小包装单元数量
-                packingQuantity: packingQuantity, // 包装数量
-                packingUnit: packingUnit, // 单位
-                measureQuantity: measureQuantity, // 计量数量
-                measureUnit: item.measuringUnit, // 计量单位
+                packingQuantity:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].packingCount
+                    : packingQuantity, // 包装数量
+                packingUnit:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].packingUnit
+                    : packingUnit, // 单位
+                measureQuantity:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].quantity
+                    : measureQuantity, // 计量数量
+                measureUnit:
+                  this.saleProductList[index] &&
+                  this.saleProductList[index].isAllPackageData &&
+                  this.saleProductList[index].isAllPackageData == 1
+                    ? this.saleProductList[index].measuringUnit
+                    : item.measuringUnit, // 计量单位
                 modelKey: filtersItem.modelKey
                   ? filtersItem.modelKey.split(',')
                   : '', // 机型
@@ -1794,6 +1817,11 @@
               }
               let packingUnit = item.packingUnit;
               let singleWeight = item.singleWeight || 0; // 单重重量
+              console.log(
+                this.isMoreProduct,
+                this.detailList,
+                'this.isMoreProduct'
+              );
               return {
                 index: this.productList.length + index,
                 isSave: true,
@@ -1887,6 +1915,8 @@
             let packingCodeList = data;
             // 生产包装
             this.packingList = this.detailList.map((item, index) => {
+              // if (item.isAllPackageData != 1) {
+              console.log(item.packingUnit, 'itemitemitemitemitemitem1');
               console.log(item.packingUnit, 'itemitemitemitemitemitem2');
               // 换算重量
               let weight = 0;
@@ -2027,6 +2057,7 @@
                 status: 2, // 状态(0=未质检 1待检 2已检)
                 serialNumber: item.productSequence // 产品序号
               };
+              // }
             });
             console.log(this.packingList, '包装明细列表');
             this.packingList.forEach((item) => {
@@ -2398,7 +2429,7 @@
           batchNos: this.productList.map((item) => item.batchNo)
         });
 
-        return  new Promise((resolve, reject) => {
+        return new Promise((resolve, reject) => {
           if (isVerifyData?.length) {
             this.$confirm(
               `当前批次:${isVerifyData[0].batchNo},物品${isVerifyData
@@ -2419,7 +2450,6 @@
             resolve(obj);
           }
         });
-
       },
       pickingHandleScroll() {
         if (this.showPackingList.length < this.packingList.length) {

+ 1 - 1
src/views/bpm/todo/index.vue

@@ -301,7 +301,7 @@
               this.$refs.formParserDialogRef.open({
                 // id: row.processInstance.id,
                 // taskId: row.id,
-                // taskDefinitionKey: row.taskDefinitionKey,
+                taskDefinitionKey: row.taskDefinitionKey,
                 // formJson:row.formJson,
                 // valueJsom:row.formJson,
                 businessId: row.businessId,

+ 2 - 1
vue.config.js

@@ -40,8 +40,9 @@ module.exports = {
         // target: 'http://192.168.1.105:18086',
 
         // target: 'http://192.168.1.251:18186',
+        target: 'http://192.168.1.125:18086',
 
-        target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 s才表示开启跨域
         pathRewrite: {