12 |
- "use strict";(self["webpackChunkscproject"]=self["webpackChunkscproject"]||[]).push([[3217],{75465: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("NomMarkerWord",{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)},o=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"pAHeader"},[e("div",{staticClass:"pAHeader1"},[t._v("个人创客申请")])])}],r=(a(57658),a(57651)),s=a(24613),n=a(16079),l={components:{NomMarkerWord:r.Z},data(){return{loading:!1,submitHint:!1,wordData:{applicationDate:(0,s.YZ)(1),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}if(this.total<=0)return this.$message.error("请输入预算经费"),document.querySelector("#fund").scrollIntoView({behavior:"smooth"}),!1;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:"",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:1};this.ajax.post(this.$store.state.api+"/ActivityApply",e).then((t=>{1==t["data"]?(this.$message.success("活动提交成功"),localStorage.getItem("NomActivityApplyData")&&localStorage.removeItem("NomActivityApplyData"),this.$router.push("/makerActvity")):this.$message.error("活动提交失败")})).catch((t=>{console.log(t)}))}))},saveData(){localStorage.setItem("NomActivityApplyData",JSON.stringify(this.wordData))}},mounted(){localStorage.getItem("NomActivityApplyData")&&(this.wordData=JSON.parse(localStorage.getItem("NomActivityApplyData"))),window.addEventListener("beforeunload",(()=>this.saveData()))},beforeRouteLeave(t,e,a){this.submitHint||this.saveData(),a()}},c=l,d=a(43736),u=(0,d.Z)(c,i,o,!1,null,"54a1909e",null),h=u.exports},24613:function(t,e,a){function i(t=0){let e=new Date,a=e.getFullYear(),i=e.getMonth()+1,o=e.getDate(),r=e.getHours(),s=e.getMinutes(),n=e.getSeconds();return i>1&&i<=9&&(i="0"+i),o>0&&o<=9&&(o="0"+o),r>0&&r<9&&(r="0"+r),s>0&&s<=9&&(s="0"+s),n>0&&n<9&&(n="0"+n),0==t?`${a}-${i}-${o} ${r}:${s}:${n}`:1==t?`${a}年${i}月${o}日`:void 0}function o(t){let e=JSON.parse(t);if(e[0]==e[1])return e[0];let a=e[0].split("-"),i=e[1].split("-");return a[0]==i[0]?a[1]==i[1]?`${a[0]}-${a[1]}-${a[2]} 至 ${i[2]}`:`${a[0]}-${a[1]}-${a[2]} 至 ${i[1]}-${i[2]}`:e[0]+" 至 "+e[1]}a.d(e,{YZ:function(){return i},nK:function(){return o}})},16079:function(t,e,a){a.d(e,{Z:function(){return s}});var i=a(36890),o=a(26125);const r={XM:"/getProjectNo",CX:"/getProjectNo",CY:"/getProjectNo",SJ:"/getProjectNo",HD:"/getActivityNo",ZJ:"/getFundNo"};function s(t="XM"){return new Promise(((e,a)=>{i.Z.get(o.Z.state.api+r[t],{uid:o.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 i=a["data"][0][0]["No"],o=parseInt(i.slice(-7)),r=o+1,s=`${t}${r.toString().padStart(7,"0")}`;e(s)}))}))}}}]);
- //# sourceMappingURL=3217.b0439d4c.js.map
|