projectApplicationApplyMain.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. <template>
  2. <!-- 项目立项申请表单区域 -->
  3. <div class="projectApplicationApplyPAapply">
  4. <!-- 上方导航区开始 -->
  5. <div class="PAheader">
  6. <div class="PAheaderBlock" :style="{opacity: status!=0?0.8:1}" @click="status=0">
  7. <img src="@/assets/vector/first.png" class="vector" alt="">
  8. 立项基础信息
  9. </div>
  10. <div class="PAheaderBlock" :style="{opacity: status!=1?0.8:1}" @click="status=1">
  11. <img src="@/assets/vector/second.png" class="vector" alt="">
  12. 项目内容
  13. </div>
  14. <div class="PAheaderBlock" :style="{opacity: status!=2?0.8:1}" @click="status=2">
  15. <img src="@/assets/vector/fouth.png" class="vector" alt="">
  16. 预算经费
  17. </div>
  18. </div>
  19. <!-- 上方导航区结束-->
  20. <!--下方内容区开始-->
  21. <div class="Main_area">
  22. <!-- 学生创客项目 5e21b204-c206-11ed-a4cd-509a4c5b67cf -->
  23. <!-- 特色创客空间建设项目 5f7a66d5-c206-11ed-a4cd-509a4c5b67cf -->
  24. <projectApplicationApply :data="projectApplicationApply1" :next="next" :back="back" v-if="status==0 && pageType[0]=='5e21b204-c206-11ed-a4cd-509a4c5b67cf'"/>
  25. <projectApplicationApplyMakerSpace :data="MakerSpace" :next="next" :back="back" v-if="status==0 && pageType[0]=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf'"/>
  26. <projectApplicationApply2 :data="projectApplicationApply2" :next="next" :back="back" v-if="status==1"/>
  27. <projectApplicationApply3 :data="projectApplicationApply3" :confirmSetFund="confirmSetFund" :data2="projectApplicationApply1" :next="next" :back="back" :submitBtn="submitBtn" v-show="status==2"/>
  28. </div>
  29. <!--下方内容区结束-->
  30. <!-- 提交对话框开始 -->
  31. <el-dialog
  32. title="提示"
  33. :visible.sync="submitHint"
  34. width="600px"
  35. class="pageSubmitData"
  36. :before-close="init">
  37. <div class="addDialogLogo">LOGO</div>
  38. <div class="deleteContent">确定提交“{{projectApplicationApply1.select.projectName}}”项目立项?</div>
  39. <span slot="footer" class="dialog-footer">
  40. <el-button type="primary" @click="submitAll" class="AllDialogBtn">确认提交</el-button>
  41. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  42. </span>
  43. </el-dialog>
  44. <!-- 提交对话框结束 -->
  45. <!-- 选择分类开始 -->
  46. <el-dialog
  47. title="提示"
  48. :visible.sync="selectType"
  49. width="600px"
  50. class="pageSubmitData"
  51. :close-on-click-modal='false'
  52. :close-on-press-escape="false"
  53. >
  54. <!-- <div class="addDialogLogo">LOGO</div> -->
  55. <div class="" style="display: flex;align-items: center;justify-content: center;margin-top: 10px;">
  56. <div style="margin-right: 10px;">选择分类</div>
  57. <el-cascader v-model="pageType" :options="projectApplicationApply1.sortOptions" clearable></el-cascader>
  58. </div>
  59. <span slot="footer" class="dialog-footer">
  60. <el-button type="primary" @click="selectTypeButton" class="AllDialogBtn">确定</el-button>
  61. <el-button @click="$router.back()" class="AllDialogBtn">取消</el-button>
  62. </span>
  63. </el-dialog>
  64. <!-- 选择分类结束 -->
  65. </div>
  66. </template>
  67. <script>
  68. // 引入项目详情三个页面
  69. // import { uuid } from 'vue-uuid';
  70. import projectApplicationApply from './projectApplicationApply.vue';
  71. import projectApplicationApply2 from './projectApplicationApply2.vue';
  72. import projectApplicationApply3 from './projectApplicationApply3.vue';
  73. //创客空间建设项目立项申报
  74. import projectApplicationApplyMakerSpace from './projectApplicationApplyMakerSpace.vue';
  75. export default {
  76. // 进行注册使用
  77. components:{
  78. projectApplicationApply,
  79. projectApplicationApply2,
  80. projectApplicationApply3,
  81. projectApplicationApplyMakerSpace,
  82. },
  83. data() {
  84. return {
  85. selectType:true, //选择分类对话框
  86. pageType:['5f7a66d5-c206-11ed-a4cd-509a4c5b67cf',0], //判断页面显示分类 学生创客项目 学院特色创客空间
  87. status:0, //判断顶部导航跳转
  88. submitHint:false, //提交按钮
  89. //创客空间建设项目立项申报数据
  90. MakerSpace:{
  91. amendMemberDialog:false, //修改人员对话框显示判断
  92. dialogImageUrl:"", //封面
  93. select:{ //基本信息数据框
  94. projectName:'', //项目名称
  95. person:'', //项目负责人
  96. Data:[], //项目时间
  97. value:"", //部门
  98. fund:'', //预算总经费
  99. leader:"",//学院牵头领导
  100. // tel:'', //联系人电话
  101. // value1:"",
  102. },
  103. options: [], //部门下拉框
  104. textarea:'', //项目简介
  105. teacherData:[],//教师组
  106. studentData:[],//学生组
  107. },
  108. //创客空间建设项目立项申报项目内容数据
  109. MakerSpace2:{
  110. contentOne:'',
  111. contentTwo:'',
  112. contentThree:'',
  113. contentFour:'',
  114. contentFive:'',
  115. },
  116. projectApplicationApply1:{ //立项基础信息页面
  117. amendMemberDialog:false, //修改人员对话框显示判断
  118. dialogImageUrl:"", //封面
  119. telVerify:true,
  120. telVerify2:true, //添加修改成员电话判断
  121. select:{ //基本信息数据框
  122. projectName:'',
  123. person:'',
  124. Data:"",
  125. value:"", //部门
  126. fund:'',
  127. tel:'',
  128. value1:"",
  129. sort:[] //["dawjiawdjaw",0]
  130. },
  131. options: [], //部门下拉框
  132. // sortOptions: [], //分类下拉框
  133. sortOptions: [
  134. {
  135. value:"",
  136. label: '',
  137. children: [{
  138. value: 0,
  139. label: '创意组',
  140. },
  141. {
  142. value: 1,
  143. label: '初创组',
  144. }
  145. ]},
  146. {
  147. value:"",
  148. label: '',
  149. children: [{
  150. value: 0,
  151. label: '已建设',
  152. }, {
  153. value: 1,
  154. label: '待建设',
  155. }]
  156. }],
  157. textarea:'', //项目简介
  158. Member:{ //添加成员
  159. name:'',
  160. class:'',
  161. phone:'',
  162. score:'0'
  163. },
  164. tableData:[ //成员列表
  165. ],
  166. },
  167. projectApplicationApply2:{ //项目内容页面
  168. contentOne:'',
  169. contentTwo:'',
  170. contentThree:'',
  171. contentFour:'',
  172. contentFive:'',
  173. },
  174. projectApplicationApply3:{ //预算经费页面
  175. tableData: // 经费月支出计划列表数据默认显示数据
  176. [
  177. {
  178. one:'-',
  179. two:'-',
  180. three:'-',
  181. four:'-',
  182. five:'-',
  183. six:'-',
  184. seven:'-',
  185. eight:'-',
  186. nine:'-',
  187. ten:'-',
  188. eleven:'-',
  189. twelve:'-',
  190. remark:'-'
  191. }
  192. ],
  193. items:{ //经费月支出计划dialog对话框要提交的数据
  194. one:'',
  195. two:'',
  196. three:'',
  197. four:'',
  198. five:'',
  199. six:'',
  200. seven:'',
  201. eight:'',
  202. nine:'',
  203. ten:'',
  204. eleven:'',
  205. twelve:'',
  206. remark:''
  207. },
  208. items2:{}, //复制items,可以确定后清除数据
  209. tableData2:[],// 经费明细列表数据
  210. dialog:{ //经费明细添加对话框
  211. // id:'',
  212. fund:'', //金额
  213. type:'', //支出类别
  214. disburseProject:'', //支出项目
  215. textarea:'', //备注
  216. isOk:''
  217. },
  218. }
  219. }
  220. },
  221. methods:{
  222. selectTypeButton(){
  223. // this.$message.error('请选择分类')
  224. console.log(this.pageType[0]==false);
  225. if (!this.pageType[0]) return this.$message.error('请选择分类')
  226. this.selectType=false
  227. },
  228. next(){ //顶部导航栏页面下一条跳转
  229. if(this.status>=2)return;
  230. this.status++;
  231. },
  232. back(){ //顶部导航栏页面上一条
  233. if(this.status==0)return;
  234. this.status--;
  235. },
  236. getProjectDepartmentData(){ //获取项目立项申请基础信息页面所在部门数据
  237. let param={
  238. uid:this.$store.state.userInfo.userid
  239. }
  240. this.ajax
  241. .get(this.$store.state.api+'/SelectAllDepartment',param)
  242. .then(res=>{
  243. // console.log(res.data[0]);
  244. let p=res.data[0]
  245. let a=this.projectApplicationApply1
  246. a.options=p
  247. this.MakerSpace.options = p;
  248. },err=>{
  249. console.log(err);
  250. })
  251. },
  252. getProjectTypeData(){ //获取项目立项申请基础信息页面分类数据
  253. let param={
  254. uid:this.$store.state.userInfo.userid
  255. }
  256. this.ajax
  257. .get(this.$store.state.api+'/SelectAllType',param)
  258. .then(res=>{
  259. console.log(res.data[0]);
  260. let p=res.data[0]
  261. let a=this.projectApplicationApply1
  262. a.sortOptions[0].value=p[0].id
  263. a.sortOptions[0].label=p[0].name
  264. a.sortOptions[1].value=p[1].id
  265. a.sortOptions[1].label=p[1].name
  266. },err=>{
  267. console.log(err);
  268. })
  269. },
  270. //立项基础信息页面删除功能在它自己页面人员信息
  271. init(){
  272. //重置
  273. this.submitHint=false;
  274. // this.selectType=false
  275. },
  276. confirmSetFund(){ //预算经费经费月支出计划对话框提交
  277. let data=this.projectApplicationApply3;
  278. for(let key in data.items){
  279. if (data.items[key]=='') {
  280. data.items[key]='-'
  281. }
  282. }
  283. Object.assign(data.tableData[0],data.items)
  284. this.$message.success('设置经费成功')
  285. },
  286. submitBtn(){ //预算经费页面提交显示对话框
  287. this.submitHint = true;
  288. },
  289. submitAll(){
  290. this.submitData()
  291. },
  292. submitData(){ //提交页面所有数据
  293. let a=this.projectApplicationApply1;
  294. let b=this.projectApplicationApply2;
  295. let c=this.projectApplicationApply3
  296. if(a.select.projectName=='') return this.$message.error('请输入项目名称')
  297. if(a.select.person=='') return this.$message.error('请输入项目负责人')
  298. if(a.select.value1=='') return this.$message.error('请选择项目开始时间')
  299. if(a.select.value=='') return this.$message.error('请选择所在部门')
  300. if(a.select.fund=='') return this.$message.error('请输入预算总经费')
  301. if(a.select.tel=='') return this.$message.error('请输入联系电话')
  302. if(!a.telVerify) return this.$message.error('请输入正确联系电话格式')
  303. if(a.select.sort=='') return this.$message.error('请选择分类')
  304. let d=[] //按照后端格式传递数据,项目内容,要将经费支出,与项目明细放在一起,
  305. for(let key in b){
  306. d.push(b[key])
  307. }
  308. let newData1 = c.tableData[0]; //没有输入的月支出计划改为0,向后端传递
  309. for(let key in newData1){
  310. if (newData1[key]=='-') {
  311. newData1[key]=0
  312. }
  313. }
  314. console.log(a.select.sort);
  315. let typeId=a.select.sort[0]
  316. let typeName=a.select.sort[1]
  317. // return console.log(typeId,typeName);
  318. let param={
  319. uid:this.$store.state.userInfo.userid,
  320. title:a.select.projectName,
  321. brief:a.textarea,
  322. leader:a.select.person,
  323. phone:a.select.tel,
  324. cid:a.select.value,
  325. student:JSON.stringify(a.tableData),
  326. message:JSON.stringify([d,[newData1,c.tableData2]]),
  327. tid:typeId,
  328. tidName:typeName,
  329. mon:a.select.fund,
  330. imgsrc:a.dialogImageUrl,
  331. beginTime:a.select.value1
  332. }
  333. this.ajax
  334. .post(this.$store.state.api+'/CreateProject',param)
  335. .then(res=>{
  336. console.log(res)
  337. if(res.data==1){
  338. this.$message.success("创建成功")
  339. this.$router.push('projectApplication')
  340. }else{
  341. this.$message.error("创建失败")
  342. }
  343. },err=>{
  344. console.log(err);
  345. })
  346. },
  347. // 提示选择分类
  348. },
  349. created(){ //实例初始化完成后调用
  350. this.getProjectDepartmentData() //获取项目立项申请基础信息页面所在部门数据
  351. this.getProjectTypeData() //获取项目立项申请基础信息页面分类数据
  352. // this.submitData()
  353. // if(this.$route.query["id"]){
  354. // //弹窗
  355. // }else{
  356. // // this.$route.push(`/projectApplicationApplyMain?id=`)
  357. // }
  358. }
  359. }
  360. </script>
  361. <style lang="less">
  362. .projectApplicationApplyPAapply{
  363. width: 100%;
  364. background: #e6eaf0;
  365. display: flex;
  366. flex-direction: column;
  367. align-items: center;
  368. // 顶部导航区开始
  369. .PAheader{
  370. width: 71.4%;
  371. height: 70px;
  372. position: relative;
  373. top: 15px;
  374. border-radius: 5px;
  375. background: #ffffff;
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. .PAheaderBlock{
  380. background: #4a83d0;
  381. width: 13%;
  382. height: 70%;
  383. border-radius: 10px;
  384. display: flex;
  385. justify-content: center;
  386. align-items: center;
  387. color: #fff;
  388. font-size: 16px;
  389. cursor: pointer;
  390. }
  391. .PAheaderBlock:nth-of-type(2){
  392. margin: 10%;
  393. }
  394. }
  395. .vector{ //矢量图大小
  396. height: 50%;
  397. margin-top: 5px;
  398. }
  399. .Main_area{ //宽度
  400. width: 75%;
  401. min-height: 80%;
  402. margin-bottom: 20px;
  403. }
  404. // 顶部导航区结束
  405. //提交对话框开始 选择分类
  406. // .projectApplicationfundAddDialog{
  407. // .el-dialog__header{
  408. // display: flex;
  409. // justify-content: center;
  410. // }
  411. // .el-dialog{
  412. // border-radius: 5px;
  413. // overflow: hidden;
  414. // top: 10%;
  415. // }
  416. // .deleteContent{
  417. // width: 100%;
  418. // text-align: center;
  419. // font-size: 22px;
  420. // color: #000;
  421. // }
  422. // .addDialogLogo{
  423. // width: 60px;
  424. // height: 30px;
  425. // border-radius: 5px;
  426. // display: flex;
  427. // justify-content: center;
  428. // line-height: 30px;
  429. // background: #f2f2f2;
  430. // position: absolute;
  431. // left: 20px; top: 15px;
  432. // }
  433. // .el-dialog__header{
  434. // background: #32455b;
  435. // }
  436. // .el-dialog__title{
  437. // color:#fff;
  438. // display: flex;
  439. // justify-content: center;
  440. // font-size: 18px;
  441. // position: relative;
  442. // top: -2px;
  443. // }
  444. // .addDialogMid{
  445. // box-sizing: border-box;
  446. // padding:0 60px 0 10px;
  447. // .addDialogTit{
  448. // display: flex;
  449. // span{
  450. // width: 80px;
  451. // line-height: 40px;
  452. // text-align: left;
  453. // }
  454. // }
  455. // .addDialogTit1{
  456. // display: flex;
  457. // justify-content: space-between;
  458. // margin-bottom: 15px;
  459. // }
  460. // .addDialogTit2{
  461. // margin-top: 10px;
  462. // font-size: 18px;
  463. // color: #000;
  464. // text-indent: 2em;
  465. // }
  466. // .addDialogCon{
  467. // margin-top: 20px;
  468. // }
  469. // }
  470. // .dialog-footer{
  471. // display: flex;
  472. // justify-content: center;
  473. // // .btn5{
  474. // // height: 40px;
  475. // // font-size: 16px;
  476. // // background: #0e72e6;
  477. // // width: 200px;
  478. // // }
  479. // }
  480. // }
  481. //提交对话框结束
  482. .right{
  483. width: 83%;
  484. background: #fff;
  485. box-sizing: border-box;
  486. padding: 15px 30px;
  487. min-height: 740px;
  488. // margin-bottom: 60px;
  489. border-radius: 5px;
  490. }
  491. // 左边栏开始
  492. .left{
  493. width: 10%;
  494. min-width: 110px;
  495. height: 740px;
  496. background: #32455b;
  497. display: flex;
  498. justify-content: center;
  499. margin-right: 2%;
  500. box-sizing: border-box;
  501. padding: 0 10px;
  502. border-radius: 5px;
  503. .leftTits{
  504. display: flex;
  505. flex-direction: column;
  506. margin: 50px 0 0 10px;
  507. div{
  508. width: 97px;
  509. color: #fff;
  510. cursor: pointer;
  511. margin-bottom: 30px;
  512. p{
  513. white-space: nowrap;
  514. overflow: hidden;
  515. text-overflow:ellipsis;
  516. }
  517. }
  518. }
  519. div:hover{
  520. color: #ccc;
  521. }
  522. .sx{
  523. margin-top: 53.5px;
  524. margin-left: 8px;
  525. width: 1px;
  526. height: 400px;
  527. background: #84888d;
  528. .qiu{
  529. width: 10px;
  530. height: 10px;
  531. background: #fff;
  532. border-radius: 50px;
  533. margin-left: -4.5px;
  534. }
  535. }
  536. }
  537. // 左边栏结束
  538. }
  539. </style>