historicalDetails.vue 15 KB

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