projectApplicationApplyMain.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  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="btn5">确认提交</el-button>
  38. <el-button @click="init" class="btn5" style="background:#cccccc" size="small">取消</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. },
  192. submitBtn(){ //预算经费页面提交显示对话框
  193. this.submitHint = true;
  194. },
  195. submitAll(){
  196. this.submitData()
  197. },
  198. submitData(){ //提交页面所有数据
  199. let a=this.projectApplicationApply1;
  200. let b=this.projectApplicationApply2;
  201. let c=this.projectApplicationApply3
  202. if(a.select.projectName=='') return this.$message.error('请输入项目名称')
  203. if(a.select.person=='') return this.$message.error('请输入项目负责人')
  204. if(a.select.value1=='') return this.$message.error('请选择项目开始时间')
  205. if(a.select.value=='') return this.$message.error('请选择所在部门')
  206. if(a.select.fund=='') return this.$message.error('请输入预算总经费')
  207. if(a.select.tel=='') return this.$message.error('请输入联系电话')
  208. if(!a.telVerify) return this.$message.error('请输入正确联系电话格式')
  209. if(a.select.sort=='') return this.$message.error('请选择分类')
  210. let d=[] //按照后端格式传递数据,项目内容,要将经费支出,与项目明细放在一起,
  211. for(let key in b){
  212. d.push(b[key])
  213. }
  214. let newData1 = c.tableData[0]; //没有输入的月支出计划改为0,向后端传递
  215. for(let key in newData1){
  216. if (newData1[key]=='-') {
  217. newData1[key]=0
  218. }
  219. }
  220. let param={
  221. uid:this.$store.state.userInfo.userid,
  222. title:a.select.projectName,
  223. brief:a.textarea,
  224. leader:a.select.person,
  225. phone:a.select.tel,
  226. cid:a.select.value,
  227. student:JSON.stringify(a.tableData),
  228. message:JSON.stringify([d,[newData1,c.tableData2]]),
  229. tid:a.select.sort,
  230. mon:a.select.fund,
  231. imgsrc:a.dialogImageUrl,
  232. beginTime:a.select.value1
  233. }
  234. this.ajax
  235. .post(this.$store.state.api+'/CreateProject',param)
  236. .then(res=>{
  237. // console.log(res)
  238. if(res.data==1){
  239. this.$message.success("创建成功")
  240. this.$router.push('projectApplication')
  241. }
  242. },err=>{
  243. console.log(err);
  244. })
  245. },
  246. },
  247. created(){ //实例初始化完成后调用
  248. this.getProjectDepartmentData() //获取项目立项申请基础信息页面所在部门数据
  249. this.getProjectTypeData() //获取项目立项申请基础信息页面分类数据
  250. // this.submitData()
  251. }
  252. }
  253. </script>
  254. <style lang="less">
  255. .projectApplicationApplyPAapply{
  256. width: 100vw;
  257. background: #e6eaf0;
  258. display: flex;
  259. flex-direction: column;
  260. align-items: center;
  261. .pAHeader3{ //返回键
  262. position: absolute;
  263. right: 0px;
  264. top: 5px;
  265. cursor: pointer;
  266. }
  267. // 顶部导航区
  268. .vector{ //矢量图大小
  269. height: 50%;
  270. margin-top: 5px;
  271. }
  272. .Main_area{ //宽度
  273. width: 95%;
  274. min-height: 80%;
  275. margin-bottom: 20px;
  276. }
  277. // 顶部导航区
  278. // 顶部导航区开始
  279. .PAheader{
  280. width: 90%;
  281. height: 70px;
  282. position: relative;
  283. top: 15px;
  284. border-radius: 5px;
  285. background: #ffffff;
  286. display: flex;
  287. justify-content: center;
  288. align-items: center;
  289. .PAheaderBlock{
  290. background: #4a83d0;
  291. width: 16%;
  292. height: 80%;
  293. border-radius: 10px;
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. color: #fff;
  298. font-size: 18px;
  299. cursor: pointer;
  300. }
  301. .PAheaderBlock:nth-of-type(2){
  302. margin: 10%;
  303. }
  304. }
  305. // 顶部导航区结束
  306. //提交对话框开始
  307. .projectApplicationfundAddDialog{
  308. .el-dialog__header{
  309. display: flex;
  310. justify-content: center;
  311. }
  312. .el-dialog{
  313. border-radius: 5px;
  314. overflow: hidden;
  315. top: 10%;
  316. }
  317. .deleteContent{
  318. width: 100%;
  319. text-align: center;
  320. font-size: 22px;
  321. color: #000;
  322. }
  323. .addDialogLogo{
  324. width: 60px;
  325. height: 30px;
  326. border-radius: 5px;
  327. display: flex;
  328. justify-content: center;
  329. line-height: 30px;
  330. background: #f2f2f2;
  331. position: absolute;
  332. left: 20px; top: 15px;
  333. }
  334. .el-dialog__header{
  335. background: #32455b;
  336. }
  337. .el-dialog__title{
  338. font-size: 18px;
  339. color:rgb(246, 247, 246);
  340. }
  341. .addDialogMid{
  342. box-sizing: border-box;
  343. padding:0 60px 0 10px;
  344. .addDialogTit{
  345. display: flex;
  346. span{
  347. width: 80px;
  348. line-height: 40px;
  349. text-align: left;
  350. }
  351. }
  352. .addDialogTit1{
  353. display: flex;
  354. justify-content: space-between;
  355. margin-bottom: 15px;
  356. }
  357. .addDialogTit2{
  358. margin-top: 10px;
  359. font-size: 18px;
  360. color: #000;
  361. text-indent: 2em;
  362. }
  363. .addDialogCon{
  364. margin-top: 20px;
  365. }
  366. }
  367. .dialog-footer{
  368. display: flex;
  369. justify-content: center;
  370. .btn5{
  371. height: 40px;
  372. font-size: 16px;
  373. background: #0e72e6;
  374. width: 200px;
  375. }
  376. }
  377. }
  378. //提交对话框结束
  379. .right{
  380. width: 83%;
  381. background: #fff;
  382. box-sizing: border-box;
  383. padding: 15px 20px;
  384. min-height: 740px;
  385. margin-bottom: 60px;
  386. border-radius: 5px;
  387. }
  388. // 左边栏开始
  389. .left{
  390. width: 10%;
  391. min-width: 110px;
  392. height: 740px;
  393. background: #32455b;
  394. display: flex;
  395. justify-content: center;
  396. margin-right: 2%;
  397. box-sizing: border-box;
  398. padding: 0 10px;
  399. border-radius: 5px;
  400. .leftTits{
  401. display: flex;
  402. flex-direction: column;
  403. margin: 50px 0 0 10px;
  404. div{
  405. width: 97px;
  406. color: #fff;
  407. cursor: pointer;
  408. margin-bottom: 30px;
  409. p{
  410. white-space: nowrap;
  411. overflow: hidden;
  412. text-overflow:ellipsis;
  413. }
  414. }
  415. }
  416. div:hover{
  417. color: #ccc;
  418. }
  419. .sx{
  420. margin-top: 53.5px;
  421. margin-left: 8px;
  422. width: 1px;
  423. height: 400px;
  424. background: #84888d;
  425. .qiu{
  426. width: 10px;
  427. height: 10px;
  428. background: #fff;
  429. border-radius: 50px;
  430. margin-left: -4.5px;
  431. }
  432. }
  433. }
  434. // 左边栏结束
  435. }
  436. </style>