StepFirst.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. <template>
  2. <!--填写注册信息-->
  3. <div class="section" @click="onHideBox">
  4. <div class="register">
  5. <div class="x-form-set-header">
  6. <h4>企业基本信息</h4>
  7. </div>
  8. <div class="row">
  9. <label class="col-sm-2 x-required">企业名称:</label>
  10. <div class="col-sm-5">
  11. <input :class="!validName.isValidTypeName || !validName.isValidName?'form-control error-box-border':'form-control'" type="text" @change="nameCheck(3)" @input="nameTypeCheck()" :disabled="!loginData.isSelf" v-model="data.name" name="name" required="" placeholder="填写营业执照上的企业名称">
  12. </div>
  13. <div class="x-text-help" v-show="validName.isValidTypeName && validName.isValidName && !validName.init">
  14. <i class="glyphicon glyphicon-ok x-icon-left"></i>
  15. </div>
  16. <div class="col-sm-5" v-show="!validName.isValidTypeName && !validName.init">
  17. <p>
  18. <i class="fa fa-info-circle"></i>请填写正确的企业名称,2~99个字符
  19. </p>
  20. </div>
  21. <div class="col-sm-5" v-show="!validName.isValidName && !validName.init">
  22. <p>
  23. <i class="fa fa-info-circle"></i>注册的企业名称已存在,请联系管理员
  24. </p>
  25. </div>
  26. </div>
  27. <div class="row">
  28. <label class="col-sm-2 x-required">营业执照号:</label>
  29. <div class="col-sm-5">
  30. <input type="text" maxlength="20" :class="!validLicence.isValidLicence?'form-control error-box-border':'form-control x-input'" :disabled="!loginData.isSelf" @input="validLicence.init=false" @change="licenceCheck(3)" v-model="data.licenceId" name="name" required="" placeholder="请填写营业执照上的注册号">
  31. </div>
  32. <div class="x-text-help" v-show="validLicence.isValidLicence && !validLicence.init">
  33. <i class="glyphicon glyphicon-ok x-icon-left"></i>
  34. </div>
  35. <div class="col-sm-5" v-show="!validLicence.isValidLicence && !validLicence.init"><p><i class="fa fa-info-circle"></i>请填写营业执照上的注册号</p></div>
  36. </div>
  37. <!--<div class="row">
  38. <label class="col-sm-2 x-required">营业执照:</label>
  39. <div class="col-sm-5">
  40. <a class="x-btn-blank" v-if="loginData.isSelf" title="请上传营业执照扫描件(≤5M的图片或PDF)">
  41. <i class="fa fa-picture-o"></i>
  42. 请上传营业执照扫描件(≤5M的图片或PDF)
  43. <input type="file" @change="upload" class="form-control file-input" name="name" required="" placeholder="请上传营业执照扫描件(≤5M的图片或PDF)" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf">
  44. </a>
  45. <img class="previewImg" v-if="data.url != ''" :src="isPdf?'/images/all/timg.png':data.url" alt="">
  46. </div>
  47. <div class="x-text-help" v-show="validUpload.isValidUpload && !validUpload.init">
  48. <i class="glyphicon glyphicon-ok x-icon-left"></i>
  49. </div>
  50. <div class="col-sm-5" v-show="!validUpload.isValidUpload && !validUpload.init"><p><i class="fa fa-info-circle"></i>请上传营业执照扫描件(≤5M的图片或PDF)</p></div>
  51. </div>
  52. <div class="row">
  53. <label class="col-sm-2 x-required">法定代表人:</label>
  54. <div class="col-sm-5">
  55. <input type="text" :disabled="!loginData.isSelf" :class="!validLawPerson.isValidLawPerson?'form-control error-box-border':'form-control'" @input="lawPersonCheck()" v-model="data.lawPerson" name="name" required="" placeholder="请填写营业执照上的法定代表人">
  56. </div>
  57. <div class="x-text-help" v-show="validLawPerson.isValidLawPerson && !validLawPerson.init">
  58. <i class="glyphicon glyphicon-ok x-icon-left"></i>
  59. </div>
  60. <div class="col-sm-5" v-show="!validLawPerson.isValidLawPerson && !validLawPerson.init"><p><i class="fa fa-info-circle"></i>请填写营业执照上的法定代表人</p></div>
  61. </div>-->
  62. <div class="row">
  63. <label class="col-sm-2 x-required">注册地址:</label>
  64. <div class="col-sm-5">
  65. <input type="text" readonly aria-haspopup="true" aria-expanded="false" @click="onShowAddress" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="padding-left:20px;background-color: transparent;">
  66. <span class="fa fa-map-marker"></span>
  67. <div v-show="showAddressBox"
  68. @mouseenter="isInAddressBox = true"
  69. @mouseleave="isInAddressBox = false"
  70. style="display: block; left: 14px;" class="dropdown-menu x-union-menu" aria-labelledby="address">
  71. <div class="x-union-header">
  72. <div>省份</div>
  73. <div>城市</div>
  74. <div>县区</div>
  75. <div class="x-item-ext">详细地址</div>
  76. </div>
  77. <div class="x-union-list">
  78. <ul class="list-unstyled">
  79. <li v-for="province in cityData.province"
  80. :class="province == address.currentProvince ? 'active' : ''"
  81. v-text="province"
  82. @click="getCity(province)"></li>
  83. </ul>
  84. <ul class="list-unstyled">
  85. <li v-for="city in cityData.city"
  86. :class="city == address.currentCity ? 'active' : ''"
  87. v-text="city"
  88. @click="getDistrict(city)"></li>
  89. </ul>
  90. <ul class="list-unstyled">
  91. <li v-for="district in cityData.district"
  92. v-text="district"
  93. :class="district == address.currentDistrict ? 'active' : ''"
  94. @click="chooseDistrict(district)"></li>
  95. </ul>
  96. <div class="x-item-ext">
  97. <div class="form-group">
  98. <div class="col-sm-12">
  99. <textarea id="street" name="street" rows="4" v-model="address.detail" @input="onDetailAddressInput" class="form-control x-input" placeholder="xx路xx大厦xx栋xx楼xx室"></textarea>
  100. </div>
  101. </div>
  102. <div class="text-right">
  103. <a class="register-btn btn-submit" @click="submitAddress">确定</a> <a @click="showAddressBox = false" class="register-btn btn-console">取消</a>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="x-text-help" v-show="validAddress.isValidAddress && !validAddress.init">
  110. <i class="glyphicon glyphicon-ok x-icon-left"></i>
  111. </div>
  112. <div class="col-sm-5" v-show="!validAddress.isValidAddress && !validAddress.init"><p><i class="fa fa-info-circle"></i>填写总部所在地详细地址</p></div>
  113. </div>
  114. <!--<div class="row">
  115. <label class="col-sm-2">联系人:</label>
  116. <div class="col-sm-5">
  117. <input type="text" :disabled="!loginData.isSelf" class="form-control" title="请填写企业对外的联系人,为空则默认为管理员" v-model="data.linkman" name="name" required="" placeholder="请填写企业对外的联系人,为空则默认为管理员">
  118. </div>
  119. <div class="col-sm-5"></div>
  120. </div>
  121. <div class="row">
  122. <label class="col-sm-2">联系电话:</label>
  123. <div class="col-sm-5">
  124. <input :disabled="!loginData.isSelf" :class="!validPhone.isValidPhone?'form-control error-box-border':'form-control'" type="text" v-model="data.phone" @input="phoneCheck()" name="name" required="" placeholder="例如:13838883888">
  125. </div>
  126. <div class="col-sm-5"></div>
  127. </div>
  128. <div class="row">
  129. <label class="col-sm-2">邮箱:</label>
  130. <div class="col-sm-5">
  131. <input type="text" :disabled="!loginData.isSelf" :class="!validEmail.isValidEmail?'form-control error-box-border':'form-control'" v-model="data.email" @input="emailCheck()" required="" placeholder="例如:123123@usoft.com">
  132. </div>
  133. <div class="col-sm-5"></div>
  134. </div>
  135. <div class="row">
  136. <label class="col-sm-2">企业传真:</label>
  137. <div class="col-sm-5">
  138. <input type="text" :disabled="!loginData.isSelf" :class="!validFax.isValidFax?'form-control error-box-border':'form-control'" v-model="data.fax" @input="faxCheck()" required="" placeholder="例如:0755-268XXXXX">
  139. </div>
  140. <div class="col-sm-5"></div>
  141. </div>
  142. <div class="row">
  143. <label class="col-sm-2">企业官网:</label>
  144. <div class="col-sm-5">
  145. <input type="text" :disabled="!loginData.isSelf" class="form-control" v-model="data.website" name="name" required="" placeholder="www.usoftchina.com" style="padding-left:55px;">
  146. <span class="web">http://</span>
  147. </div>
  148. <div class="col-sm-5"></div>
  149. </div>
  150. <div class="row">
  151. <label class="col-sm-2">行业:</label>
  152. <div class="col-sm-5 select-dot">
  153. <input type="text" readonly aria-haspopup="true" aria-expanded="false" @click="onShowProfession()" :style="!loginData.isSelf?'background-color: #eee;':''" :disabled="!loginData.isSelf" v-model="data.profession" class="form-control" name="name" required="" placeholder="请选择所在行业">
  154. <div v-show="showProfessionBox"
  155. @mouseenter="isInProfessionBox = true"
  156. @mouseleave="isInProfessionBox = false"
  157. style="display: block; left: 14px; width: 473px" class="dropdown-menu x-union-menu">
  158. <div class="x-union-list">
  159. <ul class="list-unstyled auto-width">
  160. <li v-for="profession in professionData.profession"
  161. :class="profession == currentProfession.profession ? 'active' : ''"
  162. v-text="profession"
  163. @click="getProfessionDetail(profession)"></li>
  164. </ul>
  165. <ul class="list-unstyled auto-width">
  166. <li v-for="detail in professionData.detail"
  167. :class="detail == currentProfession.detail ? 'active' : ''"
  168. v-text="detail"
  169. @click="chooseProfessionDetail(detail)"></li>
  170. </ul>
  171. <ul class="list-unstyled auto-width">
  172. <li v-for="detail in professionData.thirdDetail"
  173. :class="detail == currentProfession.thirdDetail ? 'active' : ''"
  174. v-text="detail"
  175. @click="chooseProfessionThirdDetail(detail)"></li>
  176. </ul>
  177. </div>
  178. </div>
  179. </div>
  180. <div class="col-sm-5"></div>
  181. </div>-->
  182. <!--<div class="row" >
  183. <label class="col-sm-2">企业LOGO:</label>
  184. <div class="col-sm-5">
  185. <input type="file" v-if="loginData.isSelf" @change="uploadLogo" class="form-control file-input upload-area" required="" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png">
  186. <div class="logo-img-area">
  187. <img class="preview-logo-img" :src="data.logoUrl && data.logoUrl != ''?data.logoUrl:'/images/all/upload-bg.png'" alt="">
  188. </div>
  189. </div>
  190. <div class="col-sm-5"><p v-show="!validLogo.isValidLogo"><i class="fa fa-info-circle"></i>logo大小不能超过100K</p></div>
  191. <div class="logo-text">个性化展示您的企业形象,图片不超过100Kb,建议宽x高=100x60</div>
  192. &lt;!&ndash; <div class="x-text-help" v-show="validUpload.isValidUpload && !validUpload.init">
  193. <i class="glyphicon glyphicon-ok x-icon-left"></i>
  194. </div>
  195. <div class="col-sm-5" v-show="!validUpload.isValidUpload && !validUpload.init"><p><i class="fa fa-info-circle"></i>请上传营业执照扫描件(≤5M的图片或PDF)</p></div>&ndash;&gt;
  196. </div>-->
  197. <!-- <div class="row">
  198. <label class="col-sm-2">经营范围标签:</label>
  199. <div class="col-sm-8">
  200. <div class="no-tags" v-if="!data.tagsData || data.tagsData.length == 0">暂无标签</div>
  201. <div class="tags-list">
  202. <ul>
  203. <li v-for="(tag, index) in data.tagsData"><span v-text="tag"></span><i v-if="loginData.isSelf" class="glyphicon glyphicon-remove" @click="removeTag(index)"></i></li>
  204. </ul>
  205. </div>
  206. </div>
  207. <div class="col-sm-5 tags-box" v-if="loginData.isSelf">
  208. <input type="text" @input="tagCheck()" class="form-control" v-model="tag" name="name" required="">
  209. <span class="add-tag-btn" @click="addTags()" >+添加标签</span>
  210. </div>
  211. <div class="col-sm-5" v-if="loginData.isSelf">
  212. <div class="x-text-tip">
  213. <i class="glyphicon glyphicon-info-sign x-icon-left"></i>标签长度不超过10个字
  214. </div>
  215. </div>
  216. <div class="col-sm-12 tags-lists" v-if="loginData.isSelf"><em class="pull-left">例如:</em><span>企业管理咨询</span><span>电子产品开发</span><span>货运代理</span></div>
  217. </div>-->
  218. <div class="row next-btn"><button class="btn" :style="loginData.isSelf && !isValid ? 'opacity: .65;':''" @click="sectionChange(2)">下一步</button></div>
  219. </div>
  220. </div>
  221. </template>
  222. <script>
  223. export default {
  224. data () {
  225. return {
  226. data: {
  227. name: '',
  228. // lawPerson: '',
  229. // url: '',
  230. licenceId: '',
  231. address: ''
  232. // linkman: '',
  233. // phone: '',
  234. // email: '',
  235. // fax: '',
  236. // website: '',
  237. // profession: '',
  238. // logoUrl: '',
  239. // tagsData: []
  240. },
  241. validName: {
  242. isValidTypeName: true,
  243. isValidName: true,
  244. init: true
  245. },
  246. // validUpload: {
  247. // isValidUpload: true,
  248. // init: true
  249. // },
  250. validLicence: {
  251. isValidLicence: true,
  252. init: true
  253. },
  254. validAddress: {
  255. isValidAddress: true,
  256. init: true
  257. },
  258. // validLawPerson: {
  259. // isValidLawPerson: true,
  260. // init: true
  261. // },
  262. // validPhone: {
  263. // isValidPhone: true,
  264. // init: true
  265. // },
  266. // validEmail: {
  267. // isValidEmail: true,
  268. // init: true
  269. // },
  270. // validFax: {
  271. // isValidFax: true,
  272. // init: true
  273. // },
  274. // validLogo: {
  275. // isValidLogo: true,
  276. // init: true
  277. // },
  278. isValid: false,
  279. // isPdf: false,
  280. showAddressBox: false,
  281. isInAddressBox: false,
  282. // showProfessionBox: false,
  283. // isInProfessionBox: false,
  284. temCityData: {},
  285. cityData: {
  286. province: [],
  287. city: [],
  288. district: []
  289. },
  290. address: {
  291. currentProvince: '',
  292. currentCity: '',
  293. currentDistrict: '',
  294. detail: ''
  295. }
  296. // tempProfession: {},
  297. // professionData: {
  298. // profession: [],
  299. // detail: [],
  300. // thirdDetail: []
  301. // },
  302. // currentProfession: {
  303. // profession: '',
  304. // detail: '',
  305. // thirdDetail: ''
  306. // },
  307. // tag: ''
  308. }
  309. },
  310. props: ['loginData', 'enterpriseData', 'businessImgUrl'],
  311. watch: {
  312. enterpriseData: function (val, oldVal) {
  313. if (val.name) { // 个人
  314. this.initData(val)
  315. this.nameCheck(3)
  316. this.nameTypeCheck()
  317. this.licenceCheck(3)
  318. this.addressCheck()
  319. // this.imgUrlCheck()
  320. // this.lawPersonCheck()
  321. // this.phoneCheck()
  322. // this.emailCheck()
  323. // this.faxCheck()
  324. this.checkFullData()
  325. this.submitRegisterData()
  326. }
  327. if (val.uu) { // 企业
  328. this.initData(val)
  329. // this.nameCheck(3)
  330. // this.nameTypeCheck()
  331. // this.licenceCheck(3)
  332. this.enAddressCheck()
  333. // this.imgUrlCheck()
  334. // this.lawPersonCheck()
  335. // this.phoneCheck()
  336. // this.emailCheck()
  337. // this.faxCheck()
  338. // this.checkFullData()
  339. this.submitRegisterData()
  340. }
  341. }
  342. // businessImgUrl: function (val, oldVal) {
  343. // this.data.url = val
  344. // this.checkFullData()
  345. // this.submitRegisterData()
  346. // }
  347. },
  348. mounted () {
  349. this.$http.get('/data/city.json').then(response => {
  350. this.temCityData = response.data
  351. for (let province in response.data) {
  352. this.cityData.province.push(province)
  353. }
  354. })
  355. // this.$http.get('/data/profession.json').then(response => {
  356. // this.tempProfession = response.data
  357. // for (let profession in response.data) {
  358. // this.professionData.profession.push(profession)
  359. // }
  360. // })
  361. },
  362. methods: {
  363. initData: function (val) {
  364. this.data.name = val.spaceName || val.enName || val.name || ''
  365. this.data.licenceId = val.businessCode || val.licenceId || val.enBussinessCode || ''
  366. this.data.address = val.address || val.enAddress || ''
  367. },
  368. // 下一步点击,保存企业信息,或者保存缓存企业信息
  369. sectionChange: function (type) {
  370. if (!this.isValid) {
  371. this.$message.error('请填写正确的注册信息')
  372. } else {
  373. if (this.enterpriseData.uu) {
  374. this.enCheckFullData()
  375. } else {
  376. this.checkFullData()
  377. }
  378. let enterprise = this.data
  379. // enterprise.tagsData = enterprise.tagsData.toString()
  380. // if (typeof this.data.tagsData === 'string') {
  381. // this.data.tagsData = this.data.tagsData.split(',')
  382. // }
  383. let data = {}
  384. data.enterprise = enterprise
  385. data.isValidRegister = this.isValid
  386. // data.url = this.data.url
  387. enterprise.enIsRead = false
  388. // enterprise.enBussinessCodeImage = this.data.url
  389. // 个人用户,提交保存缓存企业信息
  390. if (this.loginData.isSelf) {
  391. this.$http.post('/basic/user/userCacheEnterprise', enterprise)
  392. this.$emit('isSelfCacheDataAction', enterprise)
  393. } else { // 企业用户,更新当前企业信息,主要是更新企业地址
  394. this.enterpriseData.enAddress = this.data.address
  395. this.$http.post('/basic/enterprise/' + this.enterpriseData.uu + '/updateInfo', this.enterpriseData)
  396. }
  397. this.$emit('registerAction', data)
  398. this.$emit('sectionEvent', type)
  399. // this.$emit('businessImgUrlAction', this.data.url)
  400. }
  401. },
  402. // upload: function (e) {
  403. // let file = e.target.files[0]
  404. // this.validUpload.init = false
  405. // if (file.size > 5 * 1024 * 1024) {
  406. // this.validUpload.isValidUpload = false
  407. // } else {
  408. // this.validUpload.isValidUpload = true
  409. // if (file.type !== 'application/pdf') {
  410. // this.isPdf = false
  411. // let param = new FormData()
  412. // param.append('file', file, file.name)
  413. // param.append('chunk', '0')
  414. // let config = {
  415. // headers: {'Content-Type': 'multipart/form-data'}
  416. // }
  417. // this.$http.post('/api/images', param, config)
  418. // .then(response => {
  419. // this.data.url = response.data[0].path
  420. // this.$emit('businessImgUrlAction', this.data.url)
  421. // }, err => {
  422. // console.log(err)
  423. // this.validUpload.isValidUpload = false
  424. // })
  425. // } else {
  426. // let param = new FormData()
  427. // param.append('file', file, file.name)
  428. // let config = {
  429. // headers: {'Content-Type': file.type}
  430. // }
  431. // this.$http.post('/file', param, config)
  432. // .then(response => {
  433. // this.isPdf = true
  434. // this.data.url = response.data[0].path
  435. // this.$emit('businessImgUrlAction', this.data.url)
  436. // }, err => {
  437. // console.log(err)
  438. // this.validUpload.isValidUpload = false
  439. // })
  440. // }
  441. // }
  442. // this.validCheck()
  443. // },
  444. // uploadLogo: function (e) {
  445. // this.validLogo.init = false
  446. // let file = e.target.files[0]
  447. // if (file.size > 100 * 1024) {
  448. // this.validLogo.isValidLogo = false
  449. // // this.$message.error('图片请勿超过100Kb')
  450. // } else {
  451. // let param = new FormData()
  452. // param.append('file', file, file.name)
  453. // let config = {
  454. // headers: {'Content-Type': file.type}
  455. // }
  456. // this.$http.post('/api/images', param, config)
  457. // .then(response => {
  458. // this.validLogo.isValidLogo = true
  459. // this.data.logoUrl = response.data[0].path
  460. // }, err => {
  461. // console.log(err)
  462. // this.$message.error('图片上传失败')
  463. // })
  464. // }
  465. // },
  466. validCheck: function () {
  467. this.isValid =
  468. // this.validUpload.isValidUpload && !this.validUpload.init &&
  469. this.validName.isValidTypeName && !this.validName.init && this.validName.isValidName &&
  470. this.validLicence.isValidLicence && !this.validLicence.init &&
  471. this.validAddress.isValidAddress && !this.validAddress.init
  472. // this.validLawPerson.isValidLawPerson && !this.validLawPerson.init &&
  473. // (this.validPhone.init || this.validPhone.isValidPhone) &&
  474. // (this.validEmail.init || this.validEmail.isValidEmail) &&
  475. // (this.validFax.init || this.validFax.isValidFax)
  476. },
  477. enValidCheck: function () {
  478. this.isValid = this.validAddress.isValidAddress && !this.validAddress.init
  479. },
  480. checkFullData: function () {
  481. this.isValid =
  482. // this.validUpload.isValidUpload &&
  483. this.validName.isValidTypeName && this.validName.isValidName &&
  484. this.validLicence.isValidLicence &&
  485. this.validAddress.isValidAddress
  486. // this.validLawPerson.isValidLawPerson
  487. },
  488. enCheckFullData: function () {
  489. this.isValid = this.validAddress.isValidAddress
  490. },
  491. // 企业名称字符验证
  492. nameTypeCheck: function () {
  493. this.validName.isValidTypeName = this.data.name !== '' && this.data.name.length >= 2 && this.data.name.length <= 99 && this.commonValid(this.data.name)
  494. this.validName.init = false
  495. },
  496. // 企业名称是否已存在验证
  497. nameCheck: function (num) {
  498. if (num > 0) {
  499. this.$http.post('/basic/enterprise/register/valid/name?name=' + this.data.name)
  500. .then(response => {
  501. if (response.data.code !== 12) {
  502. this.validName.init = false
  503. this.validName.isValidName = response.data.success
  504. this.validCheck()
  505. } else {
  506. this.nameCheck(num - 1)
  507. }
  508. })
  509. }
  510. },
  511. // imgUrlCheck: function () {
  512. // this.validUpload.init = false
  513. // this.validUpload.isValidUpload = this.data.url !== ''
  514. // },
  515. // 执照号验证
  516. licenceCheck: function (num) {
  517. if ((/^[\S-]{1,255}$/).test(this.data.licenceId)) {
  518. if (num > 0) {
  519. this.$http.post('/basic/enterprise/register/valid/businessCode?businessCode=' + this.data.licenceId)
  520. .then(response => {
  521. if (response.data.code !== 12) {
  522. this.validLicence.init = false
  523. this.validLicence.isValidLicence = response.data.success && this.data.licenceId
  524. this.validCheck()
  525. } else {
  526. // this.validLicence.init = tmpInit
  527. this.licenceCheck(num - 1)
  528. }
  529. })
  530. }
  531. } else {
  532. this.validLicence.init = false
  533. this.validLicence.isValidLicence = false
  534. this.validCheck()
  535. }
  536. },
  537. // 个人地址校验
  538. addressCheck: function () {
  539. this.validAddress.init = false
  540. this.validAddress.isValidAddress = this.data.address !== ''
  541. this.validCheck()
  542. },
  543. // 企业地址校验
  544. enAddressCheck: function () {
  545. this.validAddress.init = false
  546. this.validAddress.isValidAddress = this.data.address !== ''
  547. this.enValidCheck()
  548. },
  549. // lawPersonCheck: function () {
  550. // this.validLawPerson.init = false
  551. // this.validLawPerson.isValidLawPerson = (/^\S{1,255}$/).test(this.data.lawPerson)
  552. // this.validCheck()
  553. // },
  554. // phoneCheck: function () {
  555. // this.validPhone.init = false
  556. // this.validPhone.isValidPhone = (/^[\d-]{8,}$/).test(this.data.phone) || this.data.phone === ''
  557. // this.validCheck()
  558. // },
  559. // emailCheck: function () {
  560. // this.validEmail.init = false
  561. // this.validEmail.isValidEmail = (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/).test(this.data.email) || this.data.email === ''
  562. // this.validCheck()
  563. // },
  564. // faxCheck: function () {
  565. // this.validFax.init = false
  566. // this.validFax.isValidFax = (/^(([\0]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/).test(this.data.fax) || this.data.fax === ''
  567. // this.validCheck()
  568. // },
  569. commonValid: function (str) {
  570. return str.indexOf(' ') === -1
  571. },
  572. submitRegisterData: function () {
  573. let enterprise = this.data
  574. let data = {}
  575. data.enterprise = enterprise
  576. data.isValidRegister = this.isValid
  577. // data.url = this.data.url
  578. this.$emit('registerAction', data)
  579. },
  580. onHideBox: function () {
  581. this.onHideAddress()
  582. // this.onHideProfession()
  583. },
  584. onShowAddress: function () {
  585. if (this.showAddressBox) {
  586. this.onHideAddress()
  587. } else {
  588. this.showAddressBox = true
  589. this.isClickInputAddress = true
  590. }
  591. },
  592. onHideAddress: function () {
  593. if (!this.isInAddressBox && !this.isClickInputAddress) {
  594. this.showAddressBox = false
  595. }
  596. this.isClickInputAddress = false
  597. },
  598. // onShowProfession: function () {
  599. // if (this.showProfessionBox) {
  600. // this.onHideProfession()
  601. // } else {
  602. // this.showProfessionBox = true
  603. // this.isClickInputProfession = true
  604. // }
  605. // },
  606. // onHideProfession: function () {
  607. // if (!this.isInProfessionBox && !this.isClickInputProfession) {
  608. // this.showProfessionBox = false
  609. // }
  610. // this.isClickInputProfession = false
  611. // },
  612. getCity: function (province) {
  613. this.cityData.city = []
  614. this.address.currentCity = ''
  615. this.cityData.district = []
  616. this.address.currentDistrict = ''
  617. this.address.currentProvince = province
  618. for (let item in this.temCityData[province]) {
  619. this.cityData.city.push(item)
  620. }
  621. },
  622. getDistrict: function (city) {
  623. this.address.currentCity = city
  624. this.address.currentDistrict = ''
  625. this.cityData.district = this.temCityData[this.address.currentProvince][city]
  626. },
  627. chooseDistrict: function (district) {
  628. this.address.currentDistrict = district
  629. },
  630. submitAddress: function () {
  631. if (this.address.currentDistrict !== '' && this.address.currentCity !== '' && this.address.currentProvince !== '') {
  632. if (this.address.detail !== '') {
  633. this.data.address = this.address.currentProvince + this.address.currentCity + this.address.currentDistrict + this.address.detail
  634. this.showAddressBox = false
  635. if (this.enterpriseData.uu) {
  636. this.enAddressCheck()
  637. } else {
  638. this.addressCheck()
  639. }
  640. } else {
  641. this.$message.error('请输入详细地址')
  642. }
  643. } else {
  644. this.$message.error('请输入省、市、区')
  645. }
  646. },
  647. // getProfessionDetail: function (profession) {
  648. // this.currentProfession.profession = profession
  649. // this.currentProfession.detail = ''
  650. // this.professionData.detail = []
  651. // this.currentProfession.thirdDetail = ''
  652. // this.professionData.thirdDetail = []
  653. // let _this = this
  654. // _this.professionData.detail = []
  655. // for (let item in this.tempProfession[profession]) {
  656. // if (typeof this.tempProfession[profession][item] !== 'object') {
  657. // _this.professionData.detail.push(this.tempProfession[profession][item])
  658. // } else {
  659. // _this.professionData.detail.push(item)
  660. // }
  661. // }
  662. // },
  663. // chooseProfessionDetail: function (detail) {
  664. // this.currentProfession.detail = detail
  665. // this.currentProfession.thirdDetail = ''
  666. // this.professionData.thirdDetail = []
  667. // if (typeof this.tempProfession[this.currentProfession.profession][detail] !== 'object') {
  668. // this.data.profession = detail
  669. // this.showProfessionBox = false
  670. // } else {
  671. // this.professionData.thirdDetail = this.tempProfession[this.currentProfession.profession][detail]
  672. // }
  673. // },
  674. // chooseProfessionThirdDetail: function (thirdDetail) {
  675. // this.currentProfession.thirdDetail = thirdDetail
  676. // this.data.profession = thirdDetail
  677. // this.showProfessionBox = false
  678. // },
  679. // tagCheck: function () {
  680. // if (this.tag.length > 10) {
  681. // this.tag = this.tag.substring(0, 10)
  682. // }
  683. // },
  684. // addTags: function () {
  685. // let flag = true
  686. // let _this = this
  687. // if (!this.tag || this.tag === '') {
  688. // flag = false
  689. // } else {
  690. // this.data.tagsData.forEach(function (item) {
  691. // if (item === _this.tag) {
  692. // flag = false
  693. // }
  694. // })
  695. // }
  696. // if (flag) {
  697. // this.data.tagsData.push(this.tag)
  698. // this.tag = ''
  699. // } else {
  700. // this.tag = ''
  701. // }
  702. // },
  703. // removeTag: function (index) {
  704. // this.data.tagsData.splice(index, 1)
  705. // },
  706. onDetailAddressInput: function () {
  707. this.address.detail = this.address.detail.trim()
  708. }
  709. }
  710. }
  711. </script>
  712. <style scoped>
  713. .register{
  714. height: 700px;
  715. }
  716. .register input[type="file"] {
  717. display: block;
  718. }
  719. .previewImg {
  720. max-height: 200px;
  721. max-width: 200px;
  722. margin-top: 5px;
  723. }
  724. .x-union-menu {
  725. width: 600px
  726. }
  727. .x-union-header{
  728. margin-top: -40px;
  729. }
  730. .x-union-header>div{
  731. background: #f5f8fa;
  732. font-weight: 700;
  733. border-bottom: 1px solid #e4ecf3;
  734. }
  735. .x-union-header>div,.x-union-list>ul {
  736. float: left;
  737. width: 121px;
  738. border-right: 1px solid #e4ecf3;
  739. }
  740. .x-union-list>ul {
  741. height: 200px;
  742. margin: 0;
  743. overflow-y: auto;
  744. }
  745. .x-union-menu .x-item-ext {
  746. float: left;
  747. width: 235px;
  748. }
  749. .x-union-list .x-item-ext {
  750. padding: 10px
  751. }
  752. .x-union-header>div:last-child {
  753. border-right-width: 0
  754. }
  755. .x-union-header>div,.x-union-list>ul>li {
  756. padding: 2px 10px;
  757. cursor: pointer;
  758. }
  759. .x-union-list>ul>li:hover,.x-union-list>ul>li.active {
  760. background: #fee9c7;
  761. }
  762. .x-input {
  763. border-color: #ccc;
  764. border-radius: 0;
  765. box-shadow: none;
  766. }
  767. textarea.form-control {
  768. height: auto;
  769. }
  770. .text-right {
  771. text-align: right;
  772. }
  773. .register-btn {
  774. padding: 5px 10px;
  775. font-size: 12px;
  776. line-height: 1.5;
  777. }
  778. .btn-submit {
  779. background: #5078cb;
  780. color: #fff;
  781. }
  782. .btn-console {
  783. border: 1px solid #ccc;
  784. background: #fff;
  785. color: #888;
  786. margin-left: 5px;
  787. transition: all .2s ease-in-out;
  788. }
  789. .btn-console:hover {
  790. border: 1px solid #adadad;
  791. background: #e6e6e6;
  792. color: #333;
  793. }
  794. .x-text-help {
  795. color: green;
  796. }
  797. .register .row .upload-area {
  798. width: 130px;
  799. height: 130px;
  800. left: 15px;
  801. padding: 0;
  802. z-index: 100;
  803. }
  804. .error-box-border {
  805. border-color: #f4645f!important;
  806. }
  807. .x-btn-blank:hover, .x-btn-blank[disabled] {
  808. border: 1px solid #adadad;
  809. background: #e6e6e6;
  810. color: #333;
  811. }
  812. .register .row .auto-width {
  813. width: auto!important;
  814. }
  815. .select-dot input {
  816. background: url("../../../static/images/all/dot.png") no-repeat;
  817. background-position-x: 353px;
  818. background-position-y: 10px;
  819. }
  820. .register .row .logo-text {
  821. font-size: 12px;
  822. width: 180px;
  823. position: relative;
  824. top: 5px;
  825. left: 175px;
  826. text-align: center;
  827. color: #999;
  828. line-height: 20px;
  829. }
  830. .logo-img-area {
  831. width: 130px;
  832. height: 130px;
  833. }
  834. .logo-img-area .preview-logo-img {
  835. max-width: 130px;
  836. max-height: 130px;
  837. }
  838. .no-tags {
  839. float: left;
  840. padding: 2px 14px;
  841. line-height: 20px;
  842. border: #5078cb 1px solid;
  843. border-radius: 5px;
  844. font-size: 12px;
  845. margin: 0 3px;
  846. background: #5078cb;
  847. color: #fff;
  848. margin-top: 5px;
  849. }
  850. .register .row .add-tag-btn {
  851. position: absolute;
  852. right: 24px;
  853. color: #5078cb;
  854. font-size: 12px;
  855. cursor: pointer;
  856. }
  857. .register .row .tags-box {
  858. margin-top: 15px;
  859. }
  860. .register .row p {
  861. color: red;
  862. }
  863. .register .row .form-control:focus{
  864. border-color: #5078cb;
  865. box-shadow: none;
  866. }
  867. .x-input:focus, .x-input-blank:focus {
  868. border-color: #5078cb;
  869. box-shadow: none;
  870. }
  871. .register .row .fa-map-marker{
  872. position: relative;
  873. top: -34px;
  874. left: -5px;
  875. }
  876. .register .row .tags-list ul{
  877. list-style: none;
  878. }
  879. .register .row .tags-list ul li {
  880. display: inline-block;
  881. padding: 2px 14px;
  882. line-height: 20px;
  883. border: #5078cb 1px solid;
  884. border-radius: 5px;
  885. font-size: 12px;
  886. color: #5078cb;
  887. margin: 0 3px;
  888. }
  889. .register .row .tags-list ul li i{
  890. font-size: 12px;
  891. color: red;
  892. position: relative;
  893. top: -3px;
  894. right: -12px;
  895. }
  896. .register .row .tags-lists {
  897. margin-top: 10px;
  898. }
  899. .register .row .tags-lists em {
  900. font-style: inherit;
  901. margin-left: 163px;
  902. font-size: 12px;
  903. color: #999;
  904. }
  905. .register .row .tags-lists span {
  906. float: left;
  907. padding: 2px 14px;
  908. line-height: 20px;
  909. border: #5078cb 1px solid;
  910. border-radius: 5px;
  911. font-size: 12px;
  912. color: #5078cb;
  913. margin: 0 3px;
  914. }
  915. .register .row .x-text-tip {
  916. color: #777;
  917. margin-top: 15px;
  918. }
  919. .register .row .x-text-tip i {
  920. margin-right: 5px;
  921. }
  922. </style>