todoDetail.vue 4.1 KB

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