skuRecognize.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div class="skuRecognize">
  3. <van-nav-bar class="navBar" title="拜访任务详情" left-arrow @click-left="onClickLeft">
  4. <template #right>
  5. <van-button
  6. style="height: 30px; padding: 5px; border-radius: 5px"
  7. type="info"
  8. v-if="detail && detail.skuPhotoIdentifyId"
  9. @click="feedbackShow = true"
  10. >识别异常反馈</van-button
  11. >
  12. </template>
  13. </van-nav-bar>
  14. <div class="content" v-if="detail">
  15. <div class="title">产品陈列照</div>
  16. <div class="tipsTitle">{{ detail.skuDescribe }}</div>
  17. <div>
  18. <van-row gutter="10">
  19. <van-col span="4" v-for="(urls, index) in detail.fileUrlList" :key="index">
  20. <div class="img-box">
  21. <img :src="urls" @click="previewsImg(index)" />
  22. </div>
  23. </van-col>
  24. </van-row>
  25. </div>
  26. <div class="skuDeatil" v-if="detail.skuList">
  27. <div class="tableTitle">SKU图像识别结果:{{ detail.skuTotal }}个</div>
  28. <el-table
  29. :data="detail.skuList"
  30. style="width: 100%; border-radius: 10px"
  31. border
  32. class="table-headermd">
  33. <el-table-column label="序号" type="index" align="center"> </el-table-column>
  34. <el-table-column label="品类" prop="skuProductType" align="center"></el-table-column>
  35. <el-table-column label="SKU名称" prop="name" align="center">
  36. <template slot-scope="scope">
  37. <span class="tipTitle">{{ scope.row.name }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="排面数" prop="count" align="center" width="60"></el-table-column>
  41. </el-table>
  42. </div>
  43. <!-- 返回历史 -->
  44. <div class="feedbackHistorical" v-if="detail.feedbackList.length">
  45. <div class="tableTitle">识别异常反馈</div>
  46. <div class="historicalContent">
  47. <div class="rejectMsgItem" v-for="(item, index) in detail.feedbackList" :key="index">
  48. <div class="item approver">
  49. <span class="label">反馈人:</span>
  50. <span class="value">{{ item.nickName }}</span>
  51. </div>
  52. <div class="item approvalTime">
  53. <span class="label">反馈时间:</span>
  54. <span class="value">{{ item.createTime }}</span>
  55. </div>
  56. <div class="item rejectCause">
  57. <span class="label">反馈内容:</span>
  58. <span class="value">{{ item.feedbackContent }}</span>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <!-- 识别异常反馈 -->
  65. <van-popup v-model="feedbackShow" round class="feedbackMsgBox" :close-on-click-overlay="false">
  66. <div class="feedbackTitle">SKU图像识别结果异常反馈</div>
  67. <div class="feedbackContent">
  68. <van-field
  69. v-model="feedbackMessage"
  70. rows="2"
  71. autosize
  72. type="textarea"
  73. :formatter="formatter"
  74. placeholder="若识别SKU有遗漏、缺失,请在此反馈,本部会根据实际情况优化模型,谢谢!" />
  75. </div>
  76. <div class="btnBox">
  77. <van-button type="info" plain @click="feedbackShow = false">取消</van-button>
  78. <van-button type="info" @click="feedbackSubmit">提交</van-button>
  79. </div>
  80. </van-popup>
  81. </div>
  82. </template>
  83. <script>
  84. import deleteUploadImg from '@/components/deleteUploadImg';
  85. import { photoSkuImgSummary, photoSkuFeedback } from '@/api/historicalVisit.js';
  86. import { ImagePreview } from 'vant';
  87. export default {
  88. name: 'skuRecognize',
  89. components: { deleteUploadImg },
  90. data() {
  91. return {
  92. visitsId: '',
  93. detail: null,
  94. feedbackShow: false,
  95. feedbackMessage: '', //反馈内容
  96. };
  97. },
  98. activated() {
  99. this.visitsId = this.$route.query.visitId || '';
  100. this.getDetail();
  101. },
  102. methods: {
  103. getDetail() {
  104. this.toastLoading(0, '加载中...', true);
  105. photoSkuImgSummary({ visitsId: this.visitsId })
  106. .then((res) => {
  107. this.toastLoading().clear();
  108. if (res.code == 200) {
  109. this.detail = res.data;
  110. } else {
  111. this.$dialog.alert({
  112. message: res.msg,
  113. });
  114. }
  115. })
  116. .catch((err) => {
  117. this.$dialog.alert({
  118. message: err.msg,
  119. });
  120. });
  121. },
  122. // 提交反馈
  123. feedbackSubmit() {
  124. if (this.feedbackMessage == '') {
  125. this.$toast('请输入反馈意见!');
  126. return;
  127. }
  128. photoSkuFeedback({
  129. photoIdentifyId: this.detail.skuPhotoIdentifyId, //long sku识别信息id
  130. feedbackContent: this.feedbackMessage, //string 内容
  131. }).then((res) => {
  132. this.feedbackShow = false;
  133. this.getDetail();
  134. });
  135. },
  136. previewsImg(index) {
  137. ImagePreview({
  138. images: this.detail.fileUrlList,
  139. startPosition: index,
  140. });
  141. },
  142. formatter(value) {
  143. return value.replace(
  144. /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
  145. ''
  146. );
  147. },
  148. onClickLeft() {
  149. this.$router.go(-1);
  150. },
  151. },
  152. };
  153. </script>
  154. <style lang="scss" scoped>
  155. .skuRecognize {
  156. width: 100%;
  157. height: 100%;
  158. display: flex;
  159. flex-direction: column;
  160. overflow: hidden;
  161. .content {
  162. flex: 1;
  163. overflow-y: auto;
  164. background: #fff;
  165. padding: 10px 15px;
  166. margin-top: 10px;
  167. .title {
  168. font-size: 16px;
  169. padding-bottom: 10px;
  170. }
  171. .tipsTitle {
  172. font-size: 12px;
  173. padding-bottom: 10px;
  174. }
  175. .tableTitle {
  176. padding: 10px 0;
  177. font-size: 16px;
  178. font-weight: bold;
  179. background: #f5f5f5;
  180. }
  181. .skuDeatil {
  182. }
  183. .feedbackHistorical {
  184. .historicalContent {
  185. flex: 1;
  186. overflow-y: auto;
  187. .rejectMsgItem {
  188. margin-bottom: 20px;
  189. border: 1px solid #ccc;
  190. padding: 10px;
  191. .item {
  192. padding: 5px 0;
  193. span {
  194. display: inline-block;
  195. }
  196. }
  197. .label {
  198. width: 80px;
  199. font-size: 14px;
  200. font-weight: 600;
  201. }
  202. .value {
  203. font-size: 14px;
  204. }
  205. }
  206. }
  207. }
  208. .img-box {
  209. width: 100%;
  210. height: 50px;
  211. position: relative;
  212. display: inline-block;
  213. border-radius: 6px;
  214. overflow: hidden;
  215. img {
  216. width: 100%;
  217. height: 100%;
  218. }
  219. }
  220. }
  221. .feedbackMsgBox {
  222. min-height: 30%;
  223. width: 90%;
  224. padding: 10px 20px;
  225. display: flex;
  226. flex-direction: column;
  227. overflow: hidden;
  228. .feedbackTitle {
  229. padding: 10px 0;
  230. text-align: center;
  231. font-size: 16px;
  232. font-weight: 600px;
  233. }
  234. .feedbackContent {
  235. flex: 1;
  236. overflow-y: auto;
  237. }
  238. .btnBox {
  239. height: 44px;
  240. display: flex;
  241. justify-content: space-between;
  242. button {
  243. width: 45%;
  244. }
  245. }
  246. }
  247. }
  248. </style>
  249. <style lang="scss">
  250. .skuDeatil {
  251. .table-headermd {
  252. font-size: 12px;
  253. text-align: center;
  254. position: initial;
  255. width: 98% !important;
  256. margin: 0 auto;
  257. border-right: 0;
  258. border-radius: 10px;
  259. .el-table__cell {
  260. padding: 6px 0 !important;
  261. }
  262. }
  263. .table-headermd th.el-table__cell {
  264. background-color: #1989fa;
  265. color: #fff;
  266. }
  267. }
  268. </style>