poolForm.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031
  1. <template>
  2. <div :class="type === '2' ? 'poolAdd poolDetail' : 'poolAdd'">
  3. <el-form
  4. ref="form"
  5. :model="form"
  6. :rules="type === '2' ? rules1 : rules"
  7. label-width="160px"
  8. class="special-el-form"
  9. >
  10. <h3>项目基础信息</h3>
  11. <el-divider></el-divider>
  12. <el-form-item label="项目名称" prop="projectName">
  13. <el-input
  14. maxlength="100"
  15. v-model="form.projectName"
  16. placeholder="请输入项目名称"
  17. :disabled="type === '2'"
  18. />
  19. </el-form-item>
  20. <el-form-item label="渠道" prop="tProjectChannel.channelName">
  21. <el-select
  22. :disabled="type === '2'"
  23. v-model="form.tProjectChannel.channelName"
  24. placeholder="请选择"
  25. clearable
  26. @change="handleChannel"
  27. >
  28. <el-option
  29. v-for="item in channelList"
  30. :key="item.id"
  31. :label="item.channelName"
  32. :value="item.id"
  33. />
  34. <el-option label="无" value="-1" />
  35. </el-select>
  36. <!-- <channelItem
  37. ref="channelItem"
  38. @getChannelInfo="getChannelInfo"
  39. ></channelItem> -->
  40. <!-- <el-input v-model="form.channel" placeholder="请输入渠道" /> -->
  41. </el-form-item>
  42. <el-form-item label="初次接触日期" prop="contactDate">
  43. <el-date-picker
  44. :disabled="type === '2'"
  45. clearable
  46. v-model="form.contactDate"
  47. type="date"
  48. value-format="yyyy-MM-dd"
  49. placeholder="请选择初次接触日期"
  50. >
  51. </el-date-picker>
  52. </el-form-item>
  53. <el-form-item label="所属组别">
  54. <el-select
  55. v-model="form.tProjectChannel.channelGroup"
  56. disabled
  57. placeholder="请选择所属组别"
  58. >
  59. <el-option
  60. v-for="dict in dict.type.project_group"
  61. :key="dict.value"
  62. :label="dict.label"
  63. :value="dict.value"
  64. ></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item label="所属行业" prop="industry">
  68. <el-select
  69. v-model="form.industry"
  70. placeholder="请选择所属行业"
  71. :disabled="type === '2'"
  72. >
  73. <el-option
  74. v-for="dict in dict.type.CUSTOMER_TRADE"
  75. :key="dict.value"
  76. :label="dict.label"
  77. :value="dict.value"
  78. ></el-option>
  79. </el-select>
  80. </el-form-item>
  81. <el-form-item label="项目负责人" prop="investHead">
  82. <el-input
  83. v-if="type === '2'"
  84. maxlength="30"
  85. v-model="form.investHead"
  86. :disabled="type === '2'"
  87. />
  88. <div
  89. class="el-input__inner inputSimulation"
  90. @click="openSelectDept"
  91. v-else
  92. >
  93. {{ form.investHead ? form.investHead : "请选择项目负责人" }}
  94. </div>
  95. <selecDept
  96. ref="selecDepts"
  97. @getDeptUserInfo="getDeptUserInfo"
  98. :deptId="deptId"
  99. ></selecDept>
  100. </el-form-item>
  101. <el-form-item
  102. label="项目情况描述"
  103. prop="description"
  104. class="special-el-form-item"
  105. >
  106. <el-input
  107. :disabled="type === '2'"
  108. maxlength="200"
  109. rows="4"
  110. type="textarea"
  111. v-model="form.description"
  112. placeholder="请输入项目情况描述"
  113. />
  114. </el-form-item>
  115. <h3>项目公司信息</h3>
  116. <el-divider></el-divider>
  117. <el-form-item label="公司名称" prop="tProjectCompany.companyName">
  118. <el-input
  119. :disabled="type === '2'"
  120. maxlength="100"
  121. v-model="form.tProjectCompany.companyName"
  122. placeholder="请输入公司名称"
  123. />
  124. </el-form-item>
  125. <el-form-item label="统一社会信用代码" prop="tProjectCompany.companyCode">
  126. <el-input
  127. :disabled="type === '2'"
  128. maxlength="35"
  129. v-model="form.tProjectCompany.companyCode"
  130. placeholder="请输入企业统一社会信用代码"
  131. />
  132. </el-form-item>
  133. <el-form-item label="营业开始时间" prop="tProjectCompany.startTime">
  134. <el-date-picker
  135. :disabled="type === '2'"
  136. clearable
  137. v-model="form.tProjectCompany.startTime"
  138. type="date"
  139. value-format="yyyy-MM-dd"
  140. placeholder="请选择营业开始时间"
  141. >
  142. </el-date-picker>
  143. </el-form-item>
  144. <el-form-item label="营业结束时间" prop="tProjectCompany.endTime">
  145. <el-date-picker
  146. :disabled="type === '2'"
  147. clearable
  148. v-model="form.tProjectCompany.endTime"
  149. type="date"
  150. value-format="yyyy-MM-dd"
  151. placeholder="请选择营业结束时间"
  152. >
  153. </el-date-picker>
  154. </el-form-item>
  155. <el-form-item
  156. label="注册资本(万元)"
  157. prop="tProjectCompany.registeredCapital"
  158. >
  159. <el-input
  160. :disabled="type === '2'"
  161. maxlength="20"
  162. v-model="form.tProjectCompany.registeredCapital"
  163. @input="
  164. (value) =>
  165. (form.tProjectCompany.registeredCapital = value
  166. .replace(/[^0-9.]/g, '')
  167. .replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
  168. .replace(/-/g, ''))
  169. "
  170. placeholder="请输入注册资本"
  171. />
  172. </el-form-item>
  173. <el-form-item label="实缴资本(万元)" prop="tProjectCompany.paidCapital">
  174. <el-input
  175. :disabled="type === '2'"
  176. maxlength="20"
  177. v-model="form.tProjectCompany.paidCapital"
  178. @input="
  179. (value) =>
  180. (form.tProjectCompany.paidCapital = value
  181. .replace(/[^0-9.]/g, '')
  182. .replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
  183. .replace(/-/g, ''))
  184. "
  185. placeholder="请输入实缴资本"
  186. />
  187. </el-form-item>
  188. <el-form-item label="实控人" prop="tProjectCompany.actualBod">
  189. <el-input
  190. :disabled="type === '2'"
  191. maxlength="25"
  192. v-model="form.tProjectCompany.actualBod"
  193. placeholder="请输入实控人"
  194. />
  195. </el-form-item>
  196. <el-form-item label="联系电话" prop="tProjectCompany.phone">
  197. <el-input
  198. :disabled="type === '2'"
  199. maxlength="20"
  200. v-model="form.tProjectCompany.phone"
  201. placeholder="请输入联系电话"
  202. />
  203. </el-form-item>
  204. <el-form-item label="所属类型" prop="tProjectCompany.type">
  205. <el-input
  206. :disabled="type === '2'"
  207. maxlength="25"
  208. v-model="form.tProjectCompany.type"
  209. placeholder="请输入所属类型"
  210. />
  211. </el-form-item>
  212. <el-form-item label="备案时间" prop="tProjectCompany.filingTime">
  213. <el-date-picker
  214. :disabled="type === '2'"
  215. clearable
  216. v-model="form.tProjectCompany.filingTime"
  217. type="date"
  218. value-format="yyyy-MM-dd"
  219. placeholder="请选择备案时间"
  220. >
  221. </el-date-picker>
  222. </el-form-item>
  223. <el-form-item
  224. label="注册地址"
  225. prop="tProjectCompany.registeredAddress"
  226. class="special-el-form-item"
  227. >
  228. <el-input
  229. :disabled="type === '2'"
  230. type="textarea"
  231. rows="4"
  232. maxlength="100"
  233. v-model="form.tProjectCompany.registeredAddress"
  234. placeholder="请输入注册地址"
  235. />
  236. </el-form-item>
  237. <el-form-item
  238. label="办公地址"
  239. prop="tProjectCompany.businessAddress"
  240. class="special-el-form-item"
  241. >
  242. <el-input
  243. :disabled="type === '2'"
  244. type="textarea"
  245. rows="4"
  246. maxlength="100"
  247. v-model="form.tProjectCompany.businessAddress"
  248. placeholder="请输入办公地址"
  249. />
  250. </el-form-item>
  251. <el-form-item
  252. label="公司附件"
  253. prop="listFile"
  254. class="special-el-form-item"
  255. >
  256. <fileItem
  257. ref="fileItem"
  258. :id="form.id"
  259. @getFileList="getFileList"
  260. ></fileItem>
  261. </el-form-item>
  262. <h3>项目公司联系人信息</h3>
  263. <el-divider></el-divider>
  264. <el-form-item label="联系人姓名" prop="tProjectContacts.name">
  265. <el-input
  266. :disabled="type === '2'"
  267. maxlength="25"
  268. v-model="form.tProjectContacts.name"
  269. placeholder="请输入联系人姓名"
  270. />
  271. </el-form-item>
  272. <el-form-item label="职位" prop="tProjectContacts.position">
  273. <el-input
  274. :disabled="type === '2'"
  275. maxlength="25"
  276. v-model="form.tProjectContacts.position"
  277. placeholder="请输入职位"
  278. />
  279. </el-form-item>
  280. <el-form-item label="联系电话/微信" prop="tProjectContacts.contact">
  281. <el-input
  282. :disabled="type === '2'"
  283. maxlength="25"
  284. v-model="form.tProjectContacts.contact"
  285. placeholder="请输入联系电话/微信"
  286. />
  287. </el-form-item>
  288. <h3>项目融资信息</h3>
  289. <el-divider></el-divider>
  290. <el-form-item label="项目融资阶段" prop="financingStage">
  291. <el-select
  292. :disabled="type === '2'"
  293. v-model="form.financingStage"
  294. placeholder="请选择项目融资阶段"
  295. >
  296. <el-option
  297. v-for="dict in dict.type.financing_stage"
  298. :key="dict.value"
  299. :label="dict.label"
  300. :value="dict.value"
  301. ></el-option>
  302. </el-select>
  303. </el-form-item>
  304. <el-form-item label="预期融资金额(万元)" prop="financingMoney">
  305. <el-input
  306. :disabled="type === '2'"
  307. maxlength="20"
  308. v-model="form.financingMoney"
  309. @input="
  310. (value) =>
  311. (form.financingMoney = value.replace(/\D/g, '').replace(/-/g, ''))
  312. "
  313. placeholder="请输入预期融资金额"
  314. />
  315. </el-form-item>
  316. <el-form-item label="投前估值(万元)" prop="investValuation">
  317. <el-input
  318. :disabled="type === '2'"
  319. maxlength="20"
  320. v-model="form.investValuation"
  321. @input="
  322. (value) =>
  323. (form.investValuation = value
  324. .replace(/[^0-9.]/g, '')
  325. .replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
  326. .replace(/-/g, ''))
  327. "
  328. placeholder="请输入投前估值"
  329. />
  330. </el-form-item>
  331. <el-form-item label="预计投资金额(万元)" prop="investMoney">
  332. <el-input
  333. :disabled="type === '2'"
  334. maxlength="20"
  335. v-model="form.investMoney"
  336. @input="
  337. (value) =>
  338. (form.investMoney = value.replace(/\D/g, '').replace(/-/g, ''))
  339. "
  340. placeholder="请输入预计投资金额"
  341. />
  342. </el-form-item>
  343. <!-- -->
  344. <el-form-item label="投资类型" prop="investType">
  345. <el-select
  346. v-model="form.investType"
  347. placeholder="请选择投资类型"
  348. :disabled="type === '2'"
  349. >
  350. <el-option
  351. v-for="dict in dict.type.invest_type"
  352. :key="dict.value"
  353. :label="dict.label"
  354. :value="dict.value"
  355. ></el-option>
  356. </el-select>
  357. </el-form-item>
  358. <el-form-item label="投资策略" prop="investPloy">
  359. <el-select
  360. v-model="form.investPloy"
  361. placeholder="请选择投资策略"
  362. :disabled="type === '2'"
  363. >
  364. <el-option
  365. v-for="dict in dict.type.invest_ploy"
  366. :key="dict.value"
  367. :label="dict.label"
  368. :value="dict.value"
  369. ></el-option>
  370. </el-select>
  371. </el-form-item>
  372. <el-form-item label="投资价值" prop="investWorth">
  373. <el-select
  374. v-model="form.investWorth"
  375. placeholder="请选择投资价值"
  376. :disabled="type === '2'"
  377. >
  378. <el-option
  379. v-for="dict in dict.type.invest_worth"
  380. :key="dict.value"
  381. :label="dict.label"
  382. :value="dict.value"
  383. ></el-option>
  384. </el-select>
  385. </el-form-item>
  386. <el-form-item
  387. label="历次融资"
  388. prop="previousFinancing"
  389. class="special-el-form-item"
  390. >
  391. <el-input
  392. :disabled="type === '2'"
  393. maxlength="200"
  394. rows="4"
  395. type="textarea"
  396. v-model="form.previousFinancing"
  397. placeholder="请输入历次融资"
  398. />
  399. </el-form-item>
  400. <el-form-item
  401. label="融资条件"
  402. prop="financingCondition"
  403. class="special-el-form-item"
  404. >
  405. <el-input
  406. :disabled="type === '2'"
  407. maxlength="200"
  408. rows="4"
  409. type="textarea"
  410. v-model="form.financingCondition"
  411. placeholder="请输入融资条件"
  412. />
  413. </el-form-item>
  414. <el-form-item
  415. label="投资亮点"
  416. prop="investSparkle"
  417. class="special-el-form-item"
  418. >
  419. <el-input
  420. :disabled="type === '2'"
  421. maxlength="200"
  422. rows="4"
  423. type="textarea"
  424. v-model="form.investSparkle"
  425. placeholder="请输入投资亮点"
  426. />
  427. </el-form-item>
  428. <el-form-item
  429. label="股权架构"
  430. prop="shareholding"
  431. class="special-el-form-item"
  432. >
  433. <el-input
  434. :disabled="type === '2'"
  435. maxlength="200"
  436. rows="4"
  437. type="textarea"
  438. v-model="form.shareholding"
  439. placeholder="请输入股权架构"
  440. />
  441. </el-form-item>
  442. <h3>其他</h3>
  443. <el-divider></el-divider>
  444. <el-form-item label="BP" prop="bpFile" class="special-el-form-item">
  445. <fileItem
  446. ref="bpFileItem"
  447. :id="form.id"
  448. @getFileList="getBPFileList"
  449. ></fileItem>
  450. </el-form-item>
  451. <el-form-item
  452. label="其他附件"
  453. prop="otherFile"
  454. class="special-el-form-item"
  455. >
  456. <fileItem
  457. ref="otherFileItem"
  458. :id="form.id"
  459. @getFileList="getOtherFileList"
  460. ></fileItem>
  461. </el-form-item>
  462. <el-form-item label="备注" prop="mark" class="special-el-form-item">
  463. <el-input
  464. :disabled="type === '2'"
  465. maxlength="200"
  466. :readonly="type === '2' ? true : false"
  467. rows="4"
  468. type="textarea"
  469. v-model="form.mark"
  470. placeholder="请输入备注"
  471. />
  472. </el-form-item>
  473. <el-form-item class="btnList" v-if="type === '1'">
  474. <el-button @click="goBack">返 回</el-button>
  475. <el-button
  476. type="warning"
  477. @click="submitForm(1)"
  478. v-preventReClick
  479. v-if="!form.projectState || form.projectState == '1'"
  480. >暂 存</el-button
  481. >
  482. <el-button type="primary" @click="submitForm(2)" v-preventReClick
  483. >提 交</el-button
  484. >
  485. </el-form-item>
  486. </el-form>
  487. </div>
  488. </template>
  489. <script>
  490. import {
  491. listPool,
  492. getPool,
  493. delPool,
  494. addPool,
  495. updatePool,
  496. } from "@/api/invest/pool";
  497. import { listChannel } from "@/api/invest/channel";
  498. import fileItem from "./fileItem";
  499. import channelItem from "./channelItem";
  500. import selecDept from "../components/selecDept";
  501. import { mapGetters } from "vuex";
  502. export default {
  503. props: {
  504. id: {
  505. type: String,
  506. },
  507. type: {
  508. type: String,
  509. default: "1", //1可修改 2不可修改
  510. },
  511. },
  512. components: { fileItem, channelItem, selecDept },
  513. dicts: [
  514. "CUSTOMER_TRADE",
  515. "project_group",
  516. "invest_type",
  517. "invest_ploy",
  518. "invest_worth",
  519. "financing_stage",
  520. ],
  521. data() {
  522. const validateLogo = (rule, value, callback) => {
  523. if (this.fileListBP.length <= 0) {
  524. callback(new Error("请上传BP"));
  525. } else {
  526. callback();
  527. }
  528. };
  529. return {
  530. deptId: process.env.VUE_APP_DEPTID,
  531. title: "新增项目",
  532. baseUrl: process.env.VUE_APP_BASE_API,
  533. // 表单参数
  534. form: {
  535. id: null,
  536. projectName: null,
  537. projectGroup: "",
  538. industry: null,
  539. recordDate: null,
  540. projectCode: null,
  541. channel: "",
  542. contactDate: null,
  543. projectDate: null,
  544. decisionDate: null,
  545. tProjectCompany: {
  546. companyName: null,
  547. companyCode: null,
  548. startTime: null,
  549. endTime: null,
  550. registeredCapital: null,
  551. registeredAddress: null,
  552. paidCapital: null,
  553. businessAddress: null,
  554. actualBod: null,
  555. phone: null,
  556. filingTime: null,
  557. type: null,
  558. },
  559. tProjectContacts: {
  560. name: null,
  561. position: null,
  562. contact: null,
  563. },
  564. tProjectChannel: {
  565. channelName: "",
  566. channelGroup: "",
  567. },
  568. description: null,
  569. projectContacts: null,
  570. investHead: null,
  571. previousFinancing: null,
  572. financingStage: null,
  573. financingCondition: null,
  574. financingMoney: null,
  575. financingDate: null,
  576. investSparkle: null,
  577. investValuation: null,
  578. investMoney: null,
  579. investType: null,
  580. investPloy: null,
  581. investWorth: null,
  582. shareholding: null,
  583. projectStage: null,
  584. projectState: null,
  585. mark: null,
  586. delFlag: null,
  587. createBy: null,
  588. createTime: null,
  589. updateBy: null,
  590. updateTime: null,
  591. listFile: null,
  592. bpFile: null,
  593. otherFile: null,
  594. },
  595. fileList: [],
  596. fileListBP: [],
  597. fileListOther: [],
  598. // 表单校验
  599. rules1: {},
  600. rules: {
  601. projectName: [{ required: true, trigger: "blur", message: "请输入" }],
  602. // channel: [{ required: true, trigger: "blur", message: "请输入" }],
  603. contactDate: [{ required: true, trigger: "blur", message: "请输入" }],
  604. // projectGroup: [
  605. // { required: true, trigger: "change", message: "请选择" },
  606. // ],
  607. industry: [{ required: true, trigger: "change", message: "请选择" }],
  608. investHead: [{ required: true, trigger: "blur", message: "请输入" }],
  609. bpFile: [{ required: true, validator: validateLogo }],
  610. "tProjectChannel.channelName": [
  611. { required: true, trigger: "change", message: "请选择" },
  612. ],
  613. // description: [{ required: true, trigger: "blur", message: "请输入" }],
  614. "tProjectCompany.companyName": [
  615. { required: true, trigger: "blur", message: "请输入" },
  616. ],
  617. "tProjectCompany.companyCode": [
  618. { required: true, trigger: "blur", message: "请输入" },
  619. ],
  620. "tProjectCompany.startTime": [
  621. { required: true, trigger: "blur", message: "请选择" },
  622. ],
  623. "tProjectCompany.endTime": [
  624. { required: true, trigger: "blur", message: "请选择" },
  625. ],
  626. "tProjectCompany.registeredCapital": [
  627. { required: true, trigger: "blur", message: "请输入" },
  628. ],
  629. "tProjectCompany.registeredAddress": [
  630. { required: true, trigger: "blur", message: "请输入" },
  631. ],
  632. "tProjectCompany.paidCapital": [
  633. { required: true, trigger: "blur", message: "请输入" },
  634. ],
  635. "tProjectCompany.businessAddress": [
  636. { required: true, trigger: "blur", message: "请输入" },
  637. ],
  638. "tProjectCompany.actualBod": [
  639. { required: true, trigger: "blur", message: "请输入" },
  640. ],
  641. "tProjectCompany.phone": [
  642. { required: true, trigger: "blur", message: "请输入联系电话" },
  643. // {
  644. // pattern: /^1[3456789]\d{9}$/,
  645. // message: "请输入正确的手机号",
  646. // trigger: "blur",
  647. // },
  648. ],
  649. "tProjectCompany.filingTime": [
  650. { required: true, trigger: "blur", message: "请选择" },
  651. ],
  652. "tProjectCompany.type": [
  653. { required: true, trigger: "blur", message: "请输入" },
  654. ],
  655. // files: [{ required: true, trigger: "blur", message: "请输入" }],
  656. "tProjectContacts.name": [
  657. { required: true, trigger: "blur", message: "请输入" },
  658. ],
  659. "tProjectContacts.position": [
  660. { required: true, trigger: "blur", message: "请输入" },
  661. ],
  662. "tProjectContacts.contact": [
  663. { required: true, trigger: "blur", message: "请输入" },
  664. ],
  665. financingStage: [
  666. { required: true, trigger: "change", message: "请选择" },
  667. ],
  668. financingMoney: [
  669. { required: true, trigger: "blur", message: "请输入" },
  670. ],
  671. investValuation: [
  672. { required: true, trigger: "blur", message: "请输入" },
  673. ],
  674. investMoney: [{ required: true, trigger: "blur", message: "请输入" }],
  675. investType: [{ required: true, trigger: "change", message: "请选择" }],
  676. investPloy: [{ required: true, trigger: "change", message: "请选择" }],
  677. investWorth: [{ required: true, trigger: "change", message: "请选择" }],
  678. // previousFinancing: [{ required: true, trigger: "blur", message: "请输入" }],
  679. // financingCondition: [
  680. // { required: true, trigger: "blur", message: "请输入" },
  681. // ],
  682. investSparkle: [{ required: true, trigger: "blur", message: "请输入" }],
  683. shareholding: [{ required: true, trigger: "blur", message: "请输入" }],
  684. // mark: [{ required: true, trigger: "blur", message: "请输入" }]
  685. },
  686. channelList: [],
  687. };
  688. },
  689. computed: {
  690. ...mapGetters(["user"]),
  691. },
  692. mounted() {
  693. new Promise((resolve, reject) => {
  694. listChannel({
  695. pageNum: 1,
  696. pageSize: 100,
  697. }).then((response) => {
  698. this.channelList = response.rows;
  699. resolve();
  700. });
  701. }).then(() => {
  702. if (this.id) {
  703. this.getPoolDetail(this.id);
  704. } else {
  705. this.reset();
  706. }
  707. });
  708. },
  709. methods: {
  710. // getListChannel() {
  711. // // 渠道
  712. // listChannel({
  713. // pageNum: 1,
  714. // pageSize: 100,
  715. // }).then((response) => {
  716. // this.channelList = response.rows;
  717. // });
  718. // },
  719. // 选择部门人
  720. openSelectDept() {
  721. this.$refs.selecDepts.show(1, this.user.userId);
  722. },
  723. getDeptUserInfo(info) {
  724. if (info.length > 0) {
  725. this.form.investHead = info[0].nickName;
  726. this.$refs.form.clearValidate(["investHead"]);
  727. }
  728. },
  729. // 获取渠道信息
  730. getChannelInfo(info) {
  731. if (info.length > 0) {
  732. this.form.channel = info[0].id;
  733. this.form.tProjectChannel.channelName = info[0].channelName;
  734. this.form.tProjectChannel.channelGroup = info[0].channelGroup;
  735. this.$refs.form.clearValidate(["channel"]);
  736. }
  737. },
  738. // 选择渠道
  739. handleChannel(vId) {
  740. let obj = {};
  741. obj = this.channelList.find((item) => {
  742. return item.id === vId;
  743. });
  744. if (obj && obj.id) {
  745. this.form.channel = obj.id;
  746. this.form.tProjectChannel.channelName = obj.channelName;
  747. this.form.tProjectChannel.channelGroup = obj.channelGroup;
  748. } else {
  749. this.form.channel = -1;
  750. this.form.tProjectChannel.channelName = "无";
  751. this.form.tProjectChannel.channelGroup = "";
  752. }
  753. },
  754. handleChannelItem() {
  755. this.$refs.channelItem.showChannelItem = true;
  756. },
  757. getPoolDetail(id) {
  758. getPool(id).then((response) => {
  759. this.form = response.data;
  760. let channeItem = this.channelList.find((item) => {
  761. if (this.form.channel == item.id) {
  762. return item;
  763. }
  764. });
  765. if (channeItem && channeItem.channelName) {
  766. this.form.tProjectChannel.channelName = channeItem.channelName;
  767. this.form.tProjectChannel.channelGroup = channeItem.channelGroup;
  768. } else {
  769. this.form.tProjectChannel = {
  770. channelName: "无",
  771. channelGroup: "",
  772. };
  773. }
  774. setTimeout(() => {
  775. if (this.type == "2") {
  776. this.$refs.fileItem.handleButton();
  777. this.$refs.bpFileItem.handleButton();
  778. this.$refs.otherFileItem.handleButton();
  779. }
  780. this.$refs.fileItem.fileList = [];
  781. this.$refs.fileItem.getListFileBusinessId(
  782. this.form.tProjectCompany.companyId
  783. );
  784. this.$refs.bpFileItem.fileList = [];
  785. this.$refs.bpFileItem.getListFileBusinessId(this.form.id, "9");
  786. this.$refs.otherFileItem.fileList = [];
  787. this.$refs.otherFileItem.getListFileBusinessId(this.form.id, "0");
  788. }, 300);
  789. });
  790. },
  791. // 获取fileList
  792. getFileList(fileList) {
  793. if (fileList && fileList.length > 0) {
  794. this.fileList = fileList;
  795. } else {
  796. this.fileList = [];
  797. }
  798. },
  799. getBPFileList(fileList) {
  800. if (fileList && fileList.length > 0) {
  801. this.fileListBP = fileList;
  802. this.$refs.form.clearValidate(["bpFile"]);
  803. } else {
  804. this.fileList = [];
  805. }
  806. },
  807. getOtherFileList(fileList) {
  808. if (fileList && fileList.length > 0) {
  809. this.fileListOther = fileList;
  810. } else {
  811. this.fileList = [];
  812. }
  813. },
  814. /** 提交按钮 */
  815. submitForm(type) {
  816. let that = this;
  817. if (this.form.channel == "") {
  818. this.form.channel = -1;
  819. }
  820. if (type === 1) {
  821. // 暂存
  822. if (!this.form.projectName) {
  823. this.$modal.msgError("请输入项目名称");
  824. return false;
  825. }
  826. this.form.listFile = this.fileList;
  827. this.form.bpFile = this.fileListBP;
  828. this.form.otherFile = this.fileListOther;
  829. if (this.form.id != null) {
  830. updatePool(this.form).then((response) => {
  831. this.$modal.msgSuccess("暂存成功");
  832. setTimeout(() => {
  833. that.goBack();
  834. }, 1500);
  835. });
  836. } else {
  837. this.form.projectStage = "1";
  838. this.form.projectState = "1";
  839. this.form.projectGroup = this.form.tProjectChannel.channelGroup;
  840. addPool(this.form).then((response) => {
  841. this.$modal.msgSuccess("暂存成功");
  842. setTimeout(() => {
  843. that.goBack();
  844. }, 1500);
  845. });
  846. }
  847. } else if (type === 2) {
  848. // 提交
  849. this.$refs["form"].validate((valid, rules) => {
  850. if (valid) {
  851. this.form.listFile = this.fileList;
  852. this.form.bpFile = this.fileListBP;
  853. this.form.otherFile = this.fileListOther;
  854. this.form.tProjectCompany.registeredCapital =
  855. this.form.tProjectCompany.registeredCapital
  856. .replace(/[^0-9.]/g, "")
  857. .replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")
  858. .replace(/-/g, "");
  859. this.form.tProjectCompany.paidCapital =
  860. this.form.tProjectCompany.paidCapital
  861. .replace(/[^0-9.]/g, "")
  862. .replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")
  863. .replace(/-/g, "");
  864. this.form.investValuation = this.form.investValuation
  865. .replace(/[^0-9.]/g, "")
  866. .replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")
  867. .replace(/-/g, "");
  868. this.form.financingMoney = this.form.financingMoney
  869. .replace(/\D/g, "")
  870. .replace(/-/g, "");
  871. this.form.investMoney = this.form.investMoney
  872. .replace(/\D/g, "")
  873. .replace(/-/g, "");
  874. if (this.form.id != null) {
  875. if (this.form.projectState == "1") {
  876. this.form.projectState = "a";
  877. }
  878. updatePool(this.form).then((response) => {
  879. this.$modal.msgSuccess("修改成功");
  880. setTimeout(() => {
  881. that.goBack();
  882. }, 1500);
  883. });
  884. } else {
  885. this.form.projectStage = "1";
  886. this.form.projectState = "a";
  887. this.form.projectGroup = this.form.tProjectChannel.channelGroup;
  888. addPool(this.form).then((response) => {
  889. this.$modal.msgSuccess("新增成功");
  890. setTimeout(() => {
  891. that.goBack();
  892. }, 1500);
  893. });
  894. }
  895. } else {
  896. for (var ruleName in rules) {
  897. let _rule = rules[ruleName];
  898. let message = _rule[0].message;
  899. this.$message.warning(message, 1);
  900. break;
  901. }
  902. //验证不通过回滚到不通过的第一个位置
  903. this.$nextTick(() => {
  904. let isError = document.getElementsByClassName("is-error");
  905. isError[0].scrollIntoView({
  906. block: "center",
  907. behavior: "smooth",
  908. });
  909. });
  910. }
  911. });
  912. }
  913. },
  914. goBack() {
  915. this.$router.go(-1);
  916. },
  917. // 表单重置
  918. reset() {
  919. this.form = {
  920. id: null,
  921. projectName: null,
  922. projectGroup: "",
  923. industry: null,
  924. recordDate: null,
  925. projectCode: null,
  926. channel: "",
  927. contactDate: null,
  928. projectDate: null,
  929. decisionDate: null,
  930. tProjectCompany: {
  931. companyName: null,
  932. companyCode: null,
  933. startTime: null,
  934. endTime: null,
  935. registeredCapital: null,
  936. registeredAddress: null,
  937. paidCapital: null,
  938. businessAddress: null,
  939. actualBod: null,
  940. phone: null,
  941. filingTime: null,
  942. type: null,
  943. },
  944. tProjectContacts: {
  945. name: null,
  946. position: null,
  947. contact: null,
  948. },
  949. tProjectChannel: {
  950. channelName: "",
  951. channelGroup: "",
  952. },
  953. description: null,
  954. projectContacts: null,
  955. investHead: this.user.nickName,
  956. previousFinancing: null,
  957. financingStage: null,
  958. financingCondition: null,
  959. financingMoney: null,
  960. financingDate: null,
  961. investSparkle: null,
  962. investValuation: null,
  963. investMoney: null,
  964. investType: null,
  965. investPloy: null,
  966. investWorth: null,
  967. shareholding: null,
  968. projectStage: null,
  969. projectState: null,
  970. mark: null,
  971. delFlag: null,
  972. createBy: null,
  973. createTime: null,
  974. updateBy: null,
  975. updateTime: null,
  976. listFile: null,
  977. bpFile: null,
  978. otherFile: null,
  979. };
  980. this.resetForm("form");
  981. },
  982. },
  983. };
  984. </script>
  985. <style lang="scss" scoped>
  986. .poolAdd {
  987. h2 {
  988. margin-left: 30px;
  989. }
  990. .special-el-form {
  991. h3 {
  992. width: 100%;
  993. margin-bottom: -10px;
  994. font-weight: bold;
  995. }
  996. .btnList {
  997. width: 100%;
  998. display: flex;
  999. justify-content: center;
  1000. padding-bottom: 40px;
  1001. }
  1002. }
  1003. }
  1004. .poolDetail {
  1005. position: relative;
  1006. // cursor: not-allowed;
  1007. }
  1008. .poolDetail ::placeholder {
  1009. color: #f5f7fa !important;
  1010. }
  1011. // .poolDetail::after {
  1012. // content: "";
  1013. // display: block;
  1014. // position: absolute;
  1015. // top: 0;
  1016. // left: 0;
  1017. // width: 100%;
  1018. // height: 120%;
  1019. // }
  1020. </style>