todoDetail.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 { showConfirmDialog } from 'vant';
  33. import { showNotify } from 'vant';
  34. import { getMajorTodoDetail } from '@/api/major';
  35. import { currentNode } from '@/api/workFlowNodeInstance';
  36. import { commit } from '@/api/workflow';
  37. export default {
  38. data() {
  39. return {
  40. // 大中型详情
  41. major: {},
  42. currentNode: {},
  43. // 节点提交信息
  44. commitInfo: {},
  45. };
  46. },
  47. created() {
  48. this.major.id = this.$route.query.id;
  49. this.currentNode.nodeCode = this.$route.query.currentNodeCode;
  50. this.getTodoDetail();
  51. },
  52. methods: {
  53. // 获取待办详情
  54. getTodoDetail() {
  55. if (this.major.id) {
  56. getMajorTodoDetail(this.major.id).then((res) => {
  57. if (res.code === 200) {
  58. this.major = res.data;
  59. this.major.principal = this.$route.query.principal;
  60. this.major.projectName = this.$route.query.projectName;
  61. this.major.reportNo = this.$route.query.reportNo;
  62. this.major.statementNo = this.$route.query.statementNo;
  63. this.getCurrentNode();
  64. }
  65. });
  66. }
  67. },
  68. // 获取当前节点实例
  69. getCurrentNode() {
  70. if (this.major.id) {
  71. currentNode({ mainBusiness: 'MAJOR_BUSINESS', businessId: this.major.id, businessSubId: this.major.statementNo, businessMinId: this.major.reportNo }).then((res) => {
  72. if (res.code === 200) {
  73. this.currentNode = res.data;
  74. this.currentNode.taskCreated = this.$route.query.taskCreated;
  75. }
  76. });
  77. }
  78. },
  79. // 提交节点
  80. commitNode(state) {
  81. showConfirmDialog({
  82. title: '提交节点',
  83. message: '确认提交流程节点?',
  84. }).then(() => {
  85. this.commitInfo.instanceNodeId = this.currentNode.instanceId;
  86. this.commitInfo.state = state;
  87. this.commitInfo.businessSubId = this.major.statementNo;
  88. this.commitInfo.businessMinId = this.major.reportNo;
  89. commit(this.commitInfo).then((res) => {
  90. if (res.code === 200 && res.data) {
  91. showNotify({ type: 'success', message: '节点提交成功' });
  92. history.back();
  93. }
  94. });
  95. });
  96. },
  97. },
  98. };
  99. </script>
  100. <style scoped>
  101. .button-style {
  102. display: inline-block;
  103. margin: 20px;
  104. width: 100px;
  105. }
  106. </style>