| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882 |
- <template>
- <div>
- <div class="navBarTOP">
- <!-- 顶部条 -->
- <van-nav-bar class="navBar" title="客户详情" left-arrow @click-left="onClickLeft">
- <template #right>
- <!-- 未结案状态下 已提交/未提交 -->
- <template v-if="list.storeType == '未结案'">
- <!-- 已提交状态禁止操作 -->
- <template v-if="list.submit"></template>
- <!-- 未提交 -->
- <template v-if="!list.submit">
- <span
- style="color: #0057ba"
- v-if="list.updatable && list.validFlag != 2 && type != 'address'"
- @click="editorFn"
- >编辑
- </span>
- </template>
- </template>
- <template v-else>
- <span
- style="color: #0057ba"
- v-if="list.updatable && list.validFlag == 2"
- @click="placeOrderFn"
- >去下单
- </span>
- <span
- style="color: #0057ba"
- v-if="list.updatable && list.validFlag != 2 && type != 'address'"
- @click="editorFn"
- >编辑
- </span>
- </template>
- </template>
- </van-nav-bar>
- </div>
- <!--主体内容-->
- <div style="margin-top: 44px; padding-bottom: 50px" v-if="pageShow">
- <van-dialog title="门店位置">
- <mapmarker :info="list"></mapmarker>
- </van-dialog>
- <van-tabs class="myTab" v-model="tabVal" color="#0057ba" @change="tabChange">
- <van-tab title="基础信息" name="insidePlan" ref="dispsps">
- <!-- 提交审批后被驳回 -->
- <div class="rejectMsg" v-if="rejectMsg[0] && '退回状态'">
- <span class="label">退回原因</span>
- <span class="value">{{ rejectMsg[0].rejectCause }}</span>
- <span class="examineDetail" @click="examineDetail">查看详情</span>
- </div>
- <van-field readonly v-model="list.storeCode" label="编号" />
- <van-field readonly v-if="DIYshow" v-model="list.attribute1" label="DIY编号" />
- <van-field readonly v-model="list.storeName" :label="storeName" />
- <van-field readonly v-model="list.storeCategoryName" label="类型" />
- <van-field
- readonly
- v-if="type != 'address'"
- rows="1"
- autosize
- type="textarea"
- v-model="list.addressLine"
- :label="address" />
- <van-field
- v-if="type == 'address'"
- rows="1"
- autosize
- type="textarea"
- v-model="list.addressLine"
- :label="address">
- <template #button>
- <van-button size="small" type="info" @click="fns"
- ><van-icon name="location-o" />地图</van-button
- >
- </template>
- </van-field>
- <van-field v-model="list.lat" readonly label="经度" placeholder="经度" />
- <van-field readonly v-model="list.lon" label="维度" />
- <van-field readonly v-model="list.orgName" label="销售部" />
- <van-field readonly v-model="list.provinceName" label="省(州)" @click="provinceFN">
- <template #button>
- <van-icon name="arrow" v-if="type == 'address'" />
- </template>
- </van-field>
- <van-field readonly v-model="list.cityName" label="城市" @click="cityFN">
- <template #button>
- <van-icon name="arrow" v-if="type == 'address'" />
- </template>
- </van-field>
- <van-field readonly v-model="list.districtName" label="区(县)" @click="districtFN">
- <template #button>
- <van-icon name="arrow" v-if="type == 'address'" />
- </template>
- </van-field>
- <van-field readonly v-model="list.townName" label="街道" @click="towntFN">
- <template #button>
- <van-icon name="arrow" v-if="type == 'address'" />
- </template>
- </van-field>
- <van-field readonly v-model="list.cityLevel" label="城市等级" />
- <van-field
- readonly
- v-if="list.ifJzStoreType != 1 && list.storeCategory != 'C917'"
- v-model="list.contactName"
- label="联系人" />
- <van-field
- readonly
- v-if="list.ifJzStoreType == 1 && list.storeCategory != 'C917'"
- v-model="list.contactName"
- label="老板" />
- <van-field
- readonly
- v-model="list.telephone"
- label="联系电话"
- v-if="list.storeCategory != 'C917'" />
- <van-field
- readonly
- v-model="list.chainCode"
- label="经销商编号"
- v-if="list.storeCategory != 'C917'" />
- <van-field
- readonly
- v-model="list.chainName"
- label="经销商名称"
- v-if="list.storeCategory != 'C917'" />
- <van-field readonly v-model="list.salesmanName" label="销售员" />
- <div v-if="list.storeCategory != 'C917'">
- <van-field
- readonly
- v-model="list.area"
- v-if="list.ifJzStoreType != 1"
- label="面积(m²)" />
- <van-field
- readonly
- v-model="list.area"
- v-if="list.ifJzStoreType == 1"
- label="家装展厅面积(m²)" />
- </div>
- <van-field
- readonly
- v-if="GZAttributeFormShow"
- label="潜在客户类型"
- v-model="list.potentialCustomerType" />
- <van-field readonly v-if="list.carShop" label="是否车铺开店">
- <template #input>
- <span v-if="list.carShop == 1">是</span>
- <span v-if="list.carShop == 0">否</span>
- </template>
- </van-field>
- <div v-if="list.carShopImgList != null && list.carShop == 1">
- <p style="padding: 0 16px">车铺照片(店招及车铺产品拍在一张照片里)</p>
- <viewUploadImg :imgs="list.carShopImgList"></viewUploadImg>
- </div>
- <template v-if="list.img != null && list.storeCategory != 'C917'">
- <van-row gutter="20" style="padding: 16px">
- <van-col span="12">
- <div v-if="storeTypePOP">
- <van-image
- width="100%"
- height="160"
- :src="setImgSrc(list.img)"
- @click="deleteImgs(list.img)" />
- <p style="text-align: center">
- {{ list.ifJzStoreType != 1 ? '建店时门店照' : '家装前台照片' }}
- </p>
- </div>
- <div v-else>
- <van-image
- width="100%"
- height="160"
- :src="setImgSrc(list.img)"
- @click="deleteImgs(list.img)" />
- <p style="text-align: center">
- {{ list.storeCategory == 'C912' ? '工地铭牌照片' : '公司照片' }}
- </p>
- </div>
- </van-col>
- <van-col span="12" v-if="list.ifJzStoreType != 1">
- <div v-if="storeTypePOP">
- <van-image
- width="100%"
- height="160"
- :src="setImgSrc(list.imgSed)"
- @click="deleteImgs(list.imgSed)" />
- <p style="text-align: center">
- {{ list.ifJzStoreType != 1 ? '陈列照' : '立邦展厅照片' }}
- </p>
- </div>
- </van-col>
- </van-row>
- </template>
- <van-row gutter="20" style="padding: 16px">
- <van-col span="12" v-if="list.newStoreSignPhoto">
- <div v-if="storeTypePOP">
- <van-image
- width="100%"
- height="160"
- :src="setImgSrc(list.newStoreSignPhoto)"
- @click="deleteImgs(list.newStoreSignPhoto)" />
- <p style="text-align: center">最近一次拜访店招</p>
- </div>
- </van-col>
- </van-row>
- <van-row gutter="20" style="padding: 16px" v-if="type == 'address'">
- <van-col
- span="12"
- v-if="
- list.storeCategory == '35' ||
- list.storeCategory == '36' ||
- list.storeCategory == '37' ||
- list.storeCategory == '38' ||
- list.storeCategory == '91'
- ">
- <upload-img
- :uploadid="uploadid2"
- :imgArr="img"
- @newimgarr="newimgarr1"
- imgText="店招照片"
- :type="1"></upload-img>
- </van-col>
- </van-row>
- <van-collapse v-model="activeNames" class="orderList">
- <van-collapse-item title="门店下单记录" name="1">
- <div class="orderItem" v-for="(item, index) in orderList" :key="index">
- <div class="orderTitle">
- {{ item.ORDERID }} | {{ item.ORDERDATE }} | {{ item.STATUS_DESCR }}
- </div>
- <el-table
- :data="item.productDetail"
- border
- class="table-headermd table-headermdhome"
- style="width: 100%">
- <el-table-column label="产品名称" prop="DESCR" />
- <el-table-column label="数量" prop="QTY" width="80px" />
- <!-- <el-table-column label="单价" prop="price" width="80px" /> -->
- </el-table>
- </div>
- </van-collapse-item>
- </van-collapse>
- </van-tab>
- <van-tab title="属性信息" name="outsidePlan">
- <van-field readonly label="属性" v-if="dictTypeFormShow" v-model="list.tcfxName" />
- </van-tab>
- </van-tabs>
- <!--省、市、区、街道-->
- <van-popup v-model="provinceShow" position="bottom">
- <van-picker
- show-toolbar
- title="省(州)"
- :columns="provinceList"
- @confirm="onProvinceConfirm"
- @cancel="provinceShow = false" />
- </van-popup>
- <van-popup v-model="cityShow" position="bottom">
- <van-picker
- show-toolbar
- title="城市"
- :columns="cityList"
- @confirm="onCityConfirm"
- @cancel="cityShow = false" />
- </van-popup>
- <van-popup v-model="districtShow" position="bottom">
- <van-picker
- show-toolbar
- title="县区"
- :columns="districtList"
- @confirm="onDistrictConfirm"
- @cancel="districtShow = false" />
- </van-popup>
- <van-popup v-model="towntShow" position="bottom">
- <van-picker
- show-toolbar
- title="街道"
- :columns="townList"
- @confirm="onTownConfirm"
- @cancel="towntShow = false" />
- </van-popup>
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <!-- 未结案 未提交状态下可关闭门店、提交审核 -->
- <div class="bottomBtn">
- <van-button color="red" round>撤销建店</van-button>
- <van-button type="primary" round>提交审核</van-button>
- </div>
- <div
- style="
- position: fixed;
- bottom: 0;
- width: 100%;
- padding: 14px;
- background-color: white;
- border-top: 1px solid #eee;
- "
- v-if="type">
- <van-row gutter="20">
- <van-col
- span="12"
- v-if="
- list.storeCategory != '35' &&
- list.storeCategory != '36' &&
- list.storeCategory != '37' &&
- list.storeCategory != '38' &&
- list.storeCategory != '91'
- "
- ><van-button round type="default" style="width: 100%" @click="valid"
- >无效关店</van-button
- ></van-col
- >
- <van-col
- span="12"
- v-if="
- list.storeCategory != '35' &&
- list.storeCategory != '36' &&
- list.storeCategory != '37' &&
- list.storeCategory != '38' &&
- list.storeCategory != '91'
- "
- ><van-button
- round
- type="info"
- style="width: 100%; background-color: #0057ba"
- @click="updateStoreAddress"
- >提交</van-button
- ></van-col
- >
- <van-col
- span="24"
- v-if="
- list.storeCategory == '35' ||
- list.storeCategory == '36' ||
- list.storeCategory == '37' ||
- list.storeCategory == '38' ||
- list.storeCategory == '91'
- "
- ><van-button
- round
- type="info"
- style="width: 100%; background-color: #0057ba"
- @click="updateStoreAddress"
- >提交</van-button
- ></van-col
- >
- </van-row>
- </div>
- <van-dialog
- v-model="showDialog"
- title="系统提示"
- show-cancel-button
- :show-confirm-button="false">
- <p v-if="!Array.isArray(msgList)" style="padding: 10px 14px; margin: 0">
- {{ msgList }}
- </p>
- <div style="max-height: 400px; overflow-y: auto" v-if="Array.isArray(msgList)">
- <p
- style="border-bottom: 1px solid #f5f5f5; padding: 10px 14px; margin: 0"
- v-for="(item, index) in msgList"
- :key="index">
- {{ item }}
- </p>
- </div>
- </van-dialog>
- <div style="position: fixed; top: 0; height: 100%; z-index: 3000; width: 100%" v-if="showmap">
- <div id="allmap1" style="height: 100%; width: 100%"></div>
- <div
- style="position: fixed; z-index: 99999; top: 0; width: 100%; background-color: white"
- v-if="showmap">
- <form action="/">
- <van-search
- v-model="searchValue"
- left-icon="search"
- @input="searchFn"
- placeholder="请输入搜索关键词">
- <!-- <template #action>
- <div @click="searchFn">搜索</div>
- </template> -->
- </van-search>
- </form>
- <div style="height: 200px; overflow: hidden" v-if="searchSHow">
- <div style="height: 100px; min-height: 200px; overflow-y: scroll; padding: 12px">
- <div
- v-for="(itme, index) in mapsearchlist"
- style="border-bottom: 1px solid #eee"
- @click="addressFn(itme)">
- <p>{{ itme.title }}</p>
- <p>{{ itme.address }}</p>
- <!-- <p>距离:{{ itme._distance }}米</p> -->
- </div>
- </div>
- </div>
- </div>
- <div class="mapaddress" v-if="showmap">
- <div class="title">
- <span @click="showmap = false" style="float: left"
- ><van-icon name="cross" size="16"
- /></span>
- <p class="titleText">附近地址信息</p>
- <span style="float: right" @click="confirmMap">确定</span>
- </div>
- <div class="listBox">
- <van-radio-group v-model="addresssb" @change="mapselect" v-if="shows">
- <van-radio :name="index" v-for="(item, index) in maplist" :key="index"
- ><p style="margin: 4px 0; font-weight: bold">
- {{ item.title }}
- </p>
- <p style="margin: 4px 0">{{ item.address }}</p>
- <!-- <p style="margin: 4px 0">距离:{{ item._distance }}米</p> -->
- </van-radio>
- </van-radio-group>
- <br />
- <br />
- <br />
- <br />
- </div>
- </div>
- </div>
- </div>
- <div class="helpPageMask" v-if="helpPageFlag">
- <helpPage @btnClick="btnClick"></helpPage>
- </div>
- <!-- 提交审核 退回原因 只有同城分销店显示 -->
- <van-popup v-model="rejectMsgShow" class="rejectMsgBox" closeable round position="bottom">
- <!-- <div class="rejectMsgBox"> -->
- <div class="title">退回详情</div>
- <div class="content">
- <div class="rejectMsgItem" v-for="(item, index) in rejectMsg" :key="index">
- <div class="item approver">
- <span class="label">审批人:</span>
- <span class="value">{{ item.approver }}</span>
- </div>
- <div class="item approvalTime">
- <span class="label">审批时间:</span>
- <span class="value">{{ item.approvalTime }}</span>
- </div>
- <div class="item rejectCause">
- <span class="label">退回原因:</span>
- <span class="value">{{ item.rejectCause }}</span>
- </div>
- </div>
- <!-- </div> -->
- </div>
- </van-popup>
- </div>
- </template>
- <script>
- import { ImagePreview } from 'vant';
- import {
- getById,
- getStoreTypeList,
- updateStore,
- getStoreyslTypeList,
- getTCFXList,
- addStore,
- checkVisit,
- getSJSList,
- getQGJZist,
- getCustomerInfoList,
- getCustomerNatureList,
- getMainProjectList,
- getMainRelationList,
- getManagementModelList,
- getpotentialCustomerTypeList,
- streetQuery,
- getOrderByStoreCode,
- } from '@/api/index';
- import mapmarker from '@/components/mapMarker';
- import viewUploadImg from '@/components/viewUploadImg';
- import txmapimg1 from '@/assets/txmap1.svg';
- import txmapimg2 from '@/assets/txmap2.svg';
- import txmapimg3 from '@/assets/marker_blue.png';
- import axios from 'axios';
- import { updateStoreAddress, valid } from '@/api/visitstore';
- import uploadImg from '@/components/viewaddreddUploadImg.vue';
- import helpPage from './helpPage.vue';
- import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
- export default {
- components: { uploadImg, mapmarker, viewUploadImg, helpPage },
- data() {
- return {
- addresssb: '',
- searchSHow: false,
- uploadid2: 'uploadid2',
- shows: true,
- searchValue: '',
- tabVal: 'insidePlan',
- showDialog: false,
- msgList: '',
- list: [],
- provinceList: [],
- txmapimg1: txmapimg1,
- txmapimg2: txmapimg2,
- txmapimg3: txmapimg3,
- cityList: [],
- districtList: [],
- maplist: [],
- townList: [],
- storeId: '',
- vaue: '',
- show: false,
- storeTypeList: [],
- ManagementModelList: [],
- MainRelationList: [],
- MainProjectList: [],
- CustomerNatureList: [],
- CustomerInfoList: [],
- potentialCustomerTypeList: [],
- typeABshow: false,
- dictTypeFormShow: false,
- detilId: '',
- DIYshow: false,
- visitListList: [],
- TCFXList: [],
- QGJZist: [],
- SJSList: [],
- storeName: '名称',
- address: '地址',
- storeTypePOP: false,
- GZAttributeFormShow: false,
- type: '',
- towntShow: false,
- districtShow: false,
- cityShow: false,
- provinceShow: false,
- showmap: false,
- markers: undefined,
- markers1: undefined,
- marker: undefined,
- pageShow: false,
- mapsearchlist: [],
- map: '',
- img: '',
- lat: '',
- lon: '',
- poiAddress: '',
- myLat: '',
- poiLat: '',
- poiLon: '',
- poiId: '',
- myLon: '',
- pLat: '',
- pLot: '',
- poiName: '',
- helpPageFlag: false, //提交修改 不通过 点击帮助弹出框
- rejectMsgShow: false,
- //退回原因
- rejectMsg: [
- {
- approver: '测试111',
- approvalTime: '2020-08-06 15:08:08',
- rejectCause: '测试222',
- },
- {
- approver: '测试111',
- approvalTime: '2020-08-06 15:08:08',
- rejectCause: '测试222',
- },
- {
- approver: '测试111',
- approvalTime: '2020-08-06 15:08:08',
- rejectCause: '测试222',
- },
- {
- approver: '测试111',
- approvalTime: '2020-08-06 15:08:08',
- rejectCause: '测试222',
- },
- ],
- activeNames: [],
- orderList: [
- {
- orderNum: 'D2323523532',
- createTime: '2020-08-06 15:08:08',
- state: '待确认',
- productDetail: [
- {
- productName: '外墙平油',
- productNum: '1',
- price: '100',
- },
- {
- productName: '外墙平油',
- productNum: '1',
- price: '100',
- },
- {
- productName: '外墙平油',
- productNum: '1',
- price: '100',
- },
- ],
- },
- {
- orderNum: 'D2323523532',
- createTime: '2020-08-06 15:08:08',
- state: '已签收',
- productDetail: [
- {
- productName: '外墙平油',
- productNum: '1',
- price: '100',
- },
- ],
- },
- {
- orderNum: 'D2323523532',
- createTime: '2020-08-06 15:08:08',
- state: '已签收',
- productDetail: [
- {
- productName: '外墙平油',
- productNum: '1',
- price: '100',
- },
- ],
- },
- ],
- };
- },
- created() {
- // this.detilId = this.$route.query.detilId;
- // this.type = this.$route.query.type;
- // this.getTCFXList();
- // this.getSJSList();
- // this.getQGJZist();
- // this.getCustomerInfoList();
- // this.getManagementModelList();
- // this.getMainRelationList();
- // this.getMainProjectList();
- // this.getCustomerNatureList();
- // this.getpotentialCustomerTypeList();
- },
- activated() {
- this.showmap = false;
- this.img = '';
- this.detilId = this.$route.query.detilId;
- this.type = this.$route.query.type;
- this.getCustomerInfoList();
- this.getManagementModelList();
- this.getMainRelationList();
- this.getMainProjectList();
- this.getCustomerNatureList();
- this.getTCFXList();
- this.getSJSList();
- this.getQGJZist();
- this.getStoreType();
- this.getpotentialCustomerTypeList();
- this.visitListList = [];
- this.getStreetQuery('');
- window.scrollTo(0, 0);
- this.poiAddress = '';
- this.myLat = '';
- this.poiLat = '';
- this.poiLon = '';
- this.poiId = '';
- this.myLon = '';
- this.poiName = '';
- },
- methods: {
- newimgarr1(val) {
- this.img = val.fileUrl;
- },
- addressFn(val) {
- var that = this;
- setTimeout(() => {
- that.searchSHow = false;
- that.map.setCenter(new TMap.LatLng(val.location.lat, val.location.lng));
- that.markers1.updateGeometries([
- {
- id: 'marker',
- styleId: 'marker',
- position: new TMap.LatLng(val.location.lat, val.location.lng),
- },
- ]);
- that.maplist = [];
- // 地点搜索 获取500米范围poi点
- getMapPoi({ latitude: val.location.lat, longitude: val.location.lng }).then((res) => {
- console.log(res);
- that.maplist = res.data;
- that.marker.setGeometries([]);
- setTimeout(() => {
- for (let p = 0; p < res.data.length; p++) {
- that.marker.updateGeometries([
- {
- id: res.data[p].id,
- position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
- },
- ]);
- }
- });
- });
- // 清楚选中状态
- that.addresssb = -1;
- // jsonp(
- // "https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(" +
- // val.location.lat +
- // "," +
- // val.location.lng +
- // ",500,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6"
- // ).then((res) => {
- // console.log(res);
- // that.maplist = res.data;
- // that.marker.setGeometries([]);
- // setTimeout(() => {
- // for (let p = 0; p < res.data.length; p++) {
- // that.marker.updateGeometries([
- // {
- // id: res.data[p].id,
- // position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
- // },
- // ]);
- // }
- // });
- // });
- });
- },
- searchFn() {
- this.searchSHow = false;
- console.log(this.searchValue);
- getkeywordPoi({ latitude: this.pLat, longitude: this.pLot }, this.searchValue).then((res) => {
- // 不显示下拉选择
- if (!res.data.length && !this.searchValue) {
- this.searchSHow = false;
- } else {
- this.searchSHow = true;
- }
- // 联想下拉选
- this.mapsearchlist = res.data;
- // // 赋值底部列表数据
- // this.maplist = res.data;
- });
- },
- mapselect(val) {
- this.searchSHow = false;
- if (val > -1) {
- this.markers.updateGeometries([
- {
- id: 'markers1',
- styleId: 'abc',
- position: new TMap.LatLng(
- this.maplist[val].location.lat,
- this.maplist[val].location.lng
- ),
- },
- ]);
- }
- },
- confirmMap() {
- console.log(this.maplist);
- console.log(this.addresssb);
- if (this.addresssb > -1) {
- let checkedPoint = this.maplist[this.addresssb];
- // 坐标转换
- let TXisBD = this.CJ02BD(checkedPoint.location.lat, checkedPoint.location.lng);
- this.list.addressLine = checkedPoint.address;
- this.lon = this.myLat;
- this.lat = this.myLon;
- this.poiAddress = checkedPoint.address;
- this.poiLat = TXisBD.lat;
- this.poiLon = TXisBD.lon;
- this.poiId = checkedPoint.id;
- this.poiName = checkedPoint.title;
- this.showmap = false;
- }
- },
- fns() {
- this.searchValue = '';
- getPosition()
- .then((res) => {
- let { TXisBD, resData } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- if (this.list.lon == '') {
- this.list.lon = TXisBD.lon;
- this.list.lat = resData.latitude;
- }
- this.pLat = resData.latitude;
- this.pLot = resData.longitude;
- this.myLat = TXisBD.lat;
- this.myLon = TXisBD.lon;
- this.showmap = true;
- // 地点搜索 获取500米范围poi点
- getMapPoi(resData).then((resPoi) => {
- this.maplist = resPoi.data;
- setTimeout(() => {
- this.addVisits1('1');
- });
- });
- })
- .catch((err) => {
- console.log(err);
- });
- // let loading1 = this.$toast.loading({
- // duration: 0,
- // message: "定位中...",
- // forbidClick: true,
- // });
- // let url = window.location.href;
- // // let url = encodeURIComponent("https://ssbsfatest.nipponpaint.com.cn/mobile" + window.location.href.split("/mobile")[1]).replaceAll("%3A", ":")
- // let that = this;
- // let qiyeData;
- // const instance = axios.create();
- // instance.defaults.headers.common["userId"] = localStorage.getItem("loginName");
- // instance
- // .get(process.env.VUE_APP_BASE_API + "mobile/wx/ticket", {
- // params: {
- // url: url,
- // },
- // })
- // .then((response) => {
- // if (response.status == 200) {
- // this.cont = 6;
- // var flat = true;
- // var times = setInterval(() => {
- // this.cont--;
- // if (this.cont == "0") {
- // if (flat) {
- // loading1.clear();
- // clearInterval(times);
- // that.$dialog.alert({
- // message: "定位失败,请开启企微定位权限",
- // });
- // } else {
- // clearInterval(times);
- // }
- // }
- // }, 1000);
- // qiyeData = response.data.data;
- // that.wx.config({
- // beta: true,
- // debug: false,
- // appId: qiyeData.appId,
- // timestamp: qiyeData.timestamp,
- // nonceStr: qiyeData.nonceStr,
- // signature: qiyeData.signature,
- // jsApiList: ["ready", "getLocation"],
- // });
- // that.wx.ready(function () {
- // that.wx.getLocation({
- // type: "gcj02",
- // success: function (res) {
- // flat = false;
- // loading1.clear();
- // var location = that.CJ02BD(res.latitude, res.longitude);
- // that.lat = location.lat;
- // that.lon = location.lon;
- // if (that.list.lon == "") {
- // that.list.lon = location.lon;
- // that.list.lat = res.latitude;
- // }
- // that.pLat = res.latitude;
- // that.pLot = res.longitude;
- // that.myLat = location.lat;
- // that.myLon = location.lon;
- // that.showmap = true;
- // jsonp(
- // "https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(" +
- // res.latitude +
- // "," +
- // res.longitude +
- // ",500,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6"
- // ).then((res) => {
- // console.log(res);
- // that.maplist = res.data;
- // setTimeout(() => {
- // that.addVisits1("1");
- // });
- // });
- // },
- // fail: function () {
- // loading1.clear();
- // that.$dialog.alert({
- // title: "系统提示",
- // message: "GPS未开启",
- // });
- // },
- // });
- // });
- // that.wx.error(function (res) {
- // this.$toast.fail("定位失败");
- // });
- // } else {
- // this.$toast.fail("接口异常");
- // }
- // });
- },
- addVisits1(val) {
- var that = this;
- var latlng = {
- lat: this.pLat,
- lon: this.pLot,
- };
- var map = new TMap.Map('allmap1', {
- zoom: 15,
- center: new TMap.LatLng(latlng.lat, latlng.lon),
- });
- var markers = new TMap.MultiMarker({
- id: 'markers',
- map: map,
- geometries: [],
- styles: {
- marker: new TMap.MarkerStyle({
- width: 32,
- height: 40,
- anchor: { x: 16, y: 32 },
- src: 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker-pink.png',
- }),
- },
- });
- markers.setGeometries([]);
- var location = new TMap.LatLng(latlng.lat, latlng.lon);
- map.setCenter(location);
- markers.updateGeometries([
- {
- id: 'marker',
- styleId: 'marker',
- position: location,
- },
- ]);
- var marker = new TMap.MultiMarker({
- map: map,
- styles: {
- default: new TMap.MarkerStyle({
- width: 32,
- height: 40,
- anchor: {
- x: 17,
- y: 21,
- },
- src: 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker_blue.png',
- }),
- },
- geometries: [],
- });
- for (let p = 0; p < this.maplist.length; p++) {
- marker.updateGeometries([
- {
- id: this.maplist[p].id,
- position: new TMap.LatLng(this.maplist[p].location.lat, this.maplist[p].location.lng),
- },
- ]);
- }
- var markers1 = new TMap.MultiMarker({
- map: map,
- mapgeometries: [{ id: 'markers1', position: new TMap.LatLng(0, 0) }],
- styles: {
- abc: new TMap.MarkerStyle({
- width: 32,
- height: 40,
- anchor: { x: 16, y: 32 },
- src: txmapimg3,
- }),
- },
- });
- markers1.setGeometries([]);
- this.map = map;
- this.markers = markers1;
- this.markers1 = markers;
- this.marker = marker;
- map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.SCALE); //移除比例尺控件
- map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ROTATION); //移除旋转控件
- map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ZOOM); //移除控件缩放
- this.map.on('click', this.clickMap);
- },
- // 点击事件处理方法
- clickMap(evt) {
- var lat = evt.latLng.getLat().toFixed(6);
- var lng = evt.latLng.getLng().toFixed(6);
- console.log(evt);
- },
- initMap(map) {
- // 监听地图平移开始
- map.on('pan', () => {
- console.log('监听地图平移开始');
- });
- // 监听地图平移结束
- map.on('panend', () => {
- console.log('监听地图平移结束');
- });
- },
- updateStoreAddress() {
- if (this.list.province == '') {
- this.$toast('省(州)不能为空');
- return;
- }
- if (this.list.city == '') {
- this.$toast('城市不能为空');
- return;
- }
- if (this.list.district == '') {
- this.$toast('县区不能为空');
- return;
- }
- if (this.list.townName == '') {
- this.$toast('街道不能为空');
- return;
- }
- if (this.list.addressLine == '') {
- this.$toast('地址不能为空');
- return;
- }
- if (
- this.lat == '' &&
- (this.list.storeCategory == '35' ||
- this.list.storeCategory == '36' ||
- this.list.storeCategory == '37' ||
- this.list.storeCategory == '38' ||
- this.list.storeCategory == '91')
- ) {
- this.$toast('未定位,请重新定位或地图选择地点');
- return;
- }
- if (
- this.img == '' &&
- (this.list.storeCategory == '35' ||
- this.list.storeCategory == '36' ||
- this.list.storeCategory == '37' ||
- this.list.storeCategory == '38' ||
- this.list.storeCategory == '91')
- ) {
- this.$toast('店招照片不能为空');
- return;
- }
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- let params = {
- storeAddressId: this.$route.query.storeAddressId,
- storeCode: this.list.storeCode,
- storeName: this.list.storeName,
- addressLine: this.list.addressLine,
- storeId: this.list.storeId,
- province: this.list.province,
- lon: this.lon,
- lat: this.lat,
- myLon: this.myLon,
- myLat: this.myLat,
- poiId: this.poiId,
- poiLon: this.poiLon,
- poiLat: this.poiLat,
- poiAddress: this.poiAddress,
- city: this.list.city,
- district: this.list.district,
- townName: this.list.townName,
- shopSignUrl: this.img,
- poiName: this.poiName, //地图选择POI名称
- };
- console.log(JSON.stringify(params));
- console.log(params);
- updateStoreAddress(params).then((res) => {
- loading1.clear();
- if (res.code == 200) {
- this.$dialog
- .alert({
- message: res.msg,
- messageAlign: 'left',
- })
- .then(() => {
- this.$router.go(-1);
- });
- } else {
- this.$dialog
- .alert({
- className: 'helpAlert',
- confirmButtonColor: '#0057ba',
- message: res.msg,
- messageAlign: 'left',
- showCancelButton: true,
- cancelButtonText: '帮助',
- cancelButtonColor: '#f79200',
- })
- .then(() => {})
- .catch(() => {
- // 帮助 弹出框
- this.helpPageFlag = true;
- });
- }
- });
- },
- towntFN() {
- if (this.type == 'address') {
- this.towntShow = true;
- }
- },
- districtFN() {
- if (this.type == 'address') {
- this.districtShow = true;
- }
- },
- cityFN() {
- if (this.type == 'address') {
- this.cityShow = true;
- }
- },
- provinceFN() {
- if (this.type == 'address') {
- this.provinceShow = true;
- }
- },
- onProvinceConfirm(value) {
- this.list.provinceName = value.text;
- this.list.province = value.provinceCode;
- this.list.cityName = '';
- this.list.city = '';
- this.list.districtName = '';
- this.list.countyCode = '';
- this.list.townName = '';
- this.list.townCode = '';
- this.getStreetQuery('1');
- this.provinceShow = false;
- },
- onCityConfirm(value) {
- this.list.cityName = value.text;
- this.list.city = value.cityCode;
- this.list.districtName = '';
- this.list.district = '';
- this.list.townName = '';
- this.list.townCode = '';
- this.cityCode = value.cityCode;
- this.getStreetQuery('2');
- this.cityShow = false;
- },
- onDistrictConfirm(value) {
- this.list.districtName = value.text;
- this.list.district = value.countyCode;
- this.list.townName = '';
- this.list.townCode = '';
- this.list.cityLevel = value.countyLevel;
- this.getStreetQuery('3');
- this.districtShow = false;
- },
- onTownConfirm(value) {
- this.list.townName = value.text;
- this.list.townCode = value.townCode;
- this.towntShow = false;
- },
- getStreetQuery(type) {
- var provinceCode = this.list.province;
- var cityCode = this.list.city;
- var countyCode = this.list.district;
- if (type == '1') {
- cityCode = '';
- countyCode = '';
- } else if (type == '2') {
- countyCode = '';
- } else if (type == '3') {
- } else {
- provinceCode = '';
- cityCode = '';
- countyCode = '';
- }
- streetQuery({
- provinceCode: provinceCode,
- cityCode: cityCode,
- countyCode: countyCode,
- }).then((res) => {
- if (res.code == 200) {
- var provinceList = [];
- var cityList = [];
- var districtList = [];
- var townList = [];
- if (type == '1') {
- for (var z1 = 0; z1 < res.data.length; z1++) {
- cityList.push({
- cityCode: res.data[z1].cityCode,
- text: res.data[z1].cityName,
- });
- }
- this.cityList = cityList;
- } else if (type == '2') {
- for (var z2 = 0; z2 < res.data.length; z2++) {
- districtList.push({
- countyCode: res.data[z2].countyCode,
- text: res.data[z2].countyName,
- countyLevel: res.data[z2].countyLevel,
- });
- }
- this.districtList = districtList;
- } else if (type == '3') {
- for (var z3 = 0; z3 < res.data.length; z3++) {
- townList.push({
- townCode: res.data[z3].townCode,
- text: res.data[z3].townName,
- });
- }
- this.townList = townList;
- } else {
- for (var z = 0; z < res.data.length; z++) {
- provinceList.push({
- provinceCode: res.data[z].provinceCode,
- text: res.data[z].provinceName,
- });
- }
- this.provinceList = provinceList;
- }
- } else {
- this.$toast.fail('请求超时');
- }
- });
- },
- getCustomerInfoList() {
- getCustomerInfoList().then((res) => {
- var CustomerInfoList = [];
- for (var t = 0; t < res.data.length; t++) {
- CustomerInfoList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.CustomerInfoList = CustomerInfoList;
- });
- },
- getCustomerNatureList() {
- getCustomerNatureList().then((res) => {
- var CustomerNatureList = [];
- for (var t = 0; t < res.data.length; t++) {
- CustomerNatureList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.CustomerNatureList = CustomerNatureList;
- });
- },
- getpotentialCustomerTypeList() {
- getpotentialCustomerTypeList().then((res) => {
- var potentialCustomerTypeList = [];
- for (var t = 0; t < res.data.length; t++) {
- potentialCustomerTypeList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.potentialCustomerTypeList = potentialCustomerTypeList;
- });
- },
- getMainProjectList() {
- getMainProjectList().then((res) => {
- var MainProjectList = [];
- for (var t = 0; t < res.data.length; t++) {
- MainProjectList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.MainProjectList = MainProjectList;
- });
- },
- getMainRelationList() {
- getMainRelationList().then((res) => {
- var MainRelationList = [];
- for (var t = 0; t < res.data.length; t++) {
- MainRelationList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.MainRelationList = MainRelationList;
- });
- },
- getManagementModelList() {
- getManagementModelList().then((res) => {
- var ManagementModelList = [];
- for (var t = 0; t < res.data.length; t++) {
- ManagementModelList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.ManagementModelList = ManagementModelList;
- });
- },
- getSJSList() {
- getSJSList({}).then((res) => {
- var SJSList = [];
- for (var t = 0; t < res.data.length; t++) {
- SJSList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.SJSList = SJSList;
- });
- },
- getQGJZist() {
- getQGJZist({}).then((res) => {
- var QGJZist = [];
- for (var t = 0; t < res.data.length; t++) {
- QGJZist.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.QGJZist = QGJZist;
- });
- },
- getTCFXList() {
- getTCFXList({}).then((res) => {
- var TCFXList = [];
- for (var t = 0; t < res.data.length; t++) {
- TCFXList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictCode,
- });
- }
- this.TCFXList = TCFXList;
- });
- },
- visitsFn(row) {
- this.$router.push({
- path: '/historicalDetails',
- query: {
- visitId: row.id,
- storeCode: row.storeCode,
- storeId: row.storeId,
- },
- });
- },
- valid() {
- var that = this;
- this.$dialog
- .confirm({
- title: '系统提示',
- message: '是否确认无效关店?',
- })
- .then(() => {
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- valid({ storeId: that.list.storeId }).then((res) => {
- loading1.clear();
- if (res.code == 200) {
- that.$router.go(-1);
- // window.location.replace(window.location.origin + "/mobile/storeAddress");
- }
- });
- });
- },
- setImgSrc(imgUrl) {
- let imgArr = imgUrl.split(',');
- return imgArr[0];
- },
- deleteImgs(val) {
- ImagePreview(val.split(','));
- },
- getStoreType() {
- // 先授权
- getTicketFun().then(() => {
- if (localStorage.getItem('storeType') == '2') {
- this.DIYshow = true;
- getStoreyslTypeList({}).then((res) => {
- this.storeTypeList = res.data;
- this.getDetail();
- });
- } else {
- this.DIYshow = false;
- getStoreTypeList({}).then((res) => {
- this.storeTypeList = res.data;
- this.getDetail();
- });
- }
- });
- },
- getDetail() {
- this.pageShow = false;
- this.lat = '';
- this.lon = '';
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- getById({ storeId: this.$route.query.id }).then((res) => {
- loading1.clear();
- this.pageShow = true;
- localStorage.setItem('locationRemark', res.data.addressLine);
- localStorage.setItem('orgName', res.data.orgName);
- localStorage.setItem('chainName', res.data.storeName);
- if (res.code == 200) {
- if (res.data.lat != null) {
- this.lat = res.data.lat;
- this.lon = res.data.lon;
- }
- this.list = res.data;
- if (
- res.data.province != null &&
- res.data.province != undefined &&
- res.data.province != ''
- ) {
- this.getStreetQuery('1');
- }
- if (res.data.city != null && res.data.city != undefined && res.data.city != '') {
- this.getStreetQuery('2');
- }
- if (
- res.data.district != null &&
- res.data.district != undefined &&
- res.data.district != ''
- ) {
- this.getStreetQuery('3');
- }
- if (this.list.carShopImgList != null) {
- } else {
- this.list.carShopImgList = [];
- }
- if (this.list.storeCategory == '10131' || this.list.storeCategory == '129081') {
- this.typeABshow = true;
- } else {
- this.typeABshow = false;
- }
- if (this.list.storeCategory == 'C917') {
- this.GZAttributeFormShow = true;
- this.dictTypeSJSFormShow = false;
- this.dictTypeQGJZFormShow = false;
- this.dictTypeFormShow = false;
- this.dictTypeAFormShow = false;
- this.typeABshow = false;
- for (let k = 0; k < this.potentialCustomerTypeList.length; k++) {
- if (this.potentialCustomerTypeList[k].dictCode == this.list.potentialCustomerType) {
- this.list.potentialCustomerType = this.potentialCustomerTypeList[k].text;
- }
- }
- } else {
- this.GZAttributeFormShow = false;
- }
- if (this.list.storeCategory == '129081') {
- this.dictTypeFormShow = true;
- if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
- this.list.tcfxName = this.list.attribute3;
- } else {
- this.list.tcfxName = this.list.attribute5;
- }
- }
- if (this.list.storeCategory == '10131') {
- this.dictTypeFormShow = true;
- for (var k = 0; k < this.TCFXList.length; k++) {
- if (this.TCFXList[k].dictCode == this.list.tcfxName) {
- this.list.tcfxName = this.TCFXList[k].text;
- }
- }
- }
- if (this.list.storeCategory == 'sjs61') {
- this.dictTypeFormShow = true;
- for (var k = 0; k < this.SJSList.length; k++) {
- if (this.SJSList[k].dictCode == this.list.tcfxName) {
- this.list.tcfxName = this.SJSList[k].text;
- }
- }
- }
- if (this.list.storeCategory == 'zyjz63') {
- this.dictTypeFormShow = true;
- for (var k = 0; k < this.QGJZist.length; k++) {
- if (this.QGJZist[k].dictCode == this.list.tcfxName) {
- this.list.tcfxName = this.QGJZist[k].text;
- }
- }
- }
- if (this.list.storeCategory == 'C912') {
- this.storeTypePOP = false;
- this.storeName = '铭牌上项目名称';
- this.address = '地址';
- } else if (this.list.storeCategory == 'C917') {
- this.storeTypePOP = false;
- this.storeName = '名称';
- this.address = '地址';
- } else {
- this.storeTypePOP = true;
- this.storeName = '名称';
- this.address = '地址';
- }
- // 获取定位
- getPosition()
- .then((res) => {
- let { TXisBD, resData } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- this.myLat = TXisBD.lat;
- this.myLon = TXisBD.lon;
- this.list.lon = TXisBD.lon;
- this.list.lat = TXisBD.lat;
- })
- .catch((err) => {
- console.log(err);
- });
- // 获取门店订单
- this.getStoreOrderList(this.list.storeCode);
- } else {
- this.$toast.fail(res.msg);
- }
- });
- },
- // 获取门店订单
- getStoreOrderList(storeCode) {
- getOrderByStoreCode({ storeCode: storeCode }).then((res) => {
- if (res.code == 200) {
- let orderList = res.data.ORDERS;
- let orderMap = new Map();
- for (let i = 0; i < orderList.length; i++) {
- if (orderMap.has(orderList[i].ORDERID)) {
- orderMap.get(orderList[i].ORDERID).productDetail.push(orderList[i]);
- } else {
- let orderObj = {
- ORDERID: orderList[i].ORDERID,
- ORDERDATE: orderList[i].ORDERDATE,
- STATUS_DESCR: orderList[i].STATUS_DESCR,
- productDetail: [orderList[i]],
- };
- orderMap.set(orderList[i].ORDERID, orderObj);
- }
- }
- let orderListArr = [];
- for (let value of orderMap.values()) {
- orderListArr.push(value);
- }
- this.orderList = orderListArr;
- }
- });
- },
- positionFn() {
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '定位中...',
- forbidClick: true,
- });
- let url = window.location.href;
- let that = this;
- let qiyeData;
- const instance = axios.create();
- instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
- instance
- .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
- params: {
- url: url,
- },
- })
- .then((response) => {
- if (response.status == 200) {
- this.cont = 6;
- var flat = true;
- var times = setInterval(() => {
- this.cont--;
- if (this.cont == '0') {
- if (flat) {
- loading1.clear();
- clearInterval(times);
- that.$dialog
- .alert({
- message: '定位失败,请开启企微定位权限',
- })
- .then(() => {
- this.$router.go(-1);
- });
- } else {
- clearInterval(times);
- }
- }
- }, 1000);
- qiyeData = response.data.data;
- that.wx.config({
- beta: true,
- debug: false,
- appId: qiyeData.appId,
- timestamp: qiyeData.timestamp,
- nonceStr: qiyeData.nonceStr,
- signature: qiyeData.signature,
- jsApiList: ['ready', 'getLocation'],
- });
- that.wx.ready(function () {
- that.wx.getLocation({
- type: 'gcj02',
- success: function (res) {
- flat = false;
- loading1.clear();
- var location = that.CJ02BD(res.latitude, res.longitude);
- that.lat = location.lat;
- that.lon = location.lon;
- that.myLat = location.lat;
- that.myLon = location.lon;
- that.list.lon = location.lon;
- that.list.lat = location.lon;
- },
- fail: function () {
- loading1.clear();
- that.$dialog.alert({
- title: '系统提示',
- message: 'GPS未开启',
- });
- },
- });
- });
- that.wx.error(function (res) {
- this.$toast.fail('定位失败');
- });
- } else {
- this.$toast.fail('接口异常');
- }
- });
- },
- editorFn() {
- this.$router.push({
- path: '/storeEdit',
- query: { id: this.$route.query.id, validFlag: this.list.validFlag },
- });
- },
- formLink() {
- this.$router.push('/storeVisit/questions');
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- tabChange(name, title) {
- console.log(name, title);
- },
- placeOrderFn() {
- var that = this;
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- addStore(this.list).then((res) => {
- loading1.clear();
- if (res.code == 200) {
- if (res.data.serverCode) {
- if (
- res.data.orderUrl != null &&
- (res.data.orderUrl != '') & (res.data.orderUrl != undefined)
- ) {
- window.location.replace(res.data.orderUrl);
- } else {
- checkVisit({ storeId: res.data.sfaStore.storeId }).then((response) => {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', this.list.deptName);
- localStorage.setItem('chainNameR', this.list.storeName);
- if (response.code == 200) {
- that.$dialog
- .confirm({
- title: '系统提示',
- message: '建店成功,是否立即拜访?',
- confirmButtonText: '立即拜访',
- cancelButtonText: '返回上一页',
- })
- .then(() => {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', res.data.sfaStore.deptName);
- localStorage.setItem('chainNameR', res.data.sfaStore.storeName);
- window.location.replace(
- window.location.origin +
- '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
- res.data.sfaStore.storeId +
- '&lat=' +
- that.list.lat +
- '&lon=' +
- that.list.lon +
- '&addressLine=' +
- that.list.addressLine +
- '&storeCategory=' +
- res.data.sfaStore.storeCategory +
- '&storeName=' +
- that.list.storeName +
- '&contactName=' +
- that.list.contactName +
- '&storeCode=' +
- res.data.sfaStore.storeCode +
- '&latNew=' +
- that.list.lat +
- '&lonNew=' +
- that.list.lon
- );
- })
- .catch(() => {
- that.$router.go(-2);
- });
- } else {
- that.$dialog
- .alert({
- title: '系统提示',
- message: response.msg,
- })
- .then((res) => {});
- }
- });
- }
- } else {
- this.list.storeCode = res.data.sfaStore.storeCode;
- this.list.storeId = res.data.sfaStore.storeId;
- this.$dialog.alert({
- title: '系统提示',
- message: res.data.serverMsg,
- });
- }
- } else {
- this.msgList = res.msg;
- this.showDialog = true;
- }
- });
- },
- btnClick() {
- this.helpPageFlag = false;
- },
- // 退回原因查看详情
- examineDetail() {
- this.rejectMsgShow = true;
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .container {
- padding-bottom: 50px;
- }
- .myTab .van-tabs__nav--card {
- margin: 0 !important;
- border-left: 0;
- border-right: 0;
- }
- .myTab .van-tabs__wrap,
- .van-tabs__nav--card {
- height: 40px;
- }
- .myTab .van-tab {
- line-height: 40px;
- }
- .helpPageMask {
- width: 100%;
- height: 100%;
- background: rgba(116, 116, 116, 0.8);
- position: fixed;
- z-index: 100000;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .bottomBtn {
- position: fixed;
- bottom: 0;
- height: 50px;
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- .van-button {
- /* flex: 1; */
- width: 40%;
- }
- }
- .rejectMsg {
- position: sticky;
- top: 46px;
- z-index: 10;
- display: flex;
- box-sizing: border-box;
- width: 100%;
- padding: 10px 16px;
- overflow: hidden;
- color: #323233;
- font-size: 14px;
- line-height: 24px;
- background-color: #f5daac;
- font-weight: 600;
- .label {
- width: 6.2em;
- margin-right: 12px;
- }
- .value {
- flex: 1;
- }
- .examineDetail {
- width: 70px;
- color: #0057ba;
- }
- }
- .rejectMsgBox {
- min-height: 30%;
- max-height: 50%;
- padding: 10px 20px;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- .title {
- padding: 10px 0;
- text-align: center;
- font-size: 16px;
- font-weight: 600px;
- }
- .content {
- flex: 1;
- overflow-y: auto;
- .rejectMsgItem {
- margin-bottom: 20px;
- .item {
- padding: 5px 0;
- span {
- display: inline-block;
- }
- }
- .label {
- width: 80px;
- font-size: 14px;
- font-weight: 600;
- }
- .value {
- font-size: 14px;
- }
- }
- }
- }
- .orderList {
- .orderItem {
- .orderTitle {
- padding: 5px 0;
- font-size: 16px;
- font-weight: 600;
- color: #000;
- display: flex;
- align-items: center;
- &::before {
- content: '';
- width: 8px;
- height: 8px;
- background: red;
- border-radius: 50%;
- display: inline-block;
- margin-right: 5px;
- }
- }
- }
- }
- </style>
- <style lang="scss">
- .searchDiv {
- .van-search {
- /* // background: #fff; */
- }
- .van-search__action {
- font-size: 14px;
- color: #0057ba;
- font-weight: bold;
- background: #f1f1f1;
- border-bottom-right-radius: 60px;
- border-top-right-radius: 60px;
- border: 1px solid #ccc;
- padding: 0 20px;
- }
- .van-search--show-action {
- padding-right: 12px;
- }
- .van-search__content {
- border: 1px solid #ccc;
- border-bottom-left-radius: 60px;
- border-top-left-radius: 60px;
- background: #f1f1f1;
- border-right: 0;
- }
- }
- .helpAlert {
- .van-dialog__cancel {
- .van-button__text {
- &::before {
- content: '?';
- background: #f79200;
- width: 20px;
- display: inline-block;
- border-radius: 50%;
- color: #fff;
- }
- }
- }
- }
- </style>
|