skuRecognize.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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="clickFeedbackShow"
  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" width="50"> </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="70"></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. clickFeedbackShow() {
  149. this.feedbackMessage = '';
  150. this.feedbackShow = true;
  151. },
  152. onClickLeft() {
  153. this.$router.go(-1);
  154. },
  155. },
  156. };
  157. </script>
  158. <style lang="scss" scoped>
  159. .skuRecognize {
  160. width: 100%;
  161. height: 100%;
  162. display: flex;
  163. flex-direction: column;
  164. overflow: hidden;
  165. .content {
  166. flex: 1;
  167. overflow-y: auto;
  168. background: #fff;
  169. padding: 10px 15px;
  170. margin-top: 10px;
  171. .title {
  172. font-size: 16px;
  173. padding-bottom: 10px;
  174. font-weight: bold;
  175. }
  176. .tipsTitle {
  177. font-size: 12px;
  178. padding-bottom: 10px;
  179. }
  180. .tableTitle {
  181. padding: 10px 0;
  182. font-size: 16px;
  183. font-weight: bold;
  184. background: #f5f5f5;
  185. margin: 15px 0;
  186. }
  187. .skuDeatil {
  188. }
  189. .feedbackHistorical {
  190. .historicalContent {
  191. flex: 1;
  192. overflow-y: auto;
  193. .rejectMsgItem {
  194. margin-bottom: 20px;
  195. border: 1px solid #ccc;
  196. padding: 10px;
  197. .item {
  198. padding: 5px 0;
  199. span {
  200. display: inline-block;
  201. }
  202. }
  203. .label {
  204. width: 80px;
  205. font-size: 14px;
  206. font-weight: 600;
  207. }
  208. .value {
  209. font-size: 14px;
  210. }
  211. }
  212. }
  213. }
  214. .img-box {
  215. width: 100%;
  216. height: 50px;
  217. position: relative;
  218. display: inline-block;
  219. border-radius: 6px;
  220. overflow: hidden;
  221. img {
  222. width: 100%;
  223. height: 100%;
  224. }
  225. }
  226. }
  227. .feedbackMsgBox {
  228. min-height: 30%;
  229. width: 90%;
  230. padding: 10px 20px;
  231. display: flex;
  232. flex-direction: column;
  233. overflow: hidden;
  234. .feedbackTitle {
  235. padding: 10px 0;
  236. text-align: center;
  237. font-size: 16px;
  238. font-weight: 600px;
  239. }
  240. .feedbackContent {
  241. flex: 1;
  242. overflow-y: auto;
  243. .van-field__control {
  244. color: #666 !important;
  245. }
  246. }
  247. .btnBox {
  248. margin-bottom: 10px;
  249. height: 44px;
  250. display: flex;
  251. justify-content: space-between;
  252. button {
  253. width: 45%;
  254. border-radius: 10px;
  255. }
  256. }
  257. }
  258. }
  259. </style>
  260. <style lang="scss">
  261. .skuDeatil {
  262. .table-headermd {
  263. font-size: 14px;
  264. text-align: center;
  265. position: initial;
  266. width: 98% !important;
  267. margin: 0 auto;
  268. border-right: 0;
  269. border-radius: 8px;
  270. font-weight: bold;
  271. thead {
  272. color: #000;
  273. }
  274. .el-table__cell {
  275. padding: 6px 0 !important;
  276. }
  277. }
  278. .table-headermd th.el-table__cell {
  279. background-color: #f5f5f5;
  280. }
  281. }
  282. .feedbackMsgBox {
  283. .van-cell {
  284. border: 1px solid #ccc;
  285. }
  286. .van-field__control {
  287. color: #666;
  288. }
  289. }
  290. </style>