178.f6a6b7de.js 5.2 KB

12
  1. "use strict";(self["webpackChunkscproject"]=self["webpackChunkscproject"]||[]).push([[178],{28617:function(t,e,a){a.r(e),a.d(e,{default:function(){return h}});var i=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{id:"MakerActivityWord"}},[t._m(0),e("hr"),e("markeractivityWord",{attrs:{wordData:t.wordData,total:t.total}}),e("div",{staticStyle:{position:"fixed",bottom:"5%",right:"2%"}},[e("el-button",{attrs:{type:"primary"},on:{click:t.test}},[t._v("提交活动")])],1),e("el-dialog",{staticClass:"pageSubmitData",attrs:{title:"提示",visible:t.submitHint,width:"600px"},on:{"update:visible":function(e){t.submitHint=e}}},[e("div",{staticClass:"deleteContent"},[t._v("确定提交“"+t._s(t.wordData["activityName"])+"”创客活动吗?")]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{staticClass:"AllDialogBtn",attrs:{type:"primary"},on:{click:t.applyActivity}},[t._v("确认提交")]),e("el-button",{staticClass:"AllDialogBtn",on:{click:function(e){t.submitHint=!1}}},[t._v("取消")])],1)])],1)},r=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"pAHeader"},[e("div",{staticClass:"pAHeader1"},[t._v("创客活动申请")])])}],o=(a(57658),a(20572)),s=a(24613),n=a(16079),c={components:{markeractivityWord:o.Z},data(){return{loading:!1,submitHint:!1,wordData:{applicationDate:(0,s.YZ)(1),associatedProjects:"",activityName:"",pro_leader:"",college:"",tel:"",activityTime:[],student:0,member:[{name:"",collage:"",work:""},{name:"",collage:"",work:""},{name:"",collage:"",work:""}],activityPlan:"",expectations:"",eventAudience:"",fundingPlan:"",expenditureMothPlan:["","","","","","","","","","","",""],fund:{device:"",Material:"",processing:"",Collaboration:"",APPRAISAL:"",entery:"",activities:"",Transaction:""}}}},computed:{total(){let t=0;for(let e in this.wordData["fund"])t+=Number(this.wordData["fund"][e]);return t}},methods:{test(){const t=/^\s*$/g,e=/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/;for(let a in this.wordData)switch(a){case"activityName":if(t.test(this.wordData[a]))return this.$message.error("请输入活动名称"),document.querySelector("#two").scrollIntoView({behavior:"smooth"}),!1;break;case"pro_leader":if(t.test(this.wordData[a]))return this.$message.error("请输入活动负责人"),document.querySelector("#three").scrollIntoView({behavior:"smooth"}),!1;break;case"college":if(t.test(this.wordData[a]))return this.$message.error("请选择所在学院"),document.querySelector("#three").scrollIntoView({behavior:"smooth"}),!1;break;case"tel":if(t.test(this.wordData[a]))return this.$message.error("请输入联系电话"),document.querySelector("#three").scrollIntoView({behavior:"smooth"}),!1;if(!e.test(this.wordData[a]))return this.$message.error("请输入正确的手机号"),document.querySelector("#three").scrollIntoView({behavior:"smooth"}),!1;break;case"activityTime":if(this.wordData[a].length<=0)return this.$message.error("请选择活动时间"),document.querySelector("#four").scrollIntoView({behavior:"smooth"}),!1;break;case"allFund":if(console.log(11111),this.total<=0)return this.$message.error("请输入预算经费"),document.querySelector("#fund").scrollIntoView({behavior:"smooth"}),!1;break}this.submitHint=!0},applyActivity(){(0,n.Z)("HD").then((t=>{let e={uid:this.$store.state.userInfo.userid,aNo:t,tit:this.wordData["activityName"],courseId:this.wordData["associatedProjects"],pLeader:this.wordData["pro_leader"],mon:this.total,st:this.wordData["student"],ct:JSON.stringify(this.wordData["member"]),chp:JSON.stringify({activityPlan:this.wordData["activityName"],expectations:this.wordData["expectations"],eventAudience:this.wordData["eventAudience"],fundingPlan:this.wordData["fundingPlan"]}),cid:this.wordData["college"],ph:this.wordData["tel"],beg:JSON.stringify(this.wordData["activityTime"]),f:JSON.stringify(this.wordData["fund"]),appltTime:this.wordData["applicationDate"],mp:JSON.stringify(this.wordData["expenditureMothPlan"]),t:""!=this.wordData["associatedProjects"]?0:1};this.ajax.post(this.$store.state.api+"/ActivityApply",e).then((t=>{1==t["data"]?(this.$message.success("活动提交成功"),sessionStorage.getItem("makerActivityApplyData")&&sessionStorage.removeItem("makerActivityApplyData"),this.$router.push("/makerActvity")):this.$message.error("活动提交失败")})).catch((t=>{console.log(t)}))}))}},mounted(){sessionStorage.getItem("makerActivityApplyData")&&(this.wordData=JSON.parse(sessionStorage.getItem("makerActivityApplyData")))},beforeRouteLeave(t,e,a){this.submitHint||sessionStorage.setItem("makerActivityApplyData",JSON.stringify(this.wordData)),a()}},l=c,d=a(1001),u=(0,d.Z)(l,i,r,!1,null,"bc8ba79c",null),h=u.exports},16079:function(t,e,a){a.d(e,{Z:function(){return s}});var i=a(36890),r=a(26125);const o={XM:"/getProjectNo",HD:"/getActivityNo",ZJ:"/getFundNo"};function s(t="XM"){return new Promise(((e,a)=>{i.Z.get(r.Z.state.api+o[t],{uid:r.Z.state.userInfo.userid}).then((a=>{if(console.log(a["data"]),0==a["data"][0].length||null==a["data"][0][0]["No"])return e(`${t}0000001`);let i=a["data"][0][0]["No"],r=parseInt(i.slice(-7)),o=r+1,s=`${t}${o.toString().padStart(7,"0")}`;e(s)}))}))}}}]);
  2. //# sourceMappingURL=178.f6a6b7de.js.map