visitHistoryDetail.vue 11 KB

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