7607.d6106cba.js 6.6 KB

12
  1. "use strict";(self["webpackChunkscproject"]=self["webpackChunkscproject"]||[]).push([[7607],{43382:function(t,e,a){a.r(e),a.d(e,{default:function(){return u}});var s=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.saveDraft}},[t._v("保存草稿")]),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)},i=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"pAHeader"},[e("div",{staticClass:"pAHeader1"},[t._v("创客活动申请")])])}],r=(a(57658),a(94045)),o=a(24613),n=a(16079),l={components:{markeractivityWord:r.Z},data(){return{loading:!1,submitHint:!1,wordData:{applicationDate:(0,o.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((async t=>{1==t["data"]?(this.$message.success("活动提交成功"),localStorage.getItem(`makerActivityApplyData${this.$store.state.userInfo.userid}`)&&localStorage.removeItem(`makerActivityApplyData${this.$store.state.userInfo.userid}`),await this.ajax.post(this.$store.state.api+"/delDraft",{userid:this.$store.state.userInfo.userid,type:2}),this.$router.push("/makerActvity")):this.$message.error("活动提交失败")})).catch((t=>{console.log(t)}))}))},saveData(){localStorage.setItem(`makerActivityApplyData${this.$store.state.userInfo.userid}`,JSON.stringify(this.wordData))},saveDraft(){if(this.loading)return this.$message.info("请稍等...");this.loading=!0;let t={userid:this.$store.state.userInfo.userid,type:2,jsonData:encodeURIComponent(JSON.stringify(this.wordData))};this.ajax.post(this.$store.state.api+"/saveDraft",t).then((t=>{1==t.data?this.$message.success("保存成功"):this.$message.error("保存失败"),this.loading=!1}))},getDraft(){if(this.loading)return this.$message.info("请稍等...");this.loading=!0;let t={userid:this.$store.state.userInfo.userid,type:2};this.ajax.get(this.$store.state.api+"/getDraft",t).then((t=>{t.data[0].length?this.wordData=JSON.parse(t.data[0][0].json):localStorage.getItem(`makerActivityApplyData${this.$store.state.userInfo.userid}`)&&(this.wordData=JSON.parse(localStorage.getItem(`makerActivityApplyData${this.$store.state.userInfo.userid}`))),this.loading=!1}))}},mounted(){this.getDraft(),window.addEventListener("beforeunload",(()=>this.saveData()))},activated(){this.getDraft(),window.addEventListener("beforeunload",(()=>this.saveData()))},destroyed(){window.removeEventListener("beforeunload",(t=>this.saveData()))},beforeRouteLeave(t,e,a){this.submitHint||this.saveData(),a()}},d=l,c=a(43736),h=(0,c.Z)(d,s,i,!1,null,"07eb3b45",null),u=h.exports},16079:function(t,e,a){a.d(e,{Z:function(){return o}});var s=a(36890),i=a(26125);const r={XM:"/getProjectNo",CX:"/getProjectNo",CY:"/getProjectNo",SJ:"/getProjectNo",HD:"/getActivityNo",ZJ:"/getFundNo"};function o(t="XM"){return new Promise(((e,a)=>{s.Z.get(i.Z.state.api+r[t],{uid:i.Z.state.userInfo.userid,type:t}).then((a=>{if(console.log(a["data"]),0==a["data"][0].length||null==a["data"][0][0]["No"])return e(`${t}0000001`);let s=a["data"][0][0]["No"],i=parseInt(s.slice(-7)),r=i+1,o=`${t}${r.toString().padStart(7,"0")}`;e(o)}))}))}}}]);
  2. //# sourceMappingURL=7607.d6106cba.js.map