projectApplicationApplyMain.vue 18 KB

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