poolForm.vue 32 KB

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