projectApplicationApplyMain.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <!-- 项目立项申请表单区域 -->
  3. <div class="projectApplicationApplyPAapply core_dialogue">
  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" size="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. }
  243. },err=>{
  244. console.log(err);
  245. })
  246. },
  247. },
  248. created(){ //实例初始化完成后调用
  249. this.getProjectDepartmentData() //获取项目立项申请基础信息页面所在部门数据
  250. this.getProjectTypeData() //获取项目立项申请基础信息页面分类数据
  251. // this.submitData()
  252. }
  253. }
  254. </script>
  255. <style lang="less">
  256. .projectApplicationApplyPAapply{
  257. width: 100vw;
  258. background: #e6eaf0;
  259. display: flex;
  260. flex-direction: column;
  261. align-items: center;
  262. .pAHeader3{ //返回键
  263. position: absolute;
  264. right: 0px;
  265. top: 5px;
  266. cursor: pointer;
  267. }
  268. // 顶部导航区
  269. .vector{ //矢量图大小
  270. height: 50%;
  271. margin-top: 5px;
  272. }
  273. .Main_area{ //宽度
  274. width: 95%;
  275. min-height: 80%;
  276. margin-bottom: 20px;
  277. }
  278. // 顶部导航区
  279. // 顶部导航区开始
  280. .PAheader{
  281. width: 90%;
  282. height: 70px;
  283. position: relative;
  284. top: 15px;
  285. border-radius: 5px;
  286. background: #ffffff;
  287. display: flex;
  288. justify-content: center;
  289. align-items: center;
  290. .PAheaderBlock{
  291. background: #4a83d0;
  292. width: 16%;
  293. height: 80%;
  294. border-radius: 10px;
  295. display: flex;
  296. justify-content: center;
  297. align-items: center;
  298. color: #fff;
  299. font-size: 18px;
  300. cursor: pointer;
  301. }
  302. .PAheaderBlock:nth-of-type(2){
  303. margin: 10%;
  304. }
  305. }
  306. // 顶部导航区结束
  307. //提交对话框开始
  308. .projectApplicationfundAddDialog{
  309. .el-dialog__header{
  310. display: flex;
  311. justify-content: center;
  312. }
  313. .el-dialog{
  314. border-radius: 5px;
  315. overflow: hidden;
  316. top: 10%;
  317. }
  318. .deleteContent{
  319. width: 100%;
  320. text-align: center;
  321. font-size: 22px;
  322. color: #000;
  323. }
  324. .addDialogLogo{
  325. width: 60px;
  326. height: 30px;
  327. border-radius: 5px;
  328. display: flex;
  329. justify-content: center;
  330. line-height: 30px;
  331. background: #f2f2f2;
  332. position: absolute;
  333. left: 20px; top: 15px;
  334. }
  335. .el-dialog__header{
  336. background: #32455b;
  337. }
  338. .el-dialog__title{
  339. color:#fff;
  340. display: flex;
  341. justify-content: center;
  342. font-size: 18px;
  343. position: relative;
  344. top: -2px;
  345. }
  346. .addDialogMid{
  347. box-sizing: border-box;
  348. padding:0 60px 0 10px;
  349. .addDialogTit{
  350. display: flex;
  351. span{
  352. width: 80px;
  353. line-height: 40px;
  354. text-align: left;
  355. }
  356. }
  357. .addDialogTit1{
  358. display: flex;
  359. justify-content: space-between;
  360. margin-bottom: 15px;
  361. }
  362. .addDialogTit2{
  363. margin-top: 10px;
  364. font-size: 18px;
  365. color: #000;
  366. text-indent: 2em;
  367. }
  368. .addDialogCon{
  369. margin-top: 20px;
  370. }
  371. }
  372. .dialog-footer{
  373. display: flex;
  374. justify-content: center;
  375. // .btn5{
  376. // height: 40px;
  377. // font-size: 16px;
  378. // background: #0e72e6;
  379. // width: 200px;
  380. // }
  381. }
  382. }
  383. //提交对话框结束
  384. .right{
  385. width: 83%;
  386. background: #fff;
  387. box-sizing: border-box;
  388. padding: 15px 20px;
  389. min-height: 740px;
  390. margin-bottom: 60px;
  391. border-radius: 5px;
  392. }
  393. // 左边栏开始
  394. .left{
  395. width: 10%;
  396. min-width: 110px;
  397. height: 740px;
  398. background: #32455b;
  399. display: flex;
  400. justify-content: center;
  401. margin-right: 2%;
  402. box-sizing: border-box;
  403. padding: 0 10px;
  404. border-radius: 5px;
  405. .leftTits{
  406. display: flex;
  407. flex-direction: column;
  408. margin: 50px 0 0 10px;
  409. div{
  410. width: 97px;
  411. color: #fff;
  412. cursor: pointer;
  413. margin-bottom: 30px;
  414. p{
  415. white-space: nowrap;
  416. overflow: hidden;
  417. text-overflow:ellipsis;
  418. }
  419. }
  420. }
  421. div:hover{
  422. color: #ccc;
  423. }
  424. .sx{
  425. margin-top: 53.5px;
  426. margin-left: 8px;
  427. width: 1px;
  428. height: 400px;
  429. background: #84888d;
  430. .qiu{
  431. width: 10px;
  432. height: 10px;
  433. background: #fff;
  434. border-radius: 50px;
  435. margin-left: -4.5px;
  436. }
  437. }
  438. }
  439. // 左边栏结束
  440. }
  441. </style>