suishenbangOutstoreVisit.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  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;请在“奖励案”和“生动化陈列”中拍全本店陈列的所有产品,以便准确识别SKU数量
  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. getVisitTasks,
  150. } from '@/api/index';
  151. import axios from 'axios';
  152. import { saveVisitsParams, getOrderUrlByStoreId } from '@/api/inventory';
  153. export default {
  154. name: 'suishenbangOutstoreVisit',
  155. data() {
  156. return {
  157. notes: '',
  158. visitModel: '1',
  159. sp: sp,
  160. shows: false,
  161. flag: true,
  162. questionsshow: false,
  163. uploadImgshow: false,
  164. imgs: [],
  165. uploadImages: [],
  166. uploadid1: 'uploadid1',
  167. uploadid2: 'uploadid2',
  168. iscuxiao: false,
  169. text: '',
  170. radio: '',
  171. uploadImgEditText: '编辑',
  172. isEdit: false,
  173. storeId: '',
  174. rdId: '',
  175. lat: '',
  176. lon: '',
  177. list: [],
  178. storeGroupId: '',
  179. addShow1: false,
  180. visitId: '',
  181. addressLine: '',
  182. storeCategory: '',
  183. storeName: '',
  184. contactName: '',
  185. urlParameter: '',
  186. uType: '-1',
  187. showOrderButton: null,
  188. visitsRemarks: [],
  189. location: {
  190. lat: '34.6174',
  191. lon: '112.44039',
  192. },
  193. address: '',
  194. showTime: '00:00:00',
  195. city: '',
  196. locationAccuracy: '',
  197. id: '89',
  198. startTime: null,
  199. timeN: null,
  200. wuliaoTable: false,
  201. wuliaoList: [],
  202. };
  203. },
  204. created() {},
  205. beforeRouteLeave(to, from, next) {
  206. if (
  207. (to.path == '/outsidelist/index' && from.path == '/suishenbangOutstoreVisit') ||
  208. (to.path == '/storeAdd' && from.path == '/suishenbangOutstoreVisit')
  209. ) {
  210. if (this.visitId != null && this.visitId != '') {
  211. this.editDwellTimes();
  212. }
  213. }
  214. next();
  215. },
  216. activated() {
  217. // 是否请求任务列表接口
  218. let getRequestFlage = localStorage.getItem('getRequestFlage');
  219. if (getRequestFlage != 'true') return;
  220. this.urlParameter = this.$route.query;
  221. this.storeId = this.$route.query.storeId + '';
  222. this.visitId = this.$route.query.visitId;
  223. this.storeCode = this.$route.query.storeCode;
  224. this.rdId = this.$route.query.rdId + '';
  225. this.addressLine = this.$route.query.addressLine + '';
  226. this.storeCategory = this.$route.query.storeCategory + '';
  227. this.storeName = this.$route.query.storeName + '';
  228. this.contactName = this.$route.query.contactName + '';
  229. this.lat = this.$route.query.lat + '';
  230. this.lon = this.$route.query.lon + '';
  231. this.visitModel = this.$route.query.visitModel + '';
  232. this.uType = localStorage.getItem('uType');
  233. this.list = [];
  234. if (localStorage.getItem('visitId') != null) {
  235. this.visitId = localStorage.getItem('visitId');
  236. setTimeout(() => {
  237. this.addVisits();
  238. });
  239. } else {
  240. setTimeout(() => {
  241. this.addVisits();
  242. });
  243. }
  244. },
  245. methods: {
  246. animation() {
  247. //前时间减去上次开启时间减去暂停累计时间
  248. var times = new Date().getTime() - new Date(this.startTime).getTime();
  249. var house = Math.floor(times / 3600000); //毫秒转化为分钟
  250. var minutes = Math.floor(times / 60000 - house * 60); //毫秒转化为分钟
  251. var minutes1 = Math.floor(times / 60000); //毫秒转化为分钟
  252. var seconds = Math.floor((times - minutes1 * 60000) / 1000); //已知分钟将time减去分钟 除去1000得出 秒
  253. var ms = Math.floor((times - minutes1 * 60000 - seconds * 1000) / 10); //
  254. this.showTime =
  255. (house < 10 ? '0' + house : house) +
  256. ':' +
  257. (minutes < 10 ? '0' + minutes : minutes) +
  258. ':' +
  259. (seconds < 10 ? '0' + seconds : seconds);
  260. // +":"
  261. // +(ms<10 ? "0"+ms : ms);
  262. },
  263. // 结束拜访
  264. onstopVisit() {
  265. this.$dialog
  266. .confirm({
  267. confirmButtonText: '确定',
  268. cancelButtonText: '取消',
  269. title: '系统提示',
  270. message: '取消拜访会清空填写的拜访内容和照片,是否确认?',
  271. })
  272. .then(() => {
  273. stopVisit({ visitsId: this.visitId }).then((res) => {
  274. if (res.code == 200) {
  275. localStorage.removeItem('visitId');
  276. this.$dialog
  277. .alert({
  278. title: '系统提示',
  279. message: '拜访中任务结束成功!',
  280. })
  281. .then(() => {
  282. // this.$router.replace({});
  283. this.onClickLeft();
  284. // window.location.replace(window.location.origin + '/mobile/outsidelist/index');
  285. });
  286. } else {
  287. this.$dialog.alert({
  288. title: '系统提示',
  289. message: res.msg,
  290. });
  291. }
  292. });
  293. });
  294. },
  295. overbookingFn(val) {
  296. buryingPoint({
  297. systemModel: '拜访页',
  298. buryingPointType: 1,
  299. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  300. buryingPointName: '去下单',
  301. buryingPointPosition: '拜访页',
  302. });
  303. this.toastLoading(0, '加载中...', true);
  304. getOrderUrlByStoreId({
  305. storeId: this.$route.query.storeId,
  306. from: this.$route.query.from,
  307. }).then((res) => {
  308. this.toastLoading().clear();
  309. if (res.code == 200 && res.data) {
  310. window.location.href = res.data;
  311. } else {
  312. this.Toast({
  313. message: res.msg,
  314. duration: 5000,
  315. });
  316. }
  317. });
  318. },
  319. visitFn(val) {
  320. var that = this;
  321. suishenbangStoreSale({ storeCode: val }).then((res) => {
  322. if (res.code == 200) {
  323. if (res.data.num != '0') {
  324. window.location.href =
  325. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + val;
  326. } else {
  327. that.$toast(res.data.msg);
  328. }
  329. } else {
  330. that.$toast(res.msg);
  331. }
  332. });
  333. },
  334. getLocation() {
  335. let loading1 = this.$toast.loading({
  336. duration: 0,
  337. message: '加载中...',
  338. forbidClick: true,
  339. });
  340. this.list = [];
  341. let url = window.location.href;
  342. let that = this;
  343. let wx = this.wx;
  344. let qiyeData;
  345. const instance = axios.create();
  346. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  347. instance
  348. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  349. params: {
  350. url: url,
  351. },
  352. })
  353. .then((response) => {
  354. if (response.status == 200) {
  355. loading1.clear();
  356. qiyeData = response.data.data;
  357. wx.config({
  358. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  359. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  360. appId: qiyeData.appId, // 必填,企业微信的corpID
  361. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  362. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  363. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  364. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  365. });
  366. wx.ready(function () {
  367. wx.getLocation({
  368. type: 'gcj02',
  369. success: function (res) {
  370. var location = that.CJ02BD(res.latitude, res.longitude);
  371. that.location = location;
  372. if (that.urlParameter.lat == '' || that.urlParameter.lat == null) {
  373. that.lat = that.location.lat;
  374. that.lon = that.location.lon;
  375. }
  376. let PointSum = that
  377. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  378. .toFixed(2);
  379. if (PointSum > 500) {
  380. that.visitModel = '5';
  381. localStorage.setItem('visitModel', '5');
  382. that.$dialog
  383. .confirm({
  384. confirmButtonText: '确定',
  385. cancelButtonText: '重新定位',
  386. title: '系统提示',
  387. message: '距离本店距离差距太大',
  388. })
  389. .then(() => {
  390. that.addVisits();
  391. })
  392. .catch(() => {
  393. that.getLocation();
  394. });
  395. } else {
  396. that.addVisits();
  397. }
  398. },
  399. fail: function () {
  400. that.$dialog
  401. .alert({
  402. message: 'GPS未开启',
  403. })
  404. .then(() => {
  405. that.getLocation();
  406. });
  407. },
  408. });
  409. });
  410. }
  411. });
  412. },
  413. editDwellTimes() {
  414. let dwellTime = this.weekend(localStorage.getItem('startTime'), new Date()) + '';
  415. editDwellTime({ dwellTime: dwellTime, visitsId: this.visitId }).then((res) => {
  416. if (res.code == 200) {
  417. localStorage.removeItem('visitId');
  418. }
  419. });
  420. },
  421. weekend(time1) {
  422. var arrtime1 = new Date(time1).getTime();
  423. var arrtime2 = new Date().getTime();
  424. return Math.round((arrtime2 - arrtime1) / 1000);
  425. },
  426. addVisits() {
  427. var postType = localStorage.getItem('postType');
  428. if (postType == 'GZ') {
  429. this.addShow1 = false;
  430. } else {
  431. this.addShow1 = true;
  432. }
  433. var visitEntry = '';
  434. if (this.urlParameter.tabVal == '0') {
  435. visitEntry = '2';
  436. } else {
  437. visitEntry = '1';
  438. }
  439. if (this.$route.query.shopCode != undefined) {
  440. this.storeCode = this.$route.query.shopCode;
  441. }
  442. var that = this;
  443. var map = new TMap.Map('allmap', {
  444. zoom: 14,
  445. center: new TMap.LatLng(39.986785, 116.301012),
  446. });
  447. var geocoder = new TMap.service.Geocoder();
  448. var markers = new TMap.MultiMarker({
  449. map: map,
  450. geometries: [],
  451. });
  452. markers.setGeometries([]);
  453. var input = [that.urlParameter.marklat, that.urlParameter.marklon];
  454. var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
  455. geocoder.getAddress({ location: location }).then(
  456. function (result) {
  457. var addresses = result.result.formatted_addresses;
  458. let address_component = result.result.address_component;
  459. let province = address_component.province;
  460. let city = address_component.city;
  461. let district = address_component.district;
  462. console.log('province=' + province);
  463. console.log('city=' + city);
  464. console.log('district=' + district);
  465. let recommend = '';
  466. if (addresses) {
  467. recommend = addresses.recommend;
  468. }
  469. var params = {
  470. storeId: that.storeId,
  471. storeCode: that.storeCode,
  472. visitEntry: visitEntry,
  473. lat: that.urlParameter.latNew,
  474. lon: that.urlParameter.lonNew,
  475. visitModel: that.visitModel,
  476. routeDetailsId: that.rdId,
  477. visitSource: '1',
  478. locationCity: '',
  479. locationRemark: recommend,
  480. locationAccuracy: that.urlParameter.PointSum,
  481. province: address_component.province,
  482. city: address_component.city,
  483. district: address_component.district,
  484. };
  485. that.locationAccuracy = that.urlParameter.PointSum;
  486. that.city = '';
  487. that.address = recommend;
  488. localStorage.setItem('address', '');
  489. if (that.visitId != null) {
  490. params.id = that.visitId;
  491. }
  492. let loading2 = that.$toast.loading({
  493. duration: 0,
  494. message: '加载中...',
  495. forbidClick: true,
  496. });
  497. getVisitTasks(params).then((res) => {
  498. loading2.clear();
  499. if (res.code == 200) {
  500. debugger;
  501. localStorage.setItem('visitId', res.data.visitId);
  502. that.notes = res.data.notes;
  503. that.visitId = res.data.visitId;
  504. that.list = res.data.sfaTaskList;
  505. that.storeGroupId = res.data.storeGroupId;
  506. that.showOrderButton = res.data.showOrderButton;
  507. that.startTime = res.data.startTime;
  508. that.timeN = setInterval(that.animation, 16);
  509. that.visitsRemarks = res.data.visitsRemarks;
  510. } else {
  511. that.$toast(res.msg);
  512. }
  513. });
  514. },
  515. function (err) {
  516. var params = {
  517. storeId: that.storeId,
  518. storeCode: that.storeCode,
  519. visitEntry: visitEntry,
  520. lat: that.urlParameter.latNew,
  521. lon: that.urlParameter.lonNew,
  522. visitModel: that.visitModel,
  523. routeDetailsId: that.rdId,
  524. visitSource: '1',
  525. locationCity: '',
  526. locationRemark: '',
  527. locationAccuracy: that.urlParameter.PointSum,
  528. };
  529. that.locationAccuracy = that.urlParameter.PointSum;
  530. that.city = '';
  531. that.address = '';
  532. localStorage.setItem('address', '');
  533. if (that.visitId != null) {
  534. params.id = that.visitId;
  535. }
  536. let loading2 = that.$toast.loading({
  537. duration: 0,
  538. message: '加载中...',
  539. forbidClick: true,
  540. });
  541. getVisitTasks(params).then((res) => {
  542. loading2.clear();
  543. if (res.code == 200) {
  544. localStorage.setItem('visitId', res.data.visitId);
  545. that.notes = res.data.notes;
  546. that.visitId = res.data.visitId;
  547. that.list = res.data.sfaTaskList;
  548. that.storeGroupId = res.data.storeGroupId;
  549. that.showOrderButton = res.data.showOrderButton;
  550. that.startTime = res.data.startTime;
  551. that.timeN = setInterval(that.animation, 16);
  552. that.visitsRemarks = res.data.visitsRemarks;
  553. console.log(that.visitId);
  554. } else {
  555. that.$toast(res.msg);
  556. }
  557. });
  558. }
  559. );
  560. },
  561. addStoreVisit(val, index) {
  562. localStorage.setItem('getRequestFlage', 'false');
  563. console.log(this.visitId);
  564. this.$router.push({
  565. path: '/addStoreVisit',
  566. query: {
  567. storeId: this.storeId,
  568. storeCode: this.urlParameter.storeCode,
  569. visitId: this.visitId,
  570. ids: index,
  571. taskId: val.taskId,
  572. storeGroupId: this.storeGroupId,
  573. taskType: val.taskType,
  574. photoType: val.photoType,
  575. lat: this.lat,
  576. lon: this.lon,
  577. visitSource: '1',
  578. visitModel: this.visitModel,
  579. locationCity: this.city,
  580. locationRemark: this.address,
  581. locationAccuracy: this.locationAccuracy,
  582. photoIdentifyType: val.photoIdentifyType,
  583. deviceCode: val.deviceCode,
  584. putInCode: val.putInCode,
  585. equipmentCode: val.equipmentCode,
  586. inspectionType: val.inspectionType,
  587. },
  588. });
  589. },
  590. onClickLeft() {
  591. localStorage.setItem('getRequestFlage', 'true');
  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: 9999 !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. margin-top: 0 !important;
  934. .el-dialog__header {
  935. height: 40px;
  936. display: flex;
  937. justify-content: right;
  938. .el-dialog__headerbtn {
  939. position: static !important;
  940. }
  941. }
  942. .el-dialog__body {
  943. padding: 30px 20px !important;
  944. overflow-y: auto;
  945. flex: 1;
  946. }
  947. .cell {
  948. font-size: 12px;
  949. }
  950. }
  951. }
  952. </style>