todoDetail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div>
  3. <BackBar title="待办处理-资产" lefttext="返回" />
  4. <van-form>
  5. <van-cell-group inset>
  6. <van-field label="项目编号" v-model="assets.orderId" name="orderId" readonly placeholder="-" />
  7. <van-field label="订单名称" v-model="assets.projectName" name="projectName" type="textarea" readonly placeholder="-" />
  8. <van-field label="意见书号" v-model="assets.statementNo" name="statementNo" readonly placeholder="-" />
  9. <van-field label="报告号" v-model="assets.reportNo" name="reportNo" readonly placeholder="-" />
  10. <van-field label="业务类型" v-model="assets.assetsBusinessGener" name="assetsBusinessGener" readonly placeholder="-" />
  11. <van-field label="客户名称" v-model="assets.customerName" name="customerName" readonly placeholder="-" />
  12. <van-field label="业务来源" v-model="assets.customerSubName" name="customerSubName" readonly placeholder="-" />
  13. <van-field label="委托人" v-model="assets.bailor" name="bailor" readonly placeholder="-" />
  14. <van-field label="委托人电话" v-model="assets.bailorContactTel" name="bailorContactTel" readonly placeholder="-" />
  15. <van-field label="当前节点" v-model="currentNode.nodeName" name="nodeName" readonly :error="true" placeholder="-" />
  16. <van-field label="节点处理人" v-model="currentNode.handlerName" name="handlerName" readonly placeholder="-" />
  17. <van-field label="项目负责人" v-model="assets.principalName" name="principalName" readonly placeholder="-" />
  18. <van-field label="客户经理" v-model="assets.clientManagerName" name="clientManagerName" readonly placeholder="-" />
  19. <van-field label="最新备注" v-model="commitInfo.comments" name="comments" type="textarea" />
  20. </van-cell-group>
  21. </van-form>
  22. <div class="button-style" style="float: left" v-if="currentNode.reversible">
  23. <van-button type="warning" style="width: 100%" @click="commitNode('REVERSE')">退回</van-button>
  24. </div>
  25. <div class="button-style" style="float: right">
  26. <van-button type="success" style="width: 100%" @click="commitNode('PASS')">提交</van-button>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import { showConfirmDialog } from 'vant';
  32. import { showNotify } from 'vant';
  33. import { getAssetsTodoDetail } from '@/api/assets';
  34. import { currentNode } from '@/api/workFlowNodeInstance';
  35. import { commit } from '@/api/workflow';
  36. export default {
  37. data() {
  38. return {
  39. // 资产详情
  40. assets: {},
  41. currentNode: {},
  42. // 节点提交信息
  43. commitInfo: {},
  44. };
  45. },
  46. created() {
  47. this.assets.id = this.$route.query.assetsId;
  48. this.getTodoDetail();
  49. this.getCurrentNode();
  50. },
  51. methods: {
  52. // 获取待办详情
  53. getTodoDetail() {
  54. if (this.assets.id) {
  55. getAssetsTodoDetail(this.assets.id).then((res) => {
  56. if (res.code === 200) {
  57. this.assets = res.data;
  58. this.assets.statementNo = this.$route.query.statementNo;
  59. this.assets.reportNo = this.$route.query.reportNo;
  60. this.assets.projectName = this.$route.query.projectName;
  61. }
  62. });
  63. }
  64. },
  65. // 获取当前节点实例
  66. getCurrentNode() {
  67. if (this.assets.id) {
  68. currentNode({ mainBusiness: 'ASSET_BUSINESS', businessId: this.assets.id, businessSubId: this.$route.query.statementNo, businessMinId: this.$route.query.reportNo }).then((res) => {
  69. if (res.code === 200) {
  70. this.currentNode = res.data;
  71. this.currentNode.currentNodeCode = this.$route.query.currentNodeCode;
  72. this.currentNode.handlerName = this.$route.query.handlerName;
  73. }
  74. });
  75. }
  76. },
  77. // 提交节点
  78. commitNode(state) {
  79. showConfirmDialog({
  80. title: '提交节点',
  81. message: '确认提交流程节点?',
  82. }).then(() => {
  83. this.commitInfo.instanceNodeId = this.currentNode.instanceId;
  84. this.commitInfo.state = state;
  85. this.commitInfo.businessSubId = this.assets.statementNo;
  86. this.commitInfo.businessMinId = this.assets.reportNo;
  87. commit(this.commitInfo).then((res) => {
  88. if (res.code === 200 && res.data) {
  89. showNotify({ type: 'success', message: '节点提交成功' });
  90. history.back();
  91. }
  92. });
  93. });
  94. },
  95. },
  96. };
  97. </script>
  98. <style scoped>
  99. .button-style {
  100. display: inline-block;
  101. margin: 20px;
  102. width: 100px;
  103. }
  104. </style>