StepThird.vue 37 KB

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