projectApplicationApplyMain.vue 15 KB

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