historicalDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  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. if (this.list.visitSource == '2') {
  319. this.$router.push({
  320. path: '/abnormalVisit',
  321. query: {
  322. type: 'edit',
  323. storeCode: this.$route.query.storeCode || this.list.storeCode,
  324. rdId: this.$route.query.visitId,
  325. visitId: this.$route.query.visitId,
  326. storeId: this.list.storeId,
  327. visitSource: this.list.visitSource,
  328. visitModel: this.list.visitModel,
  329. marklat: this.list.lat,
  330. marklon: this.list.lon,
  331. },
  332. });
  333. } else {
  334. var LCshow = false;
  335. if (this.$route.query.taskId != null) {
  336. LCshow = true;
  337. } else {
  338. LCshow = false;
  339. }
  340. this.$router.push({
  341. path: '/storeVisitpage',
  342. query: {
  343. type: 'edit',
  344. storeGroupId: this.list.storeGroupId,
  345. storeCode: this.$route.query.storeCode || this.list.storeCode,
  346. storeName: this.list.storeName,
  347. addressLine: this.list.addressLine,
  348. rdId: this.$route.query.visitId,
  349. visitId: this.$route.query.visitId,
  350. storeId: this.list.storeId,
  351. visitSource: this.list.visitSource,
  352. visitModel: this.list.visitModel,
  353. LCshow: LCshow,
  354. instanceId: this.list.instanceId,
  355. taskId: this.$route.query.taskId,
  356. marklat: this.list.lat,
  357. marklon: this.list.lon,
  358. from: 'outPlan',
  359. },
  360. });
  361. }
  362. }
  363. },
  364. submint() {
  365. if (this.dataform.remarkContent.trim() == '') {
  366. this.$toast('请填写点评内容!');
  367. } else {
  368. insertVisitRemark(this.dataform).then((res) => {
  369. if (res.code == 200) {
  370. this.getVisitsDetailFn();
  371. }
  372. });
  373. }
  374. },
  375. getPhotoTypeList() {
  376. getPhotoTypeList1({}).then((res) => {
  377. this.typeList = res.data;
  378. });
  379. },
  380. getVisitsDetailFn() {
  381. getVisitsDetail({ visitsId: this.$route.query.visitId }).then((res) => {
  382. this.toastLoading().clear();
  383. if (res.code == 200) {
  384. this.list = res.data;
  385. if (res.data.visitSource != 2) {
  386. this.getListHistoryList(res.data.instanceId);
  387. }
  388. if (res.data.stopTime != res.data.updateTime) {
  389. this.updateTimeShow = true;
  390. } else {
  391. this.updateTimeShow = false;
  392. }
  393. if (localStorage.getItem('userId') == this.$route.query.userId) {
  394. this.userShow = true;
  395. } else {
  396. this.userShow = false;
  397. }
  398. if (this.$route.query.taskId != null) {
  399. this.CWShow = true;
  400. } else {
  401. this.CWShow = false;
  402. }
  403. this.sameDay = res.data.sameDay;
  404. if (localStorage.getItem('userId') == res.data.userId) {
  405. this.remarkShow = false;
  406. } else {
  407. this.remarkShow = true;
  408. }
  409. if (res.data.visitRemarks != null) {
  410. if (res.data.visitRemarks.length > 0) {
  411. this.managerRemarkContents = res.data.visitRemarks;
  412. } else {
  413. this.managerRemarkContents = null;
  414. }
  415. }
  416. if (res.data.visitSource == 2) {
  417. this.imgs = res.data.sysFileInfos;
  418. }
  419. } else {
  420. this.$toast.fail(res.msg);
  421. }
  422. });
  423. },
  424. historiStoreVisit(val, index) {
  425. this.$router.push({
  426. path: '/historiStoreVisit',
  427. query: { visitId: this.visitsId, ids: index, taskType: val.taskType },
  428. });
  429. sessionStorage.setItem('collectionItemList', JSON.stringify(val.collectionItemList));
  430. },
  431. toSkuRecognize() {
  432. this.$router.push({
  433. path: '/skuRecognize',
  434. query: { visitId: this.visitsId },
  435. });
  436. },
  437. onClickLeft() {
  438. if (this.$route.query.token) {
  439. this.$router.push({
  440. path: '/historicalVisit',
  441. });
  442. } else {
  443. this.$router.go(-1);
  444. }
  445. },
  446. },
  447. };
  448. </script>
  449. <style lang="scss" scoped>
  450. .historicalDetails {
  451. }
  452. .container {
  453. padding-bottom: 50px;
  454. }
  455. .container .custom-titles {
  456. white-space: break-spaces;
  457. }
  458. .card {
  459. background: #fff;
  460. padding: 10px 15px;
  461. box-sizing: border-box;
  462. .title {
  463. line-height: 30px;
  464. font-size: 16px;
  465. font-weight: bold;
  466. color: #333;
  467. }
  468. .subtitle {
  469. line-height: 24px;
  470. font-size: 14px;
  471. color: #7b7b7b;
  472. }
  473. .info {
  474. font-size: 16px;
  475. color: #484848;
  476. line-height: 40px;
  477. border-bottom: 1px solid #dedede;
  478. position: relative;
  479. &:last-child {
  480. border-bottom: 0;
  481. }
  482. .arrow {
  483. float: right;
  484. display: inline-block;
  485. height: 20px;
  486. width: 20px;
  487. line-height: 20px;
  488. text-align: center;
  489. border-radius: 50%;
  490. background: #1989fa;
  491. color: #fff;
  492. font-weight: bold;
  493. font-size: 14px;
  494. margin-top: 9px;
  495. }
  496. .taskPhotoConditionPassed {
  497. img {
  498. width: 40px;
  499. height: 30px;
  500. }
  501. }
  502. .arrowdetils1 {
  503. background: #fff;
  504. color: #444;
  505. margin: 0;
  506. margin-left: 5px;
  507. }
  508. }
  509. }
  510. .TCFXList {
  511. .van-field__control--custom {
  512. flex-direction: column;
  513. align-items: self-start;
  514. .TCFXListTreeSelec {
  515. padding: 3px;
  516. }
  517. }
  518. }
  519. </style>
  520. <style>
  521. .fontWeit .van-cell__title {
  522. font-weight: bold;
  523. font-size: 16px;
  524. }
  525. .fontWeit .van-cell__title p {
  526. margin: 0;
  527. }
  528. .comment .van-field__control {
  529. background-color: #ebf4ff;
  530. border-radius: 6px;
  531. }
  532. .contern .van-cell {
  533. background-color: #ebf4ff;
  534. border-radius: 6px;
  535. overflow: hidden;
  536. }
  537. </style>