projectApplicationApplyMain.vue 15 KB

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