StepThird.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  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" v-if="tab == 'ORIGINAL_FACTORY'"></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" v-bind:key="index">
  170. <upload :typeData="index" @uploadAction="onUpload" :NopassThree="true" v-if="tab == 'AGENCY'"></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.splice(0, this.brands.length)
  336. this.brands.push({
  337. type: 'BRAND',
  338. name: '',
  339. url: '',
  340. isPdf: false,
  341. brandUuid: ''
  342. })
  343. },
  344. onUpload: function (obj) {
  345. if (obj.type === 'BUSINESS_LICENSE') {
  346. // this.businessLicenseUrl = obj.url
  347. this.businessLicenseUrl = obj.url
  348. if (obj.url !== '') {
  349. this.$emit('businessImgUrlAction', this.businessLicenseUrl)
  350. }
  351. } else if (obj.type === 'TAX_PAYER') {
  352. this.taxPayerUrl = obj.url
  353. } else if (obj.type === 'TAX_REGISTRATION') {
  354. this.taxRegistrationUrl = obj.url
  355. } else if (typeof obj.type === 'number') {
  356. this.brands[obj.type].url = obj.url
  357. }
  358. },
  359. onBrandChanged: function (item, index) {
  360. this.showSimilarKey.flag = this.showFlag
  361. if (!this.showFlag) {
  362. this.onCheck(item)
  363. }
  364. },
  365. onCheck: function (item, index) {
  366. if (item.name && item.name !== '') {
  367. this.$http.get('/api/product/brand', {params: {name: item.name, op: 'by_name'}})
  368. .then(response => {
  369. item.brandUuid = response.data.uuid
  370. item.isPdf = item.url.substring(item.url.length - 4, item.url.length) === '.pdf'
  371. }, err => {
  372. console.log(err)
  373. this.showBrandNameInvalid = true
  374. })
  375. }
  376. },
  377. onBrandInput: function (brand, index) {
  378. this.showSimilarKey.flag = false
  379. this.$http.get('/search/similarBrands?keyword=' + brand.name)
  380. .then(response => {
  381. if (response.data.length > 0 && response.data instanceof Array) {
  382. this.similarKeys[index] = response.data
  383. }
  384. if (response.data.length > 0 && response.data instanceof Array) {
  385. this.showSimilarKey.flag = true
  386. this.showSimilarKey.index = index
  387. }
  388. })
  389. },
  390. changedName: function (brand, index, keyIndex) {
  391. brand.name = this.similarKeys[index][keyIndex].nameCn
  392. this.showSimilarKey.flag = false
  393. this.onCheck(brand)
  394. },
  395. setKeyActive: function (e) {
  396. e.target.setAttribute('class', 'active')
  397. },
  398. setKeyDefault: function (e) {
  399. e.target.setAttribute('class', '')
  400. },
  401. submitApply: function () {
  402. // 个人
  403. if (this.loginData.isSelf) {
  404. if (!this.registerData.isValidRegister) {
  405. this.$message.error('请输入正确的注册信息')
  406. } else if (!this.checkData.checked) {
  407. this.$message.error('您还没有勾选相关条款')
  408. } else {
  409. // 注册企业,并提交申请
  410. this.registerSelf()
  411. }
  412. } else { // 企业
  413. if (!this.checkData.checked) {
  414. this.$message.error('您还没有勾选相关条款')
  415. } else {
  416. // 提交申请
  417. this.storeApply(this.loginData.enterprise.uu)
  418. }
  419. }
  420. },
  421. // 个人用户,先注册企业,成功后,提交开店申请
  422. registerSelf: function () {
  423. this.showLoading = true
  424. this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
  425. .then(response => {
  426. if (response.data.success) {
  427. this.isSelfRegisterSuccess = true
  428. // 删除保存的缓存企业信息
  429. this.$http.delete('/basic/user/userCacheEnterprise')
  430. // 把当前用户登录企业信息切换为注册的企业
  431. this.$http.get(`/user/authentication/` + response.data.data.enuu).then(() => {
  432. // 重新获取登录用户信息
  433. this.$store.dispatch('loadUserInfo')
  434. this.loginData.isSelf = false
  435. this.loginData.enterprise.uu = response.data.data.enuu
  436. // 提交开店申请
  437. this.storeApply(response.data.data.enuu)
  438. // window.location.reload()
  439. this.showLoading = false
  440. })
  441. } else {
  442. this.isSelfRegisterSuccess = false
  443. this.showLoading = false
  444. this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
  445. }
  446. }, err => {
  447. console.log(err)
  448. this.isSelfRegisterSuccess = false
  449. this.showLoading = false
  450. this.$message.error('企业注册失败,请重新填写信息')
  451. })
  452. },
  453. // 提交开店申请
  454. storeApply: function (enuu) {
  455. this.showLoading = true
  456. let validCode = 0
  457. if (this.businessLicenseUrl === '') {
  458. this.$message.error('请上传营业执照')
  459. this.showLoading = false
  460. } else {
  461. if (this.brands[0].name === '') {
  462. validCode = 1
  463. } else if (this.brands[0].url === '') {
  464. validCode = 2
  465. }
  466. if (validCode === 0 || this.tab === 'DISTRIBUTION') {
  467. let qualifications = []
  468. qualifications.push({
  469. type: 'BUSINESS_LICENSE',
  470. resourceUrl: this.businessLicenseUrl,
  471. isPdf: this.isPdf(this.businessLicenseUrl)
  472. })
  473. if (this.taxPayerUrl !== '') {
  474. qualifications.push({
  475. type: 'TAX_PAYER',
  476. resourceUrl: this.taxPayerUrl,
  477. isPdf: this.isPdf(this.taxPayerUrl)
  478. })
  479. }
  480. if (this.taxPayerUrl !== '') {
  481. qualifications.push({
  482. type: 'TAX_REGISTRATION',
  483. resourceUrl: this.taxRegistrationUrl,
  484. isPdf: this.isPdf(this.taxRegistrationUrl)
  485. })
  486. }
  487. // console.log(qualifications)
  488. let tmpBrands = []
  489. this.brands.forEach(function (item) {
  490. if (item.name !== '' && item.url !== '') {
  491. tmpBrands.push(item)
  492. }
  493. })
  494. // 申请开店
  495. this.$http.post('/store-service/applications', {
  496. brands: tmpBrands,
  497. qualifications: qualifications,
  498. type: this.tab
  499. }).then(response => {
  500. this.showLoading = false
  501. if (response.data.success) {
  502. this.btnDisabled = true
  503. this.$message.success('感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!')
  504. } else {
  505. this.btnDisabled = true
  506. this.$message.error('开通店铺异常,请前往我的店铺查看店铺开通进度')
  507. }
  508. this.$http.post('/basic/enterprise/openVendor/' + enuu)
  509. .then(() => {
  510. // this.$http.get('/user/authentication/reflash')
  511. // .then(() => {
  512. // this.$http.get(`/user/authentication/` + enuu).then(() => {
  513. // this.$store.dispatch('loadUserInfo')
  514. // })
  515. // })
  516. window.setTimeout(function () {
  517. window.location.href = '/vendor#/store-apply/wait'
  518. }, 3000)
  519. })
  520. }, err => {
  521. console.log(err)
  522. this.$http.post('/basic/enterprise/openVendorSetRead/' + enuu)
  523. this.$message.error('开通店铺失败')
  524. this.showLoading = false
  525. })
  526. } else {
  527. if (validCode === 1) {
  528. this.$message.error('请添加品牌信息')
  529. this.showLoading = false
  530. } else if (validCode === 2) {
  531. this.$message.error('请上传品牌图片')
  532. this.showLoading = false
  533. }
  534. }
  535. }
  536. },
  537. addBrand: function () {
  538. this.brands.push({
  539. type: 'BRAND',
  540. name: '',
  541. url: '',
  542. isPdf: false,
  543. brandUuid: ''
  544. })
  545. this.similarKeys.push([])
  546. },
  547. deleteBrand: function (index) {
  548. this.brands.splice(index, 1)
  549. this.similarKeys.splice(index, 1)
  550. },
  551. isPdf: function (url) {
  552. return url.substring(url.length - 4, url.length) === '.pdf'
  553. },
  554. reflashEnterprise: function (enuu, url) {
  555. this.$http.post('/basic/enterprise/openVendor/' + enuu)
  556. .then(() => {
  557. this.$http.get('/user/authentication/reflash')
  558. .then(() => {
  559. this.$http.get(`/user/authentication/` + enuu).then(() => {
  560. this.$store.dispatch('loadUserInfo')
  561. window.location.href = url
  562. })
  563. }
  564. )
  565. }).catch((err) => {
  566. console.log(err)
  567. this.$message.error('开通卖家中心失败')
  568. })
  569. },
  570. goProduct: function (baseUrl) {
  571. if (this.loginData.isSelf) {
  572. if (!this.registerData.isValidRegister) {
  573. this.$message.error('请输入正确的注册信息')
  574. } else if (!this.checkData.checked) {
  575. this.$message.error('您还没有勾选相关条款')
  576. } else {
  577. this.showLoading = true
  578. this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
  579. .then(response => {
  580. if (response.data.success) {
  581. this.isSelfRegisterSuccess = true
  582. this.$http.delete('/basic/user/userCacheEnterprise')
  583. this.reflashEnterprise(response.data.data.enuu, baseUrl || '/vendor#/vendor_upload')
  584. } else {
  585. this.isSelfRegisterSuccess = false
  586. this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
  587. }
  588. this.showLoading = false
  589. }, err => {
  590. console.log(err)
  591. this.isSelfRegisterSuccess = false
  592. this.showLoading = false
  593. this.$message.error('企业注册失败,请重新填写信息')
  594. })
  595. }
  596. } else {
  597. if (!this.checkData.checked) {
  598. this.$message.error('您还没有勾选相关条款')
  599. } else {
  600. this.reflashEnterprise(this.loginData.enterprise.uu, baseUrl || '/vendor#/vendor_upload')
  601. }
  602. }
  603. },
  604. goBrandApply: function () {
  605. this.showBrandNameInvalid = false
  606. this.goProduct('/vendor#/brand/apply/')
  607. }
  608. }
  609. }
  610. </script>
  611. <style scoped>
  612. .com-input{
  613. width: 100%;
  614. height: 100%;
  615. text-align: center;
  616. position: absolute;
  617. bottom: 0;
  618. left: 0;
  619. opacity: 0;
  620. display: inline-block !important;
  621. }
  622. .el-upload-list--picture-card .el-upload-list__item{
  623. width: 160px;
  624. height: 120px;
  625. top: 69px;
  626. }
  627. div.vendor_store_apply {
  628. margin: 0 auto;
  629. width: 1026px;
  630. background-color: #FFFFFF;
  631. margin-bottom: 20px;
  632. margin-top: 25px;
  633. }
  634. div.vendor_store_apply .com_row {
  635. padding: 0 40px;
  636. min-height: 40px;
  637. }
  638. div.vendor_store_apply .title_row {
  639. margin-bottom: 20px;
  640. border-bottom: #e8e8e8 1px solid;
  641. }
  642. div.vendor_store_apply .custom_col {
  643. margin: 0;
  644. padding: 0;
  645. }
  646. div.vendor_store_apply .custom_col img.previewImage {
  647. max-width: 160px;
  648. max-height: 120px;
  649. cursor: pointer;
  650. /*padding: 0 30px;*/
  651. }
  652. div.vendor_store_apply .row h2 {
  653. padding: 10px 0;
  654. font-size: 16px;
  655. font-weight: 500;
  656. color: #000000;
  657. }
  658. div.vendor_store_apply .row span {
  659. display: block;
  660. padding: 10px 0;
  661. font-size: 14px;
  662. color: #000000;
  663. }
  664. div.vendor_store_apply #file_upload {
  665. width: 100px;
  666. height: 100px;
  667. border:1px solid #CDCDCD;
  668. /*background: url("static/img/vendor/images/upload.png");*/
  669. }
  670. div.vendor_store_apply #upload_qualification {
  671. width: 100px;
  672. height: 100px;
  673. opacity: 0;
  674. }
  675. div.vendor_store_apply .custom_tab {
  676. margin: 0 15px;
  677. width: 90px;
  678. text-align: center;
  679. }
  680. div.vendor_store_apply .nav li.custom_tab.active>a,
  681. div.vendor_store_apply .nav li.custom_tab.active>a:focus,
  682. div.vendor_store_apply .nav li.custom_tab.active>a:hover {
  683. border: 1px solid #5078CB;
  684. border-bottom-color: transparent;
  685. color: #5078cb;
  686. }
  687. div.vendor_store_apply .uploadify-button {
  688. display: block;
  689. }
  690. div.vendor_store_apply .custom_col .show_image_area {
  691. height: 120px;
  692. display: flex;
  693. justify-content: center;
  694. align-items: center;
  695. }
  696. .nav-tabs{
  697. height: 41px;
  698. background: none;
  699. padding: 0 40px;
  700. }
  701. .nav-tabs>li>a{
  702. border-radius: 0;
  703. color: #333;
  704. }
  705. div.vendor_store_apply .btn-primary{
  706. background: #5078cb;
  707. border-radius: 0;
  708. }
  709. div.vendor_store_apply .btn-primary:hover{
  710. background: #3f7ae3;
  711. }
  712. div.vendor_store_apply .com_row .col-md-2{
  713. width: 120px;
  714. }
  715. div.vendor_store_apply .com_row .col-md-10 span{
  716. color: #666;
  717. }
  718. /*修改的样式*/
  719. div.vendor_store_apply .custom_col .show_image_area{
  720. position: relative;
  721. overflow: hidden;
  722. }
  723. .hover-show{
  724. position: absolute;
  725. width: 100%;
  726. height: 100%;
  727. top: 120px;
  728. left: 0;
  729. background: rgba(0,0,0,.5);
  730. }
  731. div.vendor_store_apply .custom_col .show_image_area .hover-show{
  732. top: 0;
  733. }
  734. .hover-show .delete{
  735. padding: 0;
  736. width: 30px;
  737. height: 30px;
  738. float: right;
  739. text-align: center;
  740. }
  741. .hover-show .delete:hover{
  742. cursor: pointer;
  743. }
  744. .hover-show .delete i{
  745. color: #fff;
  746. font-size: 18px;
  747. }
  748. .hover-show a{
  749. display: inline-block;
  750. width: 100%;
  751. height: 60px;
  752. font-size: 14px;
  753. color: #fff;
  754. text-align: center;
  755. line-height: 60px;
  756. }
  757. .hover-show a i{
  758. margin-right: 5px;
  759. font-size: 16px;
  760. }
  761. .brand-type{
  762. line-height: 34px;
  763. font-size: 14px;
  764. margin: 20px 20px 5px 20px;
  765. }
  766. .brand-type .brand-small-img{
  767. position: relative;
  768. width: 84px;
  769. height: 84px;
  770. overflow: hidden;
  771. text-align: center;
  772. border: #e8e8e8 1px solid;
  773. }
  774. .brand-type .brand-small-img .preview img{
  775. max-width: 84px;
  776. max-height: 84px;
  777. }
  778. .brand-type em{
  779. color: #ff0000;
  780. }
  781. .brand-type .col-md-7,.brand-type .col-md-1{
  782. margin-top: 25px;
  783. }
  784. .brand-small-upload .file-text,.brand-type .brand-small-img{
  785. float: left;
  786. }
  787. .brand-small-upload .file-text{
  788. width: 120px;
  789. margin-left: 10px;
  790. line-height: 20px;
  791. margin-top: 6%;
  792. }
  793. .brand-small-upload .delete{
  794. float: right;
  795. text-align: center;
  796. line-height: 84px;
  797. }
  798. .brand-small-upload .delete i{
  799. font-size: 18px;
  800. color: #5078cb;
  801. }
  802. .brand-small-upload .delete:hover{
  803. cursor: pointer;
  804. }
  805. .brand-small-upload .delete:hover i{
  806. color: #f00;
  807. }
  808. .brand-small-upload .brand-small-img .hover-show{
  809. top: 0;
  810. }
  811. .brand-small-upload .brand-small-img .hover-show{
  812. }
  813. .brand-small-upload .brand-small-img .hover-show span i{
  814. color: #fff;
  815. }
  816. .brand-small-upload .brand-small-img .hover-show span.delete{
  817. line-height: 30px;
  818. padding: 0;
  819. }
  820. .brand-small-upload .brand-small-img .hover-show a{
  821. line-height: 30px;
  822. height: 30px;
  823. }
  824. .tab-content {
  825. border: 1px #5078CB solid;
  826. padding-bottom: 30px;
  827. }
  828. .tab-content .com_row{
  829. margin:40px 0 0;
  830. border-bottom: #ccc 1px dashed;
  831. padding-bottom: 40px !important;
  832. }
  833. .tab-content .com_row .col-md-12{
  834. color: #999;
  835. margin-top: 20px;
  836. font-size: 12px;
  837. padding-left: 50px;
  838. }
  839. .brand-small-upload .col-md-12{
  840. color: #999;
  841. font-size: 12px;
  842. padding-left: 0;
  843. }
  844. .tab-content .com_row .col-md-12 em,.brand-small-upload .col-md-12 em{
  845. color: #f00;
  846. }
  847. .add-brand{
  848. text-align: center;
  849. border-bottom: #ccc 1px dashed;
  850. margin: 0 0 20px 0;
  851. height: 34px;
  852. }
  853. .add-brand a{
  854. font-size: 14px;
  855. color: #5078cb;
  856. width: 200px;
  857. height: 15px;
  858. display: inline-block;
  859. border: #ccc 1px dashed;
  860. border-top: 0;
  861. border-bottom-left-radius: 50px;
  862. border-bottom-right-radius: 50px;
  863. margin-top: 31px;
  864. background: #fff;
  865. line-height: 15px;
  866. text-decoration: none;
  867. }
  868. .add-brand a i{
  869. margin-right: 5px;
  870. font-size: 20px;
  871. vertical-align: middle;
  872. }
  873. .add-brand a em{
  874. position: relative;
  875. top: -10px;
  876. font-weight: bold;
  877. font-style: inherit;
  878. }
  879. .add-brand a:hover em{
  880. color: #d32526;
  881. text-decoration: none;
  882. }
  883. .unpass-reason {
  884. margin: 0 40px;
  885. line-height: 34px;
  886. }
  887. /* 预览框 end */
  888. .brand-type .dropdown-menu {
  889. width: 95%;
  890. }
  891. .brand-type .dropdown-menu li {
  892. font-size: 14px;
  893. }
  894. .com-del-box{
  895. position: fixed;
  896. z-index: 1000;
  897. height: auto;
  898. opacity: 1;
  899. background-color: white;
  900. width: 310px;
  901. -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  902. -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  903. -o-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  904. box-shadow: 0 5px 15px rgba(0,0,0,.5);
  905. margin: -155px 0 0 -75px;
  906. top: 55%;
  907. left: 43%;
  908. }
  909. .com-del-box .title{
  910. height: 30px;
  911. background-color: #5078cb;
  912. text-align: right;
  913. padding-right: 15px;
  914. line-height: 30px;
  915. }
  916. .com-del-box .title a{
  917. color: white;
  918. font-size: 16px;
  919. }
  920. .com-del-box .content{
  921. width: 100%;
  922. text-align: center;
  923. margin: 0 auto;
  924. }
  925. .com-del-box .content p{
  926. line-height: 50px;
  927. font-size: 14px;
  928. padding-top: 10px;
  929. }
  930. .com-del-box .content p i{
  931. color: #5078cb;
  932. font-size: 16px;
  933. margin-right: 10px;
  934. }
  935. .com-del-box .content div{
  936. width: 100%;
  937. text-align: center;
  938. margin: 0 auto;
  939. }
  940. .com-del-box .content div a{
  941. width: 55px;
  942. height: 26px;
  943. line-height: 26px;
  944. display: inline-block;
  945. text-align: center;
  946. font-size: 14px;
  947. }
  948. .com-del-box .content div a:first-child{
  949. background: #b4b5b9;
  950. color: #333;
  951. margin-right: 10px;
  952. }
  953. .com-del-box .content div a:last-child{
  954. background: #5078cb;
  955. color: #fff;
  956. }
  957. .com-del-box .content div a:hover{
  958. background: #3f7ae3;
  959. color: #fff;
  960. }
  961. div.vendor_store_apply .custom_col .show_image_area{
  962. width: 160px;
  963. border: #dcdcdc 1px solid;
  964. margin: 0 10px 0 0;
  965. padding: 0;
  966. }
  967. div.vendor_store_apply .tab-content .custom_col{
  968. width: 280px;
  969. }
  970. div.vendor_store_apply .tab-content .custom_col:first-child{
  971. margin-left: 50px;
  972. }
  973. div.vendor_store_apply .custom_col .row .col-md-5:last-child{
  974. width: 110px;
  975. }
  976. div.vendor_store_apply .custom_col .row .col-md-5:last-child span{
  977. margin-top: 85% !important;
  978. padding-bottom: 0 !important;
  979. }
  980. .hoverShow{
  981. position: absolute;
  982. width: 30px;
  983. height: 30px;
  984. top: 0px;
  985. right: 0;
  986. background: rgba(0,0,0,.4);
  987. display: none;
  988. }
  989. div.vendor_store_apply .custom_col .show_image_area:hover .hoverShow{
  990. display: block;
  991. }
  992. div.vendor_store_apply .custom_col .show_image_area .deleteImg{
  993. position: absolute;
  994. right: 7px;
  995. top: 0;
  996. display: inline-block;
  997. padding: 0;
  998. margin-top: 6px;
  999. font-size: 18px;
  1000. color: #fff;
  1001. }
  1002. .hover-show a{
  1003. color: #fff;
  1004. text-decoration: none;
  1005. }
  1006. .hover-show a:hover, .hover-show a:active, .hover-show a:focus{
  1007. color: #fff;
  1008. text-decoration: none;
  1009. }
  1010. /* .dropdown-menu>.active>a, .dropdown-menu>.active>a:focus, .dropdown-menu>.active>a:hover {
  1011. color: #fff;
  1012. }*/
  1013. .dropdown-menu {
  1014. display: block;
  1015. left: 14px;
  1016. }
  1017. /*
  1018. radio
  1019. */
  1020. .radioLabel {
  1021. line-height: 20px;
  1022. cursor: pointer;
  1023. }
  1024. .radioLabel label{
  1025. width: 16px;
  1026. height: 16px;
  1027. background: url("/images/messageBoard/radio.png");
  1028. background-position: 0 -1px;
  1029. vertical-align: middle;
  1030. margin-bottom: 0 !important;
  1031. margin-right: 0 !important;
  1032. cursor: pointer;
  1033. }
  1034. .radioLabel input[type="radio"]:checked + label {
  1035. background-position: -19px -1px;
  1036. }
  1037. .radioLabel input[type="radio"] + label + span {
  1038. margin-left: 5px;
  1039. }
  1040. .radioLabel input[type="radio"]:checked + label{
  1041. color: #5078cb;
  1042. }
  1043. .radioLabel input[type="radio"]{
  1044. display: none;
  1045. }
  1046. .radioLabel span {
  1047. font-weight: bold;
  1048. font-size: 18px;
  1049. color: #5e5e5e;
  1050. }
  1051. .radioCheck {
  1052. padding-top: 35px;
  1053. padding-left: 30px;
  1054. padding-bottom: 35px;
  1055. }
  1056. .radioCheck .radioLabel:first-child {
  1057. margin-right: 10px;
  1058. }
  1059. .btn-area {
  1060. margin-top: 20px;
  1061. text-align: center;
  1062. }
  1063. .btn-area span {
  1064. height: 35px;
  1065. line-height: 35px;
  1066. border: 1px solid #5078cb;
  1067. padding: 0 62px;
  1068. font-size: 16px;
  1069. display: inline-block;
  1070. color: #5078cb;
  1071. cursor: pointer;
  1072. background: #fff;
  1073. }
  1074. .btn-area span:first-child{
  1075. margin-right: 16px;
  1076. }
  1077. .btn-area span:last-child{
  1078. background: #5078cb;
  1079. color: #fff;
  1080. }
  1081. /* .btn-area span:hover {
  1082. }*/
  1083. .loading {
  1084. position: fixed;
  1085. top: 0;
  1086. left: 0;
  1087. right: 0;
  1088. width: 100%;
  1089. height: 100%;
  1090. z-index: 1000;
  1091. text-align: center;
  1092. }
  1093. .loading img {
  1094. position: relative;
  1095. top: 40%;
  1096. }
  1097. .btn-area .btn-disabled {
  1098. cursor: not-allowed;
  1099. opacity: .5;
  1100. }
  1101. </style>