Browse Source

新增大众新评估部退单功能

wucl 4 months ago
parent
commit
fd68795861

+ 4 - 1
src/api/modules/major.js

@@ -41,5 +41,8 @@ export default {
   },
   productionDetail(params1,params2,params3){
     return request.get(`major/${params1}/${params2}/${params3}`)
-  }
+  },
+  feedbackX(params) {
+    return request.post(`major/feedback`, params)
+  },
 }

+ 4 - 0
src/api/modules/workflowLog.js

@@ -8,6 +8,10 @@ export default {
   },
   detail(params) {
     return request.get(`workFlowLog/${params}`)
+  },
+  getRefuse(param1,param2){
+    return request.get(`workFlowLog/refuse?businessId=${param1}&businessType=${param2}`)
   }
 
+
 }

+ 29 - 0
src/components/workflowBoard.vue

@@ -184,6 +184,9 @@ export default {
         if (val.nextHandlerId){
           commit.nextHandlerId =  val.nextHandlerId;
         }
+        if (!val.ifCheckTask){
+          commit.ifCheckTask = val.ifCheckTask;
+        }
       });
       if (isOk){
           this.$prompt('请填写处理意见,若无可直接点击确认按钮。',handldType,{
@@ -215,6 +218,32 @@ export default {
         })
       }
     },
+    refuse(reason){
+      let commit = this.workNodeCommit
+      commit.state = 'REFUSE';
+      commit.comments = reason;
+      commit.instanceNodeId = this.nodeBusinessInfo.currentInstanceNodeId;
+      this.$api.workflow.commit(commit).then(res=>{
+            if (res.code === 200 && res.data){
+              this.$notify({
+                  title: '成功',
+                  message: '工作流节点提交成功。',
+                  type: 'success',
+                  duration: 1000,
+                  offset: 100
+                });
+                this.goBack();
+            }else{
+              this.$notify({
+                  title: '失败',
+                  message: '工作流节点提交失败,请联系管理员。',
+                  type: 'error',
+                  duration: 1000,
+                  offset: 100
+                });
+            }
+          })
+    },
     goBack(){
       const back = this.$route.query.back;
 

+ 4 - 0
src/views/complex/index.vue

@@ -1041,6 +1041,10 @@ export default {
         this.$router.push(`/major/my/order?todoBusinessId=${row.businessId}&sNo=${statementNo}&tId=${row.taskId}&cId=${row.currentNodeId}`)
         return;
       }
+      if (row.nodeCode === 'LEADER_ALLOCATION'){
+        this.$router.push(`/major/todo?businessId=${row.businessId}&nodeCode=${row.nodeCode}&currentNodeId=${row.currentNodeId}&departmentName=${row.departmentName}`)
+        return;
+      }
       if (reportNo && statementNo) {
         this.$router.push(`/major/todo/detail?id=${row.businessId}&reportNo=${reportNo}&statementNo=${row.statementNo}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${row.nodeCode}&back=${'/complex/index'}`)
       } else if (!reportNo && statementNo) {

+ 1 - 1
src/views/major/detail.vue

@@ -2442,7 +2442,7 @@
         }
 
       }
-    },
+      },
       $route(to, from) {
         if (to.path === from.path){
           this.couldEdit = this.$route.query.couldEdit ==='true';

+ 35 - 4
src/views/major/todoDetail.vue

@@ -24,8 +24,10 @@
     <div class="button-area">
       <el-button v-if="nodeBusinessInfo.currentNodePermission.commit" class="y-save" type="success" round
         @click="commit('PASS')" :disabled="!nodeBusinessInfo.doWorkflow">提交</el-button>
-      <el-button v-if="nodeBusinessInfo.currentNodePermission.reversible" class="y-save" type="warning" round
+      <el-button v-if="nodeBusinessInfo.currentNodePermission.reversible && currentNode.nodeCode!='DEPARTMENT_ALLOCATION'" class="y-save" type="warning" round
         @click="commit('REVERSE')" :disabled="!nodeBusinessInfo.doWorkflow">退回</el-button>
+      <el-button v-if="nodeBusinessInfo.currentNodePermission.reversible && currentNode.nodeCode=='DEPARTMENT_ALLOCATION'" class="y-save" type="danger" round
+        @click="refuseDialog=true" :disabled="!nodeBusinessInfo.doWorkflow">退单</el-button>
       <el-button v-if="nodeBusinessInfo.currentNodePermission.skippable" class="y-save" type="warning" round
         @click="commit('SKIP')" :disabled="!nodeBusinessInfo.doWorkflow">跳过</el-button>
       <el-button v-if="nodeBusinessInfo.currentNodePermission.terminable" class="y-save" type="danger" round
@@ -1755,6 +1757,23 @@
         <el-button type="primary" @click="doPassNotRecord()">已知晓</el-button>
       </span>
     </el-dialog>
+    <el-dialog :visible.sync="refuseDialog" center width="25%" top="35vh">
+    <el-form :model="refuseForm">
+    <el-form-item label="退单原因">
+      <el-select v-model="refuseForm.reason" placeholder="请选择退单原因">
+        <el-option label="部门工作超负荷" value="1"></el-option>
+        <el-option label="委托人要求高,无法满足其评估需求" value="2"></el-option>
+        <el-option label="委托人撤单" value="3"></el-option>
+        <el-option label="客户经理通知终止" value="4"></el-option>
+      </el-select>
+    </el-form-item>
+    <span v-show="refuseForm.reason" style="font-weight: bold; color: red;">退回到:{{ (refuseForm.reason==='1'||refuseForm.reason==='2')?'分管副总':'客户经理' }}</span>
+  </el-form>
+  <div slot="footer" class="dialog-footer">
+    <el-button @click="refuseDialog = false">取 消</el-button>
+    <el-button type="primary" @click="saveRefuseReason()">确 定</el-button>
+  </div>
+  </el-dialog>
     <!-- <el-dialog :visible.sync="notSubmitDialog" width="45%" center top="35vh" custom-class="doWarehouseClass" @closed="remindClean()">
       <el-divider content-position="left">
           <h3 >
@@ -1783,7 +1802,6 @@ import YDetailPageLayout from '@/components/YDetailPageLayout/index_detail'
 import WorkflowBoard from '@/components/workflowBoard'
 import ScanEntry from '@/components/ScanEntry'
 import { isNumber, phoneNumber, postiveInteger, isIdNumber } from '@/utils/validate'
-import { parseTwoDigitYear } from 'moment'
 
 
 export default {
@@ -1794,6 +1812,7 @@ export default {
     WorkflowBoard,
     ScanEntry
   },
+ 
   watch: {
     $route(to, from) {
       if (to.path === from.path){
@@ -1884,6 +1903,7 @@ export default {
 
   },
   computed: {
+ 
     couldEdit() {
       let currentNodeCode = this.$route.query.currentNodeCode;
       if (currentNodeCode === 'DEPARTMENT_ALLOCATION') {
@@ -2107,7 +2127,6 @@ export default {
       },
       workflowLogs: [],
       takeNumberDialog: false,
-      year: '2025',
       productions: [],
       waitingUpload: [],
       performance: {
@@ -2168,7 +2187,11 @@ export default {
         isSubmit:null,
         notSubmitReason:null
       },
-      passNotSubmit:false
+      passNotSubmit:false,
+      refuseDialog:false,
+      refuseForm:{
+        reason:null
+      },
     }
   },
   created() {
@@ -3267,6 +3290,10 @@ export default {
       if (commit.state === 'PASS') {
         this.getProductions(this.majorId, (this.reportNo == null ? this.statementNo : this.reportNo));
         switch (nodeCode) {
+          case 'OPENING_ORDER':
+            verify.ifCheckTask = false;
+            callback(verify);
+            return;
           case 'WRITE_STATEMENT':
             let notTakeNumberTargets = this.evaluateLandData.filter(function (e) {
               return e.statementNo == null;
@@ -3721,6 +3748,10 @@ export default {
     commit(state) {
       this.$refs.board.commit(state);
     },
+
+    saveRefuseReason(){
+      this.$refs.board.refuse(this.refuseForm.reason);
+    },
     goBack() {
       const back = this.$route.query.back
       if (back) {

+ 148 - 16
src/views/major/todoList.vue

@@ -28,20 +28,20 @@
           <template slot-scope="{row}">
             <span class="enableClick" @click="toDetail(row)">{{ row.productionName == null ? row.orderName :
               row.productionName
-            }}</span>
+              }}</span>
           </template>
         </el-table-column>
         <el-table-column label="订单号" align="center" width="150" v-if="!hiddenLabels.includes('orderId')" prop="orderId">
           <template slot-scope="{row}">
             <span class="enableClick" @click="toDetail(row)" @contextmenu.prevent="$doCopy(row.orderId)">{{ row.orderId
-            }}</span>
+              }}</span>
           </template>
         </el-table-column>
         <el-table-column label="价值意见书号" align="center" width="200" v-if="!hiddenLabels.includes('statementNo')"
           prop="statementNo" sortable>
           <template slot-scope="{row}">
             <span @contextmenu.prevent="$doCopy(row.statementNo)">{{ row.statementNo == null ? '-' : row.statementNo
-            }}</span>
+              }}</span>
           </template>
         </el-table-column>
         <el-table-column label="报告号/复评函号" align="center" width="200" v-if="!hiddenLabels.includes('reportNo')"
@@ -61,13 +61,14 @@
             <span>{{ row.handler }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="当前节点" align="center" width="140" v-if="!hiddenLabels.includes('nodeName')" prop="nodeName"
-          sortable>
+        <el-table-column label="当前节点" align="center" width="140" v-if="!hiddenLabels.includes('nodeName')"
+          prop="nodeName" sortable>
           <template slot-scope="{row}">
             <span>{{ row.nodeName }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="客户经理" align="center" v-if="!hiddenLabels.includes('clientManager')" prop="clientManager">
+        <el-table-column label="客户经理" align="center" v-if="!hiddenLabels.includes('clientManager')"
+          prop="clientManager">
           <template slot-scope="{row}">
             <span>{{ row.clientManager }}</span>
           </template>
@@ -107,7 +108,8 @@
             {{ row.cmobile }}
           </template>
         </el-table-column>
-        <el-table-column label="下单时间" align="center" width="160" v-if="!hiddenLabels.includes('created')" prop="created">
+        <el-table-column label="下单时间" align="center" width="160" v-if="!hiddenLabels.includes('created')"
+          prop="created">
           <template slot-scope="{row}">
             <span>{{ row.created }}</span>
           </template>
@@ -127,7 +129,8 @@
       </parentTable>
     </y-page-list-layout>
     <TransferDialog :transferDialogVisible="visible" @parentFalse="parentFalse()" @getPage="getPage()"
-      :recordId="recordId"></TransferDialog>
+      :recordId="recordId">
+    </TransferDialog>
     <el-dialog :visible.sync="batchCommitDialog" width="70%">
       <y-page-list-layout :page-list="batchCommitPageData" :page-para="batchCommitListQuery"
         :get-page-list="selectBatchCommitPage">
@@ -151,20 +154,22 @@
             <template slot-scope="{row}">
               <span class="enableClick" @click="toDetail(row)">{{ row.productionName == null ? row.orderName :
                 row.productionName
-              }}</span>
+                }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="订单号" align="center" width="150" v-if="!hiddenLabels.includes('orderId')" prop="orderId">
+          <el-table-column label="订单号" align="center" width="150" v-if="!hiddenLabels.includes('orderId')"
+            prop="orderId">
             <template slot-scope="{row}">
-              <span class="enableClick" @click="toDetail(row)" @contextmenu.prevent="$doCopy(row.orderId)">{{ row.orderId
-              }}</span>
+              <span class="enableClick" @click="toDetail(row)" @contextmenu.prevent="$doCopy(row.orderId)">{{
+                row.orderId
+                }}</span>
             </template>
           </el-table-column>
           <el-table-column label="价值意见书号" align="center" width="200" v-if="!hiddenLabels.includes('statementNo')"
             prop="statementNo" sortable>
             <template slot-scope="{row}">
               <span @contextmenu.prevent="$doCopy(row.statementNo)">{{ row.statementNo == null ? '-' : row.statementNo
-              }}</span>
+                }}</span>
             </template>
           </el-table-column>
           <el-table-column label="报告号/复评函号" align="center" width="200" v-if="!hiddenLabels.includes('reportNo')"
@@ -204,6 +209,51 @@
         </parentTable>
       </y-page-list-layout>
     </el-dialog>
+    <el-dialog :visible.sync="allocationDialog" title="评估部退单,请领导重新分单。" center width="35%" top="15vh">
+      <el-form :model="allocationForm">
+        <el-row>
+          <el-col :xs="24" :sm="12" :lg="24" :span="6">
+            <el-form-item label="退单部门:">
+              <el-input :value="allocationForm.departmentName + '-' + allocationForm.refuseUser" readonly  style="width: 80%;"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="12" :lg="24" :span="6">
+            <el-form-item label="退单时间:">
+              <el-input :value="allocationForm.refuseTime" readonly  style="width: 80%;"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="12" :lg="24" :span="6">
+            <el-form-item label="退单原因:">
+              <el-input :value="allocationForm.reason" readonly style="width: 80%;"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="12" :lg="24" :span="6">
+            <el-form-item label="接单部门:">
+              <el-select v-model="allocationForm.departmentId" placeholder="请重新分配接单部门" clearable style="width: 80%;">
+                <el-option v-for="(d, id) in allotDepartment" :label="d.name" :value="d.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :xs="24" :sm="12" :lg="24" :span="6">
+            <el-form-item label="处理意见:">
+              <el-input type="textarea" v-model="allocationForm.comments"  clearable style="width: 80%;" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="batchCommitDialog = false">取 消</el-button>
+        <el-button type="primary" @click="saveAllocation()">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -231,7 +281,7 @@ export default {
         keyword: null,
         descs: null,
         ascs: null,
-        getNodeIsCheckArchiving:false
+        getNodeIsCheckArchiving: false
       },
       majorNodes: [],
       orderDate: '',
@@ -277,13 +327,34 @@ export default {
         getNodeIsRecheckArchiving: false,
         getNodeIsCheckArchiving: false
       },
-      batchCommitPageData: { records: [] }
+      batchCommitPageData: { records: [] },
+      allocationDialog: false,
+      allocationForm: {
+        id: null,
+        departmentId: null,
+        comments: null,
+        departmentName:null,
+        reason:null,
+        refuseTime:null,
+        refuseUser:null
+      },
+      allotDepartment: [],
+      nodeCode:null,
     }
   },
   created() {
     if (getCookie("MajorTodoList-hiddenLabels") != undefined) {
       this.hiddenLabels = JSON.parse(getCookie("MajorTodoList-hiddenLabels"))
     }
+    this.nodeCode = this.$route.query.nodeCode;
+    if (this.nodeCode === 'LEADER_ALLOCATION'){
+        this.getAllotDepartment();
+        this.getRefuseReason(this.$route.query.businessId);
+        this.allocationDialog = true;
+        this.allocationForm.instanceNodeId = this.$route.query.currentNodeId;
+        this.allocationForm.id = this.$route.query.businessId;
+        this.allocationForm.departmentName = this.$route.query.departmentName;
+    }
     this.getPage();
     this.getMajorNodes();
   },
@@ -442,6 +513,15 @@ export default {
         this.$router.push(`/major/production/in?openDialog=${true}`)
         return;
       }
+      if (row.nodeCode === 'LEADER_ALLOCATION') {
+        this.getAllotDepartment();
+        this.getRefuseReason(row.businessId);
+        this.allocationDialog = true;
+        this.allocationForm.instanceNodeId = row.currentNodeId;
+        this.allocationForm.id = row.businessId;
+        this.allocationForm.departmentName = row.departmentName;
+        return;
+      }
       if (reportNo && statementNo) {
         this.$router.push(`/major/todo/detail?id=${row.businessId}&orderId=${row.orderId}&reportNo=${reportNo}&statementNo=${row.statementNo}&doWorkflow=${true}&currentNodeId=${row.currentNodeId}&currentNodeCode=${row.nodeCode}&back=${'/major/todo'}`)
       } else if (!reportNo && statementNo) {
@@ -525,6 +605,57 @@ export default {
           message: '请选择至少一条流程再提交!'
         });
       }
+    },
+    saveAllocation() {
+      let major = new Object();
+      major.id = this.allocationForm.id;
+      major.departmentId = this.allocationForm.departmentId;
+      this.$api.major.edit(major).then(res=>{
+        if (res.code === 200 && res.data){
+            let commit = new Object();
+            commit.instanceNodeId = this.allocationForm.instanceNodeId;
+            commit.state = 'PASS';
+            commit.ifCheckTask = false;
+            commit.nodeCode = 'LEADER_ALLOCATION';
+            this.$api.workflow.commit(commit).then(res=>{
+              if (res.code === 200 && res.data){
+                this.$notify({
+                    title: '成功',
+                    message: '操作成功',
+                    type: 'success',
+                    duration: 2000
+                });
+                this.allocationDialog = false;
+                this.getPage();
+              }else{
+                this.$notify({
+                    title: '失败',
+                    message: '操作失败',
+                    type: 'error',
+                    duration: 2000
+                })
+              }
+            })
+        }
+      })
+    },
+    getAllotDepartment() {
+      this.$api.department.allot('MAJOR_BUSINESS').then(res => {
+        if (res.code === 200) {
+          this.allotDepartment = res.data;
+        }
+      })
+    },
+    getRefuseReason(businessId){
+       if (businessId){
+          this.$api.workflowLog.getRefuse(businessId,'MAJOR_BUSINESS').then(res=>{
+            if (res.code === 200 && res.data){
+                this.allocationForm.reason = res.data.comments;
+                this.allocationForm.refuseTime = res.data.created;
+                this.allocationForm.refuseUser = res.data.handler;
+            }
+          })
+       }
     }
   },
 
@@ -537,4 +668,5 @@ export default {
 .enableClick:hover {
   color: #1890ff;
   cursor: pointer;
-}</style>
+}
+</style>