Pārlūkot izejas kodu

1.修复大中型出库申请提交报错的BUG

GouGengquan 10 mēneši atpakaļ
vecāks
revīzija
648c1a1174
1 mainītis faili ar 61 papildinājumiem un 28 dzēšanām
  1. 61 28
      src/views/major/myOrder.vue

+ 61 - 28
src/views/major/myOrder.vue

@@ -6,8 +6,9 @@
     <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
       <template slot="left">
         <MoreSearchBar business="MAJOR_BUSINESS" @fliterSearch="fliterSearch" @resetParams="resetParams"
-          :listQuery="listQuery" :nodeCode="false" :financial="false" :delivery="true" :hasRealAmount="true" :hasShouldAmount="true" :clientManager="false" :businessObjectType="false"
-          :department="false" :orderId="true" :productionNo="true" :productionType="true">
+          :listQuery="listQuery" :nodeCode="false" :financial="false" :delivery="true" :hasRealAmount="true"
+          :hasShouldAmount="true" :clientManager="false" :businessObjectType="false" :department="false" :orderId="true"
+          :productionNo="true" :productionType="true">
           <template v-slot:otherButton>
             <PermissionButton menu-code="_views_major_order" class-name="filter-item" type="danger"
               icon="el-icon-circle-plus-outline" :page-jump="true" round
@@ -388,10 +389,9 @@
                 v-if="(r.productionNo === reportNo && r.production != 'STATEMENT' && r.repertoryState != null && !r.repertoryState)"
                 style="float: right; padding: 3px 0;margin-left:10px" type="text"
                 @click="openApplyOutWarehouseList(r)">出库申请</el-button> -->
-                <el-button
+              <el-button
                 v-if="(r.productionNo === reportNo && r.production != 'STATEMENT' && r.repertoryState != null && !r.repertoryState)"
-                style="float: right; padding: 3px 0;margin-left:10px" type="text"
-                @click="doApplyOut()">出库申请</el-button>
+                style="float: right; padding: 3px 0;margin-left:10px" type="text" @click="doApplyOut(r)">出库申请</el-button>
               <el-button v-if="r.productionNo === statementNo && !r.delivery && r.production === 'STATEMENT'"
                 style="float: right; padding: 3px 0;" type="text" @click="confirmDelivery(r.id)">确认送达</el-button>
               <el-button v-if="!r.delivery && r.production != 'STATEMENT' && r.repertoryState"
@@ -1080,31 +1080,64 @@ export default {
         }
       })
     },
-    doApplyOut() {
-      let taskRecordDTO = new Object();
-      taskRecordDTO.recordId = this.taskId;
-      taskRecordDTO.taskData = this.outWarehouse;
-      this.$api.productionOutWarehouse.add(taskRecordDTO).then(res => {
-        if (res.code === 200 && res.data) {
-          this.$notify({
-            title: '成功',
-            message: '出库申请已提交',
-            type: 'success',
-            duration: 2000
-          });
-          this.commitNode();
-          this.outWarehouseDialog = false;
-          this.outWarehouseListDialog = false;
-          this.productionListDialog = false;
+    doApplyOut(row) {
+      if (row.shouldAmount) {
+        this.getListByBizTypeProductionId('MAJOR_BUSINESS', row.id);
+        if (this.outApllyList.length > 0) {
+          const applys = this.outApllyList;
+          for (let i in applys) {
+            if (applys[i].departmentCheckState == null && applys[i].financeCheckState == null) {
+              this.$notify({
+                title: '提示',
+                message: '存在待审核的申请,请勿重复申请。',
+                type: 'info',
+                duration: 2000
+              });
+              return;
+            }
+          }
         } else {
-          this.$notify({
-            title: '失败',
-            message: '出库申请提交失败',
-            type: 'error',
-            duration: 2000
-          });
+
+          this.outWarehouse.productionFundId = row.productionFundId;
+          this.outWarehouse.realAmount = row.realAmount
+          this.outWarehouse.ifProductionFund = row.realAmount != null
+          this.outWarehouse.id = row.id;
+          this.outWarehouse.businessType = 'MAJOR_BUSINESS';
+          this.outWarehouse.standardAmount = row.standardAmount;
+
+          let taskRecordDTO = new Object();
+          taskRecordDTO.recordId = this.taskId;
+          taskRecordDTO.taskData = this.outWarehouse;
+          this.$api.productionOutWarehouse.add(taskRecordDTO).then(res => {
+            if (res.code === 200 && res.data) {
+              this.$notify({
+                title: '成功',
+                message: '出库申请已提交',
+                type: 'success',
+                duration: 2000
+              });
+              this.commitNode();
+              this.outWarehouseDialog = false;
+              this.outWarehouseListDialog = false;
+              this.productionListDialog = false;
+            } else {
+              this.$notify({
+                title: '失败',
+                message: '出库申请提交失败',
+                type: 'error',
+                duration: 2000
+              });
+            }
+          })
         }
-      })
+      } else {
+        this.$notify({
+          title: '失败',
+          message: '请先填写应收款',
+          type: 'error',
+          duration: 2000
+        });
+      }
     },
     outApplyCancel(id, productionId, state) {
       this.$confirm('请确认是否撤销此出库申请?', '提示', {