newNomMarker.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <!-- 测试上传组件 -->
  3. <div v-loading="loading" id="MakerActivityWord">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">个人创客申请</div>
  6. </div>
  7. <hr>
  8. <!-- 创客专项资金及项目申请表(创客活动) -->
  9. <NomMarkerWord :wordData="wordData" :total="total"/>
  10. <el-button type="primary" @click="test">提交项目</el-button>
  11. <el-dialog
  12. title="提示"
  13. :visible.sync="submitHint"
  14. width="600px"
  15. class="pageSubmitData">
  16. <div class="addDialogLogo">LOGO</div>
  17. <div class="deleteContent">确定提交“{{wordData['activityName']}}”个人创客?</div>
  18. <span slot="footer" class="dialog-footer">
  19. <el-button type="primary" @click="applyActivity" class="AllDialogBtn">确认提交</el-button>
  20. <el-button @click="submitHint=false" class="AllDialogBtn">取消</el-button>
  21. </span>
  22. </el-dialog>
  23. </div>
  24. </template>
  25. <script>
  26. import NomMarkerWord from './components/NomMarkerWord.vue';
  27. import {getNowDate} from '@/components/tool/Date.js'
  28. import getProjectNo from '@/components/tool/getProjectNo';
  29. export default {
  30. components: {
  31. NomMarkerWord
  32. },
  33. data() {
  34. return {
  35. loading:false,
  36. submitHint:false,
  37. wordData:{
  38. applicationDate:getNowDate(1),//申请日期
  39. // associatedProjects:"",//关联项目
  40. activityName:'',//项目名称
  41. pro_leader:"",//活动负责人
  42. college: '',//所在学院
  43. tel:'',//联系电话
  44. activityTime:"",//活动时间
  45. student:0,//参与学生人数
  46. member:[
  47. {name:"",collage:"",work:""},
  48. {name:"",collage:"",work:""},
  49. {name:"",collage:"",work:""},
  50. {name:"",collage:"",work:""},
  51. {name:"",collage:"",work:""},
  52. ],
  53. activityPlan:"",//活动计划
  54. expectations:"",//预期目标
  55. eventAudience:"",//活动受众面
  56. fundingPlan:"",//经费支出计划
  57. expenditureMothPlan:['','','','','','','','','','','',''],
  58. fund:{
  59. device:"",
  60. Material:"",
  61. processing:"",
  62. Collaboration:"",
  63. APPRAISAL:"",
  64. entery:"",
  65. activities:"",
  66. Transaction:"",
  67. },//预算经费
  68. }
  69. };
  70. },
  71. computed:{
  72. total() {
  73. let num = 0;
  74. for(let i in this.wordData['fund'])num += Number(this.wordData['fund'][i]);
  75. return num;
  76. // return (this.wordData.fund.facility*1 + this.wordData.fund.materials*1+this.wordData.fund.process*1+ this.input*1+this.wordData.fund.authenticate*1+ this.wordData.fund.match*1+this.wordData.fund.activity*1+this.wordData.fund.affair*1)/10000
  77. }
  78. },
  79. methods: {
  80. test(){
  81. const cEmpty = /^\s*$/g;
  82. const checkPhone = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/; //获取正则表达式 存放到verify变量中
  83. for(let i in this.wordData){
  84. switch(i){
  85. case "activityName":
  86. if(cEmpty.test(this.wordData[i])){
  87. this.$message.error("请输入活动名称")
  88. document.querySelector('#two').scrollIntoView({ behavior: "smooth" });
  89. return false;
  90. }
  91. break;
  92. case "pro_leader":
  93. if(cEmpty.test(this.wordData[i])){
  94. this.$message.error("请输入活动负责人")
  95. document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
  96. return false;
  97. }
  98. break;
  99. case "college":
  100. if(cEmpty.test(this.wordData[i])){
  101. this.$message.error("请选择所在学院")
  102. document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
  103. return false;;
  104. }
  105. break;
  106. case "tel":
  107. if(cEmpty.test(this.wordData[i])){
  108. this.$message.error("请输入联系电话")
  109. document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
  110. return false;
  111. }else if(!checkPhone.test(this.wordData[i])){
  112. this.$message.error("请输入正确的手机号");
  113. document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
  114. return false;
  115. }
  116. break;
  117. case "activityTime":
  118. if(cEmpty.test(this.wordData[i][0])){
  119. this.$message.error("请选择活动时间")
  120. document.querySelector('#four').scrollIntoView({ behavior: "smooth" });
  121. return false;;
  122. }
  123. break;
  124. case "member":
  125. let num = 0;
  126. this.wordData[i].forEach(item=>{
  127. for(let j in item){
  128. if(cEmpty.test(item[j])){
  129. num++;
  130. }
  131. }
  132. })
  133. if(num>0){
  134. this.$message.error("请填完指导老师信息");
  135. document.querySelector('#five').scrollIntoView({ behavior: "smooth" });
  136. return false;
  137. }
  138. break;
  139. case "activityPlan":
  140. if(cEmpty.test(this.wordData[i][0])){
  141. this.$message.error("请输入活动计划");
  142. document.querySelector('#six').scrollIntoView({ behavior: "smooth" });
  143. return false;
  144. }
  145. break;
  146. case "expectations":
  147. if(cEmpty.test(this.wordData[i][0])){
  148. this.$message.error("预期目标");
  149. document.querySelector('#seven').scrollIntoView({ behavior: "smooth" });
  150. return false;
  151. }
  152. break;
  153. case "eventAudience":
  154. if(cEmpty.test(this.wordData[i][0])){
  155. this.$message.error("活动受众面")
  156. document.querySelector('#nine').scrollIntoView({ behavior: "smooth" });
  157. return false;
  158. }
  159. break;
  160. case "fundingPlan":
  161. if(cEmpty.test(this.wordData[i][0])){
  162. this.$message.error("经费支出计划")
  163. document.querySelector('#ten').scrollIntoView({ behavior: "smooth" });
  164. return false;
  165. }
  166. break;
  167. }
  168. }
  169. this.submitHint = true;
  170. },
  171. applyActivity(){
  172. getProjectNo("HD").then(result=>{
  173. let pram = {
  174. uid:this.$store.state.userInfo.userid,//用户ID
  175. aNo:result,//活动编号
  176. tit:this.wordData['activityName'],//活动名称
  177. courseId:'',//关联项目ID
  178. pLeader:this.wordData['pro_leader'],//活动负责人
  179. mon:this.total,//预算经费
  180. st:this.wordData['student'],//参与学生人数
  181. ct:JSON.stringify(this.wordData['member']),//活动指导老师
  182. chp:JSON.stringify({
  183. activityPlan:this.wordData['activityName'],//活动计划
  184. expectations:this.wordData['expectations'],//预期目标
  185. eventAudience:this.wordData['eventAudience'],//活动受众面
  186. fundingPlan:this.wordData['fundingPlan'],//经费支出计划
  187. }),//活动信息
  188. cid:this.wordData['college'],//学院ID,
  189. ph:this.wordData['tel'],//联系电话
  190. beg:JSON.stringify(this.wordData['activityTime']),//活动时间
  191. f:JSON.stringify(this.wordData['fund']),//预算经费明细
  192. appltTime:this.wordData['applicationDate'],//申请日期
  193. mp:JSON.stringify(this.wordData['expenditureMothPlan']),
  194. t:1,//活动分类 1 个人创客
  195. }
  196. this.ajax.post(this.$store.state.api+'/ActivityApply',pram).then(result=>{
  197. if(result['data']==1){
  198. this.$message.success("活动提交成功");
  199. this.$router.push('/makerActvity');
  200. }else{
  201. this.$message.error("活动提交失败")
  202. }
  203. }).catch(err=>{
  204. console.log(err)
  205. })
  206. })
  207. },
  208. },
  209. };
  210. </script>
  211. <style lang="less" scoped>
  212. #MakerActivityWord{
  213. width:100%;
  214. display: flex;
  215. flex-direction: column;
  216. align-items: center;
  217. }
  218. </style>