skuRecognize.vue 8.0 KB

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