AIImageDetailTSJ.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="AIImageDetail">
  3. <p class="titleText">请主管了解情况后回复原因及解决方案</p>
  4. <div class="feedbackReason">
  5. <div class="cause">
  6. <div class="title">
  7. <span style="color: red">*</span>
  8. <span>反馈原因及解决方案</span>
  9. </div>
  10. <van-field
  11. v-model="causeMessageData"
  12. :disabled="approveState == '1'"
  13. rows="1"
  14. autosize
  15. type="textarea"
  16. placeholder="请反馈原因及解决方案" />
  17. </div>
  18. </div>
  19. <div class="confirmBtn" v-if="approveState == '0'">
  20. <van-button type="info" @click="confirm">提交</van-button>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import { savePhotoApprove } from '@/api/AIImage';
  26. export default {
  27. name: 'AIImageDetail',
  28. props: {
  29. approveState: {
  30. type: String,
  31. default: '0',
  32. },
  33. causeMessage: {
  34. type: String,
  35. default: '',
  36. },
  37. photoApproveId: {
  38. type: [String, Number],
  39. default: '',
  40. },
  41. },
  42. data() {
  43. return {
  44. causeMessageData: '',
  45. };
  46. },
  47. activated() {
  48. this.causeMessageData = this.causeMessage;
  49. },
  50. methods: {
  51. confirm() {
  52. if (!this.causeMessageData) {
  53. this.$toast('请反馈原因及解决方案');
  54. return;
  55. }
  56. savePhotoApprove({
  57. photoApproveId: this.photoApproveId, // long 主键
  58. resultCorrect: '', // string AI识别是否正确: 1 正确 0不正确
  59. reasonsSolutions: this.causeMessageData, // string 原因及解决方案
  60. feedbackError: '', // string 反馈AI识别不正确
  61. }).then((res) => {
  62. if (res.code == 200) {
  63. this.$toast.loading({
  64. duration: 1000,
  65. message: '已反馈给本部',
  66. forbidClick: true,
  67. onClose: () => {
  68. this.onClickLeft();
  69. },
  70. });
  71. } else {
  72. this.$toast('提交失败');
  73. }
  74. });
  75. },
  76. onClickLeft() {
  77. this.$router.replace({
  78. path: '/AIImage',
  79. });
  80. },
  81. },
  82. };
  83. </script>