audit.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div>
  3. <el-alert style="margin: 20px 0;"
  4. title="审核意见"
  5. :closable="false"
  6. class="alert"
  7. type="info">
  8. </el-alert>
  9. <el-input type="textarea"
  10. :autosize="{ minRows: 2, maxRows: 4 }"
  11. placeholder="请输入审核意见"
  12. v-model="remark">
  13. </el-input>
  14. <div slot="footer"
  15. class="dialog-footer">
  16. <!-- <el-button @click="$listeners.close">取 消</el-button> -->
  17. <el-button type="primary"
  18. @click="submit(1)"
  19. v-if="permission('musicGroupPaymentCalender/auditPass')">审核通过</el-button>
  20. <el-button type="danger"
  21. @click="submit(0)"
  22. v-if="permission('musicGroupPaymentCalender/auditRefuse')">驳回</el-button>
  23. <el-button @click="$emit('close')">关 闭</el-button>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import { permission } from '@/utils/directivePage'
  29. import { auditPass, auditRefuse } from "@/api/auditManager";
  30. export default {
  31. props: ["selList"],
  32. data () {
  33. return {
  34. remark: "",
  35. };
  36. },
  37. methods: {
  38. async submit (val) {
  39. if (!this.remark) {
  40. return this.$message.error("请输入审核意见");
  41. }
  42. if (val) {
  43. try {
  44. await this.$confirm('是否确认批量审核通过', '提示', {
  45. type: 'warning'
  46. })
  47. await auditPass({ batchNo: this.selList.map(item => item.batchNo).join(','), auditMemo: this.remark }).then((res) => {
  48. if (res.code == 200) {
  49. this.$message.success('批量审核通过')
  50. this.$emit('close')
  51. this.$emit('submited')
  52. }
  53. });
  54. } catch (error) {}
  55. } else {
  56. try {
  57. await this.$confirm('是否确认批量驳回', '提示', {
  58. type: 'warning'
  59. })
  60. await auditRefuse({ batchNo: this.selList.map(item => item.batchNo).join(','), auditMemo: this.remark }).then((res) => {
  61. if (res.code == 200) {
  62. this.$message.success('批量驳回成功')
  63. this.$emit('close')
  64. this.$emit('submited')
  65. }
  66. });
  67. } catch (error) {}
  68. }
  69. },
  70. permission (str) {
  71. return permission(str)
  72. }
  73. },
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. .dialog-footer {
  78. margin-top: 20px;
  79. display: block;
  80. text-align: right;
  81. }
  82. </style>