historicalDetails.vue 19 KB

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