projectApplicationApplyMain.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  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" :addPerson="addPerson" :amend="amend" :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.select" :next="next" :addFundDetail="addFundDetail" :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. style="top: 120px;"
  34. :before-close="init">
  35. <div class="addDialogLogo">LOGO</div>
  36. <div class="deleteContent">确定提交“×××”项目立项?</div>
  37. <span slot="footer" class="dialog-footer">
  38. <el-button type="primary" @click="init" class="btn5">确认提交</el-button>
  39. <el-button @click="init" class="btn5" style="background:#cccccc" size="small">取消</el-button>
  40. </span>
  41. </el-dialog>
  42. <!-- 提交对话框结束 -->
  43. </div>
  44. </template>
  45. <script>
  46. // 引入项目详情三个页面
  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. DialogStatus:1,
  59. select:{ //基本信息数据框
  60. projectName:'',
  61. person:'',
  62. Data:'',
  63. value:"",
  64. fund:'',
  65. tel:'',
  66. value1:"",
  67. sort:''
  68. },
  69. options: [], //部门下拉框
  70. sortOptions: [], //分类下拉框
  71. textarea:'每周星期四为活动时间', //项目简介
  72. Member:{ //添加成员
  73. name:'',
  74. class:'',
  75. phone:''
  76. },
  77. tableData:[{ //成员列表
  78. name:'徐晓慧',
  79. class:'22电子通信G5',
  80. phone:'13751177411',
  81. },
  82. ],
  83. },
  84. projectApplicationApply2:{ //项目内容页面
  85. contentOne:'11',
  86. contentTwo:'22',
  87. contentThree:'33',
  88. contentFour:'44',
  89. contentFive:'55',
  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. tableData2:[{ // 经费明细列表数据
  111. sort:'人工智能设备购买',
  112. Fund:'20000.00',
  113. projectName:'项目协作费用',
  114. remark:'拨款多多益善'
  115. },
  116. ],
  117. items:{ //经费月支出计划dialog对话框
  118. one:'',
  119. two:'',
  120. three:'',
  121. four:'',
  122. five:'',
  123. six:'',
  124. seven:'',
  125. eight:'',
  126. nine:'',
  127. ten:'',
  128. eleven:'',
  129. twelve:'',
  130. remark:''
  131. },
  132. dialog:{ //经费明细添加对话框
  133. fund:'300000', //金额
  134. type:'填海', //支出类别
  135. disburseProject:'改造世界', //支出项目
  136. textarea:'小同志不利于团结的话可不兴说呀', //备注
  137. },
  138. }
  139. }
  140. },
  141. methods:{
  142. next(){ //顶部导航栏页面下一条跳转
  143. if(this.status>=2)return;
  144. this.status++;
  145. },
  146. back(){ //顶部导航栏页面上一条
  147. if(this.status==0)return;
  148. this.status--;
  149. },
  150. addPerson(){ //立项基础信息页面添加人员和修改数据框
  151. this.projectApplicationApply1.addMemberDialog=false;
  152. let p=this.projectApplicationApply1.Member;
  153. this.projectApplicationApply1.tableData.push(p);
  154. },
  155. getProjectDepartmentData(){ //获取项目立项申请基础信息页面所在部门数据
  156. let param={
  157. uid:this.$store.state.userInfo.userid
  158. }
  159. this.ajax
  160. .get(this.$store.state.api+'/SelectAllDepartment',param)
  161. .then(res=>{
  162. // console.log(res.data[0]);
  163. let p=res.data[0]
  164. let a=this.projectApplicationApply1
  165. a.options=p
  166. },err=>{
  167. console.log(err);
  168. })
  169. },
  170. getProjectTypeData(){ //获取项目立项申请基础信息页面分类数据
  171. let param={
  172. uid:this.$store.state.userInfo.userid
  173. }
  174. this.ajax
  175. .get(this.$store.state.api+'/SelectAllType',param)
  176. .then(res=>{
  177. // console.log(res.data[0]);
  178. let p=res.data[0]
  179. let a=this.projectApplicationApply1
  180. a.sortOptions=p
  181. // console.log(a.sortOptions);
  182. },err=>{
  183. console.log(err);
  184. })
  185. },
  186. amend(val){ //立项基础信息页面修改人员信息
  187. console.log('111');
  188. let p=this.projectApplicationApply1;
  189. let param={
  190. uid:this.$store.state.userInfo.userid,
  191. nid:val,
  192. personName:p.Member.name,
  193. class:p.Member.Class,
  194. phone:p.Member.phone
  195. }
  196. console.log(param);
  197. return
  198. this.ajax
  199. .get(this.$store.state.api+'',param)
  200. .then(res=>{
  201. console.log(res);
  202. },err=>{
  203. console.log(err);
  204. })
  205. },
  206. //立项基础信息页面删除功能在它自己页面人员信息
  207. confirmSetFund(){ //预算经费设置经费对话框
  208. let data=this.projectApplicationApply3
  209. for(let key in data.items){
  210. if (data.items[key]=='') {
  211. data.items[key]='-'
  212. }
  213. }
  214. data.tableData.splice(0,1,data.items)
  215. },
  216. addFundDetail(){ //预算经费页面经费添加按钮
  217. let p=this.projectApplicationApply3;
  218. let data={
  219. Fund:p.dialog.fund,
  220. projectName:p.dialog.disburseProject,
  221. sort:p.dialog.type,
  222. remark:p.dialog.textarea
  223. }
  224. p.tableData2.push(data)
  225. },
  226. submitBtn(){ //预算经费页面提交按钮
  227. console.log("提交啦");
  228. this.submitData()
  229. // this.submitHint = true;
  230. },
  231. submitData(){ //提交页面所有数据
  232. let a=this.projectApplicationApply1;
  233. let b=this.projectApplicationApply2;
  234. let c=this.projectApplicationApply3
  235. let d=[]
  236. for(let key in b){
  237. d.push(b[key])
  238. }
  239. let newData1 = c.tableData[0];
  240. for(let key in newData1){
  241. if (newData1[key]=='-') {
  242. // console.log(newData1[key]);
  243. newData1[key]=0
  244. // console.log(key+'--'+newData1[key]);
  245. // // newData1[key]=0
  246. }
  247. }
  248. let param={
  249. uid:this.$store.state.userInfo.userid,
  250. title:a.select.projectName,
  251. brief:a.textarea,
  252. leader:a.select.person,
  253. phone:a.select.tel,
  254. cid:a.select.value,
  255. student:JSON.stringify(a.tableData),
  256. message:JSON.stringify([d,[newData1,c.tableData2]]),
  257. tid:a.select.sort,
  258. mon:a.select.fund,
  259. beginTime:a.select.value1
  260. }
  261. this.ajax
  262. .post(this.$store.state.api+'/CreateProject',param)
  263. .then(res=>{
  264. console.log(res)
  265. if(res.data==1){
  266. this.$message.success("创建成功")
  267. }
  268. // console.log(res.data==1);
  269. },err=>{
  270. console.log(err);
  271. })
  272. },
  273. init(){
  274. //重置
  275. this.projectApplicationApply1.addMemberDialog=false
  276. this.submitHint=false;
  277. },
  278. },
  279. created(){ //实例初始化完成后调用
  280. this.getProjectDepartmentData() //获取项目立项申请基础信息页面所在部门数据
  281. this.getProjectTypeData() //获取项目立项申请基础信息页面分类数据
  282. // this.submitData()
  283. }
  284. }
  285. </script>
  286. <style lang="less">
  287. .projectApplicationApplyPAapply{
  288. width: 100vw;
  289. background: #e6eaf0;
  290. display: flex;
  291. flex-direction: column;
  292. align-items: center;
  293. .pAHeader3{ //返回键
  294. position: absolute;
  295. right: 0px;
  296. top: 5px;
  297. cursor: pointer;
  298. }
  299. // 顶部导航区
  300. .vector{ //矢量图大小
  301. height: 50%;
  302. margin-top: 5px;
  303. }
  304. .Main_area{ //宽度
  305. width: 95%;
  306. min-height: 80%;
  307. margin-bottom: 20px;
  308. }
  309. // 顶部导航区
  310. // 顶部导航区开始
  311. .PAheader{
  312. width: 90%;
  313. height: 70px;
  314. position: relative;
  315. top: 15px;
  316. border-radius: 5px;
  317. background: #ffffff;
  318. display: flex;
  319. justify-content: center;
  320. align-items: center;
  321. .PAheaderBlock{
  322. background: #4a83d0;
  323. width: 16%;
  324. height: 80%;
  325. border-radius: 10px;
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. color: #fff;
  330. font-size: 18px;
  331. cursor: pointer;
  332. }
  333. .PAheaderBlock:nth-of-type(2){
  334. margin: 10%;
  335. }
  336. }
  337. // 顶部导航区结束
  338. //提交对话框开始
  339. .projectApplicationfundAddDialog{
  340. .el-dialog__header{
  341. border-radius: 10px 10px 0 0;
  342. }
  343. .el-dialog{
  344. border-radius:10px ;
  345. }
  346. .deleteContent{
  347. width: 100%;
  348. text-align: center;
  349. font-size: 22px;
  350. color: #000;
  351. }
  352. .addDialogLogo{
  353. width: 60px;
  354. height: 30px;
  355. line-height: 30px;
  356. background: #f2f2f2;
  357. position: absolute;
  358. left: 10px;
  359. top: 10px;
  360. text-align: center;
  361. }
  362. .el-dialog__header{
  363. background: #32455b;
  364. }
  365. .el-dialog__title{
  366. // text-align: center;
  367. margin-left:250px;
  368. font-size: 22px;
  369. color:rgb(246, 247, 246);
  370. }
  371. .addDialogMid{
  372. box-sizing: border-box;
  373. padding:0 60px 0 10px;
  374. .addDialogTit{
  375. display: flex;
  376. span{
  377. width: 80px;
  378. line-height: 40px;
  379. text-align: left;
  380. }
  381. }
  382. .addDialogTit1{
  383. display: flex;
  384. justify-content: space-between;
  385. margin-bottom: 15px;
  386. }
  387. .addDialogTit2{
  388. margin-top: 10px;
  389. font-size: 18px;
  390. color: #000;
  391. text-indent: 2em;
  392. }
  393. .addDialogCon{
  394. margin-top: 20px;
  395. }
  396. }
  397. .dialog-footer{
  398. display: flex;
  399. justify-content: center;
  400. .btn5{
  401. height: 40px;
  402. font-size: 16px;
  403. background: #0e72e6;
  404. width: 200px;
  405. }
  406. }
  407. }
  408. //提交对话框结束
  409. .right{
  410. width: 83%;
  411. background: #fff;
  412. box-sizing: border-box;
  413. padding: 15px 20px;
  414. min-height: 740px;
  415. margin-bottom: 60px;
  416. border-radius: 5px;
  417. }
  418. // 左边栏开始
  419. .left{
  420. width: 10%;
  421. min-width: 110px;
  422. height: 740px;
  423. background: #32455b;
  424. display: flex;
  425. justify-content: center;
  426. margin-right: 2%;
  427. box-sizing: border-box;
  428. padding: 0 10px;
  429. border-radius: 5px;
  430. .leftTits{
  431. display: flex;
  432. flex-direction: column;
  433. margin: 50px 0 0 10px;
  434. div{
  435. width: 97px;
  436. color: #fff;
  437. cursor: pointer;
  438. margin-bottom: 30px;
  439. p{
  440. white-space: nowrap;
  441. overflow: hidden;
  442. text-overflow:ellipsis;
  443. }
  444. }
  445. }
  446. div:hover{
  447. color: #ccc;
  448. }
  449. .sx{
  450. margin-top: 53.5px;
  451. margin-left: 8px;
  452. width: 1px;
  453. height: 400px;
  454. background: #84888d;
  455. .qiu{
  456. width: 10px;
  457. height: 10px;
  458. background: #fff;
  459. border-radius: 50px;
  460. margin-left: -4.5px;
  461. }
  462. }
  463. }
  464. // 左边栏结束
  465. }
  466. </style>