StepThird.vue 39 KB

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