visitHistoryDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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.chainName }}(<span style="color: #1989fa">{{ list.chainCode }}</span
  26. >)
  27. </div>
  28. <div class="info">拜访人:{{ list.nickName }}</div>
  29. <div class="info">拜访日期:{{ list.startTime }}~{{ list.stopTime }}</div>
  30. <div class="info">身份类型:{{ list.typeName2 }}</div>
  31. <div class="info">实际经营者:{{ list.customerManager }}</div>
  32. <div class="info">开户日期:{{ formatCompactDate(list.openDate) }}</div>
  33. <div class="info">是否冻结:{{ list.freeze }}</div>
  34. <div class="info">是否关户:{{ list.close }}</div>
  35. </div>
  36. <van-collapse
  37. v-model="active"
  38. class="fontWeit"
  39. v-if="managerRemarkContents && managerRemarkContents.length > 0">
  40. <van-collapse-item name="1" title="点评">
  41. <div class="" v-for="(item, index) in managerRemarkContents" :key="index">
  42. <p>{{ item.deptName }} - {{ item.postName }} - {{ item.nickName }}的点评</p>
  43. <p class="contern">
  44. <van-field v-model="item.remarkContent" rows="4" autosize readonly type="textarea" />
  45. </p>
  46. <p style="text-align: right">点评时间:{{ item.createTime }}</p>
  47. </div>
  48. </van-collapse-item>
  49. </van-collapse>
  50. <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">任务</div>
  51. <div class="card" v-if="list.visitSource != 2">
  52. <div
  53. class="info"
  54. style="line-height: 44px; font-size: 14px"
  55. v-for="(item, index) in list.sfaTaskList"
  56. :key="index"
  57. @click="historiStoreVisit(item, index)">
  58. <div
  59. style="
  60. width: 100%;
  61. margin: 0;
  62. line-height: 24px;
  63. padding: 10px 0;
  64. display: flex;
  65. align-items: center;
  66. justify-content: space-between;
  67. ">
  68. <div
  69. class="taskName"
  70. style="flex: 1; font-weight: bold; color: #4a4a4a; font-size: 16px">
  71. {{ item.taskName }}
  72. </div>
  73. <div class="arrowdetils1">
  74. <van-icon name="arrow" />
  75. </div>
  76. </div>
  77. <div class="infoContent">
  78. <visitedTaskDetailMobile
  79. :taskType="item.taskType"
  80. :visitId="list.id"
  81. :taskId="item.taskId"
  82. :chainId="item.chainsId"
  83. :storeGroupId="list.storeGroupId"
  84. :visitsDetailData="item"
  85. v-if="item.collectionItemList.length" />
  86. <van-empty v-else />
  87. </div>
  88. </div>
  89. </div>
  90. <div v-if="list.visitSource == 2" style="background-color: #fff">
  91. <van-cell title="异常事由" :value="selectDictLabel(typeList, list.abnormalReason)" />
  92. <van-cell title="异常信息照" />
  93. <div style="padding: 10px 16px 0">
  94. <delete-upload-img :imgs="imgs"></delete-upload-img>
  95. </div>
  96. <van-cell title="异常信息" :value="list.remark" />
  97. </div>
  98. <!-- <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">更多记录</div>
  99. <van-cell-group>
  100. <van-cell v-for="(item1, index1) in list.visitsMore" :key="index1">
  101. <template #title>
  102. <van-row>
  103. <van-col span="6">拜访人:</van-col>
  104. <van-col span="18" class="custom-titles">{{ item1.userName }}</van-col>
  105. </van-row>
  106. </template>
  107. <template #right-icon>
  108. <span>{{ item1.visitTime }}</span>
  109. </template>
  110. </van-cell>
  111. </van-cell-group> -->
  112. <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">点评</div>
  113. <div class="comment">
  114. <van-field
  115. v-model="dataform.remarkContent"
  116. rows="4"
  117. autosize
  118. maxlength="800"
  119. show-word-limit
  120. type="textarea"
  121. :formatter="formatter" />
  122. <br />
  123. <br />
  124. <div class="contentborder">
  125. <van-button type="info" size="small" plain class="Btn1" @click="submint"
  126. >提交点评</van-button
  127. >
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </template>
  133. <script>
  134. import deleteUploadImg from '@/components/deleteUploadImg';
  135. import { getPhotoTypeList1, insertVisitRemark, getListHistoryList } from '@/api/index';
  136. import { getVisitsDetail } from '@/api/agentList';
  137. import visitedTaskDetailMobile from './visitedTaskDetailMobile';
  138. export default {
  139. name: 'visitHistoryDetail',
  140. components: { deleteUploadImg, visitedTaskDetailMobile },
  141. data() {
  142. return {
  143. userShow: false,
  144. visitsId: '',
  145. imgs: '',
  146. typeList: [],
  147. active: ['1'],
  148. sameDay: false,
  149. ListHistoryTOTLE: '',
  150. managerRemarkContents: null,
  151. managerRemarkContent: '',
  152. CWShow: false,
  153. dataform: {
  154. remarkContent: '',
  155. },
  156. updateTimeShow: false,
  157. insert: true,
  158. remarkShow: false,
  159. ListHistoryList: [],
  160. list: null,
  161. urlParameter: null,
  162. imgs: '',
  163. };
  164. },
  165. created() {
  166. this.urlParameter = this.$route.query;
  167. this.getVisitsDetailFn();
  168. this.getPhotoTypeList();
  169. },
  170. methods: {
  171. getListHistoryList(instanceId) {
  172. var form = { visitsId: this.$route.query.visitId, pageNum: 1, pageSize: 999 };
  173. getListHistoryList(form).then((res) => {
  174. this.ListHistoryList = res.data;
  175. });
  176. },
  177. formatter(value) {
  178. return value.replace(
  179. /[\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,
  180. ''
  181. );
  182. },
  183. editorFn() {
  184. if (this.list.hideStr != '' && this.list.hideStr != null) {
  185. this.$toast(this.list.hideStr);
  186. } else {
  187. localStorage.setItem('ORGName', this.list.deptName);
  188. localStorage.setItem('chainNameR', this.list.storeName);
  189. if (this.list.visitSource == '2') {
  190. this.$router.push({
  191. path: '/abnormalVisit',
  192. query: {
  193. type: 'edit',
  194. storeCode: this.$route.query.storeCode || this.list.storeCode,
  195. rdId: this.$route.query.visitId,
  196. visitId: this.$route.query.visitId,
  197. storeId: this.list.storeId,
  198. visitSource: this.list.visitSource,
  199. visitModel: this.list.visitModel,
  200. marklat: this.list.lat,
  201. marklon: this.list.lon,
  202. },
  203. });
  204. } else {
  205. var LCshow = false;
  206. if (this.$route.query.taskId != null) {
  207. LCshow = true;
  208. } else {
  209. LCshow = false;
  210. }
  211. this.$router.push({
  212. path: '/storeVisitpage',
  213. query: {
  214. type: 'edit',
  215. storeGroupId: this.list.storeGroupId,
  216. storeCode: this.$route.query.storeCode || this.list.storeCode,
  217. storeName: this.list.storeName,
  218. addressLine: this.list.addressLine,
  219. rdId: this.$route.query.visitId,
  220. visitId: this.$route.query.visitId,
  221. storeId: this.list.storeId,
  222. visitSource: this.list.visitSource,
  223. visitModel: this.list.visitModel,
  224. LCshow: LCshow,
  225. instanceId: this.list.instanceId,
  226. taskId: this.$route.query.taskId,
  227. marklat: this.list.lat,
  228. marklon: this.list.lon,
  229. from: 'outPlan',
  230. },
  231. });
  232. }
  233. }
  234. },
  235. submint() {
  236. if (this.dataform.remarkContent.trim() == '') {
  237. this.$toast('请填写点评内容!');
  238. } else {
  239. insertVisitRemark({
  240. ...this.dataform,
  241. visitsId: this.$route.query.visitId,
  242. remarkType: '1',
  243. }).then((res) => {
  244. if (res.code == 200) {
  245. this.$toast('点评成功!');
  246. this.dataform.remarkContent = '';
  247. this.getVisitsDetailFn();
  248. }
  249. });
  250. }
  251. },
  252. getPhotoTypeList() {
  253. getPhotoTypeList1({}).then((res) => {
  254. this.typeList = res.data;
  255. });
  256. },
  257. getVisitsDetailFn() {
  258. getVisitsDetail({ visitsId: this.urlParameter.visitId }).then((res) => {
  259. if (res.code == 200) {
  260. this.list = res.data;
  261. if (res.data.visitSource != 2) {
  262. // this.getListHistoryList(res.data.instanceId);
  263. }
  264. if (res.data.stopTime != res.data.updateTime) {
  265. this.updateTimeShow = true;
  266. } else {
  267. this.updateTimeShow = false;
  268. }
  269. if (localStorage.getItem('userId') == this.$route.query.userId) {
  270. this.userShow = true;
  271. } else {
  272. this.userShow = false;
  273. }
  274. if (this.$route.query.taskId != null) {
  275. this.CWShow = true;
  276. } else {
  277. this.CWShow = false;
  278. }
  279. this.sameDay = res.data.sameDay;
  280. if (localStorage.getItem('userId') == res.data.userId) {
  281. this.remarkShow = false;
  282. } else {
  283. this.remarkShow = true;
  284. }
  285. if (res.data.visitRemarks != null) {
  286. if (res.data.visitRemarks.length > 0) {
  287. this.managerRemarkContents = res.data.visitRemarks;
  288. } else {
  289. this.managerRemarkContents = null;
  290. }
  291. }
  292. if (res.data.visitSource == 2) {
  293. this.imgs = res.data.sysFileInfos;
  294. }
  295. } else {
  296. this.$toast.fail(res.msg);
  297. }
  298. });
  299. },
  300. historiStoreVisit(val, index) {
  301. return;
  302. this.$router.push({
  303. path: '/visitedTaskDetail',
  304. query: {
  305. taskType: val.taskType,
  306. PhotoType: val.photoType,
  307. visitId: this.list.id,
  308. taskId: val.taskId,
  309. chainId: val.chainsId,
  310. storeGroupId: this.list.storeGroupId,
  311. activatedIndex: index,
  312. },
  313. });
  314. sessionStorage.setItem('collectionItemList', JSON.stringify(val.collectionItemList));
  315. },
  316. onClickLeft() {
  317. // 从代办消息列表来-返回拜访历史列表
  318. if (this.$route.query.loginName) {
  319. console.log(this.$router);
  320. this.$router.push({
  321. path: '/infoHistorVisit',
  322. });
  323. } else {
  324. // 从哪里来回哪里去
  325. this.$router.go(-1);
  326. }
  327. },
  328. },
  329. };
  330. </script>
  331. <style lang="scss" scoped>
  332. .container {
  333. padding-bottom: 50px;
  334. }
  335. .container .custom-titles {
  336. white-space: break-spaces;
  337. }
  338. .card {
  339. background: #fff;
  340. padding: 10px 15px;
  341. box-sizing: border-box;
  342. .title {
  343. line-height: 30px;
  344. font-size: 16px;
  345. font-weight: bold;
  346. color: #333;
  347. }
  348. .subtitle {
  349. line-height: 24px;
  350. font-size: 14px;
  351. color: #7b7b7b;
  352. }
  353. .info {
  354. font-size: 16px;
  355. color: #484848;
  356. line-height: 40px;
  357. border-bottom: 1px solid #dedede;
  358. position: relative;
  359. &:last-child {
  360. border-bottom: 0;
  361. }
  362. .arrow {
  363. float: right;
  364. display: inline-block;
  365. height: 20px;
  366. width: 20px;
  367. line-height: 20px;
  368. text-align: center;
  369. border-radius: 50%;
  370. background: #1989fa;
  371. color: #fff;
  372. font-weight: bold;
  373. font-size: 14px;
  374. margin-top: 9px;
  375. }
  376. .arrowdetils1 {
  377. background: #fff;
  378. // position: absolute;
  379. // top: 50%;
  380. color: #444;
  381. // right: 0;
  382. // margin-top: -22px;
  383. }
  384. }
  385. }
  386. .TCFXList {
  387. .van-field__control--custom {
  388. flex-direction: column;
  389. align-items: self-start;
  390. .TCFXListTreeSelec {
  391. padding: 3px;
  392. }
  393. }
  394. }
  395. </style>
  396. <style>
  397. .fontWeit .van-cell__title {
  398. font-weight: bold;
  399. font-size: 16px;
  400. }
  401. .fontWeit .van-cell__title p {
  402. margin: 0;
  403. }
  404. .comment .van-field__control {
  405. background-color: #ebf4ff;
  406. border-radius: 6px;
  407. }
  408. .contern .van-cell {
  409. background-color: #ebf4ff;
  410. border-radius: 6px;
  411. overflow: hidden;
  412. }
  413. </style>