perfectStore.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. <template>
  2. <div class="perfectStore">
  3. <!-- 顶部条-->
  4. <van-nav-bar class="navBar" title="AI完美门店报告" left-arrow @click-left="onClickLeft">
  5. <template #right>
  6. <span
  7. style="
  8. color: white;
  9. background: #74a4d9;
  10. display: block;
  11. padding: 6px 10px;
  12. border-radius: 6px;
  13. "
  14. @click="editorFn"
  15. v-if="!remarkShow && sameDay"
  16. >编辑</span
  17. >
  18. </template>
  19. </van-nav-bar>
  20. <!-- 主体内容-->
  21. <div class="container" v-if="list">
  22. <div class="lineGrey"></div>
  23. <div class="card mt10">
  24. <div class="title">
  25. {{ list.storeName }}(<span style="color: #1989fa">{{ list.storeCode }}</span
  26. >)
  27. </div>
  28. <div class="subtitle">地址:{{ list.addressLine }}</div>
  29. <div class="subtitle">拜访人:{{ list.nickName }}</div>
  30. <div class="subtitle">拜访日期:{{ list.startTime }}~{{ list.stopTime }}</div>
  31. <div class="subtitle" v-if="list.dwellTime">拜访时长:{{ list.dwellTime }}</div>
  32. <!-- 分销店 -->
  33. <template
  34. v-if="
  35. verifyStoreType(list.storeCategory) && verifyStoreType(list.storeCategory).type == 'fxd'
  36. ">
  37. <div class="subtitle" style="display: flex">
  38. <div class="label" style="width: 75px">经销商:</div>
  39. <div class="valuue TCFXList">
  40. <div
  41. class="sfaStoreChainsContactList"
  42. v-for="(item, index) in list.sfaStoreChainsContactList"
  43. :key="index">
  44. {{ item.categoryDescribe }}
  45. {{ item.chainCode }}
  46. {{ item.chainName }}
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <template v-else>
  52. <div class="subtitle">经销商:{{ list.chainName }}</div>
  53. </template>
  54. <div class="subtitle" v-if="updateTimeShow">更新时间:{{ list.updateTime }}</div>
  55. </div>
  56. <!-- 特殊任务展示 -->
  57. <!-- 店招 -->
  58. <div class="shopSign specialTask" v-if="shopSignDetail && shopSignDetail.qualifiedState">
  59. <div class="specialTaskLeft" @click="openPerfectStoreSign">
  60. <div class="SignText">AI 店招识别</div>
  61. <div class="signContent">
  62. <div class="" style="display: flex">
  63. <van-button round type="primary" v-if="shopSignDetail.qualifiedState == '1'"
  64. >通过</van-button
  65. >
  66. <van-button round type="danger" v-if="shopSignDetail.qualifiedState == '0'"
  67. >不通过</van-button
  68. >
  69. <div class="jiantou">
  70. <van-icon name="arrow" />
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <!-- 调色机 -->
  77. <div class="TSJBox specialTask" v-if="tiaoSJDetail && tiaoSJDetail.qualifiedState">
  78. <div class="specialTaskLeft" @click="openPerfectStoreTSJ">
  79. <div class="SignText">AI 调色机识别</div>
  80. <div class="signContent">
  81. <div class="" style="display: flex">
  82. <van-button round type="primary" v-if="tiaoSJDetail.qualifiedState == '1'"
  83. >通过</van-button
  84. >
  85. <van-button round type="danger" v-if="tiaoSJDetail.qualifiedState == '0'"
  86. >不通过</van-button
  87. >
  88. <div class="jiantou">
  89. <van-icon name="arrow" />
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <!-- 陈列SKU个数: -->
  96. <div class="TSJBox specialTask" v-if="list.isSku == '是'">
  97. <div class="specialTaskLeft">
  98. <div class="SignText">
  99. AI SKU个数识别: <span v-if="list.skuNum">{{ list.skuNum }}个</span>
  100. </div>
  101. <div class="signContent" @click="toSkuRecognize">
  102. <div class="" style="display: flex">
  103. <span style="color: rgb(25, 137, 250)">查看详情</span>
  104. <div class="jiantou">
  105. <van-icon name="arrow" />
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <!-- 目前陈列任务 -->
  112. <div class="TSJBox specialTask" v-if="taskTypeArr && taskTypeArr.length">
  113. <div class="specialTaskLeft">
  114. <div class="SignText">AI 陈列任务识别</div>
  115. </div>
  116. </div>
  117. <div class="SKUBox" v-if="taskTypeArr && taskTypeArr.length">
  118. <div class="SKUList">
  119. <div
  120. class="itemList"
  121. v-for="(value, index) in taskTypeArr"
  122. @click="historiStoreVisit(value)">
  123. <div class="itemTitle">{{ convertToChinese(index + 1) }}、{{ value.taskName }}</div>
  124. <div class="" style="display: flex">
  125. <van-button round type="primary" v-if="value.taskPhotoConditionPassed == 1"
  126. >通过</van-button
  127. >
  128. <van-button round type="danger" v-if="value.taskPhotoConditionPassed == 0"
  129. >不通过</van-button
  130. >
  131. <div class="jiantou">
  132. <van-icon name="arrow" />
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div style="padding: 15px 16px; font-size: 16px; font-weight: bold; background: #f5f5f5">
  139. 其他拜访任务
  140. </div>
  141. <div class="card" v-if="list.visitSource != 2">
  142. <div
  143. class="info"
  144. style="
  145. font-size: 14px;
  146. display: flex;
  147. align-items: center;
  148. justify-content: space-between;
  149. padding: 3px;
  150. "
  151. v-for="(item, index) in list.sfaTaskList"
  152. :key="index"
  153. v-if="
  154. item.photoIdentifyType != '1' && item.photoIdentifyType != '3' && item.taskType != '5'
  155. "
  156. @click="historiStoreVisit(item, index)">
  157. <p style="flex: 1; margin: 0">
  158. {{ item.taskName }}
  159. </p>
  160. <div class="taskPhotoConditionPassed" @click.stop>
  161. <el-popover
  162. :popper-class="item.taskPhotoConditionPassed == 1 ? 'zpoverSuccess' : 'zpover'"
  163. placement="bottom"
  164. width="120"
  165. trigger="click"
  166. :content="
  167. item.taskPhotoConditionPassed == 1
  168. ? '陈列奖励案拍照AI识别通过'
  169. : '陈列奖励案拍照AI识别不通过'
  170. ">
  171. <div class="taskPhotoConditionPassed" slot="reference">
  172. <img
  173. v-if="item.taskPhotoConditionPassed == 1"
  174. :src="require('@/assets/taskPhotoSu.png')" />
  175. <img
  176. v-if="item.taskPhotoConditionPassed == 0"
  177. :src="require('@/assets/taskPhotoErr.png')" />
  178. </div>
  179. </el-popover>
  180. </div>
  181. <p class="arrowdetils1">
  182. <van-icon name="arrow" />
  183. </p>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </template>
  189. <script>
  190. import deleteUploadImg from '@/components/deleteUploadImg';
  191. import {
  192. getVisitsDetailPerfectStore,
  193. getPhotoTypeList1,
  194. insertVisitRemark,
  195. getListHistoryList,
  196. } from '@/api/index';
  197. import { getDictOption } from '@/api/index';
  198. import { ImagePreview } from 'vant';
  199. export default {
  200. components: { deleteUploadImg },
  201. data() {
  202. return {
  203. userShow: false,
  204. visitsId: '',
  205. imgs: '',
  206. typeList: [],
  207. active: ['1'],
  208. sameDay: false,
  209. ListHistoryTOTLE: '',
  210. managerRemarkContents: null,
  211. managerRemarkContent: '',
  212. CWShow: false,
  213. dataform: {
  214. remarkContent: '',
  215. visitsId: 0,
  216. },
  217. updateTimeShow: false,
  218. insert: true,
  219. remarkShow: false,
  220. ListHistoryList: [],
  221. list: null,
  222. AIResultOption: [],
  223. shopSignDetail: null,
  224. tiaoSJDetail: null,
  225. taskTypeArr: null,
  226. };
  227. },
  228. activated() {
  229. this.list = null;
  230. this.toastLoading(0, '加载中...', true);
  231. this.visitsId = this.$route.query.visitId;
  232. this.dataform.visitsId = this.$route.query.visitId;
  233. this.getVisitsDetailFn();
  234. // 获取店招异常原因字典
  235. getDictOption({}, 'feedback_error_msg').then((res) => {
  236. this.AIResultOption = res.data;
  237. });
  238. this.getPhotoTypeList();
  239. },
  240. methods: {
  241. resultCorrect(resultCorrect) {
  242. let data = this.AIResultOption.find((item) => item.dictValue == resultCorrect);
  243. return data ? data.dictLabel : '';
  244. },
  245. filterTitle(item) {
  246. switch (item) {
  247. case 1:
  248. return '店招识别异常,主管反馈:';
  249. // case '2':
  250. // return '门店代码识别';
  251. case 3:
  252. return '调色机识别异常,主管反馈:';
  253. // case '4':
  254. // return '更换店招';
  255. }
  256. },
  257. getListHistoryList(instanceId) {
  258. var form = { visitsId: this.$route.query.visitId, pageNum: 1, pageSize: 999 };
  259. getListHistoryList(form).then((res) => {
  260. this.ListHistoryList = res.data;
  261. });
  262. },
  263. formatter(value) {
  264. return value.replace(
  265. /[\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,
  266. '',
  267. );
  268. },
  269. editorFn() {
  270. if (this.list.hideStr != '' && this.list.hideStr != null) {
  271. this.$toast(this.list.hideStr);
  272. } else {
  273. localStorage.setItem('ORGName', this.list.deptName);
  274. localStorage.setItem('chainNameR', this.list.storeName);
  275. localStorage.setItem('getRequestFlage', 'true');
  276. if (this.list.visitSource == '2') {
  277. this.$router.push({
  278. path: '/abnormalVisit',
  279. query: {
  280. type: 'edit',
  281. storeCode: this.$route.query.storeCode || this.list.storeCode,
  282. rdId: this.$route.query.visitId,
  283. visitId: this.$route.query.visitId,
  284. storeId: this.list.storeId,
  285. visitSource: this.list.visitSource,
  286. visitModel: this.list.visitModel,
  287. marklat: this.list.lat,
  288. marklon: this.list.lon,
  289. },
  290. });
  291. } else {
  292. var LCshow = false;
  293. if (this.$route.query.taskId != null) {
  294. LCshow = true;
  295. } else {
  296. LCshow = false;
  297. }
  298. this.$router.push({
  299. path: '/storeVisitpage',
  300. query: {
  301. type: 'edit',
  302. storeGroupId: this.list.storeGroupId,
  303. storeCode: this.$route.query.storeCode || this.list.storeCode,
  304. storeName: this.list.storeName,
  305. addressLine: this.list.addressLine,
  306. rdId: this.$route.query.visitId,
  307. visitId: this.$route.query.visitId,
  308. storeId: this.list.storeId,
  309. visitSource: this.list.visitSource,
  310. visitModel: this.list.visitModel,
  311. LCshow: LCshow,
  312. instanceId: this.list.instanceId,
  313. taskId: this.$route.query.taskId,
  314. marklat: this.list.lat,
  315. marklon: this.list.lon,
  316. from: 'outPlan',
  317. },
  318. });
  319. }
  320. }
  321. },
  322. submint() {
  323. if (this.dataform.remarkContent.trim() == '') {
  324. this.$toast('请填写点评内容!');
  325. } else {
  326. insertVisitRemark(this.dataform).then((res) => {
  327. if (res.code == 200) {
  328. this.getVisitsDetailFn();
  329. }
  330. });
  331. }
  332. },
  333. getPhotoTypeList() {
  334. getPhotoTypeList1({}).then((res) => {
  335. this.typeList = res.data;
  336. });
  337. },
  338. getVisitsDetailFn() {
  339. this.shopSignDetail = null;
  340. this.tiaoSJDetail = null;
  341. this.taskTypeArr = null;
  342. getVisitsDetailPerfectStore({ visitsId: this.$route.query.visitId }).then((res) => {
  343. this.toastLoading().clear();
  344. if (res.code == 200) {
  345. this.list = res.data;
  346. this.filterSfaTaskList(this.list.sfaTaskList);
  347. let shopSignArr = this.list.sfaTaskList.filter((val) => val.photoIdentifyType == '1');
  348. if (shopSignArr.length) this.shopSignDetail = shopSignArr[0];
  349. let tiaoSJArr = this.list.sfaTaskList.filter((val) => val.photoIdentifyType == '3');
  350. if (tiaoSJArr.length) {
  351. this.tiaoSJDetail = tiaoSJArr[0];
  352. console.log(this.tiaoSJDetail);
  353. }
  354. if (res.data.visitSource != 2) {
  355. this.getListHistoryList(res.data.instanceId);
  356. }
  357. if (res.data.stopTime != res.data.updateTime) {
  358. this.updateTimeShow = true;
  359. } else {
  360. this.updateTimeShow = false;
  361. }
  362. if (localStorage.getItem('userId') == this.$route.query.userId) {
  363. this.userShow = true;
  364. } else {
  365. this.userShow = false;
  366. }
  367. if (this.$route.query.taskId != null) {
  368. this.CWShow = true;
  369. } else {
  370. this.CWShow = false;
  371. }
  372. this.sameDay = res.data.sameDay;
  373. if (localStorage.getItem('userId') == res.data.userId) {
  374. this.remarkShow = false;
  375. } else {
  376. this.remarkShow = true;
  377. }
  378. if (res.data.visitRemarks != null) {
  379. if (res.data.visitRemarks.length > 0) {
  380. this.managerRemarkContents = res.data.visitRemarks;
  381. } else {
  382. this.managerRemarkContents = null;
  383. }
  384. }
  385. if (res.data.visitSource == 2) {
  386. this.imgs = res.data.sysFileInfos;
  387. }
  388. } else {
  389. this.$toast.fail(res.msg);
  390. }
  391. });
  392. },
  393. filterSfaTaskList(list) {
  394. this.taskTypeArr = list.filter((val) => val.taskType == '5');
  395. },
  396. historiStoreVisit(val, index) {
  397. if (val.taskType == '5') {
  398. this.$router.push({
  399. path: '/perfectStoreTask',
  400. query: {
  401. storeCode: this.$route.query.storeCode || this.list.storeCode,
  402. visitsId: this.visitsId,
  403. taskId: val.taskId,
  404. storeGroupId: this.list.storeGroupId,
  405. insert: 0,
  406. source: 'historicalDetails',
  407. },
  408. });
  409. } else {
  410. this.$router.push({
  411. path: '/historiStoreVisit',
  412. query: { visitId: this.visitsId, ids: index, taskType: val.taskType, taskId: val.taskId },
  413. });
  414. }
  415. sessionStorage.setItem('collectionItemList', JSON.stringify(val.collectionItemList));
  416. },
  417. toSkuRecognize() {
  418. this.$router.push({
  419. path: '/perfectStoreSku',
  420. query: { visitId: this.visitsId },
  421. });
  422. },
  423. onClickLeft() {
  424. if (this.$route.query.token) {
  425. this.$router.push({
  426. path: '/historicalVisit',
  427. });
  428. } else {
  429. this.$router.go(-1);
  430. }
  431. },
  432. previewsImg(url) {
  433. ImagePreview([url]);
  434. },
  435. openPerfectStoreSign() {
  436. this.$router.push({
  437. path: '/perfectStoreSign',
  438. query: { visitId: this.visitsId },
  439. });
  440. },
  441. openPerfectStoreTSJ() {
  442. this.$router.push({
  443. path: '/perfectStoreTSJ',
  444. query: { visitId: this.visitsId },
  445. });
  446. },
  447. },
  448. };
  449. </script>
  450. <style lang="scss" scoped>
  451. .perfectStore {
  452. background: #fff;
  453. .specialTask {
  454. display: flex;
  455. flex-direction: row;
  456. margin: 10px;
  457. border-radius: 10px;
  458. // min-height: 90px;
  459. padding: 10px 0px 10px 10px;
  460. font-size: 16px;
  461. justify-content: space-between;
  462. background: #e5faff;
  463. .specialTaskLeft {
  464. display: flex;
  465. flex-direction: row;
  466. justify-content: space-between;
  467. width: 100%;
  468. }
  469. .SignText {
  470. font-weight: 600;
  471. }
  472. .signContent {
  473. display: flex;
  474. flex-direction: row;
  475. margin: 0 8px;
  476. .icon {
  477. padding-top: 2px;
  478. margin-right: 5px;
  479. }
  480. }
  481. }
  482. // .shopSign {
  483. // background: #e5faff;
  484. // }
  485. // .TSJBox {
  486. // background: #fff4e4;
  487. // margin-top: 20px;
  488. // }
  489. .SKUBox {
  490. margin: 0px 10px 10px 10px;
  491. border-radius: 10px;
  492. // min-height: 90px;
  493. padding: 5px 10px;
  494. font-size: 16px;
  495. // background: #ffecf4;
  496. .SKUTotal {
  497. display: flex;
  498. justify-content: space-between;
  499. width: 100%;
  500. color: rgb(25, 137, 250);
  501. }
  502. .SKUList {
  503. .itemList {
  504. display: flex;
  505. flex-direction: row;
  506. justify-content: space-between;
  507. align-items: center;
  508. padding: 3px 0;
  509. margin: 10px 0;
  510. }
  511. }
  512. }
  513. .itemList,
  514. .signContent {
  515. .itemTitle {
  516. flex: 1;
  517. // text-decoration: underline;
  518. // color: rgb(25, 137, 250);
  519. }
  520. .jiantou {
  521. margin-left: 5px;
  522. color: rgb(25, 137, 250);
  523. display: flex;
  524. align-items: center;
  525. }
  526. button {
  527. width: 55px;
  528. height: 25px;
  529. padding: 0;
  530. font-size: 12px;
  531. }
  532. }
  533. }
  534. .container {
  535. padding-bottom: 50px;
  536. }
  537. .container .custom-titles {
  538. white-space: break-spaces;
  539. }
  540. .card {
  541. background: #fff;
  542. padding: 10px 15px;
  543. box-sizing: border-box;
  544. .title {
  545. line-height: 30px;
  546. font-size: 16px;
  547. font-weight: bold;
  548. color: #333;
  549. }
  550. .subtitle {
  551. line-height: 24px;
  552. font-size: 14px;
  553. color: #7b7b7b;
  554. }
  555. .info {
  556. font-size: 16px;
  557. color: #484848;
  558. line-height: 40px;
  559. border-bottom: 1px solid #dedede;
  560. position: relative;
  561. &:last-child {
  562. border-bottom: 0;
  563. }
  564. .arrow {
  565. float: right;
  566. display: inline-block;
  567. height: 20px;
  568. width: 20px;
  569. line-height: 20px;
  570. text-align: center;
  571. border-radius: 50%;
  572. background: #1989fa;
  573. color: #fff;
  574. font-weight: bold;
  575. font-size: 14px;
  576. margin-top: 9px;
  577. }
  578. .taskPhotoConditionPassed {
  579. width: 33px;
  580. margin: 0 5px;
  581. display: inline-flex;
  582. img {
  583. width: 33px;
  584. height: 25px;
  585. }
  586. }
  587. .arrowdetils1 {
  588. background: #fff;
  589. color: #444;
  590. margin: 0;
  591. margin-left: 5px;
  592. }
  593. }
  594. }
  595. .TCFXList {
  596. .van-field__control--custom {
  597. flex-direction: column;
  598. align-items: self-start;
  599. .TCFXListTreeSelec {
  600. padding: 3px;
  601. }
  602. }
  603. }
  604. </style>
  605. <style lang="scss">
  606. .fontWeit .van-cell__title {
  607. font-weight: bold;
  608. font-size: 16px;
  609. }
  610. .fontWeit .van-cell__title p {
  611. margin: 0;
  612. }
  613. .comment .van-field__control {
  614. background-color: #ebf4ff;
  615. border-radius: 6px;
  616. }
  617. .contern .van-cell {
  618. background-color: #ebf4ff;
  619. border-radius: 6px;
  620. overflow: hidden;
  621. }
  622. .perfectStore {
  623. .card {
  624. .el-popover__reference-wrapper {
  625. display: flex;
  626. }
  627. }
  628. .van-button--danger {
  629. background-color: #ee0a24 !important;
  630. border: 1px solid #ee0a24 !important;
  631. }
  632. }
  633. .zpoverSuccess {
  634. background-color: #28e978 !important;
  635. color: #fff !important;
  636. padding: 8px 10px !important;
  637. z-index: 1 !important;
  638. border-radius: 6px !important;
  639. border: 0 !important;
  640. box-shadow: none !important;
  641. }
  642. </style>