AIImageDetailPage.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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="resultCorrect" :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. watch: {
  77. detail: {
  78. handler(val) {
  79. this.causeMessageData = this.causeMessage;
  80. },
  81. immediate: true,
  82. },
  83. },
  84. data() {
  85. return {
  86. causeMessageData: '',
  87. resultCorrect: '1',
  88. };
  89. },
  90. created() {
  91. this.resultCorrect = this.abnormalReason == '0' ? '1' : this.abnormalReason;
  92. },
  93. methods: {
  94. previewImgs(val) {
  95. ImagePreview([val]);
  96. },
  97. confirm() {
  98. if (!this.resultCorrect || this.resultCorrect == '0') {
  99. this.$toast('请选择招异常原因');
  100. return;
  101. }
  102. this.toastLoading(0, '加载中...', true);
  103. savePhotoApprove({
  104. photoApproveId: this.photoApproveId, // long 主键
  105. resultCorrect: this.resultCorrect, // string AI识别是否正确: 1 正确 0不正确
  106. reasonsSolutions: '',
  107. feedbackError: this.causeMessageData, // string 反馈AI识别不正确
  108. }).then((res) => {
  109. this.toastLoading().clear();
  110. if (res.code == 200) {
  111. this.$toast.loading({
  112. duration: 1000,
  113. message: '已反馈给本部',
  114. forbidClick: true,
  115. onClose: () => {
  116. this.onClickLeft();
  117. },
  118. });
  119. } else {
  120. this.$toast('提交失败');
  121. }
  122. });
  123. },
  124. onClickLeft() {
  125. this.$router.replace({
  126. path: '/AIImage',
  127. });
  128. },
  129. },
  130. };
  131. </script>