historicalDetails.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. <template>
  2. <div class="historicalDetails">
  3. <!-- 顶部条-->
  4. <van-nav-bar class="navBar" title="拜访任务" 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. <p
  57. style="padding: 0 10px; font-size: 14px; color: #222; font-weight: bold"
  58. v-if="list.visitSource != 2 && ListHistoryList.length > 0">
  59. 审批历史
  60. </p>
  61. <div
  62. v-for="(item1, index1) in ListHistoryList"
  63. :key="index1"
  64. style="background-color: white; padding-top: 14px">
  65. <p style="padding: 0 16px; font-size: 14px; color: #222; margin: 0">
  66. 流程名称:{{ item1.modelName }}
  67. </p>
  68. <van-steps direction="vertical" :active="item1.processList.length">
  69. <van-step v-for="(item, index) in item1.processList" :key="index">
  70. <h3 style="font-size: 14px">{{ item.activityName }} &nbsp;{{ item.assigneeName }}</h3>
  71. <p>{{ item.comment }}</p>
  72. </van-step>
  73. </van-steps>
  74. <div style="border-bottom: 2px solid #f5f5f5; margin: 0 16px 16px"></div>
  75. </div>
  76. <van-collapse
  77. v-model="active"
  78. class="fontWeit"
  79. v-if="managerRemarkContents != null && managerRemarkContents.length > 0">
  80. <van-collapse-item name="1" title="点评">
  81. <p>
  82. {{ managerRemarkContents[0].deptName }} - {{ managerRemarkContents[0].postName }} -
  83. {{ managerRemarkContents[0].nickName }}的点评
  84. </p>
  85. <p class="contern">
  86. <van-field
  87. v-model="managerRemarkContents[0].remarkContent"
  88. rows="4"
  89. autosize
  90. readonly
  91. type="textarea" />
  92. </p>
  93. <p style="text-align: right">点评时间:{{ managerRemarkContents[0].createTime }}</p>
  94. </van-collapse-item>
  95. </van-collapse>
  96. <template v-if="list.isSku == '是'">
  97. <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">SKU图像识别结果</div>
  98. <div class="card">
  99. <div
  100. class="info"
  101. @click="toSkuRecognize"
  102. style="
  103. display: flex;
  104. align-items: center;
  105. justify-content: space-between;
  106. padding: 3px;
  107. ">
  108. <p
  109. style="flex: 1; margin: 0; line-height: 24px; padding: 10px 0; display: inline-block">
  110. 拍摄的所有产品陈列照识别结果:<span v-if="list.skuTotal" style="color: red"
  111. >{{ list.skuTotal }}个</span
  112. >
  113. </p>
  114. <p class="arrowdetils1">
  115. <van-icon name="arrow" />
  116. </p>
  117. </div>
  118. </div>
  119. </template>
  120. <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">任务</div>
  121. <div class="card" v-if="list.visitSource != 2">
  122. <div
  123. class="info"
  124. style="
  125. font-size: 14px;
  126. display: flex;
  127. align-items: center;
  128. justify-content: space-between;
  129. padding: 3px;
  130. "
  131. v-for="(item, index) in list.sfaTaskList"
  132. :key="index"
  133. @click="historiStoreVisit(item, index)">
  134. <p style="flex: 1; margin: 0">
  135. {{ item.taskName }}
  136. </p>
  137. <div class="taskPhotoConditionPassed" @click.stop>
  138. <el-popover
  139. :popper-class="item.taskPhotoConditionPassed == 1 ? 'zpoverSuccess' : 'zpover'"
  140. placement="bottom"
  141. width="120"
  142. trigger="click"
  143. :content="
  144. item.taskPhotoConditionPassed == 1
  145. ? '陈列奖励案拍照AI识别通过'
  146. : '陈列奖励案拍照AI识别不通过'
  147. ">
  148. <div class="taskPhotoConditionPassed" slot="reference">
  149. <img
  150. v-if="item.taskPhotoConditionPassed == 1"
  151. :src="require('@/assets/taskPhotoSu.png')" />
  152. <img
  153. v-if="item.taskPhotoConditionPassed == 0"
  154. :src="require('@/assets/taskPhotoErr.png')" />
  155. </div>
  156. </el-popover>
  157. </div>
  158. <p class="arrowdetils1">
  159. <van-icon name="arrow" />
  160. </p>
  161. </div>
  162. </div>
  163. <div v-if="list.visitSource == 2" style="background-color: #fff">
  164. <van-cell title="异常事由" :value="selectDictLabel(typeList, list.abnormalReason)" />
  165. <van-cell title="异常信息照" />
  166. <div style="padding: 10px 16px 0">
  167. <delete-upload-img :imgs="imgs"></delete-upload-img>
  168. </div>
  169. <van-cell title="异常信息" :value="list.remark" />
  170. </div>
  171. <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">更多记录</div>
  172. <van-cell-group>
  173. <van-cell v-for="(item1, index1) in list.visitsMore" :key="index1">
  174. <template #title>
  175. <van-row>
  176. <van-col span="6">拜访人:</van-col>
  177. <van-col span="18" class="custom-titles">{{ item1.userName }}</van-col>
  178. </van-row>
  179. </template>
  180. <template #right-icon>
  181. <span>{{ item1.visitTime }}</span>
  182. </template>
  183. </van-cell>
  184. </van-cell-group>
  185. <!-- 业务员拜访记录回显部主管反馈内容 -->
  186. <template v-if="list.sfaPhotoApproveList && list.sfaPhotoApproveList.length">
  187. <div
  188. class="sfaPhotoApproveList"
  189. v-for="(item, index) in list.sfaPhotoApproveList"
  190. :key="item.identifyType">
  191. <!-- 1:店招内容识别,2:门店代码识别,3:调色机识别,4:更换店招 -->
  192. <template v-if="item.identifyType == 1 || item.identifyType == 3">
  193. <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">
  194. {{ filterTitle(item.identifyType) }}
  195. </div>
  196. <template v-if="item.historyFeedback == '0'">
  197. <van-cell-group>
  198. <van-cell> AI识别结果: {{ item.resultCorrect == 1 ? '正确' : '不正确' }} </van-cell>
  199. <van-cell>
  200. 拜访照异常原因及解决方案: {{ item.feedbackError || item.reasonsSolutions }}
  201. </van-cell>
  202. </van-cell-group>
  203. </template>
  204. <template v-if="item.historyFeedback == '1'">
  205. <van-cell-group>
  206. <van-cell v-if="item.identifyType == 1">
  207. 店招异常原因: {{ resultCorrect(item.resultCorrect) }}
  208. </van-cell>
  209. <van-cell> 反馈: {{ item.feedbackError || item.reasonsSolutions }} </van-cell>
  210. </van-cell-group>
  211. </template>
  212. </template>
  213. </div>
  214. </template>
  215. <div
  216. style="padding: 10px 16px; font-size: 16px; font-weight: bold"
  217. v-if="managerRemarkContents == null && remarkShow">
  218. 点评
  219. </div>
  220. <div class="comment" v-if="managerRemarkContents == null && remarkShow">
  221. <van-field
  222. v-model="dataform.remarkContent"
  223. rows="4"
  224. autosize
  225. maxlength="800"
  226. show-word-limit
  227. type="textarea"
  228. :formatter="formatter" />
  229. <br />
  230. <br />
  231. <div class="contentborder">
  232. <van-button type="info" size="small" plain class="Btn1" @click="submint"
  233. >提交点评</van-button
  234. >
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </template>
  240. <script>
  241. import deleteUploadImg from '@/components/deleteUploadImg';
  242. import {
  243. getVisitsDetail,
  244. getPhotoTypeList1,
  245. insertVisitRemark,
  246. getListHistoryList,
  247. getCollectionShowHistory,
  248. } from '@/api/index';
  249. import { getDictOption } from '@/api/index';
  250. export default {
  251. components: { deleteUploadImg },
  252. data() {
  253. return {
  254. userShow: false,
  255. visitsId: '',
  256. imgs: '',
  257. typeList: [],
  258. active: ['1'],
  259. sameDay: false,
  260. ListHistoryTOTLE: '',
  261. managerRemarkContents: null,
  262. managerRemarkContent: '',
  263. CWShow: false,
  264. dataform: {
  265. remarkContent: '',
  266. visitsId: 0,
  267. },
  268. updateTimeShow: false,
  269. insert: true,
  270. remarkShow: false,
  271. ListHistoryList: [],
  272. list: null,
  273. AIResultOption: [],
  274. };
  275. },
  276. // watch: {
  277. // $route(to, from) {
  278. // console.log(to.path)
  279. // if (to.path == "/historicalDetails") {
  280. // this.getVisitsDetailFn()
  281. // }
  282. // }
  283. // },
  284. activated() {
  285. this.list = null;
  286. this.toastLoading(0, '加载中...', true);
  287. this.visitsId = this.$route.query.visitId;
  288. this.dataform.visitsId = this.$route.query.visitId;
  289. this.getVisitsDetailFn();
  290. // 获取店招异常原因字典
  291. getDictOption({}, 'feedback_error_msg').then((res) => {
  292. this.AIResultOption = res.data;
  293. });
  294. this.getPhotoTypeList();
  295. },
  296. methods: {
  297. resultCorrect(resultCorrect) {
  298. let data = this.AIResultOption.find((item) => item.dictValue == resultCorrect);
  299. return data ? data.dictLabel : '';
  300. },
  301. filterTitle(item) {
  302. switch (item) {
  303. case 1:
  304. return '店招识别异常,主管反馈:';
  305. // case '2':
  306. // return '门店代码识别';
  307. case 3:
  308. return '调色机识别异常,主管反馈:';
  309. // case '4':
  310. // return '更换店招';
  311. }
  312. },
  313. getListHistoryList(instanceId) {
  314. var form = { visitsId: this.$route.query.visitId, pageNum: 1, pageSize: 999 };
  315. getListHistoryList(form).then((res) => {
  316. this.ListHistoryList = res.data;
  317. });
  318. },
  319. formatter(value) {
  320. return value.replace(
  321. /[\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,
  322. '',
  323. );
  324. },
  325. editorFn() {
  326. if (this.list.hideStr != '' && this.list.hideStr != null) {
  327. this.$toast(this.list.hideStr);
  328. } else {
  329. localStorage.setItem('ORGName', this.list.deptName);
  330. localStorage.setItem('chainNameR', this.list.storeName);
  331. if (this.list.visitSource == '2') {
  332. this.$router.push({
  333. path: '/abnormalVisit',
  334. query: {
  335. type: 'edit',
  336. storeCode: this.$route.query.storeCode || this.list.storeCode,
  337. rdId: this.$route.query.visitId,
  338. visitId: this.$route.query.visitId,
  339. storeId: this.list.storeId,
  340. visitSource: this.list.visitSource,
  341. visitModel: this.list.visitModel,
  342. marklat: this.list.lat,
  343. marklon: this.list.lon,
  344. },
  345. });
  346. } else {
  347. var LCshow = false;
  348. if (this.$route.query.taskId != null) {
  349. LCshow = true;
  350. } else {
  351. LCshow = false;
  352. }
  353. this.$router.push({
  354. path: '/storeVisitpage',
  355. query: {
  356. type: 'edit',
  357. storeGroupId: this.list.storeGroupId,
  358. storeCode: this.$route.query.storeCode || this.list.storeCode,
  359. storeName: this.list.storeName,
  360. addressLine: this.list.addressLine,
  361. rdId: this.$route.query.visitId,
  362. visitId: this.$route.query.visitId,
  363. storeId: this.list.storeId,
  364. visitSource: this.list.visitSource,
  365. visitModel: this.list.visitModel,
  366. LCshow: LCshow,
  367. instanceId: this.list.instanceId,
  368. taskId: this.$route.query.taskId,
  369. marklat: this.list.lat,
  370. marklon: this.list.lon,
  371. from: 'outPlan',
  372. },
  373. });
  374. }
  375. }
  376. },
  377. submint() {
  378. if (this.dataform.remarkContent.trim() == '') {
  379. this.$toast('请填写点评内容!');
  380. } else {
  381. insertVisitRemark(this.dataform).then((res) => {
  382. if (res.code == 200) {
  383. this.getVisitsDetailFn();
  384. }
  385. });
  386. }
  387. },
  388. getPhotoTypeList() {
  389. getPhotoTypeList1({}).then((res) => {
  390. this.typeList = res.data;
  391. });
  392. },
  393. getVisitsDetailFn() {
  394. getVisitsDetail({ visitsId: this.$route.query.visitId }).then((res) => {
  395. this.toastLoading().clear();
  396. if (res.code == 200) {
  397. this.list = res.data;
  398. if (res.data.visitSource != 2) {
  399. this.getListHistoryList(res.data.instanceId);
  400. }
  401. if (res.data.stopTime != res.data.updateTime) {
  402. this.updateTimeShow = true;
  403. } else {
  404. this.updateTimeShow = false;
  405. }
  406. if (localStorage.getItem('userId') == this.$route.query.userId) {
  407. this.userShow = true;
  408. } else {
  409. this.userShow = false;
  410. }
  411. if (this.$route.query.taskId != null) {
  412. this.CWShow = true;
  413. } else {
  414. this.CWShow = false;
  415. }
  416. this.sameDay = res.data.sameDay;
  417. if (localStorage.getItem('userId') == res.data.userId) {
  418. this.remarkShow = false;
  419. } else {
  420. this.remarkShow = true;
  421. }
  422. if (res.data.visitRemarks != null) {
  423. if (res.data.visitRemarks.length > 0) {
  424. this.managerRemarkContents = res.data.visitRemarks;
  425. } else {
  426. this.managerRemarkContents = null;
  427. }
  428. }
  429. if (res.data.visitSource == 2) {
  430. this.imgs = res.data.sysFileInfos;
  431. }
  432. } else {
  433. this.$toast.fail(res.msg);
  434. }
  435. });
  436. },
  437. historiStoreVisit(val, index) {
  438. this.$router.push({
  439. path: '/historiStoreVisit',
  440. query: { visitId: this.visitsId, ids: index, taskType: val.taskType, taskId: val.taskId },
  441. });
  442. sessionStorage.setItem('collectionItemList', JSON.stringify(val.collectionItemList));
  443. },
  444. toSkuRecognize() {
  445. this.$router.push({
  446. path: '/skuRecognize',
  447. query: { visitId: this.visitsId },
  448. });
  449. },
  450. onClickLeft() {
  451. if (this.$route.query.token) {
  452. this.$router.push({
  453. path: '/historicalVisit',
  454. });
  455. } else {
  456. this.$router.go(-1);
  457. }
  458. },
  459. },
  460. };
  461. </script>
  462. <style lang="scss" scoped>
  463. .historicalDetails {
  464. }
  465. .container {
  466. padding-bottom: 50px;
  467. }
  468. .container .custom-titles {
  469. white-space: break-spaces;
  470. }
  471. .card {
  472. background: #fff;
  473. padding: 10px 15px;
  474. box-sizing: border-box;
  475. .title {
  476. line-height: 30px;
  477. font-size: 16px;
  478. font-weight: bold;
  479. color: #333;
  480. }
  481. .subtitle {
  482. line-height: 24px;
  483. font-size: 14px;
  484. color: #7b7b7b;
  485. }
  486. .info {
  487. font-size: 16px;
  488. color: #484848;
  489. line-height: 40px;
  490. border-bottom: 1px solid #dedede;
  491. position: relative;
  492. &:last-child {
  493. border-bottom: 0;
  494. }
  495. .arrow {
  496. float: right;
  497. display: inline-block;
  498. height: 20px;
  499. width: 20px;
  500. line-height: 20px;
  501. text-align: center;
  502. border-radius: 50%;
  503. background: #1989fa;
  504. color: #fff;
  505. font-weight: bold;
  506. font-size: 14px;
  507. margin-top: 9px;
  508. }
  509. .taskPhotoConditionPassed {
  510. width: 33px;
  511. margin: 0 5px;
  512. display: inline-flex;
  513. img {
  514. width: 33px;
  515. height: 25px;
  516. }
  517. }
  518. .arrowdetils1 {
  519. background: #fff;
  520. color: #444;
  521. margin: 0;
  522. margin-left: 5px;
  523. }
  524. }
  525. }
  526. .TCFXList {
  527. .van-field__control--custom {
  528. flex-direction: column;
  529. align-items: self-start;
  530. .TCFXListTreeSelec {
  531. padding: 3px;
  532. }
  533. }
  534. }
  535. </style>
  536. <style lang="scss">
  537. .fontWeit .van-cell__title {
  538. font-weight: bold;
  539. font-size: 16px;
  540. }
  541. .fontWeit .van-cell__title p {
  542. margin: 0;
  543. }
  544. .comment .van-field__control {
  545. background-color: #ebf4ff;
  546. border-radius: 6px;
  547. }
  548. .contern .van-cell {
  549. background-color: #ebf4ff;
  550. border-radius: 6px;
  551. overflow: hidden;
  552. }
  553. .historicalDetails {
  554. .card {
  555. .el-popover__reference-wrapper {
  556. display: flex;
  557. }
  558. }
  559. }
  560. .zpoverSuccess {
  561. background-color: #28e978 !important;
  562. color: #fff !important;
  563. padding: 8px 10px !important;
  564. z-index: 1 !important;
  565. border-radius: 6px !important;
  566. border: 0 !important;
  567. box-shadow: none !important;
  568. }
  569. </style>