historicalDetails.vue 16 KB

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