start.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <basic-container>
  3. <avue-form ref="form" :option="option" v-model="form" @submit="handleSubmit"/>
  4. </basic-container>
  5. </template>
  6. <script>
  7. import { examineApproveSubmit } from "@/api/examineApprove/interface";
  8. export default {
  9. name: "start",
  10. props:{
  11. processDefinitionId:{
  12. type:String
  13. },
  14. itemId:{
  15. type:String
  16. }
  17. },
  18. data(){
  19. return {
  20. form: {},
  21. option: {
  22. group: [
  23. {
  24. labelWidth: 120,
  25. column: [
  26. {
  27. label: '第一级审批人',
  28. prop: 'checkUser',
  29. type: 'select',
  30. dicUrl: `/api/blade-user/user-list`,
  31. row:true,
  32. props: {
  33. label: "account",
  34. value: "id"
  35. },
  36. span: 22,
  37. rules: [
  38. {
  39. required: true,
  40. message: '请选择第一级审批人',
  41. trigger: 'blur'
  42. }
  43. ]
  44. },
  45. {
  46. label: '第二级审批人',
  47. prop: 'checkSecondsUser',
  48. type: 'select',
  49. row:true,
  50. dicUrl: `/api/blade-user/user-list`,
  51. props: {
  52. label: "account",
  53. value: "id"
  54. },
  55. span: 22,
  56. rules: [
  57. {
  58. required: true,
  59. message: '请选择第二级审批人',
  60. trigger: 'blur'
  61. }
  62. ]
  63. },
  64. {
  65. label: '备注',
  66. row:true,
  67. prop: 'reason',
  68. type: 'textarea',
  69. span: 22,
  70. rules: [
  71. {
  72. required: true,
  73. message: '请输入请假理由',
  74. trigger: 'blur'
  75. }
  76. ]
  77. },
  78. ]
  79. },
  80. ],
  81. }
  82. }
  83. },
  84. methods:{
  85. handleSubmit(){
  86. this.$refs["form"].validate((valid) => {
  87. if(valid){
  88. this.form.processDefinitionId = this.processDefinitionId
  89. this.form.itemId = this.itemId
  90. examineApproveSubmit(this.form).then(res =>{
  91. if(res.data.success){
  92. this.$message.success("请核成功!")
  93. this.$emit('dialogClose');
  94. }
  95. })
  96. }
  97. })
  98. }
  99. }
  100. }
  101. </script>
  102. <style scoped>
  103. .startFrom-input{
  104. display:flex;
  105. justify-content:center;
  106. }
  107. </style>