StepThird.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. <template>
  2. <!--最后一步-->
  3. <div class="section">
  4. <div class="step-last">
  5. <!-- <h4 class="h4">免费开店</h4>
  6. <p class="title">申请开店完全免费,一个企业只能开一家店,申请到正式开通预计需1-3个工作日。了解更多请看《开店规则》</p>-->
  7. </div>
  8. <div class="radioCheck">
  9. <label for="1" class="radioLabel">
  10. <input type="radio" v-model="selectFlag" name="role" value="open" id="1"/>
  11. <label for="1" class="txtContact"></label>
  12. <span>免费开店</span>
  13. </label>
  14. <label for="2" class="radioLabel">
  15. <input type="radio" v-model="selectFlag" name="role" value="seller" id="2" checked/>
  16. <label for="2" class="txtContact"></label>
  17. <span>暂不开店直接寄售</span>
  18. </label>
  19. </div>
  20. <!--导入店铺模板-->
  21. <div class="container vendor_store_apply" v-show="selectFlag == 'open'">
  22. <div>
  23. <!-- Nav tabs -->
  24. <ul class="nav nav-tabs">
  25. <li><div style="height: 39px;line-height: 39px;font-size: 14px;">店铺类型:</div></li>
  26. <li class="custom_tab" :class="{active: tab == 'ORIGINAL_FACTORY'}" @click="toggleTab('ORIGINAL_FACTORY')">
  27. <a href="javascript:void(0)">原厂</a>
  28. </li>
  29. <li class="custom_tab" :class="{active: tab == 'AGENCY'}" @click="toggleTab('AGENCY')">
  30. <a href="javascript:void(0)">代理商</a>
  31. </li>
  32. <li class="custom_tab" :class="{active: tab == 'DISTRIBUTION'}" @click="toggleTab('DISTRIBUTION')">
  33. <a href="javascript:void(0)">经销商</a>
  34. </li>
  35. </ul>
  36. <!-- Tab panes -->
  37. <div class="tab-content">
  38. <!-- 原厂 -->
  39. <div role="tabpanel" class="tab-pane" v-if="tab == 'ORIGINAL_FACTORY'" :class="{active: tab == 'ORIGINAL_FACTORY'}">
  40. <div class="row com_row">
  41. <div class="col-md-4 custom_col">
  42. <div class="row" style="margin: 0;">
  43. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  44. <upload :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload" :NopassThree="true"></upload>
  45. </div>
  46. <div class="col-md-5" style="padding: 0;">
  47. <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="col-md-4 custom_col">
  52. <div class="row" style="margin: 0;">
  53. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  54. <upload :typeData="'TAX_PAYER'" @uploadAction="onUpload" :NopassThree="true"></upload>
  55. </div>
  56. <div class="col-md-5" style="padding: 0;">
  57. <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="col-md-4 custom_col">
  62. <div class="row" style="margin: 0;">
  63. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  64. <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload" :NopassThree="true"></upload>
  65. </div>
  66. <div class="col-md-5" style="padding: 0;">
  67. <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
  72. </div>
  73. <!--增加品牌-->
  74. <div class="brand-type row" v-for="(brand, index) in brands">
  75. <div class="col-md-1">品牌{{index+1}}<em v-if="index == 0">*</em></div>
  76. <div class="col-md-7">
  77. <input type="text" v-model="brand.name"
  78. @input="onBrandInput(brand, index)"
  79. @blur.stop.prevent="onBrandChanged(brand, index)"
  80. class="form-control" name="brandName" autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
  81. <ul class="dropdown-menu"
  82. v-show="showSimilarKey.flag && showSimilarKey.index == index"
  83. @mouseenter="showFlag = true"
  84. @mouseleave="showFlag = false">
  85. <li @mouseenter="setKeyActive"
  86. @mouseleave="setKeyDefault"
  87. @click.stop.prevent="changedName(brand, index, key_index)"
  88. v-for="(key, key_index) in similarKeys[index]">
  89. <a v-text="key.nameCn">
  90. <!--<strong>C</strong>apital Advan<strong>c</strong>ed-->
  91. </a>
  92. </li>
  93. </ul>
  94. </div>
  95. <div class="brand-small-upload col-md-4">
  96. <div class="brand-small-img">
  97. <upload :typeData="index" @uploadAction="onUpload" :NopassThree="true"></upload>
  98. </div>
  99. <div class="file-text">品牌logo/商标注册原件/授权说明书</div>
  100. <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除"><i class="fa fa-trash"></i></div>
  101. <div class="col-md-12"><em v-if="index == 0">*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>
  102. </div>
  103. </div>
  104. <div class="add-brand row">
  105. <a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
  106. </div>
  107. <div class="unpass-reason row" style="display: none">
  108. 原因:<span style="color: #d32526;">原因</span>
  109. </div>
  110. </div>
  111. <!--原厂end-->
  112. <!--代理商 begin-->
  113. <div role="tabpanel" class="tab-pane" v-if="tab == 'AGENCY'" :class="{active: tab == 'AGENCY'}">
  114. <div class="row com_row">
  115. <div class="col-md-4 custom_col">
  116. <div class="row" style="margin: 0;">
  117. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  118. <upload :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload" :NopassThree="true"></upload>
  119. </div>
  120. <div class="col-md-5" style="padding: 0;">
  121. <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="col-md-4 custom_col">
  126. <div class="row" style="margin: 0;">
  127. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  128. <upload :typeData="'TAX_PAYER'" @uploadAction="onUpload" :NopassThree="true"></upload>
  129. </div>
  130. <div class="col-md-5" style="padding: 0;">
  131. <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
  132. </div>
  133. </div>
  134. </div>
  135. <div class="col-md-4 custom_col">
  136. <div class="row" style="margin: 0;">
  137. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  138. <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload" :NopassThree="true"></upload>
  139. </div>
  140. <div class="col-md-5" style="padding: 0;">
  141. <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
  146. </div>
  147. <!--增加品牌-->
  148. <div class="brand-type row" v-for="(brand, index) in brands">
  149. <div class="col-md-1">品牌{{index+1}}<em>*</em></div>
  150. <div class="col-md-7">
  151. <input type="text" v-model="brand.name"
  152. @input="onBrandInput(brand, index)"
  153. @blur.stop.prevent="onBrandChanged(brand, index)"
  154. class="form-control" name="brandName" autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
  155. <ul class="dropdown-menu"
  156. v-show="showSimilarKey.flag && showSimilarKey.index == index"
  157. @mouseenter="showFlag = true"
  158. @mouseleave="showFlag = false">
  159. <li @mouseenter="setKeyActive"
  160. @mouseleave="setKeyDefault"
  161. v-for="(key, key_index) in similarKeys[index]">
  162. <a v-text="key.nameCn" @click.stop.prevent="changedName(brand, index, key_index)">
  163. <!--<strong>C</strong>apital Advan<strong>c</strong>ed-->
  164. </a>
  165. </li>
  166. </ul>
  167. </div>
  168. <div class="brand-small-upload col-md-4">
  169. <div class="brand-small-img">
  170. <upload :typeData="index" @uploadAction="onUpload" :NopassThree="true"></upload>
  171. </div>
  172. <div class="file-text">代理资格证/代理授权书</div>
  173. <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除"><i class="fa fa-trash"></i></div>
  174. <div class="col-md-12"> <em>*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>
  175. </div>
  176. </div>
  177. <div class="add-brand row">
  178. <a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
  179. </div>
  180. <div class="unpass-reason row" style="display: none">
  181. 原因:<span style="color: #d32526;">原因</span>
  182. </div>
  183. </div>
  184. <!--代理商 end-->
  185. <!--经销商 begin-->
  186. <div role="tabpanel" class="tab-pane" v-if="tab == 'DISTRIBUTION'" :class="{active: tab == 'DISTRIBUTION'}">
  187. <div class="row com_row">
  188. <div class="col-md-4 custom_col">
  189. <div class="row" style="margin: 0;">
  190. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  191. <upload :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload" :NopassThree="true"></upload>
  192. </div>
  193. <div class="col-md-5" style="padding: 0;">
  194. <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="col-md-4 custom_col">
  199. <div class="row" style="margin: 0;">
  200. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  201. <upload :typeData="'TAX_PAYER'" @uploadAction="onUpload" :NopassThree="true"></upload>
  202. </div>
  203. <div class="col-md-5" style="padding: 0;">
  204. <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
  205. </div>
  206. </div>
  207. </div>
  208. <div class="col-md-4 custom_col">
  209. <div class="row" style="margin: 0;">
  210. <div class="col-md-5 col-md-offset-1 show_image_area show_image">
  211. <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload" :NopassThree="true"></upload>
  212. </div>
  213. <div class="col-md-5" style="padding: 0;">
  214. <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
  215. </div>
  216. </div>
  217. </div>
  218. <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
  219. </div>
  220. </div>
  221. <!--经销商 end-->
  222. </div>
  223. <!-- Submit button -->
  224. <!-- <div style="padding: 28px 40px;">
  225. <button type="button" class="btn btn-primary" style="float: right" @click="submitApply">提交申请</button>
  226. <div class="clear-fix"></div>
  227. </div>-->
  228. </div>
  229. <!--删除上传图片-->
  230. <div class="com-del-box" style="display: none">
  231. <div class="title">
  232. <a><i class="fa fa-close fa-lg"></i></a>
  233. </div>
  234. <div class="content">
  235. <p><i class="fa fa-exclamation-circle"></i>是否删除选中信息</p>
  236. <div><a>取消</a><a>确认</a></div>
  237. </div>
  238. </div>
  239. <!--删除品牌图片-->
  240. <div class="com-del-box" style="display: none">
  241. <div class="title">
  242. <a><i class="fa fa-close fa-lg"></i></a>
  243. </div>
  244. <div class="content">
  245. <p><i class="fa fa-exclamation-circle"></i>品牌信息为重要信息,确定删除吗?</p>
  246. <div><a>取消</a><a>确认</a></div>
  247. </div>
  248. </div>
  249. <!--提示框-->
  250. <div class="com-del-box" v-if="showBrandNameInvalid">
  251. <div class="title">
  252. <a @click="showBrandNameInvalid = false"><i class="fa fa-close fa-lg"></i></a>
  253. </div>
  254. <div class="content">
  255. <p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>
  256. <p style="line-height: 20px;">前往<a @click="goBrandApply()" target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>
  257. </div>
  258. </div>
  259. </div>
  260. <!--<div class="step-last">
  261. <h4 class="h4">库存寄售</h4>
  262. <p class="title">无需开店,即可发布贵司仓库里的滞销产品,优软商城代为销售,匿名清仓无压力<button class="no-apply" @click="goProduct">暂不开店,直接寄售</button></p>
  263. </div>-->
  264. <div class="row btn-area">
  265. <span @click="sectionChange(2)">上一步</span>
  266. <span @click="btnDisabled?'':selectFlag == 'open'?submitApply():goProduct()" :class="btnDisabled?'btn-disabled':''">提交申请</span>
  267. </div>
  268. <div class="loading" v-show="showLoading">
  269. <img src="/images/all/loading.gif" alt="">
  270. </div>
  271. </div>
  272. </template>
  273. <script>
  274. import Upload from '~components/common/upload/upload.vue'
  275. export default {
  276. data () {
  277. return {
  278. tab: 'ORIGINAL_FACTORY',
  279. brands: [{
  280. type: 'BRAND',
  281. name: '',
  282. url: '',
  283. isPdf: false,
  284. brandUuid: ''
  285. }],
  286. businessLicenseUrl: '',
  287. taxPayerUrl: '',
  288. taxRegistrationUrl: '',
  289. // defaultBusinessUrl: '',
  290. showBrandNameInvalid: false,
  291. similarKeys: [[]],
  292. showSimilarKey: {
  293. flag: false,
  294. index: 0
  295. },
  296. showFlag: false,
  297. isSelfRegisterSuccess: true,
  298. selectFlag: 'open',
  299. showLoading: false,
  300. btnDisabled: false
  301. }
  302. },
  303. props: [
  304. 'checkData',
  305. 'registerData',
  306. 'loginData',
  307. 'enterpriseData',
  308. 'businessImgUrl'
  309. ],
  310. watch: {
  311. enterpriseData: function (val, oldVal) {
  312. if (val !== {}) {
  313. this.businessLicenseUrl = val.url || val.businessCodeImage || ''
  314. // this.defaultBusinessUrl = val.enBussinessCodeImage || ''
  315. }
  316. },
  317. businessImgUrl: function (val, oldVal) {
  318. this.businessLicenseUrl = val
  319. }
  320. },
  321. components: {
  322. Upload
  323. },
  324. computed: {
  325. user () {
  326. return this.$store.state.option.user
  327. }
  328. },
  329. methods: {
  330. sectionChange: function (type) {
  331. this.$emit('sectionEvent', type)
  332. },
  333. toggleTab (t) {
  334. this.tab = t
  335. this.brands = [{
  336. type: 'BRAND',
  337. name: '',
  338. url: '',
  339. isPdf: false,
  340. brandUuid: ''
  341. }]
  342. },
  343. onUpload: function (obj) {
  344. if (obj.type === 'BUSINESS_LICENSE') {
  345. // this.businessLicenseUrl = obj.url
  346. this.businessLicenseUrl = obj.url
  347. if (obj.url !== '') {
  348. this.$emit('businessImgUrlAction', this.businessLicenseUrl)
  349. }
  350. } else if (obj.type === 'TAX_PAYER') {
  351. this.taxPayerUrl = obj.url
  352. } else if (obj.type === 'TAX_REGISTRATION') {
  353. this.taxRegistrationUrl = obj.url
  354. } else if (typeof obj.type === 'number') {
  355. this.brands[obj.type].url = obj.url
  356. }
  357. },
  358. onBrandChanged: function (item, index) {
  359. this.showSimilarKey.flag = this.showFlag
  360. if (!this.showFlag) {
  361. this.onCheck(item)
  362. }
  363. },
  364. onCheck: function (item, index) {
  365. if (item.name && item.name !== '') {
  366. this.$http.get('/api/product/brand', {params: {name: item.name, op: 'by_name'}})
  367. .then(response => {
  368. item.brandUuid = response.data.uuid
  369. item.isPdf = item.url.substring(item.url.length - 4, item.url.length) === '.pdf'
  370. }, err => {
  371. console.log(err)
  372. this.showBrandNameInvalid = true
  373. })
  374. }
  375. },
  376. onBrandInput: function (brand, index) {
  377. this.showSimilarKey.flag = false
  378. this.$http.get('/search/similarBrands?keyword=' + brand.name)
  379. .then(response => {
  380. if (response.data.length > 0 && response.data instanceof Array) {
  381. this.similarKeys[index] = response.data
  382. }
  383. if (response.data.length > 0 && response.data instanceof Array) {
  384. this.showSimilarKey.flag = true
  385. this.showSimilarKey.index = index
  386. }
  387. })
  388. },
  389. changedName: function (brand, index, keyIndex) {
  390. brand.name = this.similarKeys[index][keyIndex].nameCn
  391. this.showSimilarKey.flag = false
  392. this.onCheck(brand)
  393. },
  394. setKeyActive: function (e) {
  395. e.target.setAttribute('class', 'active')
  396. },
  397. setKeyDefault: function (e) {
  398. e.target.setAttribute('class', '')
  399. },
  400. submitApply: function () {
  401. // 个人
  402. if (this.loginData.isSelf) {
  403. if (!this.registerData.isValidRegister) {
  404. this.$message.error('请输入正确的注册信息')
  405. } else if (!this.checkData.checked) {
  406. this.$message.error('您还没有勾选相关条款')
  407. } else {
  408. // 注册企业,并提交申请
  409. this.registerSelf()
  410. }
  411. } else { // 企业
  412. if (!this.checkData.checked) {
  413. this.$message.error('您还没有勾选相关条款')
  414. } else {
  415. // 提交申请
  416. this.storeApply(this.loginData.enterprise.uu)
  417. }
  418. }
  419. },
  420. // 个人用户,先注册企业,成功后,提交开店申请
  421. registerSelf: function () {
  422. this.showLoading = true
  423. this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
  424. .then(response => {
  425. if (response.data.success) {
  426. this.isSelfRegisterSuccess = true
  427. // 删除保存的缓存企业信息
  428. this.$http.delete('/basic/user/userCacheEnterprise')
  429. // 把当前用户登录企业信息切换为注册的企业
  430. this.$http.get(`/user/authentication/` + response.data.data.enuu).then(() => {
  431. // 重新获取登录用户信息
  432. this.$store.dispatch('loadUserInfo')
  433. this.loginData.isSelf = false
  434. this.loginData.enterprise.uu = response.data.data.enuu
  435. // 提交开店申请
  436. this.storeApply(response.data.data.enuu)
  437. // window.location.reload()
  438. this.showLoading = false
  439. })
  440. } else {
  441. this.isSelfRegisterSuccess = false
  442. this.showLoading = false
  443. this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
  444. }
  445. }, err => {
  446. console.log(err)
  447. this.isSelfRegisterSuccess = false
  448. this.showLoading = false
  449. this.$message.error('企业注册失败,请重新填写信息')
  450. })
  451. },
  452. // 提交开店申请
  453. storeApply: function (enuu) {
  454. this.showLoading = true
  455. let validCode = 0
  456. if (this.businessLicenseUrl === '') {
  457. this.$message.error('请上传营业执照')
  458. this.showLoading = false
  459. } else {
  460. if (this.brands[0].name === '') {
  461. validCode = 1
  462. } else if (this.brands[0].url === '') {
  463. validCode = 2
  464. }
  465. if (validCode === 0 || this.tab === 'DISTRIBUTION') {
  466. let qualifications = []
  467. qualifications.push({
  468. type: 'BUSINESS_LICENSE',
  469. resourceUrl: this.businessLicenseUrl,
  470. isPdf: this.isPdf(this.businessLicenseUrl)
  471. })
  472. if (this.taxPayerUrl !== '') {
  473. qualifications.push({
  474. type: 'TAX_PAYER',
  475. resourceUrl: this.taxPayerUrl,
  476. isPdf: this.isPdf(this.taxPayerUrl)
  477. })
  478. }
  479. if (this.taxPayerUrl !== '') {
  480. qualifications.push({
  481. type: 'TAX_REGISTRATION',
  482. resourceUrl: this.taxRegistrationUrl,
  483. isPdf: this.isPdf(this.taxRegistrationUrl)
  484. })
  485. }
  486. // console.log(qualifications)
  487. let tmpBrands = []
  488. this.brands.forEach(function (item) {
  489. if (item.name !== '' && item.url !== '') {
  490. tmpBrands.push(item)
  491. }
  492. })
  493. // 申请开店
  494. this.$http.post('/store-service/applications', {
  495. brands: tmpBrands,
  496. qualifications: qualifications,
  497. type: this.tab
  498. }).then(response => {
  499. this.showLoading = false
  500. if (response.data.success) {
  501. this.btnDisabled = true
  502. this.$message.success('感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!')
  503. } else {
  504. this.btnDisabled = true
  505. this.$message.error('开通店铺异常,请前往我的店铺查看店铺开通进度')
  506. }
  507. this.$http.post('/basic/enterprise/openVendor/' + enuu)
  508. .then(() => {
  509. // this.$http.get('/user/authentication/reflash')
  510. // .then(() => {
  511. // this.$http.get(`/user/authentication/` + enuu).then(() => {
  512. // this.$store.dispatch('loadUserInfo')
  513. // })
  514. // })
  515. window.setTimeout(function () {
  516. window.location.href = '/vendor#/store-apply/wait'
  517. }, 3000)
  518. })
  519. }, err => {
  520. console.log(err)
  521. this.$http.post('/basic/enterprise/openVendorSetRead/' + enuu)
  522. this.$message.error('开通店铺失败')
  523. this.showLoading = false
  524. })
  525. } else {
  526. if (validCode === 1) {
  527. this.$message.error('请添加品牌信息')
  528. this.showLoading = false
  529. } else if (validCode === 2) {
  530. this.$message.error('请上传品牌图片')
  531. this.showLoading = false
  532. }
  533. }
  534. }
  535. },
  536. addBrand: function () {
  537. this.brands.push({
  538. type: 'BRAND',
  539. name: '',
  540. url: '',
  541. isPdf: false,
  542. brandUuid: ''
  543. })
  544. this.similarKeys.push([])
  545. },
  546. deleteBrand: function (index) {
  547. this.brands.splice(index, 1)
  548. this.similarKeys.splice(index, 1)
  549. },
  550. isPdf: function (url) {
  551. return url.substring(url.length - 4, url.length) === '.pdf'
  552. },
  553. reflashEnterprise: function (enuu, url) {
  554. this.$http.post('/basic/enterprise/openVendor/' + enuu)
  555. .then(() => {
  556. this.$http.get('/user/authentication/reflash')
  557. .then(() => {
  558. this.$http.get(`/user/authentication/` + enuu).then(() => {
  559. this.$store.dispatch('loadUserInfo')
  560. window.location.href = url
  561. })
  562. }
  563. )
  564. }).catch((err) => {
  565. console.log(err)
  566. this.$message.error('开通卖家中心失败')
  567. })
  568. },
  569. goProduct: function (baseUrl) {
  570. if (this.loginData.isSelf) {
  571. if (!this.registerData.isValidRegister) {
  572. this.$message.error('请输入正确的注册信息')
  573. } else if (!this.checkData.checked) {
  574. this.$message.error('您还没有勾选相关条款')
  575. } else {
  576. this.showLoading = true
  577. this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
  578. .then(response => {
  579. if (response.data.success) {
  580. this.isSelfRegisterSuccess = true
  581. this.$http.delete('/basic/user/userCacheEnterprise')
  582. this.reflashEnterprise(response.data.data.enuu, baseUrl || '/vendor#/vendor_upload')
  583. } else {
  584. this.isSelfRegisterSuccess = false
  585. this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
  586. }
  587. this.showLoading = false
  588. }, err => {
  589. console.log(err)
  590. this.isSelfRegisterSuccess = false
  591. this.showLoading = false
  592. this.$message.error('企业注册失败,请重新填写信息')
  593. })
  594. }
  595. } else {
  596. if (!this.checkData.checked) {
  597. this.$message.error('您还没有勾选相关条款')
  598. } else {
  599. this.reflashEnterprise(this.loginData.enterprise.uu, baseUrl || '/vendor#/vendor_upload')
  600. }
  601. }
  602. },
  603. goBrandApply: function () {
  604. this.showBrandNameInvalid = false
  605. this.goProduct('/vendor#/brand/apply/')
  606. }
  607. }
  608. }
  609. </script>
  610. <style scoped>
  611. .com-input{
  612. width: 100%;
  613. height: 100%;
  614. text-align: center;
  615. position: absolute;
  616. bottom: 0;
  617. left: 0;
  618. opacity: 0;
  619. display: inline-block !important;
  620. }
  621. .el-upload-list--picture-card .el-upload-list__item{
  622. width: 160px;
  623. height: 120px;
  624. top: 69px;
  625. }
  626. div.vendor_store_apply {
  627. margin: 0 auto;
  628. width: 1026px;
  629. background-color: #FFFFFF;
  630. margin-bottom: 20px;
  631. margin-top: 25px;
  632. }
  633. div.vendor_store_apply .com_row {
  634. padding: 0 40px;
  635. min-height: 40px;
  636. }
  637. div.vendor_store_apply .title_row {
  638. margin-bottom: 20px;
  639. border-bottom: #e8e8e8 1px solid;
  640. }
  641. div.vendor_store_apply .custom_col {
  642. margin: 0;
  643. padding: 0;
  644. }
  645. div.vendor_store_apply .custom_col img.previewImage {
  646. max-width: 160px;
  647. max-height: 120px;
  648. cursor: pointer;
  649. /*padding: 0 30px;*/
  650. }
  651. div.vendor_store_apply .row h2 {
  652. padding: 10px 0;
  653. font-size: 16px;
  654. font-weight: 500;
  655. color: #000000;
  656. }
  657. div.vendor_store_apply .row span {
  658. display: block;
  659. padding: 10px 0;
  660. font-size: 14px;
  661. color: #000000;
  662. }
  663. div.vendor_store_apply #file_upload {
  664. width: 100px;
  665. height: 100px;
  666. border:1px solid #CDCDCD;
  667. /*background: url("static/img/vendor/images/upload.png");*/
  668. }
  669. div.vendor_store_apply #upload_qualification {
  670. width: 100px;
  671. height: 100px;
  672. opacity: 0;
  673. }
  674. div.vendor_store_apply .custom_tab {
  675. margin: 0 15px;
  676. width: 90px;
  677. text-align: center;
  678. }
  679. div.vendor_store_apply .nav li.custom_tab.active>a,
  680. div.vendor_store_apply .nav li.custom_tab.active>a:focus,
  681. div.vendor_store_apply .nav li.custom_tab.active>a:hover {
  682. border: 1px solid #5078CB;
  683. border-bottom-color: transparent;
  684. color: #5078cb;
  685. }
  686. div.vendor_store_apply .uploadify-button {
  687. display: block;
  688. }
  689. div.vendor_store_apply .custom_col .show_image_area {
  690. height: 120px;
  691. display: flex;
  692. justify-content: center;
  693. align-items: center;
  694. }
  695. .nav-tabs{
  696. height: 41px;
  697. background: none;
  698. padding: 0 40px;
  699. }
  700. .nav-tabs>li>a{
  701. border-radius: 0;
  702. color: #333;
  703. }
  704. div.vendor_store_apply .btn-primary{
  705. background: #5078cb;
  706. border-radius: 0;
  707. }
  708. div.vendor_store_apply .btn-primary:hover{
  709. background: #3f7ae3;
  710. }
  711. div.vendor_store_apply .com_row .col-md-2{
  712. width: 120px;
  713. }
  714. div.vendor_store_apply .com_row .col-md-10 span{
  715. color: #666;
  716. }
  717. /*修改的样式*/
  718. div.vendor_store_apply .custom_col .show_image_area{
  719. position: relative;
  720. overflow: hidden;
  721. }
  722. .hover-show{
  723. position: absolute;
  724. width: 100%;
  725. height: 100%;
  726. top: 120px;
  727. left: 0;
  728. background: rgba(0,0,0,.5);
  729. }
  730. div.vendor_store_apply .custom_col .show_image_area .hover-show{
  731. top: 0;
  732. }
  733. .hover-show .delete{
  734. padding: 0;
  735. width: 30px;
  736. height: 30px;
  737. float: right;
  738. text-align: center;
  739. }
  740. .hover-show .delete:hover{
  741. cursor: pointer;
  742. }
  743. .hover-show .delete i{
  744. color: #fff;
  745. font-size: 18px;
  746. }
  747. .hover-show a{
  748. display: inline-block;
  749. width: 100%;
  750. height: 60px;
  751. font-size: 14px;
  752. color: #fff;
  753. text-align: center;
  754. line-height: 60px;
  755. }
  756. .hover-show a i{
  757. margin-right: 5px;
  758. font-size: 16px;
  759. }
  760. .brand-type{
  761. line-height: 34px;
  762. font-size: 14px;
  763. margin: 20px 20px 5px 20px;
  764. }
  765. .brand-type .brand-small-img{
  766. position: relative;
  767. width: 84px;
  768. height: 84px;
  769. overflow: hidden;
  770. text-align: center;
  771. border: #e8e8e8 1px solid;
  772. }
  773. .brand-type .brand-small-img .preview img{
  774. max-width: 84px;
  775. max-height: 84px;
  776. }
  777. .brand-type em{
  778. color: #ff0000;
  779. }
  780. .brand-type .col-md-7,.brand-type .col-md-1{
  781. margin-top: 25px;
  782. }
  783. .brand-small-upload .file-text,.brand-type .brand-small-img{
  784. float: left;
  785. }
  786. .brand-small-upload .file-text{
  787. width: 120px;
  788. margin-left: 10px;
  789. line-height: 20px;
  790. margin-top: 6%;
  791. }
  792. .brand-small-upload .delete{
  793. float: right;
  794. text-align: center;
  795. line-height: 84px;
  796. }
  797. .brand-small-upload .delete i{
  798. font-size: 18px;
  799. color: #5078cb;
  800. }
  801. .brand-small-upload .delete:hover{
  802. cursor: pointer;
  803. }
  804. .brand-small-upload .delete:hover i{
  805. color: #f00;
  806. }
  807. .brand-small-upload .brand-small-img .hover-show{
  808. top: 0;
  809. }
  810. .brand-small-upload .brand-small-img .hover-show{
  811. }
  812. .brand-small-upload .brand-small-img .hover-show span i{
  813. color: #fff;
  814. }
  815. .brand-small-upload .brand-small-img .hover-show span.delete{
  816. line-height: 30px;
  817. padding: 0;
  818. }
  819. .brand-small-upload .brand-small-img .hover-show a{
  820. line-height: 30px;
  821. height: 30px;
  822. }
  823. .tab-content {
  824. border: 1px #5078CB solid;
  825. padding-bottom: 30px;
  826. }
  827. .tab-content .com_row{
  828. margin:40px 0 0;
  829. border-bottom: #ccc 1px dashed;
  830. padding-bottom: 40px !important;
  831. }
  832. .tab-content .com_row .col-md-12{
  833. color: #999;
  834. margin-top: 20px;
  835. font-size: 12px;
  836. padding-left: 50px;
  837. }
  838. .brand-small-upload .col-md-12{
  839. color: #999;
  840. font-size: 12px;
  841. padding-left: 0;
  842. }
  843. .tab-content .com_row .col-md-12 em,.brand-small-upload .col-md-12 em{
  844. color: #f00;
  845. }
  846. .add-brand{
  847. text-align: center;
  848. border-bottom: #ccc 1px dashed;
  849. margin: 0 0 20px 0;
  850. height: 34px;
  851. }
  852. .add-brand a{
  853. font-size: 14px;
  854. color: #5078cb;
  855. width: 200px;
  856. height: 15px;
  857. display: inline-block;
  858. border: #ccc 1px dashed;
  859. border-top: 0;
  860. border-bottom-left-radius: 50px;
  861. border-bottom-right-radius: 50px;
  862. margin-top: 31px;
  863. background: #fff;
  864. line-height: 15px;
  865. text-decoration: none;
  866. }
  867. .add-brand a i{
  868. margin-right: 5px;
  869. font-size: 20px;
  870. vertical-align: middle;
  871. }
  872. .add-brand a em{
  873. position: relative;
  874. top: -10px;
  875. font-weight: bold;
  876. font-style: inherit;
  877. }
  878. .add-brand a:hover em{
  879. color: #d32526;
  880. text-decoration: none;
  881. }
  882. .unpass-reason {
  883. margin: 0 40px;
  884. line-height: 34px;
  885. }
  886. /* 预览框 end */
  887. .brand-type .dropdown-menu {
  888. width: 95%;
  889. }
  890. .brand-type .dropdown-menu li {
  891. font-size: 14px;
  892. }
  893. .com-del-box{
  894. position: fixed;
  895. z-index: 1000;
  896. height: auto;
  897. opacity: 1;
  898. background-color: white;
  899. width: 310px;
  900. -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  901. -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  902. -o-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  903. box-shadow: 0 5px 15px rgba(0,0,0,.5);
  904. margin: -155px 0 0 -75px;
  905. top: 55%;
  906. left: 43%;
  907. }
  908. .com-del-box .title{
  909. height: 30px;
  910. background-color: #5078cb;
  911. text-align: right;
  912. padding-right: 15px;
  913. line-height: 30px;
  914. }
  915. .com-del-box .title a{
  916. color: white;
  917. font-size: 16px;
  918. }
  919. .com-del-box .content{
  920. width: 100%;
  921. text-align: center;
  922. margin: 0 auto;
  923. }
  924. .com-del-box .content p{
  925. line-height: 50px;
  926. font-size: 14px;
  927. padding-top: 10px;
  928. }
  929. .com-del-box .content p i{
  930. color: #5078cb;
  931. font-size: 16px;
  932. margin-right: 10px;
  933. }
  934. .com-del-box .content div{
  935. width: 100%;
  936. text-align: center;
  937. margin: 0 auto;
  938. }
  939. .com-del-box .content div a{
  940. width: 55px;
  941. height: 26px;
  942. line-height: 26px;
  943. display: inline-block;
  944. text-align: center;
  945. font-size: 14px;
  946. }
  947. .com-del-box .content div a:first-child{
  948. background: #b4b5b9;
  949. color: #333;
  950. margin-right: 10px;
  951. }
  952. .com-del-box .content div a:last-child{
  953. background: #5078cb;
  954. color: #fff;
  955. }
  956. .com-del-box .content div a:hover{
  957. background: #3f7ae3;
  958. color: #fff;
  959. }
  960. div.vendor_store_apply .custom_col .show_image_area{
  961. width: 160px;
  962. border: #dcdcdc 1px solid;
  963. margin: 0 10px 0 0;
  964. padding: 0;
  965. }
  966. div.vendor_store_apply .tab-content .custom_col{
  967. width: 280px;
  968. }
  969. div.vendor_store_apply .tab-content .custom_col:first-child{
  970. margin-left: 50px;
  971. }
  972. div.vendor_store_apply .custom_col .row .col-md-5:last-child{
  973. width: 110px;
  974. }
  975. div.vendor_store_apply .custom_col .row .col-md-5:last-child span{
  976. margin-top: 85% !important;
  977. padding-bottom: 0 !important;
  978. }
  979. .hoverShow{
  980. position: absolute;
  981. width: 30px;
  982. height: 30px;
  983. top: 0px;
  984. right: 0;
  985. background: rgba(0,0,0,.4);
  986. display: none;
  987. }
  988. div.vendor_store_apply .custom_col .show_image_area:hover .hoverShow{
  989. display: block;
  990. }
  991. div.vendor_store_apply .custom_col .show_image_area .deleteImg{
  992. position: absolute;
  993. right: 7px;
  994. top: 0;
  995. display: inline-block;
  996. padding: 0;
  997. margin-top: 6px;
  998. font-size: 18px;
  999. color: #fff;
  1000. }
  1001. .hover-show a{
  1002. color: #fff;
  1003. text-decoration: none;
  1004. }
  1005. .hover-show a:hover, .hover-show a:active, .hover-show a:focus{
  1006. color: #fff;
  1007. text-decoration: none;
  1008. }
  1009. /* .dropdown-menu>.active>a, .dropdown-menu>.active>a:focus, .dropdown-menu>.active>a:hover {
  1010. color: #fff;
  1011. }*/
  1012. .dropdown-menu {
  1013. display: block;
  1014. left: 14px;
  1015. }
  1016. /*
  1017. radio
  1018. */
  1019. .radioLabel {
  1020. line-height: 20px;
  1021. cursor: pointer;
  1022. }
  1023. .radioLabel label{
  1024. width: 16px;
  1025. height: 16px;
  1026. background: url("/images/messageBoard/radio.png");
  1027. background-position: 0 -1px;
  1028. vertical-align: middle;
  1029. margin-bottom: 0 !important;
  1030. margin-right: 0 !important;
  1031. cursor: pointer;
  1032. }
  1033. .radioLabel input[type="radio"]:checked + label {
  1034. background-position: -19px -1px;
  1035. }
  1036. .radioLabel input[type="radio"] + label + span {
  1037. margin-left: 5px;
  1038. }
  1039. .radioLabel input[type="radio"]:checked + label{
  1040. color: #5078cb;
  1041. }
  1042. .radioLabel input[type="radio"]{
  1043. display: none;
  1044. }
  1045. .radioLabel span {
  1046. font-weight: bold;
  1047. font-size: 18px;
  1048. color: #5e5e5e;
  1049. }
  1050. .radioCheck {
  1051. padding-top: 35px;
  1052. padding-left: 30px;
  1053. padding-bottom: 35px;
  1054. }
  1055. .radioCheck .radioLabel:first-child {
  1056. margin-right: 10px;
  1057. }
  1058. .btn-area {
  1059. margin-top: 20px;
  1060. text-align: center;
  1061. }
  1062. .btn-area span {
  1063. height: 35px;
  1064. line-height: 35px;
  1065. border: 1px solid #5078cb;
  1066. padding: 0 62px;
  1067. font-size: 16px;
  1068. display: inline-block;
  1069. color: #5078cb;
  1070. cursor: pointer;
  1071. background: #fff;
  1072. }
  1073. .btn-area span:first-child{
  1074. margin-right: 16px;
  1075. }
  1076. .btn-area span:last-child{
  1077. background: #5078cb;
  1078. color: #fff;
  1079. }
  1080. /* .btn-area span:hover {
  1081. }*/
  1082. .loading {
  1083. position: fixed;
  1084. top: 0;
  1085. left: 0;
  1086. right: 0;
  1087. width: 100%;
  1088. height: 100%;
  1089. z-index: 1000;
  1090. text-align: center;
  1091. }
  1092. .loading img {
  1093. position: relative;
  1094. top: 40%;
  1095. }
  1096. .btn-area .btn-disabled {
  1097. cursor: not-allowed;
  1098. opacity: .5;
  1099. }
  1100. </style>