registerFirst.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. <template>
  2. <div class="app-container">
  3. <div class="content">
  4. <el-form ref="form" :model="form" :rules="registerRules" label-width="200px">
  5. <table class="table_register media">
  6. <tr>
  7. <th rowspan="6" style="width: 20%;">企业信息</th>
  8. <th><span style="color: red;">*</span>企业名称</th>
  9. <td>
  10. <el-form-item label-width="0" prop="entName">
  11. <el-input v-model="form.entName" type="text" auto-complete="off" placeholder="请输入企业名称">
  12. </el-input>
  13. </el-form-item>
  14. </td>
  15. <th><span style="color: red;">*</span>统一社会信用代码</th>
  16. <td>
  17. <el-form-item label-width="0" prop="license">
  18. <el-input type="text" @change="validLicense"
  19. v-model="form.license"
  20. placeholder="请输入统一社会信用代码">
  21. </el-input>
  22. </el-form-item>
  23. </td>
  24. </tr>
  25. <tr>
  26. <th><span style="color: red;">*</span>注册资金</th>
  27. <td>
  28. <el-form-item label-width="0" prop="regCapital">
  29. <el-input type="text"
  30. v-model="form.regCapital"
  31. placeholder="请输入注册资金">
  32. <template slot="append">万元</template>
  33. </el-input>
  34. </el-form-item>
  35. </td>
  36. <th><span style="color: red;">*</span>工商注册时间</th>
  37. <td>
  38. <el-form-item label-width="0" prop="regDate">
  39. <el-date-picker v-model="form.regDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"></el-date-picker>
  40. </el-form-item>
  41. </td>
  42. </tr>
  43. <tr>
  44. <th><span style="color: red;">*</span>工商注册类型</th>
  45. <td>
  46. <el-form-item label-width="0" prop="regType">
  47. <el-select v-model="form.regType" filterable>
  48. <el-option v-for="item in regTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
  49. </el-select>
  50. </el-form-item>
  51. </td>
  52. <th><span style="color: red;">*</span>主营产品(服务)所属技术领域</th>
  53. <td>
  54. <el-form-item label-width="0" prop="mainProducts">
  55. <el-select v-model="form.mainProducts" style="width: 220px;" filterable>
  56. <el-option v-for="(item,index) in mainProductsOptions" :label="item.dictLabel" :key="index" :value="item.dictValue">{{item.dictLabel}}</el-option>
  57. </el-select>
  58. </el-form-item>
  59. </td>
  60. </tr>
  61. <tr>
  62. <th><span style="color: red;">*</span>通信地址</th>
  63. <td>
  64. <el-form-item label-width="0" prop="address">
  65. <el-input v-model="form.address" type="text" auto-complete="off" placeholder="请输入通信地址">
  66. </el-input>
  67. </el-form-item>
  68. </td>
  69. <th><span style="color: red;">*</span>邮政编码</th>
  70. <td>
  71. <el-form-item label-width="0" prop="zipCode">
  72. <el-input v-model="form.zipCode" type="text" auto-complete="off" placeholder="请输入邮政编码">
  73. </el-input>
  74. </el-form-item>
  75. </td>
  76. </tr>
  77. <tr>
  78. <th><span style="color: red;">*</span>企业所属行政区域</th>
  79. <td colspan="3">
  80. <el-col :span="8">
  81. <el-form-item label-width="0" prop="provinceId">
  82. <el-select v-model="form.provinceId" placeholder="省" @change="getCityData" style="width: 220px;" filterable>
  83. <el-option v-for="(item,index) in provinceDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  84. </el-select>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. <el-form-item prop="cityId" label-width="0px">
  89. <el-select v-model="form.cityId" placeholder="市" @change="getDistrictData" style="width: 220px;" filterable>
  90. <el-option v-for="(item, index) in cityDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  91. </el-select>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="8">
  95. <el-form-item label-width="0px" prop="districtId">
  96. <el-select v-model="form.districtId" placeholder="区" style="width: 220px;" filterable>
  97. <el-option v-for="(item, index) in districtDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  98. </el-select>
  99. </el-form-item>
  100. </el-col>
  101. </td>
  102. </tr>
  103. <tr>
  104. <th><span style="color: red;">*</span>企业所得税主管税务机关</th>
  105. <td colspan="3">
  106. <el-form-item label-width="0" prop="taxOffice">
  107. <el-input v-model="form.taxOffice" type="text" auto-complete="off" placeholder="请输入企业所得税主管税务机关" disabled>
  108. </el-input>
  109. </el-form-item>
  110. </td>
  111. </tr>
  112. <tr>
  113. <th rowspan="3">法人信息</th>
  114. <th><span style="color: red;">*</span>姓名</th>
  115. <td>
  116. <el-form-item label-width="0" prop="legalName">
  117. <el-input v-model="form.legalName" type="text" auto-complete="off" placeholder="请输入法人姓名">
  118. </el-input>
  119. </el-form-item>
  120. </td>
  121. <th><span style="color: red;">*</span>身份证号码</th>
  122. <td>
  123. <el-form-item label-width="0" prop="legalIdCard">
  124. <el-input v-model="form.legalIdCard" type="text" auto-complete="off" placeholder="请输入法人身份证号码">
  125. </el-input>
  126. </el-form-item>
  127. </td>
  128. </tr>
  129. <tr>
  130. <th><span style="color: red;">*</span>手机号码</th>
  131. <td>
  132. <el-form-item label-width="0" prop="legalMobile">
  133. <el-input v-model="form.legalMobile" type="text" auto-complete="off" placeholder="手机号码">
  134. </el-input>
  135. </el-form-item>
  136. </td>
  137. <th>固定电话</th>
  138. <td>
  139. <el-form-item label-width="0" prop="legalPhone">
  140. <el-input v-model="form.legalPhone" type="text" auto-complete="off" placeholder="请输入固定电话">
  141. </el-input>
  142. </el-form-item>
  143. </td>
  144. </tr>
  145. <tr>
  146. <th>传真</th>
  147. <td>
  148. <el-form-item label-width="0" prop="legalFax">
  149. <el-input v-model="form.legalFax" type="text" auto-complete="off" placeholder="请输入法人传真">
  150. </el-input>
  151. </el-form-item>
  152. </td>
  153. <th>E-mail</th>
  154. <td>
  155. <el-form-item label-width="0" prop="legalEmail">
  156. <el-input v-model="form.legalEmail" type="text" auto-complete="off" placeholder="请输入法人邮箱">
  157. </el-input>
  158. </el-form-item>
  159. </td>
  160. </tr>
  161. <tr>
  162. <th rowspan="3">联系人信息</th>
  163. <th><span style="color: red;">*</span>姓名</th>
  164. <td>
  165. <el-form-item label-width="0" prop="linkName">
  166. <el-input v-model="form.linkName" type="text" auto-complete="off" placeholder="请输入联系人姓名">
  167. </el-input>
  168. </el-form-item>
  169. </td>
  170. <th><span style="color: red;">*</span>身份证号码</th>
  171. <td>
  172. <el-form-item label-width="0" prop="linkIdCard">
  173. <el-input v-model="form.linkIdCard" type="text" auto-complete="off" placeholder="请输入联系人身份证号码">
  174. </el-input>
  175. </el-form-item>
  176. </td>
  177. </tr>
  178. <tr>
  179. <th><span style="color: red;">*</span>手机号码</th>
  180. <td>
  181. <el-form-item label-width="0" prop="linkMobile">
  182. <el-input v-model="form.linkMobile" type="text" auto-complete="off" placeholder="请填入手机号码">
  183. </el-input>
  184. </el-form-item>
  185. </td>
  186. <th>固定电话</th>
  187. <td>
  188. <el-form-item label-width="0" prop="linkPhone">
  189. <el-input v-model="form.linkPhone" type="text" auto-complete="off" placeholder="请输入联系人固定电话">
  190. </el-input>
  191. </el-form-item>
  192. </td>
  193. </tr>
  194. <tr>
  195. <th>传真</th>
  196. <td>
  197. <el-form-item label-width="0" prop="linkFax">
  198. <el-input v-model="form.linkFax" type="text" auto-complete="off" placeholder="请输入联系人传真">
  199. </el-input>
  200. </el-form-item>
  201. </td>
  202. <th>E-mail</th>
  203. <td>
  204. <el-form-item label-width="0" prop="linkEmail">
  205. <el-input v-model="form.linkEmail" type="text" auto-complete="off" placeholder="请输入联系人邮箱">
  206. </el-input>
  207. </el-form-item>
  208. </td>
  209. </tr>
  210. <tr>
  211. <th>企业上市信息</th>
  212. <th><span style="color: red;">*</span>企业是否上市</th>
  213. <td>
  214. <el-form-item label-width="0" prop="listedFlag">
  215. <el-radio-group v-model="form.listedFlag">
  216. <el-radio v-for="(item, index) in yesOrNoOptions" :key="index" :label="item.dictValue">{{item.dictLabel}}</el-radio>
  217. </el-radio-group>
  218. </el-form-item>
  219. </td>
  220. <template v-if="form.listedFlag == 1">
  221. <th><span style="color: red;">*</span>企业上市代码</th>
  222. <td>
  223. <el-form-item label-width="0" prop="listingCode">
  224. <el-input v-model="form.listingCode" type="text" auto-complete="off" placeholder="请输入企业上市代码">
  225. </el-input>
  226. </el-form-item>
  227. </td>
  228. </template>
  229. </tr>
  230. <tr>
  231. <th>风险投资信息</th>
  232. <th><span style="color: red;">*</span>是否引入风险投资</th>
  233. <td>
  234. <el-form-item label-width="0" prop="investFlag">
  235. <el-radio-group v-model="form.investFlag">
  236. <el-radio v-for="(item, index) in yesOrNoOptions" :key="index" :label="item.dictValue">{{item.dictLabel}}</el-radio>
  237. </el-radio-group>
  238. </el-form-item>
  239. </td>
  240. <template v-if="form.investFlag == 1">
  241. <th><span style="color: red;">*</span>风险投资金额</th>
  242. <td>
  243. <el-form-item label-width="0" prop="investCapital">
  244. <el-input v-model="form.investCapital" type="text" auto-complete="off" placeholder="请输入风险投资金额">
  245. <template slot="append">万元</template>
  246. </el-input>
  247. </el-form-item>
  248. </td>
  249. </template>
  250. </tr>
  251. <tr>
  252. <th>高新企业</th>
  253. <th><span style="color: red;">*</span>是否为高新企业</th>
  254. <td>
  255. <el-form-item label-width="0" prop="techFlag">
  256. <el-radio-group v-model="form.techFlag">
  257. <el-radio v-for="(item, index) in yesOrNoOptions" :key="index" :label="item.dictValue">{{item.dictLabel}}</el-radio>
  258. </el-radio-group>
  259. </el-form-item>
  260. </td>
  261. <template v-if="form.techFlag == 1">
  262. <th><span style="color: red;">*</span>高新企业编号</th>
  263. <td>
  264. <el-form-item label-width="0" prop="techCode">
  265. <el-input v-model="form.techCode" type="text" auto-complete="off" placeholder="请输入高新企业编号">
  266. </el-input>
  267. </el-form-item>
  268. </td>
  269. </template>
  270. </tr>
  271. <tr>
  272. <th>上年度是否做加计扣除</th>
  273. <th><span style="color: red;">*</span>上年度是否做加计扣除</th>
  274. <td>
  275. <el-form-item label-width="0" prop="deductionFlag">
  276. <el-radio-group v-model="form.deductionFlag">
  277. <el-radio v-for="(item, index) in yesOrNoOptions" :key="index" :label="item.dictValue">{{item.dictLabel}}</el-radio>
  278. </el-radio-group>
  279. </el-form-item>
  280. </td>
  281. </tr>
  282. <tr>
  283. <th rowspan="2">附件</th>
  284. <th><span style="color: red;">*</span>企业营业执照</th>
  285. <td colspan="3">
  286. <el-form-item label-width="3" prop="licensePath" ref="licenseUpload">
  287. <ImageUpload @input="handleLicenseSuccess" :params="params" :limit="limit" :value="form.licensePath" :fileSize="fileSize"></ImageUpload>
  288. </el-form-item>
  289. </td>
  290. </tr>
  291. <tr>
  292. <th>其他附件</th>
  293. <td colspan="3">
  294. <el-form-item prop="attachIds" label-width="0">
  295. <el-upload
  296. class="upload-demo"
  297. :action="action"
  298. :on-preview="handlePreview"
  299. :before-remove="beforeRemove"
  300. :on-success="handleFileSuccess"
  301. multiple
  302. :data="params"
  303. :file-list="form.fileList">
  304. <el-button size="small" type="primary">点击上传</el-button>
  305. </el-upload>
  306. </el-form-item>
  307. </td>
  308. </tr>
  309. <tr>
  310. <th>文件水印</th>
  311. <th>文件水印</th>
  312. <td colspan="3">
  313. <el-form-item label-width="0" prop="logo" ref="logoUpload">
  314. <ImageUpload @input="handleLogoSuccess" :params="params" :limit="limit" :value="form.logo" :fileSize="fileSize"></ImageUpload>
  315. </el-form-item>
  316. </td>
  317. </tr>
  318. </table>
  319. <el-row :gutter="40" style="margin-top: 20px;">
  320. <el-col :span="24">
  321. <el-form-item style="width:100%;text-align: center;" label-width="0px">
  322. <el-button
  323. :loading="loading"
  324. size="medium"
  325. type="primary"
  326. @click.native.prevent="handleRegister" style="width: 100px;">
  327. <span v-if="!loading">注册</span>
  328. <span v-else>注 册 中...</span>
  329. </el-button>
  330. <el-button size="medium" type="primary" style="width: 100px;" @click="cancel">取消</el-button>
  331. </el-form-item>
  332. </el-col>
  333. </el-row>
  334. </el-form>
  335. </div>
  336. </div>
  337. </template>
  338. <script>
  339. import { getCodeImg, registerEntApi,getEntUserById,entUserAudit,enterUserNoToken,getEnclosureApi,deleteEnclosureApi } from "@/api/login";
  340. import {getProvinceDataApi,getRegionChildrenApi,validLicenseApi} from "@/api/common/common"
  341. import { regTypeOptions,mainProductsOptions,yesOrNoOptions } from "@/utils/dataFormat"
  342. import FileUpload from '@/components/FileUpload'
  343. import ImageUpload from '@/components/ImageUpload'
  344. import { validIDcard,validAmount} from '@/utils/validate'
  345. import { validNumber,validZh } from '@/utils/validate'
  346. export default {
  347. name: "First",
  348. components: {
  349. FileUpload,
  350. ImageUpload
  351. },
  352. data() {
  353. return {
  354. action: process.env.VUE_APP_BASE_API + "/common/attach/upload", // 上传的图片服务器地址
  355. tokenVisile: false,
  356. limit: 1, //长传图片数量
  357. fileSize: 1,
  358. params: {
  359. attachType: 'ENT',
  360. dataId: ''
  361. },
  362. dialogVisible: false,
  363. dialogImageUrl: "",
  364. provinceName: '',
  365. attachType: 'ENT',
  366. dataId: '',
  367. list: [],
  368. token: '',
  369. cityName: '',
  370. districtName: '',
  371. codeUrl: "",
  372. regTypeOptions: regTypeOptions,
  373. mainProductsOptions: mainProductsOptions,
  374. yesOrNoOptions: yesOrNoOptions,
  375. provinceDataList: [],
  376. cityDataList: [],
  377. districtDataList: [],
  378. form: {
  379. startDate: '',
  380. endDate: '',
  381. attachIds: [],
  382. provinceId: '',
  383. cityId: '',
  384. districtId: '',
  385. mainProducts: '',
  386. userName: "",
  387. techFlag: 1,
  388. listedFlag: 1,
  389. investFlag: 1,
  390. deductionFlag: 1
  391. },
  392. registerRules: {
  393. userName: [
  394. { required: true, trigger: "blur", message: "请输入您的账号" },
  395. { min: 2, max: 20, message: '用户账号长度必须介于 2 和 20 之间', trigger: 'blur' }
  396. ],
  397. email: [
  398. { required: true, trigger: ["blur", "change"], message: "请输入邮箱",type: "email", },
  399. ],
  400. entName: [
  401. { required: true, trigger: "blur", message: "请输入企业名称" },
  402. { validator: validZh, trigger: 'blur' }
  403. ],
  404. license: [
  405. { required: true, trigger: "blur", message: "请输入统一社会信用代码" },
  406. {min: 18,max: 18, message: '请输入正确的统一社会信用代码格式', trigger: 'blur' }
  407. ],
  408. regCapital: [
  409. { required: true, trigger: "blur", message: "请输入注册资金" },
  410. { validator: validAmount, trigger: 'blur'}
  411. ],
  412. regDate: [
  413. { required: true, trigger: "change", message: "请选择工商注册时间" },
  414. ],
  415. regType: [
  416. { required: true, trigger: "change", message: "请选择工商注册类型" },
  417. ],
  418. mainProducts: [
  419. { required: true, message: '请至少选择一个主营产品(服务)所属技术领域', trigger: 'change' }
  420. ],
  421. address: [
  422. { required: true, trigger: "blur", message: "请输入通信地址" },
  423. {max: 50, message: '最多输入50个字符', trigger: 'blur' }
  424. ],
  425. zipCode: [
  426. { required: true, trigger: "blur", message: "请输入邮政编码" },
  427. { validator: validNumber, trigger: 'blur'},
  428. {max: 6, message: '最多输入6位数字', trigger: 'blur' }
  429. ],
  430. provinceId: [
  431. { required: true, trigger: "change", message: "请选择省份" },
  432. ],
  433. cityId: [
  434. { required: true, trigger: "change", message: "请选择市" },
  435. ],
  436. districtId: [
  437. { required: true, trigger: "change", message: "请选择区" },
  438. ],
  439. taxOffice: [
  440. { required: true, trigger: "blur", message: "企业所得税主管税务机关" },
  441. {max: 30, message: '最多输入30个字符', trigger: 'blur' }
  442. ],
  443. legalName: [
  444. { required: true, trigger: "blur", message: "请输入姓名" },
  445. {max: 30, message: '最多输入30个字符', trigger: 'blur' }
  446. ],
  447. legalIdCard: [
  448. { required: true, trigger: "blur", message: "请输入身份证号码" },
  449. { validator: validIDcard, trigger: 'blur'}
  450. ],
  451. legalMobile: [
  452. { required: true, trigger: "blur", message: "请输入手机号码" },
  453. {
  454. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  455. message: "请输入正确的手机号码",
  456. trigger: "blur"
  457. }
  458. ],
  459. linkName: [
  460. { required: true, trigger: "blur", message: "请输入姓名" },
  461. {max: 30, message: '最多输入30个字符', trigger: 'blur' }
  462. ],
  463. linkIdCard: [
  464. { required: true, trigger: "blur", message: "请输入身份证号码" },
  465. { validator: validIDcard, trigger: 'blur'}
  466. ],
  467. linkMobile: [
  468. { required: true, trigger: "blur", message: "请输入手机号码" },
  469. {
  470. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  471. message: "请输入正确的手机号码",
  472. trigger: "blur"
  473. }
  474. ],
  475. listedFlag: [
  476. { required: true, trigger: "change", message: "请选择企业是否上市" },
  477. ],
  478. listingCode: [
  479. { required: true, trigger: "blur", message: "请输入企业上市代码" },
  480. {max: 30, message: '最多输入30个字符', trigger: 'blur' }
  481. ],
  482. investFlag: [
  483. { required: true, trigger: "change", message: "请选择是否引入风险投资" },
  484. ],
  485. investCapital: [
  486. { required: true, trigger: "blur", message: "请输入风险投资金额" },
  487. { validator: validAmount, trigger: 'blur'}
  488. ],
  489. techFlag: [
  490. { required: true, trigger: "change", message: "请选择是否为高新企业" },
  491. ],
  492. techCode: [
  493. { required: true, trigger: "blur", message: "请输入高新企业编号" },
  494. {max: 30, message: '最多输入30个字符', trigger: 'blur' }
  495. ],
  496. deductionFlag: [
  497. { required: true, trigger: "change", message: "请选择是否做加计扣除" },
  498. ],
  499. licensePath: [
  500. { required: true, trigger: "change", message: "请上传营业执照附件" },
  501. ],
  502. },
  503. loading: false,
  504. captchaOnOff: true,
  505. returnFlag: true
  506. };
  507. },
  508. created() {
  509. this.getCode();
  510. this.getProvinceData()
  511. this.token = this.$route.query.token || ''
  512. if(this.token) {
  513. this.getData()
  514. }
  515. },
  516. methods: {
  517. handlePreview(file) {
  518. if (file) {
  519. const addTypeArray = file.name.split(".");
  520. const addType = addTypeArray[addTypeArray.length - 1];
  521. let filePath = ""
  522. if(file.id) {
  523. filePath = file.url
  524. } else {
  525. filePath = file.response.data.url
  526. }
  527. if (addType === "pdf") {
  528. let routeData = this.$router.resolve({
  529. path: "/pdfPreview",
  530. query: { url: filePath },
  531. });
  532. window.open(routeData.href, "_blank");
  533. }
  534. //".rar, .zip, .doc, .docx, .xls, .txt, .pdf, .jpg, .png, .jpeg,"
  535. else if (addType === "doc" || addType === "docx" || addType === "xls" || addType === "xlsx") {
  536. window.open(filePath);
  537. } else if (addType === "txt") {
  538. window.open(filePath);
  539. } else if (["png", "jpg", "jpeg"].includes(addType)) {
  540. window.open(filePath);
  541. } else if (addType === "rar" || addType === "zip") {
  542. this.$message({
  543. message: "该文件类型暂不支持预览",
  544. type: "warning",
  545. });
  546. return false;
  547. }
  548. }
  549. },
  550. beforeRemove(file, fileList) {
  551. if(file.id) {
  552. const id = file.id
  553. let _this = this
  554. return this.$confirm('是否确认删除该数据?', "警告", {
  555. confirmButtonText: "确定",
  556. cancelButtonText: "取消",
  557. type: "warning"
  558. }).then(function() {
  559. return deleteEnclosureApi(_this.token,id);
  560. }).then(() => {
  561. this.$modal.msgSuccess("删除成功");
  562. })
  563. }
  564. },
  565. handleFileSuccess(response, file, fileList) {
  566. this.form.attachIds = []
  567. fileList.forEach(item => {
  568. if(item.id) {
  569. this.form.attachIds.push(item.id)
  570. }else {
  571. this.form.attachIds.push(item.response.data.id)
  572. }
  573. })
  574. },
  575. validLicense(val) {
  576. validLicenseApi(val).then(res => {
  577. // true存在
  578. if(res.data) {
  579. this.$message.error('统一社会信用代码已经存在,不可以重复注册');
  580. }
  581. })
  582. },
  583. getEnclosureData() {
  584. getEnclosureApi(this.token,this.attachType, this.dataId).then(res => {
  585. this.list = res.data.records
  586. this.list.map(item => {
  587. item.name = item.fileName
  588. })
  589. this.$set(this.form, 'fileList', this.list)
  590. this.$forceUpdate()
  591. })
  592. },
  593. getData() {
  594. this.loading = true
  595. getEntUserById(this.token).then(res => {
  596. this.loading = false
  597. this.form = res.data || {}
  598. this.dataId = res.data.id || ""
  599. this.params.dataId = this.dataId || ""
  600. if(this.dataId) {
  601. this.getEnclosureData()
  602. }
  603. this.form.provinceId = res.data.provinceId
  604. if(this.form.provinceId) {
  605. getRegionChildrenApi(this.form.provinceId).then(res => {
  606. if(res.code == 200) {
  607. this.cityDataList = res.data
  608. }
  609. })
  610. }
  611. if(this.form.cityId) {
  612. getRegionChildrenApi(this.form.cityId).then(res => {
  613. if(res.code == 200) {
  614. this.districtDataList = res.data
  615. }
  616. })
  617. }
  618. })
  619. },
  620. handleSuccess(file) {
  621. this.form.licensePath = file.url;
  622. this.form.fileName = file.name;
  623. },
  624. handleSaleSuccess(files) {
  625. this.form.fileList = files
  626. this.form.attachIds = []
  627. files.forEach(item => {
  628. this.form.attachIds.push(item.response.data.id)
  629. });
  630. },
  631. handleLogoSuccess(file) {
  632. this.form.logo = file
  633. },
  634. handleLicenseSuccess(file) {
  635. this.form.licensePath = file
  636. this.$refs.licenseUpload.clearValidate()
  637. },
  638. //选择省份
  639. getCityData() {
  640. this.form.cityId = ''
  641. this.form.districtId = ''
  642. getRegionChildrenApi(this.form.provinceId).then(res => {
  643. if(res.code == 200) {
  644. this.cityDataList = res.data
  645. let obj = this.provinceDataList.find(item => {
  646. return item.id == this.form.provinceId
  647. })
  648. this.provinceName = obj.name
  649. this.form.taxOffice = '国家税务总局'+this.provinceName+'税务局'
  650. }
  651. })
  652. },
  653. //选择市
  654. getDistrictData() {
  655. this.form.districtId = ''
  656. getRegionChildrenApi(this.form.cityId).then(res => {
  657. if(res.code == 200) {
  658. this.districtDataList = res.data
  659. let obj = this.cityDataList.find(item => {
  660. return item.id == this.form.cityId
  661. })
  662. this.cityName = obj.name
  663. this.form.taxOffice = '国家税务总局'+this.cityName+'税务局'
  664. }
  665. })
  666. },
  667. changeDistrict() {
  668. let obj = this.districtDataList.find(item => {
  669. return item.id == this.form.districtId
  670. })
  671. this.districtName = obj.name
  672. this.form.taxOffice = '国家税务总局'+this.districtName+'税务局'
  673. },
  674. getProvinceData() {
  675. getProvinceDataApi().then(res => {
  676. if(res.code == 200) {
  677. this.provinceDataList = res.data
  678. this.form.provinceId = '1481196860266852481'
  679. getRegionChildrenApi(this.form.provinceId).then(res => {
  680. if(res.code == 200) {
  681. this.cityDataList = res.data
  682. this.form.cityId = '1481196860266852482'
  683. getRegionChildrenApi(this.form.cityId).then(res => {
  684. if(res.code == 200) {
  685. this.districtDataList = res.data
  686. }
  687. })
  688. }
  689. })
  690. }
  691. })
  692. this.form.taxOffice = '国家税务总局长沙市税务局'
  693. },
  694. getCode() {
  695. getCodeImg().then(res => {
  696. this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
  697. if (this.captchaOnOff) {
  698. this.codeUrl = "data:image/gif;base64," + res.img;
  699. this.form.uuid = res.uuid;
  700. }
  701. });
  702. },
  703. handleRegister() {
  704. this.$refs.form.validate((valid,obj) => {
  705. if (valid) {
  706. this.loading = true;
  707. if(this.token) {
  708. entUserAudit(this.token, this.form).then(res => {
  709. this.$alert("注册信息修改成功", '系统提示', {
  710. dangerouslyUseHTMLString: true,
  711. type: 'success'
  712. }).then(() => {
  713. this.$store.dispatch('LogOut').then(() => {
  714. this.$router.push("/login");
  715. })
  716. }).catch(() => {});
  717. }).catch(() => {
  718. this.loading = false;
  719. })
  720. } else {
  721. validLicenseApi(this.form.license).then(res => {
  722. if(res.data) {
  723. this.$message.error('统一社会信用代码已经存在,不可以重复注册');
  724. this.loading = false;
  725. }else {
  726. registerEntApi(this.form).then(res => {
  727. const userName = this.form.userName;
  728. this.$alert("<font color='red'>您已注册成功,账户为统一信用代码,密码为默认123456。请等待审核通过后登录平台进行操作。</font>", '系统提示', {
  729. dangerouslyUseHTMLString: true,
  730. type: 'success'
  731. }).then(() => {
  732. this.$router.push("/login");
  733. }).catch(() => {});
  734. }).catch(() => {
  735. this.loading = false;
  736. })
  737. }
  738. })
  739. }
  740. }else {
  741. const a = []
  742. for (let key in obj) {
  743. a.push(obj[key][0].message)
  744. }
  745. this.$message({
  746. message: a[0],
  747. type: "warning"
  748. })
  749. return false
  750. }
  751. });
  752. },
  753. cancel() {
  754. this.$router.go(-1);
  755. }
  756. }
  757. };
  758. </script>
  759. <style lang="scss" scoped>
  760. .content {
  761. width: 1200px;
  762. margin: 0 auto;
  763. overflow: hidden;
  764. }
  765. .register {
  766. display: flex;
  767. justify-content: center;
  768. align-items: center;
  769. height: 900px;
  770. overflow-y: auto;
  771. scroll-behavior: auto;
  772. background-image: url("../../assets/images/login-background.jpg");
  773. background-size: cover;
  774. }
  775. .title {
  776. margin: 0px auto 30px auto;
  777. text-align: center;
  778. color: #FFFFFF;
  779. }
  780. // @media ( max-width : 850px) {
  781. // .media {
  782. // display: none !important;
  783. // }
  784. // }
  785. // @media ( min-width: 850px ) {
  786. // .media-short {
  787. // display: none !important;
  788. // }
  789. // }
  790. </style>