submit.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <el-col :span="16" :offset="6">
  3. <el-form label-width="100px">
  4. <el-form-item
  5. label="审批建议"
  6. prop="reason"
  7. style="margin-bottom: 20px"
  8. :rules="{
  9. required: true,
  10. message: '请选择',
  11. trigger: 'change'
  12. }"
  13. >
  14. <el-input
  15. type="textarea"
  16. v-model="reason"
  17. placeholder="请输入审批建议"
  18. />
  19. </el-form-item>
  20. </el-form>
  21. <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
  22. <el-button
  23. icon="el-icon-edit-outline"
  24. type="success"
  25. size="mini"
  26. @click="handleAudit(1)"
  27. >通过
  28. </el-button>
  29. <el-button
  30. icon="el-icon-circle-close"
  31. type="danger"
  32. size="mini"
  33. @click="handleAudit(0)"
  34. >不通过
  35. </el-button>
  36. <el-dropdown @command="(command) => handleCommand(command)" style="margin-left: 30px;">
  37. <span class="el-dropdown-link">更多<i class="el-icon-arrow-down el-icon--right"></i></span>
  38. <el-dropdown-menu slot="dropdown">
  39. <el-dropdown-item command="cancel">作废</el-dropdown-item>
  40. </el-dropdown-menu>
  41. </el-dropdown>
  42. </div>
  43. </el-col>
  44. </template>
  45. <script>
  46. import { managerApprove, cancel } from '@/api/bpm/components/saleManage/contact';
  47. // 流程实例的详情页,可用于审批
  48. export default {
  49. name: '',
  50. components: {
  51. // Parser
  52. },
  53. props: {
  54. businessId: {
  55. default: ''
  56. },
  57. taskId: {
  58. default: ''
  59. }
  60. },
  61. data() {
  62. return {
  63. reason: ''
  64. };
  65. },
  66. created() {},
  67. methods: {
  68. /** 处理转办审批人 */
  69. handleUpdateAssignee() {
  70. this.$emit('handleUpdateAssignee');
  71. },
  72. handleAudit(status) {
  73. managerApprove({
  74. businessId: this.businessId,
  75. reason: this.reason,
  76. status,
  77. taskId: this.taskId
  78. }).then((res) => {
  79. this.$emit('handleAudit', { status });
  80. });
  81. // this.dialogVisible = false;
  82. },
  83. //更多
  84. handleCommand(command) {
  85. if (command === 'cancel') {
  86. this.$confirm("是否确认作废?", {
  87. type: 'warning',
  88. cancelButtonText: '取消',
  89. confirmButtonText: '确定'
  90. }).then(() => {
  91. cancel({
  92. id: this.taskId,
  93. reason: this.form.reason,
  94. businessId: this.businessId,
  95. }).then(() => {
  96. this.$emit('handleClose');
  97. }).catch(() => {
  98. this.$message.error("流程作废失败");
  99. });
  100. }).catch(() => {});
  101. }
  102. },
  103. }
  104. };
  105. </script>
  106. <style lang="scss"></style>