perfectStoreSku.vue 9.3 KB

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