suishenbangOutstoreVisit.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952
  1. <template>
  2. <div>
  3. <!-- 顶部条-->
  4. <div class="navBarTOP">
  5. <van-nav-bar class="navBar" title="拜访" left-arrow @click-left="onClickLeft" />
  6. </div>
  7. <!-- 主体内容-->
  8. <div class="container">
  9. <div class="lineGrey"></div>
  10. <div class="lineGrey"></div>
  11. <div class="lineGrey"></div>
  12. <div class="lineGrey"></div>
  13. <div class="lineGrey"></div>
  14. <div class="card mt10">
  15. <div class="title f-blue">
  16. {{ storeName }}(<span style="color: #0057ba">{{ urlParameter.storeCode }}</span
  17. >)
  18. </div>
  19. <div class="info1" v-if="addressLine != null">类型:{{ storeCategory }}</div>
  20. <div class="info1" v-if="addressLine != 'null'">地址:{{ addressLine }}</div>
  21. <div class="info1" v-if="notes != null">上次拜访备注:{{ notes }}</div>
  22. <div class="info1">拜访时长:{{ showTime }}</div>
  23. <div class="info1">
  24. <span v-if="urlParameter.hisTime"
  25. >上次拜访时间:{{ parseTime(urlParameter.hisTime) }}</span
  26. ><span @click="shows = true" class="f-blue" v-if="visitsRemarks" style="font-weight: bold"
  27. ><van-icon name="browsing-history-o" />查看最近三次</span
  28. >
  29. </div>
  30. <van-button
  31. type="info"
  32. style="background: rgb(0, 87, 186); color: #fff; margin: 10px 0; border-radius: 5px"
  33. size="small"
  34. plain
  35. class="centerBtn"
  36. @click="visitFn(urlParameter.storeCode)"
  37. >经营情况</van-button
  38. >
  39. <van-button
  40. type="info"
  41. style="background: rgb(0, 87, 186); color: #fff; margin: 10px; border-radius: 5px"
  42. size="small"
  43. plain
  44. v-if="showOrderButton"
  45. class="centerBtn"
  46. @click="overbookingFn(urlParameter)"
  47. >去下单</van-button
  48. >
  49. <van-button
  50. type="info"
  51. style="background: rgb(0, 87, 186); color: #fff; margin: 10px; border-radius: 5px"
  52. size="small"
  53. plain
  54. class="centerBtn"
  55. @click="wuliaoLog(urlParameter)"
  56. >物料历史</van-button
  57. >
  58. <van-button
  59. type="info"
  60. style="
  61. float: right;
  62. background: #ed5565;
  63. border-color: #ed5565;
  64. color: #fff;
  65. margin: 10px 0;
  66. border-radius: 5px;
  67. "
  68. size="small"
  69. plain
  70. class="centerBtn"
  71. @click="onstopVisit"
  72. >取消拜访</van-button
  73. >
  74. </div>
  75. <div
  76. v-if="addShow1"
  77. style="color: #999; font-size: 12px; padding: 10px; background-color: #f5f5f5">
  78. <van-icon
  79. name="info-o" />&nbsp;可控店及金牌店的店招任务中,若拍摄两次仍不通过,允许提交,不影响正常拜访。
  80. </div>
  81. <div class="card">
  82. <div
  83. class="info"
  84. v-for="(item, index) in list"
  85. :key="index"
  86. @click="addStoreVisit(item, index)">
  87. <span class="must" v-show="item.isMust == '0' || item.isMust == '2'">*</span>
  88. <span class="must" v-show="item.isMust != '0' && item.isMust != '2'">&nbsp;</span>
  89. <p style="width: 74%; margin: 0; line-height: 24px; display: inline-block">
  90. {{ item.taskName }}
  91. </p>
  92. <span v-show="item.processKey != null" class="processIco">
  93. <van-icon :name="sp" size="16" />
  94. </span>
  95. <span v-show="!item.success" class="arrow" style="background-color: #fff; color: #444"
  96. ><van-icon name="arrow"
  97. /></span>
  98. <span v-show="item.success" class="arrow" tyle="background-color: #0057ba"
  99. ><van-icon name="success"
  100. /></span>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="tc" style="padding: 0 16px">
  105. <van-button class="submitBtn" block type="info" color="#0057ba" @click="endVisitsFn"
  106. >提交拜访</van-button
  107. >
  108. </div>
  109. <br />
  110. <van-dialog v-model="shows">
  111. <div class="tipTitleBox" style="padding: 10px">
  112. <p class="p">近三次拜访备注</p>
  113. <div
  114. v-for="item in visitsRemarks"
  115. style="border-bottom: 1px solid #e8e8e8; font-size: 14px; padding: 10px 0">
  116. <p>拜访时间:{{ item.stopTime }}</p>
  117. <p>备注:{{ item.visitRemark }}</p>
  118. </div>
  119. </div>
  120. </van-dialog>
  121. <div id="allmap"></div>
  122. <!-- 物料历史列表 -->
  123. <el-dialog
  124. :visible.sync="wuliaoTable"
  125. width="90%"
  126. :append-to-body="true"
  127. :close-on-click-modal="false"
  128. @close="wuliaoTableClose"
  129. custom-class="wuliaoTable">
  130. <el-table :data="wuliaoList" border style="width: 100%">
  131. <el-table-column label="物料名称" prop="materialDataName" align="center" />
  132. <el-table-column label="发放时间" prop="issuerTime" align="center" />
  133. <el-table-column label="数量" prop="inventoryNum" width="60" align="center" />
  134. <el-table-column label="签收状态" prop="receiptState" width="60" align="center" />
  135. </el-table>
  136. </el-dialog>
  137. </div>
  138. </template>
  139. <script>
  140. import sp from './../../assets/sp.png';
  141. import {
  142. getStoreGroupTask,
  143. endVisits,
  144. editDwellTime,
  145. suishenbangStoreSale,
  146. stopVisit,
  147. buryingPoint,
  148. getMaterialHistory,
  149. } from '@/api/index';
  150. import axios from 'axios';
  151. import { saveVisitsParams, getOrderUrlByStoreId } from '@/api/inventory';
  152. export default {
  153. name: 'suishenbangOutstoreVisit',
  154. data() {
  155. return {
  156. notes: '',
  157. visitModel: '1',
  158. sp: sp,
  159. shows: false,
  160. flag: true,
  161. questionsshow: false,
  162. uploadImgshow: false,
  163. imgs: [],
  164. uploadImages: [],
  165. uploadid1: 'uploadid1',
  166. uploadid2: 'uploadid2',
  167. iscuxiao: false,
  168. text: '',
  169. radio: '',
  170. uploadImgEditText: '编辑',
  171. isEdit: false,
  172. storeId: '',
  173. rdId: '',
  174. lat: '',
  175. lon: '',
  176. list: [],
  177. storeGroupId: '',
  178. addShow1: false,
  179. visitId: '',
  180. addressLine: '',
  181. storeCategory: '',
  182. storeName: '',
  183. contactName: '',
  184. urlParameter: '',
  185. uType: '-1',
  186. showOrderButton: null,
  187. visitsRemarks: [],
  188. location: {
  189. lat: '34.6174',
  190. lon: '112.44039',
  191. },
  192. address: '',
  193. showTime: '00:00:00',
  194. city: '',
  195. locationAccuracy: '',
  196. id: '89',
  197. startTime: null,
  198. timeN: null,
  199. wuliaoTable: false,
  200. wuliaoList: [],
  201. };
  202. },
  203. created() {
  204. this.urlParameter = this.$route.query;
  205. this.storeId = this.$route.query.storeId + '';
  206. this.visitId = this.$route.query.visitId;
  207. this.storeCode = this.$route.query.storeCode;
  208. this.rdId = this.$route.query.rdId + '';
  209. this.addressLine = this.$route.query.addressLine;
  210. this.storeCategory = this.$route.query.storeCategory;
  211. this.storeName = this.$route.query.storeName;
  212. this.contactName = this.$route.query.contactName;
  213. this.lat = this.$route.query.lat + '';
  214. this.lon = this.$route.query.lon + '';
  215. this.visitModel = this.$route.query.visitModel + '';
  216. this.uType = localStorage.getItem('uType');
  217. },
  218. beforeRouteLeave(to, from, next) {
  219. if (
  220. (to.path == '/outsidelist/index' && from.path == '/suishenbangOutstoreVisit') ||
  221. (to.path == '/storeAdd' && from.path == '/suishenbangOutstoreVisit')
  222. ) {
  223. if (this.visitId != null && this.visitId != '') {
  224. this.editDwellTimes();
  225. }
  226. }
  227. next();
  228. },
  229. activated() {
  230. this.urlParameter = this.$route.query;
  231. this.storeId = this.$route.query.storeId + '';
  232. this.visitId = this.$route.query.visitId;
  233. this.storeCode = this.$route.query.storeCode;
  234. this.rdId = this.$route.query.rdId + '';
  235. this.addressLine = this.$route.query.addressLine + '';
  236. this.storeCategory = this.$route.query.storeCategory + '';
  237. this.storeName = this.$route.query.storeName + '';
  238. this.contactName = this.$route.query.contactName + '';
  239. this.lat = this.$route.query.lat + '';
  240. this.lon = this.$route.query.lon + '';
  241. this.list = [];
  242. this.visitModel = this.$route.query.visitModel + '';
  243. this.uType = localStorage.getItem('uType');
  244. if (localStorage.getItem('visitId') != null) {
  245. this.visitId = localStorage.getItem('visitId');
  246. setTimeout(() => {
  247. this.addVisits();
  248. });
  249. } else {
  250. setTimeout(() => {
  251. this.addVisits();
  252. });
  253. }
  254. },
  255. methods: {
  256. animation() {
  257. //前时间减去上次开启时间减去暂停累计时间
  258. var times = new Date().getTime() - new Date(this.startTime).getTime();
  259. var house = Math.floor(times / 3600000); //毫秒转化为分钟
  260. var minutes = Math.floor(times / 60000 - house * 60); //毫秒转化为分钟
  261. var minutes1 = Math.floor(times / 60000); //毫秒转化为分钟
  262. var seconds = Math.floor((times - minutes1 * 60000) / 1000); //已知分钟将time减去分钟 除去1000得出 秒
  263. var ms = Math.floor((times - minutes1 * 60000 - seconds * 1000) / 10); //
  264. this.showTime =
  265. (house < 10 ? '0' + house : house) +
  266. ':' +
  267. (minutes < 10 ? '0' + minutes : minutes) +
  268. ':' +
  269. (seconds < 10 ? '0' + seconds : seconds);
  270. // +":"
  271. // +(ms<10 ? "0"+ms : ms);
  272. },
  273. // 结束拜访
  274. onstopVisit() {
  275. this.$dialog
  276. .confirm({
  277. confirmButtonText: '确定',
  278. cancelButtonText: '取消',
  279. title: '系统提示',
  280. message: '取消拜访会清空填写的拜访内容和照片,是否确认?',
  281. })
  282. .then(() => {
  283. stopVisit({ visitsId: this.visitId }).then((res) => {
  284. if (res.code == 200) {
  285. this.$dialog
  286. .alert({
  287. title: '系统提示',
  288. message: '拜访中任务结束成功!',
  289. })
  290. .then(() => {
  291. // this.$router.replace({});
  292. this.onClickLeft();
  293. // window.location.replace(window.location.origin + '/mobile/outsidelist/index');
  294. });
  295. } else {
  296. this.$dialog.alert({
  297. title: '系统提示',
  298. message: res.msg,
  299. });
  300. }
  301. });
  302. });
  303. },
  304. overbookingFn(val) {
  305. buryingPoint({
  306. systemModel: '拜访页',
  307. buryingPointType: 1,
  308. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  309. buryingPointName: '去下单',
  310. buryingPointPosition: '拜访页',
  311. });
  312. this.toastLoading(0, '加载中...', true);
  313. getOrderUrlByStoreId({
  314. storeId: this.$route.query.storeId,
  315. from: this.$route.query.from,
  316. }).then((res) => {
  317. this.toastLoading().clear();
  318. if (res.code == 200 && res.data) {
  319. window.location.href = res.data;
  320. } else {
  321. this.Toast({
  322. message: res.msg,
  323. duration: 5000,
  324. });
  325. }
  326. });
  327. },
  328. visitFn(val) {
  329. var that = this;
  330. suishenbangStoreSale({ storeCode: val }).then((res) => {
  331. if (res.code == 200) {
  332. if (res.data.num != '0') {
  333. window.location.href =
  334. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + val;
  335. } else {
  336. that.$toast(res.data.msg);
  337. }
  338. } else {
  339. that.$toast(res.msg);
  340. }
  341. });
  342. },
  343. getLocation() {
  344. let loading1 = this.$toast.loading({
  345. duration: 0,
  346. message: '加载中...',
  347. forbidClick: true,
  348. });
  349. this.list = [];
  350. let url = window.location.href;
  351. let that = this;
  352. let wx = this.wx;
  353. let qiyeData;
  354. const instance = axios.create();
  355. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  356. instance
  357. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  358. params: {
  359. url: url,
  360. },
  361. })
  362. .then((response) => {
  363. if (response.status == 200) {
  364. loading1.clear();
  365. qiyeData = response.data.data;
  366. wx.config({
  367. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  368. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  369. appId: qiyeData.appId, // 必填,企业微信的corpID
  370. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  371. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  372. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  373. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  374. });
  375. wx.ready(function () {
  376. wx.getLocation({
  377. type: 'gcj02',
  378. success: function (res) {
  379. var location = that.CJ02BD(res.latitude, res.longitude);
  380. that.location = location;
  381. if (that.urlParameter.lat == '' || that.urlParameter.lat == null) {
  382. that.lat = that.location.lat;
  383. that.lon = that.location.lon;
  384. }
  385. let PointSum = that
  386. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  387. .toFixed(2);
  388. if (PointSum > 500) {
  389. that.visitModel = '5';
  390. localStorage.setItem('visitModel', '5');
  391. that.$dialog
  392. .confirm({
  393. confirmButtonText: '确定',
  394. cancelButtonText: '重新定位',
  395. title: '系统提示',
  396. message: '距离本店距离差距太大',
  397. })
  398. .then(() => {
  399. that.addVisits();
  400. })
  401. .catch(() => {
  402. that.getLocation();
  403. });
  404. } else {
  405. that.addVisits();
  406. }
  407. },
  408. fail: function () {
  409. that.$dialog
  410. .alert({
  411. message: 'GPS未开启',
  412. })
  413. .then(() => {
  414. that.getLocation();
  415. });
  416. },
  417. });
  418. });
  419. }
  420. });
  421. },
  422. editDwellTimes() {
  423. let dwellTime = this.weekend(localStorage.getItem('startTime'), new Date()) + '';
  424. editDwellTime({ dwellTime: dwellTime, visitsId: this.visitId }).then((res) => {
  425. if (res.code == 200) {
  426. localStorage.removeItem('visitId');
  427. }
  428. });
  429. },
  430. weekend(time1) {
  431. var arrtime1 = new Date(time1).getTime();
  432. var arrtime2 = new Date().getTime();
  433. return Math.round((arrtime2 - arrtime1) / 1000);
  434. },
  435. addVisits() {
  436. var postType = localStorage.getItem('postType');
  437. if (postType == 'GZ') {
  438. this.addShow1 = false;
  439. } else {
  440. this.addShow1 = true;
  441. }
  442. var visitEntry = '';
  443. if (this.urlParameter.tabVal == '0') {
  444. visitEntry = '2';
  445. } else {
  446. visitEntry = '1';
  447. }
  448. if (this.$route.query.shopCode != undefined) {
  449. this.storeCode = this.$route.query.shopCode;
  450. }
  451. var that = this;
  452. var map = new TMap.Map('allmap', {
  453. zoom: 14,
  454. center: new TMap.LatLng(39.986785, 116.301012),
  455. });
  456. var geocoder = new TMap.service.Geocoder();
  457. var markers = new TMap.MultiMarker({
  458. map: map,
  459. geometries: [],
  460. });
  461. markers.setGeometries([]);
  462. var input = [that.urlParameter.marklat, that.urlParameter.marklon];
  463. var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
  464. geocoder.getAddress({ location: location }).then(
  465. function (result) {
  466. var addresses = result.result.formatted_addresses;
  467. let address_component = result.result.address_component;
  468. let province = address_component.province;
  469. let city = address_component.city;
  470. let district = address_component.district;
  471. console.log('province=' + province);
  472. console.log('city=' + city);
  473. console.log('district=' + district);
  474. let recommend = '';
  475. if (addresses) {
  476. recommend = addresses.recommend;
  477. }
  478. var params = {
  479. storeId: that.storeId,
  480. storeCode: that.storeCode,
  481. visitEntry: visitEntry,
  482. lat: that.urlParameter.latNew,
  483. lon: that.urlParameter.lonNew,
  484. visitModel: that.visitModel,
  485. routeDetailsId: that.rdId,
  486. visitSource: '1',
  487. locationCity: '',
  488. locationRemark: recommend,
  489. locationAccuracy: that.urlParameter.PointSum,
  490. province: address_component.province,
  491. city: address_component.city,
  492. district: address_component.district,
  493. };
  494. that.locationAccuracy = that.urlParameter.PointSum;
  495. that.city = '';
  496. that.address = recommend;
  497. localStorage.setItem('address', '');
  498. if (that.visitId != null) {
  499. params.id = that.visitId;
  500. }
  501. let loading2 = that.$toast.loading({
  502. duration: 0,
  503. message: '加载中...',
  504. forbidClick: true,
  505. });
  506. getStoreGroupTask(params).then((res) => {
  507. loading2.clear();
  508. if (res.code == 200) {
  509. localStorage.setItem('visitId', res.data.visitId);
  510. that.notes = res.data.notes;
  511. that.visitId = res.data.visitId;
  512. that.list = res.data.sfaTaskList;
  513. that.storeGroupId = res.data.storeGroupId;
  514. that.showOrderButton = res.data.showOrderButton;
  515. that.startTime = res.data.startTime;
  516. that.timeN = setInterval(that.animation, 16);
  517. that.visitsRemarks = res.data.visitsRemarks;
  518. } else {
  519. that.$toast(res.msg);
  520. }
  521. });
  522. },
  523. function (err) {
  524. var params = {
  525. storeId: that.storeId,
  526. storeCode: that.storeCode,
  527. visitEntry: visitEntry,
  528. lat: that.urlParameter.latNew,
  529. lon: that.urlParameter.lonNew,
  530. visitModel: that.visitModel,
  531. routeDetailsId: that.rdId,
  532. visitSource: '1',
  533. locationCity: '',
  534. locationRemark: '',
  535. locationAccuracy: that.urlParameter.PointSum,
  536. };
  537. that.locationAccuracy = that.urlParameter.PointSum;
  538. that.city = '';
  539. that.address = '';
  540. localStorage.setItem('address', '');
  541. if (that.visitId != null) {
  542. params.id = that.visitId;
  543. }
  544. let loading2 = that.$toast.loading({
  545. duration: 0,
  546. message: '加载中...',
  547. forbidClick: true,
  548. });
  549. getStoreGroupTask(params).then((res) => {
  550. loading2.clear();
  551. if (res.code == 200) {
  552. localStorage.setItem('visitId', res.data.visitId);
  553. that.notes = res.data.notes;
  554. that.visitId = res.data.visitId;
  555. that.list = res.data.sfaTaskList;
  556. that.storeGroupId = res.data.storeGroupId;
  557. that.showOrderButton = res.data.showOrderButton;
  558. that.startTime = res.data.startTime;
  559. that.timeN = setInterval(that.animation, 16);
  560. that.visitsRemarks = res.data.visitsRemarks;
  561. } else {
  562. that.$toast(res.msg);
  563. }
  564. });
  565. }
  566. );
  567. },
  568. addStoreVisit(val, index) {
  569. this.$router.push({
  570. path: '/addStoreVisit',
  571. query: {
  572. storeId: this.storeId,
  573. storeCode: this.urlParameter.storeCode,
  574. visitId: this.visitId,
  575. ids: index,
  576. taskId: val.taskId,
  577. storeGroupId: this.storeGroupId,
  578. taskType: val.taskType,
  579. photoType: val.photoType,
  580. lat: this.lat,
  581. lon: this.lon,
  582. visitSource: '1',
  583. visitModel: this.visitModel,
  584. locationCity: this.city,
  585. locationRemark: this.address,
  586. locationAccuracy: this.locationAccuracy,
  587. photoIdentifyType: val.photoIdentifyType,
  588. },
  589. });
  590. },
  591. onClickLeft() {
  592. if (this.$route.query.urltype == 1) {
  593. window.location.replace(window.location.origin + '/mobile/home');
  594. } else {
  595. this.$router.go(-1);
  596. }
  597. },
  598. onshouow() {
  599. this.uploadshow = false;
  600. this.questionsshow = false;
  601. },
  602. uploadImgEdit() {
  603. if (this.uploadImgEditText == '编辑') {
  604. this.uploadImgEditText = '完成';
  605. } else {
  606. this.uploadImgEditText = '编辑';
  607. this.uploadImgshow = false;
  608. }
  609. },
  610. deleteImg(index) {
  611. this.imgs.splice(index, 1);
  612. },
  613. questionClick(item) {
  614. console.log(item);
  615. if (item.isUpload) {
  616. this.uploadshow = true;
  617. } else if (item.isQuestion) {
  618. this.questionsshow = true;
  619. }
  620. },
  621. endVisitsFn() {
  622. if (this.list.length == 0) {
  623. this.$toast('暂无任务提交');
  624. return;
  625. }
  626. for (var vl = 0; vl < this.list.length; vl++) {
  627. if (this.list[vl].isMust == '0') {
  628. if (!this.list[vl].success) {
  629. this.$toast(this.list[vl].taskName + '任务未完成');
  630. return;
  631. }
  632. }
  633. }
  634. let loading1 = this.$toast.loading({
  635. duration: 0,
  636. message: '加载中...',
  637. forbidClick: true,
  638. });
  639. let dwellTime = this.weekend(localStorage.getItem('startTime'), new Date());
  640. let storeCode = this.storeCode;
  641. if (this.$route.query.shopCode != undefined) {
  642. storeCode = this.$route.query.shopCode;
  643. }
  644. if (this.flag) {
  645. this.flag = false;
  646. this.timer = null;
  647. this.timer = setTimeout(() => {
  648. this.flag = true;
  649. }, 5000);
  650. endVisits({
  651. visitSource: '1',
  652. storeGroupId: this.storeGroupId,
  653. id: this.visitId,
  654. storeCode: storeCode,
  655. dwellTime: dwellTime,
  656. visitModel: this.$route.query.visitModel,
  657. }).then((res) => {
  658. this.flag = true;
  659. loading1.clear();
  660. if (res.code == 200) {
  661. this.editDwellTimes();
  662. if (this.$route.query.linkType == 6) {
  663. window.location.replace(window.location.origin + '/mobile/topStore?info=y');
  664. } else {
  665. if (this.$route.query.urltype == 1) {
  666. window.location.replace(window.location.origin + '/mobile/home');
  667. } else {
  668. this.onClickLeft();
  669. // window.location.replace(
  670. // window.location.origin + '/mobile/outsidelist/index?info=y'
  671. // );
  672. }
  673. }
  674. } else {
  675. this.$toast({
  676. message: res.msg,
  677. duration: 5000,
  678. });
  679. }
  680. });
  681. }
  682. },
  683. newimgarr1(val) {
  684. this.imgs = val;
  685. },
  686. uploadImgShowFn() {
  687. this.uploadImgshow = true;
  688. if (this.uploadImages.length <= 0) {
  689. this.uploadImgEditText = '';
  690. }
  691. },
  692. previewsImg(index) {
  693. ImagePreview({
  694. images: this.uploadImages,
  695. startPosition: index,
  696. onClose() {
  697. // do something
  698. },
  699. });
  700. },
  701. // 物料历史
  702. wuliaoLog() {
  703. this.toastLoading(0, '加载中...', true);
  704. getMaterialHistory({ storeId: this.storeId })
  705. .then((res) => {
  706. this.toastLoading().clear();
  707. if (res.code == 200 && res.data) {
  708. this.wuliaoList = res.data;
  709. this.wuliaoTable = true;
  710. }
  711. })
  712. .catch(() => {
  713. this.toastLoading().clear();
  714. });
  715. },
  716. wuliaoTableClose() {
  717. this.wuliaoTable = false;
  718. },
  719. },
  720. destroyed() {
  721. this.timeN = null;
  722. clearInterval(this.timeN);
  723. },
  724. };
  725. </script>
  726. <style lang="scss" scoped>
  727. .container {
  728. margin-bottom: 10px;
  729. background-color: white;
  730. /*padding:0 16px;*/
  731. }
  732. .navBarOverlay {
  733. background: #fff;
  734. }
  735. .card {
  736. background: #fff;
  737. box-sizing: border-box;
  738. padding: 10px 16px;
  739. .title {
  740. line-height: 32px;
  741. font-size: 16px;
  742. font-weight: bold;
  743. color: #333;
  744. }
  745. .subtitle {
  746. line-height: 24px;
  747. font-size: 14px;
  748. color: #7b7b7b;
  749. .status {
  750. float: right;
  751. }
  752. }
  753. .info {
  754. font-size: 14px;
  755. color: #484848;
  756. padding: 14px;
  757. border-bottom: 1px solid #f1f1f1;
  758. position: relative;
  759. .arrow {
  760. float: right;
  761. display: inline-block;
  762. height: 20px;
  763. width: 20px;
  764. line-height: 20px;
  765. text-align: center;
  766. border-radius: 50%;
  767. background: #0057ba;
  768. color: #fff;
  769. font-weight: bold;
  770. font-size: 14px;
  771. position: absolute;
  772. margin-top: -10px;
  773. right: 0;
  774. top: 50%;
  775. }
  776. }
  777. .info1 {
  778. font-size: 14px;
  779. color: #666;
  780. line-height: 18px;
  781. padding: 4px 0;
  782. position: relative;
  783. .arrow {
  784. float: right;
  785. display: inline-block;
  786. height: 20px;
  787. width: 20px;
  788. line-height: 20px;
  789. text-align: center;
  790. border-radius: 50%;
  791. background: #0057ba;
  792. color: #fff;
  793. font-weight: bold;
  794. font-size: 14px;
  795. margin-top: 9px;
  796. position: absolute;
  797. right: 0;
  798. top: 50%;
  799. margin-top: -10px;
  800. }
  801. }
  802. }
  803. .must {
  804. font-size: 18px;
  805. color: #f56c6c;
  806. margin-right: 2px;
  807. }
  808. .zw {
  809. display: inline-block;
  810. width: 7px;
  811. height: 100%;
  812. }
  813. .lineGrey {
  814. height: 10px;
  815. width: 100%;
  816. background: #f1f1f1;
  817. }
  818. .submitBtn {
  819. margin: 16px 0;
  820. font-size: 18px;
  821. }
  822. .wrapper {
  823. display: flex;
  824. align-items: center;
  825. justify-content: center;
  826. height: 100%;
  827. .block {
  828. width: 100%;
  829. height: 100%;
  830. background-color: #fff;
  831. overflow: auto;
  832. }
  833. }
  834. .questionName {
  835. font-size: 16px;
  836. color: #484848;
  837. /*line-height: 40px;*/
  838. background: #f4f4f4;
  839. padding: 10px 15px;
  840. box-sizing: border-box;
  841. position: relative;
  842. display: flex;
  843. justify-content: center;
  844. .text {
  845. flex: 9;
  846. }
  847. }
  848. .answerDiv {
  849. background: #fff;
  850. padding: 0 15px 10px;
  851. .answerItem {
  852. padding: 10px 0;
  853. border-bottom: 1px solid #dedede;
  854. .name {
  855. line-height: 36px;
  856. font-size: 14px;
  857. color: #8b8b8b;
  858. }
  859. }
  860. }
  861. .border {
  862. border: 1px solid #dedede;
  863. }
  864. .ht30 {
  865. height: 30px;
  866. }
  867. .bodrder-b {
  868. border-bottom: 1px solid #dedede;
  869. }
  870. .img-box {
  871. width: 50%;
  872. /*height: 100%;*/
  873. position: relative;
  874. padding: 10px;
  875. display: inline-block;
  876. i {
  877. position: absolute;
  878. right: 2px;
  879. top: 2px;
  880. }
  881. img {
  882. width: 100%;
  883. height: 100%;
  884. }
  885. }
  886. .imgNull {
  887. text-align: center;
  888. padding-top: 100px;
  889. i {
  890. color: #dedede;
  891. }
  892. div {
  893. padding-top: 30px;
  894. font-size: 18px;
  895. font-weight: bold;
  896. }
  897. }
  898. .card .f-blue {
  899. color: #0057ba;
  900. }
  901. </style>
  902. <style lang="scss">
  903. .navBarOverlay .van-nav-bar__left .van-icon {
  904. color: #8b8b8b;
  905. }
  906. .navBarOverlay .van-nav-bar__right .van-nav-bar__text {
  907. color: #333;
  908. }
  909. .ht30 .van-radio__label {
  910. color: #8b8b8b;
  911. }
  912. .van-dialog__confirm,
  913. .van-dialog__confirm:active {
  914. color: #0057ba;
  915. }
  916. #allmap {
  917. width: 20px;
  918. height: 20px;
  919. left: -1000px;
  920. position: relative;
  921. }
  922. .el-dialog__wrapper {
  923. z-index: 3333 !important;
  924. display: flex;
  925. justify-content: center;
  926. align-items: center;
  927. background: rgba(0, 0, 0, 0.5) !important;
  928. .wuliaoTable {
  929. overflow: hidden;
  930. display: flex;
  931. flex-direction: column;
  932. max-height: 70%;
  933. .el-dialog__header {
  934. height: 40px;
  935. }
  936. .el-dialog__body {
  937. padding: 30px 20px !important;
  938. overflow-y: auto;
  939. flex: 1;
  940. }
  941. .cell {
  942. font-size: 12px;
  943. }
  944. }
  945. }
  946. </style>