historicalDetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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">
  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. <div
  142. style="padding: 10px 16px; font-size: 16px; font-weight: bold"
  143. v-if="managerRemarkContents == null && remarkShow">
  144. 点评
  145. </div>
  146. <div class="comment" v-if="managerRemarkContents == null && remarkShow">
  147. <van-field
  148. v-model="dataform.remarkContent"
  149. rows="4"
  150. autosize
  151. maxlength="800"
  152. show-word-limit
  153. type="textarea"
  154. :formatter="formatter" />
  155. <br />
  156. <br />
  157. <div class="contentborder">
  158. <van-button type="info" size="small" plain class="Btn1" @click="submint"
  159. >提交点评</van-button
  160. >
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </template>
  166. <script>
  167. import deleteUploadImg from '@/components/deleteUploadImg';
  168. import {
  169. getVisitsDetail,
  170. getPhotoTypeList1,
  171. insertVisitRemark,
  172. getListHistoryList,
  173. getCollectionShowHistory,
  174. } from '@/api/index';
  175. export default {
  176. components: { deleteUploadImg },
  177. data() {
  178. return {
  179. userShow: false,
  180. visitsId: '',
  181. imgs: '',
  182. typeList: [],
  183. active: ['1'],
  184. sameDay: false,
  185. ListHistoryTOTLE: '',
  186. managerRemarkContents: null,
  187. managerRemarkContent: '',
  188. CWShow: false,
  189. dataform: {
  190. remarkContent: '',
  191. visitsId: 0,
  192. },
  193. updateTimeShow: false,
  194. insert: true,
  195. remarkShow: false,
  196. ListHistoryList: [],
  197. list: '',
  198. };
  199. },
  200. created() {
  201. this.visitsId = this.$route.query.visitId;
  202. this.dataform.visitsId = this.$route.query.visitId;
  203. this.getVisitsDetailFn();
  204. this.getPhotoTypeList();
  205. },
  206. // watch: {
  207. // $route(to, from) {
  208. // console.log(to.path)
  209. // if (to.path == "/historicalDetails") {
  210. // this.getVisitsDetailFn()
  211. // }
  212. // }
  213. // },
  214. activated() {
  215. this.getVisitsDetailFn();
  216. },
  217. methods: {
  218. getListHistoryList(instanceId) {
  219. var form = { visitsId: this.$route.query.visitId, pageNum: 1, pageSize: 999 };
  220. getListHistoryList(form).then((res) => {
  221. this.ListHistoryList = res.data;
  222. });
  223. },
  224. formatter(value) {
  225. return value.replace(
  226. /[\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,
  227. ''
  228. );
  229. },
  230. editorFn() {
  231. if (this.list.hideStr != '' && this.list.hideStr != null) {
  232. this.$toast(this.list.hideStr);
  233. } else {
  234. localStorage.setItem('ORGName', this.list.deptName);
  235. localStorage.setItem('chainNameR', this.list.storeName);
  236. if (this.list.visitSource == '2') {
  237. this.$router.push({
  238. path: '/abnormalVisit',
  239. query: {
  240. type: 'edit',
  241. storeCode: this.$route.query.storeCode || this.list.storeCode,
  242. rdId: this.$route.query.visitId,
  243. visitId: this.$route.query.visitId,
  244. storeId: this.list.storeId,
  245. visitSource: this.list.visitSource,
  246. visitModel: this.list.visitModel,
  247. marklat: this.list.lat,
  248. marklon: this.list.lon,
  249. },
  250. });
  251. } else {
  252. var LCshow = false;
  253. if (this.$route.query.taskId != null) {
  254. LCshow = true;
  255. } else {
  256. LCshow = false;
  257. }
  258. this.$router.push({
  259. path: '/storeVisitpage',
  260. query: {
  261. type: 'edit',
  262. storeGroupId: this.list.storeGroupId,
  263. storeCode: this.$route.query.storeCode || this.list.storeCode,
  264. storeName: this.list.storeName,
  265. addressLine: this.list.addressLine,
  266. rdId: this.$route.query.visitId,
  267. visitId: this.$route.query.visitId,
  268. storeId: this.list.storeId,
  269. visitSource: this.list.visitSource,
  270. visitModel: this.list.visitModel,
  271. LCshow: LCshow,
  272. instanceId: this.list.instanceId,
  273. taskId: this.$route.query.taskId,
  274. marklat: this.list.lat,
  275. marklon: this.list.lon,
  276. from: 'outPlan',
  277. },
  278. });
  279. }
  280. }
  281. },
  282. submint() {
  283. if (this.dataform.remarkContent.trim() == '') {
  284. this.$toast('请填写点评内容!');
  285. } else {
  286. insertVisitRemark(this.dataform).then((res) => {
  287. if (res.code == 200) {
  288. this.getVisitsDetailFn();
  289. }
  290. });
  291. }
  292. },
  293. getPhotoTypeList() {
  294. getPhotoTypeList1({}).then((res) => {
  295. this.typeList = res.data;
  296. });
  297. },
  298. getVisitsDetailFn() {
  299. getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
  300. if (res.code == 200) {
  301. this.list = res.data;
  302. if (res.data.visitSource != 2) {
  303. this.getListHistoryList(res.data.instanceId);
  304. }
  305. if (res.data.stopTime != res.data.updateTime) {
  306. this.updateTimeShow = true;
  307. } else {
  308. this.updateTimeShow = false;
  309. }
  310. if (localStorage.getItem('userId') == this.$route.query.userId) {
  311. this.userShow = true;
  312. } else {
  313. this.userShow = false;
  314. }
  315. if (this.$route.query.taskId != null) {
  316. this.CWShow = true;
  317. } else {
  318. this.CWShow = false;
  319. }
  320. this.sameDay = res.data.sameDay;
  321. if (localStorage.getItem('userId') == res.data.userId) {
  322. this.remarkShow = false;
  323. } else {
  324. this.remarkShow = true;
  325. }
  326. if (res.data.visitRemarks != null) {
  327. if (res.data.visitRemarks.length > 0) {
  328. this.managerRemarkContents = res.data.visitRemarks;
  329. } else {
  330. this.managerRemarkContents = null;
  331. }
  332. }
  333. if (res.data.visitSource == 2) {
  334. this.imgs = res.data.sysFileInfos;
  335. }
  336. } else {
  337. this.$toast.fail(res.msg);
  338. }
  339. });
  340. },
  341. historiStoreVisit(val, index) {
  342. this.$router.push({
  343. path: '/historiStoreVisit',
  344. query: { visitId: this.visitsId, ids: index, taskType: val.taskType },
  345. });
  346. sessionStorage.setItem('collectionItemList', JSON.stringify(val.collectionItemList));
  347. },
  348. onClickLeft() {
  349. this.$router.go(-1);
  350. },
  351. },
  352. };
  353. </script>
  354. <style lang="scss" scoped>
  355. .container {
  356. padding-bottom: 50px;
  357. }
  358. .container .custom-titles {
  359. white-space: break-spaces;
  360. }
  361. .card {
  362. background: #fff;
  363. padding: 10px 15px;
  364. box-sizing: border-box;
  365. .title {
  366. line-height: 30px;
  367. font-size: 16px;
  368. font-weight: bold;
  369. color: #333;
  370. }
  371. .subtitle {
  372. line-height: 24px;
  373. font-size: 14px;
  374. color: #7b7b7b;
  375. }
  376. .info {
  377. font-size: 16px;
  378. color: #484848;
  379. line-height: 40px;
  380. border-bottom: 1px solid #dedede;
  381. position: relative;
  382. &:last-child {
  383. border-bottom: 0;
  384. }
  385. .arrow {
  386. float: right;
  387. display: inline-block;
  388. height: 20px;
  389. width: 20px;
  390. line-height: 20px;
  391. text-align: center;
  392. border-radius: 50%;
  393. background: #1989fa;
  394. color: #fff;
  395. font-weight: bold;
  396. font-size: 14px;
  397. margin-top: 9px;
  398. }
  399. .arrowdetils1 {
  400. background: #fff;
  401. position: absolute;
  402. top: 50%;
  403. color: #444;
  404. right: 0;
  405. margin-top: -22px;
  406. }
  407. }
  408. }
  409. .TCFXList {
  410. .van-field__control--custom {
  411. flex-direction: column;
  412. align-items: self-start;
  413. .TCFXListTreeSelec {
  414. padding: 3px;
  415. }
  416. }
  417. }
  418. </style>
  419. <style>
  420. .fontWeit .van-cell__title {
  421. font-weight: bold;
  422. font-size: 16px;
  423. }
  424. .fontWeit .van-cell__title p {
  425. margin: 0;
  426. }
  427. .comment .van-field__control {
  428. background-color: #ebf4ff;
  429. border-radius: 6px;
  430. }
  431. .contern .van-cell {
  432. background-color: #ebf4ff;
  433. border-radius: 6px;
  434. overflow: hidden;
  435. }
  436. </style>