StepThird.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. <template>
  2. <!--最后一步-->
  3. <div class="section" style="overflow-y: auto;position: absolute;height: 100%;">
  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="mobile-vendor_store_apply" v-show="selectFlag == 'open'">
  22. <div>
  23. <!-- Nav tabs -->
  24. <ul class="nav nav-tabs" v-show="false">
  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="mobile-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="custom_col">
  42. <div class="wrap-title"><span class="line"></span>营业执照</div>
  43. <div class="clearfix" style="margin: 0 0.25rem">
  44. <div class="show_image_area show_image pull-left">
  45. <upload ref="Pom" :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload"></upload>
  46. </div>
  47. <div class="pull-left infoTextMobile" style="width: 5.1rem;margin-left: 0.2rem">
  48. <em style="color: #FF0000;">*</em>如已上传最新版营业执照(三证合一),则其他两证无需上传;仅支持上传JPG、PNG、GIF、PDF格式,每张大小不超过3M
  49. </div>
  50. <!--<div class="col-md-5" style="padding: 0;">-->
  51. <!--<span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>-->
  52. <!--</div>-->
  53. </div>
  54. </div>
  55. <div class="custom_col">
  56. <div class="wrap-title"><span class="line"></span>纳税人证明</div>
  57. <div class="" style="margin: 0 0.25rem">
  58. <div class="show_image_area show_image">
  59. <upload ref="Pom" :typeData="'TAX_PAYER'" @uploadAction="onUpload"></upload>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="custom_col">
  64. <div class="wrap-title"><span class="line"></span>税务登记证</div>
  65. <div class="" style="margin: 0 0.25rem">
  66. <div class="show_image_area show_image">
  67. <upload ref="Pom" :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload"></upload>
  68. </div>
  69. <!--<div class="col-md-5" style="padding: 0;">-->
  70. <!--<span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>-->
  71. <!--</div>-->
  72. </div>
  73. </div>
  74. <!--<div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>-->
  75. </div>
  76. <!--增加品牌-->
  77. <div class="custom_col brand-type" v-for="(brand, index) in brands" style="margin-top: 0px">
  78. <div class="wrap-title"><span class="line"></span>品牌{{index+1}}</div>
  79. <!--<div class="col-md-1">品牌{{index+1}}<em v-if="index == 0">*</em></div>-->
  80. <div class="" style="margin: 0px 0.25rem;position: relative">
  81. <div class="mobile-register-brand-name">品牌名称:<input @input="onBrandInput(brand, index)"
  82. @blur.stop.prevent="onBrandChanged(brand, index)"
  83. type="text" v-model="brand.name"
  84. placeholder="请输入英文品牌或中文品牌"
  85. name="brandName" />
  86. </div>
  87. <!--<input type="text" v-model="brand.name"-->
  88. <!--@input="onBrandInput(brand, index)"-->
  89. <!--@blur.stop.prevent="onBrandChanged(brand, index)"-->
  90. <!--class="form-control" name="brandName" autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>-->
  91. <ul class="dropdown-menu"
  92. v-show="showSimilarKey.flag && showSimilarKey.index == index"
  93. @mouseenter="showFlag = true"
  94. @mouseleave="showFlag = false">
  95. <li @mouseenter="setKeyActive"
  96. @mouseleave="setKeyDefault"
  97. @click.stop.prevent="changedName(brand, index, key_index)"
  98. v-for="(key, key_index) in similarKeys[index]">
  99. <a v-text="key.nameCn">
  100. <!--<strong>C</strong>apital Advan<strong>c</strong>ed-->
  101. </a>
  102. </li>
  103. </ul>
  104. </div>
  105. <div class="brand-small-upload clearfix" style="margin: 0.1rem 0.25rem 0 0.25rem">
  106. <div class="brand-small-img">
  107. <upload ref="Pom" :typeData="index" @uploadAction="onUpload" :NopassThree="true"></upload>
  108. </div>
  109. <div class="file-text">品牌logo/商标注册原件/授权说明书</div>
  110. <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除" style="float: right;text-align: center;line-height: 1.09rem;height: 1.09rem;padding-top: 0.36rem;"><i class="fa fa-trash"></i></div>
  111. <!--<div class="col-md-12"><em v-if="index == 0">*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>-->
  112. </div>
  113. </div>
  114. <div class="add-brand" @click="addBrand">
  115. <i class="fa fa-plus-circle"></i>增加品牌
  116. <!--<a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>-->
  117. </div>
  118. <div class="unpass-reason row" style="display: none">
  119. 原因:<span style="color: #d32526;">原因</span>
  120. </div>
  121. </div>
  122. <!--原厂end-->
  123. <!--代理商 begin-->
  124. <div role="tabpanel" class="tab-pane" v-if="tab == 'AGENCY'" :class="{active: tab == 'AGENCY'}">
  125. <div class="row com_row">
  126. <div class="custom_col">
  127. <div class="wrap-title"><span class="line"></span>营业执照</div>
  128. <div class="clearfix" style="margin: 0 0.25rem">
  129. <div class="show_image_area show_image pull-left">
  130. <upload ref="Pom" :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload" :NopassThree="true"></upload>
  131. </div>
  132. <div class="pull-left infoTextMobile" style="width: 5.1rem;margin-left: 0.2rem">
  133. <em style="color: #FF0000;">*</em>如已上传最新版营业执照(三证合一),则其他两证无需上传;仅支持上传JPG、PNG、GIF、PDF格式,每张大小不超过3M
  134. </div>
  135. <!--<div class="" style="padding: 0;">-->
  136. <!--<span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>-->
  137. <!--</div>-->
  138. </div>
  139. </div>
  140. <div class="custom_col">
  141. <div class="wrap-title"><span class="line"></span>纳税人证明</div>
  142. <div class="" style="margin: 0 0.25rem">
  143. <div class="show_image_area show_image">
  144. <upload ref="Pom" :typeData="'TAX_PAYER'" @uploadAction="onUpload" :NopassThree="true"></upload>
  145. </div>
  146. </div>
  147. </div>
  148. <div class="custom_col">
  149. <div class="wrap-title"><span class="line"></span>税务登记证</div>
  150. <div class="" style="margin: 0 0.25rem">
  151. <div class="show_image_area show_image">
  152. <upload ref="Pom" :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload" :NopassThree="true"></upload>
  153. </div>
  154. <!--<div class="col-md-5" style="padding: 0;">-->
  155. <!--<span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>-->
  156. <!--</div>-->
  157. </div>
  158. </div>
  159. <!--<div class=""><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>-->
  160. </div>
  161. <!--增加品牌-->
  162. <div class="custom_col brand-type" v-for="(brand, index) in brands" style="margin-top: 0px">
  163. <!--<div class="col-md-1">品牌{{index+1}}<em>*</em></div>-->
  164. <div class="wrap-title"><span class="line"></span>品牌{{index+1}}</div>
  165. <div class="" style="margin: 0px 0.25rem;position: relative">
  166. <div class="mobile-register-brand-name">品牌名称:<input type="text" v-model="brand.name"
  167. @input="onBrandInput(brand, index)"
  168. @blur.stop.prevent="onBrandChanged(brand, index)"
  169. placeholder="请输入英文品牌或中文品牌"
  170. name="brandName" />
  171. </div>
  172. <!--<input type="text" v-model="brand.name"-->
  173. <!--@input="onBrandInput(brand, index)"-->
  174. <!--@blur.stop.prevent="onBrandChanged(brand, index)"-->
  175. <!--class="form-control" name="brandName" autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>-->
  176. <ul class="dropdown-menu"
  177. v-show="showSimilarKey.flag && showSimilarKey.index == index"
  178. @mouseenter="showFlag = true"
  179. @mouseleave="showFlag = false">
  180. <li @mouseenter="setKeyActive"
  181. @mouseleave="setKeyDefault"
  182. v-for="(key, key_index) in similarKeys[index]">
  183. <a v-text="key.nameCn" @click.stop.prevent="changedName(brand, index, key_index)">
  184. <!--<strong>C</strong>apital Advan<strong>c</strong>ed-->
  185. </a>
  186. </li>
  187. </ul>
  188. </div>
  189. <div class="brand-small-upload clearfix" style="margin: 0.1rem 0.25rem 0 0.25rem">
  190. <div class="brand-small-img">
  191. <upload ref="Pom" :typeData="index" @uploadAction="onUpload" :NopassThree="true"></upload>
  192. </div>
  193. <div class="file-text">代理资格证/代理授权书</div>
  194. <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除"><i class="fa fa-trash"></i></div>
  195. <!--<div class="col-md-12"> <em>*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>-->
  196. </div>
  197. </div>
  198. <div class="add-brand" @click="addBrand">
  199. <i class="fa fa-plus-circle"></i>增加品牌
  200. <!--<a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>-->
  201. </div>
  202. <!--<div class="add-brand row">-->
  203. <!--<a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>-->
  204. <!--</div>-->
  205. <div class="unpass-reason row" style="display: none">
  206. 原因:<span style="color: #d32526;">原因</span>
  207. </div>
  208. </div>
  209. <!--代理商 end-->
  210. <!--经销商 begin-->
  211. <div role="tabpanel" class="tab-pane" v-if="tab == 'DISTRIBUTION'" :class="{active: tab == 'DISTRIBUTION'}">
  212. <div class="row com_row">
  213. <div class="custom_col">
  214. <div class="wrap-title"><span class="line"></span>营业执照</div>
  215. <div class="clearfix" style="margin: 0 0.25rem">
  216. <div class="show_image_area show_image pull-left">
  217. <upload ref="Pom" :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload" :NopassThree="true"></upload>
  218. </div>
  219. <div class="pull-left infoTextMobile" style="width: 5.1rem;margin-left: 0.2rem">
  220. <em style="color: #FF0000;">*</em>如已上传最新版营业执照(三证合一),则其他两证无需上传;仅支持上传JPG、PNG、GIF、PDF格式,每张大小不超过3M
  221. </div>
  222. <!--<div class="col-md-5" style="padding: 0;">-->
  223. <!--<span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>-->
  224. <!--</div>-->
  225. </div>
  226. </div>
  227. <div class="custom_col">
  228. <div class="wrap-title"><span class="line"></span>纳税人证明</div>
  229. <div class="" style="margin: 0 0.25rem">
  230. <div class="show_image_area show_image">
  231. <upload ref="Pom" :typeData="'TAX_PAYER'" @uploadAction="onUpload" :NopassThree="true"></upload>
  232. </div>
  233. </div>
  234. </div>
  235. <div class="custom_col">
  236. <div class="wrap-title"><span class="line"></span>税务登记证</div>
  237. <div class="" style="margin: 0 0.25rem">
  238. <div class="show_image_area show_image">
  239. <upload ref="Pom" :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload" :NopassThree="true"></upload>
  240. </div>
  241. <!--<div class="col-md-5" style="padding: 0;">-->
  242. <!--<span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>-->
  243. <!--</div>-->
  244. </div>
  245. </div>
  246. <!--<div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>-->
  247. </div>
  248. </div>
  249. <!--经销商 end-->
  250. <!--主营产品 begin-->
  251. <div role="tabpanel" class="tab-pane">
  252. <div class="row com_row">
  253. <div class="custom_col">
  254. <div class="wrap-title"><span class="line"></span>主营产品</div>
  255. <div class="" style="margin: 0 0.25rem">
  256. <textarea v-model="description"
  257. rows="5"
  258. maxlength="500"
  259. class="form-control"
  260. placeholder="例:本店主营Panasonic、IT、三星等知名品牌的触控IC、显示驱动IC、液晶屏、功率模块类、电源芯片、高压熔断、被动器件等产品。"></textarea>
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. <!--主营产品 end-->
  266. </div>
  267. <!-- Submit button -->
  268. <!-- <div style="padding: 28px 40px;">
  269. <button type="button" class="btn btn-primary" style="float: right" @click="submitApply">提交申请</button>
  270. <div class="clear-fix"></div>
  271. </div>-->
  272. </div>
  273. <!--删除上传图片-->
  274. <div class="com-del-box" style="display: none">
  275. <div class="title">
  276. <a><i class="fa fa-close fa-lg"></i></a>
  277. </div>
  278. <div class="content">
  279. <p><i class="fa fa-exclamation-circle"></i>是否删除选中信息</p>
  280. <div><a>取消</a><a>确认</a></div>
  281. </div>
  282. </div>
  283. <!--删除品牌图片-->
  284. <div class="com-del-box" style="display: none">
  285. <div class="title">
  286. <a><i class="fa fa-close fa-lg"></i></a>
  287. </div>
  288. <div class="content">
  289. <p><i class="fa fa-exclamation-circle"></i>品牌信息为重要信息,确定删除吗?</p>
  290. <div><a>取消</a><a>确认</a></div>
  291. </div>
  292. </div>
  293. <!--提示框-->
  294. <div class="com-del-box" v-if="false">
  295. <div class="title">
  296. <a @click="showBrandNameInvalid = false"><i class="fa fa-close fa-lg"></i></a>
  297. </div>
  298. <div class="content">
  299. <p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>
  300. <p style="line-height: 20px;">前往<a @click="goBrandApply()" target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>
  301. </div>
  302. </div>
  303. </div>
  304. <!--<div class="step-last">
  305. <h4 class="h4">库存寄售</h4>
  306. <p class="title">无需开店,即可发布贵司仓库里的滞销产品,优软商城代为销售,匿名清仓无压力<button class="no-apply" @click="goProduct">暂不开店,直接寄售</button></p>
  307. </div>-->
  308. <div class="btn-area">
  309. <span @click="sectionChange(3)" style="background: #c1c1c1;border:#c1c1c1">上一步</span>
  310. <!--<span @click="btnDisabled?'':selectFlag == 'open'?submitApply():goProduct()" :class="btnDisabled?'btn-disabled':''">提交申请</span>-->
  311. </div>
  312. <div class="btn-area">
  313. <!--<span @click="sectionChange(2)">上一步</span>-->
  314. <span @click="btnDisabled?'':selectFlag == 'open'?submitApply():goProduct()" :class="btnDisabled?'btn-disabled':''">提交申请</span>
  315. </div>
  316. <div class="loading" v-show="showLoading">
  317. <!--<img src="/images/all/loading.gif" alt="">-->
  318. </div>
  319. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  320. </div>
  321. </template>
  322. <script>
  323. import { RemindBox } from '~components/mobile/common'
  324. import Upload from '~components/common/upload/upload.vue'
  325. export default {
  326. // props: {
  327. // tab: {
  328. // default: 'ORIGINAL_FACTORY'
  329. // }
  330. // },
  331. data () {
  332. return {
  333. // tab: 'AGENCY',
  334. collectResult: '',
  335. timeoutCount: 0,
  336. brands: [{
  337. type: 'BRAND',
  338. name: '',
  339. url: '',
  340. isPdf: false,
  341. brandUuid: ''
  342. }],
  343. businessLicenseUrl: '',
  344. taxPayerUrl: '',
  345. taxRegistrationUrl: '',
  346. // defaultBusinessUrl: '',
  347. showBrandNameInvalid: false,
  348. similarKeys: [[]],
  349. showSimilarKey: {
  350. flag: false,
  351. index: 0
  352. },
  353. showFlag: false,
  354. isSelfRegisterSuccess: true,
  355. selectFlag: 'open',
  356. showLoading: false,
  357. btnDisabled: false,
  358. description: ''
  359. }
  360. },
  361. props: [
  362. 'checkData',
  363. 'registerData',
  364. 'loginData',
  365. 'enterpriseData',
  366. 'businessImgUrl',
  367. 'tab'
  368. ],
  369. watch: {
  370. enterpriseData: function (val, oldVal) {
  371. if (val !== {}) {
  372. console.log(1)
  373. this.businessLicenseUrl = val.url || val.businessCodeImage || ''
  374. // this.defaultBusinessUrl = val.enBussinessCodeImage || ''
  375. }
  376. },
  377. businessImgUrl: function (val, oldVal) {
  378. console.log(2)
  379. this.businessLicenseUrl = val
  380. }
  381. },
  382. components: {
  383. Upload,
  384. RemindBox
  385. },
  386. computed: {
  387. user () {
  388. return this.$store.state.option.user
  389. }
  390. },
  391. methods: {
  392. clearInfo() {
  393. this.brands = [{
  394. type: 'BRAND',
  395. name: '',
  396. url: '',
  397. isPdf: false,
  398. brandUuid: ''
  399. }]
  400. this.businessLicenseUrl = ''
  401. this.taxPayerUrl = ''
  402. this.taxRegistrationUrl = ''
  403. console.log('clear')
  404. // for (let i = 0; i < this.$refs.Pom.length; i++) {
  405. // this.$refs.Pom[i].clearInfo()
  406. // }
  407. },
  408. sectionChange: function (type) {
  409. this.$emit('sectionEvent', type)
  410. },
  411. toggleTab (t) {
  412. this.tab = t
  413. this.brands = [{
  414. type: 'BRAND',
  415. name: '',
  416. url: '',
  417. isPdf: false,
  418. brandUuid: ''
  419. }]
  420. },
  421. onUpload: function (obj) {
  422. if (obj.type === 'BUSINESS_LICENSE') {
  423. // this.businessLicenseUrl = obj.url
  424. this.businessLicenseUrl = obj.url
  425. if (obj.url !== '') {
  426. this.$emit('businessImgUrlAction', this.businessLicenseUrl)
  427. }
  428. } else if (obj.type === 'TAX_PAYER') {
  429. this.taxPayerUrl = obj.url
  430. } else if (obj.type === 'TAX_REGISTRATION') {
  431. this.taxRegistrationUrl = obj.url
  432. } else if (typeof obj.type === 'number') {
  433. this.brands[obj.type].url = obj.url
  434. }
  435. },
  436. onBrandChanged: function (item, index) {
  437. this.showSimilarKey.flag = this.showFlag
  438. if (!this.showFlag) {
  439. this.onCheck(item)
  440. }
  441. },
  442. onCheck: function (item, index) {
  443. if (item.name && item.name !== '') {
  444. this.$http.get('/api/product/brand', {params: {name: item.name, op: 'by_name'}})
  445. .then(response => {
  446. item.brandUuid = response.data.uuid
  447. item.isPdf = item.url.substring(item.url.length - 4, item.url.length) === '.pdf'
  448. this.$set(item, 'status', true)
  449. }, err => {
  450. console.log(err)
  451. this.$set(item, 'status', false)
  452. this.showBrandNameInvalid = true
  453. })
  454. }
  455. },
  456. onBrandInput: function (brand, index) {
  457. this.showSimilarKey.flag = false
  458. this.$http.get('/search/similarBrands?keyword=' + brand.name)
  459. .then(response => {
  460. if (response.data.length > 0 && response.data instanceof Array) {
  461. this.similarKeys[index] = response.data
  462. }
  463. if (response.data.length > 0 && response.data instanceof Array) {
  464. this.showSimilarKey.flag = true
  465. this.showSimilarKey.index = index
  466. }
  467. })
  468. },
  469. changedName: function (brand, index, keyIndex) {
  470. brand.name = this.similarKeys[index][keyIndex].nameCn
  471. this.showSimilarKey.flag = false
  472. this.onCheck(brand)
  473. },
  474. setKeyActive: function (e) {
  475. e.target.setAttribute('class', 'active')
  476. },
  477. setKeyDefault: function (e) {
  478. e.target.setAttribute('class', '')
  479. },
  480. submitApply: function () {
  481. // 个人
  482. if (this.loginData.isSelf) {
  483. if (!this.registerData.isValidRegister) {
  484. // this.$message.error('请输入正确的注册信息')
  485. this.collectResult = '请输入正确的注册信息'
  486. this.timeoutCount++
  487. } else if (!this.checkData.checked) {
  488. // this.$message.error('您还没有勾选相关条款')
  489. this.collectResult = '您还没有勾选相关条款'
  490. this.timeoutCount++
  491. } else {
  492. // 注册企业,并提交申请
  493. this.registerSelf()
  494. }
  495. } else {
  496. // 企业
  497. if (!this.checkData.checked) {
  498. // this.$message.error('您还没有勾选相关条款')
  499. this.collectResult = '您还没有勾选相关条款'
  500. this.timeoutCount++
  501. } else {
  502. // 提交申请
  503. this.storeApply(this.loginData.enterprise.uu)
  504. }
  505. }
  506. },
  507. // 个人用户,先注册企业,成功后,提交开店申请
  508. registerSelf: function () {
  509. this.showLoading = true
  510. this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
  511. .then(response => {
  512. if (response.data.success) {
  513. this.isSelfRegisterSuccess = true
  514. // 删除保存的缓存企业信息
  515. this.$http.delete('/basic/user/userCacheEnterprise')
  516. // 把当前用户登录企业信息切换为注册的企业
  517. this.$http.get(`/user/authentication/` + response.data.data.enuu).then(() => {
  518. // 重新获取登录用户信息
  519. this.$store.dispatch('loadUserInfo')
  520. this.loginData.isSelf = false
  521. this.loginData.enterprise.uu = response.data.data.enuu
  522. // 提交开店申请
  523. this.storeApply(response.data.data.enuu)
  524. // window.location.reload()
  525. this.showLoading = false
  526. })
  527. } else {
  528. this.isSelfRegisterSuccess = false
  529. this.showLoading = false
  530. // this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
  531. this.collectResult = response.data.message || '企业注册失败,请重新填写信息'
  532. this.timeoutCount++
  533. }
  534. }, err => {
  535. console.log(err)
  536. this.isSelfRegisterSuccess = false
  537. this.showLoading = false
  538. this.collectResult = '企业注册失败,请重新填写信息'
  539. this.timeoutCount++
  540. // this.$message.error('企业注册失败,请重新填写信息')
  541. })
  542. },
  543. storeApply: function (enuu) {
  544. this.showLoading = true
  545. let validCode = 0
  546. let _brandFlg = true
  547. let _brandName = ''
  548. for (let i = 0; i < this.brands.length; i++) {
  549. if (this.brands[i].status !== undefined && !this.brands[i].status) {
  550. _brandFlg = false
  551. _brandName = this.brands[i].name
  552. }
  553. }
  554. if (this.businessLicenseUrl === '') {
  555. // this.$message.error('请上传营业执照')
  556. this.collectResult = '请上传营业执照'
  557. this.timeoutCount++
  558. this.showLoading = false
  559. } else if (this.description === '') {
  560. this.collectResult = '请填写主营产品信息'
  561. this.timeoutCount++
  562. this.showLoading = false
  563. } else if (!_brandFlg) {
  564. this.collectResult = `品牌${_brandName}不存在,请申请此品牌`
  565. this.showLoading = false
  566. } else {
  567. if (this.brands[0].name === '') {
  568. validCode = 1
  569. } else if (this.brands[0].url === '') {
  570. validCode = 2
  571. }
  572. if (validCode === 0 || this.tab === 'DISTRIBUTION') {
  573. let qualifications = []
  574. qualifications.push({
  575. type: 'BUSINESS_LICENSE',
  576. resourceUrl: this.businessLicenseUrl,
  577. isPdf: this.isPdf(this.businessLicenseUrl)
  578. })
  579. if (this.taxPayerUrl !== '') {
  580. qualifications.push({
  581. type: 'TAX_PAYER',
  582. resourceUrl: this.taxPayerUrl,
  583. isPdf: this.isPdf(this.taxPayerUrl)
  584. })
  585. }
  586. if (this.taxPayerUrl !== '') {
  587. qualifications.push({
  588. type: 'TAX_REGISTRATION',
  589. resourceUrl: this.taxRegistrationUrl,
  590. isPdf: this.isPdf(this.taxRegistrationUrl)
  591. })
  592. }
  593. // console.log(qualifications)
  594. let tmpBrands = []
  595. this.brands.forEach(function (item) {
  596. if (item.name !== '' && item.url !== '') {
  597. tmpBrands.push(item)
  598. }
  599. })
  600. // 申请开店
  601. this.$http.post('/store-service/applications', {
  602. applyDescription: this.description,
  603. brands: tmpBrands,
  604. qualifications: qualifications,
  605. type: this.tab
  606. }).then(response => {
  607. this.showLoading = false
  608. if (response.data.success) {
  609. this.btnDisabled = true
  610. this.collectResult = '感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!'
  611. this.timeoutCount++
  612. // this.push('/mobile/')
  613. // this.$message.success('感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!')
  614. } else {
  615. this.btnDisabled = true
  616. this.collectResult = '开通店铺异常,请前往PC端,我的店铺查看店铺开通进度'
  617. this.timeoutCount++
  618. // this.$message.error('开通店铺异常,请前往我的店铺查看店铺开通进度')
  619. }
  620. this.$http.post('/basic/enterprise/openVendor/' + enuu)
  621. .then(() => {
  622. setTimeout(() => {
  623. window.location.href = '/mobile/user'
  624. // this.$router.push('/mobile/user')
  625. }, 1500)
  626. })
  627. }, err => {
  628. console.log(err)
  629. this.$http.post('/basic/enterprise/openVendorSetRead/' + enuu)
  630. this.collectResult = '开通店铺失败'
  631. this.timeoutCount++
  632. // this.$message.error('开通店铺失败')
  633. this.showLoading = false
  634. })
  635. } else {
  636. if (validCode === 1) {
  637. this.collectResult = '请添加品牌信息'
  638. this.timeoutCount++
  639. // this.$message.error('请添加品牌信息')
  640. this.showLoading = false
  641. } else if (validCode === 2) {
  642. this.collectResult = '请上传品牌图片'
  643. this.timeoutCount++
  644. // this.$message.error('请上传品牌图片')
  645. this.showLoading = false
  646. }
  647. }
  648. }
  649. },
  650. addBrand: function () {
  651. this.brands.push({
  652. type: 'BRAND',
  653. name: '',
  654. url: '',
  655. isPdf: false,
  656. brandUuid: ''
  657. })
  658. this.similarKeys.push([])
  659. },
  660. deleteBrand: function (index) {
  661. this.brands.splice(index, 1)
  662. this.similarKeys.splice(index, 1)
  663. },
  664. isPdf: function (url) {
  665. return url.substring(url.length - 4, url.length) === '.pdf'
  666. },
  667. reflashEnterprise: function (enuu, url) {
  668. this.$http.post('/basic/enterprise/openVendor/' + enuu)
  669. .then(() => {
  670. this.$http.get('/user/authentication/reflash')
  671. .then(() => {
  672. this.$http.get(`/user/authentication/` + enuu).then(() => {
  673. this.$store.dispatch('loadUserInfo')
  674. // window.location.href = url
  675. this.$router.push('/mobile/user')
  676. })
  677. }
  678. )
  679. })
  680. },
  681. goProduct: function (baseUrl) {
  682. if (this.loginData.isSelf) {
  683. if (!this.registerData.isValidRegister) {
  684. this.collectResult = '请输入正确的注册信息'
  685. this.timeoutCount++
  686. // this.$message.error('请输入正确的注册信息')
  687. } else if (!this.checkData.checked) {
  688. this.collectResult = '您还没有勾选相关条款'
  689. this.timeoutCount++
  690. // this.$message.error('您还没有勾选相关条款')
  691. } else {
  692. this.showLoading = true
  693. this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
  694. .then(response => {
  695. if (response.data.success) {
  696. this.isSelfRegisterSuccess = true
  697. this.$http.delete('/basic/user/userCacheEnterprise')
  698. this.reflashEnterprise(response.data.data.enuu, baseUrl || '/vendor#/vendor_upload')
  699. } else {
  700. this.isSelfRegisterSuccess = false
  701. this.collectResult = response.data.message || '企业注册失败,请重新填写信息'
  702. this.timeoutCount++
  703. // this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
  704. }
  705. this.showLoading = false
  706. }, err => {
  707. console.log(err)
  708. this.isSelfRegisterSuccess = false
  709. this.showLoading = false
  710. this.collectResult = '企业注册失败,请重新填写信息'
  711. this.timeoutCount++
  712. // this.$message.error('企业注册失败,请重新填写信息')
  713. })
  714. }
  715. } else {
  716. if (!this.checkData.checked) {
  717. this.collectResult = '您还没有勾选相关条款'
  718. this.timeoutCount++
  719. // this.$message.error('您还没有勾选相关条款')
  720. } else {
  721. this.reflashEnterprise(this.loginData.enterprise.uu, baseUrl || '/vendor#/vendor_upload')
  722. }
  723. }
  724. },
  725. goBrandApply: function () {
  726. this.showBrandNameInvalid = false
  727. this.goProduct('/vendor#/brand/apply/')
  728. }
  729. }
  730. }
  731. </script>
  732. <style lang="scss">
  733. .mobile-vendor_store_apply{
  734. #image-box{
  735. overflow:visible;
  736. height:95vh;
  737. margin-top:0;
  738. top:2%;
  739. padding:1rem;
  740. .x-close-wrap{
  741. right:-.15rem;
  742. top:-.15rem;
  743. width:.35rem;
  744. height:.35rem;
  745. line-height: .3rem;
  746. a{
  747. font-size: .35rem;
  748. }
  749. }
  750. }
  751. .wrap-title {
  752. color: #333;
  753. font-size: 0.28rem;
  754. border-bottom: 1px solid #d3d3d3;
  755. height: 0.5rem;
  756. text-align: left;
  757. padding: 0 0 0.1rem 0.05rem;
  758. margin: 0.17rem 0.25rem 0.13rem 0.25rem;
  759. line-height: 0.5rem;
  760. .line{
  761. width: 0.05rem;
  762. background: #3f84f6;
  763. display: inline-block;
  764. vertical-align: top;
  765. margin-right: 0.08rem;
  766. height: 0.28rem;
  767. margin-top: 0.09rem;
  768. }
  769. }
  770. }
  771. </style>