| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122 |
- <template>
- <div class="storeEdit">
- <!-- 顶部条-->
- <div class="navBarTOP">
- <van-nav-bar
- class="navBar"
- title="编辑信息"
- left-arrow
- @click-left="onClickLeft"
- right-text="保存"
- @click-right="onSubmit" />
- </div>
- <!-- 主体内容-->
- <div style="margin-top: 44px">
- <van-dialog v-model="show" title="门店位置">
- <mapmarker :info="fromValue"></mapmarker>
- </van-dialog>
- <van-form ref="tabstoreVal">
- <van-tabs class="myTab" v-model="tabVal" color="#1989fa">
- <van-tab title="基础信息" name="insidePlan">
- <van-field readonly v-model="fromValue.storeCode" label="编号">
- <template #left-icon>
- <span class="van-f-red"> </span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.storeCategoryName"
- label="类型"
- placeholder="点击选择类型"
- @click="showPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.orgName"
- label="部门名称"
- placeholder="点击选择部门名称"
- @click="PickerDept">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <div
- style="background-color: white; padding: 0 14px"
- class="morelaji"
- v-if="fromValue.storeCategory != 'C917'">
- <!-- 分销店 -->
- <template
- v-if="
- verifyStoreType(fromValue.storeCategory) &&
- verifyStoreType(fromValue.storeCategory).type == 'fxd'
- ">
- <van-row style="border-bottom: 1px solid #ebedf0">
- <van-col span="24">
- <van-field label="经销商名称" @click="showPickerChainsListFn" class="TCFXList">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- <template #input>
- <template v-if="sfaStoreChainsContactList.length">
- <div
- class="sfaStoreChainsContactList"
- v-for="(item, index) in sfaStoreChainsContactList"
- :key="index">
- {{ item.categoryDescribe }}
- {{ item.chainCode }}
- {{ item.chainName }}
- </div>
- </template>
- <template v-else>
- <span style="color: rgb(150, 151, 153)"> 点击选择经销商名称 </span>
- </template>
- </template>
- </van-field>
- </van-col>
- </van-row>
- </template>
- <template v-else>
- <van-row style="border-bottom: 1px solid #ebedf0">
- <van-col span="20">
- <van-field
- rows="1"
- autosize
- type="textarea"
- readonly
- clickable
- name="picker"
- :value="fromValue.chainName"
- label="经销商名称"
- placeholder="点击选择经销商名称"
- @click="showPickerChainsListFn">
- <template #left-icon>
- <span
- v-if="
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C912' &&
- fromValue.storeCategory != 'C917'
- "
- class="van-f-red"
- >*</span
- >
- </template>
- </van-field>
- </van-col>
- <van-col span="4"
- ><van-button
- size="small"
- type="info"
- style="margin-top: 6px"
- native-type="button"
- @click="moreTypeShowFn"
- ><van-icon name="list-switching" />更多</van-button
- ></van-col
- >
- </van-row>
- </template>
- </div>
- <van-field
- v-model="fromValue.storeName"
- @blur="setStoreNameFn"
- :label="storeName"
- placeholder="请输入">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.provinceName"
- label="省(州)"
- placeholder="点击选择省(州)"
- @click="showProvincePicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.cityName"
- label="城市"
- placeholder="点击选择城市"
- @click="showCityPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.districtName"
- label="区(县)"
- placeholder="点击选择区(县)"
- @click="showDistrictPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.townName"
- label="街道"
- placeholder="点击选择街道"
- @click="showTownPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- v-model="fromValue.addressLine"
- rows="1"
- autosize
- type="textarea"
- :label="address"
- placeholder="地址"
- @blur="addressFn">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- <template #button>
- <van-button size="small" type="info" native-type="button" @click="fns"
- ><van-icon name="location-o" />地图</van-button
- >
- </template>
- </van-field>
- <van-field v-model="fromValue.lat" readonly label="经度" placeholder="经度">
- <template #left-icon>
- <span class="van-f-red"> </span>
- </template>
- </van-field>
- <van-field v-model="fromValue.lon" readonly label="维度" placeholder="维度">
- <template #left-icon>
- <span class="van-f-red"> </span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.cityLevel"
- label="城市等级"
- placeholder="点击选择城市等级">
- <template #left-icon>
- <span class="van-f-red"></span>
- </template>
- </van-field>
- <div v-if="fromValue.storeCategory != 'C917'">
- <van-field
- v-if="fromValue.ifJzStoreType != 1"
- v-model="fromValue.area"
- @input="numberFn"
- type="number"
- label="面积(m²)"
- @
- placeholder="面积">
- <template #left-icon>
- <span class="van-f-red"> </span>
- </template>
- </van-field>
- <van-field
- v-if="fromValue.ifJzStoreType == 1"
- v-model="fromValue.area"
- @input="numberFn"
- type="number"
- label="家装展厅面积(m²)"
- placeholder="面积">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- </div>
- <van-field
- v-model="fromValue.contactName"
- v-if="fromValue.ifJzStoreType != 1 && fromValue.storeCategory != 'C917'"
- label="联系人"
- placeholder="联系人">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- v-model="fromValue.contactName"
- v-if="fromValue.ifJzStoreType == 1 && fromValue.storeCategory != 'C917'"
- label="老板"
- placeholder="老板">
- <template #left-icon>
- <span class="van-f-red"> </span>
- </template>
- </van-field>
- <van-field
- v-if="fromValue.storeCategory != 'C917'"
- type="tel"
- v-model="fromValue.telephone"
- label="联系电话"
- placeholder="联系电话"
- @blur="phoneCheck">
- <template #left-icon>
- <span class="van-f-red" v-if="fromValue.ifJzStoreType != 1">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- v-model="fromValue.salesmanName"
- label="销售员"
- placeholder="销售员">
- <template #left-icon>
- <span class="van-f-red"> </span>
- </template>
- </van-field>
- <div v-if="GZAttributeFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>潜在客户类型</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.potentialCustomerType" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in potentialCustomerTypeList"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- <van-field label="是否车铺开店" v-if="typeABshow">
- <template #input>
- <span v-if="fromValue.carShop == 1">是</span>
- <span v-if="fromValue.carShop == 0">否</span>
- </template>
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field label="车铺照片" v-if="fromValue.carShop == 1 && typeABshow">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <div v-if="fromValue.carShop == 1 && typeABshow">
- <p
- style="
- color: #666;
- font-size: 14px;
- margin: 0;
- background-color: #fff;
- padding: 6px 18px;
- ">
- 注:店招及车铺产品拍在一张照片里
- </p>
- <viewUploadImg :imgs="fromValue.carShopImgList"></viewUploadImg>
- </div>
- <div v-if="fromValue.storeCategory != 'C917'">
- <div style="padding: 20px; height: 228px; background-color: #f1f1f1">
- <div class="displayImg">
- <div class="displayImgBox">
- <div v-if="storeTypePOP">
- <upload-img
- :uploadid="uploadid2"
- :imgArr="fromValue.img"
- @newimgarr="newimgarr1"
- :imgText="fromValue.ifJzStoreType != 1 ? '门店照' : '家装前台照片'"
- :type="1"></upload-img>
- </div>
- <div v-else>
- <upload-img
- :uploadid="uploadid2"
- :imgArr="fromValue.img"
- @newimgarr="newimgarr1"
- :imgText="fromValue.storeCategory == 'C912' ? '工地铭牌照片' : '公司照片'"
- :type="1"></upload-img>
- </div>
- </div>
- <template
- v-if="fromValue.ifJzStoreType != 1 && storeTypePOP && displayImg.length">
- <div class="displayImgBox" v-for="(urls, index) in displayImg" :key="index">
- <van-icon name="close" size="16" @click="deleteImg(index)" />
- <img :src="urls" width="99%" height="99%" @click="previewsImg(index)" />
- <div class="title">陈列照</div>
- </div>
- </template>
- <div class="displayImgBox" v-if="fromValue.ifJzStoreType != 1">
- <div v-if="storeTypePOP">
- <upload-img
- v-if="fromValue.ifJzStoreType != 1"
- :uploadid="uploadid2"
- imgArr=""
- @newimgarr="newimgarr1"
- imgText="陈列照(至少一张)"
- :type="2"
- :count="1"></upload-img>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 无效店铺,关闭店铺 -->
- <!-- <div class="invalid">
- <van-button type="warning" round @click="valid">无效关店</van-button>
- </div> -->
- </van-tab>
- <van-tab title="属性信息" name="Planpic">
- <!-- 同城分销店-属性信息 -->
- <div v-if="dictTypeFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in TCFXList"
- :key="index"
- style="margin-bottom: 10px"
- v-if="item.remark == fromValue.storeCategory">
- <van-radio shape="square" :name="item.dictCode + ''">{{
- item.text
- }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- <div v-if="dictTypeSJSFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in SJSList"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- <div v-if="dictTypeAFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group
- v-model="fromValue.attribute3"
- class="typeRadioStore1"
- @change="attrChange">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in brandst"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- <van-field
- v-if="attrShow"
- v-model="fromValue.attribute5"
- label="其他品牌"
- placeholder="其他品牌">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- </div>
- <div v-if="dictTypeQGJZFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in QGJZist"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- </van-tab>
- </van-tabs>
- </van-form>
- </div>
- <!--类型-->
- <van-popup v-model="showPicker" position="bottom">
- <van-picker
- show-toolbar
- :columns="storeCategoryList"
- value-key="dictLabel"
- @confirm="onConfirm"
- @cancel="showPicker = false" />
- </van-popup>
- <!--经销商-->
- <van-popup
- v-model="showPickerChainsList"
- position="bottom"
- class="agencyBox"
- :close-on-click-overlay="false">
- <!-- 分销店 -->
- <template
- v-if="
- verifyStoreType(fromValue.storeCategory) &&
- verifyStoreType(fromValue.storeCategory).type == 'fxd'
- ">
- <div class="header_btn">
- <div class="cancel" @click="showPickerChainsList = false">取消</div>
- <div class="confirm" @click="treeSelectConfirm">确定</div>
- </div>
- <van-tree-select
- :items="treeSelect"
- :main-active-index.sync="activeIndex"
- @click-nav="clickNav">
- <template #content>
- <div
- class="treeSelectchildren"
- v-if="activeIndex == index"
- v-for="(item, index) in treeSelect"
- :key="index">
- <div
- class="item"
- v-for="(val, ind) in item.children"
- :key="ind"
- @click="treeSelectItemClick(item, index, val, ind)">
- <div
- :class="{
- 'van-radio__icon': true,
- 'van-radio__icon--round': true,
- 'van-radio__icon--checked': val.Check,
- }">
- <i class="van-icon van-icon-success"></i>
- </div>
- <div class="value">{{ val.chainCode }} {{ val.chainName }}</div>
- </div>
- </div>
- </template>
- </van-tree-select>
- </template>
- <template v-else>
- <van-picker
- show-toolbar
- :columns="ChainsList"
- value-key="chainName"
- @confirm="onConfirmChainsList"
- @cancel="showPickerChainsList = false" />
- </template>
- </van-popup>
- <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%; font-size: 14px">
- <van-row style="background-color: #f5f5f5">
- <van-col span="20">
- <van-field
- left-icon="search"
- style="margin-top: 2px; border-radius: 6px; overflow: hidden"
- v-model="chainName"
- label=""
- placeholder="请输入关键词"
- clearable />
- </van-col>
- <van-col
- span="4"
- style="text-align: center; line-height: 48px"
- @click="getChainsByDeptCodesearch">
- <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
- >
- </van-row>
- <van-picker
- show-toolbar
- :columns="ChainsLists"
- value-key="chainName"
- @confirm="onConfirmChainsList"
- @cancel="moreTypeShow = false" />
- </van-popup>
- <van-popup v-model="showPickerDeptList" position="bottom">
- <van-picker
- show-toolbar
- :columns="deptList"
- @confirm="onDeptConfirm"
- @cancel="showPickerDeptList = false" />
- </van-popup>
- <!--同城类型-->
- <van-popup v-model="showTCFXL" position="bottom">
- <van-picker
- show-toolbar
- :columns="TCFXList"
- @confirm="onTCFXLConfirm"
- @cancel="showTCFXL = false" />
- </van-popup>
- <!--省、市、区、街道-->
- <van-popup v-model="showProvincePicker" position="bottom">
- <van-picker
- show-toolbar
- title="省(州)"
- :columns="provinceList"
- @confirm="onProvinceConfirm"
- @cancel="showProvincePicker = false" />
- </van-popup>
- <van-popup v-model="showCityPicker" position="bottom">
- <van-picker
- show-toolbar
- title="城市"
- :columns="cityList"
- @confirm="onCityConfirm"
- @cancel="showCityPicker = false" />
- </van-popup>
- <van-popup v-model="showDistrictPicker" position="bottom">
- <van-picker
- show-toolbar
- title="县区"
- :columns="districtList"
- @confirm="onDistrictConfirm"
- @cancel="showDistrictPicker = false" />
- </van-popup>
- <van-popup v-model="showTownPicker" position="bottom">
- <van-picker
- show-toolbar
- title="街道"
- :columns="townList"
- @confirm="onTownConfirm"
- @cancel="showTownPicker = false" />
- </van-popup>
- <!-- 部门数据 -->
- <div id="allmap"></div>
- <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">
- <van-search
- v-model="search"
- shape="round"
- background="#0057ba"
- @input="searchFn"
- placeholder="请输入搜索关键词" />
- <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="addressFns(itme)">
- <p>{{ itme.title }}</p>
- <p>{{ itme.address }}</p>
- </div>
- </div>
- </div>
- </div>
- <div class="mapaddress">
- <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">
- <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>
- </van-radio>
- </van-radio-group>
- <br />
- <br />
- <br />
- <br />
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- updateStore,
- beforeAdd,
- streetQuery,
- getTCFXList,
- getById,
- phoneCheck,
- getChainsByDeptCode,
- addStore,
- checkVisit,
- getSJSList,
- getQGJZist,
- getbrands,
- getCustomerInfoList,
- getCustomerNatureList,
- getMainProjectList,
- getMainRelationList,
- getManagementModelList,
- getpotentialCustomerTypeList,
- getDictOption,
- } from '@/api/index';
- import uploadImg from '@/components/uploadImgVStore';
- import uploadImgc from '@/components/uploadImgVStorec';
- import viewUploadImg from '@/components/viewUploadImg';
- import mapmarker from '@/components/mapMarker';
- import { jsonp } from 'vue-jsonp';
- import txmapimg1 from '@/assets/txmap1.svg';
- import txmapimg2 from '@/assets/txmap2.svg';
- import txmapimg3 from '@/assets/marker_blue.png';
- import { valid } from '@/api/visitstore';
- import { ImagePreview } from 'vant';
- import { getPosition, getTicketFun, getMapPoi, getkeywordPoi } from '@/utils/TXApiFun';
- import { listChainsByCategory } from '@/api/store';
- export default {
- name: 'storeAdd',
- components: { uploadImg, mapmarker, uploadImgc, viewUploadImg },
- data() {
- return {
- searchSHow: false,
- mapsearchlist: [],
- search: '',
- showmap: false,
- showDialog: false,
- msgList: '',
- tabVal: 'insidePlan',
- typeABshow: false,
- showPickerChainsList: false,
- showDistribute: false,
- showProvincePicker: false,
- showCityPicker: false,
- showDistrictPicker: false,
- showTownPicker: false,
- showPickerDeptList: false,
- dictTypeFormShow: false,
- moreTypeShow: false,
- typeShow: false,
- dictTypeSJSFormShow: false,
- dictTypeAFormShow: false,
- dictTypeQGJZFormShow: false,
- attrShow: false,
- provinceList: [],
- showTCFXL: false,
- show: false,
- cityList: [],
- deptList: [],
- districtList: [],
- cont: 0,
- townList: [],
- uploadid2: 'uploadid2',
- storeTypePOP: false,
- storeName: '名称',
- fromValue: {
- addressLine: '',
- chainCode: '',
- telephone: '',
- storeCategoryName: '',
- provinceName: '',
- salesmanName: '',
- orgName: '',
- lat: '',
- lon: '',
- districtName: '',
- contactName: '',
- cityName: '',
- cityLevel: '',
- potentialCustomerType: '',
- storeName: '',
- storeCategory: '',
- area: '',
- img: '',
- imgSed: '',
- townName: '',
- tcfxName: '',
- tcfxCode: '',
- orgId: '',
- carShop: '',
- carShopImgList: [],
- showroom: '',
- attribute3: '',
- attribute5: '',
- customerInfoFrom: '',
- customerNature: '',
- managementModel: '',
- mainProjectType: '',
- mainRelationFrom: '',
- },
- img: 'https://svs-test.oss-cn-shanghai.aliyuncs.com/1647398239620微信截图_20220315112921.png',
- location: {
- lat: '34.616712',
- lon: '112.440816',
- },
- checkboxGroup: [],
- radio: '',
- Radiocolumns: [
- { name: '1', text: '选项01' },
- { name: '2', text: '选项02' },
- ],
- showPicker: false,
- cityLeveList: [],
- storeTypeList: [],
- storeCategoryList: [],
- ChainsList: [],
- TCFXList: [],
- imgs: [],
- provinceCode: '',
- cityCode: '',
- countyCode: '',
- districtName: '',
- contactName: '',
- cityName: '',
- cityLevel: '',
- storeCategory: '',
- phoneNumber: true,
- sfaOrderProducts: [],
- deptShow: false,
- validFlag: '',
- QGJZist: [],
- SJSList: [],
- chainName: '',
- ChainsLists: [],
- address: '地址',
- brandst: [],
- maplist: [],
- ManagementModelList: [],
- MainRelationList: [],
- MainProjectList: [],
- CustomerNatureList: [],
- CustomerInfoList: [],
- potentialCustomerTypeList: [],
- GZAttributeFormShow: false,
- addresssb: -1,
- markers: undefined,
- markers1: undefined,
- marker: undefined,
- pageShow: false,
- map: '',
- pLat: '',
- pLot: '',
- displayImg: [],
- activeIndex: 0,
- treeSelectItemInd: 0,
- treeSelect: [],
- sfaStoreChainsContactList: [], //选中确定的经销商
- activatedTCFXList: [], //选中的经销商
- };
- },
- activated() {
- this.tabVal = 'insidePlan';
- this.treeSelect = [];
- // 授权
- getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
- this.getTCFXList();
- this.getSJSList();
- this.getQGJZist();
- this.getDetail();
- this.getbrands();
- this.getStreetQuery();
- this.getCustomerInfoList();
- this.getManagementModelList();
- this.getMainRelationList();
- this.getMainProjectList();
- this.getCustomerNatureList();
- this.getpotentialCustomerTypeList();
- this.showmap = false;
- });
- },
- methods: {
- addressFns(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;
- });
- },
- searchFn(val) {
- this.searchSHow = false;
- getkeywordPoi({ latitude: this.pLat, longitude: this.pLot }, val).then((res) => {
- // 不显示下拉选择
- if (!res.data.length && !val) {
- this.searchSHow = false;
- } else {
- this.searchSHow = true;
- }
- // 联想下拉选
- this.mapsearchlist = 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() {
- if (this.addresssb > -1) {
- let checkedPoint = this.maplist[this.addresssb];
- // 坐标转换
- let TXisBD = this.CJ02BD(checkedPoint.location.lat, checkedPoint.location.lng);
- this.fromValue.addressLine = checkedPoint.address;
- var location = this.CJ02BD(this.pLat, this.pLot);
- this.fromValue.lat = location.lat;
- this.fromValue.lon = location.lon;
- this.fromValue.poiAddress = checkedPoint.address;
- this.fromValue.poiLat = TXisBD.lat;
- this.fromValue.poiLon = TXisBD.lon;
- this.fromValue.poiId = checkedPoint.id;
- this.fromValue.poiName = checkedPoint.title;
- }
- this.showmap = false;
- },
- fns() {
- this.search = '';
- getPosition()
- .then((res) => {
- let { TXisBD, resData } = res;
- this.pLat = resData.latitude;
- this.pLot = resData.longitude;
- if (this.fromValue.lon == '') {
- this.fromValue.lon = TXisBD.lon;
- this.fromValue.lat = TXisBD.lat;
- }
- this.showmap = true;
- // 地点搜索 获取500米范围poi点
- getMapPoi({ latitude: this.pLat, longitude: this.pLot }).then((res) => {
- console.log(res);
- this.maplist = res.data;
- setTimeout(() => {
- this.addVisits1('1');
- });
- });
- })
- .catch((error) => {
- this.$dialog.alert({
- message: error,
- });
- });
- this.addresssb = -1;
- },
- 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: [],
- });
- marker.setGeometries([]);
- setTimeout(() => {
- 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);
- },
- addressFn() {
- localStorage.setItem('locationRemark', this.fromValue.addressLine);
- },
- getChainsByDeptCodesearch(chainName) {
- this.ChainsLists = [];
- getChainsByDeptCode({
- chainName: this.chainName,
- cityName: this.fromValue.cityNameOld,
- districtName: this.fromValue.districtNameOld,
- deptId: this.fromValue.deptId,
- ifJzStoreType: this.fromValue.ifJzStoreType,
- storeCategory: this.fromValue.storeCategory,
- }).then((res) => {
- this.ChainsLists = res.data.sfaChains;
- this.ChainsLists.push({});
- this.ChainsLists.pop();
- });
- },
- //
- PickerDept() {
- if (this.deptShow) {
- this.showPickerDeptList = true;
- }
- },
- handleSelectionChange(val) {
- this.fromValue.orderProductStoreList = val;
- },
- 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;
- });
- },
- getChainsByDeptCode(deptCode, ifJzStoreType) {
- getChainsByDeptCode({
- cityName: this.fromValue.cityName,
- districtName: this.fromValue.districtName,
- deptId: deptCode,
- ifJzStoreType: ifJzStoreType,
- storeCategory: this.fromValue.storeCategory,
- }).then((res) => {
- if (res.data.deptList.length == 1) {
- this.fromValue.orgId = res.data.deptList[0].deptId;
- this.fromValue.orgName = res.data.deptList[0].deptName;
- localStorage.setItem('orgName', res.data.deptList[0].deptName);
- this.ChainsList = res.data.sfaChains;
- this.deptShow = false;
- } else {
- this.deptShow = true;
- this.ChainsList = [];
- var deptList = [];
- for (var t1 = 0; t1 < res.data.deptList.length; t1++) {
- deptList.push({
- deptId: res.data.deptList[t1].deptId,
- text: res.data.deptList[t1].deptName,
- });
- }
- this.deptList = deptList;
- }
- var arrlist = [];
- if (res.data.sfaOrderProducts != null) {
- for (var n1 = 0; n1 < this.fromValue.orderProductStoreList.length; n1++) {
- for (var n2 = 0; n2 < res.data.sfaOrderProducts.length; n2++) {
- res.data.sfaOrderProducts[n2].storeProductId =
- res.data.sfaOrderProducts[n2].orderProductId;
- if (
- res.data.sfaOrderProducts[n2].orderProductId ==
- this.fromValue.orderProductStoreList[n1].productId
- ) {
- res.data.sfaOrderProducts[n2].orderNum =
- this.fromValue.orderProductStoreList[n1].orderNum;
- res.data.sfaOrderProducts[n2].storeProductId =
- this.fromValue.orderProductStoreList[n1].storeProductId;
- arrlist.push(res.data.sfaOrderProducts[n2]);
- }
- }
- }
- this.sfaOrderProducts = res.data.sfaOrderProducts;
- }
- });
- },
- 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;
- });
- },
- 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;
- });
- },
- getChainsByDeptId(deptCode, ifJzStoreType) {
- getChainsByDeptCode({
- cityName: this.fromValue.cityName,
- districtName: this.fromValue.districtName,
- deptId: deptCode,
- ifJzStoreType: ifJzStoreType,
- storeCategory: this.fromValue.storeCategory,
- }).then((res) => {
- this.ChainsList = res.data.sfaChains;
- });
- },
- onDeptConfirm(value) {
- this.fromValue.orgName = value.text;
- localStorage.setItem('orgName', value.text);
- this.fromValue.orgId = value.deptId;
- this.fromValue.chainCode = '';
- this.fromValue.chainName = '';
- this.getChainsByDeptId(value.deptId, this.fromValue.ifJzStoreType);
- this.showPickerDeptList = false;
- },
- setStoreNameFn() {
- localStorage.setItem('chainName', this.fromValue.storeName);
- },
- attrChange(val) {
- if (val == '0') {
- this.attrShow = true;
- } else {
- this.attrShow = false;
- this.fromValue.attribute5 = '';
- }
- },
- getStreetQuery(type) {
- var provinceCode = '';
- var cityCode = '';
- var countyCode = '';
- if (type == '1') {
- provinceCode = this.fromValue.province;
- cityCode = '';
- countyCode = '';
- } else if (type == '2') {
- provinceCode = this.fromValue.province;
- cityCode = this.fromValue.city;
- countyCode = '';
- } else if (type == '3') {
- provinceCode = this.fromValue.province;
- cityCode = this.fromValue.city;
- countyCode = this.fromValue.district;
- } else {
- provinceCode = '';
- cityCode = '';
- countyCode = '';
- }
- streetQuery({ provinceCode: provinceCode, cityCode: cityCode, countyCode: countyCode }).then(
- (res) => {
- 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;
- }
- }
- );
- },
- getDetail() {
- // 获取当前定位
- this.getLocation();
- this.phoneNumber = true;
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.typeShow = false;
- } else {
- this.typeShow = true;
- }
- getById({ storeId: this.$route.query.id }).then((res) => {
- loading1.clear();
- this.validFlag = this.$route.query.validFlag;
- if (res.code == 200) {
- this.fromValue = res.data;
- this.sfaStoreChainsContactList = this.fromValue.sfaStoreChainsContactList;
- if (this.fromValue.imgSed && this.fromValue.imgSed != '') {
- this.displayImg = this.fromValue.imgSed.split(',');
- } else {
- this.displayImg = [];
- }
- if (this.fromValue.lat != null) {
- } else {
- this.fromValue.lat = '';
- this.fromValue.lon = '';
- }
- localStorage.setItem('locationRemark', res.data.addressLine);
- localStorage.setItem('orgName', res.data.orgName);
- if (
- this.fromValue.potentialCustomerType != null &&
- this.fromValue.potentialCustomerType != undefined
- ) {
- } else {
- this.fromValue.potentialCustomerType = '';
- }
- if (this.fromValue.carShopImgList != null) {
- } else {
- this.fromValue.carShopImgList = [];
- }
- if (this.fromValue.attribute3 != null) {
- } else {
- this.fromValue.attribute3 = '';
- }
- if (this.fromValue.attribute5 != null) {
- } else {
- this.fromValue.attribute5 = '';
- }
- // this.getChainsByDeptCode(res.data.orgId)
- this.getChainsByDeptCode(null, res.data.ifJzStoreType);
- if (
- this.verifyStoreType(this.fromValue.storeCategory) &&
- this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
- ) {
- this.typeABshow = true;
- this.dictTypeFormShow = true;
- }
- // if (this.fromValue.storeCategory == '129081') {
- // this.dictTypeAFormShow = true;
- // }
- // if (this.fromValue.storeCategory == '10131') {
- // this.dictTypeFormShow = true;
- // }
- if (this.fromValue.attribute3 == '0') {
- this.attrShow = true;
- }
- if (this.fromValue.storeCategory == 'sjs61') {
- this.dictTypeSJSFormShow = true;
- }
- if (this.fromValue.storeCategory == 'zyjz63') {
- this.dictTypeQGJZFormShow = true;
- } else {
- this.dictTypeQGJZFormShow = false;
- }
- if (this.fromValue.storeCategory == 'C912') {
- this.storeTypePOP = false;
- this.storeName = '铭牌上项目名称';
- this.address = '地址';
- } else if (this.fromValue.storeCategory == 'C917') {
- this.storeTypePOP = false;
- this.storeName = '名称';
- this.address = '地址';
- } else {
- this.storeTypePOP = true;
- this.storeName = '名称';
- this.address = '地址';
- }
- if (this.fromValue.storeCategory == 'C917') {
- this.GZAttributeFormShow = true;
- this.dictTypeSJSFormShow = false;
- this.dictTypeQGJZFormShow = false;
- this.dictTypeFormShow = false;
- this.dictTypeAFormShow = false;
- this.typeABshow = false;
- } else {
- this.GZAttributeFormShow = false;
- }
- localStorage.setItem('chainName', res.data.storeName);
- this.getStreetQuery();
- this.getStreetQuery('1');
- this.getStreetQuery('2');
- this.getStreetQuery('3');
- this.beforeAddFn(res.data.ifJzStoreType);
- } else {
- this.$toast.fail(res.msg);
- }
- });
- },
- newimgarr1(val) {
- if (val.type == '1') {
- this.fromValue.img = val.fileUrl;
- } else if (val.type == '2') {
- // this.fromValue.imgSed = val.fileUrl;
- this.displayImg.push(val.fileUrl);
- } else {
- this.fromValue.carShopImgList.push(val.fileUrl);
- }
- },
- // 关闭无效店铺
- valid() {
- this.$dialog
- .confirm({
- title: '系统提示',
- message: '是否确认无效关店?',
- })
- .then(() => {
- this.toastLoading();
- valid({ storeId: this.$route.query.id }).then((res) => {
- this.toastLoading().clear();
- if (res.code == 200) {
- this.$router.go(-2);
- } else {
- this.Toast({
- message: res.msg,
- duration: 3000,
- });
- }
- });
- });
- },
- beforeAddFn(ifJzStoreType) {
- beforeAdd({
- cityName: this.fromValue.cityName,
- districtName: this.fromValue.districtName,
- ifJzStoreType: ifJzStoreType,
- storeId: this.$route.query.id,
- }).then((res) => {
- this.storeCategoryList = res.data.storeCategoryList;
- });
- },
- getbrands() {
- getbrands({}).then((res) => {
- var brandst = [];
- for (var t = 0; t < res.data.length; t++) {
- brandst.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.brandst = brandst;
- });
- },
- addVisits2() {
- var that = this;
- var map = new TMap.Map('allmap', {
- zoom: 15,
- center: new TMap.LatLng(39.986785, 116.301012),
- });
- var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
- var markers = new TMap.MultiMarker({
- map: map,
- geometries: [],
- });
- markers.setGeometries([]);
- var latlng = this.gcj02BD(this.fromValue.lat, this.fromValue.lon);
- var location = new TMap.LatLng(latlng.lat, latlng.lon);
- map.setCenter(location);
- markers.updateGeometries([
- {
- id: 'marker',
- position: location,
- },
- ]);
- geocoder.getAddress({ location: location }).then(function (result) {
- var addresses = result.result.formatted_addresses;
- (that.cityName = result.result.ad_info.city),
- (that.districtName = result.result.ad_info.district),
- (that.provinceName = result.result.ad_info.province),
- (that.addressLine = addresses.recommend);
- localStorage.setItem('locationRemark', addresses.recommend);
- localStorage.setItem('address', addresses.recommend);
- that.beforeAddFn();
- });
- },
- getLocation() {
- getPosition()
- .then((res) => {
- let { TXisBD } = res;
- this.location = TXisBD;
- this.fromValue.lat = TXisBD.lat;
- this.fromValue.lon = TXisBD.lon;
- })
- .catch((error) => {
- this.$dialog.alert({
- message: error,
- });
- });
- },
- showPickerChainsListFn() {
- if (this.fromValue.storeCategoryName == '') {
- this.$toast('类型未选择');
- return;
- } else if (this.fromValue.orgName == '') {
- this.$toast('部门未选择');
- return;
- } else {
- // 分销店
- if (
- this.verifyStoreType(this.fromValue.storeCategory) &&
- this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
- ) {
- this.getStoreChainsContact();
- } else {
- this.showPickerChainsList = true;
- }
- }
- },
- // 同城分销-属性信息
- 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].dictValue,
- remark: res.data[t].remark,
- });
- }
- this.TCFXList = TCFXList;
- });
- },
- 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;
- });
- },
- onProvinceConfirm(value) {
- this.fromValue.provinceName = value.text;
- this.fromValue.province = value.provinceCode;
- this.fromValue.cityName = '';
- this.fromValue.city = '';
- this.fromValue.districtName = '';
- this.fromValue.district = '';
- this.fromValue.townName = '';
- this.fromValue.townCode = '';
- this.countyCode = '';
- this.cityCode = '';
- this.provinceCode = value.provinceCode;
- this.getStreetQuery('1');
- this.showProvincePicker = false;
- },
- onCityConfirm(value) {
- this.fromValue.cityName = value.text;
- this.fromValue.city = value.cityCode;
- this.fromValue.districtName = '';
- this.fromValue.district = '';
- this.fromValue.townName = '';
- this.fromValue.townCode = '';
- this.countyCode = '';
- this.cityCode = value.cityCode;
- this.getStreetQuery('2');
- this.showCityPicker = false;
- },
- onDistrictConfirm(value) {
- this.fromValue.districtName = value.text;
- this.fromValue.district = value.countyCode;
- this.fromValue.townName = '';
- this.fromValue.townCode = '';
- this.countyCode = value.countyCode;
- this.fromValue.cityLevel = value.countyLevel;
- this.getStreetQuery('3');
- this.showDistrictPicker = false;
- },
- onTownConfirm(value) {
- this.fromValue.townName = value.text;
- this.fromValue.townCode = value.townCode;
- this.showTownPicker = false;
- },
- onTCFXLConfirm(value) {
- this.fromValue.tcfxName = value.text;
- this.fromValue.tcfxCode = value.dictCode;
- this.showTCFXL = false;
- },
- moreTypeShowFn() {
- if (this.fromValue.storeCategoryName == '') {
- this.$toast('类型未选择');
- return;
- } else if (this.fromValue.orgName == '') {
- this.$toast('部门未选择');
- return;
- } else {
- this.ChainsLists = [];
- this.moreTypeShow = true;
- }
- },
- onConfirm(value) {
- // || value.dictValue == "129081" ||value.dictValue == "10131"
- this.fromValue.storeCategoryName = value.text;
- this.fromValue.storeCategory = value.dictValue;
- if (
- this.verifyStoreType(this.fromValue.storeCategory) &&
- this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
- ) {
- this.typeABshow = true;
- this.dictTypeFormShow = true;
- } else {
- this.typeABshow = false;
- this.fromValue.carShop = '';
- this.fromValue.carShopImgList = [];
- this.fromValue.tcfxName = '';
- this.fromValue.tcfxCode = '';
- this.dictTypeFormShow = false;
- }
- // if (value.dictValue == '129081') {
- // this.dictTypeAFormShow = true;
- // } else {
- // this.fromValue.tcfxName = '';
- // this.fromValue.tcfxCode = '';
- // this.dictTypeAFormShow = false;
- // }
- if (value.dictValue == 'C917') {
- this.GZAttributeFormShow = true;
- this.dictTypeSJSFormShow = false;
- this.dictTypeQGJZFormShow = false;
- this.dictTypeFormShow = false;
- this.dictTypeAFormShow = false;
- this.typeABshow = false;
- } else {
- this.fromValue.tcfxName = '';
- this.fromValue.tcfxCode = '';
- this.GZAttributeFormShow = false;
- }
- // if (value.dictValue == '10131') {
- // this.dictTypeFormShow = true;
- // } else {
- // this.fromValue.tcfxName = '';
- // this.fromValue.tcfxCode = '';
- // this.dictTypeFormShow = false;
- // }
- if (value.dictValue == 'sjs61') {
- this.dictTypeSJSFormShow = true;
- } else {
- this.fromValue.tcfxName = '';
- this.fromValue.tcfxCode = '';
- this.dictTypeSJSFormShow = false;
- }
- if (value.dictValue == 'zyjz63') {
- this.dictTypeQGJZFormShow = true;
- } else {
- this.fromValue.tcfxName = '';
- this.fromValue.tcfxCode = '';
- this.dictTypeQGJZFormShow = false;
- }
- if (this.fromValue.ifJzStoreType == 1 && value.ifJzStoreType != 1) {
- this.$toast('家装公司不能变为同城店');
- return;
- } else if (this.fromValue.ifJzStoreType != 1 && value.ifJzStoreType == 1) {
- this.$toast('同城店不能变为家装公司');
- return;
- } else {
- this.fromValue.chainName = '';
- this.fromValue.chainCode = '';
- this.fromValue.orgName = '';
- this.fromValue.orgId = '';
- this.fromValue.storeCategoryName = value.dictLabel;
- this.fromValue.storeCategory = value.dictValue;
- this.fromValue.ifJzStoreType = value.ifJzStoreType;
- this.getChainsByDeptCode(null, value.ifJzStoreType);
- // 切换门店类型删除选定经销商
- this.treeSelect = [];
- this.sfaStoreChainsContactList = []; //选中确定的经销商
- this.activatedTCFXList = []; //选中的经销商
- this.showPicker = false;
- }
- if (value.dictValue == 'C912') {
- this.storeTypePOP = false;
- this.storeName = '铭牌上项目名称';
- this.address = '地址';
- } else if (value.dictValue == 'C917') {
- this.storeTypePOP = false;
- this.storeName = '名称';
- this.address = '地址';
- } else {
- this.storeTypePOP = true;
- this.storeName = '名称';
- this.address = '地址';
- }
- },
- onConfirmChainsList(value) {
- this.fromValue.chainName = value.chainName;
- this.fromValue.chainCode = value.chainCode;
- this.showPickerChainsList = false;
- this.moreTypeShow = false;
- },
- numberFn() {
- if (Number(this.fromValue.area) < 1) {
- this.fromValue.area = '';
- } else {
- this.fromValue.area = this.fromValue.area.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
- }
- },
- onSubmit() {
- this.fromValue.imgSed = this.displayImg.join(',');
- for (var n1 = 0; n1 < this.fromValue.orderProductStoreList.length; n1++) {
- for (var n2 = 0; n2 < this.sfaOrderProducts.length; n2++) {
- if (
- this.sfaOrderProducts[n2].storeProductId ==
- this.fromValue.orderProductStoreList[n1].storeProductId
- ) {
- this.fromValue.orderProductStoreList[n1].orderNum = this.sfaOrderProducts[n2].orderNum;
- }
- }
- }
- var fromValue = this.fromValue;
- var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- if (fromValue.orgId == '') {
- this.$toast('部门未选择');
- return;
- } else if (fromValue.storeName == '') {
- if (fromValue.storeCategory == 'C912') {
- this.$toast('铭牌上项目名称未填写');
- } else if (fromValue.storeCategory == 'C917') {
- this.$toast('名称未填写');
- } else {
- this.$toast('名称未填写');
- }
- return;
- } else if (fromValue.addressLine == '') {
- if (fromValue.storeCategory == 'C912') {
- this.$toast('地址未填写');
- } else if (fromValue.storeCategory == 'C917') {
- this.$toast('地址未填写');
- } else {
- this.$toast('地址未填写');
- }
- return;
- } else if (fromValue.storeCategoryName == '') {
- this.$toast('类型未填写');
- return;
- } else if (fromValue.provinceName == '') {
- this.$toast('所在省份未填写');
- return;
- } else if (fromValue.cityName == '') {
- this.$toast('所在城市未填写');
- return;
- } else if (fromValue.districtName == '') {
- this.$toast('所在县区未填写');
- return;
- } else if (fromValue.townName == '') {
- this.$toast('所在街道未填写');
- return;
- } else if (
- fromValue.contactName == '' &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('联系人未填写');
- return;
- } else if (
- fromValue.telephone.trim() == '' &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('联系电话未填写');
- return;
- } else if (
- !telrg.test(fromValue.telephone) &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('手机号格式错误');
- return;
- } else if (
- !this.phoneNumber &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('不能填写业务员手机号');
- return;
- } else if (fromValue.img == '' && fromValue.storeCategory != 'C917') {
- if (this.storeTypePOP) {
- if (fromValue.ifJzStoreType != 1) {
- this.$toast('图片未上传');
- } else {
- this.$toast('家装前台照片未上传');
- }
- } else {
- this.$toast('照片未上传');
- }
- return;
- } else if (
- (fromValue.storeCategory == 'sjs61' || fromValue.storeCategory == 'zyjz63') &&
- fromValue.tcfxName == ''
- ) {
- this.$toast('属性未填写');
- return;
- }
- if (fromValue.area.trim() == '' && fromValue.ifJzStoreType == 1) {
- this.$toast('家装展厅面积未填写');
- return;
- }
- if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
- this.$toast('潜在客户类型未填写');
- return;
- }
- // 同城分销类型门店
- if (
- this.verifyStoreType(this.fromValue.storeCategory) &&
- this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
- ) {
- // 同城分销多经销商
- this.fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
- if (!this.fromValue.sfaStoreChainsContactList.length) {
- this.$toast('经销商未填写');
- return;
- }
- if (fromValue.tcfxName == '') {
- this.$toast('属性未填写');
- return;
- }
- } else {
- // 非同城分销店 经销商必填校验
- if (
- fromValue.chainName == '' &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C912' &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('经销商未选择');
- return;
- }
- if (
- fromValue.imgSed == '' &&
- fromValue.ifJzStoreType != 1 &&
- this.storeTypePOP &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('图片未上传');
- return;
- }
- }
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- // 当前定位复制
- this.fromValue.myLat = this.location.lat;
- this.fromValue.myLon = this.location.lon;
- console.log(this.fromValue);
- updateStore(this.fromValue).then((res) => {
- loading1.clear();
- if (res.code == 200) {
- this.$dialog
- .alert({
- title: '系统提示',
- message: res.msg,
- })
- .then(() => {
- this.$router.go(-1);
- });
- } else {
- this.$dialog.alert({
- message: res.msg,
- messageAlign: 'left',
- });
- }
- });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- phoneCheck() {
- if (this.fromValue.ifJzStoreType != 1) {
- var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- if (this.fromValue.telephone.trim() == '') {
- return;
- } else if (!telrg.test(this.fromValue.telephone)) {
- this.$toast('手机号格式错误');
- return;
- } else {
- phoneCheck({ phoneNumber: this.fromValue.telephone }).then((res) => {
- if (res.code == 200) {
- this.phoneNumber = true;
- } else {
- this.phoneNumber = false;
- }
- });
- }
- }
- },
- // 陈列照 图片删除
- deleteImg(index) {
- this.displayImg.splice(index, 1);
- },
- // 预览
- previewsImg(index) {
- var arrimg = [];
- for (var imgi = 0; imgi < this.displayImg.length; imgi++) {
- arrimg.push(this.displayImg[imgi]);
- }
- ImagePreview({
- images: arrimg,
- startPosition: index,
- });
- },
- //获取经销商
- async getStoreChainsContact() {
- // 打开select,上次选中确认数据赋值给选中待确认,回显使用
- this.activatedTCFXList = JSON.parse(JSON.stringify(this.sfaStoreChainsContactList));
- if (!this.treeSelect.length) {
- this.toastLoading(0, '加载中...', true);
- listChainsByCategory({ orgId: this.fromValue.orgId }).then((res) => {
- this.toastLoading().clear();
- // 初始化数据
- res.data.forEach((val) => {
- val.dot = false;
- });
- this.showPickerChainsList = true;
- this.treeSelect = res.data;
- this.setCheckData();
- });
- } else {
- this.showPickerChainsList = true;
- this.setCheckData();
- }
- },
- setCheckData() {
- for (let x = 0; x < this.treeSelect.length; x++) {
- // 设置左侧选中图标
- let activate = this.activatedTCFXList.find((item) => {
- return item.categoryCode == this.treeSelect[x].code;
- });
- this.treeSelect[x].dot = activate ? true : false;
- // 右侧选中返现
- let children = this.treeSelect[x].children;
- if (children && this.treeSelect[x].dot) {
- for (let y = 0; y < children.length; y++) {
- let activate = this.activatedTCFXList.find((item) => {
- return (
- children[y].categoryCode == item.categoryCode &&
- children[y].chainCode == item.chainCode
- );
- });
- if (activate) {
- children[y].Check = true;
- } else {
- children[y].Check = false;
- }
- }
- }
- }
- this.$forceUpdate();
- this.activeIndex = 0;
- },
- // 左侧数据点击
- clickNav(index) {
- // this.treeSelect[index].children.forEach((val) => {
- // // 回显右侧选中
- // let activate = this.activatedTCFXList.find((item) => item.code == val.code);
- // val.Check = activate ? true : false;
- // });
- },
- // 右侧数据点击
- treeSelectItemClick(itemData, index, val, ind) {
- itemData.children.forEach((item) => {
- if (val.chainCode == item.chainCode) {
- item.Check = !item.Check;
- // 设置左侧选中图标
- itemData.dot = item.Check;
- } else {
- item.Check = false;
- }
- });
- this.$forceUpdate();
- },
- // 分销店 确认
- treeSelectConfirm() {
- let treeSelectArr = [];
- this.treeSelect.forEach((item) => {
- if (item.dot) {
- let childrenData = item.children.find((val) => val.Check);
- treeSelectArr.push(childrenData);
- }
- });
- if (!treeSelectArr.length) {
- this.$toast('请选择至少选择一个经销商');
- return false;
- }
- console.log(treeSelectArr);
- this.sfaStoreChainsContactList = treeSelectArr;
- this.showPickerChainsList = false;
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .myTab .van-tabs__nav--card {
- margin: 0 !important;
- border-left: 0;
- border-right: 0;
- }
- .myTab .van-tabs__wrap,
- .myTab .van-tabs__nav--card {
- height: 40px;
- }
- .myTab .van-tab {
- line-height: 40px;
- }
- .van-f-red {
- color: red;
- width: 4px;
- display: inline-block;
- }
- .storeEdit {
- .invalid {
- display: flex;
- justify-content: center;
- padding-bottom: 10px;
- .van-button {
- width: 70%;
- }
- }
- }
- .displayImg {
- overflow: hidden;
- .displayImgBox {
- position: relative;
- width: 48%;
- padding: 20px 0;
- height: 210px;
- float: left;
- margin-right: 4%;
- .title {
- text-align: center;
- padding: 5px 0;
- }
- }
- .displayImgBox:nth-child(even) {
- margin-right: 0;
- }
- i {
- position: absolute;
- right: 4px;
- color: white;
- background: red;
- overflow: hidden;
- border-radius: 50%;
- }
- }
- </style>
- <style lang="scss">
- #allmap {
- width: 100px;
- height: 100px;
- position: fixed;
- left: -2000px;
- }
- .van-dialog__confirm,
- .van-dialog__confirm:active {
- color: #0057ba;
- }
- .navBarTOP {
- position: fixed;
- width: 100%;
- z-index: 2;
- top: 0;
- }
- .typeRadioStore .van-radio {
- margin: 10px;
- }
- .typeRadioStore .van-radio__icon .van-icon {
- border: 0 !important;
- }
- .typeRadioStore .van-radio__icon--checked .van-icon {
- color: #1989fa;
- background-color: transparent;
- border-color: transparent;
- }
- .typeRadioStore .van-cell {
- padding: 0 16px;
- line-height: 40px;
- }
- .container .typeRadioStore .van-cell__title {
- height: 40px;
- }
- .typeRadioStore1 .van-radio__icon .van-icon {
- border-radius: 2px;
- border-color: #ccc !important;
- }
- .typeRadioStore1 .van-radio__icon--checked .van-icon {
- background-color: transparent;
- color: #1989fa;
- border-color: #1989fa !important;
- }
- .typeRadioStore1 .van-radio[aria-checked='true'] .van-radio__label {
- color: #1989fa;
- }
- .morelaji .van-cell {
- padding: 10px 0;
- }
- .storeEdit {
- .agencyBox {
- .header_btn {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 10px;
- font-size: 16px;
- border-bottom: 1px solid #ccc;
- div {
- padding: 3px;
- }
- }
- .van-sidebar {
- width: 100px;
- text-align: center;
- flex: none;
- }
- .treeSelectchildren {
- .item {
- display: flex;
- align-items: center;
- padding: 5px;
- .value {
- margin-left: 15px;
- }
- }
- }
- }
- .TCFXList {
- .van-field__control--custom {
- flex-direction: column;
- align-items: self-start;
- .sfaStoreChainsContactList {
- padding: 3px;
- }
- }
- }
- }
- </style>
|