poolEdit.vue 30 KB

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