AIImageDetail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div class="AIImageDetail" v-if="data">
  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">{{ data.storeName }}</div>
  8. <div class="storeCode" style="margin-left: 5px; margin-top: 2px">
  9. (<span style="color: #0057ba; vertical-align: -1px">{{ data.storeCode }}</span
  10. >)
  11. </div>
  12. </div>
  13. <div class="item">
  14. <div class="label">门店类型:</div>
  15. <div class="value">{{ data.storeCategoryName }}</div>
  16. </div>
  17. <div class="item">
  18. <div class="label">地址:</div>
  19. <div class="value">{{ data.addressLine }}</div>
  20. </div>
  21. <div class="item">
  22. <div class="label">拜访人:</div>
  23. <div class="value">{{ data.visitUserNickName }}</div>
  24. </div>
  25. <div class="item">
  26. <div class="label">拜访时间:</div>
  27. <div class="value">{{ data.createTime }}</div>
  28. </div>
  29. <div class="item">
  30. <div class="label">拍摄类型:</div>
  31. <div class="value">{{ data.identifyType | filterType }}</div>
  32. </div>
  33. <div class="item" style="color: red">
  34. <div class="label">识别结果:</div>
  35. <div class="value">{{ data.unqualifiedReason }}</div>
  36. </div>
  37. <div class="item">
  38. <div class="label">业务员反馈AI识别不正确:{{ data.feedbackMessage || '未反馈' }}</div>
  39. </div>
  40. <div class="item" style="display: flex; justify-content: center">
  41. <van-image
  42. v-if="data.fileUrl"
  43. height="400px"
  44. :src="data.fileUrl"
  45. @click="previewImgs(data.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. <p class="titleText">请主管了解情况后回复原因及解决方案</p>
  54. <div class="feedbackReason">
  55. <div class="result">
  56. <div class="title">
  57. <span style="color: red">*</span>
  58. <span>请核查并确认店招异常原因:</span>
  59. </div>
  60. <van-radio-group v-model="abnormalReason" :disabled="approveState == '1'">
  61. <van-radio :name="item.dictValue" v-for="item in AIResultOption">{{
  62. item.dictLabel
  63. }}</van-radio>
  64. </van-radio-group>
  65. </div>
  66. <div class="cause" v-if="data.abnormalStoreSolutionImg">
  67. <div class="title">
  68. <span style="color: red">*</span>
  69. <span>请知悉异常店招对应解决方案,并尽快整改</span>
  70. </div>
  71. <div class="tipsImg">
  72. <img
  73. :src="data.abnormalStoreSolutionImg"
  74. width="100%"
  75. @click="previewImgs(data.abnormalStoreSolutionImg)" />
  76. </div>
  77. </div>
  78. <div class="cause">
  79. <div class="title">
  80. <span>反馈:</span>
  81. </div>
  82. <van-field
  83. v-model="causeMessage"
  84. :disabled="approveState == '1'"
  85. rows="1"
  86. autosize
  87. type="textarea"
  88. placeholder="如ai识别错误、门店异常原因等,均可在此反馈,本部相关负责人会查看" />
  89. </div>
  90. </div>
  91. <div class="confirmBtn" v-if="approveState == '0'">
  92. <van-button type="info" @click="confirm">提交</van-button>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import { ImagePreview } from 'vant';
  98. import { getPhotoApproveDetail, savePhotoApprove } from '@/api/AIImage';
  99. import { getDictOption } from '@/api/index';
  100. export default {
  101. name: 'AIImageDetail',
  102. data() {
  103. return {
  104. data: null,
  105. photoApproveId: null,
  106. abnormalReason: '1',
  107. causeTitle: '',
  108. causeMessage: '',
  109. approveState: '0',
  110. AIResultOption: [],
  111. };
  112. },
  113. filters: {
  114. filterType(val) {
  115. if (val == 1) {
  116. return '店招内容识别';
  117. } else if (val == 2) {
  118. return '门店代码识别';
  119. } else if (val == 3) {
  120. return '调色机识别';
  121. } else if (val == 4) {
  122. return '更换店招';
  123. }
  124. },
  125. },
  126. activated() {
  127. this.photoApproveId = this.$route.query.photoApproveId;
  128. this.getDeytail();
  129. // 获取店招异常原因字典
  130. getDictOption({}, 'feedback_error_msg').then((res) => {
  131. this.AIResultOption = res.data;
  132. });
  133. },
  134. mounted() {},
  135. methods: {
  136. getDeytail() {
  137. this.toastLoading(0, '加载中...', true);
  138. getPhotoApproveDetail({ photoApproveId: this.photoApproveId }).then((res) => {
  139. this.toastLoading().clear();
  140. if (res.code == 200) {
  141. this.data = res.data;
  142. this.approveState = res.data.approveState; //反馈状态:0 未审批 1已审批
  143. if (this.approveState == '0') {
  144. // latestPhotoApprove 上次反馈内容 反显
  145. let latestPhotoApprove = res.data.latestPhotoApprove;
  146. if (latestPhotoApprove) {
  147. this.abnormalReason = latestPhotoApprove.resultCorrect || '1';
  148. this.causeMessage =
  149. latestPhotoApprove.reasonsSolutions || latestPhotoApprove.feedbackError;
  150. this.$dialog
  151. .confirm({
  152. title: '系统提示',
  153. message:
  154. latestPhotoApprove.approveTime +
  155. '已反馈该店拜访照异常原因及解决方案,此次拜访照仍异常,请及时跟进',
  156. confirmButtonText: '确定',
  157. showCancelButton: false,
  158. })
  159. .then(() => {});
  160. }
  161. } else {
  162. this.abnormalReason = res.data.resultCorrect || '1';
  163. this.causeMessage = res.data.reasonsSolutions || res.data.feedbackError;
  164. }
  165. }
  166. });
  167. },
  168. previewImgs(val) {
  169. ImagePreview([val]);
  170. },
  171. confirm() {
  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" scoped>
  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. }
  253. </style>