StepThird.vue 38 KB

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