edit.vue 36 KB

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