edit.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <div class="detailWrapper">
  3. <section class="section1 public-flex">
  4. <div class="public-margin-r-20">
  5. <h4>
  6. 投资项目
  7. <span class="alreadyStop" v-if="detailInfo.delFlag === '1'"
  8. >已终止</span
  9. >
  10. </h4>
  11. <p class="projectNameTit">{{ detailInfo.projectName }}</p>
  12. </div>
  13. </section>
  14. <el-divider></el-divider>
  15. <section>
  16. <el-divider></el-divider>
  17. <div class="public-flex-between basicsInfo" v-if="detailInfo.projectState != '1'">
  18. <div class="public-flex-center-column">
  19. <div>项目公司名称</div>
  20. <p style="width: 250px; text-align: center" class="yichu1"
  21. v-if="
  22. detailInfo.tProjectCompany &&
  23. detailInfo.tProjectCompany.companyName
  24. ">
  25. {{ detailInfo.tProjectCompany.companyName }}
  26. </p>
  27. </div>
  28. <div class="public-flex-center-column">
  29. <div>渠道</div>
  30. <p
  31. v-if="
  32. detailInfo.tProjectChannel &&
  33. detailInfo.tProjectChannel.channelName
  34. "
  35. >
  36. {{ detailInfo.tProjectChannel.channelName }}
  37. </p>
  38. <p v-else>无</p>
  39. </div>
  40. <div class="public-flex-center-column">
  41. <div>项目负责人</div>
  42. <p>{{ detailInfo.investHead }}</p>
  43. </div>
  44. <div class="public-flex-center-column" v-if="detailInfo.projectDate">
  45. <div>立项通过日期</div>
  46. <p>{{ detailInfo.projectDate }}</p>
  47. </div>
  48. <div class="public-flex-center-column" v-if="detailInfo.decisionDate">
  49. <div>投决通过日期</div>
  50. <p>{{ detailInfo.decisionDate }}</p>
  51. </div>
  52. <div class="public-flex-center-column">
  53. <div>投前估值(万元)</div>
  54. <p>{{ detailInfo.investValuation }}</p>
  55. </div>
  56. <div class="public-flex-center-column">
  57. <div>预计投资金额(万元)</div>
  58. <p>{{ detailInfo.investMoney }}</p>
  59. </div>
  60. </div>
  61. </section>
  62. <section class="section3">
  63. <el-tabs v-model="activeName" @tab-click="handleClick">
  64. <el-tab-pane label="立项信息" name="0"></el-tab-pane>
  65. <el-tab-pane label="项目基本信息" name="1"></el-tab-pane>
  66. </el-tabs>
  67. <section>
  68. <div v-if="activeName === '0'" >
  69. <el-tabs type="border-card">
  70. <el-tab-pane label="项目立项申请表">
  71. <el-form
  72. v-if="formLXApply.id"
  73. class="special-el-form public-padded-t-20"
  74. ref="formLXApply"
  75. :model="formLXApply"
  76. :rules="rulesLXApply"
  77. label-width="120px"
  78. >
  79. <el-form-item
  80. label="项目概况"
  81. prop="projectOverview"
  82. class="special-el-form-item"
  83. >
  84. <el-input
  85. rows="4"
  86. type="textarea"
  87. maxlength="200"
  88. v-model="formLXApply.projectOverview"
  89. />
  90. </el-form-item>
  91. <el-form-item
  92. label="项目亮点"
  93. prop="projectSparkle"
  94. class="special-el-form-item"
  95. >
  96. <el-input
  97. rows="4"
  98. type="textarea"
  99. maxlength="200"
  100. v-model="formLXApply.projectSparkle"
  101. />
  102. </el-form-item>
  103. <el-form-item
  104. label="立项资料"
  105. prop="listFile"
  106. class="special-el-form-item"
  107. >
  108. <fileItem
  109. ref="fileItemLXApply"
  110. :id="formLXApply.id"
  111. @getFileList="getFileListLXApply"
  112. ></fileItem>
  113. </el-form-item>
  114. </el-form>
  115. <div
  116. v-else
  117. class="public-flex-center public-padded-20"
  118. style="color: #909399"
  119. >
  120. 暂无数据
  121. </div>
  122. </el-tab-pane>
  123. </el-tabs>
  124. </div>
  125. <div v-show="activeName === '1'">
  126. <poolForm :type="type" :id="id"></poolForm>
  127. </div>
  128. </section>
  129. </section>
  130. <section class="approveBtn">
  131. <el-form
  132. ref="flowBaseInfo"
  133. :model="flowBaseInfo"
  134. :rules="rulesFlow"
  135. label-width="120px"
  136. >
  137. <el-form-item class="btnList">
  138. <el-button @click="goBack">返 回</el-button>
  139. <el-button type="primary" @click="handleComplete(true)">提交</el-button>
  140. <el-button type="warning" @click="handleComplete(false)">关闭</el-button>
  141. </el-form-item>
  142. </el-form>
  143. </section>
  144. </div>
  145. </template>
  146. <script>
  147. import poolForm from "../../invest/components/poolForm";
  148. import fileItem from "../../invest/components/fileItem";
  149. import {getPool} from "@/api/invest/pool";
  150. import {
  151. listMeeting,
  152. listProjectPoolIdNewApproval
  153. } from "@/api/invest/meeting";
  154. import{
  155. approvalComplete
  156. } from "@/api/project/approval/pool"
  157. import { mapGetters } from "vuex";
  158. export default {
  159. name: "approvalEdit",
  160. components: {
  161. poolForm,
  162. fileItem
  163. },
  164. data() {
  165. const validateLogo = (rule, value, callback) => {
  166. if (this.fileListLXApply.length <= 0) {
  167. callback(new Error("请上传文件"));
  168. } else {
  169. callback();
  170. }
  171. };
  172. return {
  173. showDueApply: false,
  174. meetingId: "0",
  175. type: "2",
  176. id: "",
  177. active: 0,
  178. detailInfo: {
  179. projectName: "",
  180. },
  181. activeName: "0",
  182. formLXApply: {
  183. id: null,
  184. procInstId:null,
  185. projectPoolId: null,
  186. projectName: null,
  187. projectOverview: null,
  188. projectSparkle: null,
  189. listFile: null,
  190. participants: null,
  191. participantsId: null,
  192. },
  193. fileListLXApply: [],
  194. rulesLXApply: {
  195. projectOverview: [
  196. { required: true, trigger: "blur", message: "请输入" },
  197. ],
  198. projectSparkle: [
  199. { required: true, trigger: "blur", message: "请输入" },
  200. ],
  201. listFile: [{ required: true, validator: validateLogo }],
  202. },
  203. flowBaseInfo:{
  204. comment:null,
  205. taskId:null
  206. },
  207. rulesFlow:{
  208. comment: [{ required: true, trigger: "blur", message: "请输入" }],
  209. }
  210. };
  211. },
  212. computed: {
  213. ...mapGetters(["user"]),
  214. },
  215. created() {
  216. this.id = this.$route.query.id;
  217. this.flowBaseInfo.taskId=this.$route.query.taskId;
  218. this.getlistProjectPoolIdNewApproval();
  219. this.getDetail();
  220. if (this.$route.query.activeName) {
  221. this.activeName = this.$route.query.activeName;
  222. }
  223. },
  224. methods: {
  225. getMettingId(type) {
  226. let queryParams = {
  227. pageNum: 1,
  228. pageSize: 10,
  229. meetingType: type,
  230. orderByColumn: "createTime",
  231. isAsc: "desc",
  232. projectPoolId: this.id,
  233. };
  234. listMeeting(queryParams).then((response) => {
  235. let meetingList = response.rows;
  236. if (meetingList.length > 0) {
  237. let meetingId = meetingList[0].id;
  238. if (type === "LX") {
  239. this.$refs.approvalTableForm.initialize(meetingId);
  240. } else if (type === "TJ") {
  241. this.$refs.voteTableForm.initialize(meetingId);
  242. }
  243. } else {
  244. if (type === "LX") {
  245. this.$refs.approvalTableForm.showNodata();
  246. } else if (type === "TJ") {
  247. this.$refs.voteTableForm.showNodata();
  248. }
  249. }
  250. });
  251. },
  252. handleClick(tab, event) {
  253. let that = this;
  254. if (this.activeName === "0") {
  255. // 项目立项
  256. this.getMettingId("LX");
  257. this.getlistProjectPoolIdNewApproval();
  258. } else if (this.activeName === "1") {
  259. // 项目报备
  260. this.getDetail();
  261. }
  262. },
  263. // 获取立项申请
  264. getlistProjectPoolIdNewApproval() {
  265. let that = this;
  266. listProjectPoolIdNewApproval(this.id).then((response) => {
  267. if (response && response.data) {
  268. that.formLXApply = response.data;
  269. setTimeout(() => {
  270. //that.$refs.fileItemLXApply.handleButton();
  271. that.$refs.fileItemLXApply.fileList = [];
  272. that.$refs.fileItemLXApply.getListFileBusinessId(
  273. that.formLXApply.id
  274. );
  275. }, 300);
  276. }
  277. });
  278. },
  279. // 立项申请附件回显
  280. getFileListLXApply(fileList) {
  281. this.fileListLXApply = fileList;
  282. if (fileList && fileList.length > 0) {
  283. this.$refs.formLXApply.clearValidate(["listFile"]);
  284. } else {
  285. this.fileListLXApply = [];
  286. }
  287. },
  288. //项目报备
  289. getDetail() {
  290. getPool(this.id).then((response) => {
  291. this.detailInfo = response.data;
  292. // 项目退出完成n
  293. if (response.data.projectState === "n") {
  294. this.active = parseInt(response.data.projectStage);
  295. } else {
  296. this.active = parseInt(response.data.projectStage) - 1;
  297. }
  298. });
  299. },
  300. /** 加载审批任务弹框 */
  301. handleComplete(flag) {
  302. this.taskComplete(flag);
  303. },
  304. /** 用户审批任务 */
  305. taskComplete(flag) {
  306. this.formLXApply.flag=flag;
  307. this.formLXApply.listFile = this.fileListLXApply;
  308. const params={
  309. projectApproval:this.formLXApply,
  310. flowBaseInfo: this.flowBaseInfo
  311. }
  312. this.$refs["formLXApply"].validate((valid) => {
  313. if(valid) {
  314. try{
  315. approvalComplete(params).then(response => {
  316. this.$modal.msgSuccess(response.msg);
  317. this.$store.dispatch("getMyTaskApprovalNumber"); //更新代办数量
  318. this.goMyTask();
  319. });
  320. } catch (err) {
  321. // 捕获重复提交错误
  322. this.$message.error(err.message);
  323. }
  324. }
  325. })
  326. },
  327. /*返回*/
  328. goBack() {
  329. this.$router.go(-1);
  330. },
  331. //跳转到我的任务-投资机会
  332. goMyTask(){
  333. //this.$router.push({ path: "/myTask/project/approval/myTask"});
  334. // 关闭当前标签页并返回指定页面
  335. const obj = { path: "/myTask/project/approval/myTask", query: { t: Date.now()} };
  336. this.$tab.closeOpenPage(obj);
  337. },
  338. },
  339. };
  340. </script>
  341. <style lang="scss" scoped>
  342. .detailWrapper {
  343. padding: 20px 0;
  344. width: 92%;
  345. margin: 0 auto;
  346. .section1 {
  347. p {
  348. font-size: 24px;
  349. font-weight: bold;
  350. margin: 0;
  351. }
  352. > div:first-child {
  353. // width: calc(100% - 700px);
  354. width: 100%;
  355. }
  356. .btnList {
  357. width: 700px;
  358. display: flex;
  359. justify-content: flex-end;
  360. }
  361. }
  362. .basicsInfo {
  363. font-size: 14px;
  364. background: #f1f1f1;
  365. margin-top: -24px;
  366. width: 100%;
  367. padding: 30px 20px 10px;
  368. div {
  369. color: #7e7d7d;
  370. }
  371. p {
  372. font-size: 16px;
  373. color: #333;
  374. font-weight: bold;
  375. }
  376. }
  377. .section3 {
  378. margin-top: 40px;
  379. }
  380. .approveBtn {
  381. margin-top: 30px;
  382. .btnList {
  383. display: flex;
  384. justify-content: flex-end;
  385. /* 让内部元素(按钮)整体靠右 */
  386. gap: 10px; /* 替代 margin,给按钮之间加间距,可选 */
  387. padding-right: 50px;
  388. }
  389. }
  390. }
  391. .projectNameTit {
  392. }
  393. .alreadyStop {
  394. font-weight: normal;
  395. font-size: 12px;
  396. background: #ff0000;
  397. color: #fff;
  398. border-radius: 5px;
  399. padding: 5px 10px;
  400. margin-left: 10px;
  401. }
  402. </style>