AIImageDetailPage.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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>请核查并确认店招异常原因:</span>
  9. </div>
  10. <van-radio-group v-model="abnormalReason" :disabled="approveState == '1'">
  11. <van-radio :name="item.dictValue" v-for="item in AIResultOption">{{
  12. item.dictLabel
  13. }}</van-radio>
  14. </van-radio-group>
  15. </div>
  16. <div class="cause" v-if="detail.abnormalStoreSolutionImg">
  17. <div class="title">
  18. <span style="color: red">*</span>
  19. <span>请知悉异常店招对应解决方案,并尽快整改</span>
  20. </div>
  21. <div class="tipsImg">
  22. <img
  23. :src="detail.abnormalStoreSolutionImg"
  24. width="100%"
  25. @click="previewImgs(detail.abnormalStoreSolutionImg)" />
  26. </div>
  27. </div>
  28. <div class="cause">
  29. <div class="title">
  30. <span>反馈:</span>
  31. </div>
  32. <van-field
  33. v-model="causeMessageData"
  34. :disabled="approveState == '1'"
  35. rows="1"
  36. autosize
  37. type="textarea"
  38. placeholder="如ai识别错误、门店异常原因等,均可在此反馈,本部相关负责人会查看" />
  39. </div>
  40. </div>
  41. <div class="confirmBtn" v-if="approveState == '0'">
  42. <van-button type="info" @click="confirm">提交</van-button>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import { ImagePreview } from 'vant';
  48. import { savePhotoApprove } from '@/api/AIImage';
  49. export default {
  50. name: 'AIImageDetail',
  51. props: {
  52. detail: {
  53. type: Object,
  54. },
  55. approveState: {
  56. type: String,
  57. default: '0',
  58. },
  59. abnormalReason: {
  60. type: String,
  61. default: '1',
  62. },
  63. causeMessage: {
  64. type: String,
  65. default: '',
  66. },
  67. photoApproveId: {
  68. type: [String, Number],
  69. default: '',
  70. },
  71. AIResultOption: {
  72. type: Array,
  73. default: () => [],
  74. },
  75. },
  76. data() {
  77. return {
  78. causeMessageData: '',
  79. };
  80. },
  81. activated() {
  82. this.causeMessageData = this.causeMessage;
  83. },
  84. methods: {
  85. previewImgs(val) {
  86. ImagePreview([val]);
  87. },
  88. confirm() {
  89. if (!this.abnormalReason) {
  90. this.$toast('请选择招异常原因');
  91. return;
  92. }
  93. this.toastLoading(0, '加载中...', true);
  94. savePhotoApprove({
  95. photoApproveId: this.photoApproveId, // long 主键
  96. resultCorrect: this.abnormalReason, // string AI识别是否正确: 1 正确 0不正确
  97. reasonsSolutions: '',
  98. feedbackError: this.causeMessageData, // string 反馈AI识别不正确
  99. }).then((res) => {
  100. this.toastLoading().clear();
  101. if (res.code == 200) {
  102. this.$toast.loading({
  103. duration: 1000,
  104. message: '已反馈给本部',
  105. forbidClick: true,
  106. onClose: () => {
  107. this.onClickLeft();
  108. },
  109. });
  110. } else {
  111. this.$toast('提交失败');
  112. }
  113. });
  114. },
  115. onClickLeft() {
  116. this.$router.replace({
  117. path: '/AIImage',
  118. });
  119. },
  120. },
  121. };
  122. </script>