topStore.vue 108 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949
  1. <template>
  2. <div class="bgcolor topStore">
  3. <div class="navBarTOP">
  4. <!-- 顶部条-->
  5. <van-nav-bar class="navBar" title="高销额门店推荐" left-arrow @click-left="onClickLeft">
  6. <template #right>
  7. <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
  8. </template>
  9. </van-nav-bar>
  10. <div class="searchDiv searchDivcs">
  11. <van-row v-if="showAll && showKM">
  12. <van-col span="16">
  13. <van-search
  14. v-model="storeName"
  15. left-icon="search"
  16. show-action
  17. placeholder="搜索名称/编号/地址"
  18. @clear="clearFn">
  19. <template #action>
  20. <div @click="onSearchm">搜索</div>
  21. </template>
  22. </van-search>
  23. </van-col>
  24. <van-col span="8">
  25. <div
  26. style="
  27. line-height: 36px;
  28. margin: 8px;
  29. margin-right: 0;
  30. text-align: center;
  31. border-radius: 6px;
  32. color: #0057ba;
  33. background-color: #fff;
  34. font-size: 14px;
  35. border: 1px solid #0057ba;
  36. "
  37. @click="jionAll">
  38. 加入计划内
  39. </div>
  40. </van-col>
  41. </van-row>
  42. <van-row v-if="!showAll || !showKM">
  43. <van-col span="24">
  44. <van-search
  45. v-model="storeName"
  46. left-icon="search"
  47. show-action
  48. placeholder="搜索名称/编号/地址"
  49. @clear="clearFn">
  50. <template #action>
  51. <div @click="onSearchm">搜索</div>
  52. </template>
  53. </van-search>
  54. </van-col>
  55. </van-row>
  56. </div>
  57. <van-dropdown-menu active-color="#0057ba">
  58. <van-dropdown-item v-model="value1" :options="option1" @change="v1Fn" />
  59. <van-dropdown-item v-model="value2" :options="option2" @change="v2Fn" />
  60. <van-dropdown-item v-model="value3" :options="option3" @change="v3Fn" />
  61. </van-dropdown-menu>
  62. </div>
  63. <!-- 主体内容-->
  64. <div style="height: 154px"></div>
  65. <van-notice-bar v-if="!showKM" color="#444" background="#f5f5f5" left-icon="info-o">
  66. 附近20KM内门店。
  67. </van-notice-bar>
  68. <div class="container">
  69. <van-list
  70. class="myList"
  71. v-model="loading"
  72. :finished="finished"
  73. @load="onLoad"
  74. finished-text="--已经到底了--">
  75. <van-checkbox-group v-model="radio">
  76. <div class="cellcontent" v-for="(item, index) in list" :key="index">
  77. <van-cell>
  78. <div class="card">
  79. <div class="title titlero">
  80. <template v-if="item.storeLabels">
  81. <!-- 金牌店ABC -->
  82. <img
  83. class="JPABC"
  84. :src="require('@/assets/Icon/JPA.png')"
  85. v-if="item.storeLabels.jpA" />
  86. <img
  87. class="JPABC"
  88. :src="require('@/assets/Icon/JPB.png')"
  89. v-if="item.storeLabels.jpB" />
  90. <img
  91. class="JPABC"
  92. :src="require('@/assets/Icon/JPC.png')"
  93. v-if="item.storeLabels.jpC" />
  94. </template>
  95. <span class="btn" :data-clipboard-text="item.storeCode">
  96. <span>{{ item.storeName }}</span>
  97. (<span style="color: #0057ba">{{ item.storeCode }}</span
  98. >)
  99. <van-icon
  100. :name="paste"
  101. color="#ee0a24"
  102. size="20"
  103. style="top: 6px; margin-left: 4px" />
  104. </span>
  105. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  106. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  107. <template v-if="item.approvalStatus == 0">
  108. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
  109. >已提交</span
  110. >
  111. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  112. >未提交</span
  113. >
  114. </template>
  115. </div>
  116. <div class="info" style="position: relative">
  117. 联系人:{{ item.contactName }}
  118. <div style="position: absolute; bottom: 0px; right: 0px">
  119. <!-- 金牌店ABC -->
  120. <!-- <el-popover
  121. popper-class="zpover"
  122. placement="bottom"
  123. width="120"
  124. trigger="click"
  125. :content="setJPABCContent(item)">
  126. <div
  127. v-if="setJPABCFlag(item)"
  128. class="visitStoreIco"
  129. style="background-color: #fff"
  130. slot="reference">
  131. <van-icon :name="require('@/assets/Icon/visitJPNum.png')" size="26" />
  132. <div class="JPVisitNum">{{ item.visitNum }}/{{ item.needVisitNum }}</div>
  133. </div>
  134. </el-popover> -->
  135. <el-popover
  136. popper-class="zpover"
  137. placement="bottom"
  138. width="120"
  139. trigger="click"
  140. content="该客户为凤凰客户">
  141. <div
  142. v-if="item.storeLabels.fhCustomer"
  143. class="visitStoreIco"
  144. style="background-color: #fff"
  145. slot="reference">
  146. <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
  147. </div>
  148. </el-popover>
  149. <el-popover
  150. popper-class="zpover zpover6"
  151. placement="bottom-start"
  152. trigger="click">
  153. <div>
  154. <p>
  155. 本店{{ timeData }}下单SKU数:<a
  156. @click="linkList(item)"
  157. style="text-decoration: underline"
  158. >点击查看</a
  159. >
  160. </p>
  161. </div>
  162. <div
  163. class="visitStoreIco"
  164. v-if="item.storeLabels.zysslNums"
  165. style="background-color: #fff; position: relative"
  166. slot="reference">
  167. <p
  168. style="
  169. width: 100%;
  170. position: absolute;
  171. z-index: 1;
  172. top: 0.2px;
  173. width: 22px;
  174. margin: 0;
  175. margin-left: 3.6px;
  176. text-align: center;
  177. font-size: 12px;
  178. ">
  179. {{ item.storeLabels.zysslNums }}
  180. </p>
  181. <van-icon :name="ord" size="26" />
  182. </div>
  183. </el-popover>
  184. <el-popover
  185. popper-class="zpover"
  186. placement="bottom"
  187. width="200"
  188. trigger="click">
  189. <div v-if="item.storeLabels">
  190. <p>已参加:</p>
  191. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
  192. {{ tt }}
  193. </p>
  194. </div>
  195. <div
  196. class="visitStoreIco"
  197. v-if="item.storeLabels.targetOne"
  198. style="background-color: #fff"
  199. slot="reference">
  200. <van-icon :name="targetOne" size="26" />
  201. </div>
  202. </el-popover>
  203. <el-popover
  204. popper-class="zpover"
  205. placement="bottom"
  206. width="120"
  207. trigger="click"
  208. content="调色机5天未联网">
  209. <div
  210. v-if="item.storeLabels.ccmOffline"
  211. class="visitStoreIco"
  212. style="background-color: #fff"
  213. slot="reference">
  214. <van-icon :name="Network" size="26" />
  215. </div>
  216. </el-popover>
  217. <el-popover
  218. popper-class="zpover"
  219. placement="bottom"
  220. width="200"
  221. trigger="click"
  222. content="同城店近60天未下单">
  223. <div
  224. v-if="item.storeLabels.fxNoOrder"
  225. class="visitStoreIco"
  226. style="background-color: #fff"
  227. slot="reference">
  228. <van-icon :name="order60" size="26" />
  229. </div>
  230. </el-popover>
  231. <el-popover
  232. popper-class="zpover"
  233. placement="bottom"
  234. width="200"
  235. trigger="click"
  236. content="本店本月进过专业时时丽">
  237. <div
  238. class="visitStoreIco"
  239. v-if="item.storeLabels.zyssl"
  240. style="background-color: #ed5c68"
  241. slot="reference">
  242. </div>
  243. </el-popover>
  244. <el-popover
  245. popper-class="zpover zpover1"
  246. placement="bottom"
  247. width="200"
  248. trigger="click"
  249. content="本店本月进过超好贴">
  250. <div
  251. v-if="item.storeLabels.chtczj"
  252. class="visitStoreIco"
  253. style="background-color: #0057ba"
  254. slot="reference">
  255. </div>
  256. </el-popover>
  257. <el-popover
  258. placement="bottom"
  259. popper-class="zpover zpover1 zpover1sb"
  260. trigger="click"
  261. :disabled="!item.userVisitTimesMap"
  262. :content="'本店本月已拜访过' + item.storeLabels.visitTimes + '次'">
  263. <div
  264. v-if="
  265. false && item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0
  266. "
  267. class="visitStoreIco"
  268. slot="reference"
  269. style="background-color: #fff; position: relative">
  270. <p
  271. style="
  272. width: 100%;
  273. position: absolute;
  274. z-index: 10;
  275. top: -2px;
  276. margin: 0;
  277. text-align: center;
  278. font-size: 12px;
  279. ">
  280. {{ item.storeLabels.visitTimes }}
  281. </p>
  282. <van-icon :name="ordernum" size="26" />
  283. </div>
  284. <p style="text-align: center; background: #fff; color: #000; padding: 5px 0">
  285. 本店本月己拜访过{{ item.storeLabels.visitTimes }}次
  286. </p>
  287. <p
  288. v-if="item.storeLabels.jpA"
  289. style="text-align: center; background: #fff; color: red; padding: 5px 0">
  290. A级金牌店拜访标准:1月2次
  291. </p>
  292. <el-table :data="item.userVisitTimesMap" border max-height="180px">
  293. <el-table-column label="业务员" prop="userName" />
  294. <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
  295. </el-table>
  296. </el-popover>
  297. </div>
  298. </div>
  299. <div class="info" style="position: relative">
  300. 类型:<span v-if="cstype != 1">{{ item.storeCategory }}</span
  301. ><span v-if="cstype == 1">金牌店</span>&nbsp;
  302. <el-popover
  303. popper-class="zpover zpover6"
  304. placement="bottom-start"
  305. trigger="click">
  306. <div>
  307. <p>
  308. 本店经营品项指导:
  309. <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
  310. </p>
  311. </div>
  312. <van-icon name="question-o" size="18" slot="reference" />
  313. </el-popover>
  314. </div>
  315. <div class="info" @click="buryingPointFn(item)">
  316. 联系电话:<a
  317. style="color: #0057ba; font-weight: bold; text-decoration: underline"
  318. :href="'tel:' + item.telephone"
  319. >{{ item.telephone }}<van-icon name="phone"
  320. /></a>
  321. </div>
  322. <div class="info">地址:{{ item.addressLine }}</div>
  323. <!-- 分销店 -->
  324. <template
  325. v-if="
  326. item.sfaStoreType &&
  327. item.sfaStoreType.type == 'fxd' &&
  328. item.sfaStoreChainsContactList
  329. ">
  330. <div class="info" v-if="typeShow">
  331. 经销商:
  332. <div
  333. class="TCFXListItem"
  334. v-for="(item, index) in item.sfaStoreChainsContactList">
  335. <el-popover
  336. popper-class="zpover zpoverStoreztype"
  337. placement="bottom-start"
  338. trigger="click">
  339. <div>
  340. <div>{{ item.chainCode }}</div>
  341. <div>{{ item.chainName }}</div>
  342. </div>
  343. <div slot="reference" :key="index">
  344. {{ item.categoryDescribe }}
  345. </div>
  346. </el-popover>
  347. </div>
  348. </div>
  349. </template>
  350. <template v-else>
  351. <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
  352. </template>
  353. <div class="info" style="color: #444">
  354. 门店销额(近三个月):¥{{ Micrometer(item.rolling3monthAMT) }}元
  355. <span
  356. v-if="cstype == 1 && index == 0 && value1 == 'b'"
  357. style="float: right; font-weight: bold; color: red">
  358. <img
  359. src="../../assets/Icon/top1.png"
  360. v-if="index == 0"
  361. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  362. >
  363. <span
  364. v-if="cstype == 1 && index == 1 && value1 == 'b'"
  365. style="float: right; font-weight: bold; color: #f4ea2a">
  366. <img
  367. src="../../assets/Icon/top2.png"
  368. v-if="index == 1"
  369. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  370. >
  371. <span
  372. v-if="cstype == 1 && index == 2 && value1 == 'b'"
  373. style="float: right; font-weight: bold; color: #1afa29">
  374. <img
  375. src="../../assets/Icon/top3.png"
  376. v-if="index == 2"
  377. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  378. >
  379. <span
  380. v-if="cstype == 1 && index > 2 && value1 == 'b'"
  381. style="float: right; font-weight: bold">
  382. <img
  383. src="../../assets/Icon/top4.png"
  384. v-if="index > 2"
  385. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  386. >
  387. </div>
  388. <div class="info" style="color: #444">
  389. 最近拜访时间:{{ parseTime(item.hisTime) }}
  390. </div>
  391. <div class="info" style="color: #444">
  392. 最新下单时间:{{ parseTime(item.deliveryDate) }}
  393. </div>
  394. </div>
  395. <div
  396. class="statstext"
  397. v-if="item.joinInPaln && showKM"
  398. style="background-color: #fff; bottom: 70px; right: 14px; top: auto">
  399. <van-checkbox
  400. :name="item.storeId"
  401. shape="square"
  402. style="float: right"></van-checkbox>
  403. </div>
  404. <div
  405. class="statstext"
  406. v-if="item.stateString == '未拜访'"
  407. style="background-color: #ed5c68">
  408. 未拜访
  409. </div>
  410. <div
  411. class="statstext"
  412. v-if="item.stateString == '拜访中'"
  413. style="background-color: white">
  414. <van-icon :name="times" color="#ee0a24" size="32" />
  415. </div>
  416. <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
  417. <div class="btnbox">
  418. <van-row>
  419. <van-col
  420. span="5"
  421. v-if="item.stateString != '已拜访' && customerVisits"
  422. @click="storeVisit(item)">
  423. <img :src="call" style="margin: 0 auto; height: 18px; display: block" />
  424. <p style="text-align: center; margin: 0; font-size: 12px">进入拜访</p>
  425. </van-col>
  426. <van-col
  427. span="5"
  428. v-if="item.storeCategory == '公装经销商'"
  429. @click="projectOutVisit(item)">
  430. <img :src="xmgj" style="margin: 0 auto; height: 18px; display: block" />
  431. <p style="text-align: center; margin: 0; font-size: 12px">项目跟进</p>
  432. <!-- <van-button type="info" size="small" plain class="centerBtn" @click="signAdd(item)">大客户签约</van-button>-->
  433. </van-col>
  434. <van-col
  435. span="5"
  436. v-if="
  437. item.stateString != '已拜访' &&
  438. item.storeCategory != '公装经销商' &&
  439. customerVisits
  440. "
  441. @click="abnormalVisit(item)">
  442. <img :src="yichang" style="margin: 0 auto; height: 18px; display: block" />
  443. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  444. 异常拜访
  445. </p>
  446. </van-col>
  447. <van-col span="4" v-if="item.showOrderButton" @click="orderFn(item)">
  448. <img :src="xiadan" style="margin: 0 auto; height: 18px; display: block" />
  449. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  450. 去下单
  451. </p>
  452. </van-col>
  453. <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
  454. <img :src="bfxx" style="margin: 0 auto; width: 18px; display: block" />
  455. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  456. 拜访信息
  457. </p>
  458. </van-col>
  459. <van-col span="5" @click="visitFn(item)">
  460. <img :src="kehuxinxi" style="margin: 0 auto; height: 18px; display: block" />
  461. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  462. 客户信息
  463. </p>
  464. </van-col>
  465. <van-col span="5" v-if="item.joinInPaln && showKM" @click="storeJoinVisitv(item)">
  466. <img :src="jiarujihua" style="margin: 0 auto; height: 18px; display: block" />
  467. <p style="text-align: center; margin: 0; font-size: 12px">加入计划内</p>
  468. </van-col>
  469. </van-row>
  470. </div>
  471. </van-cell>
  472. <div class="lineGrey"></div>
  473. </div>
  474. </van-checkbox-group>
  475. <van-empty v-if="list.length == 0" />
  476. </van-list>
  477. <br />
  478. <br />
  479. <br />
  480. <br />
  481. <br />
  482. </div>
  483. <van-action-sheet
  484. v-model="showOutPopover"
  485. :actions="actions"
  486. @select="onSelect"
  487. cancel-text="取消"
  488. @cancel="showOutPopover = false" />
  489. <van-popup v-model="showPicker" position="bottom" class="textsize">
  490. <van-row
  491. style="
  492. position: fixed;
  493. top: 0;
  494. width: 100%;
  495. z-index: 998;
  496. background-color: #fff;
  497. border-bottom: 1px solid #ccc;
  498. ">
  499. <van-col span="3" style="text-align: center; margin: 14px 0" @click="showPicker = false">
  500. <van-icon name="cross" size="20" color="#909399" />
  501. </van-col>
  502. <van-col span="13"> </van-col>
  503. <van-col span="4" style="text-align: center; line-height: 36px" @click="onConfirm">
  504. <div style="color: #0057ba">
  505. <van-button type="info" size="small" color="#0057ba">筛选</van-button>
  506. </div></van-col
  507. >
  508. <van-col span="4" style="text-align: center; line-height: 36px" @click="onsets">
  509. <van-button type="default" size="small" style="height: 28px">重置</van-button>
  510. </van-col>
  511. </van-row>
  512. <div style="height: 48px; width: 100%"></div>
  513. <!-- <van-picker show-toolbar :columns="storeTypeLists" value-key="dictLabel" @confirm="onConfirm" @cancel="showPicker = false"/> -->
  514. <div class="searchcheck">
  515. <p class="searchchecktitle">&nbsp;经销商</p>
  516. <van-row>
  517. <van-col span="24">
  518. <div @click="moreTypeShowFn">
  519. <van-field
  520. style="
  521. margin-top: -6px;
  522. border-radius: 6px;
  523. border: 1px solid #ccc;
  524. overflow: hidden;
  525. "
  526. readonly
  527. v-model="chainName"
  528. label=""
  529. placeholder="请选择经销商" />
  530. </div>
  531. </van-col>
  532. <!-- <van-col span="4"><van-button type="default" native-type="button" @click="moreTypeShowclearableFn">清空</van-button></van-col>-->
  533. </van-row>
  534. <p class="searchchecktitle" @click="otherbqShow = !otherbqShow">
  535. &nbsp;门店标签<van-icon name="arrow-down" style="float: right" />
  536. </p>
  537. <van-checkbox-group v-model="storeLabelTypes" direction="horizontal">
  538. <div v-if="otherbqShow" style="width: 100%">
  539. <div class="checkbox" v-for="(item, index) in StoreLabels" :key="index">
  540. <div>
  541. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  542. </div>
  543. </div>
  544. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  545. </div>
  546. </van-checkbox-group>
  547. <van-checkbox-group v-model="result" direction="horizontal">
  548. <p class="searchchecktitle" @click="otherkkdShow = !otherkkdShow">
  549. &nbsp;可控店<van-icon name="arrow-down" style="float: right" />
  550. </p>
  551. <div v-if="otherkkdShow">
  552. <div v-for="(item, index) in storeTypeLists" :key="index" class="checkbox1">
  553. <div v-if="item.groupType == 'kkd'" class="child">
  554. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  555. </div>
  556. </div>
  557. </div>
  558. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  559. <p class="searchchecktitle" @click="otherfxdShow = !otherfxdShow">
  560. &nbsp;分销店<van-icon name="arrow-down" style="float: right" />
  561. </p>
  562. <div v-if="otherfxdShow" style="margin: 0 14px; width: 100%">
  563. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  564. <p class="searchchecktitle1" @click="otherfxdShow1 = !otherfxdShow1">
  565. 金牌店<van-icon name="arrow-down" style="float: right" />
  566. </p>
  567. <div v-if="otherfxdShow1">
  568. <div v-for="(item1, index1) in storeTypeLists" :key="200 + index1" class="checkbox1">
  569. <div v-if="item1.groupType == 'fxd' && item1.remark == 'jp'" class="child">
  570. <van-checkbox :name="item1.dictValue">{{ item1.dictLabel }}</van-checkbox>
  571. </div>
  572. </div>
  573. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  574. </div>
  575. <p class="searchchecktitle1" @click="otherfxdShow2 = !otherfxdShow2">
  576. 同城分销店<van-icon name="arrow-down" style="float: right" />
  577. </p>
  578. <div v-if="otherfxdShow2">
  579. <div
  580. v-for="(itemlj, indexlj) in storeTypeLists"
  581. :key="400 + indexlj"
  582. class="checkbox1">
  583. <div v-if="itemlj.groupType == 'fxd' && itemlj.remark == 'tcfx'" class="child">
  584. <van-checkbox :name="itemlj.dictValue">{{ itemlj.dictLabel }}</van-checkbox>
  585. </div>
  586. </div>
  587. <div style="clear: both"></div>
  588. </div>
  589. </div>
  590. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  591. <p class="searchchecktitle" @click="otherShow = !otherShow">
  592. &nbsp;其他 <van-icon name="arrow-down" style="float: right" />
  593. </p>
  594. <div v-if="otherShow">
  595. <div v-for="(item2, index2) in storeTypeLists" :key="100 + index2" class="checkbox1">
  596. <div v-if="item2.groupType == 'other'" class="child">
  597. <van-checkbox :name="item2.dictValue">{{ item2.dictLabel }}</van-checkbox>
  598. </div>
  599. </div>
  600. </div>
  601. </van-checkbox-group>
  602. </div>
  603. </van-popup>
  604. <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%">
  605. <van-row style="background-color: #f5f5f5">
  606. <van-col span="20">
  607. <van-field
  608. left-icon="search"
  609. style="margin-top: 2px; border-radius: 6px; overflow: hidden"
  610. v-model="CustomerName"
  611. label=""
  612. placeholder="请输入关键词"
  613. clearable />
  614. </van-col>
  615. <van-col span="4" style="text-align: center; line-height: 48px" @click="getCustomer">
  616. <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
  617. >
  618. </van-row>
  619. <van-picker
  620. show-toolbar
  621. :columns="chainsData"
  622. value-key="chainName"
  623. @confirm="onConfirmChainsList"
  624. @cancel="moreTypeShow = false"
  625. visible-item-count="10" />
  626. </van-popup>
  627. <div class="positionContent" @click="rangeStoreFn()">
  628. <van-icon class="img" :name="mpimg" size="50" />
  629. </div>
  630. </div>
  631. </template>
  632. <script>
  633. import {
  634. stopVisit,
  635. checkVisit,
  636. addVisitsPosition,
  637. mobileReposition,
  638. getStoreyslTypeList,
  639. getStoreTypeListlp,
  640. joinInPlan,
  641. getStoreLabels,
  642. getCustomerList,
  643. buryingPoint,
  644. ProductItemImge,
  645. getStoreGroupCategory,
  646. } from '@/api/index';
  647. import times from '@/assets/Icon/times.png';
  648. import order60 from '@/assets/order60.png';
  649. import targetOne from '@/assets/targetOne.png';
  650. import Network from '@/assets/Network.png';
  651. import ordernum from '@/assets/ordernum.png';
  652. import ord from '@/assets/ord.png';
  653. import timeico from '@/assets/Icon/datatims.png';
  654. import location from '@/assets/location.png';
  655. import paste from '@/assets/paste.png';
  656. import visitTimes from '@/assets/visitTimes.png';
  657. import mpimg from '@/assets/mpimg.png';
  658. import axios from 'axios';
  659. import mapmarker from '@/components/mapMarkerDouble';
  660. import order from '@/assets/order.png';
  661. import nocj from '@/assets/nocj.png';
  662. import request from '@/utils/request';
  663. import call from '@/assets/call.png';
  664. import jiarujihua from '@/assets/jiarujihua.png';
  665. import kehuxinxi from '@/assets/kehuxinxi-2.png';
  666. import xiadan from '@/assets/xiadan.png';
  667. import yichang from '@/assets/yichang.png';
  668. import bfxx from '@/assets/bfxx.png';
  669. import xmgj from '@/assets/xmgj.png';
  670. import { getOrderUrlByStoreId, topjoinInPlan, topStore } from '@/api/inventory';
  671. import { parseTime } from '@/utils';
  672. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  673. import sbpmdh from '@/assets/sbpmdh.png';
  674. import { getPosition, getTicketFun } from '@/utils/TXApiFun';
  675. export default {
  676. name: 'outsidelist',
  677. components: { mapmarker },
  678. data() {
  679. return {
  680. xmgj: xmgj,
  681. bfxx: bfxx,
  682. times: times,
  683. searchShows: false,
  684. paste: paste,
  685. visitTimess: visitTimes,
  686. typeShow: false,
  687. mpimg: mpimg,
  688. order: order,
  689. mapShow: false,
  690. yichang: yichang,
  691. xiadan: xiadan,
  692. kehuxinxi: kehuxinxi,
  693. jiarujihua: jiarujihua,
  694. call: call,
  695. otherShow: false,
  696. Network: Network,
  697. order60: order60,
  698. targetOne: targetOne,
  699. chainName: '',
  700. chainCode: '',
  701. activeNames: '1',
  702. showPopover: false,
  703. moreTypeShow: false,
  704. showPopoverVNUM: [],
  705. showPopoverC: [],
  706. showPopoverZ: [],
  707. zyssl: [],
  708. chtczj: [],
  709. noVisit: [],
  710. noOrder: [],
  711. fxNoOrder: [],
  712. storeLabelTypes: [],
  713. // showPopover:false,
  714. location: location,
  715. timeico: timeico,
  716. nocj: nocj,
  717. disabled: false,
  718. timer: null,
  719. flag: true,
  720. show: false,
  721. tabVal: '0',
  722. list: [],
  723. cont: 0,
  724. loading: false,
  725. showPicker: false,
  726. finished: false,
  727. otherbqShow: true,
  728. otherkkdShow: true,
  729. otherfxdShow: true,
  730. typeName: '搜索',
  731. visitEndId: '',
  732. pageSize: 12,
  733. pageNum: 1,
  734. listActive: null,
  735. query: '',
  736. storeName: '',
  737. genDate: '',
  738. storeType: '',
  739. endShow: false,
  740. storeCategory: '',
  741. fromValue: {},
  742. storeTypeList: [],
  743. storeTypeLists: [],
  744. chainsData: [],
  745. serachstype: '',
  746. timeData: '',
  747. addShow1: false,
  748. storeCategoryList: '',
  749. result: [],
  750. StoreLabels: [],
  751. CustomerName: '',
  752. lat: '',
  753. lon: '',
  754. cstype: 0,
  755. title: '计划外',
  756. value1: 'b',
  757. value2: '',
  758. showKM: true,
  759. value3: '',
  760. showOutPopover: false,
  761. actions: [
  762. { name: '周一', id: 1 },
  763. { name: '周二', id: 2 },
  764. { name: '周三', id: 3 },
  765. { name: '周四', id: 4 },
  766. { name: '周五', id: 5 },
  767. { name: '周六', id: 6 },
  768. { name: '周日', id: 7 },
  769. ],
  770. option1: [
  771. { text: '门店销量', value: 'a' },
  772. { text: '门店销量倒序', value: 'b' },
  773. { text: '门店销量正序', value: 'c' },
  774. ],
  775. option2: [
  776. { text: '拜访时间', value: '' },
  777. { text: '拜访时间倒序', value: 'b' },
  778. { text: '拜访时间正序', value: 'c' },
  779. ],
  780. option3: [
  781. { text: '下单时间', value: '' },
  782. { text: '下单时间倒序', value: 'b' },
  783. { text: '下单时间正序', value: 'c' },
  784. ],
  785. radio: [],
  786. sortParam: 'sales',
  787. sortType: 'desc',
  788. storeIds: '',
  789. Jointype: 1,
  790. showAll: false,
  791. ordernum: ordernum,
  792. ord: ord,
  793. customerVisits: true,
  794. otherfxdShow1: true,
  795. otherfxdShow2: true,
  796. };
  797. },
  798. watch: {
  799. $route(to, from) {
  800. if (
  801. (from.path == '/storeDetail' && to.path == '/topStore') ||
  802. (from.path == '/storeGroup' && to.path == '/topStore') ||
  803. (from.path == '/suishenbangOutstoreVisit' && to.path == '/topStore') ||
  804. (from.path == '/outabnormalVisit' && to.path == '/topStore') ||
  805. (from.path == '/home' && to.path == '/topStore') ||
  806. (from.path == '/deviceWithin/index' && to.path == '/topStore') ||
  807. (from.path == '/AI/index' && to.path == '/topStore') ||
  808. (from.path == '/storemanagement/index' && to.path == '/topStore') ||
  809. (from.path == '/My/index' && to.path == '/topStore')
  810. ) {
  811. this.lat = '';
  812. this.onSearch();
  813. var week = new Date().getDay();
  814. if (week > 0 && week < 6) {
  815. this.actions[week - 1].name = '今天';
  816. }
  817. this.radio = [];
  818. // setTimeout(()=>{
  819. // this.onSearch()
  820. // },1000)
  821. }
  822. this.value1 = 'b';
  823. this.value2 = '';
  824. this.value3 = '';
  825. this.storeName = localStorage.getItem('outvstoreName');
  826. this.chainName = localStorage.getItem('outvchainName');
  827. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  828. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  829. } else {
  830. this.storeLabelTypes = [];
  831. }
  832. if (localStorage.getItem('outvstoreCategoryList') != null) {
  833. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  834. this.storeCategoryList = this.result.join(',');
  835. } else {
  836. this.result = [];
  837. this.storeCategoryList = this.result.join(',');
  838. }
  839. this.chainCode = localStorage.getItem('outvchainCode');
  840. this.storeName = localStorage.getItem('outvstoreName');
  841. this.sortType = localStorage.getItem('outvstoreName');
  842. this.sortParam = localStorage.getItem('outvstoreName');
  843. if (this.sortParam != '') {
  844. if (this.sortParam == 'sales') {
  845. if (this.sortType == 'desc') {
  846. this.value1 = 'b';
  847. }
  848. if (this.sortType == 'asc') {
  849. this.value1 = 'c';
  850. }
  851. }
  852. if (this.sortParam == 'visitTime') {
  853. this.value1 = '';
  854. if (this.sortType == 'desc') {
  855. this.value2 = 'b';
  856. }
  857. if (this.sortType == 'asc') {
  858. this.value2 = 'c';
  859. }
  860. }
  861. if (this.sortParam == 'orderTime') {
  862. this.value1 = '';
  863. if (this.sortType == 'desc') {
  864. this.value3 = 'b';
  865. }
  866. if (this.sortType == 'asc') {
  867. this.value3 = 'c';
  868. }
  869. }
  870. }
  871. var postType = localStorage.getItem('postType');
  872. if (postType == 'GZ') {
  873. this.addShow1 = false;
  874. this.otherShow = true;
  875. } else {
  876. this.addShow1 = true;
  877. this.otherShow = false;
  878. }
  879. },
  880. },
  881. created() {
  882. this.value1 = 'b';
  883. this.value2 = '';
  884. this.value3 = '';
  885. this.storeName = localStorage.getItem('outvstoreName');
  886. this.chainName = localStorage.getItem('outvchainName');
  887. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  888. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  889. } else {
  890. this.storeLabelTypes = [];
  891. }
  892. if (localStorage.getItem('outvstoreCategoryList') != null) {
  893. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  894. this.storeCategoryList = this.result.join(',');
  895. } else {
  896. this.result = [];
  897. this.storeCategoryList = this.result.join(',');
  898. }
  899. this.chainCode = localStorage.getItem('outvchainCode');
  900. this.storeName = localStorage.getItem('outvstoreName');
  901. this.sortType = localStorage.getItem('outvstoreName');
  902. this.sortParam = localStorage.getItem('outvstoreName');
  903. if (this.sortParam != '') {
  904. if (this.sortParam == 'sales') {
  905. if (this.sortType == 'desc') {
  906. this.value1 = 'b';
  907. }
  908. if (this.sortType == 'asc') {
  909. this.value1 = 'c';
  910. }
  911. }
  912. if (this.sortParam == 'visitTime') {
  913. this.value1 = '';
  914. if (this.sortType == 'desc') {
  915. this.value2 = 'b';
  916. }
  917. if (this.sortType == 'asc') {
  918. this.value2 = 'c';
  919. }
  920. }
  921. if (this.sortParam == 'orderTime') {
  922. this.value1 = '';
  923. if (this.sortType == 'desc') {
  924. this.value3 = 'b';
  925. }
  926. if (this.sortType == 'asc') {
  927. this.value3 = 'c';
  928. }
  929. }
  930. }
  931. if (localStorage.getItem('tabVal') == null || this.$route.query.info != 'y') {
  932. this.tabVal = '0';
  933. } else {
  934. this.tabVal = localStorage.getItem('tabVal');
  935. }
  936. this.cstype = this.$route.query.type;
  937. this.query = this.$route.query;
  938. localStorage.removeItem('visitId');
  939. this.getStoreTypeList();
  940. this.getStoreLabels();
  941. this.lat = '';
  942. var postType = localStorage.getItem('postType');
  943. if (postType == 'GZ') {
  944. this.addShow1 = false;
  945. this.otherShow = true;
  946. } else {
  947. this.addShow1 = true;
  948. this.otherShow = false;
  949. }
  950. var week = new Date().getDay();
  951. if (week > 0 && week < 6) {
  952. this.actions[week - 1].name = '今天';
  953. }
  954. this.radio = [];
  955. this.onSearch();
  956. this.getMonth();
  957. },
  958. methods: {
  959. setJPABCFlag(item) {
  960. // needVisitNum:需要拜访的次数;visitNum:本月已拜访次数
  961. if (item.storeLabels.jpA && item.visitNum < item.needVisitNum) {
  962. return true;
  963. } else {
  964. return false;
  965. }
  966. },
  967. setJPABCContent(item) {
  968. if (item.storeLabels.jpA) {
  969. return 'A级金牌店拜访标准1月2次';
  970. } else if (item.storeLabels.jpB) {
  971. return 'B级金牌店拜访标准1月1次';
  972. } else if (item.storeLabels.jpC) {
  973. return 'C级金牌店拜访标准1月1次';
  974. } else {
  975. return '';
  976. }
  977. },
  978. linkapp(val) {
  979. var poind = this.gcj02BD(val.lat, val.lon);
  980. let url = window.location.href;
  981. let that = this;
  982. let wx = this.wx;
  983. let qiyeData;
  984. const instance = axios.create();
  985. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  986. instance
  987. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  988. params: {
  989. url: url,
  990. agent: 1,
  991. },
  992. })
  993. .then((response) => {
  994. if (response.status == 200) {
  995. qiyeData = response.data.data;
  996. wx.agentConfig({
  997. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  998. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  999. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1000. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1001. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  1002. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  1003. success: function (res) {
  1004. wx.invoke(
  1005. 'launchMiniprogram',
  1006. {
  1007. appid: 'wx238bbb5f6d958414',
  1008. path:
  1009. 'pages/relayStation/relayStation?latitude=' +
  1010. poind.lat +
  1011. '&longitude=' +
  1012. poind.lon +
  1013. '&name=' +
  1014. val.addressLine,
  1015. },
  1016. function (res) {
  1017. if (res.err_msg == 'launchMiniprogram:ok') {
  1018. } else {
  1019. }
  1020. }
  1021. );
  1022. },
  1023. fail: function (res) {
  1024. if (res.errMsg.indexOf('function not exist') > -1) {
  1025. alert('版本过低请升级');
  1026. }
  1027. },
  1028. });
  1029. }
  1030. });
  1031. },
  1032. clearFn() {
  1033. this.storeName = '';
  1034. localStorage.setItem('outvstoreName', '');
  1035. },
  1036. orderFn(val) {
  1037. this.buryingPoint({
  1038. systemModel: '高销额门店推荐',
  1039. buryingPointType: 1,
  1040. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1041. buryingPointName: '去下单',
  1042. buryingPointPosition: '高销额门店推荐',
  1043. });
  1044. getOrderUrlByStoreId({
  1045. storeId: val.storeId,
  1046. from: 'topStore',
  1047. }).then((res) => {
  1048. if (res.code == 200 && res.data) {
  1049. window.location.href = res.data;
  1050. } else {
  1051. this.Toast({
  1052. message: res.msg,
  1053. duration: 5000,
  1054. });
  1055. }
  1056. });
  1057. },
  1058. linkList(val) {
  1059. this.$router.push({
  1060. path: '/pItem',
  1061. query: { id: val.storeCode, detilId: 'a' },
  1062. });
  1063. },
  1064. linkimg(val) {
  1065. ProductItemImge({ storeId: val.storeId }).then((response) => {
  1066. if (response.code == 200) {
  1067. if (response.data != undefined) {
  1068. window.open(response.data);
  1069. } else {
  1070. this.$toast(response.msg);
  1071. }
  1072. }
  1073. });
  1074. },
  1075. getMonth() {
  1076. // 获取当前日期
  1077. var currentDate = new Date();
  1078. // 获取当前月份
  1079. var currentMonth = currentDate.getMonth();
  1080. // 获取当前年份
  1081. // var currentYear = currentDate.getFullYear();
  1082. var previousMonthDate1 = new Date();
  1083. if (currentDate.getDate() == 1) {
  1084. previousMonthDate1.setMonth(currentMonth - 1);
  1085. } else {
  1086. }
  1087. var previousMonth1 = previousMonthDate1.getMonth();
  1088. var previousYear1 = previousMonthDate1.getFullYear();
  1089. // 计算前三个月的年份和月份
  1090. var previousMonthDate = new Date();
  1091. if (currentDate.getDate() == 1) {
  1092. previousMonthDate.setMonth(currentMonth - 3);
  1093. } else {
  1094. previousMonthDate.setMonth(currentMonth - 2);
  1095. }
  1096. 1;
  1097. var previousMonth = previousMonthDate.getMonth();
  1098. var previousYear = previousMonthDate.getFullYear();
  1099. //前三个月
  1100. if (previousYear1 == previousYear) {
  1101. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  1102. // 格式化年份和月份
  1103. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  1104. this.timeData =
  1105. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  1106. } else {
  1107. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  1108. // .toString().padStart(2, '0');
  1109. // 格式化年份和月份
  1110. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  1111. this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  1112. }
  1113. },
  1114. jionAll() {
  1115. this.Jointype = 2;
  1116. this.showOutPopover = true;
  1117. },
  1118. storeJoinVisitv(val) {
  1119. this.storeIds = val.storeId;
  1120. this.Jointype = 1;
  1121. this.showOutPopover = true;
  1122. },
  1123. onClickLeft() {
  1124. this.$router.replace({ path: '/deviceWithin' });
  1125. },
  1126. onSelect(val) {
  1127. this.showOutPopover = false;
  1128. var storeIds = '';
  1129. if (this.Jointype == 1) {
  1130. storeIds = this.storeIds;
  1131. } else {
  1132. if (this.radio.length > 0) {
  1133. storeIds = this.radio.join(',');
  1134. } else {
  1135. var storeIdsss = [];
  1136. for (var i = 0; i < this.list.length; i++) {
  1137. if (this.list[i].joinInPaln) {
  1138. storeIdsss.push(this.list[i].storeId);
  1139. }
  1140. }
  1141. storeIds = storeIdsss.join(',');
  1142. }
  1143. }
  1144. topjoinInPlan({ storeIds: storeIds, date: val.id }).then((request) => {
  1145. if (request.code == 200) {
  1146. this.$toast.success('加入成功');
  1147. this.onSearch();
  1148. } else {
  1149. this.$toast(res.msg);
  1150. }
  1151. });
  1152. },
  1153. v1Fn(val) {
  1154. this.value3 = '';
  1155. this.value2 = '';
  1156. this.sortParam = 'sales';
  1157. if (val == 'b') {
  1158. this.sortType = 'desc';
  1159. } else {
  1160. this.sortType = 'asc';
  1161. }
  1162. this.onSearchm();
  1163. },
  1164. v2Fn(val) {
  1165. this.value1 = 'a';
  1166. this.value3 = '';
  1167. this.sortParam = 'visitTime';
  1168. if (val == 'b') {
  1169. this.sortType = 'desc';
  1170. } else {
  1171. this.sortType = 'asc';
  1172. }
  1173. this.onSearchm();
  1174. },
  1175. v3Fn(val) {
  1176. this.value1 = 'a';
  1177. this.value2 = '';
  1178. this.sortParam = 'orderTime';
  1179. if (val == 'b') {
  1180. this.sortType = 'desc';
  1181. } else {
  1182. this.sortType = 'asc';
  1183. }
  1184. this.onSearchm();
  1185. },
  1186. // value1
  1187. moreTypeShowFn() {
  1188. this.moreTypeShow = true;
  1189. // this.CustomerName=""
  1190. // this.chainsData=[]
  1191. this.getCustomer();
  1192. },
  1193. buryingPoint(val) {
  1194. buryingPoint(val);
  1195. },
  1196. getCustomer() {
  1197. var name = '';
  1198. if (this.tabVal != 1) {
  1199. name = 'org';
  1200. } else {
  1201. name = 'my';
  1202. }
  1203. getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
  1204. this.chainsData = request.data;
  1205. this.chainsData.push({});
  1206. this.chainsData.pop();
  1207. });
  1208. },
  1209. onConfirmChainsList(value) {
  1210. if (value.chainName != undefined) {
  1211. this.chainName = value.chainName;
  1212. this.chainCode = value.chainCode;
  1213. }
  1214. this.showPickerChainsList = false;
  1215. this.moreTypeShow = false;
  1216. },
  1217. getStoreLabels() {
  1218. getStoreLabels().then((res) => {
  1219. this.StoreLabels = res.data;
  1220. });
  1221. },
  1222. searchType(val) {
  1223. this.storeTypeLists = [];
  1224. if (val != '') {
  1225. let filterArr = this.storeTypeList.filter((item) => {
  1226. return item.dictLabel.toLowerCase().includes(val.toLowerCase());
  1227. });
  1228. this.storeTypeLists = filterArr;
  1229. } else {
  1230. this.storeTypeLists = this.storeTypeList;
  1231. }
  1232. },
  1233. onConfirm(value) {
  1234. this.storeCategoryList = this.result.join(',');
  1235. // this.typeName=value.dictLabel
  1236. this.showPicker = false;
  1237. this.onSearchm();
  1238. },
  1239. moreTypeShowclearableFn() {
  1240. this.chainName = '';
  1241. this.chainCode = '';
  1242. this.chainsData = [];
  1243. },
  1244. onsets() {
  1245. this.result = [];
  1246. this.zyssl = [];
  1247. this.chtczj = [];
  1248. this.noVisit = [];
  1249. this.noOrder = [];
  1250. this.fxNoOrder = [];
  1251. this.storeLabelTypes = [];
  1252. this.storeCategoryList = this.result.join(',');
  1253. this.chainName = '';
  1254. this.chainCode = '';
  1255. // this.typeName=value.dictLabel
  1256. this.onSearch();
  1257. },
  1258. getStoreTypeList() {
  1259. getStoreTypeListlp({}).then((res) => {
  1260. this.storeTypeLists = res.data;
  1261. this.storeTypeList = res.data;
  1262. });
  1263. },
  1264. // 范围
  1265. rangeStoreFn() {
  1266. getPosition()
  1267. .then((res) => {
  1268. let { TXisBD } = res;
  1269. this.lat = TXisBD.lat;
  1270. this.lon = TXisBD.lon;
  1271. this.buryingPoint({
  1272. systemModel: '高销额门店推荐',
  1273. buryingPointType: 3,
  1274. buryingPointValue: '进入地图',
  1275. buryingPointName: '高销额门店推荐',
  1276. buryingPointPosition: '进入地图',
  1277. });
  1278. this.$router.push({
  1279. path: '/rangeStore',
  1280. query: {
  1281. lat: '',
  1282. lon: '',
  1283. tabVal: 6,
  1284. },
  1285. });
  1286. })
  1287. .catch((error) => {
  1288. this.$dialog.alert({
  1289. message: error,
  1290. });
  1291. });
  1292. // let loading1 = this.$toast.loading({
  1293. // duration: 0,
  1294. // message: '加载中...',
  1295. // forbidClick: true,
  1296. // });
  1297. // let url = window.location.href;
  1298. // let wx = this.wx;
  1299. // var that = this;
  1300. // let qiyeData;
  1301. // const instance = axios.create();
  1302. // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1303. // instance
  1304. // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1305. // params: {
  1306. // url: url,
  1307. // },
  1308. // })
  1309. // .then((response) => {
  1310. // if (response.status == 200) {
  1311. // this.cont = 3;
  1312. // var flat = true;
  1313. // var times = setInterval(() => {
  1314. // this.cont--;
  1315. // if (this.cont == '0') {
  1316. // if (flat) {
  1317. // loading1.clear();
  1318. // clearInterval(times);
  1319. // that.$dialog
  1320. // .alert({
  1321. // message: '定位失败,请开启企微定位权限',
  1322. // })
  1323. // .then(() => {});
  1324. // } else {
  1325. // clearInterval(times);
  1326. // }
  1327. // }
  1328. // }, 1000);
  1329. // qiyeData = response.data.data;
  1330. // wx.config({
  1331. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1332. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1333. // appId: qiyeData.appId, // 必填,企业微信的corpID
  1334. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1335. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1336. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1337. // jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1338. // });
  1339. // wx.ready(function () {
  1340. // wx.getLocation({
  1341. // type: 'gcj02',
  1342. // success: function (res) {
  1343. // flat = false;
  1344. // loading1.clear();
  1345. // that.buryingPoint({
  1346. // systemModel: '高销额门店推荐',
  1347. // buryingPointType: 3,
  1348. // buryingPointValue: '进入地图',
  1349. // buryingPointName: '高销额门店推荐',
  1350. // buryingPointPosition: '进入地图',
  1351. // });
  1352. // that.$router.push({
  1353. // path: '/rangeStore',
  1354. // query: {
  1355. // lat: '',
  1356. // lon: '',
  1357. // tabVal: 6,
  1358. // },
  1359. // });
  1360. // },
  1361. // fail: function () {
  1362. // loading1.clear();
  1363. // that.$dialog.alert({
  1364. // message: 'GPS未开启',
  1365. // });
  1366. // },
  1367. // });
  1368. // });
  1369. // wx.error(function (res) {
  1370. // loading1.clear();
  1371. // that.$dialog
  1372. // .alert({
  1373. // message: '定位失败,请开启企微定位权限',
  1374. // })
  1375. // .then(() => {});
  1376. // });
  1377. // }
  1378. // });
  1379. },
  1380. //取消搜索
  1381. cancelSearch() {
  1382. this.$refs.item.toggle();
  1383. },
  1384. storeJoinVisit(val) {
  1385. joinInPlan({ storeId: val.storeId }).then((res) => {
  1386. if (res.code == 200) {
  1387. this.onSearch();
  1388. } else {
  1389. this.$dialog.alert({
  1390. title: '系统提示',
  1391. message: res.msg,
  1392. });
  1393. }
  1394. });
  1395. },
  1396. searchFn() {
  1397. this.showPicker = true;
  1398. this.CustomerName = '';
  1399. },
  1400. moreSearch() {
  1401. this.onSearch();
  1402. this.$refs.item.toggle();
  1403. },
  1404. getUserOutPlaList() {
  1405. this.storeType = localStorage.getItem('storeType');
  1406. this.customerVisits = localStorage.getItem('customerVisits');
  1407. var that = this;
  1408. let loading3 = this.$toast.loading({
  1409. duration: 0,
  1410. message: '加载中...',
  1411. forbidClick: true,
  1412. });
  1413. this.endShow = false;
  1414. if (this.refreshing) {
  1415. this.list = [];
  1416. this.refreshing = false;
  1417. }
  1418. topStore({
  1419. sortParam: this.sortParam,
  1420. sortType: this.sortType,
  1421. lat: that.lat || '',
  1422. lon: that.lon || '',
  1423. chainCode: this.chainCode,
  1424. storeLabelTypes: this.storeLabelTypes.join(','),
  1425. storeCategoryList: this.storeCategoryList,
  1426. storeName: this.storeName.trim(),
  1427. genDate: this.genDate,
  1428. }).then((res) => {
  1429. this.disabled = false;
  1430. if (res.code == 200) {
  1431. loading3.clear();
  1432. this.loading = false;
  1433. if (res.data.storeList != undefined) {
  1434. this.list = res.data.storeList;
  1435. this.showKM = res.data.coverUser;
  1436. this.list.forEach((item) => {
  1437. if (item.stateString.indexOf('拜访中') != -1) {
  1438. this.endShow = true;
  1439. this.visitEndId = item.visitId;
  1440. return;
  1441. }
  1442. });
  1443. res.data.storeList.forEach((item) => {
  1444. this.showPopoverVNUM.push({ showPopover: false });
  1445. this.showPopoverC.push({ showPopover: false });
  1446. this.showPopoverZ.push({ showPopover: false });
  1447. if (item.joinInPaln) {
  1448. this.showAll = true;
  1449. }
  1450. });
  1451. } else {
  1452. this.list = [];
  1453. }
  1454. } else {
  1455. loading3.clear();
  1456. this.$dialog.alert({
  1457. title: '系统提示',
  1458. message: res.msg,
  1459. });
  1460. }
  1461. });
  1462. },
  1463. storeVisit(val) {
  1464. if (val.visitSource && val.visitSource == 2) {
  1465. this.$toast('请先取消异常拜访后再进入正常拜访!');
  1466. return;
  1467. }
  1468. localStorage.setItem('tabVal', this.tabVal);
  1469. localStorage.removeItem('visitId');
  1470. checkVisit({ storeId: val.storeId }).then((res) => {
  1471. this.buryingPoint({
  1472. systemModel: '高销额门店推荐',
  1473. buryingPointType: 1,
  1474. buryingPointValue: '进店拜访',
  1475. buryingPointName: '进店拜访',
  1476. buryingPointPosition: '高销额门店推荐',
  1477. });
  1478. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1479. if (localStorage.getItem('loginType') == 'cs') {
  1480. var lat = '';
  1481. var lon = '';
  1482. if (val.lat == '' || val.lat == null) {
  1483. lat = '31.2517820000';
  1484. lon = '120.5593090000';
  1485. } else {
  1486. lat = val.lat;
  1487. lon = val.lon;
  1488. }
  1489. this.$router.push({
  1490. path: '/suishenbangOutstoreVisit',
  1491. query: {
  1492. storeId: val.storeId,
  1493. rdId: val.rdId,
  1494. lat: lat,
  1495. lon: lon,
  1496. visitId: val.visitId,
  1497. pageType: 'out',
  1498. addressLine: val.addressLine,
  1499. storeCategory: val.storeCategory,
  1500. storeName: val.storeName,
  1501. hisTime: val.hisTime,
  1502. contactName: val.contactName,
  1503. storeCode: val.storeCode,
  1504. tabVal: this.tabVal,
  1505. visitModel: '1',
  1506. latNew: '31.2517820000',
  1507. lonNew: '120.5593090000',
  1508. PointSum: 0,
  1509. marklat: lat,
  1510. marklon: lon,
  1511. linkType: 6,
  1512. from: 'topStore',
  1513. },
  1514. });
  1515. localStorage.setItem('startTime', new Date());
  1516. localStorage.setItem('ORGName', val.deptName);
  1517. localStorage.setItem('chainNameR', val.storeName);
  1518. } else {
  1519. if (this.flag) {
  1520. this.flag = false;
  1521. this.timer = null;
  1522. let that = this;
  1523. this.timer = setTimeout(() => {
  1524. this.flag = true;
  1525. }, 2000);
  1526. if (val.stateString.indexOf('拜访中') != -1) {
  1527. localStorage.setItem('startTime', new Date());
  1528. localStorage.setItem('ORGName', val.deptName);
  1529. localStorage.setItem('chainNameR', val.storeName);
  1530. that.$router.push({
  1531. path: '/suishenbangOutstoreVisit',
  1532. query: {
  1533. storeId: val.storeId,
  1534. rdId: val.rdId,
  1535. lat: val.lat,
  1536. lon: val.lon,
  1537. visitId: val.visitId,
  1538. pageType: 'out',
  1539. addressLine: val.addressLine,
  1540. storeCategory: val.storeCategory,
  1541. storeName: val.storeName,
  1542. hisTime: val.hisTime,
  1543. contactName: val.contactName,
  1544. storeCode: val.storeCode,
  1545. tabVal: that.tabVal,
  1546. visitModel: '1',
  1547. latNew: val.lat,
  1548. lonNew: val.lon,
  1549. PointSum: '0',
  1550. marklat: val.lat,
  1551. marklon: val.lon,
  1552. linkType: 6,
  1553. from: 'topStore',
  1554. },
  1555. });
  1556. } else {
  1557. getPosition()
  1558. .then((res) => {
  1559. let { TXisBD, resData } = res;
  1560. this.lat = TXisBD.lat;
  1561. this.lon = TXisBD.lon;
  1562. localStorage.setItem('lat', this.lat);
  1563. localStorage.setItem('lon', this.lon);
  1564. // var location = this.CJ02BD(res.latitude, res.longitude);
  1565. this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
  1566. })
  1567. .catch((error) => {
  1568. this.$dialog.alert({
  1569. message: error,
  1570. });
  1571. });
  1572. // let loading1 = this.$toast.loading({
  1573. // duration: 0,
  1574. // message: '加载中...',
  1575. // forbidClick: true,
  1576. // });
  1577. // let url = window.location.href;
  1578. // let wx = this.wx;
  1579. // let qiyeData;
  1580. // const instance = axios.create();
  1581. // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1582. // instance
  1583. // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1584. // params: {
  1585. // url: url,
  1586. // },
  1587. // })
  1588. // .then((response) => {
  1589. // if (response.status == 200) {
  1590. // this.cont = 5;
  1591. // var flat = true;
  1592. // var times = setInterval(() => {
  1593. // this.cont--;
  1594. // if (this.cont == '0') {
  1595. // if (flat) {
  1596. // loading1.clear();
  1597. // clearInterval(times);
  1598. // that.$dialog
  1599. // .alert({
  1600. // message: '定位失败,请开启企微定位权限',
  1601. // })
  1602. // .then(() => {});
  1603. // } else {
  1604. // clearInterval(times);
  1605. // }
  1606. // }
  1607. // }, 1000);
  1608. // qiyeData = response.data.data;
  1609. // wx.config({
  1610. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1611. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1612. // appId: qiyeData.appId, // 必填,企业微信的corpID
  1613. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1614. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1615. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1616. // jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1617. // });
  1618. // wx.ready(() => {
  1619. // wx.getLocation({
  1620. // type: 'gcj02',
  1621. // success: (res) => {
  1622. // flat = false;
  1623. // // loading1.clear();
  1624. // var location = that.CJ02BD(res.latitude, res.longitude);
  1625. // checkStoreAddressByStoreCode({
  1626. // storeCode: val.storeCode,
  1627. // lon: location.lon,
  1628. // lat: location.lat,
  1629. // }).then((response) => {
  1630. // loading1.clear();
  1631. // if (val.lat == '' || val.lat == null) {
  1632. // this.lat = location.lat;
  1633. // this.lon = location.lon;
  1634. // } else {
  1635. // this.lat = val.lat;
  1636. // this.lon = val.lon;
  1637. // }
  1638. // let PointSum = this.twoPointSum(
  1639. // this.lat,
  1640. // this.lon,
  1641. // location.lat,
  1642. // location.lon
  1643. // ).toFixed(2);
  1644. // let PointSumval = this.twoPointSum(
  1645. // location.lat,
  1646. // location.lon,
  1647. // location.lat,
  1648. // location.lon
  1649. // ).toFixed(2);
  1650. // // GZ:工装店铺 直接进入拜访
  1651. // if (localStorage.getItem('postType') == 'GZ') {
  1652. // localStorage.setItem('startTime', new Date());
  1653. // localStorage.setItem('ORGName', val.deptName);
  1654. // localStorage.setItem('chainNameR', val.storeName);
  1655. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1656. // return;
  1657. // }
  1658. // // 门店编码校验门店地址不通过
  1659. // if (response.code != 200) {
  1660. // // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1661. // if (response.data.updateAddress == 0) {
  1662. // // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1663. // this.$dialog
  1664. // .confirm({
  1665. // confirmButtonText: '确定拜访',
  1666. // cancelButtonText: '取消拜访',
  1667. // title: '系统提示',
  1668. // message:
  1669. // '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1670. // closeOnClickOverlay: true,
  1671. // })
  1672. // .then(() => {
  1673. // this.toSuishenbangOutstoreVisit(
  1674. // res,
  1675. // val,
  1676. // location,
  1677. // PointSumval
  1678. // );
  1679. // });
  1680. // } else if (response.data.updateAddress == 1) {
  1681. // // 同城AB+金牌,去修改地址
  1682. // // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1683. // if (!response.data.addressUpdateTimesOver) {
  1684. // this.$dialog
  1685. // .confirm({
  1686. // title: '系统提示',
  1687. // message: response.msg + '请立即修改后再拜访',
  1688. // messageAlign: 'left',
  1689. // confirmButtonText: '立即修改',
  1690. // cancelButtonText: '取消',
  1691. // })
  1692. // .then(() => {
  1693. // this.$router.push({
  1694. // path: '/storeDetail',
  1695. // query: {
  1696. // id: val.storeId,
  1697. // type: 'address',
  1698. // storeAddressId: val.storeAddressId,
  1699. // },
  1700. // });
  1701. // });
  1702. // } else {
  1703. // this.$dialog.confirm({
  1704. // title: '系统提示',
  1705. // message: '已经达到最大修改次数',
  1706. // messageAlign: 'left',
  1707. // confirmButtonText: '确定',
  1708. // });
  1709. // }
  1710. // } else if (response.data.updateAddress == 2) {
  1711. // // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1712. // this.resetCoord(res, val, location, PointSumval);
  1713. // return;
  1714. // }
  1715. // } else {
  1716. // // 门店编码校验门店地址通过 进入拜访
  1717. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1718. // }
  1719. // });
  1720. // },
  1721. // fail: function () {
  1722. // loading1.clear();
  1723. // that.$dialog.alert({
  1724. // message: 'GPS未开启',
  1725. // });
  1726. // },
  1727. // });
  1728. // });
  1729. // wx.error(function (error) {
  1730. // loading1.clear();
  1731. // that.$dialog
  1732. // .alert({
  1733. // message: '定位失败,请开启企微定位权限',
  1734. // })
  1735. // .then(() => {});
  1736. // });
  1737. // }
  1738. // });
  1739. }
  1740. }
  1741. }
  1742. } else {
  1743. this.$dialog.alert({
  1744. title: '系统提示',
  1745. message: res.msg,
  1746. });
  1747. }
  1748. });
  1749. },
  1750. checkStoreAddressByStoreCodeFun(val, location, res) {
  1751. checkStoreAddressByStoreCode({
  1752. storeCode: val.storeCode,
  1753. lon: location.lon,
  1754. lat: location.lat,
  1755. }).then((response) => {
  1756. // loading1.clear();
  1757. if (val.lat == '' || val.lat == null) {
  1758. this.lat = location.lat;
  1759. this.lon = location.lon;
  1760. } else {
  1761. this.lat = val.lat;
  1762. this.lon = val.lon;
  1763. }
  1764. // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
  1765. let PointSumval = this.twoPointSum(
  1766. location.lat,
  1767. location.lon,
  1768. location.lat,
  1769. location.lon
  1770. ).toFixed(2);
  1771. // GZ:工装店铺 直接进入拜访
  1772. if (localStorage.getItem('postType') == 'GZ') {
  1773. localStorage.setItem('startTime', new Date());
  1774. localStorage.setItem('ORGName', val.deptName);
  1775. localStorage.setItem('chainNameR', val.storeName);
  1776. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1777. return;
  1778. }
  1779. // 门店校验 地址不通过
  1780. if (response.code != 200) {
  1781. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1782. if (response.data.updateAddress == 0) {
  1783. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1784. this.$dialog
  1785. .confirm({
  1786. confirmButtonText: '确定拜访',
  1787. cancelButtonText: '取消拜访',
  1788. title: '系统提示',
  1789. message:
  1790. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1791. closeOnClickOverlay: true,
  1792. })
  1793. .then(() => {
  1794. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1795. });
  1796. } else if (response.data.updateAddress == 1) {
  1797. // 同城AB+金牌,去修改地址
  1798. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1799. if (!response.data.addressUpdateTimesOver) {
  1800. this.$dialog
  1801. .confirm({
  1802. title: '系统提示',
  1803. message: response.msg + '请立即修改后再拜访',
  1804. messageAlign: 'left',
  1805. confirmButtonText: '立即修改',
  1806. cancelButtonText: '取消',
  1807. })
  1808. .then(() => {
  1809. this.$router.push({
  1810. path: '/storeDetail',
  1811. query: {
  1812. id: val.storeId,
  1813. type: 'address',
  1814. storeAddressId: val.storeAddressId,
  1815. },
  1816. });
  1817. });
  1818. } else {
  1819. this.$dialog.confirm({
  1820. title: '系统提示',
  1821. message: '已经达到最大修改次数',
  1822. messageAlign: 'left',
  1823. confirmButtonText: '确定',
  1824. });
  1825. }
  1826. } else if (response.data.updateAddress == 2) {
  1827. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1828. this.resetCoord(res, val, location, PointSumval);
  1829. return;
  1830. }
  1831. } else {
  1832. // 门店编码校验门店地址通过 进入拜访
  1833. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1834. }
  1835. });
  1836. },
  1837. // 重置经纬度
  1838. resetCoord(res, val, location, PointSumval) {
  1839. this.$dialog
  1840. .confirm({
  1841. confirmButtonText: '初始化定位',
  1842. cancelButtonText: '取消拜访',
  1843. title: '系统提示',
  1844. message: '偏差过大,不允许拜访。可修改本店定位.',
  1845. closeOnClickOverlay: true,
  1846. })
  1847. .then(() => {
  1848. mobileReposition({
  1849. storeId: val.storeId,
  1850. lat: location.lat,
  1851. lon: location.lon,
  1852. }).then((response) => {
  1853. if (response.code == 200) {
  1854. this.$dialog
  1855. .alert({
  1856. title: '系统提示',
  1857. message: '本信息定位已更新成功!',
  1858. })
  1859. .then(() => {
  1860. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1861. });
  1862. localStorage.setItem('startTime', new Date());
  1863. localStorage.setItem('ORGName', val.deptName);
  1864. localStorage.setItem('chainNameR', val.storeName);
  1865. } else {
  1866. this.$toast(response.msg);
  1867. }
  1868. });
  1869. });
  1870. },
  1871. // 进入拜访 router.push
  1872. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1873. addVisitsPosition({
  1874. storeId: val.storeId,
  1875. visitsId: '',
  1876. lon: res.longitude,
  1877. lat: res.latitude,
  1878. sourceLon: location.lon,
  1879. sourceLat: location.lat,
  1880. positionDesc: '',
  1881. accuracy: res.accuracy,
  1882. });
  1883. this.$router.push({
  1884. path: '/suishenbangOutstoreVisit',
  1885. query: {
  1886. storeId: val.storeId,
  1887. rdId: val.rdId,
  1888. lat: location.lat,
  1889. lon: location.lon,
  1890. visitId: val.visitId,
  1891. pageType: 'out',
  1892. addressLine: val.addressLine,
  1893. storeCategory: val.storeCategory,
  1894. storeName: val.storeName,
  1895. hisTime: val.hisTime,
  1896. contactName: val.contactName,
  1897. storeCode: val.storeCode,
  1898. tabVal: this.tabVal,
  1899. visitModel: '1',
  1900. latNew: location.lat,
  1901. lonNew: location.lon,
  1902. PointSum: PointSumval,
  1903. marklat: res.latitude,
  1904. marklon: res.longitude,
  1905. from: 'topStore',
  1906. },
  1907. });
  1908. },
  1909. projectOutVisit(val) {
  1910. localStorage.setItem('tabVal', this.tabVal);
  1911. localStorage.removeItem('visitId');
  1912. // checkVisit({storeId:val.storeId}).then(res=>{
  1913. // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
  1914. if (localStorage.getItem('loginType') == 'cs') {
  1915. var lat = '';
  1916. var lon = '';
  1917. if (val.lat == '' || val.lat == null) {
  1918. lat = '31.2517820000';
  1919. lon = '120.5593090000';
  1920. } else {
  1921. lat = val.lat;
  1922. lon = val.lon;
  1923. }
  1924. this.$router.push({
  1925. path: '/storeGroup',
  1926. query: {
  1927. storeId: val.storeId,
  1928. rdId: val.rdId,
  1929. lat: lat,
  1930. lon: lon,
  1931. visitId: val.visitId,
  1932. pageType: 'out',
  1933. addressLine: val.addressLine,
  1934. storeCategory: val.storeCategory,
  1935. storeName: val.storeName,
  1936. hisTime: val.hisTime,
  1937. contactName: val.contactName,
  1938. storeCode: val.storeCode,
  1939. tabVal: this.tabVal,
  1940. visitModel: '1',
  1941. latNew: '31.2517820000',
  1942. lonNew: '120.5593090000',
  1943. PointSum: 0,
  1944. marklat: lat,
  1945. marklon: lon,
  1946. },
  1947. });
  1948. localStorage.setItem('startTime', new Date());
  1949. localStorage.setItem('ORGName', val.deptName);
  1950. localStorage.setItem('chainNameR', val.storeName);
  1951. } else {
  1952. if (this.flag) {
  1953. this.flag = false;
  1954. this.timer = null;
  1955. let that = this;
  1956. this.timer = setTimeout(() => {
  1957. this.flag = true;
  1958. }, 2000);
  1959. if (val.stateString.indexOf('拜访中') != -1) {
  1960. localStorage.setItem('startTime', new Date());
  1961. localStorage.setItem('ORGName', val.deptName);
  1962. localStorage.setItem('chainNameR', val.storeName);
  1963. that.$router.push({
  1964. path: '/storeGroup',
  1965. query: {
  1966. storeId: val.storeId,
  1967. rdId: val.rdId,
  1968. lat: val.lat,
  1969. lon: val.lon,
  1970. visitId: val.visitId,
  1971. pageType: 'out',
  1972. addressLine: val.addressLine,
  1973. storeCategory: val.storeCategory,
  1974. storeName: val.storeName,
  1975. hisTime: val.hisTime,
  1976. contactName: val.contactName,
  1977. storeCode: val.storeCode,
  1978. tabVal: that.tabVal,
  1979. visitModel: '1',
  1980. latNew: val.lat,
  1981. lonNew: val.lon,
  1982. PointSum: '0',
  1983. marklat: val.lat,
  1984. marklon: val.lon,
  1985. },
  1986. });
  1987. } else {
  1988. let loading1 = this.$toast.loading({
  1989. duration: 0,
  1990. message: '加载中...',
  1991. forbidClick: true,
  1992. });
  1993. let url = window.location.href;
  1994. let wx = this.wx;
  1995. let qiyeData;
  1996. const instance = axios.create();
  1997. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1998. instance
  1999. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2000. params: {
  2001. url: url,
  2002. },
  2003. })
  2004. .then((response) => {
  2005. if (response.status == 200) {
  2006. this.cont = 3;
  2007. var flat = true;
  2008. var times = setInterval(() => {
  2009. this.cont--;
  2010. if (this.cont == '0') {
  2011. if (flat) {
  2012. loading1.clear();
  2013. clearInterval(times);
  2014. that.$dialog
  2015. .alert({
  2016. message: '定位失败,请开启企微定位权限',
  2017. })
  2018. .then(() => {});
  2019. } else {
  2020. clearInterval(times);
  2021. }
  2022. }
  2023. }, 1000);
  2024. qiyeData = response.data.data;
  2025. wx.config({
  2026. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2027. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2028. appId: qiyeData.appId, // 必填,企业微信的corpID
  2029. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2030. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2031. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2032. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2033. });
  2034. wx.ready(function () {
  2035. wx.getLocation({
  2036. type: 'gcj02',
  2037. success: function (res) {
  2038. flat = false;
  2039. loading1.clear();
  2040. var location = that.CJ02BD(res.latitude, res.longitude);
  2041. if (val.lat == '' || val.lat == null) {
  2042. that.lat = location.lat;
  2043. that.lon = location.lon;
  2044. } else {
  2045. that.lat = val.lat;
  2046. that.lon = val.lon;
  2047. }
  2048. let PointSum = that
  2049. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  2050. .toFixed(2);
  2051. if (val.lat == '' || val.lat == null) {
  2052. if (localStorage.getItem('postType') != 'GZ') {
  2053. that.$dialog
  2054. .confirm({
  2055. confirmButtonText: '确定拜访',
  2056. cancelButtonText: '取消拜访',
  2057. title: '系统提示',
  2058. message:
  2059. '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
  2060. closeOnClickOverlay: true,
  2061. })
  2062. .then(() => {
  2063. that.$router.push({
  2064. path: '/storeGroup',
  2065. query: {
  2066. storeId: val.storeId,
  2067. rdId: val.rdId,
  2068. lat: that.lat,
  2069. lon: that.lon,
  2070. visitId: val.visitId,
  2071. pageType: 'out',
  2072. addressLine: val.addressLine,
  2073. storeCategory: val.storeCategory,
  2074. storeName: val.storeName,
  2075. contactName: val.contactName,
  2076. hisTime: val.hisTime,
  2077. storeCode: val.storeCode,
  2078. tabVal: that.tabVal,
  2079. visitModel: '1',
  2080. latNew: location.lat,
  2081. lonNew: location.lon,
  2082. PointSum: PointSum,
  2083. marklat: res.latitude,
  2084. marklon: res.longitude,
  2085. },
  2086. });
  2087. });
  2088. } else {
  2089. that.$router.push({
  2090. path: '/storeGroup',
  2091. query: {
  2092. storeId: val.storeId,
  2093. rdId: val.rdId,
  2094. lat: that.lat,
  2095. lon: that.lon,
  2096. visitId: val.visitId,
  2097. pageType: 'out',
  2098. addressLine: val.addressLine,
  2099. storeCategory: val.storeCategory,
  2100. storeName: val.storeName,
  2101. contactName: val.contactName,
  2102. hisTime: val.hisTime,
  2103. storeCode: val.storeCode,
  2104. tabVal: that.tabVal,
  2105. visitModel: '1',
  2106. latNew: location.lat,
  2107. lonNew: location.lon,
  2108. PointSum: PointSum,
  2109. marklat: res.latitude,
  2110. marklon: res.longitude,
  2111. },
  2112. });
  2113. }
  2114. } else {
  2115. that.$router.push({
  2116. path: '/storeGroup',
  2117. query: {
  2118. storeId: val.storeId,
  2119. rdId: val.rdId,
  2120. lat: that.lat,
  2121. lon: that.lon,
  2122. visitId: val.visitId,
  2123. pageType: 'out',
  2124. addressLine: val.addressLine,
  2125. storeCategory: val.storeCategory,
  2126. storeName: val.storeName,
  2127. contactName: val.contactName,
  2128. hisTime: val.hisTime,
  2129. storeCode: val.storeCode,
  2130. tabVal: that.tabVal,
  2131. visitModel: '1',
  2132. latNew: location.lat,
  2133. lonNew: location.lon,
  2134. PointSum: PointSum,
  2135. marklat: res.latitude,
  2136. marklon: res.longitude,
  2137. },
  2138. });
  2139. }
  2140. localStorage.setItem('startTime', new Date());
  2141. localStorage.setItem('ORGName', val.deptName);
  2142. localStorage.setItem('chainNameR', val.storeName);
  2143. addVisitsPosition({
  2144. storeId: val.storeId,
  2145. visitsId: '',
  2146. lon: res.longitude,
  2147. lat: res.latitude,
  2148. sourceLon: location.lon,
  2149. sourceLat: location.lat,
  2150. positionDesc: '',
  2151. accuracy: res.accuracy,
  2152. });
  2153. },
  2154. fail: function () {
  2155. loading1.clear();
  2156. that.$dialog.alert({
  2157. message: 'GPS未开启',
  2158. });
  2159. },
  2160. });
  2161. });
  2162. wx.error(function (res) {
  2163. loading1.clear();
  2164. that.$dialog
  2165. .alert({
  2166. message: '定位失败,请开启企微定位权限',
  2167. })
  2168. .then(() => {});
  2169. });
  2170. }
  2171. });
  2172. }
  2173. }
  2174. }
  2175. // }
  2176. // })
  2177. },
  2178. abnormalVisit(val) {
  2179. localStorage.removeItem('visitId');
  2180. localStorage.setItem('tabVal', this.tabVal);
  2181. checkVisit({ storeId: val.storeId }).then((res) => {
  2182. this.buryingPoint({
  2183. systemModel: '高销额门店推荐',
  2184. buryingPointType: 1,
  2185. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  2186. buryingPointName: '异常拜访',
  2187. buryingPointPosition: '高销额门店推荐',
  2188. });
  2189. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  2190. if (localStorage.getItem('loginType') == 'cs') {
  2191. var lat = '';
  2192. var lon = '';
  2193. if (val.lat == '' || val.lat == null) {
  2194. lat = '31.2517820000';
  2195. lon = '120.5593090000';
  2196. } else {
  2197. lat = val.lat;
  2198. lon = val.lon;
  2199. }
  2200. this.$router.push({
  2201. path: '/outabnormalVisit',
  2202. query: {
  2203. storeId: val.storeId,
  2204. rdId: val.rdId,
  2205. lat: lat,
  2206. lon: lon,
  2207. visitId: val.visitId,
  2208. pageType: 'out',
  2209. addressLine: val.addressLine,
  2210. storeCategory: val.storeCategory,
  2211. storeName: val.storeName,
  2212. hisTime: val.hisTime,
  2213. contactName: val.contactName,
  2214. storeCode: val.storeCode,
  2215. tabVal: this.tabVal,
  2216. visitModel: '3',
  2217. latNew: '31.2517820000',
  2218. lonNew: '120.5593090000',
  2219. PointSum: 0,
  2220. marklat: lat,
  2221. marklon: lon,
  2222. linkType: 6,
  2223. },
  2224. });
  2225. localStorage.setItem('startTime', new Date());
  2226. localStorage.setItem('ORGName', val.deptName);
  2227. localStorage.setItem('chainNameR', val.storeName);
  2228. } else {
  2229. if (this.flag) {
  2230. this.flag = false;
  2231. this.timer = null;
  2232. this.timer = setTimeout(() => {
  2233. this.flag = true;
  2234. }, 2000);
  2235. let loading1 = this.$toast.loading({
  2236. duration: 0,
  2237. message: '加载中...',
  2238. forbidClick: true,
  2239. });
  2240. let url = window.location.href;
  2241. let that = this;
  2242. let wx = this.wx;
  2243. let qiyeData;
  2244. const instance = axios.create();
  2245. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2246. instance
  2247. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2248. params: {
  2249. url: url,
  2250. },
  2251. })
  2252. .then((response) => {
  2253. if (response.status == 200) {
  2254. this.cont = 3;
  2255. var flat = true;
  2256. var times = setInterval(() => {
  2257. this.cont--;
  2258. if (this.cont == '0') {
  2259. if (flat) {
  2260. loading1.clear();
  2261. clearInterval(times);
  2262. that.$dialog
  2263. .alert({
  2264. message: '定位失败,请开启企微定位权限',
  2265. })
  2266. .then(() => {
  2267. this.$router.go(-1);
  2268. });
  2269. } else {
  2270. clearInterval(times);
  2271. }
  2272. }
  2273. }, 1000);
  2274. qiyeData = response.data.data;
  2275. wx.config({
  2276. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2277. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2278. appId: qiyeData.appId, // 必填,企业微信的corpID
  2279. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2280. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2281. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2282. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2283. });
  2284. wx.ready(function () {
  2285. wx.getLocation({
  2286. type: 'gcj02',
  2287. success: function (res) {
  2288. flat = false;
  2289. loading1.clear();
  2290. var location = that.CJ02BD(res.latitude, res.longitude);
  2291. if (val.lat == '' || val.lat == null) {
  2292. that.lat = location.lat;
  2293. that.lon = location.lon;
  2294. } else {
  2295. that.lat = val.lat;
  2296. that.lon = val.lon;
  2297. }
  2298. let PointSum = that
  2299. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  2300. .toFixed(2);
  2301. if (PointSum > 500 && localStorage.getItem('postType') != 'GZ') {
  2302. that.$dialog
  2303. .confirm({
  2304. confirmButtonText: '确定',
  2305. cancelButtonText: '取消',
  2306. title: '系统提示',
  2307. message: '定位距离偏差大',
  2308. closeOnClickOverlay: true,
  2309. })
  2310. .then(() => {
  2311. that.$router.push({
  2312. path: '/outabnormalVisit',
  2313. query: {
  2314. storeId: val.storeId,
  2315. rdId: val.rdId,
  2316. lat: that.lat,
  2317. lon: that.lon,
  2318. visitId: val.visitId,
  2319. pageType: 'out',
  2320. visitModel: '5',
  2321. storeCode: val.storeCode,
  2322. tabVal: that.tabVal,
  2323. latNew: location.lat,
  2324. lonNew: location.lon,
  2325. PointSum: PointSum,
  2326. marklat: res.latitude,
  2327. marklon: res.longitude,
  2328. linkType: 6,
  2329. },
  2330. });
  2331. localStorage.setItem('startTime', new Date());
  2332. localStorage.setItem('ORGName', val.deptName);
  2333. localStorage.setItem('chainNameR', val.storeName);
  2334. })
  2335. .catch(() => {
  2336. // that.abnormalVisit(val)
  2337. });
  2338. } else {
  2339. that.$router.push({
  2340. path: '/outabnormalVisit',
  2341. query: {
  2342. storeId: val.storeId,
  2343. rdId: val.rdId,
  2344. lat: that.lat,
  2345. lon: that.lon,
  2346. visitId: val.visitId,
  2347. pageType: 'out',
  2348. visitModel: '3',
  2349. storeCode: val.storeCode,
  2350. tabVal: that.tabVal,
  2351. latNew: location.lat,
  2352. lonNew: location.lon,
  2353. PointSum: PointSum,
  2354. marklat: res.latitude,
  2355. marklon: res.longitude,
  2356. linkType: 6,
  2357. },
  2358. });
  2359. localStorage.setItem('startTime', new Date());
  2360. localStorage.setItem('ORGName', val.deptName);
  2361. localStorage.setItem('chainNameR', val.storeName);
  2362. }
  2363. addVisitsPosition({
  2364. storeId: val.storeId,
  2365. visitsId: '',
  2366. lon: res.longitude,
  2367. lat: res.latitude,
  2368. sourceLon: location.lon,
  2369. sourceLat: location.lat,
  2370. positionDesc: '',
  2371. accuracy: res.accuracy,
  2372. });
  2373. },
  2374. fail: function () {
  2375. loading1.clear();
  2376. that.$dialog
  2377. .alert({
  2378. message: 'GPS未开启',
  2379. })
  2380. .then(() => {
  2381. // that.abnormalVisit(val)
  2382. });
  2383. },
  2384. });
  2385. });
  2386. wx.error(function (res) {
  2387. loading1.clear();
  2388. that.$dialog
  2389. .alert({
  2390. message: '定位失败,请开启企微定位权限',
  2391. })
  2392. .then(() => {});
  2393. });
  2394. } else {
  2395. loading1.clear();
  2396. this.$toast.fail(dataList.msg);
  2397. }
  2398. });
  2399. // this.$router.push({path: "/outabnormalVisit", query: {
  2400. // storeId:"179792",
  2401. // rdId:"null",
  2402. // lat:"31.1882020000",
  2403. // lon:"120.6801770000",
  2404. // visitId:"null",
  2405. // visitModel:"5",
  2406. // storeCode:"0190141901",
  2407. // tabVal:"0",
  2408. // latNew:34.621855582632264,
  2409. // lonNew:112.45382530736684,
  2410. // PointSum:857246.44
  2411. // }})
  2412. localStorage.setItem('startTime', new Date());
  2413. localStorage.setItem('ORGName', val.deptName);
  2414. localStorage.setItem('chainNameR', val.storeName);
  2415. }
  2416. }
  2417. } else {
  2418. this.$dialog.alert({
  2419. title: '系统提示',
  2420. message: res.msg,
  2421. });
  2422. }
  2423. });
  2424. },
  2425. visitFn(val) {
  2426. this.buryingPoint({
  2427. systemModel: '高销额门店推荐',
  2428. buryingPointType: 1,
  2429. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  2430. buryingPointName: '客户信息',
  2431. buryingPointPosition: '高销额门店推荐',
  2432. });
  2433. this.$router.push({
  2434. path: '/storeDetail',
  2435. query: { id: val.storeId, detilId: 'a' },
  2436. });
  2437. },
  2438. // 大客户签约
  2439. signAdd(val) {
  2440. this.$router.push({
  2441. path: '/sign',
  2442. query: { id: val.storeId, detilId: 'a' },
  2443. });
  2444. },
  2445. Visit(val) {
  2446. this.$router.push({
  2447. path: '/historicalDetails',
  2448. query: {
  2449. visitId: val.visitId,
  2450. storeId: val.storeId,
  2451. storeCode: val.storeCode,
  2452. },
  2453. });
  2454. },
  2455. onSearch() {
  2456. window.scrollTo(0, 0);
  2457. this.list = [];
  2458. this.finished = true;
  2459. this.cstype = this.$route.query.type;
  2460. this.getPositionFn();
  2461. if (this.lat != '') {
  2462. this.onLoad();
  2463. } else {
  2464. let loading3 = this.$toast.loading({
  2465. duration: 0,
  2466. message: '加载中...',
  2467. forbidClick: true,
  2468. });
  2469. setTimeout(() => {
  2470. loading3.clear();
  2471. this.onLoad();
  2472. }, 1000);
  2473. }
  2474. },
  2475. getPositionFn() {
  2476. var that = this;
  2477. let url = window.location.href;
  2478. let wx = this.wx;
  2479. let qiyeData;
  2480. const instance = axios.create();
  2481. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2482. instance
  2483. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2484. params: {
  2485. url: url,
  2486. },
  2487. })
  2488. .then((response) => {
  2489. if (response.status == 200) {
  2490. this.cont = 3;
  2491. var flat = true;
  2492. var times = setInterval(() => {
  2493. this.cont--;
  2494. if (this.cont == '0') {
  2495. if (flat) {
  2496. clearInterval(times);
  2497. } else {
  2498. clearInterval(times);
  2499. }
  2500. }
  2501. }, 1000);
  2502. qiyeData = response.data.data;
  2503. wx.config({
  2504. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2505. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2506. appId: qiyeData.appId, // 必填,企业微信的corpID
  2507. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2508. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2509. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2510. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2511. });
  2512. wx.ready(function () {
  2513. wx.getLocation({
  2514. type: 'gcj02',
  2515. success: function (res) {
  2516. flat = false;
  2517. var location = that.CJ02BD(res.latitude, res.longitude);
  2518. that.lat = location.lat;
  2519. that.lon = location.lon;
  2520. },
  2521. });
  2522. });
  2523. }
  2524. });
  2525. },
  2526. buryingPointFn(val) {
  2527. this.buryingPoint({
  2528. systemModel: '高销额门店推荐',
  2529. buryingPointType: 1,
  2530. buryingPointValue: val.telephone,
  2531. buryingPointName: '点击电话',
  2532. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  2533. });
  2534. },
  2535. onSearchm() {
  2536. var postType = localStorage.getItem('postType');
  2537. if (postType == 'GZ') {
  2538. this.typeShow = false;
  2539. } else {
  2540. this.typeShow = true;
  2541. }
  2542. var StoreLabelsArr = [];
  2543. for (var k = 0; k < this.storeLabelTypes.length; k++) {
  2544. for (var k1 = 0; k1 < this.StoreLabels.length; k1++) {
  2545. if (this.StoreLabels[k1].dictValue == this.storeLabelTypes[k]) {
  2546. StoreLabelsArr.push(this.StoreLabels[k1].dictLabel);
  2547. }
  2548. }
  2549. }
  2550. var storeCategoryList = [];
  2551. for (var q = 0; q < this.result.length; q++) {
  2552. for (var q1 = 0; q1 < this.storeTypeLists.length; q1++) {
  2553. if (this.storeTypeLists[q1].dictValue == this.result[q]) {
  2554. storeCategoryList.push(this.storeTypeLists[q1].dictLabel);
  2555. }
  2556. }
  2557. }
  2558. if (this.storeLabelTypes.length > 0) {
  2559. this.buryingPoint({
  2560. systemModel: '高销额门店推荐',
  2561. buryingPointType: 1,
  2562. buryingPointValue: StoreLabelsArr.join(','),
  2563. buryingPointName: '标签',
  2564. buryingPointPosition: '客户信息筛选',
  2565. });
  2566. }
  2567. if (this.storeCategoryList != '') {
  2568. this.buryingPoint({
  2569. systemModel: '高销额门店推荐',
  2570. buryingPointType: 1,
  2571. buryingPointValue: storeCategoryList.join(','),
  2572. buryingPointName: '类型',
  2573. buryingPointPosition: '客户信息筛选',
  2574. });
  2575. }
  2576. if (this.chainName != '') {
  2577. this.buryingPoint({
  2578. systemModel: '高销额门店推荐',
  2579. buryingPointType: 1,
  2580. buryingPointValue: this.chainName,
  2581. buryingPointName: '经销商筛选',
  2582. buryingPointPosition: '客户信息筛选',
  2583. });
  2584. }
  2585. if (this.storeName != '') {
  2586. this.buryingPoint({
  2587. systemModel: '高销额门店推荐',
  2588. buryingPointType: 1,
  2589. buryingPointValue: this.storeName,
  2590. buryingPointName: '搜索名称/编号/地址',
  2591. buryingPointPosition: '客户信息筛选',
  2592. });
  2593. }
  2594. var sortParam = '';
  2595. if (this.sortParam == 'sales') {
  2596. sortParam = '销量';
  2597. } else if (this.sortParam == 'visitTime') {
  2598. sortParam = '拜访时间';
  2599. } else {
  2600. sortParam = '下单时间';
  2601. }
  2602. var sortType = '';
  2603. if (this.sortType == 'desc') {
  2604. sortType = '正序';
  2605. } else {
  2606. sortType = '倒叙';
  2607. }
  2608. this.buryingPoint({
  2609. systemModel: '高销额门店推荐',
  2610. buryingPointType: 1,
  2611. buryingPointValue: sortType,
  2612. buryingPointName: sortParam,
  2613. buryingPointPosition: '客户信息筛选',
  2614. });
  2615. localStorage.setItem('outvstoreName', this.storeName);
  2616. localStorage.setItem('outvchainName', this.chainName);
  2617. localStorage.setItem('outvstoreLabelTypes', this.storeLabelTypes);
  2618. localStorage.setItem('outvstoreCategoryList', this.result);
  2619. localStorage.setItem('outvchainCode', this.chainCode);
  2620. localStorage.setItem('outvchainCode', this.chainCode);
  2621. localStorage.setItem('outvsortType', this.sortType);
  2622. localStorage.setItem('outsortParam', this.sortParam);
  2623. this.onSearch();
  2624. },
  2625. tabChange(name) {
  2626. window.scrollTo(0, 0);
  2627. this.finished = true;
  2628. this.disabled = true;
  2629. this.list = [];
  2630. this.tabVal = name;
  2631. this.onLoad();
  2632. },
  2633. onLoad() {
  2634. // 授权
  2635. getTicketFun().then(() => {
  2636. var postType = localStorage.getItem('postType');
  2637. if (postType == 'GZ') {
  2638. this.typeShow = false;
  2639. } else {
  2640. this.typeShow = true;
  2641. }
  2642. this.getUserOutPlaList();
  2643. });
  2644. },
  2645. onLoadlong() {
  2646. this.list = [];
  2647. this.getUserOutPlaList();
  2648. },
  2649. },
  2650. };
  2651. </script>
  2652. <style lang="scss">
  2653. .van-dialog__confirm,
  2654. .van-dialog__confirm:active {
  2655. color: #0057ba;
  2656. }
  2657. .searchDiv {
  2658. .van-search {
  2659. background: #fff;
  2660. }
  2661. .van-search__action {
  2662. font-size: 14px;
  2663. color: #0057ba;
  2664. font-weight: bold;
  2665. background: #f1f1f1;
  2666. border-bottom-right-radius: 60px;
  2667. border-top-right-radius: 60px;
  2668. border: 1px solid #ccc;
  2669. padding: 0 20px;
  2670. }
  2671. .van-search--show-action {
  2672. padding-right: 12px;
  2673. }
  2674. .van-search__content {
  2675. border: 1px solid #ccc;
  2676. border-bottom-left-radius: 60px;
  2677. border-top-left-radius: 60px;
  2678. background: #f1f1f1;
  2679. border-right: 0;
  2680. }
  2681. }
  2682. .myTab {
  2683. .van-tabs__nav--card {
  2684. margin: 0 !important;
  2685. border-left: 0;
  2686. border-right: 0;
  2687. }
  2688. .van-tabs__wrap,
  2689. .van-tabs__nav--card {
  2690. height: 39px;
  2691. }
  2692. .van-tab {
  2693. line-height: 40px;
  2694. }
  2695. }
  2696. .myList {
  2697. .van-cell {
  2698. padding: 0;
  2699. &:after {
  2700. border-bottom: none;
  2701. }
  2702. }
  2703. }
  2704. .searchDivcs .van-search__content {
  2705. border-bottom-left-radius: 6px;
  2706. border-top-left-radius: 6px;
  2707. }
  2708. .searchDivcs .van-search__action {
  2709. border-bottom-right-radius: 6px;
  2710. border-top-right-radius: 6px;
  2711. }
  2712. </style>
  2713. <style lang="scss" scoped>
  2714. .bgcolor {
  2715. background-color: #f5f5f5;
  2716. }
  2717. .container {
  2718. padding-bottom: 50px;
  2719. }
  2720. .card {
  2721. padding: 10px 16px;
  2722. box-sizing: border-box;
  2723. }
  2724. .card .title {
  2725. font-size: 15px;
  2726. font-weight: bold;
  2727. color: #333;
  2728. line-height: 22px;
  2729. padding-right: 52px;
  2730. .JPABC {
  2731. width: 20px;
  2732. position: relative;
  2733. top: 4px;
  2734. margin-right: 3px;
  2735. }
  2736. .statusIcon {
  2737. padding: 3px;
  2738. font-size: 12px;
  2739. margin: 0 3px;
  2740. color: #fff;
  2741. display: inline-block;
  2742. height: 20px;
  2743. line-height: 16px;
  2744. vertical-align: -1px;
  2745. }
  2746. .submit {
  2747. background: #ffba13;
  2748. }
  2749. .noSubmit {
  2750. background: #f11818;
  2751. }
  2752. }
  2753. .card .info {
  2754. font-size: 14px;
  2755. color: #909090;
  2756. line-height: 26px;
  2757. }
  2758. .btnbox {
  2759. padding-top: 14px;
  2760. border-top: 1px solid #eee;
  2761. margin: 0 10px;
  2762. }
  2763. .navBarTOP {
  2764. position: fixed;
  2765. width: 100%;
  2766. z-index: 2;
  2767. top: 0;
  2768. }
  2769. .cellcontent .centerBtn {
  2770. margin: 0 auto 10px;
  2771. display: block;
  2772. width: 92%;
  2773. color: #0057ba;
  2774. border-radius: 5px;
  2775. padding: 0 2px;
  2776. }
  2777. .cellcontent .centerBtn1 {
  2778. background-color: #0057ba;
  2779. color: #fff;
  2780. border-color: #0057ba;
  2781. }
  2782. .cellcontent .centerBtn2 {
  2783. margin: 0 auto 10px;
  2784. display: block;
  2785. width: 92%;
  2786. color: #0057ba;
  2787. border-radius: 5px;
  2788. padding: 0;
  2789. }
  2790. .statstext {
  2791. background-color: #0057ba;
  2792. position: absolute;
  2793. right: 0;
  2794. top: 6px;
  2795. padding: 2px 6px 2px 12px;
  2796. border-bottom-left-radius: 60px;
  2797. border-top-left-radius: 60px;
  2798. color: #fff;
  2799. }
  2800. .cellcontent .van-cell {
  2801. padding: 10px 0;
  2802. }
  2803. .statstext .van-icon__image {
  2804. height: 0.7em;
  2805. }
  2806. .tipsTitle {
  2807. padding: 5px 0;
  2808. text-align: center;
  2809. font-size: 16px;
  2810. font-weight: 600;
  2811. }
  2812. </style>
  2813. <style lang="scss">
  2814. .zpover99 {
  2815. background-color: #00afff !important;
  2816. }
  2817. .van-tabs__nav--card .van-tab.van-tab--active {
  2818. background-color: #0057ba !important;
  2819. }
  2820. .visitSearch {
  2821. width: 68px;
  2822. color: #0057ba;
  2823. font-size: 14px;
  2824. }
  2825. .visitSearch .van-dropdown-menu__bar {
  2826. box-shadow: 0 0 0 #fff;
  2827. height: 52px;
  2828. }
  2829. .visitSearch .van-dropdown-menu__item {
  2830. justify-content: normal;
  2831. }
  2832. .visitSearch .van-dropdown-menu__title {
  2833. border-left: 1px solid #ccc;
  2834. }
  2835. .visitSearch .van-cell {
  2836. border: 1px solid #ccc;
  2837. border-radius: 5px;
  2838. padding: 6px;
  2839. }
  2840. .positionContent {
  2841. position: fixed;
  2842. color: #666;
  2843. display: inline-block;
  2844. box-shadow: 0px 2px 7px -5px #000;
  2845. border-radius: 100px;
  2846. overflow: hidden;
  2847. right: 14px;
  2848. cursor: pointer;
  2849. bottom: 96px;
  2850. background-color: white;
  2851. }
  2852. .positionContent .img {
  2853. border-radius: 100px;
  2854. float: left;
  2855. }
  2856. .positionContent .img .van-icon__image {
  2857. border-radius: 100px;
  2858. }
  2859. .zDialog .van-dialog__header {
  2860. padding: 10px;
  2861. border-bottom: 1px solid #f5f5f5;
  2862. }
  2863. .zDialog .infoText {
  2864. margin: 10px;
  2865. font-size: 14px;
  2866. color: #909090;
  2867. width: 98%;
  2868. }
  2869. .visitStoreIco {
  2870. float: left;
  2871. float: left;
  2872. width: 26px;
  2873. text-align: center;
  2874. background-color: #ffba13;
  2875. color: #fff;
  2876. border-radius: 100%;
  2877. margin-left: 14px;
  2878. line-height: 26px;
  2879. height: 26px;
  2880. }
  2881. .searchcheck {
  2882. padding: 0 10px 10px;
  2883. }
  2884. .searchcheck .van-checkbox {
  2885. /*width: 44%;*/
  2886. padding-bottom: 10px;
  2887. }
  2888. .searchcheck .checkbox {
  2889. font-size: 14px;
  2890. display: inline-block;
  2891. width: 50%;
  2892. line-height: 28px;
  2893. }
  2894. .searchcheck .checkbox .van-checkbox {
  2895. margin-bottom: 2px;
  2896. }
  2897. .searchcheck .checkbox1 {
  2898. font-size: 14px;
  2899. float: left;
  2900. line-height: 28px;
  2901. width: 50%;
  2902. }
  2903. .searchcheck .checkbox1 .child {
  2904. width: 100%;
  2905. }
  2906. .searchcheck {
  2907. height: 93vh;
  2908. overflow-y: auto;
  2909. }
  2910. .searchchecktitle {
  2911. width: 100%;
  2912. margin: 20px 0;
  2913. font-size: 16px;
  2914. border-left: 3px solid #0057ba;
  2915. line-height: 18px;
  2916. }
  2917. .textsize {
  2918. font-size: 14px;
  2919. }
  2920. .visitStoreIcos {
  2921. /*background: url("./../../assets/order1.png") center;*/
  2922. }
  2923. .topStore {
  2924. .JPVisitNum {
  2925. position: relative;
  2926. top: -26px;
  2927. font-size: 10px;
  2928. }
  2929. .TCFXListItem {
  2930. display: inline-block;
  2931. border: 1px solid #ccc;
  2932. padding: 3px 5px;
  2933. margin: 0 5px;
  2934. border-radius: 6px;
  2935. }
  2936. }
  2937. </style>