yusheng hai 11 meses
pai
achega
33b16ccda5

+ 48 - 38
src/views/bpm/handleTask/components/purchasePlanManage/detailDialog.vue

@@ -1,16 +1,8 @@
 <template>
   <div>
     <el-form ref="form" :model="form" label-width="120px">
-      <headerTitle title="基本信息">
-        <!-- <el-button
-                  size="small"
-                  type="primary"
-                  icon="el-icon-s-grid"
-                  class="ele-btn-icon"
-                  @click="exportTable"
-                >
-                 导出
-                </el-button> -->
+      <div class="title"> 采购计划信息</div>
+
       </headerTitle>
       <el-row>
         <el-col :span="12" style="height: 40px">
@@ -85,10 +77,7 @@
         <el-col :span="12">
           <el-form-item prop="files" label="附件:">
             <fileMain v-model="form.files" type="view"></fileMain>
-
           </el-form-item>
-          
-      
         </el-col>
       </el-row>
       <headerTitle title="计划清单" style="margin-top: 15px"></headerTitle>
@@ -101,7 +90,7 @@
             :toolkit="[]"
             :datasource="form.detailList"
             row-key="id"
-            height="500px"
+            maxHeight="500px"
           >
             <template v-slot:totalCount="scope">
               <el-input-number
@@ -121,7 +110,7 @@
                   :underline="false"
                   @click.native="handleMethod(scope.row)"
                 >
-                查看分批时间
+                  查看分批时间
                 </el-link>
               </div>
             </template>
@@ -182,6 +171,26 @@
       </el-tabs>
     </el-form>
     <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
+    <div class="title"> 入库单信息</div>
+
+    <div v-if="taskDefinitionKey == 'storeManagerApprove'">
+      <add
+        ref="inoutBoundRef"
+        v-if="form.detailList"
+        :form="form"
+        :sourceBizNo="form.planCode"
+        :saleProductList="form.detailList"
+        :bizType="2"
+      ></add>
+    </div>
+    <div v-if="view && ['3', '4', '5'].includes(form.sourceType)">
+      <detailDialog
+        ref="inoutBoundViewRef"
+        :bizType="2"
+        :businessId="form.planCode"
+      >
+      </detailDialog>
+    </div>
   </div>
 </template>
 
@@ -191,14 +200,17 @@
   import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
   import { getInventoryTotalAPI } from '@/api/bpm/components/wms';
-  // import fileMain from '@/components/addDoc/index.vue';
   import timeDialog from '@/components/timeDialog/index.vue';
-
+  import add from '@/views/bpm/stockManagement/storage.vue';
+  import detailDialog from '@/views/bpm/stockManagement/details.vue';
   export default {
     mixins: [dictMixins],
-    components: { 
+    components: {
       // fileMain,
-      timeDialog },
+      timeDialog,
+      add,
+      detailDialog
+    },
     props: {
       taskDefinitionKey: {
         type: String,
@@ -206,6 +218,9 @@
       },
       businessId: {
         default: ''
+      },
+      isView: {
+        default: ''
       }
     },
     data() {
@@ -387,7 +402,7 @@
 
       this.getPlanData(this.businessId);
     },
- 
+
     methods: {
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);
@@ -397,6 +412,7 @@
         const data = await getplanDetail(id);
         this.loading = false;
         if (data) {
+          data.purchaseDate=data.createTime
           let codeList = data.detailList.map((item) => item.productCode);
           let inventoryTotalList = await getInventoryTotalAPI(codeList);
           data.detailList.forEach((item) => {
@@ -421,23 +437,12 @@
         this.$refs.contactDetailDialogRef.open(row);
       },
       async getTableValue() {
-        try {
-          if (this.form.detailList.some((item) => !!item.totalCount == '')) {
-            this.$message.warning('数量不能为空');
-            return '';
-          }
-          // 表单验证通过,执行保存操作
-          this.loading = true;
-          this.form.detailList = [
-            ...this.form.detailList,
-            ...this.form.rawDetailList,
-            ...this.form.outputDetailList
-          ];
-          return Object.assign({}, this.form);
-        } catch (error) {
-          console.log(error);
-          // 表单验证未通过,不执行保存操作
-        }
+
+        return {
+          returnStorageData:
+            this.$refs.inoutBoundRef &&
+            this.$refs.inoutBoundRef.getReturnStorage()
+        };
       }
     }
   };
@@ -450,7 +455,12 @@
     }
   }
 
-  .headbox {
+  .title {
+    font-size: 22px;
+    font-weight: 800;
+    margin-top: 15px;
+  }
+    .headbox {
     display: flex;
     justify-content: space-between;
     align-items: center;

+ 40 - 3
src/views/bpm/handleTask/components/purchasePlanManage/submit.vue

@@ -60,9 +60,18 @@
         type="success"
         size="mini"
         @click="handleAudit(1)"
+        v-if="!['storeManagerApprove'].includes(taskDefinitionKey)"
         >通过
       </el-button>
-
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="storeManagerApprove"
+        v-if="['storeManagerApprove'].includes(taskDefinitionKey)"
+        >申请入库
+      </el-button>
       <el-dropdown
         @command="(command) => handleCommand(command)"
         style="margin-left: 30px"
@@ -120,6 +129,7 @@
   } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import { getUserPage } from '@/api/system/organization';
+  import storageApi from '@/api/warehouseManagement';
 
   // 流程实例的详情页,可用于审批
   export default {
@@ -148,7 +158,8 @@
           reason: '',
           useDeptId: ''
         },
-        userOptions: []
+        userOptions: [],
+        isSaveLoading:false
       };
     },
     created() {
@@ -175,7 +186,33 @@
           this.userOptions = data.list;
         });
       },
-
+      async storeManagerApprove() {
+        let res = await this.getTableValue();
+        let storageData = res.returnStorageData;
+        storageData.isSkip = 1;
+        try {
+          this.isSaveLoading = true;
+          await storageApi.storage(storageData);
+          approveTaskWithVariables({
+            id: this.taskId,
+            reason: this.form.reason,
+            variables: {
+              pass: true
+            }
+          }).then((res) => {
+            if (res.code != '-1') {
+              this.$emit('handleAudit', {
+                status: 1,
+                title: '入库'
+              });
+            }
+            this.isSaveLoading = false;
+          });
+        } catch (error) {
+          this.isSaveLoading = false;
+          this.$message.error('保存失败');
+        }
+      },
       async handleAudit(status) {
         let userInfo = this.userOptions.find(
           (item) => item.id == this.form.userId

+ 5 - 5
src/views/bpm/stockManagement/storage.vue

@@ -1708,7 +1708,7 @@
               } else if (this.formData.bizType == '2') {
                 // 采购入库
                 const defaultTime = '00:00:00';
-                purchaseDate = `${this.form.receiveDate} ${defaultTime}`;
+                purchaseDate = this.form.purchaseDate||`${this.form.receiveDate} ${defaultTime}`;
                 this.curDateType = 'purchaseDate';
               }
 
@@ -2958,7 +2958,7 @@
                           row.packingSpecificationOption[1]?.packageCell
                       );
                       this.$refs.wareHouseDailogRef.open(
-                        row.packingQuantity,
+                        num,
                         row.measureQuantity,
                         idx,
                         row.warehouseId,
@@ -3125,7 +3125,7 @@
         } else if (this.formData.bizType == '2') {
           // 采购入库
           const defaultTime = '00:00:00';
-          purchaseDate = `${this.form.receiveDate} ${defaultTime}`;
+          purchaseDate = this.form.purchaseDate||`${this.form.receiveDate} ${defaultTime}`;
           this.curDateType = 'purchaseDate';
         }
 
@@ -3357,7 +3357,7 @@
                     );
                   }
                 } else {
-                  measureQuantity = row.measureQuantity / row.packingQuantity;
+                  measureQuantity = row.measureQuantity / packingCodeList.length;
                 }
               } else {
                 console.log('4 拆--------');
@@ -3452,7 +3452,7 @@
               // 第二层条件: packingBoolen
               if (packingBoolen) {
                 // 空值保护: 确保 filterArr[0] 存在
-                item.packingUnit = filterArr?.[0]?.conversionUnit;
+                item.packingUnit = filterArr?.[1]?.conversionUnit;
               } else {
                 // 第三层条件: measureBoolen
                 if (measureBoolen) {