historyAIImageDetail.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div class="AIImageDetail">
  3. <p class="titleText">请主管了解情况后回复原因及解决方案</p>
  4. <div class="feedbackReason">
  5. <div class="result">
  6. <div class="title">
  7. <span style="color: red">*</span>
  8. <span>AI识别结果</span>
  9. </div>
  10. <van-radio-group v-model="AIResult" :disabled="approveState == '1'">
  11. <van-radio name="1">正确</van-radio>
  12. <van-radio name="0">不正确</van-radio>
  13. </van-radio-group>
  14. </div>
  15. <div class="cause">
  16. <div class="title">
  17. <span style="color: red">*</span>
  18. <span>{{ causeTitle }}</span>
  19. </div>
  20. <van-field
  21. v-model="causeMessageData"
  22. :disabled="approveState == '1'"
  23. rows="1"
  24. autosize
  25. type="textarea"
  26. :placeholder="'请输入' + causeTitle" />
  27. </div>
  28. </div>
  29. <div class="confirmBtn" v-if="approveState == '0'">
  30. <van-button type="info" @click="confirm">提交</van-button>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import { savePhotoApprove } from '@/api/AIImage';
  36. export default {
  37. name: 'AIImageDetail',
  38. props: {
  39. detail: {
  40. type: Object,
  41. },
  42. approveState: {
  43. type: String,
  44. default: '0',
  45. },
  46. causeMessage: {
  47. type: String,
  48. default: '',
  49. },
  50. photoApproveId: {
  51. type: [String, Number],
  52. default: '',
  53. },
  54. },
  55. data() {
  56. return {
  57. AIResult: '1',
  58. causeMessageData: '',
  59. };
  60. },
  61. watch: {
  62. AIResult: {
  63. handler(val) {
  64. if (val == 1) {
  65. this.causeTitle = '拜访照异常原因及解决方案';
  66. } else {
  67. this.causeTitle = '反馈AI识别结果有误';
  68. }
  69. },
  70. immediate: true,
  71. },
  72. detail: {
  73. handler(val) {
  74. this.causeMessageData = this.causeMessage;
  75. },
  76. immediate: true,
  77. },
  78. },
  79. mounted() {},
  80. methods: {
  81. confirm() {
  82. if (!this.causeMessageData) {
  83. this.$toast('请输入' + this.causeTitle);
  84. return;
  85. }
  86. savePhotoApprove({
  87. photoApproveId: this.photoApproveId, // long 主键
  88. resultCorrect: this.AIResult, // string AI识别是否正确: 1 正确 0不正确
  89. reasonsSolutions: this.AIResult == '1' ? this.causeMessageData : '', // string 原因及解决方案
  90. feedbackError: this.AIResult == '0' ? this.causeMessageData : '', // string 反馈AI识别不正确
  91. }).then((res) => {
  92. if (res.code == 200) {
  93. this.$toast.loading({
  94. duration: 1000,
  95. message: '已反馈给本部',
  96. forbidClick: true,
  97. onClose: () => {
  98. this.onClickLeft();
  99. },
  100. });
  101. } else {
  102. this.$toast('提交失败');
  103. }
  104. });
  105. },
  106. onClickLeft() {
  107. this.$router.replace({
  108. path: '/AIImage',
  109. });
  110. },
  111. },
  112. };
  113. </script>