Sfoglia il codice sorgente

1.修复还有产品未提交流程就完成撰写意见书节点的bug
2.报告选择节点开发
3.报告取号

GouGengquan 1 anno fa
parent
commit
be93adbac8
2 ha cambiato i file con 112 aggiunte e 28 eliminazioni
  1. 12 4
      src/api/modules/assets.js
  2. 100 24
      src/views/assets/orderDetail.vue

+ 12 - 4
src/api/modules/assets.js

@@ -79,9 +79,12 @@ export default {
     getProductionByBusinessId(params) {
         return request.get(`assetsProduction/getProductionByBusinessId/${params}`)
     },
-    // 资产产品取号
-    takeAssetsProductionNo(params) {
-        return request.post(`assets/takeAssetsProductionNo`, params)
+    // 资产意见书产品取号
+    takeAssetsStatementProductionNo(params) {
+        return request.post(`assets/takeAssetsStatementProductionNo`, params)
+    },
+    takeAssetsReportProductionNo(params){
+        return request.post(`assets/takeAssetsReportProductionNo`, params)
     },
     // 根据业务id与产品号获取资产产品详细信息
     getAssetsProductionDetailByNo(params) {
@@ -97,7 +100,7 @@ export default {
     },
     // 根据业务id与产品号查询该产品是否已有提交的流程
     getInatanceCount(params){
-        return request.get(`assetsProduction/getInatanceCount`, { params: params })
+        return request.post(`assetsProduction/getInatanceCount`, params)
     },
     // 评估对象审核定价
     checkValue(params){
@@ -111,7 +114,12 @@ export default {
     productionUpdate(params){
         return request.put(`assetsProduction/update`,params);
     },
+    // 资产产品出入库
     assetsProRepertory(params){
         return request.put(`assetsProduction/assetsProRepertory`,params);
+    },
+    // 根据业务id与产品号集合获取每个产品是否有提交过的流程实例信息
+    getInatanceCountList(params){
+        return request.post(`assetsProduction/getInatanceCountList`, params)
     }
 }

+ 100 - 24
src/views/assets/orderDetail.vue

@@ -284,7 +284,8 @@
         <el-row>
           <el-col>
             <el-col :span="2">
-              <el-button @click="openProductionDialog" v-if="currentNode.nodeCode === 'PRODUCT_CHOICE' || currentNode.nodeCode === 'REPORT_CHOICE'" type="danger"
+              <el-button @click="openProductionDialog"
+                v-if="currentNode.nodeCode === 'PRODUCT_CHOICE' || currentNode.nodeCode === 'REPORT_CHOICE'" type="danger"
                 round>选择产品</el-button>
             </el-col>
           </el-col>
@@ -367,16 +368,14 @@
                 <el-button v-if="currentNode.nodeCode === 'SPOT_RECONNAISSANCE_DETERMINE_PRICE'" type="danger"
                   @click="openTargetDialog(), changeStatus('add')" round>添加评估对象</el-button>
               </el-col>
-              <el-col :span="2"
-                v-if="currentNode.nodeCode === 'GENERATE_STATEMENT'">
+              <el-col :span="2" v-if="currentNode.nodeCode === 'GENERATE_STATEMENT'">
                 <el-tooltip class="item" effect="dark" content="全选取主号,多次取号(主号-子号)" placement="right">
-                  <el-button type="success" @click="takeAssetsProductionNo" round>意见书取号</el-button>
+                  <el-button type="success" @click="takeAssetsStatementProductionNo" round>意见书取号</el-button>
                 </el-tooltip>
               </el-col>
-              <el-col :span="2"
-                v-if="currentNode.nodeCode === 'ASSET_REPORT_TAKE_NO'">
+              <el-col :span="2" v-if="currentNode.nodeCode === 'ASSET_REPORT_TAKE_NO'">
                 <el-tooltip class="item" effect="dark" content="全选取主号,多次取号(主号-子号)" placement="right">
-                  <el-button type="success" @click="takeAssetsProductionNo" round>报告取号</el-button>
+                  <el-button type="success" @click="takeAssetsReportProductionNo" round>报告取号</el-button>
                 </el-tooltip>
               </el-col>
               <el-col :span="2"
@@ -800,7 +799,8 @@
             <el-row class="row-style">
               <el-col :xs="24" :sm="12" :lg="12" :span="6" style="width: 800px;">
                 <el-form-item label="产品类型:" prop="productionType" label-width="120px" class="postInfo-container-item">
-                  <el-radio v-if="currentNode.nodeCode === 'PRODUCT_CHOICE'" v-model="assetsProductionForm.productionType" :label="1" border size="medium">价值意见书</el-radio>
+                  <el-radio v-if="currentNode.nodeCode === 'PRODUCT_CHOICE'" v-model="assetsProductionForm.productionType"
+                    :label="1" border size="medium">价值意见书</el-radio>
                   <el-radio v-model="assetsProductionForm.productionType" :label="2" border size="medium">咨询报告</el-radio>
                   <el-radio v-model="assetsProductionForm.productionType" :label="3" border size="medium">评估报告</el-radio>
                   <el-radio v-model="assetsProductionForm.productionType" :label="4" border size="medium">意见函</el-radio>
@@ -839,12 +839,21 @@
               </el-divider>
             </div>
             <el-row class="row-style">
-              <el-col>
+              <el-col v-if="currentNode.nodeCode === 'GENERATE_STATEMENT'">
                 <el-form-item label="评估对象:" prop="productionNo" label-width="120px" class="postInfo-container-item">
                   <el-select v-model="assetsProductionForm.productionNo" @change="getAssetsProductionDetailByNo()"
                     placeholder="请选择" style="width: 300px;">
-                    <el-option v-for="(target, statementNo) in assetsEvaluationTarget" :label="target.statementNo"
-                      :value="target.statementNo" :key="target.id"></el-option>
+                    <el-option v-for="statementNo in writeProductionStatementNos" :label="statementNo"
+                      :value="statementNo" :key="statementNo"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col v-if="currentNode.nodeCode === 'WRITE_REPORT'">
+                <el-form-item label="评估对象:" prop="productionNo" label-width="120px" class="postInfo-container-item">
+                  <el-select v-model="assetsProductionForm.productionNo" @change="getAssetsProductionDetailByNo()"
+                    placeholder="请选择" style="width: 300px;">
+                    <el-option v-for="reportNo in writeProductionReportNos" :label="reportNo" :value="reportNo"
+                      :key="reportNo"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -1299,6 +1308,8 @@ export default {
       allUsers: [],
       // 资产评估对象信息
       assetsEvaluationTarget: [],
+      writeProductionStatementNos: [],
+      writeProductionReportNos: [],
       // 估计对象总价
       totalEvaluateValue: 0.00,
       // 评估对象表单
@@ -1979,18 +1990,25 @@ export default {
       }
     },
     // 根据资产业务id获取资产业务评估对象集合
-    getAETargetListByAssetsId() {
+    getAETargetListByAssetsId(productionNo) {
       let aETargetListSelectDTO = new Object();
       aETargetListSelectDTO.businessId = this.assetsForm.id;
+      // if (productionNo != null || productionNo != undefined || productionNo != '') {
+      //   aETargetListSelectDTO.statementNo = productionNo;
+      //   aETargetListSelectDTO.reportNo = productionNo;
+      // } else {
       aETargetListSelectDTO.statementNo = this.pageParams.row.statementNo;
       aETargetListSelectDTO.reportNo = this.pageParams.row.reportNo;
-
+      // }
       this.$api.assets.getAETargetListByAssetsId(aETargetListSelectDTO).then(res => {
         if (res.code === 200) {
           this.assetsEvaluationTarget = res.data;
+          this.writeProductionStatementNos = this.assetsEvaluationTarget.filter(obj => obj.createProductionDate == null || obj.createProductionDate == '').map(obj => obj.statementNo);
+          this.writeProductionReportNos = this.assetsEvaluationTarget.map(obj => obj.reportNo).filter(createProductionDate => createProductionDate == null || createProductionDate == '');
           // for (let i = 0; i < res.data.length; i++) {
           //   this.nodeBusinessInfo.reportNos.push(res.data[i].productionNo);
           // }
+
         }
       })
     },
@@ -2227,7 +2245,6 @@ export default {
       this.$api.assets.getProductionTypes(id).then(res => {
         if (res.code === 200) {
           this.nodeBusinessInfo.production = res.data;
-          console.log(this.nodeBusinessInfo.production);
         }
       })
     },
@@ -2326,8 +2343,8 @@ export default {
         }
       })
     },
-    // 资产产品取号
-    takeAssetsProductionNo() {
+    // 资产产品意见书取号
+    takeAssetsStatementProductionNo() {
       // 提交的要取号数组长度与table长度一致则是全部取号
       if (this.takeAssetsProductionNoDTO.targetIdList.length === this.assetsEvaluationTarget.length) {
         this.takeAssetsProductionNoDTO.selectAll = true;
@@ -2337,7 +2354,6 @@ export default {
 
       // 判断表格中是否还有未选择且未取号的评估对象,返回布尔
       let notTakeNumTargetSelect = this.assetsEvaluationTarget.filter(item => !this.takeAssetsProductionNoDTO.targetIdList.includes(item.id));
-      console.log(notTakeNumTargetSelect);
       this.takeAssetsProductionNoDTO.hasNotTakeNumTargetSelect = notTakeNumTargetSelect.some(target => target.statementNo === null || target.statementNo === '');
 
       this.takeAssetsProductionNoDTO.businessId = this.assetsForm.id;
@@ -2346,8 +2362,52 @@ export default {
       this.takeAssetsProductionNoDTO.printCount = this.assetsProductionForm.printCount;
 
       if (!this.takeAssetsProductionNoDTO.targetIdList.length == 0) {
-        this.$api.assets.takeAssetsProductionNo(this.takeAssetsProductionNoDTO).then(res => {
-          if (res.code === 200) {
+        this.$api.assets.takeAssetsStatementProductionNo(this.takeAssetsProductionNoDTO).then(res => {
+          if (res.code === 200 && res.data) {
+            this.$notify({
+              title: '成功',
+              message: '产品取号成功!',
+              type: 'success',
+              duration: 2000
+            });
+            // this.pageParams.row.productionNo = res.data;
+            this.getAETargetListByAssetsId();
+          }
+        })
+      } else {
+        this.$notify({
+          title: '警告',
+          message: '您必须选择至少一个评估对象!',
+          type: 'warning',
+          duration: 2000
+        });
+      }
+
+    },
+    // 资产产品报告取号
+    takeAssetsReportProductionNo() {
+      // 提交的要取号数组长度与table长度一致则是全部取号
+      if (this.takeAssetsProductionNoDTO.targetIdList.length === this.assetsEvaluationTarget.length) {
+        this.takeAssetsProductionNoDTO.selectAll = true;
+      } else {
+        this.takeAssetsProductionNoDTO.selectAll = false;
+      }
+
+      // 判断表格中是否还有未选择且未取号的评估对象,返回布尔
+      let notTakeNumTargetSelect = this.assetsEvaluationTarget.filter(item => !this.takeAssetsProductionNoDTO.targetIdList.includes(item.id));
+      this.takeAssetsProductionNoDTO.hasNotTakeNumTargetSelect = notTakeNumTargetSelect.some(target => target.statementNo === null || target.statementNo === '');
+
+      this.takeAssetsProductionNoDTO.businessId = this.assetsForm.id;
+      this.takeAssetsProductionNoDTO.productionType = this.nodeBusinessInfo.production[this.nodeBusinessInfo.production.length - 1];
+      this.getProductionByBusinessId(this.assetsForm.id);
+      this.takeAssetsProductionNoDTO.printCount = this.assetsProductionForm.printCount;
+
+      this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
+      this.taskRecordDTO.taskData = this.takeAssetsProductionNoDTO;
+
+      if (!this.takeAssetsProductionNoDTO.targetIdList.length == 0) {
+        this.$api.assets.takeAssetsReportProductionNo(this.taskRecordDTO).then(res => {
+          if (res.code === 200 && res.data) {
             this.$notify({
               title: '成功',
               message: '产品取号成功!',
@@ -2375,7 +2435,9 @@ export default {
     },
     // 判断行数据是否可选
     selectable(row) {
-      if (row.statementNo != null && row.statementNo != '') {
+      if (row.statementNo != null && row.statementNo != '' && this.currentNode.nodeCode !== 'ASSET_REPORT_TAKE_NO') {
+        return false;
+      } else if (row.reportNo != null && row.reportNo != '' && this.currentNode.nodeCode !== 'GENERATE_STATEMENT') {
         return false;
       } else {
         return true;
@@ -2430,9 +2492,11 @@ export default {
                 duration: 2000
               });
             }
-            this.getAETargetListByAssetsId();
+            this.getAETargetListByAssetsId(this.assetsProductionForm.productionNo);
             this.productionWriteDialogVisible = false;
             this.getProductionList();
+            this.writeProductionReportNos = [];
+            this.writeProductionStatementNos = [];
           })
         }
       })
@@ -2460,9 +2524,9 @@ export default {
       this.nodeBusinessInfo.businessSubId = this.commitProductionNo;
 
       // 查询该产品是否已有提交的流程
-      let aProListSelectDTO = new Object();
+      let aProListSelectDTO = { businessId: null, productionNo: null, productionNos: [] };
       aProListSelectDTO.businessId = this.assetsForm.id;
-      aProListSelectDTO.statementNo = this.commitProductionNo;
+      aProListSelectDTO.productionNo = this.commitProductionNo;
       this.$api.assets.getInatanceCount(aProListSelectDTO).then(res => {
         if (res.code == 200) {
           this.proInatanceCount = res.data;
@@ -2476,7 +2540,19 @@ export default {
       if (this.currentNode.nodeCode === 'GENERATE_STATEMENT' && isNotWriteAllPro) {
         this.nodeBusinessInfo.ifCheckTask = false;
       } else {
-        this.nodeBusinessInfo.ifCheckTask = true;
+        aProListSelectDTO.productionNos = this.assetsProductionData.map(obj => obj.productionNo);
+        this.$api.assets.getInatanceCountList(aProListSelectDTO).then(res => {
+          if (res.code == 200) {
+            if (res.data.filter(count => count === 0).length > 1) {
+              this.nodeBusinessInfo.ifCheckTask = false;
+            } else {
+              this.nodeBusinessInfo.ifCheckTask = true;
+            }
+          } else {
+            this.nodeBusinessInfo.ifCheckTask = true;
+          }
+        })
+
       }
 
     },