todoDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <div>
  3. <BackBar title="待办处理-个贷" lefttext="返回" />
  4. <van-form>
  5. <van-cell-group inset>
  6. <van-field label="项目编号" v-model="personal.orderId" name="orderId" readonly placeholder="-" />
  7. <van-field label="坐落" v-model="personal.location" name="location" readonly type="textarea" placeholder="-" />
  8. <van-field label="当前节点" v-model="currentNode.nodeName" name="nodeName" readonly :error="true" placeholder="-" />
  9. <van-field label="处理人" v-model="currentNode.handlerName" name="handlerName" readonly placeholder="-" />
  10. <van-field label="面积" v-model="personalTarget.acreage" name="acreage" readonly placeholder="-">
  11. <template #button>平米</template>
  12. </van-field>
  13. <van-field label="单价" v-model="personalTarget.price" name="price" readonly placeholder="-">
  14. <template #button>元</template>
  15. </van-field>
  16. <van-field label="总价" v-model="personalTarget.amount" name="amount" readonly placeholder="-">
  17. <template #button>元</template>
  18. </van-field>
  19. <van-field label="已出产品" name="feedback" readonly>
  20. <template #input>
  21. <van-tag type="primary"
  22. v-for="(p, index) in feedback">{{ p == 'STATEMENT' ? '价值意见书' : (p == 'REPORT' ? '报告' : (p == 'LETTER'? '复评函':'')) }}</van-tag>
  23. </template>
  24. </van-field>
  25. <van-field label="客户名称" v-model="personal.clientName" name="clientName" readonly placeholder="-" />
  26. <van-field label="业务来源" v-model="personal.clientSubName" name="clientSubName" readonly placeholder="-" />
  27. <van-field label="中介" v-model="personal.agent" name="agent" readonly placeholder="-" />
  28. <van-field label="联系人" v-model="personal.contactName" name="contactName" readonly placeholder="-" />
  29. <van-field label="联系电话" v-model="personal.contactTel" name="contactTel" readonly placeholder="-" />
  30. <van-field label="委托人1" v-model="personal.bailorA" name="bailor" readonly placeholder="-" />
  31. <van-field label="委托人1电话" v-model="personal.bailoraTel" name="bailor" readonly placeholder="-" />
  32. <van-field label="委托人2" v-model="personal.bailorB" name="bailor" readonly placeholder="-" />
  33. <van-field label="委托人2电话" v-model="personal.bailorbTel" name="bailor" readonly placeholder="-" />
  34. <van-field label="下单时间" v-model="personal.created" name="created" readonly placeholder="-" />
  35. <van-field label="节点时间" v-model="currentNode.nodeTime" name="nodeTime" readonly placeholder="-" />
  36. <van-field label="最新备注" v-model="lastestComments" name="lastestComments" readonly type="textarea" />
  37. <van-field label="我的备注" v-model="commitInfo.comments" name="comments" type="textarea" placeholder="请填入当前节点提交的备注"/>
  38. </van-cell-group>
  39. </van-form>
  40. <van-form v-show="currentNode.nodeCode=='QUOTATION_FEEDBACK' || currentNode.nodeCode=='STATEMENT_FEEDBACK' || currentNode.nodeCode=='REPORT_FEEDBACK' || currentNode.nodeCode=='LETTER_FEEDBACK'">
  41. <van-cell-group inset>
  42. <VanSinglePicker label="反馈信息" v-model="productionType" v-bind:columns="productionTypes" name="productionType"
  43. placeholder="选择反馈信息" clearable :rules="[{ required: true, message: '请选择反馈信息' }]" :required="true"
  44. @change="doFeedback()" />
  45. </van-cell-group>
  46. </van-form>
  47. <div class="buttons-div">
  48. <van-button class="button" type="warning" @click="commitNode('REVERSE')" v-if="currentNode.reversible">退回流程</van-button>
  49. <van-button class="button" type="primary" @click="openTransferDialog()">任务转交</van-button>
  50. <van-button class="button" type="success" @click="commitNode('PASS')">提交流程</van-button>
  51. </div>
  52. <van-popup v-model:show="taskTransforDialog" :style="{ padding: '10px', width:'80%' }" round >
  53. <van-form>
  54. <van-cell-group inset>
  55. <van-radio-group v-model="transforUserId" direction="horizontal">
  56. <van-radio :name="u.id" class="radio-class" v-for="(u,index) in users">{{ u.name }}</van-radio>
  57. </van-radio-group>
  58. </van-cell-group>
  59. <van-button round block size="small" type="primary" native-type="submit" @click="doTransfer()">
  60. 提交
  61. </van-button>
  62. </van-form>
  63. </van-popup>
  64. </div>
  65. </template>
  66. <script>
  67. import { showConfirmDialog } from 'vant';
  68. import { showNotify } from 'vant';
  69. import { getPersonalTodoDetail, getPersonalTargetDetail } from '@/api/personal';
  70. import { currentNode } from '@/api/workFlowNodeInstance';
  71. import { commit } from '@/api/workflow';
  72. import { doFeedback } from '@/api/personalTarget';
  73. import { postUser } from '@/api/user';
  74. import { taskTransfer } from '@/api/workRecordTransfer';
  75. export default {
  76. data() {
  77. return {
  78. // 个贷详情
  79. personal: {},
  80. personalTarget: {},
  81. currentNode: {},
  82. // 节点提交信息
  83. commitInfo: {},
  84. productionType: null,
  85. feedback: [],
  86. lastestComments:null,
  87. users:[],
  88. transforUserId:null,
  89. taskTransforDialog:false
  90. };
  91. },
  92. created() {
  93. this.personal.id = this.$route.query.id;
  94. this.personal.orderId = this.$route.query.orderId;
  95. this.lastestComments = this.$route.query.lastestComments;
  96. this.getTodoDetail();
  97. this.getTargetDetail();
  98. this.getCurrentNode();
  99. },
  100. computed: {
  101. productionTypes() {
  102. if (this.currentNode.nodeCode == 'QUOTATION_FEEDBACK') {
  103. return [
  104. { text: '出价值意见书', value: 'STATEMENT' },
  105. { text: '出报告', value: 'REPORT' },
  106. { text: '出复评函', value: 'LETTER' },
  107. { text: '结束', value: 'NONE' },
  108. ]
  109. }
  110. if (this.currentNode.nodeCode == 'STATEMENT_FEEDBACK') {
  111. return [
  112. { text: '修改意见书', value: 'CHANGE_STATEMENT' },
  113. { text: '出报告', value: 'REPORT' },
  114. { text: '出复评函', value: 'LETTER' },
  115. { text: '结束', value: 'NONE' },
  116. ]
  117. }
  118. if (this.currentNode.nodeCode == 'REPORT_FEEDBACK') {
  119. return [
  120. { text: '修改报告', value: 'CHANGE_REPORT' },
  121. { text: '出复评函', value: 'LETTER' },
  122. { text: '结束', value: 'NONE' },
  123. ]
  124. }
  125. if (this.currentNode.nodeCode == 'LETTER_FEEDBACK') {
  126. return [
  127. { text: '修改复评函', value: 'CHANGE_LETTER' },
  128. { text: '结束', value: 'NONE' },
  129. ]
  130. }
  131. }
  132. },
  133. methods: {
  134. // 获取待办详情
  135. getTodoDetail() {
  136. if (this.personal.id) {
  137. getPersonalTodoDetail(this.personal.id).then((res) => {
  138. if (res.code === 200) {
  139. this.personal = res.data;
  140. }
  141. });
  142. }
  143. },
  144. // 获取评估对象详情
  145. getTargetDetail() {
  146. if (this.personal.id) {
  147. getPersonalTargetDetail(this.personal.id).then((res) => {
  148. if (res.code === 200) {
  149. this.personalTarget = res.data;
  150. const feedback = res.data.feedback;
  151. if (feedback){
  152. this.feedback = JSON.parse(res.data.feedback);
  153. }
  154. }
  155. });
  156. }
  157. },
  158. // 获取当前节点实例
  159. getCurrentNode() {
  160. if (this.personal.id) {
  161. currentNode({ mainBusiness: 'PERSONAL_BUSINESS', businessId: this.personal.id, businessSubId: this.personal.orderId }).then((res) => {
  162. if (res.code === 200) {
  163. this.currentNode = res.data;
  164. this.currentNode.handlerName = this.$route.query.handlerName;
  165. this.currentNode.nodeTime = this.$route.query.nodeTime;
  166. }
  167. });
  168. }
  169. },
  170. // 提交节点
  171. commitNode(state) {
  172. showConfirmDialog({
  173. title: '提交节点',
  174. message: '确认提交流程节点?',
  175. }).then(() => {
  176. this.commitInfo.instanceNodeId = this.currentNode.instanceId;
  177. this.commitInfo.state = state;
  178. this.commitInfo.businessSubId = this.personal.orderId;
  179. //检查提交的节点
  180. const valid = this.checkNodeCommit();
  181. if (valid) {
  182. commit(this.commitInfo).then((res) => {
  183. if (res.code === 200 && res.data) {
  184. showNotify({ type: 'success', message: '节点提交成功' });
  185. history.back();
  186. }
  187. });
  188. }
  189. });
  190. },
  191. //报价客户反馈提交
  192. doFeedback() {
  193. let taskData = new Object();
  194. taskData.id = this.personalTarget.id;
  195. taskData.personalId = this.personalTarget.personalId;
  196. this.feedback.push(this.productionType);
  197. this.feedback = Array.from(new Set(this.feedback));
  198. taskData.feedback = JSON.stringify(this.feedback);
  199. let feedback = new Object();
  200. feedback.taskData = taskData;
  201. feedback.recordId = this.currentNode.tasks[0].recordId;
  202. doFeedback(feedback).then((res) => {
  203. if (res.code === 200 && res.data) {
  204. showNotify({ type: 'success', message: '反馈提交成功。' });
  205. }
  206. this.getTargetDetail();
  207. });
  208. },
  209. checkNodeCommit() {
  210. //提交报价客户反馈节点需要的参数
  211. if (this.currentNode.nodeCode == 'QUOTATION_FEEDBACK') {
  212. if (!this.feedback || this.feedback.length==0) {
  213. showNotify({ type: 'danger', message: '请选择反馈信息' });
  214. return false;
  215. }
  216. this.commitInfo.production = this.feedback;
  217. this.commitInfo.ccId = this.personal.clienteleId;
  218. this.commitInfo.ifFeedback = false;
  219. }
  220. if (this.currentNode.nodeCode == 'STATEMENT_FEEDBACK') {
  221. const filter = this.feedback.filter(item => item != 'STATEMENT');
  222. if (filter.length==0) {
  223. showNotify({ type: 'danger', message: '请选择反馈信息' });
  224. return false;
  225. }
  226. this.commitInfo.production = this.feedback;
  227. this.commitInfo.ccId = this.personal.clienteleId;
  228. this.commitInfo.ifFeedback = false;
  229. }
  230. if (this.currentNode.nodeCode == 'REPORT_FEEDBACK') {
  231. let filter = this.feedback.filter(item => item != 'STATEMENT');
  232. filter = filter.filter(item => item != 'CHANGE_STATEMENT');
  233. filter = filter.filter(item => item != 'REPORT');
  234. if (filter.length==0) {
  235. showNotify({ type: 'danger', message: '请选择反馈信息' });
  236. return false;
  237. }
  238. this.commitInfo.production = this.feedback;
  239. this.commitInfo.ccId = this.personal.clienteleId;
  240. this.commitInfo.ifFeedback = false;
  241. }
  242. if (this.currentNode.nodeCode == 'LETTER_FEEDBACK') {
  243. let filter = this.feedback.filter(item => item != 'STATEMENT');
  244. filter = filter.filter(item => item != 'CHANGE_STATEMENT');
  245. filter = filter.filter(item => item != 'REPORT');
  246. filter = filter.filter(item => item != 'CHANGE_REPORT');
  247. filter = filter.filter(item => item != 'LETTER');
  248. if (filter.length==0) {
  249. showNotify({ type: 'danger', message: '请选择反馈信息' });
  250. return false;
  251. }
  252. this.commitInfo.production = this.feedback;
  253. this.commitInfo.ccId = this.personal.clienteleId;
  254. this.commitInfo.ifFeedback = false;
  255. }
  256. return true;
  257. },
  258. openTransferDialog(){
  259. this.taskTransforDialog = true;
  260. postUser("个贷外业岗").then(res=>{
  261. if (res.code == 200){
  262. this.users = res.data;
  263. }
  264. })
  265. },
  266. doTransfer(){
  267. let params = new Object();
  268. params.recordId = this.currentNode.tasks[0].recordId;
  269. params.toId = this.transforUserId;
  270. taskTransfer(params).then(res=>{
  271. if (res.code == 200){
  272. showNotify({ type: 'success', message: '任务转交成功' });
  273. this.taskTransforDialog = false;
  274. history.back();
  275. }
  276. })
  277. }
  278. },
  279. };
  280. </script>
  281. <style scoped>
  282. .button-style {
  283. display: inline-block;
  284. margin: 20px;
  285. width: 100px;
  286. }
  287. .buttons-div{
  288. width: 100%;
  289. display: flex;
  290. padding: 17px;
  291. }
  292. .button{
  293. width: 90px;
  294. margin-right: 50px;
  295. }
  296. .radio-class{
  297. margin-bottom: 10px;
  298. }
  299. </style>