AIImageDetail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <div class="AIImageDetail" v-if="detail">
  3. <van-nav-bar class="navBar" title="异常反馈" left-arrow @click-left="onClickLeft">
  4. </van-nav-bar>
  5. <div class="message">
  6. <div class="storeTitle">
  7. <div class="storeName">{{ detail.storeName }}</div>
  8. <div class="storeCode" style="margin-left: 5px; margin-top: 2px">
  9. (<span style="color: #0057ba; vertical-align: -1px">{{ detail.storeCode }}</span
  10. >)
  11. </div>
  12. </div>
  13. <div class="item">
  14. <div class="label">门店类型:</div>
  15. <div class="value">{{ detail.storeCategoryName }}</div>
  16. </div>
  17. <div class="item">
  18. <div class="label">地址:</div>
  19. <div class="value">{{ detail.addressLine }}</div>
  20. </div>
  21. <div class="item">
  22. <div class="label">拜访人:</div>
  23. <div class="value">{{ detail.visitUserNickName }}</div>
  24. </div>
  25. <div class="item">
  26. <div class="label">拜访时间:</div>
  27. <div class="value">{{ detail.createTime }}</div>
  28. </div>
  29. <div class="item">
  30. <div class="label">拍摄类型:</div>
  31. <div class="value">{{ detail.identifyType | filterType }}</div>
  32. </div>
  33. <div class="item" style="color: red">
  34. <div class="label">识别结果:</div>
  35. <div class="value">{{ detail.unqualifiedReason }}</div>
  36. </div>
  37. <div class="item">
  38. <div class="label">业务员反馈AI识别不正确:{{ detail.feedbackMessage || '未反馈' }}</div>
  39. </div>
  40. <div class="item" style="display: flex; justify-content: center">
  41. <van-image
  42. v-if="detail.fileUrl"
  43. height="400px"
  44. :src="detail.fileUrl"
  45. @click="previewImgs(detail.fileUrl)"
  46. fit="contain">
  47. <template v-slot:loading>
  48. <van-loading type="spinner" size="40" />
  49. </template>
  50. </van-image>
  51. </div>
  52. </div>
  53. <template v-if="detail && detail.historyFeedback == '0'">
  54. <!-- 旧的识别反馈 -->
  55. <historyAIImageDetail
  56. :detail="detail"
  57. :approveState="approveState"
  58. :abnormalReason="abnormalReason"
  59. :causeMessage="causeMessage"
  60. :photoApproveId="photoApproveId"
  61. :AIResultOption="AIResultOption"></historyAIImageDetail>
  62. </template>
  63. <template v-if="detail && detail.historyFeedback == '1'">
  64. <!-- 新的识别反馈-调色机 -->
  65. <AIImageDetailTSJ
  66. v-if="detail.identifyType == '3'"
  67. :detail="detail"
  68. :approveState="approveState"
  69. :abnormalReason="abnormalReason"
  70. :causeMessage="causeMessage"
  71. :photoApproveId="photoApproveId"
  72. :AIResultOption="AIResultOption"></AIImageDetailTSJ>
  73. <AIImageDetailPage
  74. v-else
  75. :detail="detail"
  76. :approveState="approveState"
  77. :abnormalReason="abnormalReason"
  78. :causeMessage="causeMessage"
  79. :photoApproveId="photoApproveId"
  80. :AIResultOption="AIResultOption"></AIImageDetailPage>
  81. </template>
  82. </div>
  83. </template>
  84. <script>
  85. import { ImagePreview } from 'vant';
  86. import { getPhotoApproveDetail, savePhotoApprove } from '@/api/AIImage';
  87. import { getDictOption } from '@/api/index';
  88. import historyAIImageDetail from './historyAIImageDetail.vue';
  89. import AIImageDetailTSJ from './AIImageDetailTSJ.vue';
  90. import AIImageDetailPage from './AIImageDetailPage.vue';
  91. export default {
  92. name: 'AIImageDetail',
  93. components: {
  94. historyAIImageDetail,
  95. AIImageDetailTSJ,
  96. AIImageDetailPage,
  97. },
  98. data() {
  99. return {
  100. detail: null,
  101. photoApproveId: null,
  102. abnormalReason: '1',
  103. causeTitle: '',
  104. causeMessage: '',
  105. approveState: '0',
  106. AIResultOption: [],
  107. };
  108. },
  109. filters: {
  110. filterType(val) {
  111. if (val == 1) {
  112. return '店招内容识别';
  113. } else if (val == 2) {
  114. return '门店代码识别';
  115. } else if (val == 3) {
  116. return '调色机识别';
  117. } else if (val == 4) {
  118. return '更换店招';
  119. }
  120. },
  121. },
  122. activated() {
  123. this.photoApproveId = this.$route.query.photoApproveId;
  124. this.getDeytail();
  125. // 获取店招异常原因字典
  126. getDictOption({}, 'feedback_error_msg').then((res) => {
  127. this.AIResultOption = res.data;
  128. });
  129. },
  130. mounted() {},
  131. methods: {
  132. getDeytail() {
  133. this.toastLoading(0, '加载中...', true);
  134. getPhotoApproveDetail({ photoApproveId: this.photoApproveId }).then((res) => {
  135. this.toastLoading().clear();
  136. if (res.code == 200) {
  137. this.detail = res.data;
  138. this.approveState = res.data.approveState; //反馈状态:0 未审批 1已审批
  139. if (this.approveState == '0') {
  140. // latestPhotoApprove 上次反馈内容 反显
  141. let latestPhotoApprove = res.data.latestPhotoApprove;
  142. if (latestPhotoApprove) {
  143. this.abnormalReason = latestPhotoApprove.resultCorrect || '1';
  144. this.causeMessage =
  145. latestPhotoApprove.reasonsSolutions || latestPhotoApprove.feedbackError;
  146. this.$dialog
  147. .confirm({
  148. title: '系统提示',
  149. message:
  150. latestPhotoApprove.approveTime +
  151. '已反馈该店拜访照异常原因及解决方案,此次拜访照仍异常,请及时跟进',
  152. confirmButtonText: '确定',
  153. showCancelButton: false,
  154. })
  155. .then(() => {});
  156. }
  157. } else {
  158. this.abnormalReason = res.data.resultCorrect || '1';
  159. this.causeMessage = res.data.reasonsSolutions || res.data.feedbackError;
  160. }
  161. }
  162. });
  163. },
  164. previewImgs(val) {
  165. ImagePreview([val]);
  166. },
  167. confirm() {
  168. if (!this.abnormalReason) {
  169. this.$toast('请选择招异常原因');
  170. return;
  171. }
  172. this.toastLoading(0, '加载中...', true);
  173. savePhotoApprove({
  174. photoApproveId: this.photoApproveId, // long 主键
  175. resultCorrect: this.abnormalReason, // string AI识别是否正确: 1 正确 0不正确
  176. reasonsSolutions: '',
  177. feedbackError: this.causeMessage, // string 反馈AI识别不正确
  178. }).then((res) => {
  179. this.toastLoading().clear();
  180. if (res.code == 200) {
  181. this.$toast.loading({
  182. duration: 1000,
  183. message: '已反馈给本部',
  184. forbidClick: true,
  185. onClose: () => {
  186. this.onClickLeft();
  187. },
  188. });
  189. } else {
  190. this.$toast('提交失败');
  191. }
  192. });
  193. },
  194. onClickLeft() {
  195. this.$router.replace({
  196. path: '/AIImage',
  197. });
  198. },
  199. },
  200. };
  201. </script>
  202. <style lang="scss">
  203. .AIImageDetail {
  204. .message {
  205. padding: 10px;
  206. background: #fff;
  207. .storeTitle {
  208. display: flex;
  209. font-size: 16px;
  210. font-weight: bold;
  211. padding: 5px 0;
  212. }
  213. .item {
  214. display: flex;
  215. font-size: 13px;
  216. padding: 3px 0;
  217. .label {
  218. /* width: 80px; */
  219. text-align: left;
  220. }
  221. .value {
  222. flex: 1;
  223. }
  224. }
  225. }
  226. .titleText {
  227. padding: 10px;
  228. font-size: 16px;
  229. font-weight: 600;
  230. margin: 0;
  231. }
  232. .feedbackReason {
  233. padding: 10px;
  234. background: #fff;
  235. font-size: 16px;
  236. .title {
  237. padding: 8px 0;
  238. }
  239. .van-radio {
  240. padding: 5px 0 5px 10px;
  241. }
  242. }
  243. .confirmBtn {
  244. position: sticky;
  245. bottom: 0;
  246. padding-top: 20px;
  247. button {
  248. width: 100%;
  249. background-color: #1a77cc;
  250. }
  251. }
  252. .van-radio__label {
  253. font-size: 14px;
  254. }
  255. }
  256. </style>