StepThird.vue 38 KB

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