dislogBatchAudit.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div>
  3. <BaseDialog
  4. :appendToBody="appendToBody"
  5. v-if="checkResult == -1"
  6. width="600px"
  7. :isShow.sync="isShow"
  8. title="确定审核不通过吗?"
  9. @opne="init"
  10. @submit="batchAudit"
  11. >
  12. <el-input
  13. :rows="6"
  14. type="textarea"
  15. placeholder="请输入不通过原因"
  16. v-model="checkReason"
  17. ></el-input>
  18. </BaseDialog>
  19. </div>
  20. </template>
  21. <script>
  22. import { divideByMonthEditBo, divideByEditBo } from "@/api/financed/index";
  23. export default {
  24. name: "remarks",
  25. props: {
  26. dialogVisible: {
  27. type: Boolean,
  28. default: false,
  29. },
  30. info: {
  31. type: Object,
  32. default: () => {
  33. return {};
  34. },
  35. },
  36. appendToBody: {
  37. type: Boolean,
  38. default: false,
  39. },
  40. },
  41. data() {
  42. return {
  43. checkReason: undefined,
  44. };
  45. },
  46. mounted() {},
  47. methods: {
  48. init() {
  49. this.checkReason = undefined;
  50. },
  51. backForm() {
  52. let { checkFrom, checkResult } = this.info;
  53. const key = this.isCommission ? "orderSn" : "divideLogId";
  54. let form = this.info[key].map((e) => {
  55. return {
  56. [key]: e,
  57. checkResult,
  58. checkReason: this.checkReason,
  59. checkFrom,
  60. };
  61. });
  62. return form;
  63. },
  64. batchAuditPass() {
  65. this.$confirm("确定审核通过吗?", "提示", {
  66. confirmButtonText: "确定通过",
  67. cancelButtonText: "取消",
  68. type: "warning",
  69. }).then(() => {
  70. this.batchAudit();
  71. });
  72. },
  73. batchAudit() {
  74. const fn = this.isCommission ? divideByEditBo : divideByMonthEditBo;
  75. fn(this.backForm()).then(() => {
  76. this.$message.success(
  77. `批量审核${this.checkResult == -1 ? "不" : ""}通过成功!`
  78. );
  79. this.isShow = false;
  80. this.$emit("search");
  81. });
  82. },
  83. },
  84. computed: {
  85. isShow: {
  86. get() {
  87. return this.dialogVisible;
  88. },
  89. set(val) {
  90. this.$emit("update:dialogVisible", false);
  91. },
  92. },
  93. checkResult() {
  94. return this.info.checkResult;
  95. },
  96. isCommission() {
  97. return !!this.info.isCommission;
  98. },
  99. },
  100. watch: {
  101. isShow(val) {
  102. if (val && this.checkResult == 1) {
  103. this.batchAuditPass();
  104. }
  105. },
  106. },
  107. };
  108. </script>
  109. <style lang="scss" scoped></style>