mUinitBusiness.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276
  1. <template>
  2. <div class="mUinitBusiness">
  3. <div class="topTitle">
  4. <h3>个体工商户入驻</h3>
  5. <p>请认真填写申请信息,以便我们为您提供更好的服务!</p>
  6. </div>
  7. <div class="centBox">
  8. <el-steps :active="active" align-center>
  9. <el-step @click.native="changeActive(index = 1)" title="店铺信息"></el-step>
  10. <el-step @click.native="changeActive(index = 2)" title="主体信息"></el-step>
  11. <el-step @click.native="changeActive(index = 3)" title="经营者信息"></el-step>
  12. </el-steps>
  13. <div class="mFormBox">
  14. <div class="shopInfo" v-show="active === 1">
  15. <div class="form">
  16. <div class="inputItem">
  17. <div class="labelTit"><label><i>*</i>店铺名称:</label></div>
  18. <input type="text" v-model="personalForm.shopName" placeholder="请输入店铺名称">
  19. </div>
  20. <div class="inputItem">
  21. <div class="labelTit"><label><i>*</i>客服电话:</label></div>
  22. <input type="text" v-model="personalForm.servicePhone" placeholder="请输入客服电话">
  23. </div>
  24. <div class="inputItem">
  25. <div class="labelTit"><label><i>*</i>店铺负责人:</label></div>
  26. <input type="text" v-model="personalForm.chargePersonName" placeholder="请输入店铺负责人">
  27. </div>
  28. <div class="inputItem">
  29. <div class="labelTit"><label><i>*</i>负责人电话:</label></div>
  30. <input type="text" v-model="personalForm.chargePersonPhone" placeholder="请输入负责人电话">
  31. </div>
  32. <div class="inputItem">
  33. <div class="labelTit"><label>邀请码:</label></div>
  34. <input type="text" v-model="personalForm.invitationCode" placeholder="请输入邀请码">
  35. </div>
  36. <!-- <div class="inputItem arrow">
  37. <div class="labelTit"><label><i>*</i>店铺地址:</label></div>
  38. <input @click="showPopup" @focus="noBomBox" v-model="shopAdress" type="text" placeholder="请选择所在地区">
  39. <span class="iconfont">&#xe6ab;</span>
  40. <input type="text" v-model="personalForm.storeAddressDetail" placeholder="请输入详细地址">
  41. </div> -->
  42. <div class="inputItem">
  43. <div class="labelTit"><label><i>*</i>是否支持使用代金券</label></div>
  44. <!-- <input type="text" v-model="plannerForm.email" placeholder="请选择性别"> -->
  45. <div class="input">
  46. <van-radio-group v-model="personalForm.isVoucher" direction="horizontal">
  47. <van-radio :name="1">支持</van-radio>
  48. <van-radio :name="0">不支持</van-radio>
  49. </van-radio-group>
  50. </div>
  51. </div>
  52. <div class="inputItem">
  53. <div class="labelTit"><label><i>*</i>店铺类型</label></div>
  54. <!-- <input type="text" v-model="plannerForm.email" placeholder="请选择性别"> -->
  55. <div class="input">
  56. <van-radio-group v-model="personalForm.shopType" direction="horizontal">
  57. <van-radio name="1">商城</van-radio>
  58. <van-radio name="2">本地</van-radio>
  59. </van-radio-group>
  60. </div>
  61. </div>
  62. <div class="time-select-container" v-show="personalForm.shopType === '2'">
  63. <div class="inputItem">
  64. <div class="labelTit"><label><i>*</i>营业开始时间</label></div>
  65. <input type="text" v-model="personalForm.startTime" placeholder="请选择营业开始时间" @click="startTimeShow = true">
  66. </div>
  67. <div class="inputItem">
  68. <div class="labelTit"><label><i>*</i>营业结束时间</label></div>
  69. <input type="text" v-model="personalForm.endtime" placeholder="请选择营业开始时间" @click="endTimeShow = true">
  70. </div>
  71. </div>
  72. <div class="inputItem">
  73. <div class="labelTit"><label><i>*</i>店铺分类</label></div>
  74. <input @focus="noBomBox" type="text" placeholder="请选择店铺所属分类" v-model="selectShopCategoryStr" @click="show2 = true">
  75. <van-popup v-model="show2" round position="bottom">
  76. <div v-show="isQueryShopCategory" class="loading-container"><van-loading color="#ee0a24" type="spinner" />
  77. </div>
  78. <van-cascader v-model="personalForm.classificationId" title="请选择店铺所属分类" :field-names="categoryFieldName"
  79. :options="shopCategoryOptions" @close="show2 = false"
  80. @change="onShopCategoryChange($event, onFinishChooseShopCategory)" />
  81. </van-popup>
  82. </div>
  83. <div class="inputItem arrow" style="margin-top: 20px;">
  84. <div class="labelTit"><label><i>*</i>请选择地址</label></div>
  85. <div class="input" style="background-color: #a4a4a41f;" @click="show1 = true">
  86. {{ fieldValue || '请选择地区' }}
  87. </div>
  88. <!-- <span class="iconfont">&#xe6ab;</span> -->
  89. <input type="text" v-model="personalForm.storeAddressDetail" placeholder="请输入详细地址">
  90. <van-popup v-model="show1" round position="bottom">
  91. <!-- v-if="isRequestAddres" sb玩意不动态刷新,现在换了给方法,强行重新赋值,不完全完美的解决问题 -->
  92. <van-cascader v-model="personalForm.areaId" title="请选择所在地区" :options="options" @close="show1 = false"
  93. @change="onAddresChange" :field-names="{ text: 'name', value: 'id', children: 'children' }" />
  94. </van-popup>
  95. </div>
  96. <div class="inputItem arrow" style="margin-top: 20px;">
  97. <div class="labelTit"><label><i>*</i>代金券返还比例</label></div>
  98. <div class="voucher-wrapper">
  99. <input type="number" v-model.number="personalForm.voucherReturn" placeholder="请输入代金券返还比例,0 ~ 100%">
  100. %
  101. </div>
  102. </div>
  103. <div class="inputItem arrow" style="margin-top: 20px;">
  104. <div class="labelTit"><label><i>*</i>人均消费</label></div>
  105. <div class="voucher-wrapper">
  106. <input type="number" v-model.number="personalForm.perCapita" placeholder="人均消费额">
  107. </div>
  108. </div>
  109. <div class="inputItem arrow" style="margin-top: 20px;">
  110. <div class="labelTit"><label><i>*</i>广告图</label></div>
  111. <van-uploader style="margin-top: 20px;" v-model="advertisementList" @delete="handleDeleteAdvertisement"
  112. :after-read="(file) => { return afterRead(file, type = 'advertisement') }" />
  113. </div>
  114. <!-- <div class="inputItem">
  115. <div class="labelTit"><label><i>*</i>营销策划师</label></div>
  116. <div class="input" style="background-color: #a4a4a41f;" v-if="personalForm.areaId.length <= 0">
  117. 请先选择详细地址
  118. </div>
  119. <div class="input" style="background-color: #a4a4a41f;" v-else @click="showSubCompany = true">
  120. {{ companyValue || '请选择营销策划师' }}
  121. </div>
  122. <van-popup v-model="showSubCompany" round position="bottom" :style="{ height: '50%' }">
  123. <van-picker
  124. title="选择您的营销策划师"
  125. show-toolbar
  126. :columns="plannerColumns"
  127. value-key="name"
  128. @confirm="onPlannerConfirm"
  129. @cancel="showSubCompany = false"
  130. @change="onPlannerChange"
  131. visible-item-count="7"
  132. />
  133. <div class="loadingBox">
  134. <van-button :loading="companyLoading" type="default" @click="getMoreCompany" loading-text="加载中...">点击加载更多</van-button>
  135. </div>
  136. </van-popup>
  137. </div>
  138. <div class="inputItem">
  139. <div class="labelTit"><label><i>*</i>入驻套餐</label></div>
  140. <div class="input" style="background-color: #a4a4a41f;" @click="showSetMeal = true">
  141. {{ setMealValue || '请选择你的套餐'}}
  142. </div>
  143. <van-popup v-model="showSetMeal" round position="bottom" :style="{ height: '50%' }">
  144. <van-picker
  145. title="请选择你的套餐"
  146. show-toolbar
  147. :columns="setMealData"
  148. value-key="title"
  149. @confirm="onSetMealfirm"
  150. @cancel="showSetMeal = false"
  151. @change="onSetMealChange"
  152. visible-item-count="7"
  153. />
  154. </van-popup>
  155. </div> -->
  156. </div>
  157. </div>
  158. <div class="subjectInfo" v-show="active === 2">
  159. <div class="form">
  160. <div class="inputItem">
  161. <div class="labelTit"><label><i>*</i>商户名称:</label></div>
  162. <input type="text" v-model="personalForm.subjectName" placeholder="请输入商户名称">
  163. </div>
  164. <p class="describe">需与当地政府颁发的商业许可证书或企业注册证上的企业名称完全一致,信息审核审核
  165. 成功后,企业名称不可修改</p>
  166. <div class="inputItem">
  167. <div class="labelTit"><label><i>*</i>社会信用代码:</label></div>
  168. <input type="text" v-model="personalForm.subjectCode" placeholder="请输入社会信用代码">
  169. </div>
  170. <div class="inputItem arrow">
  171. <div class="labelTit"><label><i>*</i>注册地址:</label></div>
  172. <input @click="showRegionPopup" @focus="noBomBox" v-model="personalForm.subjectRegion" type="text"
  173. placeholder="请选择注册地址">
  174. <span class="iconfont">&#xe6ab;</span>
  175. <input type="text" v-model="personalForm.subjectAdress" placeholder="请输入详细地址">
  176. </div>
  177. <div class="inputItem arrow">
  178. <div class="labelTit"><label><i>*</i>营业期限:</label></div>
  179. <input type="text" @focus="noBomBox" v-model="personalForm.subjectStartTime" placeholder="请选择营业开始时间"
  180. @click="selectStartDateBtn">
  181. <span class="iconfont">&#xe6ab;</span>
  182. </div>
  183. <div class="inputItem arrowTime">
  184. <input @focus="noBomBox" v-model="personalForm.subjectEndTime" type="text" placeholder="请选择营业截止时间"
  185. @click="selectEndDateBtn">
  186. <span class="iconfont">&#xe6ab;</span>
  187. </div>
  188. <p class="describe">
  189. 请填写营业执照上的营业期限 注意参照示例中的格式 结束时间需大于开始时间 有效期
  190. 必须大于60天
  191. </p>
  192. <div class="inputItem">
  193. <div class="labelTit"><label><i>*</i>营业执照:</label></div>
  194. <div class="businessLicense">
  195. <van-uploader v-model="fileList" :max-count="1"
  196. :after-read="(file) => { return afterRead(file, type = 'license') }" @oversize="onOversize">
  197. <!-- <van-uploader v-model="fileList" :max-count="1" :after-read="afterRead" @oversize="onOversize">-->
  198. <div icon="plus" type="primary">
  199. <div class="updateLicense">
  200. <div class="updateTop">
  201. <img src="../../assets/images/yingyezhiz@2x.png" alt="">
  202. </div>
  203. <div class="updateBottom">添加营业执照</div>
  204. </div>
  205. </div>
  206. <template #preview-cover="{ file }">
  207. <div class="preview-cover van-ellipsis">营业执照</div>
  208. </template>
  209. </van-uploader>
  210. </div>
  211. </div>
  212. <p class="describe">
  213. 仅支持在有效期内的中国大陆工商局或市场监督管理局颁发的工商营业执照。格式要求:
  214. 原证照片、扫描件或者 复印件加盖企业公章后的扫描
  215. </p>
  216. </div>
  217. </div>
  218. <div class="subjectInfo" v-show="active === 3">
  219. <div class="form">
  220. <div class="inputItem">
  221. <div class="labelTit"><label><i>*</i>经营者姓名:</label></div>
  222. <input v-model="personalForm.subjectOperator" type="text" placeholder="请输入经营者姓名">
  223. </div>
  224. <div class="inputItem arrow">
  225. <div class="labelTit"><label><i>*</i>证件类型:</label></div>
  226. <input v-model="idType" @focus="noBomBox" type="text" placeholder="请选择证件类型" @click="idTypeShowFn">
  227. <span class="iconfont">&#xe6ab;</span>
  228. </div>
  229. <div class="inputItem">
  230. <div class="labelTit"><label><i>*</i>身份证号码:</label></div>
  231. <input v-model="personalForm.subjectIdCard" type="text" placeholder="请输入居民身份证号">
  232. </div>
  233. <div class="inputItem arrow">
  234. <div class="labelTit"><label><i>*</i>身份证有效期:</label></div>
  235. <input v-model="personalForm.subjectCardStartTime" @focus="noBomBox" type="text" placeholder="请选择身份证开始时间"
  236. @click="selectIdStartDateBtn">
  237. <span class="iconfont">&#xe6ab;</span>
  238. </div>
  239. <div class="inputItem arrowTime">
  240. <input v-model="personalForm.subjectCardEndTime" @focus="noBomBox" type="text" placeholder="请选择身份证有效期结束时间"
  241. @click="selectIdEndDateBtn">
  242. <span class="iconfont">&#xe6ab;</span>
  243. </div>
  244. <div class="inputItem">
  245. <div class="labelTit"><label><i>*</i>证件照片:</label></div>
  246. <div class="businessLicense">
  247. <van-uploader v-model="positive" :max-count="1"
  248. :after-read="(file) => { return afterRead(file, type = 'positive') }" @oversize="onOversize">
  249. <div icon="plus" type="primary">
  250. <div class="updateLicense">
  251. <div class="updateTop">
  252. <img src="../../assets/images/shouchishenfenz@2x.png" alt="">
  253. </div>
  254. <div class="updateBottom">身份证人像面</div>
  255. </div>
  256. </div>
  257. <template #preview-cover="{ file }">
  258. <div class="preview-cover van-ellipsis">身份证人像面</div>
  259. </template>
  260. </van-uploader>
  261. </div>
  262. <div class="businessLicense">
  263. <van-uploader v-model="backIdImg" :max-count="1"
  264. :after-read="(file) => { return afterRead(file, type = 'back') }" @oversize="onOversize">
  265. <div icon="plus" type="primary">
  266. <div class="updateLicense">
  267. <div class="updateTop">
  268. <img src="../../assets/images/shenfenzb@2x.png" alt="">
  269. </div>
  270. <div class="updateBottom">身份证国徽面</div>
  271. </div>
  272. </div>
  273. <template #preview-cover="{ file }">
  274. <div class="preview-cover van-ellipsis">身份证国徽面</div>
  275. </template>
  276. </van-uploader>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. <button class="nextBtn" @click="next" v-show="active < 3">下一步</button>
  283. <button class="nextBtn" @click="submitForm" v-show="active > 2">提交</button>
  284. </div>
  285. <van-popup v-model="show" round position="bottom" :style="{ height: '40%' }">
  286. <van-area title="请选择地区" :area-list="areaList" @confirm="selectArea" @cancel="closeSelect" />
  287. </van-popup>
  288. <van-popup v-model="regionShow" round position="bottom" :style="{ height: '40%' }">
  289. <van-area title="请选择地区" :area-list="areaRegionList" @confirm="selectRegionArea" @cancel="closeRegionSelect" />
  290. </van-popup>
  291. <van-popup v-model="startDateShow" round position="bottom" :style="{ height: '40%' }">
  292. <van-datetime-picker v-model="startDate" type="date" title="请选择营业执照开始时间" :min-date="minDate" :max-date="maxDate"
  293. :formatter="formatter" @confirm="selectStartTime" @cancel="closeStartTime" />
  294. </van-popup>
  295. <van-popup v-model="endDateShow" round position="bottom" :style="{ height: '40%' }">
  296. <van-datetime-picker v-model="endDate" type="date" title="请选择营业执照到期时间" :min-date="minDate" :max-date="maxDate"
  297. :formatter="formatter" @confirm="selectEndTime" @cancel="closeEndTime" />
  298. </van-popup>
  299. <van-popup v-model="idCardStartShow" round position="bottom" :style="{ height: '40%' }">
  300. <van-datetime-picker v-model="idCardStartDate" type="date" title="请选择身份证开始时间" :min-date="minDate"
  301. :max-date="maxDate" :formatter="formatter" @confirm="selectIdCardStartTime" @cancel="closeIdCardStartTime" />
  302. </van-popup>
  303. <van-popup v-model="idCardEndShow" round position="bottom" :style="{ height: '40%' }">
  304. <van-datetime-picker v-model="idCardEndDate" type="date" title="请选择身份证到期时间" :min-date="minDate" :max-date="maxDate"
  305. :formatter="formatter" @confirm="selectIdCardEndTime" @cancel="closeIdCardEndTime" />
  306. </van-popup>
  307. <van-popup v-model="idTypeShow" round position="bottom" :style="{ height: '40%' }">
  308. <van-picker title="请选择证件类型" show-toolbar :columns="columns" @confirm="onConfirm" @cancel="onCancel" />
  309. </van-popup>
  310. <van-popup v-model="startTimeShow" round position="bottom">
  311. <van-datetime-picker @confirm="startTimeShow = false" @cancel="startTimeShow = false" type="time" title="请选择营业开始时间"
  312. :min-hour="1" :max-hour="24" v-model="personalForm.startTime" />
  313. </van-popup>
  314. <van-popup v-model="endTimeShow" round position="bottom">
  315. <van-datetime-picker @confirm="endTimeShow = false" @cancel="endTimeShow = false" type="time" title="请选择营业结束时间"
  316. :min-hour="1" :max-hour="24" v-model="personalForm.endtime" />
  317. </van-popup>
  318. </div>
  319. </template>
  320. <script>
  321. import { Area, Popup, DatetimePicker, Uploader, Toast, Picker, Cascader, RadioGroup, Radio, Button, Loading } from 'vant'
  322. import api from '@/api'
  323. import { listSearchMixin } from '@/config/mixin'
  324. import AreaList from '../../util/area'
  325. export default {
  326. mixins: [listSearchMixin],
  327. name: 'mPersonalBusiness',
  328. components: {
  329. [Area.name]: Area,
  330. [Popup.name]: Popup,
  331. [DatetimePicker.name]: DatetimePicker,
  332. [Uploader.name]: Uploader,
  333. [Toast.name]: Toast,
  334. [Picker.name]: Picker,
  335. [Cascader.name]: Cascader,
  336. [RadioGroup.name]: RadioGroup,
  337. [Radio.name]: Radio,
  338. [Button.name]: Button,
  339. [Loading.name]: Loading
  340. },
  341. data() {
  342. return {
  343. active: 1,
  344. areaList: AreaList,
  345. areaRegionList: AreaList,
  346. show: false,
  347. show2: false,
  348. regionShow: false,
  349. minDate: new Date(1960, 1, 1),
  350. maxDate: new Date(2077, 12, 31),
  351. startDate: '',
  352. endDate: '',
  353. idCardStartDate: '',
  354. idCardEndDate: '',
  355. startDateShow: false,
  356. endDateShow: false,
  357. idCardStartShow: false,
  358. idCardEndShow: false,
  359. idTypeShow: false,
  360. startTimeShow: false,
  361. endTimeShow: false,
  362. idType: '',
  363. fileList: [],
  364. backIdImg: [],
  365. advertisementList: [],
  366. positive: [],
  367. shopAdress: '', // 店铺地区
  368. subjectRegion: '', // 注册地址地区
  369. personalForm: {
  370. startTime: '', // 营业开始时间
  371. shopName: '', // 店铺名称
  372. shopPhone: '', // 手机号
  373. servicePhone: '', // 客服电话
  374. chargePersonName: '', // 店铺负责人
  375. chargePersonPhone: '', // 负责人电话
  376. shopAdress: '', // 店铺地址
  377. shopAdressProvince: '', // 店铺地址省
  378. shopAdressCity: '', // 店铺地址市
  379. storeAddressDetail: '', // 店铺详细地址
  380. subjectName: '', // 商户名称
  381. subjectCode: '', // 统一社会信用代码
  382. subjectRegion: '', // 注册地址 省-市-区
  383. subjectAdress: '', // 注册地址详细
  384. subjectStartTime: '', // 营业期限开始时间
  385. subjectEndTime: '', // 营业期限结束时间
  386. subjectLicense: '', // 营业执照图片地址
  387. subjectOperator: '', // 经营者姓名
  388. subjectCardType: '', // 身份证类型
  389. subjectIdCard: '', // 经营者身份证号码
  390. subjectCardStartTime: '', // 证件有效开始时间
  391. subjectCardEndTime: '', // 证件有效结束时间
  392. subjectCardPositive: '', // 身份证正面照
  393. subjectCardSide: '', // 身份证反面照
  394. parentId: '',
  395. shopType: '1', // 店铺类型 1商城 2本地
  396. isVoucher: 1, // 是否支持使用代金卷
  397. voucherReturn: '', // 代金卷的抵扣比例/返还比例
  398. areaId: '', // 区域ID
  399. packageId: '',
  400. classificationId: '', // 商家所属分类
  401. perCapita: "", // 人均消费
  402. invitationCode: localStorage.getItem('INVITATION_CODE'), // 邀请码
  403. advertisement: [],
  404. },
  405. show1: false,
  406. show3: false,
  407. showSubCompany: false,
  408. showSetMeal: false,
  409. plannerColumns: [],
  410. companyLoading: false,
  411. options: null,
  412. shopCategoryOptions: [],
  413. setMealData: [],
  414. companyValue: '',
  415. fieldValue: '',
  416. selectShopCategoryStr: "",
  417. setMealValue: '',
  418. idCardList: [],
  419. dictName: '证件类型',
  420. columns: [],
  421. categoryFieldName: {
  422. text: 'storeName',
  423. value: 'id',
  424. children: 'items',
  425. },
  426. isQueryShopCategory: false
  427. }
  428. },
  429. mounted() {
  430. this.getDictList()
  431. console.log(localStorage.getItem('INVITATION_CODE'));
  432. },
  433. created() {
  434. this.sendReq({
  435. url: api.getTreeClass,
  436. method: 'GET',
  437. params: {}
  438. }, (res) => {
  439. // console.log(res) // 获取地址选择器数据并去除空的子项
  440. this.options = res.data
  441. // console.log(this.options)
  442. })
  443. this.sendReq({
  444. url: api.getAdditional, // 套餐购买类型:1-商家,2-策划师 3-分公司
  445. method: 'GET',
  446. params: {
  447. type: 1
  448. }
  449. }, (res) => {
  450. // console.log(res) // 获取地址选择器数据并去除空的子项
  451. this.setMealData = res.data
  452. // console.log(this.options)
  453. })
  454. this.sendReq({
  455. url: api.getCategoryList,
  456. method: 'GET',
  457. params: {
  458. levelId: 1
  459. }
  460. }, res => {
  461. this.shopCategoryOptions = res.data
  462. })
  463. },
  464. methods: {
  465. getDictList() {
  466. let self = this
  467. let params = {
  468. url: api.getByName + '?dictName=' + self.dictName,
  469. method: 'GET'
  470. }
  471. self.sendReq(params, (res) => {
  472. if (res.code === '') {
  473. self.idCardList = res.data
  474. self.idCardList.forEach((item) => {
  475. var dictData = {}
  476. dictData['text'] = item.dictName
  477. dictData['value'] = item.dictId
  478. self.columns.push(dictData)
  479. })
  480. }
  481. })
  482. },
  483. showPopup() {
  484. this.show = true
  485. },
  486. showRegionPopup() {
  487. this.regionShow = true
  488. },
  489. next() {
  490. this.active++
  491. if (this.active === 4) {
  492. }
  493. },
  494. selectArea(address) {
  495. this.shopAdress = `${address[0].name}-${address[1].name}-${address[2].name}`
  496. this.personalForm.shopAdressProvince = address[0].name
  497. this.personalForm.shopAdressCity = address[1].name
  498. console.log(address)
  499. this.show = false
  500. },
  501. selectRegionArea(address) {
  502. this.personalForm.subjectRegion = `${address[0].name}-${address[1].name}-${address[2].name}`
  503. this.regionShow = false
  504. },
  505. closeRegionSelect() {
  506. this.regionShow = false
  507. },
  508. closeSelect() {
  509. this.show = false
  510. },
  511. selectStartDateBtn() {
  512. this.startDateShow = true
  513. },
  514. selectEndDateBtn() {
  515. this.endDateShow = true
  516. },
  517. selectIdStartDateBtn() {
  518. this.idCardStartShow = true
  519. },
  520. selectIdEndDateBtn() {
  521. this.idCardEndShow = true
  522. },
  523. dateTime(value) {
  524. let date = value
  525. let m = date.getMonth() + 1
  526. let d = date.getDate()
  527. if (m >= 1 && m <= 9) {
  528. m = '0' + m
  529. }
  530. if (d >= 0 && d <= 9) {
  531. d = '0' + d
  532. }
  533. return date.getFullYear() + '年-' + m + '月-' + d + '日'
  534. },
  535. idTypeShowFn() {
  536. this.idTypeShow = true
  537. },
  538. // 选择证件类型
  539. onConfirm(type) {
  540. this.idType = type.text
  541. this.personalForm.subjectCardType = type.value
  542. this.idTypeShow = false
  543. },
  544. onCancel() {
  545. this.personalForm.subjectCardType = ''
  546. this.idTypeShow = false
  547. },
  548. // 选择开始时间
  549. selectStartTime(value) {
  550. this.personalForm.subjectStartTime = this.dateTime(value)
  551. this.startDateShow = false
  552. },
  553. // 取消选择开始时间
  554. closeStartTime() {
  555. this.startDateShow = false
  556. },
  557. // 选择截止时间
  558. selectEndTime(value) {
  559. this.personalForm.subjectEndTime = this.dateTime(value)
  560. this.endDateShow = false
  561. },
  562. // 取消选择截止时间
  563. closeEndTime() {
  564. this.endDateShow = false
  565. },
  566. // 选择证件日期开始时间
  567. selectIdCardStartTime(value) {
  568. this.personalForm.subjectCardStartTime = this.dateTime(value)
  569. this.idCardStartShow = false
  570. },
  571. // 取消选择身份证开始时间
  572. closeIdCardStartTime() {
  573. this.idCardStartShow = false
  574. },
  575. // 证件到期时间
  576. selectIdCardEndTime(value) {
  577. this.personalForm.subjectCardEndTime = this.dateTime(value)
  578. this.idCardEndShow = false
  579. },
  580. // 取消选择身份证到期时间
  581. closeIdCardEndTime() {
  582. this.idCardEndShow = false
  583. },
  584. changeActive(index) {
  585. this.active = index
  586. },
  587. formatter(type, val) {
  588. if (type === 'year') {
  589. return `${val}年`
  590. } else if (type === 'month') {
  591. return `${val}月`
  592. } else if (type === 'day') {
  593. return `${val}日`
  594. }
  595. return val
  596. },
  597. afterRead(file, type) {
  598. // console.log(file.content, file.file.name)
  599. // let fileData = this.dataURLtoFileFun(file.content, file.file.name)
  600. let formData = new FormData()
  601. formData.append('file', this.dataURLtoFileFun(file.content, file.file.name))
  602. // console.log(fileData, 'fileData')
  603. let self = this
  604. let params = {
  605. url: api.upload,
  606. method: 'POST',
  607. contentType: 'multipart/form-data',
  608. data: formData
  609. }
  610. self.sendReq(params, (res) => {
  611. if (res.code === '200') {
  612. if (type === 'license') {
  613. self.personalForm.subjectLicense = res.data.url
  614. } else if (type === 'positive') {
  615. self.personalForm.subjectCardPositive = res.data.url
  616. } else if (type === 'back') {
  617. self.personalForm.subjectCardSide = res.data.url
  618. } else if (type === 'advertisement') {
  619. self.personalForm.advertisement.push(res.data.url)
  620. }
  621. // console.log("这是为什么呢?", this.advertisementList, res.data);
  622. } else {
  623. Toast.fail(res.message)
  624. }
  625. })
  626. // file.status = 'uploading'
  627. // file.message = '上传中...'
  628. // setTimeout(() => {
  629. // file.status = 'failed'
  630. // file.message = '上传失败'
  631. // }, 1000)
  632. },
  633. dataURLtoFileFun(dataurl, filename) {
  634. // 将base64转换为文件,dataurl为base64字符串,filename为文件名(必须带后缀名,如.jpg,.png)
  635. let arr = dataurl.split(',')
  636. let mime = arr[0].match(/:(.*?);/)[1]
  637. let bstr = atob(arr[1])
  638. let n = bstr.length
  639. let u8arr = new Uint8Array(n)
  640. while (n--) {
  641. u8arr[n] = bstr.charCodeAt(n)
  642. }
  643. return new File([u8arr], filename, { type: mime })
  644. },
  645. onOversize(file) {
  646. console.log(file)
  647. Toast.fail('文件大小不能超过 500kb')
  648. },
  649. // 禁止弹出键盘
  650. noBomBox(Event) {
  651. document.activeElement.blur()
  652. },
  653. // 提交申请
  654. submitForm() {
  655. let self = this
  656. const subData = JSON.parse(JSON.stringify(self.personalForm))
  657. subData.shopAdress = ''
  658. let reg = /^1[13456789]\d{9}$/
  659. var idReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
  660. subData.shopPhone = subData.servicePhone
  661. subData.shopAdress = `${self.shopAdress},${subData.storeAddressDetail}`
  662. // alert('submit!')
  663. if (subData.shopName === '') {
  664. Toast.fail('请输入店铺名称')
  665. return false
  666. }
  667. if (subData.servicePhone === '') {
  668. Toast.fail('请输入客服电话')
  669. return false
  670. } else if (!reg.test(subData.servicePhone)) {
  671. Toast.fail('客服电话号格式错误')
  672. return false
  673. }
  674. if (subData.chargePersonName === '') {
  675. Toast.fail('请输入店铺负责人')
  676. return false
  677. }
  678. if (subData.chargePersonPhone === '') {
  679. Toast.fail('请输入负责人电话')
  680. return false
  681. } else if (!reg.test(subData.chargePersonPhone)) {
  682. Toast.fail('负责人电话式错误')
  683. return false
  684. }
  685. if (subData.shopType === '2') {
  686. if (!subData.startTime) {
  687. Toast.fail('请选择营业开始时间')
  688. return
  689. }
  690. if (!subData.endtime) {
  691. Toast.fail('请选择营业结束时间')
  692. return
  693. }
  694. }
  695. if (subData.shopAdress === '') {
  696. Toast.fail('请选择所在地区')
  697. return false
  698. }
  699. if (subData.storeAddressDetail === '') {
  700. Toast.fail('请输入详细地址')
  701. return false
  702. }
  703. if (!subData.classificationId) {
  704. Toast.fail('请选择店铺所属分类')
  705. return
  706. }
  707. if (!subData.voucherReturn && subData.voucherReturn != 0) {
  708. Toast.fail('请输入代金券返回比例')
  709. return
  710. } else {
  711. if (isNaN(subData.voucherReturn) || subData.voucherReturn < 0 || subData.voucherReturn > 100) {
  712. Toast.fail('代金券返还比例应是0 ~ 100的数字')
  713. return
  714. }
  715. }
  716. if (!subData.perCapita) {
  717. Toast.fail('请填写人均消费额')
  718. return
  719. } else if (isNaN(subData.perCapita) || subData.perCapita <= 0) {
  720. Toast.fail('人均消费额不能小于等于0元')
  721. return
  722. }
  723. if (!subData.advertisement.length) {
  724. Toast.fail('请上传广告图')
  725. return
  726. } else {
  727. subData.advertisement = subData.advertisement.join(",")
  728. }
  729. if (subData.subjectName === '') {
  730. Toast.fail('请输入商户名称')
  731. return false
  732. }
  733. if (subData.subjectCode === '') {
  734. Toast.fail('请输入社会信用代码')
  735. return false
  736. }
  737. if (subData.subjectRegion === '') {
  738. Toast.fail('请输入注册地址')
  739. return false
  740. }
  741. if (subData.subjectAdress === '') {
  742. Toast.fail('请输入注册详情地址')
  743. return false
  744. }
  745. if (subData.subjectStartTime === '') {
  746. Toast.fail('请选择营业开始时间')
  747. return false
  748. }
  749. if (subData.subjectEndTime === '') {
  750. Toast.fail('请选择营业截止时间')
  751. return false
  752. }
  753. if (subData.subjectLicense === '') {
  754. Toast.fail('请上传营业执照')
  755. return false
  756. }
  757. if (subData.subjectOperator === '') {
  758. Toast.fail('请输入经营者姓名')
  759. return false
  760. }
  761. if (subData.subjectCardType === '') {
  762. Toast.fail('请选择证件类型')
  763. return false
  764. }
  765. if (subData.subjectIdCard === '') {
  766. Toast.fail('请输入居民身份证号')
  767. return false
  768. } else if (!idReg.test(subData.subjectIdCard)) {
  769. Toast.fail('身份证号码格式错误')
  770. return false
  771. }
  772. if (subData.subjectCardStartTime === '') {
  773. Toast.fail('请选择身份证开始时间')
  774. return false
  775. }
  776. if (subData.subjectCardEndTime === '') {
  777. Toast.fail('请选择身份证有效期结束时间')
  778. return false
  779. }
  780. if (subData.subjectCardPositive === '') {
  781. Toast.fail('请上传身份证正面照')
  782. return false
  783. }
  784. if (subData.subjectCardSide === '') {
  785. Toast.fail('请上传身份证背面照')
  786. return false
  787. }
  788. let params = {
  789. url: api.individualCheck,
  790. method: 'POST',
  791. data: subData
  792. }
  793. self.sendReq(params, (res) => {
  794. if (res.code === '200') {
  795. Toast.success('提交成功')
  796. self.$router.push({ path: '/mStatus' })
  797. } else {
  798. Toast.fail(res.message)
  799. }
  800. })
  801. },
  802. onAddresChange({ value, selectedOptions, tabIndex }) { // 选择完地址后转为显示的字符串
  803. let cacheArray = []
  804. let addresString = ''
  805. let level = ''
  806. this.sendReq({
  807. url: api.getTreeOne,
  808. method: 'GET',
  809. params: {
  810. parentId: value
  811. }
  812. }, (res) => {
  813. if (res.data && res.data.length > 0) {
  814. selectedOptions[selectedOptions.length - 1].children = res.data
  815. cacheArray = this.options.map(item => { // 这里重新再赋值一遍是因为这里直接改变数组页面不会动态刷新,所以每次都重新给options赋值,强制刷新
  816. return item
  817. })
  818. this.options = cacheArray
  819. }
  820. // this.isRequestAddres = true
  821. })
  822. for (let i = 0; i < selectedOptions.length; i++) {
  823. if (i >= selectedOptions.length - 1) {
  824. addresString += selectedOptions[i].name
  825. level = selectedOptions[i].level // 获取最后选择的地址的层级
  826. this.level = level
  827. } else {
  828. addresString += selectedOptions[i].name + ' / '
  829. }
  830. }
  831. this.fieldValue = addresString
  832. if (selectedOptions.length === 4) {
  833. this.personalForm.shopAdressProvince = selectedOptions[0].name
  834. this.personalForm.shopAdressCity = selectedOptions[1].name
  835. this.show1 = false
  836. // this.personalForm.province =
  837. }
  838. // this.sendReq({ // 获取可选择的分公司
  839. // url: api.selectAnd,
  840. // method: 'POST',
  841. // data: {
  842. // area: value, // 地区编号
  843. // type: 2,
  844. // level, // "区级别不能为空"
  845. // page: this.queryData.page,
  846. // pageSize: this.queryData.size
  847. // }
  848. // }, (res) => {
  849. // this.plannerColumns = res.data.list
  850. // console.log(res)
  851. // })
  852. // console.log(this.personalForm)
  853. },
  854. onPlannerConfirm(value) { // 确认选择的公司
  855. this.companyValue = value.name
  856. this.personalForm.parentId = value.platformUserId
  857. this.showSubCompany = false
  858. },
  859. onPlannerChange(value) {
  860. // console.log(value)
  861. },
  862. getMoreCompany() {
  863. this.companyLoading = true
  864. // eslint-disable-next-line eqeqeq
  865. if (this.plannerColumns.length == this.queryData.total) {
  866. this.queryData.pageSize += 7
  867. this.sendReq({ // 获取可选择的营销策划师
  868. url: api.selectAnd,
  869. method: 'POST',
  870. data: {
  871. area: this.personalForm.areaId, // 地区编号
  872. type: 2,
  873. level: this.level, // "区级别不能为空"
  874. page: this.queryData.page,
  875. pageSize: this.queryData.size
  876. }
  877. }, (res) => {
  878. this.plannerColumns = res.data.list
  879. this.companyLoading = false
  880. // console.log(res)
  881. })
  882. } else {
  883. Toast.fail('没有更多了')
  884. this.companyLoading = false
  885. }
  886. },
  887. onSetMealfirm(value) {
  888. // console.log(value)
  889. this.setMealValue = value.title
  890. this.personalForm.packageId = value.id
  891. this.showSetMeal = false
  892. },
  893. onSetMealChange(value) {
  894. // console.log(value)
  895. },
  896. // 店铺所属分类change
  897. async onShopCategoryChange(e, finishCB) {
  898. try {
  899. this.isQueryShopCategory = true
  900. let cacheArray = []
  901. const childCategoryList = await this.getChildCategory(e.value)
  902. if (childCategoryList.length) {
  903. e.selectedOptions[e.selectedOptions.length - 1].items = childCategoryList
  904. cacheArray = this.shopCategoryOptions.map(item => {
  905. return item
  906. })
  907. this.shopCategoryOptions = cacheArray
  908. } else {
  909. finishCB(e)
  910. }
  911. this.isQueryShopCategory = false
  912. } catch (error) {
  913. finishCB(e)
  914. this.isQueryShopCategory = false
  915. }
  916. },
  917. // 确认选择店铺所属分类
  918. onFinishChooseShopCategory(e) {
  919. this.selectShopCategoryStr = e.selectedOptions[e.selectedOptions.length - 1].storeName
  920. this.show2 = false
  921. },
  922. // 获取子集分类
  923. getChildCategory(dressing) {
  924. const _this = this
  925. return new Promise(async (resolve, reject) => {
  926. _this.sendReq({
  927. url: api.getChildCategoryList,
  928. method: "GET",
  929. params: {
  930. dressing
  931. }
  932. }, res => {
  933. resolve(res.data)
  934. })
  935. })
  936. },
  937. // 删除广告图
  938. handleDeleteAdvertisement(_, { index }) {
  939. this.personalForm.advertisement.splice(index, 1)
  940. }
  941. }
  942. }
  943. </script>
  944. <style lang="scss" scoped>
  945. .loadingBox {
  946. display: flex;
  947. justify-content: center;
  948. }
  949. .plannerItem {
  950. display: flex;
  951. align-items: center;
  952. .avatar {
  953. margin-top: -3px;
  954. width: 30px;
  955. height: 30px;
  956. }
  957. .custom-title {
  958. margin-top: -5px;
  959. margin-left: 20px;
  960. }
  961. }
  962. .input {
  963. width: 100%;
  964. margin: 10px 0px;
  965. border-bottom: 1px solid #F6F4F7;
  966. height: 40px;
  967. border-radius: 50px;
  968. line-height: 40px;
  969. font-size: 16px;
  970. color: #666666;
  971. padding-left: 10px;
  972. display: flex;
  973. align-items: center;
  974. }
  975. .mUinitBusiness {
  976. padding-bottom: 60px;
  977. .topTitle {
  978. padding: 0 5%;
  979. h3 {
  980. font-size: 21px;
  981. color: #333333;
  982. margin-bottom: 22px;
  983. }
  984. p {
  985. font-size: 12px;
  986. color: #676870;
  987. }
  988. margin:50px 0 28px 0;
  989. }
  990. >>>.el-step__head {
  991. color: #E9EAEB;
  992. .el-step__icon {
  993. background: #FFFFFF;
  994. width: 50px;
  995. height: 50px;
  996. border-radius: 0;
  997. border: 1px solid #F3F4F5;
  998. }
  999. }
  1000. >>>.el-step__head.is-process {
  1001. border-color: #CDCDCD
  1002. }
  1003. >>>.el-step__line {
  1004. background-color: #F3F4F5;
  1005. height: 1px !important;
  1006. top: 50% !important;
  1007. overflow: hidden;
  1008. }
  1009. >>>.is-finish {
  1010. border-color: #C5AA7B;
  1011. color: #FFFFFF;
  1012. font-weight: 500 !important;
  1013. .el-step__icon {
  1014. background: #FFFFFF;
  1015. height: 50px;
  1016. width: 50px;
  1017. color: #C5AA7B;
  1018. border: 1px solid #C5AA7B;
  1019. border-radius: 0;
  1020. }
  1021. }
  1022. >>>.el-step__main {
  1023. .is-finish {
  1024. color: #333333;
  1025. }
  1026. }
  1027. >>>.el-step__title.is-process {
  1028. font-size: 14px;
  1029. color: #999999;
  1030. font-weight: 500;
  1031. }
  1032. >>>.el-step__title.is-wait {
  1033. font-size: 14px;
  1034. color: #999999;
  1035. font-weight: 500;
  1036. }
  1037. >>>.el-step__main {
  1038. .el-step__title {
  1039. font-size: 14px;
  1040. }
  1041. .is-success {
  1042. color: $mainColor;
  1043. }
  1044. }
  1045. .mFormBox {
  1046. padding: 0 5%;
  1047. margin-top: 41px;
  1048. .formTit {
  1049. span {
  1050. font-size: 17px;
  1051. font-weight: bold;
  1052. color: #444444;
  1053. line-height: 18px;
  1054. position: relative;
  1055. i {
  1056. background: linear-gradient(267deg, #FF8F25 0%, rgba(254, 179, 24, 0.48) 52%, rgba(255, 255, 255, 0) 100%);
  1057. opacity: 0.7;
  1058. display: block;
  1059. height: 11px;
  1060. width: 100%;
  1061. bottom: -2px;
  1062. position: absolute;
  1063. }
  1064. }
  1065. }
  1066. .form {
  1067. margin-top: 25px;
  1068. .inputItem {
  1069. margin-top: 20px;
  1070. .labelTit {
  1071. display: flex;
  1072. label {
  1073. color: #333333;
  1074. font-weight: 500;
  1075. font-size: 14px;
  1076. i {
  1077. color: $mainColor;
  1078. font-size: 15px;
  1079. margin-right: 5px;
  1080. }
  1081. }
  1082. }
  1083. input {
  1084. width: 100%;
  1085. border-bottom: 1px solid #F6F4F7;
  1086. height: 50px;
  1087. line-height: 50px;
  1088. font-size: 14px;
  1089. color: #666666;
  1090. padding-left: 10px;
  1091. }
  1092. input::placeholder {
  1093. color: #999999;
  1094. }
  1095. .voucher-wrapper {
  1096. display: flex;
  1097. align-items: center;
  1098. }
  1099. }
  1100. .arrow {
  1101. position: relative;
  1102. span {
  1103. position: absolute;
  1104. right: 5px;
  1105. top: 30px;
  1106. color: #999999;
  1107. }
  1108. }
  1109. .arrowTime {
  1110. position: relative;
  1111. span {
  1112. position: absolute;
  1113. right: 5px;
  1114. top: 20px;
  1115. color: #999999;
  1116. }
  1117. }
  1118. .describe {
  1119. color: #BBBBBB;
  1120. font-size: 12px;
  1121. margin-top: 10px;
  1122. line-height: 20px;
  1123. padding-left: 10px;
  1124. }
  1125. }
  1126. }
  1127. .nextBtn {
  1128. display: block;
  1129. margin: 50px auto 0 auto;
  1130. width: 315px;
  1131. height: 42px;
  1132. background: #333333;
  1133. color: $mainColor;
  1134. }
  1135. .businessLicense {
  1136. width: 100%;
  1137. background: #F3F4F5;
  1138. margin-top: 10px;
  1139. display: flex;
  1140. .van-uploader {
  1141. margin: 10px auto;
  1142. }
  1143. >>>.van-uploader__preview-image {
  1144. width: 162px;
  1145. height: 135px;
  1146. }
  1147. .updateLicense {
  1148. width: 162px;
  1149. height: 135px;
  1150. .updateTop {
  1151. display: flex;
  1152. justify-content: center;
  1153. height: 110px;
  1154. align-items: center;
  1155. img {
  1156. width: 169px;
  1157. height: 100px;
  1158. }
  1159. }
  1160. .updateBottom {
  1161. width: 162px;
  1162. height: 25px;
  1163. font-size: 13px;
  1164. line-height: 25px;
  1165. color: #999999;
  1166. text-align: center;
  1167. }
  1168. }
  1169. }
  1170. }
  1171. .preview-cover {
  1172. position: absolute;
  1173. bottom: 0;
  1174. box-sizing: border-box;
  1175. width: 100%;
  1176. padding: 4px;
  1177. color: #fff;
  1178. font-size: 12px;
  1179. text-align: center;
  1180. background: rgba(0, 0, 0, 0.3);
  1181. }
  1182. .centBox {
  1183. >>>.el-step {
  1184. .el-step:nth-child(1) {
  1185. .el-step__icon-inner {}
  1186. }
  1187. }
  1188. }
  1189. .loading-container {
  1190. position: fixed;
  1191. bottom: 0;
  1192. left: 0;
  1193. right: 0;
  1194. height: 400px;
  1195. display: flex;
  1196. align-items: center;
  1197. justify-content: center;
  1198. z-index: 1000;
  1199. }
  1200. </style>