dueDiligenceList.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <template>
  2. <div class="app-container">
  3. <div v-show="type == 1">
  4. <el-table border :data="dueList">
  5. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  6. <el-table-column
  7. label="尽调名称"
  8. align="center"
  9. prop="investigateName"
  10. />
  11. <el-table-column
  12. label="尽调人员"
  13. align="center"
  14. prop="investigatePerson"
  15. />
  16. <el-table-column
  17. label="尽调费用(元)"
  18. align="center"
  19. prop="investigateCost"
  20. />
  21. <el-table-column label="描述" align="center" prop="describe" />
  22. <el-table-column label="备注" align="center" prop="remark" />
  23. <el-table-column label="创建时间" align="center" prop="createTime" />
  24. <el-table-column
  25. label="操作"
  26. align="center"
  27. class-name="small-padding fixed-width"
  28. width="220"
  29. >
  30. <template slot-scope="scope">
  31. <el-button
  32. class="custom-blue-color"
  33. size="mini"
  34. type="text"
  35. icon="el-icon-search"
  36. @click="handleLook(scope.row)"
  37. >查看尽调报告</el-button
  38. >
  39. <el-button
  40. v-show="scope.row.investigatePersonId.indexOf(user.userId) > -1"
  41. size="mini"
  42. type="text"
  43. icon="el-icon-upload2"
  44. @click="handleSurvey('3', scope.row, scope.row)"
  45. >上传尽调报告</el-button
  46. >
  47. <el-button
  48. size="mini"
  49. type="text"
  50. icon="el-icon-edit"
  51. @click="handleUpdate(scope.row)"
  52. >修改</el-button
  53. >
  54. <el-button
  55. class="custom-red-color"
  56. size="mini"
  57. type="text"
  58. icon="el-icon-delete"
  59. @click="handleDelete(scope.row)"
  60. >删除</el-button
  61. >
  62. </template>
  63. </el-table-column>
  64. <!-- 添加或修改尽调申请 -->
  65. <el-dialog
  66. :title="dueDiligenceTit"
  67. :visible.sync="dueDiligenceOpen"
  68. width="1000px"
  69. append-to-body
  70. >
  71. <el-form
  72. ref="dueForm"
  73. class="special-el-form"
  74. :model="dueForm"
  75. :rules="dueRules"
  76. label-width="120px"
  77. >
  78. <el-form-item label="尽调名称" prop="investigateName">
  79. <el-input
  80. :disabled="dueDiligenceType === '3'"
  81. v-model="dueForm.investigateName"
  82. placeholder="请输入尽调名称"
  83. />
  84. </el-form-item>
  85. <el-form-item label="项目名称" prop="projectName">
  86. <el-input disabled v-model="dueForm.projectName" />
  87. </el-form-item>
  88. <el-form-item label="尽调人员" prop="investigatePerson">
  89. <div
  90. class="el-input__inner inputSimulation"
  91. @click="handleSelectPeople"
  92. :class="{ show_disabled: dueDiligenceType === '3' }"
  93. >
  94. {{
  95. dueForm.investigatePerson
  96. ? dueForm.investigatePerson
  97. : "请选择尽调人员"
  98. }}
  99. </div>
  100. </el-form-item>
  101. <el-form-item label="尽调费用(元)" prop="investigateCost">
  102. <el-input
  103. :disabled="dueDiligenceType === '3'"
  104. v-model="dueForm.investigateCost"
  105. placeholder="请输入尽调费用"
  106. onkeyup="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3').replace(/-/g, '')"
  107. />
  108. </el-form-item>
  109. <el-form-item label="文件" prop="file" class="special-el-form-item">
  110. <fileItem
  111. :class="{ show_disabled: dueDiligenceType === '3' }"
  112. ref="fileItems"
  113. :id="dueForm.id"
  114. @getFileList="getFileList"
  115. ></fileItem>
  116. </el-form-item>
  117. <el-form-item
  118. label="描述"
  119. prop="describe"
  120. class="special-el-form-item"
  121. >
  122. <el-input
  123. :disabled="dueDiligenceType === '3'"
  124. rows="4"
  125. v-model="dueForm.describe"
  126. type="textarea"
  127. placeholder="请输入内容"
  128. />
  129. </el-form-item>
  130. <el-form-item
  131. label="备注"
  132. prop="remark"
  133. class="special-el-form-item"
  134. >
  135. <el-input
  136. :disabled="dueDiligenceType === '3'"
  137. rows="4"
  138. type="textarea"
  139. v-model="dueForm.remark"
  140. placeholder="请输入备注"
  141. />
  142. </el-form-item>
  143. </el-form>
  144. <div slot="footer" class="dialog-footer">
  145. <el-button type="primary" @click="submitDueForm" v-preventReClick
  146. >确 定</el-button
  147. >
  148. <el-button @click="cancelDueForm">取 消</el-button>
  149. </div>
  150. </el-dialog>
  151. <!-- 添加或修改尽调报告 -->
  152. <el-dialog
  153. :title="dueDiligenceTit1"
  154. :visible.sync="dueDiligenceOpen1"
  155. width="1000px"
  156. append-to-body
  157. >
  158. <h3>尽调申请详情</h3>
  159. <el-divider></el-divider>
  160. <el-form
  161. ref="duePeportForm"
  162. class="special-el-form"
  163. :model="duePeportForm"
  164. :rules="dueRules1"
  165. label-width="100px"
  166. >
  167. <el-form-item label="尽调名称">
  168. <el-input
  169. disabled
  170. v-model="dueForm.investigateName"
  171. placeholder="请输入尽调名称"
  172. />
  173. </el-form-item>
  174. <el-form-item label="项目名称">
  175. <el-input disabled v-model="dueForm.projectName" />
  176. </el-form-item>
  177. <el-form-item label="尽调人员">
  178. <el-input disabled v-model="dueForm.investigatePerson" />
  179. </el-form-item>
  180. <el-form-item label="尽调费用(元)">
  181. <el-input disabled v-model="dueForm.investigateCost" />
  182. </el-form-item>
  183. <el-form-item label="文件" class="special-el-form-item">
  184. <!-- class="show_disabled" -->
  185. <fileItem
  186. ref="fileItems1"
  187. :id="dueForm.id"
  188. @getFileList="getFileList"
  189. ></fileItem>
  190. </el-form-item>
  191. <el-form-item label="描述" class="special-el-form-item">
  192. <el-input
  193. disabled
  194. rows="4"
  195. v-model="dueForm.describe"
  196. type="textarea"
  197. />
  198. </el-form-item>
  199. <el-form-item label="备注" class="special-el-form-item">
  200. <el-input
  201. disabled
  202. rows="4"
  203. type="textarea"
  204. v-model="dueForm.remark"
  205. />
  206. </el-form-item>
  207. <h3>尽调报告</h3>
  208. <el-divider></el-divider>
  209. <el-form-item
  210. label="文件"
  211. prop="listFile"
  212. class="special-el-form-item"
  213. >
  214. <fileItem
  215. ref="reportFileItems"
  216. :id="duePeportForm.id"
  217. @getFileList="getreportFileList"
  218. ></fileItem>
  219. </el-form-item>
  220. <el-form-item
  221. label="备注"
  222. prop="remark"
  223. class="special-el-form-item"
  224. >
  225. <el-input
  226. rows="4"
  227. type="textarea"
  228. v-model="duePeportForm.remark"
  229. placeholder="请输入备注"
  230. />
  231. </el-form-item>
  232. </el-form>
  233. <div slot="footer" class="dialog-footer">
  234. <el-button
  235. type="primary"
  236. @click="submitduePeportForm"
  237. v-preventReClick
  238. >确 定</el-button
  239. >
  240. <el-button @click="cancelduePeportForm">取 消</el-button>
  241. </div>
  242. </el-dialog>
  243. <!-- 查看该申请下的所有尽调报告 -->
  244. <el-dialog
  245. title="尽调报告"
  246. :visible.sync="dueDiligenceOpen2"
  247. width="1000px"
  248. append-to-body
  249. class="examineDialog"
  250. >
  251. <div v-if="dueAllPeportList.length > 0">
  252. <el-form
  253. v-for="(item, index) in dueAllPeportList"
  254. :key="index"
  255. class="special-el-form"
  256. :model="item"
  257. label-width="100px"
  258. >
  259. <el-form-item label="尽调人员" class="special-el-form-item">
  260. <el-input disabled v-model="item.investigatePerson" />
  261. </el-form-item>
  262. <el-form-item label="文件" class="special-el-form-item">
  263. <!-- class="show_disabled" -->
  264. <fileItem
  265. ref="dueAllreportFileItems"
  266. :id="item.id"
  267. @getFileList="getreportFileList"
  268. ></fileItem>
  269. </el-form-item>
  270. <el-form-item label="备注" class="special-el-form-item">
  271. <el-input
  272. disabled
  273. rows="4"
  274. type="textarea"
  275. v-model="item.remark"
  276. placeholder="请输入备注"
  277. />
  278. </el-form-item>
  279. <el-divider></el-divider>
  280. </el-form>
  281. </div>
  282. <div
  283. v-else
  284. class="public-flex-center public-padded-t-20"
  285. style="color: #909399"
  286. >
  287. 暂无数据
  288. </div>
  289. <div slot="footer" class="dialog-footer">
  290. <el-button type="primary" @click="dueDiligenceOpen2 = false"
  291. >确 定</el-button
  292. >
  293. <el-button @click="dueDiligenceOpen2 = false">取 消</el-button>
  294. </div>
  295. </el-dialog>
  296. </el-table>
  297. </div>
  298. <!--选择人员-->
  299. <selecUser
  300. ref="flowUser"
  301. :checkType="checkType"
  302. :selectValues="selectValues"
  303. :selectNameValues="selectNameValues"
  304. @handleUserSelect="handleUserSelect"
  305. ></selecUser>
  306. </div>
  307. </template>
  308. <script>
  309. import {
  310. getInvestigatelist,
  311. getlistProjectPoolId,
  312. delInvestigate,
  313. updateInvestigate,
  314. addInvestigatePerson,
  315. addInvestigate,
  316. getProjectInvestigateId,
  317. dueAllPeportList,
  318. } from "@/api/invest/pool";
  319. import projectItem from "./projectItem";
  320. import fileItem from "./fileItem";
  321. import selecDept from "./selecDept";
  322. import selecUser from "./selecUser";
  323. export default {
  324. props: {
  325. projectId: {
  326. type: String,
  327. },
  328. projectName: {
  329. type: String,
  330. default: null,
  331. required: false,
  332. },
  333. type: {
  334. type: Number, //1显示表格 2不显示
  335. },
  336. },
  337. dicts: ["up_way", "project_stage"],
  338. components: { projectItem, fileItem, selecDept, selecUser },
  339. data() {
  340. const validateLogo = (rule, value, callback) => {
  341. if (this.reportFileList.length <= 0) {
  342. callback(new Error("请上传文件"));
  343. } else {
  344. callback();
  345. }
  346. };
  347. return {
  348. // 人员选择器
  349. checkType: "multiple",
  350. // 数据回显
  351. selectValues: null,
  352. selectNameValues: null,
  353. userVisible: false,
  354. dueList: [],
  355. total: null,
  356. user: {
  357. userId: null,
  358. nickName: null,
  359. },
  360. dueDiligenceTit: "",
  361. dueDiligenceOpen: false,
  362. dueDiligenceTit1: "",
  363. dueDiligenceOpen1: false,
  364. dueDiligenceOpen2: false,
  365. duePeportForm: {
  366. createBy: null,
  367. createTime: null,
  368. deptId: null,
  369. deptName: null,
  370. id: null,
  371. investigatePerson: null,
  372. investigatePersonId: null,
  373. listFile: null,
  374. projectInvestigateId: null,
  375. remark: null,
  376. updateBy: null,
  377. updateTime: null,
  378. },
  379. dueForm: {
  380. id: null,
  381. investigateName: null,
  382. investigateCode: null,
  383. projectPoolId: null,
  384. investigatePerson: null,
  385. investigatePersonId: null,
  386. investigateCost: null,
  387. describe: null,
  388. remark: null,
  389. delFlag: null,
  390. createBy: null,
  391. createTime: null,
  392. updateBy: null,
  393. updateTime: null,
  394. projectPoolId: null,
  395. projectName: null,
  396. },
  397. dueAllPeportList: [],
  398. dueRules1: {
  399. listFile: [{ required: true, validator: validateLogo }],
  400. remark: [{ required: true, trigger: "blur", message: "请输入" }],
  401. },
  402. dueRules: {
  403. investigateName: [
  404. { required: true, trigger: "blur", message: "请输入" },
  405. ],
  406. projectName: [{ required: true, trigger: "blur", message: "请输入" }],
  407. investigatePerson: [
  408. { required: true, trigger: "blur", message: "请选择" },
  409. ],
  410. investigateCost: [
  411. { required: true, trigger: "blur", message: "请输入" },
  412. ],
  413. describe: [{ required: true, trigger: "blur", message: "请输入" }],
  414. },
  415. fileList: [],
  416. reportFileList: [],
  417. dueDiligenceType: "0",
  418. };
  419. },
  420. watch: {
  421. dueDiligenceOpen: function (newValue, oldValue) {
  422. if (newValue === false) {
  423. this.selectValues = null;
  424. this.selectNameValues = null;
  425. }
  426. },
  427. },
  428. mounted() {
  429. this.user = this.$store.getters.user;
  430. this.user.userId = this.user.userId.toString();
  431. this.getList();
  432. },
  433. methods: {
  434. // getProjectName(projectName) {
  435. // this.projectName = projectName;
  436. // },
  437. /** 查询文件资料列表 */
  438. getList() {
  439. // this.loading = true;
  440. getInvestigatelist(this.projectId).then((response) => {
  441. this.dueList = response.rows;
  442. this.total = response.total;
  443. // this.loading = false;
  444. });
  445. },
  446. handleSelectPeople() {
  447. this.$refs.flowUser.handleUserVisible(true);
  448. },
  449. // 查看尽调报告
  450. handleLook(row) {
  451. let that = this;
  452. dueAllPeportList(row.id).then((response) => {
  453. let rows = response.rows;
  454. this.dueAllPeportList = rows;
  455. this.dueDiligenceOpen2 = true;
  456. if (rows && rows.length > 0) {
  457. for (let i in rows) {
  458. setTimeout(() => {
  459. this.$refs.dueAllreportFileItems[i].handleButton();
  460. this.$refs.dueAllreportFileItems[i].getListFileBusinessId(
  461. rows[i].id
  462. );
  463. }, 300);
  464. }
  465. }
  466. });
  467. },
  468. // 修改尽调申请
  469. handleUpdate(row) {
  470. let that = this;
  471. this.resetDueForm();
  472. const id = row.projectPoolId || row.id;
  473. getlistProjectPoolId(id).then((response) => {
  474. if (response.tProjectInvestigate) {
  475. this.dueForm = response.tProjectInvestigate;
  476. this.dueForm.projectName = this.projectName;
  477. this.selectValues = response.tProjectInvestigate.investigatePersonId;
  478. this.selectNameValues =
  479. response.tProjectInvestigate.investigatePerson;
  480. this.dueDiligenceTit = "修改尽调申请";
  481. this.dueDiligenceOpen = true;
  482. setTimeout(() => {
  483. that.$refs.fileItems.fileList = [];
  484. that.$refs.fileItems.getListFileBusinessId(this.dueForm.id);
  485. }, 300);
  486. }
  487. });
  488. },
  489. /*用户选中赋值*/
  490. checkUserComplete() {
  491. this.userVisible = false;
  492. // this.checkType = "";
  493. },
  494. // 获取fileList
  495. getFileList(fileList) {
  496. this.fileList = fileList;
  497. },
  498. getreportFileList(fileList) {
  499. this.reportFileList = fileList;
  500. },
  501. // 用户选中数据
  502. handleUserSelect(selection) {
  503. const that = this;
  504. if (selection) {
  505. if (selection instanceof Array) {
  506. const userIds = selection.map((item) => item.userId);
  507. const nickName = selection.map((item) => item.nickName);
  508. this.dueForm.investigatePerson = nickName.join(",");
  509. this.dueForm.investigatePersonId = userIds.join(",");
  510. this.selectNameValues = nickName.join(",");
  511. this.selectValues = userIds.join(",");
  512. } else {
  513. this.dueForm.investigatePerson = selection.nickName;
  514. this.dueForm.investigatePersonId = selection.userId;
  515. this.selectNameValues = selection.nickName;
  516. this.selectValues = selection.userId;
  517. }
  518. this.$refs.dueForm.clearValidate(["investigatePerson"]);
  519. }
  520. },
  521. // 发起尽调申请
  522. handleSurvey(type, row, transmitForm) {
  523. // console.log(type, row, transmitForm);
  524. let that = this;
  525. this.dueDiligenceType = type;
  526. //type 1=发起 2=修改 3=上传
  527. if (type === "1") {
  528. this.resetDueForm();
  529. setTimeout(() => {
  530. that.$refs.fileItems.fileList = [];
  531. }, 300);
  532. this.dueDiligenceTit = "发起尽调申请";
  533. this.dueDiligenceOpen = true;
  534. } else if (type === "2") {
  535. this.handleUpdate(row);
  536. } else if (type === "3") {
  537. this.dueForm = transmitForm;
  538. this.dueForm.projectName = this.projectName;
  539. this.duePeportForm.projectInvestigateId = this.dueForm.id;
  540. setTimeout(() => {
  541. that.$refs.fileItems1.handleButton();
  542. that.$refs.fileItems1.getListFileBusinessId(this.dueForm.id);
  543. }, 300);
  544. this.dueDiligenceTit1 = "上传尽调报告";
  545. getProjectInvestigateId(this.dueForm.id).then((response) => {
  546. if (response.data) {
  547. this.duePeportForm = response.data;
  548. setTimeout(() => {
  549. that.$refs.reportFileItems.fileList = [];
  550. that.$refs.reportFileItems.getListFileBusinessId(
  551. this.duePeportForm.id
  552. );
  553. }, 300);
  554. }
  555. this.dueDiligenceOpen1 = true;
  556. });
  557. }
  558. this.dueForm.projectName = row.projectName;
  559. // this.dueForm.projectPoolId = row.id;
  560. this.dueForm.projectPoolId = this.projectId;
  561. },
  562. // 尽调报告
  563. submitduePeportForm() {
  564. this.$refs["duePeportForm"].validate((valid) => {
  565. if (valid) {
  566. this.duePeportForm.projectPoolId = this.dueForm.projectPoolId;
  567. this.duePeportForm.listFile = this.reportFileList;
  568. addInvestigatePerson(this.duePeportForm).then((response) => {
  569. this.$modal.msgSuccess("操作成功");
  570. this.dueDiligenceOpen1 = false;
  571. });
  572. }
  573. });
  574. },
  575. cancelduePeportForm() {
  576. this.dueDiligenceOpen1 = false;
  577. this.resetduePeportForm();
  578. },
  579. resetduePeportForm() {
  580. this.duePeportForm = {
  581. createBy: null,
  582. createTime: null,
  583. deptId: null,
  584. deptName: null,
  585. id: null,
  586. investigatePerson: null,
  587. investigatePersonId: null,
  588. listFile: null,
  589. remark: null,
  590. updateBy: null,
  591. updateTime: null,
  592. projectInvestigateId: this.dueForm.id,
  593. };
  594. },
  595. // 尽调申请
  596. submitDueForm() {
  597. this.$refs["dueForm"].validate((valid) => {
  598. if (valid) {
  599. this.dueForm.listFile = this.fileList;
  600. this.dueForm.investigateCost = this.dueForm.investigateCost.replace(
  601. /-/g,
  602. ""
  603. );
  604. if (this.dueForm.id != null) {
  605. updateInvestigate(this.dueForm).then((response) => {
  606. this.$modal.msgSuccess("修改成功");
  607. this.dueDiligenceOpen = false;
  608. this.getList();
  609. });
  610. } else {
  611. addInvestigate(this.dueForm).then((response) => {
  612. this.$modal.msgSuccess("新增成功");
  613. this.dueDiligenceOpen = false;
  614. this.getList();
  615. });
  616. }
  617. this.getList();
  618. }
  619. });
  620. },
  621. cancelDueForm() {
  622. this.dueDiligenceOpen = false;
  623. this.resetDueForm();
  624. },
  625. // 表单重置
  626. resetDueForm() {
  627. this.dueForm = {
  628. id: null,
  629. investigateName: null,
  630. investigateCode: null,
  631. projectPoolId: null,
  632. investigatePerson: null,
  633. investigatePersonId: null,
  634. investigateCost: null,
  635. describe: null,
  636. remark: null,
  637. delFlag: null,
  638. createBy: null,
  639. createTime: null,
  640. updateBy: null,
  641. updateTime: null,
  642. projectPoolId: null,
  643. projectName: null,
  644. };
  645. this.resetForm("dueForm");
  646. },
  647. /** 删除按钮操作 */
  648. handleDelete(row) {
  649. const ids = row.id || this.ids;
  650. const investigateName = row.investigateName
  651. ? row.investigateName
  652. : "此项";
  653. this.$modal
  654. .confirm('是否确认删除"' + investigateName + '"?')
  655. .then(function () {
  656. return delInvestigate(ids);
  657. })
  658. .then(() => {
  659. this.getList();
  660. this.$modal.msgSuccess("删除成功");
  661. })
  662. .catch(() => {});
  663. },
  664. },
  665. };
  666. </script>
  667. <style lang="scss">
  668. .examineDialog {
  669. .el-input.is-disabled .el-input__inner,
  670. .el-textarea.is-disabled .el-textarea__inner {
  671. background-color: #fff;
  672. color: #333;
  673. }
  674. }
  675. </style>