MakerSpaceApply.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <!-- 项目立项申请 -->
  3. <div id="MakerSpaceApply" v-loading="loading">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">创客空间项目申请</div>
  6. </div>
  7. <hr>
  8. <MakerSpaceWord :wordData="wordData"/>
  9. <el-button type="primary" @click="test">提交项目</el-button>
  10. <el-dialog
  11. title="提示"
  12. :visible.sync="submitHint"
  13. width="600px"
  14. class="pageSubmitData">
  15. <div class="addDialogLogo">LOGO</div>
  16. <div class="deleteContent">确定提交“{{wordData['projectName']}}”项目立项?</div>
  17. <span slot="footer" class="dialog-footer">
  18. <el-button type="primary" @click="applyProject" class="AllDialogBtn">确认提交</el-button>
  19. <el-button @click="submitHint=false" class="AllDialogBtn">取消</el-button>
  20. </span>
  21. </el-dialog>
  22. </div>
  23. </template>
  24. <script>
  25. import {getNowDate} from '@/components/tool/Date.js'
  26. import getProjectNo from '@/components/tool/getProjectNo';
  27. import MakerSpaceWord from './components/MakerSpaceWord.vue';
  28. export default {
  29. components:{MakerSpaceWord},
  30. data() {
  31. return {
  32. wordData:{
  33. applicationDate:getNowDate(1),//申请日期
  34. projectName:"",//项目名称
  35. college:"",//所在学院
  36. begin_at:"",//项目开始时间
  37. state:"",//项目状态
  38. plannedEnd_at:"",//计划完成时间
  39. pro_leader:"",//项目负责人
  40. lead_leader:"",//学院牵头领导
  41. teacher:[
  42. {name:"",speciality:"",title:"",education:"",section:"",work:""},
  43. {name:"",speciality:"",title:"",education:"",section:"",work:""},
  44. {name:"",speciality:"",title:"",education:"",section:"",work:""},
  45. ], //教师组//name:姓名 speciality:专业 title:职称 education:学历 section:所在教研室 work:项目组角色分工
  46. student:[
  47. {name:"",class:"",age:"",work:""},
  48. {name:"",class:"",age:"",work:""},
  49. {name:"",class:"",age:"",work:""},
  50. {name:"",class:"",age:"",work:""},
  51. {name:"",class:"",age:"",work:""},
  52. ], //学生组//name:姓名 class:班级 age:年龄 work:项目组任务分工
  53. brief:"",//项目简介
  54. Construction:"",//建设内容
  55. ProjectBasis:"",//立项依据
  56. development:"",//创客空间物理环境、制度建设及软件设施建设情况
  57. studio:"",//学生创客工作室建设情况
  58. studentTeam:"",//学生创客团队(人才)培养预期成果、数量
  59. studentActivities:"",//学生创客活动组织实施情况
  60. Transforming:"",//学生创客团队孵化、转化创业项目情况
  61. condition:"",//立 项基 础及条 件
  62. fund:{
  63. total:"",
  64. device:"",
  65. Material:"",
  66. processing:"",
  67. Collaboration:"",
  68. APPRAISAL:"",
  69. entery:"",
  70. activities:"",
  71. Transaction:"",
  72. },//预算经费
  73. //total:总经费
  74. //小型仪器设备费:device deviceRemarks
  75. //材料费:Material MaterialRemarks
  76. //测试化验加工费:processing processingRemarks
  77. //项目协作费:Collaboration CollaborationRemarks
  78. //项目成果鉴定费:APPRAISAL APPRAISALRemarks
  79. //参展参赛费:entery enteryRemarks
  80. //创客交流活动费:activities activitiesRemarks
  81. //知识产权事务费:Transaction TransactionRemarks
  82. },
  83. loading:false,
  84. submitHint:false,
  85. }
  86. },
  87. methods:{
  88. test(){//项目提交
  89. //检查各个字段
  90. const cEmpty = /^\s*$/g;
  91. for(let i in this.wordData){
  92. switch (i) {
  93. case "projectName":
  94. if(cEmpty.test(this.wordData[i])){
  95. this.$message.error("请输入项目名称");
  96. document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
  97. return false;
  98. }
  99. break;
  100. case "college":
  101. if(cEmpty.test(this.wordData[i])){
  102. this.$message.error("请选择所在学院");
  103. document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
  104. return false;
  105. }
  106. break;
  107. case "state":
  108. if(cEmpty.test(this.wordData[i])){
  109. this.$message.error("请选择项目状态");
  110. document.querySelector('#two').scrollIntoView({ behavior: "smooth" });
  111. return false;
  112. }
  113. break;
  114. case "begin_at":
  115. if(cEmpty.test(this.wordData[i])){
  116. this.$message.error("请选择项目开始时间");
  117. document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
  118. return false;
  119. }
  120. break;
  121. case "plannedEnd_at":
  122. if(cEmpty.test(this.wordData[i])){
  123. this.$message.error("请选择计划完成时间");
  124. document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
  125. return false;
  126. }
  127. break;
  128. case "pro_leader":
  129. if(cEmpty.test(this.wordData[i])){
  130. this.$message.error("请输入项目负责人");
  131. document.querySelector('#four').scrollIntoView({ behavior: "smooth" });
  132. return false;
  133. }
  134. break;
  135. case "lead_leader":
  136. if(cEmpty.test(this.wordData[i])){
  137. this.$message.error("请输入学院牵头领导");
  138. document.querySelector('#four').scrollIntoView({ behavior: "smooth" });
  139. return false;
  140. }
  141. break;
  142. case "teacher":
  143. if(this.wordData[i].length<3){
  144. this.$message.error('教师团队应3人以上')
  145. document.querySelector('#five').scrollIntoView({ behavior: "smooth" });
  146. return false;
  147. }else{
  148. let num = 0;
  149. this.wordData[i].forEach(item=>{
  150. for(let j in item){
  151. if(cEmpty.test(item[j])){
  152. num++;
  153. }
  154. }
  155. })
  156. if(num>0){
  157. this.$message.error("请填完教师信息");
  158. document.querySelector('#five').scrollIntoView({ behavior: "smooth" });
  159. return false;
  160. }
  161. }
  162. break;
  163. case "student":
  164. if(this.wordData[i].length<5){
  165. this.$message.error('学生团队应5人以上')
  166. document.querySelector('#six').scrollIntoView({ behavior: "smooth" });
  167. return false;
  168. }else{
  169. let num = 0;
  170. this.wordData[i].forEach(item=>{
  171. for(let j in item){
  172. if(cEmpty.test(item[j])){
  173. num++;
  174. }
  175. }
  176. })
  177. if(num>0){
  178. this.$message.error("请填完学生信息");
  179. document.querySelector('#six').scrollIntoView({ behavior: "smooth" });
  180. return false;
  181. }
  182. }
  183. break;
  184. case "brief":
  185. if(cEmpty.test(this.wordData[i])){
  186. this.$message.error("请填写项目简介");
  187. document.querySelector('#seven').scrollIntoView({ behavior: "smooth" });
  188. return false;
  189. }else{
  190. if(this.wordData[i].length<200||this.wordData>300){
  191. this.$message.error("项目简介需要200-300字")
  192. document.querySelector('#seven').scrollIntoView({ behavior: "smooth" });
  193. return false;
  194. }
  195. }
  196. break;
  197. case "Construction":
  198. if(cEmpty.test(this.wordData[i])){
  199. this.$message.error("请填写建设内容");
  200. document.querySelector('#eight').scrollIntoView({ behavior: "smooth" });
  201. return false;
  202. }
  203. break;
  204. case "ProjectBasis":
  205. if(cEmpty.test(this.wordData[i])){
  206. this.$message.error("请填写立项依据");
  207. document.querySelector('#nine').scrollIntoView({ behavior: "smooth" });
  208. return false;
  209. }
  210. break;
  211. case "development":
  212. if(cEmpty.test(this.wordData[i])){
  213. this.$message.error("请填写创客空间物理环境、制度建设及软件设施建设情况");
  214. document.querySelector('#ten').scrollIntoView({ behavior: "smooth" });
  215. return false;
  216. }
  217. break;
  218. case "studio":
  219. if(cEmpty.test(this.wordData[i])){
  220. this.$message.error("请填写学生创客工作室建设情况");
  221. document.querySelector('#eleven').scrollIntoView({ behavior: "smooth" });
  222. return false;
  223. }
  224. break;
  225. case "studentTeam":
  226. if(cEmpty.test(this.wordData[i])){
  227. this.$message.error("请填写学生创客团队(人才)培养预期成果、数量");
  228. document.querySelector('#twelve').scrollIntoView({ behavior: "smooth" });
  229. return false;
  230. }
  231. break;
  232. case "studentActivities":
  233. if(cEmpty.test(this.wordData[i])){
  234. this.$message.error("请填写学生创客活动组织实施情况");
  235. document.querySelector('#thirteen').scrollIntoView({ behavior: "smooth" });
  236. return false;
  237. }
  238. break;
  239. case "Transforming":
  240. if(cEmpty.test(this.wordData[i])){
  241. this.$message.error("请填写学生创客团队孵化、转化创业项目情况");
  242. document.querySelector('#fourteen').scrollIntoView({ behavior: "smooth" });
  243. return false;
  244. }
  245. break;
  246. case "condition":
  247. if(cEmpty.test(this.wordData[i])){
  248. this.$message.error("请填写基础条件");
  249. document.querySelector('#fifteen').scrollIntoView({ behavior: "smooth" });
  250. return false;
  251. }
  252. break
  253. }
  254. }
  255. this.submitHint = true;
  256. },
  257. applyProject(){
  258. //先获取编号
  259. getProjectNo("XM").then((result)=>{
  260. let pram = {
  261. uid:this.$store.state.userInfo.userid,//用户ID
  262. pNo:result,//项目编号
  263. tit:this.wordData['projectName'],//项目名称
  264. bf:this.wordData['brief'],//项目简介
  265. pLeader:this.wordData['pro_leader'],//项目负责人
  266. lLeader:this.wordData['lead_leader'],//学院牵头领导,
  267. cid:this.wordData['college'],//学院ID,
  268. ct:JSON.stringify(this.wordData['teacher']),//教师组,
  269. cs:JSON.stringify(this.wordData['student']),//学生组,
  270. f:this.wordData['fund']['total'],//总经费
  271. chp:JSON.stringify({
  272. Construction:this.wordData['Construction'],//建设内容
  273. ProjectBasis:this.wordData['ProjectBasis'],//立项依据
  274. development:this.wordData['development'],//创客空间物理环境、制度建设及软件设施建设情况
  275. studio:this.wordData['studio'],//学生创客工作室建设情况
  276. studentTeam:this.wordData['studentTeam'],//学生创客团队(人才)培养预期成果、数量
  277. studentActivities:this.wordData['studentActivities'],//学生创客活动组织实施情况
  278. Transforming:this.wordData['Transforming'],//学生创客团队孵化、转化创业项目情况
  279. condition:this.wordData['condition'],//立 项基 础及条 件
  280. }),//项目详细
  281. tid:"5f7a66d5-c206-11ed-a4cd-509a4c5b67cf",//特色创客空间建设项目分类ID
  282. tName:this.wordData['state'],//项目状态
  283. mon:JSON.stringify(this.wordData['fund']),//预算经费
  284. planEnd:this.wordData['plannedEnd_at'],//计划完成时间,
  285. beh:this.wordData['begin_at'],//项目开始时间,
  286. apply:this.wordData['applicationDate'],//申请日期
  287. }
  288. this.ajax.post(this.$store.state.api+'/MakerSpaceWordApply',pram).then(result=>{
  289. console.log(result)
  290. if(result['data']==1){
  291. this.$message.success("项目提交成功");
  292. this.$router.push('/projectApplication')
  293. }else{
  294. this.$message.error("项目提交失败");
  295. }
  296. }).catch(err=>{
  297. console.log(err);
  298. })
  299. })
  300. }
  301. },
  302. mounted(){ //跳转到此页面立刻获取数据
  303. // this.getData(); //获取表格数据
  304. // this.applyProject();
  305. }
  306. }
  307. </script>
  308. <style lang="less">
  309. #MakerSpaceApply{
  310. display: flex;
  311. flex-direction: column;
  312. align-items: center;
  313. }
  314. </style>