submit.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <el-col :span="16" :offset="6">
  3. <el-form label-width="100px" ref="formRef" :model="form">
  4. <el-form-item
  5. label="审批建议"
  6. style="margin-bottom: 20px"
  7. :rules="{
  8. required: true,
  9. message: '请选择',
  10. trigger: 'change'
  11. }"
  12. >
  13. <el-input
  14. type="textarea"
  15. v-model="form.reason"
  16. placeholder="请输入审批建议"
  17. />
  18. </el-form-item>
  19. </el-form>
  20. <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
  21. <el-button
  22. icon="el-icon-edit-outline"
  23. type="success"
  24. size="mini"
  25. @click="handleAudit2(1)"
  26. >通过
  27. </el-button>
  28. <el-button
  29. icon="el-icon-circle-close"
  30. type="danger"
  31. size="mini"
  32. @click="handleAudit2(0)"
  33. >驳回
  34. </el-button>
  35. </div>
  36. </el-col>
  37. </template>
  38. <script>
  39. import {
  40. outsourceAssign,
  41. outsourceNotPass
  42. } from '@/api/bpm/components/outsourcedWarehousing/index';
  43. // 流程实例的详情页,可用于审批
  44. export default {
  45. name: '',
  46. components: {},
  47. props: {
  48. businessId: {
  49. default: ''
  50. },
  51. taskId: {
  52. default: ''
  53. },
  54. id: {
  55. default: ''
  56. },
  57. taskDefinitionKey: {
  58. default: ''
  59. }
  60. },
  61. data() {
  62. return {
  63. form: {
  64. technicianId: '',
  65. reason: '同意'
  66. }
  67. };
  68. },
  69. computed: {},
  70. created() {},
  71. methods: {
  72. handleAudit2(status) {
  73. this._approveTaskThorVariables(status);
  74. },
  75. async _approveTaskThorVariables(status) {
  76. if (status == 1) {
  77. outsourceAssign({
  78. businessId: this.businessId,
  79. id: this.taskId,
  80. reason: this.form.reason,
  81. pass: true
  82. }).then((res) => {
  83. this.$emit('handleAudit', {
  84. status,
  85. title: ''
  86. });
  87. });
  88. } else if (status == 0) {
  89. outsourceNotPass({
  90. businessId: this.businessId,
  91. id: this.taskId,
  92. reason: this.form.reason,
  93. pass: false
  94. }).then((res) => {
  95. this.$emit('handleAudit', {
  96. status,
  97. title: '驳回'
  98. });
  99. });
  100. }
  101. }
  102. }
  103. };
  104. </script>
  105. <style lang="scss"></style>