index.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797
  1. <template>
  2. <div class="bgcolor deviceWithin">
  3. <div class="navBarTOP">
  4. <!-- 顶部条-->
  5. <van-nav-bar class="navBar" title="计划内">
  6. <template #right>
  7. <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
  8. </template>
  9. </van-nav-bar>
  10. <div class="searchDiv">
  11. <van-search
  12. v-model="storeName"
  13. left-icon="search"
  14. show-action
  15. placeholder="搜索名称/编号/地址">
  16. <template #action>
  17. <div @click="onSearch">搜索</div>
  18. </template>
  19. </van-search>
  20. </div>
  21. <!-- 隐藏高销额门店入口 -->
  22. <!-- <div style="background-color: #dfebf4; padding: 10px" v-if="mapShows">
  23. <div
  24. style="
  25. font-size: 16px;
  26. text-align: center;
  27. margin: 0 auto;
  28. width: 150px;
  29. text-decoration: underline;
  30. font-weight: bold;
  31. color: #222;
  32. "
  33. @click="goFn(1)">
  34. <img
  35. src="./../../assets/Icon/clcik.png"
  36. style="width: 22px; float: left; display: inline-block" />高销额门店推荐
  37. </div>
  38. <van-button
  39. round
  40. type="info"
  41. size="small"
  42. style="position: absolute; top: 108px; right: 10px; height: 28px"
  43. @click="goFn(1)"
  44. >去查看<van-icon name="arrow"
  45. /></van-button>
  46. </div> -->
  47. <div class="monthNow" v-show="calendarIsshow == false">
  48. <span class="month" @click="show = true">{{ timeData }}</span>
  49. <van-icon class="CalendarIcon" :name="timeico" @click="show = true" />
  50. </div>
  51. </div>
  52. <!-- 主体内容-->
  53. <div class="container content" style="margin-top: 145px" @touchmove="handleTouch">
  54. <div class="cellcontent" v-for="(item, index) in list" :key="index">
  55. <van-cell>
  56. <div class="card">
  57. <div class="title">
  58. <template v-if="item.storeLabels">
  59. <!-- 金牌店ABC -->
  60. <img
  61. class="JPABC"
  62. :src="require('@/assets/Icon/storeA.png')"
  63. v-if="item.storeLabels.storeA" />
  64. <img
  65. class="JPABC"
  66. :src="require('@/assets/Icon/storeB.png')"
  67. v-if="item.storeLabels.storeB" />
  68. <img
  69. class="JPABC"
  70. :src="require('@/assets/Icon/storeC.png')"
  71. v-if="item.storeLabels.storeC" />
  72. <img
  73. class="JPABC"
  74. :src="require('@/assets/Icon/storeD.png')"
  75. v-if="item.storeLabels.storeD" />
  76. <img
  77. class="JPABC"
  78. :src="require('@/assets/Icon/storeE.png')"
  79. v-if="item.storeLabels.storeE" />
  80. </template>
  81. <span @click="goOtherSystem(item)" :style="setStroeNameStyle(item)">
  82. <span>{{ item.storeName }}</span>
  83. (<span>{{ item.storeCode }}</span
  84. >)
  85. </span>
  86. <span class="btn" :data-clipboard-text="item.storeCode">
  87. <van-icon
  88. :name="paste"
  89. color="#ee0a24"
  90. size="20"
  91. style="top: 6px; margin-left: 4px" />
  92. </span>
  93. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  94. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  95. <template v-if="item.approvalStatus == 0">
  96. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1">已提交</span>
  97. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  98. >未提交</span
  99. >
  100. </template>
  101. </div>
  102. <div class="info">
  103. 类型:{{ item.storeCategory }} &nbsp;
  104. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  105. <div>
  106. <p>
  107. 本店经营品项指导:
  108. <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
  109. </p>
  110. </div>
  111. <van-icon name="question-o" size="18" slot="reference" />
  112. </el-popover>
  113. </div>
  114. <div class="info" style="position: relative">
  115. 联系人:{{ item.contactName }}
  116. <div style="position: absolute; bottom: 0; right: 14px">
  117. <el-popover
  118. popper-class="zpover"
  119. placement="bottom"
  120. width="120"
  121. trigger="click"
  122. content="该客户为凤凰客户">
  123. <div
  124. v-if="item.storeLabels.fhCustomer"
  125. class="visitStoreIco"
  126. style="background-color: #fff"
  127. slot="reference">
  128. <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
  129. </div>
  130. </el-popover>
  131. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  132. <div>
  133. <p>
  134. 本店{{ timeData1 }}下单SKU数:<a
  135. @click="linkList(item)"
  136. style="text-decoration: underline"
  137. >点击查看详情</a
  138. >
  139. </p>
  140. </div>
  141. <div
  142. class="visitStoreIco"
  143. v-if="item.storeLabels.zysslNums !== false"
  144. style="background-color: #fff; position: relative"
  145. slot="reference">
  146. <p
  147. style="
  148. width: 100%;
  149. position: absolute;
  150. z-index: 1;
  151. top: 0.2px;
  152. width: 22px;
  153. margin: 0;
  154. margin-left: 3.6px;
  155. text-align: center;
  156. font-size: 12px;
  157. ">
  158. {{ item.storeLabels.zysslNums }}
  159. </p>
  160. <van-icon :name="ord" size="26" />
  161. </div>
  162. </el-popover>
  163. <el-popover popper-class="zpover" placement="bottom" width="200" trigger="click">
  164. <div v-if="item.storeLabels">
  165. <p>已参加:</p>
  166. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
  167. {{ tt }}
  168. </p>
  169. </div>
  170. <div
  171. class="visitStoreIco"
  172. v-if="item.storeLabels.targetOne"
  173. style="background-color: #fff"
  174. slot="reference">
  175. <van-icon :name="targetOne" size="26" />
  176. </div>
  177. </el-popover>
  178. <el-popover
  179. popper-class="zpover"
  180. placement="bottom"
  181. width="120"
  182. trigger="click"
  183. content="调色机7天未调色">
  184. <div
  185. v-if="item.storeLabels.stopColorMixerSeven"
  186. class="visitStoreIco"
  187. style="background-color: #fff"
  188. slot="reference">
  189. <van-icon :name="Network" size="26" />
  190. </div>
  191. </el-popover>
  192. <el-popover
  193. popper-class="zpover"
  194. placement="bottom"
  195. width="120"
  196. trigger="click"
  197. content="调色机当月未调色">
  198. <div
  199. v-if="item.storeLabels.stopColorMixerMonth"
  200. class="visitStoreIco"
  201. style="background-color: #fff"
  202. slot="reference">
  203. <van-icon :name="WiFi" size="26" />
  204. </div>
  205. </el-popover>
  206. <el-popover
  207. popper-class="zpover"
  208. placement="bottom"
  209. width="200"
  210. trigger="click"
  211. content="同城店近60天未下单">
  212. <div
  213. v-if="item.storeLabels.fxNoOrder"
  214. class="visitStoreIco"
  215. style="background-color: #fff"
  216. slot="reference">
  217. <van-icon :name="order60" size="26" />
  218. </div>
  219. </el-popover>
  220. <el-popover
  221. popper-class="zpover"
  222. placement="bottom"
  223. width="200"
  224. trigger="click"
  225. content="金牌店近30天未下单">
  226. <div
  227. v-if="item.storeLabels.noOrder"
  228. class="visitStoreIco"
  229. style="background-color: #fff"
  230. slot="reference">
  231. <van-icon :name="order" size="26" />
  232. </div>
  233. </el-popover>
  234. <el-popover
  235. popper-class="zpover"
  236. placement="bottom"
  237. width="200"
  238. trigger="click"
  239. content="本店本月进过专业时时丽">
  240. <div
  241. v-if="item.storeLabels.zyssl"
  242. class="visitStoreIco"
  243. style="background-color: #ed5c68"
  244. slot="reference">
  245. </div>
  246. </el-popover>
  247. <el-popover
  248. popper-class="zpover zpover1"
  249. placement="bottom"
  250. width="200"
  251. trigger="click"
  252. content="本店本月进过超好贴">
  253. <div
  254. v-if="item.storeLabels.chtczj"
  255. class="visitStoreIco"
  256. style="background-color: #0057ba"
  257. slot="reference">
  258. </div>
  259. </el-popover>
  260. <el-popover
  261. placement="bottom"
  262. popper-class="zpover zpover1 zpover1sb"
  263. trigger="click"
  264. :disabled="!item.userVisitTimesMap"
  265. :content="'本店本月已拜访过' + item.storeLabels.visitTimes + '次'">
  266. <div
  267. v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
  268. class="visitStoreIco"
  269. slot="reference"
  270. style="background-color: #fff; position: relative">
  271. <p
  272. style="
  273. width: 100%;
  274. position: absolute;
  275. z-index: 10;
  276. top: -2px;
  277. margin: 0;
  278. text-align: center;
  279. font-size: 12px;
  280. ">
  281. {{ item.storeLabels.visitTimes }}
  282. </p>
  283. <!-- A级金牌店拜访次数少于2 -->
  284. <van-icon
  285. :name="require('@/assets/ordernumRed.png')"
  286. size="26"
  287. v-if="
  288. item.storeLabels.storeA &&
  289. item.needVisitNum &&
  290. item.storeLabels.visitTimes < item.needVisitNum
  291. " />
  292. <van-icon :name="require('@/assets/ordernum.png')" size="26" v-else />
  293. </div>
  294. <p style="text-align: center; background: #fff; color: #000; padding: 5px 0">
  295. 本店本月已拜访过{{ item.storeLabels.visitTimes }}次
  296. </p>
  297. <p
  298. v-if="item.storeLabels.storeA && item.needVisitNum"
  299. style="text-align: center; background: #fff; color: red; padding: 5px 0">
  300. A级金牌店拜访标准:1月{{ item.needVisitNum }}次
  301. </p>
  302. <el-table :data="item.userVisitTimesMap" border max-height="180px">
  303. <el-table-column label="业务员" prop="userName" />
  304. <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
  305. </el-table>
  306. </el-popover>
  307. </div>
  308. </div>
  309. <div class="info" v-if="item.telephone" @click="buryingPointFn(item)">
  310. 联系电话:<a
  311. style="color: #0057ba; font-weight: bold; text-decoration: underline"
  312. :href="'tel:' + item.telephone"
  313. >{{ item.telephone }}<van-icon name="phone"
  314. /></a>
  315. </div>
  316. <div class="info" v-if="item.addressLine">
  317. 地址:{{ item.addressLine
  318. }}<img
  319. v-if="item.storeLonExist"
  320. style="width: 36px"
  321. :src="sbpmdh"
  322. @click="linkapp(item)" />
  323. </div>
  324. <!-- 潜在店不显示经销商 -->
  325. <template v-if="item.sfaStoreType.type != 'qzd'">
  326. <!-- 分销店 -->
  327. <template
  328. v-if="
  329. item.sfaStoreType &&
  330. item.sfaStoreType.type == 'fxd' &&
  331. item.sfaStoreChainsContactList
  332. ">
  333. <div class="info" v-if="typeShow">
  334. 经销商:
  335. <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
  336. <el-popover
  337. popper-class="zpover zpoverStoreztype"
  338. placement="bottom-start"
  339. trigger="click">
  340. <div>
  341. <div>{{ item.chainCode }}</div>
  342. <div>{{ item.chainName }}</div>
  343. </div>
  344. <div slot="reference" :key="index">
  345. {{ item.categoryDescribe }}
  346. </div>
  347. </el-popover>
  348. </div>
  349. </div>
  350. </template>
  351. <template v-else>
  352. <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
  353. </template>
  354. </template>
  355. <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
  356. <div class="info" v-if="item.storeLonExist">距离:{{ Micrometer(item.distance) }}m</div>
  357. <div class="info" v-if="item.cntOrderAmtYear">
  358. 门店销额(全年累计):{{ Micrometer(item.cntOrderAmtYear) }}元
  359. </div>
  360. </div>
  361. <div
  362. class="statstext"
  363. v-if="item.stateString == '未拜访'"
  364. style="background-color: #ed5c68">
  365. 未拜访
  366. </div>
  367. <div
  368. class="statstext"
  369. v-if="item.stateString == '拜访中'"
  370. style="background-color: white">
  371. <van-icon :name="times" color="#ee0a24" size="32" />
  372. </div>
  373. <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
  374. <div class="btnbox">
  375. <van-row>
  376. <van-col
  377. span="4"
  378. v-if="item.stateString != '已拜访' && item.visitAble && customerVisits"
  379. @click="storeVisit(item)">
  380. <img :src="call" style="margin: 0 auto; height: 15px; display: block" />
  381. <p style="text-align: center; margin: 0; font-size: 11px">进入拜访</p>
  382. </van-col>
  383. <van-col
  384. span="4"
  385. v-if="item.storeCategory == '公装经销商'"
  386. @click="projectOutVisit(item)">
  387. <img :src="xmgj" style="margin: 0 auto; height: 15px; display: block" />
  388. <p style="text-align: center; margin: 0; font-size: 11px">项目跟进</p>
  389. </van-col>
  390. <van-col
  391. span="4"
  392. v-if="
  393. item.stateString != '已拜访' &&
  394. item.visitAble &&
  395. item.storeCategory != '公装经销商' &&
  396. customerVisits
  397. "
  398. @click="abnormalVisit(item)">
  399. <img :src="yichang" style="margin: 0 auto; height: 15px; display: block" />
  400. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  401. 异常拜访
  402. </p>
  403. </van-col>
  404. <van-col span="4" v-if="item.storeLabels.zysslNums !== false" @click="linkList(item)">
  405. <img
  406. :src="require('@/assets/recommendicon.png')"
  407. style="margin: 0 auto; height: 15px; display: block" />
  408. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  409. 推荐下单
  410. </p>
  411. </van-col>
  412. <van-col span="4" v-else-if="item.showOrderButton" @click="orderFn(item)">
  413. <img :src="xiadan" style="margin: 0 auto; height: 15px; display: block" />
  414. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  415. 去下单
  416. </p>
  417. </van-col>
  418. <van-col span="4" v-if="item.stateString == '已拜访'" @click="Visit(item)">
  419. <img :src="bfxx" style="margin: 0 auto; height: 15px; display: block" />
  420. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  421. 拜访信息
  422. </p>
  423. </van-col>
  424. <van-col span="4" @click="visitFn(item)">
  425. <img :src="kehuxinxi" style="margin: 0 auto; height: 15px; display: block" />
  426. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  427. 客户信息
  428. </p>
  429. </van-col>
  430. </van-row>
  431. </div>
  432. </van-cell>
  433. <div class="lineGrey"></div>
  434. </div>
  435. <p style="text-align: center; color: #888a8e" v-if="list.length > 0">--已经到底了--</p>
  436. <br />
  437. <van-empty description="暂无数据" v-if="list.length == 0" />
  438. </div>
  439. <van-popup v-model="show" position="bottom" :style="{ height: '50%' }">
  440. <van-datetime-picker
  441. v-model="currentDate"
  442. type="date"
  443. title="计划日期"
  444. :min-date="minDate"
  445. :max-date="maxDate"
  446. @confirm="dateeconfirm"
  447. @cancel="show = false" />
  448. </van-popup>
  449. <!-- 筛选模块 -->
  450. <filtrate v-show="showFilter" :showFilter="showFilter" @closePopup="closePopup"></filtrate>
  451. <tab-bar tabBarActive="deviceWithin"></tab-bar>
  452. </div>
  453. </template>
  454. <script>
  455. import Network from '@/assets/Network.png';
  456. import WiFi from '@/assets/WiFi.png';
  457. import tabBar from '@/components/tabBar';
  458. import times from '@/assets/Icon/times.png';
  459. import order60 from '@/assets/order60.png';
  460. import targetOne from '@/assets/targetOne.png';
  461. import visitTimes from '@/assets/visitTimes.png';
  462. import ord from '@/assets/ord.png';
  463. import timeico from '@/assets/Icon/datatims.png';
  464. import sbpmdh from '@/assets/sbpmdh.png';
  465. import {
  466. getUserInPlanList,
  467. checkVisit,
  468. addVisitsPosition,
  469. mobileReposition,
  470. buryingPoint,
  471. ProductItemImge,
  472. } from '@/api/index';
  473. import axios from 'axios';
  474. import paste from '@/assets/paste.png';
  475. import order from '@/assets/order.png';
  476. import call from '@/assets/call.png';
  477. import jiarujihua from '@/assets/jiarujihua.png';
  478. import kehuxinxi from '@/assets/kehuxinxi-2.png';
  479. import xiadan from '@/assets/xiadan.png';
  480. import yichang from '@/assets/yichang.png';
  481. import bfxx from '@/assets/bfxx.png';
  482. import xmgj from '@/assets/xmgj.png';
  483. import { getOrderUrlByStoreId } from '@/api/inventory';
  484. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  485. import { getPosition, getTicketFun } from '@/utils/TXApiFun';
  486. import filtrate from '@/components/filtrate';
  487. export default {
  488. name: 'deviceWithin',
  489. components: { tabBar, filtrate },
  490. data() {
  491. return {
  492. Network: Network,
  493. WiFi: WiFi,
  494. xmgj: xmgj,
  495. bfxx: bfxx,
  496. yichang: yichang,
  497. xiadan: xiadan,
  498. kehuxinxi: kehuxinxi,
  499. jiarujihua: jiarujihua,
  500. call: call,
  501. times: times,
  502. timeico: timeico,
  503. order60: order60,
  504. sbpmdh: sbpmdh,
  505. ord: ord,
  506. timeData1: '',
  507. targetOne: targetOne,
  508. paste: paste,
  509. visitTimess: visitTimes,
  510. show: false,
  511. cont: 0,
  512. timer: null,
  513. flag: true,
  514. order: order,
  515. defaultDate: new Date(),
  516. minDate: new Date(2020, 0, 1),
  517. // maxDate: new Date(2025, 10, 1),
  518. showPopoverVNUM: [],
  519. showPopoverC: [],
  520. showPopoverZ: [],
  521. currentDate: new Date(),
  522. searchValue: '',
  523. calendarIsshow: false,
  524. tabVal: 'insidePlan',
  525. list: [],
  526. loading: false,
  527. finished: false,
  528. mapShows: false,
  529. typeShow: false,
  530. storeName: '',
  531. timeData: '',
  532. genDate: '',
  533. listActive: null,
  534. query: '',
  535. lat: '',
  536. lon: '',
  537. storeType: '',
  538. endShow: false,
  539. visitEndId: '',
  540. customerVisits: true,
  541. // 筛选模块
  542. showFilter: false,
  543. filterParams: {},
  544. };
  545. },
  546. computed: {
  547. /**
  548. * 计算最大可选日期:当前日期往后推7天
  549. */
  550. maxDate() {
  551. const today = new Date();
  552. const maxYear = today.getFullYear();
  553. const maxMonth = today.getMonth();
  554. const maxDay = today.getDate() + 7;
  555. return new Date(maxYear, maxMonth, maxDay);
  556. }
  557. },
  558. watch: {
  559. $route(to, from) {
  560. if (from.path == '/deviceWithin/index' && to.path == '/storeVisitpage') {
  561. localStorage.setItem('startTime', new Date());
  562. }
  563. },
  564. },
  565. activated() {
  566. this.query = this.$route.query;
  567. this.timeData = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  568. this.storeName = localStorage.getItem('deviveStoreName');
  569. this.getMonth();
  570. // 授权
  571. getTicketFun().then(() => {
  572. this.getUserInPlanList();
  573. });
  574. },
  575. mounted() {
  576. // 解决iOS 上拉边界下拉出现白色空白
  577. let node = document.getElementsByClassName('deviceWithin')[0];
  578. node.addEventListener(
  579. 'touchmove',
  580. (e) => {
  581. if (e._isScroller) return;
  582. e.preventDefault();
  583. },
  584. {
  585. passive: false,
  586. }
  587. );
  588. },
  589. methods: {
  590. closePopup(flag, filterParams) {
  591. this.showFilter = false;
  592. if (flag) {
  593. this.filterParams = filterParams;
  594. this.onSearch();
  595. }
  596. },
  597. searchFn() {
  598. this.showFilter = true;
  599. },
  600. handleTouch(e) {
  601. e._isScroller = true;
  602. },
  603. linkapp(val) {
  604. var poind = this.gcj02BD(val.lat, val.lon);
  605. let url = window.location.href;
  606. let that = this;
  607. let wx = this.wx;
  608. let qiyeData;
  609. const instance = axios.create();
  610. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  611. instance
  612. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  613. params: {
  614. url: url,
  615. agent: 1,
  616. },
  617. })
  618. .then((response) => {
  619. if (response.status == 200) {
  620. qiyeData = response.data.data;
  621. wx.agentConfig({
  622. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  623. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  624. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  625. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  626. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  627. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  628. success: function (res) {
  629. wx.invoke(
  630. 'launchMiniprogram',
  631. {
  632. appid: 'wx238bbb5f6d958414',
  633. path:
  634. 'pages/relayStation/relayStation?latitude=' +
  635. poind.lat +
  636. '&longitude=' +
  637. poind.lon +
  638. '&name=' +
  639. val.addressLine,
  640. },
  641. function (res) {
  642. if (res.err_msg == 'launchMiniprogram:ok') {
  643. } else {
  644. }
  645. }
  646. );
  647. },
  648. fail: function (res) {
  649. if (res.errMsg.indexOf('function not exist') > -1) {
  650. alert('版本过低请升级');
  651. }
  652. },
  653. });
  654. }
  655. });
  656. },
  657. orderFn(val) {
  658. buryingPoint({
  659. systemModel: '计划内',
  660. buryingPointType: 1,
  661. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  662. buryingPointName: '去下单',
  663. buryingPointPosition: '计划内',
  664. });
  665. getOrderUrlByStoreId({
  666. storeId: val.storeId,
  667. from: 'inPlan',
  668. }).then((res) => {
  669. if (res.code == 200 && res.data) {
  670. window.location.href = res.data;
  671. } else {
  672. this.Toast({
  673. message: res.msg,
  674. duration: 5000,
  675. });
  676. }
  677. });
  678. },
  679. linkList(val) {
  680. buryingPoint({
  681. systemModel: '计划内',
  682. buryingPointType: 1,
  683. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  684. buryingPointName: '推荐下单',
  685. buryingPointPosition: '计划内',
  686. });
  687. this.$router.push({
  688. path: '/pItem',
  689. query: {
  690. id: val.storeId,
  691. detilId: 'a',
  692. from: 'inPlan',
  693. storeCode: val.storeCode,
  694. storeName: val.storeName,
  695. showOrderButton: val.showOrderButton,
  696. },
  697. });
  698. },
  699. linkimg(val) {
  700. ProductItemImge({ storeId: val.storeId }).then((response) => {
  701. if (response.code == 200) {
  702. if (response.data != undefined) {
  703. window.open(response.data);
  704. } else {
  705. this.$toast(response.msg);
  706. }
  707. } else {
  708. this.$dialog.alert({
  709. title: '系统提示',
  710. message: res.msg,
  711. });
  712. }
  713. });
  714. },
  715. getMonth() {
  716. // 获取当前日期
  717. var currentDate = new Date();
  718. // 获取当前月份
  719. var currentMonth = currentDate.getMonth();
  720. // 获取当前年份
  721. // var currentYear = currentDate.getFullYear();
  722. var previousMonthDate1 = new Date();
  723. if (currentDate.getDate() == 1) {
  724. previousMonthDate1.setMonth(currentMonth - 1);
  725. } else {
  726. }
  727. var previousMonth1 = previousMonthDate1.getMonth();
  728. var previousYear1 = previousMonthDate1.getFullYear();
  729. // 计算前三个月的年份和月份
  730. var previousMonthDate = new Date();
  731. if (currentDate.getDate() == 1) {
  732. previousMonthDate.setMonth(currentMonth - 3);
  733. } else {
  734. previousMonthDate.setMonth(currentMonth - 2);
  735. }
  736. 1;
  737. var previousMonth = previousMonthDate.getMonth();
  738. var previousYear = previousMonthDate.getFullYear();
  739. //前三个月
  740. if (previousYear1 == previousYear) {
  741. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  742. // 格式化年份和月份
  743. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  744. this.timeData1 =
  745. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  746. } else {
  747. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  748. // .toString().padStart(2, '0');
  749. // 格式化年份和月份
  750. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  751. this.timeData1 = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  752. }
  753. },
  754. Visit(val) {
  755. this.$router.push({
  756. path: '/historicalDetails',
  757. query: {
  758. visitId: val.visitId,
  759. storeId: val.storeId,
  760. storeCode: val.storeCode,
  761. },
  762. });
  763. },
  764. dateeconfirm() {
  765. this.show = false;
  766. this.genDate = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
  767. this.timeData = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
  768. this.getUserInPlanList();
  769. },
  770. dataFn() {
  771. this.genDate = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  772. this.timeData = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  773. this.getUserInPlanList();
  774. },
  775. buryingPointFn(val) {
  776. buryingPoint({
  777. systemModel: '计划内',
  778. buryingPointType: 1,
  779. buryingPointValue: val.telephone,
  780. buryingPointName: '点击电话',
  781. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  782. });
  783. },
  784. getUserInPlanList() {
  785. localStorage.setItem('outvstoreName', '');
  786. localStorage.setItem('outvchainName', '');
  787. localStorage.removeItem('outvstoreLabelTypes');
  788. localStorage.removeItem('outvstoreCategoryList');
  789. localStorage.setItem('outvchainCode', '');
  790. localStorage.setItem('outvstoreName', '');
  791. localStorage.setItem('outvsortType', '');
  792. localStorage.setItem('outsortParam', '');
  793. localStorage.setItem('lat', '');
  794. localStorage.setItem('lon', '');
  795. this.list = [];
  796. var postType = localStorage.getItem('postType');
  797. this.customerVisits = localStorage.getItem('customerVisits');
  798. if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
  799. this.mapShows = false;
  800. } else {
  801. this.mapShows = true;
  802. }
  803. if (postType == 'GZ') {
  804. this.typeShow = false;
  805. } else {
  806. this.typeShow = true;
  807. }
  808. this.storeType = localStorage.getItem('storeType');
  809. this.endShow = false;
  810. this.toastLoading(0, '加载中...', true);
  811. localStorage.removeItem('visitId');
  812. getPosition(true, true)
  813. .then((res) => {
  814. let { TXisBD } = res;
  815. this.getUserInPlanListFun(TXisBD);
  816. })
  817. .catch((error) => {
  818. this.getUserInPlanListFun();
  819. // this.$dialog.alert({
  820. // message: error,
  821. // });
  822. });
  823. },
  824. getUserInPlanListFun(TXisBD) {
  825. getUserInPlanList({
  826. storeName: this.storeName.trim(),
  827. genDate: this.genDate,
  828. lat: TXisBD ? TXisBD.lat : '',
  829. lon: TXisBD ? TXisBD.lon : '',
  830. ...this.filterParams,
  831. }).then((res) => {
  832. this.toastLoading().clear();
  833. if (res.code == 200) {
  834. this.list = res.data;
  835. this.list.forEach((item) => {
  836. if (item.stateString.indexOf('拜访中') != -1) {
  837. this.endShow = true;
  838. this.visitEndId = item.visitId;
  839. return;
  840. }
  841. });
  842. } else {
  843. this.$toast.fail(res.msg);
  844. }
  845. });
  846. },
  847. storeVisit(val) {
  848. if (val.visitSource && val.visitSource == 2) {
  849. this.$toast('请先取消异常拜访后再进入正常拜访!');
  850. return;
  851. }
  852. var that = this;
  853. localStorage.removeItem('visitId');
  854. checkVisit({ storeId: val.storeId }).then((res) => {
  855. // buryingPoint({
  856. // systemModel: '计划内',
  857. // buryingPointType: 1,
  858. // buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  859. // buryingPointName: '进店拜访',
  860. // buryingPointPosition: '计划内',
  861. // });
  862. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  863. if (localStorage.getItem('loginType') == 'cs') {
  864. var lat = '';
  865. var lon = '';
  866. if (val.lat == '' || val.lat == null) {
  867. lat = '31.2517820000';
  868. lon = '120.5593090000';
  869. } else {
  870. lat = val.lat;
  871. lon = val.lon;
  872. }
  873. this.$router.push({
  874. path: '/storeVisitpage',
  875. query: {
  876. storeId: val.storeId,
  877. rdId: val.rdId,
  878. lat: lat,
  879. lon: lon,
  880. visitId: val.visitId,
  881. pageType: 'out',
  882. addressLine: val.addressLine,
  883. storeCategory: val.storeCategory,
  884. storeName: val.storeName,
  885. hisTime: val.hisTime,
  886. contactName: val.contactName,
  887. storeCode: val.storeCode,
  888. tabVal: this.tabVal,
  889. visitModel: '1',
  890. latNew: '31.2517820000',
  891. lonNew: '120.5593090000',
  892. PointSum: 0,
  893. marklat: lat,
  894. marklon: lon,
  895. from: 'inPlan',
  896. },
  897. });
  898. localStorage.setItem('startTime', new Date());
  899. localStorage.setItem('ORGName', val.deptName);
  900. localStorage.setItem('chainNameR', val.storeName);
  901. } else {
  902. if (that.flag) {
  903. that.flag = false;
  904. that.timer = null;
  905. that.timer = setTimeout(() => {
  906. that.flag = true;
  907. }, 2000);
  908. if (val.stateString.indexOf('拜访中') != -1) {
  909. that.$router.push({
  910. path: '/storeVisitpage',
  911. query: {
  912. storeId: val.storeId,
  913. rdId: val.rdId,
  914. lat: val.lat,
  915. lon: val.lon,
  916. visitId: val.visitId,
  917. addressLine: val.addressLine,
  918. storeCategory: val.storeCategory,
  919. storeName: val.storeName,
  920. contactName: val.contactName,
  921. genDate: val.hisTime,
  922. storeCode: val.storeCode,
  923. visitModel: '1',
  924. latNew: val.lat,
  925. lonNew: val.lon,
  926. PointSum: '0',
  927. marklat: val.lat,
  928. marklon: val.lon,
  929. from: 'inPlan',
  930. },
  931. });
  932. localStorage.setItem('startTime', new Date());
  933. localStorage.setItem('ORGName', val.deptName);
  934. localStorage.setItem('chainNameR', val.storeName);
  935. } else {
  936. getPosition()
  937. .then((res) => {
  938. let { TXisBD, resData } = res;
  939. this.lat = TXisBD.lat;
  940. this.lon = TXisBD.lon;
  941. localStorage.setItem('lat', this.lat);
  942. localStorage.setItem('lon', this.lon);
  943. this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
  944. })
  945. .catch((error) => {
  946. this.$dialog.alert({
  947. message: error,
  948. });
  949. });
  950. }
  951. }
  952. }
  953. } else {
  954. this.$dialog.alert({
  955. title: '系统提示',
  956. message: res.msg,
  957. });
  958. }
  959. });
  960. },
  961. checkStoreAddressByStoreCodeFun(val, location, res) {
  962. checkStoreAddressByStoreCode({
  963. storeCode: val.storeCode,
  964. lon: location.lon,
  965. lat: location.lat,
  966. }).then((response) => {
  967. // loading1.clear();
  968. if (val.lat == '' || val.lat == null) {
  969. this.lat = location.lat;
  970. this.lon = location.lon;
  971. }
  972. // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
  973. let PointSumval = this.twoPointSum(
  974. location.lat,
  975. location.lon,
  976. location.lat,
  977. location.lon
  978. ).toFixed(2);
  979. // GZ:工装店铺 直接进入拜访
  980. if (localStorage.getItem('postType') == 'GZ') {
  981. localStorage.setItem('startTime', new Date());
  982. localStorage.setItem('ORGName', val.deptName);
  983. localStorage.setItem('chainNameR', val.storeName);
  984. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  985. return;
  986. }
  987. // 门店校验 地址不通过
  988. if (response.code != 200) {
  989. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  990. if (response.data.updateAddress == 0) {
  991. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  992. this.$dialog
  993. .confirm({
  994. confirmButtonText: '确定拜访',
  995. cancelButtonText: '取消拜访',
  996. title: '系统提示',
  997. message:
  998. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  999. closeOnClickOverlay: true,
  1000. })
  1001. .then(() => {
  1002. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1003. });
  1004. } else if (response.data.updateAddress == 1) {
  1005. // 同城AB+金牌,去修改地址
  1006. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1007. if (!response.data.addressUpdateTimesOver) {
  1008. this.$dialog
  1009. .confirm({
  1010. title: '系统提示',
  1011. message: response.msg + '请立即修改后再拜访',
  1012. messageAlign: 'left',
  1013. confirmButtonText: '立即修改',
  1014. cancelButtonText: '取消',
  1015. })
  1016. .then(() => {
  1017. this.$router.push({
  1018. path: '/storeDetail',
  1019. query: {
  1020. id: val.storeId,
  1021. type: 'address',
  1022. storeAddressId: val.storeAddressId,
  1023. },
  1024. });
  1025. });
  1026. } else {
  1027. this.$dialog.confirm({
  1028. title: '系统提示',
  1029. message: '已经达到最大修改次数',
  1030. messageAlign: 'left',
  1031. confirmButtonText: '确定',
  1032. });
  1033. }
  1034. } else if (response.data.updateAddress == 2) {
  1035. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1036. this.resetCoord(res, val, location, PointSumval);
  1037. return;
  1038. }
  1039. } else {
  1040. // 门店编码校验门店地址通过 进入拜访
  1041. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1042. }
  1043. });
  1044. },
  1045. // 重置经纬度
  1046. resetCoord(res, val, location, PointSumval) {
  1047. this.$dialog
  1048. .confirm({
  1049. confirmButtonText: '初始化定位',
  1050. cancelButtonText: '取消拜访',
  1051. title: '系统提示',
  1052. message: '偏差过大,不允许拜访。可修改本店定位.',
  1053. closeOnClickOverlay: true,
  1054. })
  1055. .then(() => {
  1056. mobileReposition({
  1057. storeId: val.storeId,
  1058. lat: location.lat,
  1059. lon: location.lon,
  1060. }).then((response) => {
  1061. if (response.code == 200) {
  1062. this.$dialog
  1063. .alert({
  1064. title: '系统提示',
  1065. message: '本信息定位已更新成功!',
  1066. })
  1067. .then(() => {
  1068. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1069. });
  1070. localStorage.setItem('startTime', new Date());
  1071. localStorage.setItem('ORGName', val.deptName);
  1072. localStorage.setItem('chainNameR', val.storeName);
  1073. } else {
  1074. this.$toast(response.msg);
  1075. }
  1076. });
  1077. })
  1078. .catch(() => {});
  1079. },
  1080. // 进入拜访 router.push
  1081. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1082. addVisitsPosition({
  1083. storeId: val.storeId,
  1084. visitsId: '',
  1085. lon: res.longitude,
  1086. lat: res.latitude,
  1087. sourceLon: location.lon,
  1088. sourceLat: location.lat,
  1089. positionDesc: '',
  1090. accuracy: res.accuracy,
  1091. }).then(() => {
  1092. this.$router.push({
  1093. path: '/storeVisitpage',
  1094. query: {
  1095. storeId: val.storeId,
  1096. rdId: val.rdId,
  1097. lat: location.lat,
  1098. lon: location.lon,
  1099. visitId: val.visitId,
  1100. addressLine: val.addressLine,
  1101. storeCategory: val.storeCategory,
  1102. storeName: val.storeName,
  1103. contactName: val.contactName,
  1104. genDate: val.hisTime,
  1105. storeCode: val.storeCode,
  1106. visitModel: '1',
  1107. latNew: location.lat,
  1108. lonNew: location.lon,
  1109. PointSum: PointSumval,
  1110. marklat: res.latitude,
  1111. marklon: res.longitude,
  1112. from: 'inPlan',
  1113. },
  1114. });
  1115. });
  1116. },
  1117. projectOutVisit(val) {
  1118. localStorage.setItem('tabVal', this.tabVal);
  1119. localStorage.removeItem('visitId');
  1120. // checkVisit({storeId:val.storeId}).then(res=>{
  1121. // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
  1122. if (localStorage.getItem('loginType') == 'cs') {
  1123. var lat = '';
  1124. var lon = '';
  1125. if (val.lat == '' || val.lat == null) {
  1126. lat = '31.2517820000';
  1127. lon = '120.5593090000';
  1128. } else {
  1129. lat = val.lat;
  1130. lon = val.lon;
  1131. }
  1132. this.$router.push({
  1133. path: '/storeGroup',
  1134. query: {
  1135. storeId: val.storeId,
  1136. rdId: val.rdId,
  1137. lat: lat,
  1138. lon: lon,
  1139. visitId: val.visitId,
  1140. pageType: 'out',
  1141. addressLine: val.addressLine,
  1142. storeCategory: val.storeCategory,
  1143. storeName: val.storeName,
  1144. hisTime: val.hisTime,
  1145. contactName: val.contactName,
  1146. storeCode: val.storeCode,
  1147. tabVal: this.tabVal,
  1148. visitModel: '1',
  1149. latNew: '31.2517820000',
  1150. lonNew: '120.5593090000',
  1151. PointSum: 0,
  1152. marklat: lat,
  1153. marklon: lon,
  1154. },
  1155. });
  1156. localStorage.setItem('startTime', new Date());
  1157. localStorage.setItem('ORGName', val.deptName);
  1158. localStorage.setItem('chainNameR', val.storeName);
  1159. } else {
  1160. if (this.flag) {
  1161. this.flag = false;
  1162. this.timer = null;
  1163. let that = this;
  1164. this.timer = setTimeout(() => {
  1165. this.flag = true;
  1166. }, 2000);
  1167. if (val.stateString.indexOf('拜访中') != -1) {
  1168. localStorage.setItem('startTime', new Date());
  1169. localStorage.setItem('ORGName', val.deptName);
  1170. localStorage.setItem('chainNameR', val.storeName);
  1171. that.$router.push({
  1172. path: '/storeGroup',
  1173. query: {
  1174. storeId: val.storeId,
  1175. rdId: val.rdId,
  1176. lat: val.lat,
  1177. lon: val.lon,
  1178. visitId: val.visitId,
  1179. pageType: 'out',
  1180. addressLine: val.addressLine,
  1181. storeCategory: val.storeCategory,
  1182. storeName: val.storeName,
  1183. hisTime: val.hisTime,
  1184. contactName: val.contactName,
  1185. storeCode: val.storeCode,
  1186. tabVal: that.tabVal,
  1187. visitModel: '1',
  1188. latNew: val.lat,
  1189. lonNew: val.lon,
  1190. PointSum: '0',
  1191. marklat: val.lat,
  1192. marklon: val.lon,
  1193. },
  1194. });
  1195. } else {
  1196. let loading1 = this.$toast.loading({
  1197. duration: 0,
  1198. message: '加载中...',
  1199. forbidClick: true,
  1200. });
  1201. let url = window.location.href;
  1202. let wx = this.wx;
  1203. let qiyeData;
  1204. const instance = axios.create();
  1205. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1206. instance
  1207. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1208. params: {
  1209. url: url,
  1210. },
  1211. })
  1212. .then((response) => {
  1213. if (response.status == 200) {
  1214. this.cont = 3;
  1215. var flat = true;
  1216. var times = setInterval(() => {
  1217. this.cont--;
  1218. if (this.cont == '0') {
  1219. if (flat) {
  1220. loading1.clear();
  1221. clearInterval(times);
  1222. that.$dialog
  1223. .alert({
  1224. message: '定位失败,请开启企微定位权限',
  1225. })
  1226. .then(() => {});
  1227. } else {
  1228. clearInterval(times);
  1229. }
  1230. }
  1231. }, 1000);
  1232. qiyeData = response.data.data;
  1233. wx.config({
  1234. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1235. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1236. appId: qiyeData.appId, // 必填,企业微信的corpID
  1237. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1238. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1239. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1240. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1241. });
  1242. wx.ready(function () {
  1243. wx.getLocation({
  1244. type: 'gcj02',
  1245. success: function (res) {
  1246. flat = false;
  1247. loading1.clear();
  1248. var location = that.CJ02BD(res.latitude, res.longitude);
  1249. if (val.lat == '' || val.lat == null) {
  1250. that.lat = location.lat;
  1251. that.lon = location.lon;
  1252. }
  1253. let PointSum = that
  1254. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1255. .toFixed(2);
  1256. if (val.lat == '' || val.lat == null) {
  1257. if (localStorage.getItem('postType') != 'GZ') {
  1258. that.$dialog
  1259. .confirm({
  1260. confirmButtonText: '确定拜访',
  1261. cancelButtonText: '取消拜访',
  1262. title: '系统提示',
  1263. message:
  1264. '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
  1265. closeOnClickOverlay: true,
  1266. })
  1267. .then(() => {
  1268. that.$router.push({
  1269. path: '/storeGroup',
  1270. query: {
  1271. storeId: val.storeId,
  1272. rdId: val.rdId,
  1273. lat: that.lat,
  1274. lon: that.lon,
  1275. visitId: val.visitId,
  1276. pageType: 'out',
  1277. addressLine: val.addressLine,
  1278. storeCategory: val.storeCategory,
  1279. storeName: val.storeName,
  1280. contactName: val.contactName,
  1281. hisTime: val.hisTime,
  1282. storeCode: val.storeCode,
  1283. tabVal: that.tabVal,
  1284. visitModel: '1',
  1285. latNew: location.lat,
  1286. lonNew: location.lon,
  1287. PointSum: PointSum,
  1288. marklat: res.latitude,
  1289. marklon: res.longitude,
  1290. },
  1291. });
  1292. });
  1293. } else {
  1294. that.$router.push({
  1295. path: '/storeGroup',
  1296. query: {
  1297. storeId: val.storeId,
  1298. rdId: val.rdId,
  1299. lat: that.lat,
  1300. lon: that.lon,
  1301. visitId: val.visitId,
  1302. pageType: 'out',
  1303. addressLine: val.addressLine,
  1304. storeCategory: val.storeCategory,
  1305. storeName: val.storeName,
  1306. contactName: val.contactName,
  1307. hisTime: val.hisTime,
  1308. storeCode: val.storeCode,
  1309. tabVal: that.tabVal,
  1310. visitModel: '1',
  1311. latNew: location.lat,
  1312. lonNew: location.lon,
  1313. PointSum: PointSum,
  1314. marklat: res.latitude,
  1315. marklon: res.longitude,
  1316. },
  1317. });
  1318. }
  1319. } else {
  1320. that.$router.push({
  1321. path: '/storeGroup',
  1322. query: {
  1323. storeId: val.storeId,
  1324. rdId: val.rdId,
  1325. lat: that.lat,
  1326. lon: that.lon,
  1327. visitId: val.visitId,
  1328. pageType: 'out',
  1329. addressLine: val.addressLine,
  1330. storeCategory: val.storeCategory,
  1331. storeName: val.storeName,
  1332. contactName: val.contactName,
  1333. hisTime: val.hisTime,
  1334. storeCode: val.storeCode,
  1335. tabVal: that.tabVal,
  1336. visitModel: '1',
  1337. latNew: location.lat,
  1338. lonNew: location.lon,
  1339. PointSum: PointSum,
  1340. marklat: res.latitude,
  1341. marklon: res.longitude,
  1342. },
  1343. });
  1344. }
  1345. localStorage.setItem('startTime', new Date());
  1346. localStorage.setItem('ORGName', val.deptName);
  1347. localStorage.setItem('chainNameR', val.storeName);
  1348. addVisitsPosition({
  1349. storeId: val.storeId,
  1350. visitsId: '',
  1351. lon: res.longitude,
  1352. lat: res.latitude,
  1353. sourceLon: location.lon,
  1354. sourceLat: location.lat,
  1355. positionDesc: '',
  1356. accuracy: res.accuracy,
  1357. });
  1358. },
  1359. fail: function () {
  1360. loading1.clear();
  1361. that.$dialog.alert({
  1362. message: 'GPS未开启',
  1363. });
  1364. },
  1365. });
  1366. });
  1367. wx.error(function (res) {
  1368. loading1.clear();
  1369. that.$dialog
  1370. .alert({
  1371. message: '定位失败,请开启企微定位权限',
  1372. })
  1373. .then(() => {});
  1374. });
  1375. }
  1376. });
  1377. }
  1378. }
  1379. }
  1380. // }
  1381. // })
  1382. },
  1383. abnormalVisit(val) {
  1384. localStorage.removeItem('visitId');
  1385. checkVisit({ storeId: val.storeId }).then((res) => {
  1386. buryingPoint({
  1387. systemModel: '计划内',
  1388. buryingPointType: 1,
  1389. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1390. buryingPointName: '异常拜访',
  1391. buryingPointPosition: '计划内',
  1392. });
  1393. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1394. if (localStorage.getItem('loginType') == 'cs') {
  1395. var lat = '';
  1396. var lon = '';
  1397. if (val.lat == '' || val.lat == null) {
  1398. lat = '31.2517820000';
  1399. lon = '120.5593090000';
  1400. } else {
  1401. lat = val.lat;
  1402. lon = val.lon;
  1403. }
  1404. this.$router.push({
  1405. path: '/abnormalVisit',
  1406. query: {
  1407. storeId: val.storeId,
  1408. rdId: val.rdId,
  1409. lat: lat,
  1410. lon: lon,
  1411. visitId: val.visitId,
  1412. pageType: 'out',
  1413. addressLine: val.addressLine,
  1414. storeCategory: val.storeCategory,
  1415. storeName: val.storeName,
  1416. hisTime: val.hisTime,
  1417. contactName: val.contactName,
  1418. storeCode: val.storeCode,
  1419. tabVal: this.tabVal,
  1420. visitModel: '3',
  1421. latNew: '31.2517820000',
  1422. lonNew: '120.5593090000',
  1423. PointSum: 0,
  1424. marklat: lat,
  1425. marklon: lon,
  1426. },
  1427. });
  1428. localStorage.setItem('startTime', new Date());
  1429. localStorage.setItem('ORGName', val.deptName);
  1430. localStorage.setItem('chainNameR', val.storeName);
  1431. } else {
  1432. getPosition()
  1433. .then((res) => {
  1434. let { TXisBD, resData } = res;
  1435. this.lat = TXisBD.lat;
  1436. this.lon = TXisBD.lon;
  1437. localStorage.setItem('lat', this.lat);
  1438. localStorage.setItem('lon', this.lon);
  1439. console.log('异常拜访=' + this.lat);
  1440. console.log('异常拜访=' + this.lon);
  1441. let PointSum = this.twoPointSum(
  1442. TXisBD.lat,
  1443. TXisBD.lon,
  1444. TXisBD.lat,
  1445. TXisBD.lon
  1446. ).toFixed(2);
  1447. this.$router.push({
  1448. path: '/abnormalVisit',
  1449. query: {
  1450. storeId: val.storeId,
  1451. rdId: val.rdId,
  1452. lat: this.lat,
  1453. lon: this.lon,
  1454. visitModel: localStorage.getItem('postType') != 'GZ' ? '5' : '3',
  1455. visitId: val.visitId,
  1456. genDate: val.genDate,
  1457. storeCode: val.storeCode,
  1458. latNew: location.lat,
  1459. lonNew: location.lon,
  1460. PointSum: PointSum,
  1461. marklat: resData.latitude,
  1462. marklon: resData.longitude,
  1463. },
  1464. });
  1465. localStorage.setItem('startTime', new Date());
  1466. localStorage.setItem('ORGName', val.deptName);
  1467. localStorage.setItem('chainNameR', val.storeName);
  1468. addVisitsPosition({
  1469. storeId: val.storeId,
  1470. visitsId: '',
  1471. lon: resData.longitude,
  1472. lat: resData.latitude,
  1473. sourceLon: location.lon,
  1474. sourceLat: location.lat,
  1475. positionDesc: '',
  1476. accuracy: resData.accuracy,
  1477. });
  1478. })
  1479. .catch((error) => {
  1480. this.$dialog.alert({
  1481. message: error,
  1482. });
  1483. });
  1484. }
  1485. } else {
  1486. this.$dialog.alert({
  1487. title: '系统提示',
  1488. message: res.msg,
  1489. });
  1490. }
  1491. });
  1492. },
  1493. compareDate(dateTime1) {
  1494. var formatDate1 = Date.parse(dateTime1);
  1495. var formatDate2 = Date.parse(this.parseTime(new Date(), '{yy}-{mm}-{dd}'));
  1496. if (formatDate1 == formatDate2) {
  1497. return true;
  1498. } else {
  1499. return false;
  1500. }
  1501. },
  1502. visitFn(val) {
  1503. buryingPoint({
  1504. systemModel: '计划内',
  1505. buryingPointType: 1,
  1506. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1507. buryingPointName: '客户信息',
  1508. buryingPointPosition: '计划内',
  1509. });
  1510. if (val.sfaStoreType.type == 'qzd') {
  1511. // 竞品店/潜在店
  1512. this.$router.push({
  1513. path: '/competingStoresDetail',
  1514. query: { id: val.storeId },
  1515. });
  1516. } else if (/^FSQ/.test(val.storeCode)) {
  1517. // FSQ 仿石漆服务商
  1518. this.$router.push({
  1519. path: '/FSQStoreDetail',
  1520. query: { id: val.storeId },
  1521. });
  1522. return;
  1523. } else if (val.designerStore) {
  1524. // designerStore 是否为设计师招募门店,true-是,false-否
  1525. this.$router.push({
  1526. path: '/addDesignerDetail',
  1527. query: { id: val.storeId },
  1528. });
  1529. return;
  1530. } else {
  1531. this.$router.push({
  1532. path: '/storeDetail',
  1533. query: { id: val.storeId, detilId: 'a' },
  1534. });
  1535. }
  1536. },
  1537. goFn() {
  1538. this.$router.push({
  1539. path: '/topStore',
  1540. });
  1541. },
  1542. formLink() {
  1543. this.$router.push('/storeVisit/questions');
  1544. },
  1545. onClickLeft() {
  1546. this.$router.go(-1);
  1547. },
  1548. onSearch() {
  1549. localStorage.setItem('deviveStoreName', this.storeName);
  1550. this.getUserInPlanList();
  1551. },
  1552. handelChange(date) {
  1553. var dateF = this.parseTime(date.$d, '{yy}-{mm}-{dd}');
  1554. this.timeData = dateF;
  1555. this.genDate = dateF;
  1556. this.getUserInPlanList();
  1557. },
  1558. onLoad() {
  1559. this.getUserInPlanList();
  1560. },
  1561. listClick(val) {
  1562. this.listActive = val;
  1563. },
  1564. setStroeNameStyle(item) {
  1565. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  1566. if (
  1567. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  1568. item.approvalStatus == null ||
  1569. item.approvalStatus == 0
  1570. ) {
  1571. return {};
  1572. } else {
  1573. return { color: '#0057ba', 'text-decoration': 'underline' };
  1574. }
  1575. },
  1576. // 跳转好帮手门店详情
  1577. goOtherSystem(item) {
  1578. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  1579. if (
  1580. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  1581. item.approvalStatus == null ||
  1582. item.approvalStatus == 0
  1583. ) {
  1584. return false;
  1585. }
  1586. if (item.storeCode) {
  1587. window.location.href =
  1588. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
  1589. } else {
  1590. this.$dialog.alert({
  1591. message: '缺少门店code',
  1592. });
  1593. }
  1594. },
  1595. },
  1596. };
  1597. </script>
  1598. <style lang="scss">
  1599. .van-dialog__confirm,
  1600. .van-dialog__confirm:active {
  1601. color: #0057ba;
  1602. }
  1603. .searchDiv {
  1604. .van-search {
  1605. background: #fff;
  1606. }
  1607. .van-search__action {
  1608. font-size: 14px;
  1609. color: #0057ba;
  1610. font-weight: bold;
  1611. background: #f1f1f1;
  1612. border-bottom-right-radius: 60px;
  1613. border-top-right-radius: 60px;
  1614. border: 1px solid #c1c1c1;
  1615. padding: 0 20px;
  1616. }
  1617. .van-search--show-action {
  1618. padding-right: 12px;
  1619. }
  1620. .van-search__content {
  1621. border: 1px solid #c1c1c1;
  1622. border-bottom-left-radius: 60px;
  1623. border-top-left-radius: 60px;
  1624. background: #f1f1f1;
  1625. border-right: 0;
  1626. }
  1627. }
  1628. </style>
  1629. <style lang="scss" scoped>
  1630. .bgcolor {
  1631. background-color: #f5f5f5;
  1632. }
  1633. .container {
  1634. padding-bottom: 50px;
  1635. }
  1636. .monthNow {
  1637. height: 48px;
  1638. line-height: 48px;
  1639. text-align: center;
  1640. font-weight: bold;
  1641. padding: 0 15px;
  1642. box-sizing: border-box;
  1643. background-color: #f5f5f5;
  1644. font-size: 16px;
  1645. .CalendarIcon {
  1646. font-size: 24px;
  1647. color: #0057ba;
  1648. position: relative;
  1649. top: 6px;
  1650. margin-left: 10px;
  1651. }
  1652. }
  1653. .card {
  1654. padding: 10px 16px;
  1655. box-sizing: border-box;
  1656. .title {
  1657. font-size: 15px;
  1658. font-weight: bold;
  1659. color: #333;
  1660. line-height: 22px;
  1661. padding-right: 52px;
  1662. /*word-break: break-all;*/
  1663. .JPABC {
  1664. width: 20px;
  1665. position: relative;
  1666. top: 4px;
  1667. margin-right: 3px;
  1668. }
  1669. .statusIcon {
  1670. padding: 3px;
  1671. font-size: 12px;
  1672. margin: 0 3px;
  1673. color: #fff;
  1674. display: inline-block;
  1675. height: 20px;
  1676. line-height: 16px;
  1677. vertical-align: -1px;
  1678. }
  1679. .submit {
  1680. background: #ffba13;
  1681. }
  1682. .noSubmit {
  1683. background: #f11818;
  1684. }
  1685. }
  1686. .info {
  1687. font-size: 14px;
  1688. color: #909090;
  1689. line-height: 26px;
  1690. }
  1691. }
  1692. .navBarTOP {
  1693. position: fixed;
  1694. width: 100%;
  1695. z-index: 2;
  1696. top: 0;
  1697. }
  1698. .cellcontent .centerBtn {
  1699. margin: 0 auto 10px;
  1700. display: block;
  1701. width: 92%;
  1702. border-radius: 5px;
  1703. color: #0057ba;
  1704. border: 1px solid #0057ba;
  1705. }
  1706. .cellcontent .centerBtn1 {
  1707. background-color: #0057ba;
  1708. color: #fff;
  1709. }
  1710. .btnbox {
  1711. padding-top: 14px;
  1712. border-top: 1px solid #eee;
  1713. margin: 0 10px;
  1714. }
  1715. .cellcontent .centerBtn2 {
  1716. margin: 0 auto 10px;
  1717. display: block;
  1718. width: 92%;
  1719. color: #0057ba;
  1720. border-radius: 5px;
  1721. padding: 0;
  1722. }
  1723. .statstext {
  1724. background-color: #0057ba;
  1725. position: absolute;
  1726. right: 0;
  1727. top: 6px;
  1728. padding: 2px 6px 2px 12px;
  1729. border-bottom-left-radius: 60px;
  1730. border-top-left-radius: 60px;
  1731. color: #fff;
  1732. }
  1733. .lineGrey {
  1734. height: 10px;
  1735. width: 100%;
  1736. background: #f1f1f1;
  1737. }
  1738. .cellcontent .van-cell {
  1739. padding: 10px 0;
  1740. }
  1741. .statstext .van-icon__image {
  1742. height: 0.7em;
  1743. }
  1744. .visitStoreIco {
  1745. float: left;
  1746. float: left;
  1747. width: 26px;
  1748. text-align: center;
  1749. background-color: #ffba13;
  1750. color: #fff;
  1751. border-radius: 100%;
  1752. margin-left: 14px;
  1753. line-height: 26px;
  1754. height: 26px;
  1755. }
  1756. .tipsTitle {
  1757. padding: 5px 0;
  1758. text-align: center;
  1759. font-size: 16px;
  1760. font-weight: 600;
  1761. }
  1762. .deviceWithin {
  1763. height: 100%;
  1764. width: 100%;
  1765. display: flex;
  1766. flex-direction: column;
  1767. overflow: hidden;
  1768. .content {
  1769. flex: 1;
  1770. overflow-y: auto;
  1771. }
  1772. .tabBar {
  1773. height: 50px;
  1774. }
  1775. .JPVisitNum {
  1776. position: relative;
  1777. top: -26px;
  1778. font-size: 10px;
  1779. }
  1780. .TCFXListItem {
  1781. display: inline-block;
  1782. border: 1px solid #ccc;
  1783. padding: 3px 5px;
  1784. margin: 0 5px;
  1785. border-radius: 6px;
  1786. }
  1787. }
  1788. </style>