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

refactor(entrustedReceive): 受托入库审批修改

liujt 4 месяцев назад
Родитель
Сommit
407424e9f2

+ 51 - 41
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/boxTabPage.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+    <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
       <el-tab-pane
         v-for="item in tabOption"
         :label="item.label"
@@ -16,7 +16,17 @@
         ref="componentRef"
         v-bind="activeNameProps"
       />
-    </keep-alive>
+    </keep-alive> -->
+    <div v-for="item in tabOption" :label="item.label" :name="item.name">
+      <component
+        v-if="form.id"
+        :is="item.name"
+        :key="item.name"
+        :ref="'componentRef' + item.name"
+        type="sourceBizNo"
+        v-bind="activeNameProps(item.name)"
+      />
+    </div>
   </div>
 </template>
 
@@ -65,37 +75,7 @@
         ]
       };
     },
-    computed: {
-      activeNameProps() {
-        switch (this.activeName) {
-          case 'tab1':
-            return {
-              taskDefinitionKey: this.taskDefinitionKey,
-              activeComp: this.activeComp,
-              businessId: this.businessId,
-              infoData: this.form,
-              permissionType: this.permissionType
-            };
-          case 'tab2':
-            return {
-              form: this.form,
-              bizType: 7,
-              sourceBizNo: this.form.code,
-              saleProductList: this.form.productList
-            };
-          case 'tab3':
-            return {
-              taskDefinitionKey: this.taskDefinitionKey,
-              businessId: this.form.code
-            };
-          case 'tab4':
-            return {
-              businessId: this.form.code,
-              isUpload: this.isUpload
-            };
-        }
-      }
-    },
+    computed: {},
     async created() {
       await this.getSendSaleOrderDetail(this.businessId);
       switch (this.taskDefinitionKey) {
@@ -132,6 +112,35 @@
       }
     },
     methods: {
+      activeNameProps(activeName) {
+        switch (activeName) {
+          case 'tab1':
+            return {
+              taskDefinitionKey: this.taskDefinitionKey,
+              activeComp: this.activeComp,
+              businessId: this.businessId,
+              infoData: this.form,
+              permissionType: this.permissionType
+            };
+          case 'tab2':
+            return {
+              form: this.form,
+              bizType: 7,
+              sourceBizNo: this.form.code,
+              saleProductList: this.form.productList
+            };
+          case 'tab3':
+            return {
+              taskDefinitionKey: this.taskDefinitionKey,
+              businessId: this.form.code
+            };
+          case 'tab4':
+            return {
+              businessId: this.form.code,
+              isUpload: this.isUpload
+            };
+        }
+      },
       isValidComponent(componentName) {
         const validComponents = ['tab1', 'tab2', 'tab3', 'tab4'];
         return validComponents.includes(componentName);
@@ -150,18 +159,19 @@
         }
       },
       async getTableValue() {
-        console.log(this.$refs.componentRef);
+        console.log(this.$refs.componentReftab2);
+        console.log(this.$refs['componentReftab2'][0].getReturnStorage);
         return {
-          form: this.$refs.componentRef.form,
-          returnStorageData: this.$refs.componentRef.getReturnStorage
-            ? await this.$refs.componentRef.getReturnStorage()
+          form: this.$refs['componentReftab1'][0].form,
+          returnStorageData: this.$refs.componentReftab2 && this.$refs['componentReftab2'][0].getReturnStorage
+            ? await this.$refs['componentReftab2'][0].getReturnStorage()
             : '',
           isAllChecked:
-            this.$refs.componentRef.getStatus &&
-            this.$refs.componentRef.getStatus(),
+            this.$refs.componentReftab3 && this.$refs['componentReftab3'][0].getStatus &&
+            this.$refs['componentReftab3'][0].getStatus(),
           qualityInspector:
-            (this.$refs.componentRef.getQualityFile &&
-              this.$refs.componentRef.getQualityFile()) ||
+            (this.$refs.componentReftab4 && this.$refs['componentReftab4'][0].getQualityFile &&
+              this.$refs['componentReftab4'][0].getQualityFile()) ||
             {}
         };
       },

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

@@ -3,81 +3,75 @@
     <el-form ref="form" :model="form" label-width="130px">
       <headerTitle title="收货信息"></headerTitle>
       <el-row :gutter="20">
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="选择订单:"
             prop="orderNo"
-            style="margin-bottom: 22px"
           >
             {{ form.orderNo }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="客户名称:"
             prop="contactName"
-            style="margin-bottom: 22px"
           >
             {{ form.contactName }}
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row :gutter="20">
-        <!-- <el-col :span="12">
-          <el-form-item label="计价方式:" style="margin-bottom: 22px">
-            {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
-          </el-form-item>
-        </el-col> -->
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="客户联系人:"
             prop="linkName"
-            style="margin-bottom: 22px"
           >
             {{ form.linkName }}
           </el-form-item>
         </el-col>
       </el-row>
+      <!-- <el-row :gutter="20"> -->
+        <!-- <el-col :span="12">
+          <el-form-item label="计价方式:" style="margin-bottom: 22px">
+            {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
+          </el-form-item>
+        </el-col> -->
+        
+      <!-- </el-row> -->
       <el-row :gutter="20">
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="车辆号:"
             prop="carNo"
-            style="margin-bottom: 22px"
           >
             {{ form.carNo }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="客户电话:"
             prop="linkPhone"
-            style="margin-bottom: 22px"
           >
             {{ form.linkPhone }}
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row :gutter="20">
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="收货日期:"
             prop="receiveDate"
-            style="margin-bottom: 22px"
           >
             {{ form.receiveDate }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="8">
           <el-form-item
             label="收货单号:"
             prop="sendNoteNo"
-            style="margin-bottom: 22px"
           >
             {{ form.sendNoteNo }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item prop="files" label="附件:">
             <fileMain v-model="form.files" type="view"></fileMain>
             <!--            <div v-if="form.files && form.files?.length">-->

+ 3 - 4
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/submit.vue

@@ -58,9 +58,7 @@
         size="mini"
         :loading="isSaveLoading"
         v-if="
-          taskDefinitionKey == 'storeManagerApprove' &&
-          activeComp == 'inoutBound'
-        "
+          taskDefinitionKey == 'storeManagerApprove'"
         @click="handleAudit(1)"
         >申请入库
       </el-button>
@@ -176,6 +174,7 @@
       };
     },
     created() {
+      console.log('taskDefinitionKey!!!', this.taskDefinitionKey);
       this.userOptions = [];
       listAllUserBind().then((data) => {
         this.userOptions.push(...data);
@@ -257,7 +256,7 @@
         if (this.taskDefinitionKey === 'storeManagerApprove' && status) {
           let res = await this.getTableValue();
           let storageData = res.returnStorageData;
-          console.log(storageData);
+          console.log('storageData~~~', res);
           // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
           storageData.isSkip = 1;
           try {