|
@@ -14,7 +14,13 @@
|
|
|
<template #button>元</template>
|
|
|
</van-field>
|
|
|
<van-field label="总价" v-model="personalTarget.amount" name="amount" readonly placeholder="-">
|
|
|
- <template #button>万元</template>
|
|
|
+ <template #button>元</template>
|
|
|
+ </van-field>
|
|
|
+ <van-field label="已出产品" name="feedback" readonly>
|
|
|
+ <template #input>
|
|
|
+ <van-tag type="primary"
|
|
|
+ v-for="(p, index) in feedback">{{ p == 'STATEMENT' ? '价值意见书' : (p == 'REPORT' ? '报告' : (p == 'LETTER'? '复评函':'')) }}</van-tag>
|
|
|
+ </template>
|
|
|
</van-field>
|
|
|
<van-field label="客户名称" v-model="personal.clientName" name="clientName" readonly placeholder="-" />
|
|
|
<van-field label="业务来源" v-model="personal.clientSubName" name="clientSubName" readonly placeholder="-" />
|
|
@@ -30,11 +36,18 @@
|
|
|
<van-field label="最新备注" v-model="commitInfo.comments" name="comments" type="textarea" />
|
|
|
</van-cell-group>
|
|
|
</van-form>
|
|
|
+ <van-form v-show="currentNode.nodeCode=='QUOTATION_FEEDBACK' || currentNode.nodeCode=='STATEMENT_FEEDBACK' || currentNode.nodeCode=='REPORT_FEEDBACK' || currentNode.nodeCode=='LETTER_FEEDBACK'">
|
|
|
+ <van-cell-group inset>
|
|
|
+ <VanSinglePicker label="反馈信息" v-model="productionType" v-bind:columns="productionTypes" name="productionType"
|
|
|
+ placeholder="选择反馈信息" clearable :rules="[{ required: true, message: '请选择反馈信息' }]" :required="true"
|
|
|
+ @change="doFeedback()" />
|
|
|
+ </van-cell-group>
|
|
|
+ </van-form>
|
|
|
<div class="button-style" style="float: left" v-if="currentNode.reversible">
|
|
|
- <van-button type="warning" style="width: 100%" @click="commitNode('REVERSE')">退回</van-button>
|
|
|
+ <van-button type="warning" style="width: 100%" @click="commitNode('REVERSE')">退回流程</van-button>
|
|
|
</div>
|
|
|
<div class="button-style" style="float: right">
|
|
|
- <van-button type="success" style="width: 100%" @click="commitNode('PASS')">提交</van-button>
|
|
|
+ <van-button type="success" style="width: 100%" @click="commitNode('PASS')">提交流程</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -45,6 +58,7 @@ import { showNotify } from 'vant';
|
|
|
import { getPersonalTodoDetail, getPersonalTargetDetail } from '@/api/personal';
|
|
|
import { currentNode } from '@/api/workFlowNodeInstance';
|
|
|
import { commit } from '@/api/workflow';
|
|
|
+import { doFeedback } from '@/api/personalTarget';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -55,6 +69,8 @@ export default {
|
|
|
currentNode: {},
|
|
|
// 节点提交信息
|
|
|
commitInfo: {},
|
|
|
+ productionType: null,
|
|
|
+ feedback: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -64,6 +80,39 @@ export default {
|
|
|
this.getTargetDetail();
|
|
|
this.getCurrentNode();
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ productionTypes() {
|
|
|
+ if (this.currentNode.nodeCode == 'QUOTATION_FEEDBACK') {
|
|
|
+ return [
|
|
|
+ { text: '出价值意见书', value: 'STATEMENT' },
|
|
|
+ { text: '出报告', value: 'REPORT' },
|
|
|
+ { text: '出复评函', value: 'LETTER' },
|
|
|
+ { text: '结束', value: 'NONE' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ if (this.currentNode.nodeCode == 'STATEMENT_FEEDBACK') {
|
|
|
+ return [
|
|
|
+ { text: '修改意见书', value: 'CHANGE_STATEMENT' },
|
|
|
+ { text: '出报告', value: 'REPORT' },
|
|
|
+ { text: '出复评函', value: 'LETTER' },
|
|
|
+ { text: '结束', value: 'NONE' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ if (this.currentNode.nodeCode == 'REPORT_FEEDBACK') {
|
|
|
+ return [
|
|
|
+ { text: '修改报告', value: 'CHANGE_REPORT' },
|
|
|
+ { text: '出复评函', value: 'LETTER' },
|
|
|
+ { text: '结束', value: 'NONE' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ if (this.currentNode.nodeCode == 'LETTER_FEEDBACK') {
|
|
|
+ return [
|
|
|
+ { text: '修改复评函', value: 'CHANGE_LETTER' },
|
|
|
+ { text: '结束', value: 'NONE' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 获取待办详情
|
|
|
getTodoDetail() {
|
|
@@ -81,6 +130,10 @@ export default {
|
|
|
getPersonalTargetDetail(this.personal.id).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.personalTarget = res.data;
|
|
|
+ const feedback = res.data.feedback;
|
|
|
+ if (feedback){
|
|
|
+ this.feedback = JSON.parse(res.data.feedback);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -106,14 +159,85 @@ export default {
|
|
|
this.commitInfo.instanceNodeId = this.currentNode.instanceId;
|
|
|
this.commitInfo.state = state;
|
|
|
this.commitInfo.businessSubId = this.personal.orderId;
|
|
|
- commit(this.commitInfo).then((res) => {
|
|
|
- if (res.code === 200 && res.data) {
|
|
|
- showNotify({ type: 'success', message: '节点提交成功' });
|
|
|
- history.back();
|
|
|
- }
|
|
|
- });
|
|
|
+ //检查提交的节点
|
|
|
+ const valid = this.checkNodeCommit();
|
|
|
+ if (valid) {
|
|
|
+ commit(this.commitInfo).then((res) => {
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
+ showNotify({ type: 'success', message: '节点提交成功' });
|
|
|
+ history.back();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
+ //报价客户反馈提交
|
|
|
+ doFeedback() {
|
|
|
+ let taskData = new Object();
|
|
|
+ taskData.id = this.personalTarget.id;
|
|
|
+ taskData.personalId = this.personalTarget.personalId;
|
|
|
+ this.feedback.push(this.productionType);
|
|
|
+ this.feedback = Array.from(new Set(this.feedback));
|
|
|
+ taskData.feedback = JSON.stringify(this.feedback);
|
|
|
+ let feedback = new Object();
|
|
|
+ feedback.taskData = taskData;
|
|
|
+ feedback.recordId = this.currentNode.tasks[0].recordId;
|
|
|
+ doFeedback(feedback).then((res) => {
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
+ showNotify({ type: 'success', message: '反馈提交成功。' });
|
|
|
+ }
|
|
|
+ this.getTargetDetail();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ checkNodeCommit() {
|
|
|
+ //提交报价客户反馈节点需要的参数
|
|
|
+ if (this.currentNode.nodeCode == 'QUOTATION_FEEDBACK') {
|
|
|
+ if (!this.feedback || this.feedback.length==0) {
|
|
|
+ showNotify({ type: 'danger', message: '请选择反馈信息' });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.commitInfo.production = this.feedback;
|
|
|
+ this.commitInfo.ccId = this.personal.clienteleId;
|
|
|
+ this.commitInfo.ifFeedback = false;
|
|
|
+ }
|
|
|
+ if (this.currentNode.nodeCode == 'STATEMENT_FEEDBACK') {
|
|
|
+ const filter = this.feedback.filter(item => item != 'STATEMENT');
|
|
|
+ if (filter.length==0) {
|
|
|
+ showNotify({ type: 'danger', message: '请选择反馈信息' });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.commitInfo.production = this.feedback;
|
|
|
+ this.commitInfo.ccId = this.personal.clienteleId;
|
|
|
+ this.commitInfo.ifFeedback = false;
|
|
|
+ }
|
|
|
+ if (this.currentNode.nodeCode == 'REPORT_FEEDBACK') {
|
|
|
+ let filter = this.feedback.filter(item => item != 'STATEMENT');
|
|
|
+ filter = filter.filter(item => item != 'CHANGE_STATEMENT');
|
|
|
+ filter = filter.filter(item => item != 'REPORT');
|
|
|
+ if (filter.length==0) {
|
|
|
+ showNotify({ type: 'danger', message: '请选择反馈信息' });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.commitInfo.production = this.feedback;
|
|
|
+ this.commitInfo.ccId = this.personal.clienteleId;
|
|
|
+ this.commitInfo.ifFeedback = false;
|
|
|
+ }
|
|
|
+ if (this.currentNode.nodeCode == 'LETTER_FEEDBACK') {
|
|
|
+ let filter = this.feedback.filter(item => item != 'STATEMENT');
|
|
|
+ filter = filter.filter(item => item != 'CHANGE_STATEMENT');
|
|
|
+ filter = filter.filter(item => item != 'REPORT');
|
|
|
+ filter = filter.filter(item => item != 'CHANGE_REPORT');
|
|
|
+ filter = filter.filter(item => item != 'LETTER');
|
|
|
+ if (filter.length==0) {
|
|
|
+ showNotify({ type: 'danger', message: '请选择反馈信息' });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.commitInfo.production = this.feedback;
|
|
|
+ this.commitInfo.ccId = this.personal.clienteleId;
|
|
|
+ this.commitInfo.ifFeedback = false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|