edit.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <template>
  2. <div class="app-container" v-loading="loading">
  3. <el-form ref="form" :model="form" :rules="registerRules" label-width="170px">
  4. <template v-if="type == 'add'">
  5. <h3 class="toolbar">
  6. <span class="title">账户信息</span>
  7. </h3>
  8. <el-row :gutter="40">
  9. <el-col :span="12">
  10. <el-form-item label="账户名称" prop="userName">
  11. <el-input v-model="form.userName" type="text" auto-complete="off" placeholder="账号">
  12. </el-input>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="12">
  16. <el-form-item label="密码" prop="password">
  17. <el-input
  18. v-model="form.password"
  19. type="password"
  20. auto-complete="new-password"
  21. placeholder="密码">
  22. </el-input>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="12">
  26. <el-form-item label="确认密码" prop="confirmPassword">
  27. <el-input
  28. v-model="form.confirmPassword"
  29. type="password"
  30. auto-complete="new-password"
  31. placeholder="确认密码">
  32. </el-input>
  33. </el-form-item>
  34. </el-col>
  35. </el-row>
  36. <h3 class="toolbar">
  37. <span class="title">账户联系人信息</span>
  38. </h3>
  39. <el-row :gutter="40">
  40. <el-col :span="12">
  41. <el-form-item label="姓名" prop="nickName">
  42. <el-input v-model="form.nickName" type="text" auto-complete="off" placeholder="姓名">
  43. </el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="12">
  47. <el-form-item label="手机号码" prop="phonenumber">
  48. <el-input v-model="form.phonenumber" type="text" auto-complete="off" placeholder="手机号码">
  49. </el-input>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="12">
  53. <el-form-item label="邮箱地址" prop="email">
  54. <el-input v-model="form.email" type="text" auto-complete="off" placeholder="邮箱地址">
  55. </el-input>
  56. </el-form-item>
  57. </el-col>
  58. </el-row>
  59. </template>
  60. <h3 class="toolbar">
  61. <span class="title">企业信息</span>
  62. </h3>
  63. <el-row :gutter="40">
  64. <el-col :span="12">
  65. <el-form-item label="企业名称" prop="entName">
  66. <el-input v-model="form.entName" type="text" auto-complete="off" placeholder="请输入企业名称">
  67. </el-input>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="12">
  71. <el-form-item label="统一社会信用代码" prop="license">
  72. <el-input type="text"
  73. v-model="form.license"
  74. placeholder="请输入统一社会信用代码">
  75. </el-input>
  76. </el-form-item>
  77. </el-col>
  78. <el-col :span="12">
  79. <el-form-item label="注册资金" prop="regCapital">
  80. <el-input type="text"
  81. v-model="form.regCapital"
  82. placeholder="请输入注册资金">
  83. </el-input>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="12">
  87. <el-form-item label="工商注册时间" prop="regDate">
  88. <el-date-picker v-model="form.regDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"></el-date-picker>
  89. </el-form-item>
  90. </el-col>
  91. <el-col :span="12">
  92. <el-form-item label="工商注册类型" prop="regType">
  93. <el-select v-model="form.regType" filterable>
  94. <el-option v-for="item in regTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
  95. </el-select>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="24">
  99. <el-form-item label="主营产品(服务)所属技术领域" prop="mainProductArray">
  100. <el-checkbox-group v-model="form.mainProductArray">
  101. <el-checkbox v-for="(item, index) in mainProductsOptions" :label="item.dictLabel" :key="index">{{item.dictLabel}}</el-checkbox>
  102. </el-checkbox-group>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="12">
  106. <el-form-item label="通信地址" prop="address">
  107. <el-input v-model="form.address" type="text" auto-complete="off" placeholder="请输入通信地址">
  108. </el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="12">
  112. <el-form-item label="邮政编码" prop="zipCode">
  113. <el-input v-model="form.zipCode" type="text" auto-complete="off" placeholder="请输入邮政编码">
  114. </el-input>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="8">
  118. <el-form-item label="企业所属行政区域" prop="provinceId">
  119. <el-select v-model="form.provinceId" placeholder="省" @change="getCityData" style="width: 220px;" filterable>
  120. <el-option v-for="(item,index) in provinceDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  121. </el-select>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="7">
  125. <el-form-item prop="cityId" label-width="60px">
  126. <el-select v-model="form.cityId" placeholder="市" @change="getDistrictData" style="width: 220px;" filterable>
  127. <el-option v-for="(item, index) in cityDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  128. </el-select>
  129. </el-form-item>
  130. </el-col>
  131. <el-col :span="8">
  132. <el-form-item label-width="0px" prop="districtId">
  133. <el-select v-model="form.districtId" placeholder="区" style="width: 220px;" filterable @change="changeDistrict">
  134. <el-option v-for="(item, index) in districtDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  135. </el-select>
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="12">
  139. <el-form-item label="企业所得税主管税务机关" prop="taxOffice">
  140. <el-input v-model="form.taxOffice" type="text" auto-complete="off" placeholder="请输入企业所得税主管税务机关">
  141. </el-input>
  142. </el-form-item>
  143. </el-col>
  144. </el-row>
  145. <h3 class="toolbar">
  146. <span class="title">法人信息</span>
  147. </h3>
  148. <el-row :gutter="40">
  149. <el-col :span="12">
  150. <el-form-item label="姓名" prop="legalName">
  151. <el-input v-model="form.legalName" type="text" auto-complete="off" placeholder="请输入法人姓名">
  152. </el-input>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="12">
  156. <el-form-item label="身份证号码" prop="legalIdCard">
  157. <el-input v-model="form.legalIdCard" type="text" auto-complete="off" placeholder="请输入法人身份证号码">
  158. </el-input>
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="12">
  162. <el-form-item label="手机号码" prop="legalMobile">
  163. <el-input v-model="form.legalMobile" type="text" auto-complete="off" placeholder="手机号码">
  164. </el-input>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="12">
  168. <el-form-item label="固定电话" prop="legalPhone">
  169. <el-input v-model="form.legalPhone" type="text" auto-complete="off" placeholder="请输入固定电话">
  170. </el-input>
  171. </el-form-item>
  172. </el-col>
  173. <el-col :span="12">
  174. <el-form-item label="传真" prop="legalFax">
  175. <el-input v-model="form.legalFax" type="text" auto-complete="off" placeholder="请输入法人传真">
  176. </el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="12">
  180. <el-form-item label="E-mail" prop="legalEmail">
  181. <el-input v-model="form.legalEmail" type="text" auto-complete="off" placeholder="请输入法人邮箱">
  182. </el-input>
  183. </el-form-item>
  184. </el-col>
  185. </el-row>
  186. <h3 class="toolbar">
  187. <span class="title">联系人信息</span>
  188. </h3>
  189. <el-row :gutter="40">
  190. <el-col :span="12">
  191. <el-form-item label="姓名" prop="linkName">
  192. <el-input v-model="form.linkName" type="text" auto-complete="off" placeholder="请输入联系人姓名">
  193. </el-input>
  194. </el-form-item>
  195. </el-col>
  196. <el-col :span="12">
  197. <el-form-item label="身份证号码" prop="linkIdCard">
  198. <el-input v-model="form.linkIdCard" type="text" auto-complete="off" placeholder="请输入联系人身份证号码">
  199. </el-input>
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="12">
  203. <el-form-item label="手机号码" prop="linkMobile">
  204. <el-input v-model="form.linkMobile" type="text" auto-complete="off" placeholder="请填入手机号码">
  205. </el-input>
  206. </el-form-item>
  207. </el-col>
  208. <el-col :span="12">
  209. <el-form-item label="固定电话" prop="linkPhone">
  210. <el-input v-model="form.linkPhone" type="text" auto-complete="off" placeholder="请输入联系人固定电话">
  211. </el-input>
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="12">
  215. <el-form-item label="传真" prop="linkFax">
  216. <el-input v-model="form.linkFax" type="text" auto-complete="off" placeholder="请输入联系人传真">
  217. </el-input>
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="12">
  221. <el-form-item label="E-mail" prop="linkEmail">
  222. <el-input v-model="form.linkEmail" type="text" auto-complete="off" placeholder="请输入联系人邮箱">
  223. </el-input>
  224. </el-form-item>
  225. </el-col>
  226. </el-row>
  227. <h3 class="toolbar">
  228. <span class="title">企业上市信息</span>
  229. </h3>
  230. <el-row :gutter="40">
  231. <el-col :span="12">
  232. <el-form-item label="企业是否上市" prop="listedFlag">
  233. <el-radio-group v-model="form.listedFlag">
  234. <el-radio label="1">是</el-radio>
  235. <el-radio label="0">否</el-radio>
  236. </el-radio-group>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="12">
  240. <el-form-item label="企业上市代码" prop="listingCode">
  241. <el-input v-model="form.listingCode" type="text" auto-complete="off" placeholder="请输入企业上市代码">
  242. </el-input>
  243. </el-form-item>
  244. </el-col>
  245. </el-row>
  246. <h3 class="toolbar">
  247. <span class="title">风险投资信息</span>
  248. </h3>
  249. <el-row :gutter="40">
  250. <el-col :span="12">
  251. <el-form-item label="是否引入风险投资" prop="investFlag">
  252. <el-radio-group v-model="form.investFlag">
  253. <el-radio label="1">是</el-radio>
  254. <el-radio label="0">否</el-radio>
  255. </el-radio-group>
  256. </el-form-item>
  257. </el-col>
  258. <el-col :span="12">
  259. <el-form-item label="风险投资金额" prop="investCapital">
  260. <el-input v-model="form.investCapital" type="text" auto-complete="off" placeholder="请输入风险投资金额">
  261. </el-input>
  262. </el-form-item>
  263. </el-col>
  264. </el-row>
  265. <h3 class="toolbar">
  266. <span class="title">高新企业</span>
  267. </h3>
  268. <el-row :gutter="40">
  269. <el-col :span="12">
  270. <el-form-item label="是否为高新企业" prop="techFlag">
  271. <el-radio-group v-model="form.techFlag">
  272. <el-radio label="1">是</el-radio>
  273. <el-radio label="0">否</el-radio>
  274. </el-radio-group>
  275. </el-form-item>
  276. </el-col>
  277. <el-col :span="12">
  278. <el-form-item label="高新企业编号" prop="techCode">
  279. <el-input v-model="form.techCode" type="text" auto-complete="off" placeholder="请输入高新企业编号">
  280. </el-input>
  281. </el-form-item>
  282. </el-col>
  283. </el-row>
  284. <h3 class="toolbar">
  285. <span class="title">上年度是否做加计扣除</span>
  286. </h3>
  287. <el-row :gutter="40">
  288. <el-col :span="12">
  289. <el-form-item label="上年度是否做加计扣除" prop="deductionFlag">
  290. <el-radio-group v-model="form.deductionFlag">
  291. <el-radio label="1">是</el-radio>
  292. <el-radio label="0">否</el-radio>
  293. </el-radio-group>
  294. </el-form-item>
  295. </el-col>
  296. </el-row>
  297. <h3 class="toolbar">
  298. <span class="title">附件</span>
  299. </h3>
  300. <el-row :gutter="40">
  301. <el-col :span="24">
  302. <el-form-item label="企业营业执照" prop="licensePath">
  303. <FileUpload :file="{url: form.licensePath, name: form.fileName}" @input="handleSuccess">上传材料</FileUpload>
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="24">
  307. <el-form-item label="其他附件" prop="attachIds">
  308. <FileUpload :files="form.attachIds" @input="handleSaleSuccess" :multiple="true">上传材料</FileUpload>
  309. </el-form-item>
  310. </el-col>
  311. </el-row>
  312. <h3 class="toolbar">
  313. <span class="title">文件水印</span>
  314. </h3>
  315. <el-row :gutter="40">
  316. <el-col :span="24">
  317. <el-form-item label="文件水印" prop="logo">
  318. <ImageUpload @input="handleLogoSuccess"></ImageUpload>
  319. </el-form-item>
  320. </el-col>
  321. </el-row>
  322. <h3 class="toolbar">
  323. <span class="title">服务时间</span>
  324. </h3>
  325. <el-row :gutter="40">
  326. <el-col :span="24">
  327. <el-form-item label="服务时间段" prop="serviceDate">
  328. <el-date-picker v-model="form.serviceDate" placeholder="选择日期" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
  329. </el-form-item>
  330. </el-col>
  331. </el-row>
  332. <el-row :gutter="40">
  333. <el-col :span="24">
  334. <el-form-item style="width:100%;text-align: center;" label-width="0px">
  335. <el-button :loading="loading" size="medium" type="primary" @click.native.prevent="handleRegister" style="width: 100px;">
  336. 提交
  337. </el-button>
  338. <el-button size="medium" type="primary" style="width: 100px;">取消</el-button>
  339. </el-form-item>
  340. </el-col>
  341. </el-row>
  342. </el-form>
  343. </div>
  344. </template>
  345. <script>
  346. import { getEntInfoByIdApi,updateEntInfoApi } from "@/api/admin/ent/ent"
  347. import { registerEntApi } from "@/api/login";
  348. import {getProvinceDataApi,getRegionChildrenApi} from "@/api/common/common"
  349. import { regTypeOptions,mainProductsOptions,signatoriesOptions } from "@/utils/dataFormat"
  350. import FileUpload from '@/components/FileUpload'
  351. import ImageUpload from '@/components/ImageUpload'
  352. export default {
  353. name: "First",
  354. components: {
  355. FileUpload,
  356. ImageUpload
  357. },
  358. data() {
  359. const equalToPassword = (rule, value, callback) => {
  360. if (this.form.password !== value) {
  361. callback(new Error("两次输入的密码不一致"));
  362. } else {
  363. callback();
  364. }
  365. };
  366. return {
  367. type: this.$route.query.type,
  368. activeName: '3',
  369. provinceName: '',
  370. cityName: '',
  371. districtName: '',
  372. codeUrl: "",
  373. regTypeOptions: regTypeOptions,
  374. mainProductsOptions: mainProductsOptions,
  375. signatoriesOptions: signatoriesOptions,
  376. provinceDataList: [],
  377. cityDataList: [],
  378. districtDataList: [],
  379. form: {
  380. serviceDate: [],
  381. listedFlag: '1',
  382. investFlag: '1',
  383. startDate: '',
  384. endDate: '',
  385. attachIds: [],
  386. provinceId: '',
  387. cityId: '',
  388. districtId: '',
  389. mainProductArray: ['电子信息'],
  390. mainProducts: '',
  391. userName: "",
  392. password: "",
  393. confirmPassword: "",
  394. code: "",
  395. // uuid: ""
  396. },
  397. registerRules: {
  398. userName: [
  399. { required: true, trigger: "blur", message: "请输入您的账号" },
  400. { min: 2, max: 20, message: '用户账号长度必须介于 2 和 20 之间', trigger: 'blur' }
  401. ],
  402. password: [
  403. { required: true, trigger: "blur", message: "请输入您的密码" },
  404. { min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
  405. ],
  406. confirmPassword: [
  407. { required: true, trigger: "blur", message: "请再次输入您的密码" },
  408. { required: true, validator: equalToPassword, trigger: "blur" }
  409. ],
  410. code: [{ required: true, trigger: "change", message: "请输入验证码" }]
  411. },
  412. loading: false,
  413. captchaOnOff: true
  414. };
  415. },
  416. created() {
  417. this.getProvinceData()
  418. this.form.id = this.$route.params.id || undefined;
  419. this.type = this.$route.query.type || undefined
  420. if(this.form.id) {
  421. this.getData()
  422. }
  423. },
  424. methods: {
  425. getData() {
  426. this.loading = true
  427. getEntInfoByIdApi(this.form.id).then(res => {
  428. this.loading = false
  429. this.form = res.data || {}
  430. this.form.listedFlag = res.data.listedFlag + ''
  431. this.form.investFlag = res.data.investFlag + ''
  432. this.form.techFlag = res.data.techFlag + ''
  433. this.form.deductionFlag = res.data.deductionFlag +''
  434. let mainProductArray = this.form.mainProducts.split(',') || ['电子信息'];
  435. this.$set(this.form, 'mainProductArray', mainProductArray);
  436. this.form.serviceDate = []
  437. if(this.form.startDate) {
  438. this.form.serviceDate[0] = this.form.startDate
  439. this.form.serviceDate[1] = this.form.endDate
  440. }
  441. if(this.form.provinceId) {
  442. this.getCityData()
  443. }
  444. if(this.form.cityId) {
  445. this.getDistrictData()
  446. }
  447. })
  448. },
  449. handleSuccess(file) {
  450. this.form.licensePath = file.url;
  451. this.form.fileName = file.name;
  452. },
  453. handleLogoSuccess(file) {
  454. this.form.logo = file
  455. },
  456. handleSaleSuccess(files) {
  457. files.forEach(item => {
  458. this.form.attachIds.push(item.response.data.id)
  459. });
  460. },
  461. //选择省份
  462. getCityData() {
  463. this.form.cityId = ''
  464. this.form.districtId = ''
  465. getRegionChildrenApi(this.form.provinceId).then(res => {
  466. if(res.code == 200) {
  467. this.cityDataList = res.data
  468. let obj = this.provinceDataList.find(item => {
  469. return item.id == this.form.provinceId
  470. })
  471. this.provinceName = obj.name
  472. this.form.taxOffice = '国家税务总局'+this.provinceName+'税务局'
  473. }
  474. })
  475. },
  476. //选择市
  477. getDistrictData() {
  478. this.form.districtId = ''
  479. getRegionChildrenApi(this.form.cityId).then(res => {
  480. if(res.code == 200) {
  481. this.districtDataList = res.data
  482. let obj = this.cityDataList.find(item => {
  483. return item.id == this.form.cityId
  484. })
  485. this.cityName = obj.name
  486. this.form.taxOffice = '国家税务总局'+this.cityName+'税务局'
  487. }
  488. })
  489. },
  490. changeDistrict() {
  491. let obj = this.districtDataList.find(item => {
  492. return item.id == this.form.districtId
  493. })
  494. this.districtName = obj.name
  495. this.form.taxOffice = '国家税务总局'+this.districtName+'税务局'
  496. },
  497. getProvinceData() {
  498. getProvinceDataApi().then(res => {
  499. if(res.code == 200) {
  500. this.provinceDataList = res.data
  501. }
  502. })
  503. },
  504. handleRegister() {
  505. console.log(process.env.VUE_APP_BASE_API)
  506. this.form.mainProducts = this.form.mainProductArray.join(',')
  507. if(this.type == 'update') {
  508. this.$refs.form.validate(valid => {
  509. if (valid) {
  510. this.loading = true;
  511. updateEntInfoApi(this.form).then(res => {
  512. const userName = this.form.userName;
  513. this.$alert("<font color='red'>恭喜你,您的账号 " + userName + " 信息修改成功!</font>", '系统提示', {
  514. dangerouslyUseHTMLString: true,
  515. type: 'success'
  516. }).then(() => {
  517. this.$store.dispatch("tagsView/delView", this.$route);
  518. this.$router.go(-1);
  519. }).catch(() => {});
  520. }).catch(() => {
  521. this.loading = false;
  522. })
  523. }
  524. });
  525. }else {
  526. this.$refs.form.validate(valid => {
  527. if (valid) {
  528. this.loading = true;
  529. registerEntApi(this.form).then(res => {
  530. const userName = this.form.userName;
  531. this.$alert("<font color='red'>恭喜你,您的账号 " + userName + " 注册成功!</font>", '系统提示', {
  532. dangerouslyUseHTMLString: true,
  533. type: 'success'
  534. }).then(() => {
  535. this.$store.dispatch("tagsView/delView", this.$route);
  536. this.$router.go(-1);
  537. }).catch(() => {});
  538. }).catch(() => {
  539. this.loading = false;
  540. })
  541. }
  542. });
  543. }
  544. }
  545. },
  546. watch: {
  547. 'form.serviceDate'(val) {
  548. if(this.form.serviceDate.length > 0) {
  549. this.form.startDate = this.form.serviceDate[0]
  550. this.form.endDate = this.form.serviceDate[1]
  551. }
  552. }
  553. }
  554. };
  555. </script>
  556. <style rel="stylesheet/scss" lang="scss">
  557. </style>