367.4ad5281a.js 6.4 KB

12
  1. "use strict";(self["webpackChunkscproject"]=self["webpackChunkscproject"]||[]).push([[367],{71637:function(t,e,a){a.r(e),a.d(e,{default:function(){return h}});var o=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[t._m(0),e("hr"),e("studentProjectWord",{ref:"pdf",attrs:{wordData:t.wordData,reversedMessage:t.reversedMessage}}),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["projectName"])+"”项目吗? ")]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{staticClass:"AllDialogBtn",attrs:{type:"primary"},on:{click:t.submitWord}},[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("创客项目申请")])])}],s=(a(57658),a(16079)),i=a(24613),n=a(1699),d={components:{studentProjectWord:n.Z},data(){return{accept:"*",loading:!1,submitHint:!1,wordData:{applicationDate:(0,i.YZ)(1),projectName:"",radio:"",checkList:[],schoolRadio:[],applyParsonRadio:[],applyParsonName:"",college:"",tel:"",beginTime:"",endTime:"",studentS:[{name:"",collage:"",work:""}],teacherS:[{name:"",collage:"",work:""}],brief:"",introduce:{back:"",innovate:"",path:"",scene:"",worth:"",team:"",cost:"",expectResults:"",expectResultsTeacher:"",expectConversion:"",plan:""},total:"",fund:{device:"",Material:"",processing:"",Collaboration:"",APPRAISAL:"",entery:"",activities:"",Transaction:""}}}},computed:{reversedMessage:function(){return 1*this.wordData.fund.device+1*this.wordData.fund.Material+1*this.wordData.fund.processing+1*this.wordData.fund.Collaboration+1*this.wordData.fund.APPRAISAL+1*this.wordData.fund.entery+1*this.wordData.fund.activities+1*this.wordData.fund.Transaction}},methods:{test(){const t=/^\s*$/g;for(let e in this.wordData)switch(e){case"projectName":if(t.test(this.wordData[e]))return this.$message.error("请输入项目名称"),document.querySelector("#projectName").scrollIntoView({behavior:"smooth"}),!1;break;case"radio":if(t.test(this.wordData[e]))return this.$message.error("请选择项目分组"),document.querySelector("#radio").scrollIntoView({behavior:"smooth"}),!1;break;case"applyParsonRadio":if(0==this.wordData[e].length)return this.$message.error("请选择项目申请人"),document.querySelector("#applyParsonRadio").scrollIntoView({behavior:"smooth"}),!1;break;case"applyParsonName":if(t.test(this.wordData[e]))return this.$message.error("请填写申请人姓名"),document.querySelector("#applyParsonName").scrollIntoView({behavior:"smooth"}),!1;break;case"college":if(t.test(this.wordData[e]))return this.$message.error("请选择所在学院"),document.querySelector("#applyParsonName").scrollIntoView({behavior:"smooth"}),!1;break;case"tel":if(t.test(this.wordData[e]))return this.$message.error("请填写联系方式"),document.querySelector("#applyParsonName").scrollIntoView({behavior:"smooth"}),!1;break;case"beginTime":if(t.test(this.wordData[e]))return this.$message.error("请选择项目起始时间"),document.querySelector("#beginTime").scrollIntoView({behavior:"smooth"}),!1;break;case"endTime":if(t.test(this.wordData[e]))return this.$message.error("请选择计划完成时间"),document.querySelector("#beginTime").scrollIntoView({behavior:"smooth"}),!1;break;case"fund":let a=0;for(let t in this.wordData.fund)a+=1*this.wordData.fund[t];if(0==a)return document.querySelector("#fund").scrollIntoView({behavior:"smooth"}),this.$message.error("请输入经费");break}this.wordData["total"]=1*this.wordData.fund.device+1*this.wordData.fund.Material+1*this.wordData.fund.processing+1*this.wordData.fund.Collaboration+1*this.wordData.fund.APPRAISAL+1*this.wordData.fund.entery+1*this.wordData.fund.activities+1*this.wordData.fund.Transaction,this.submitHint=!0},submitWord(){(0,s.Z)("XM").then((t=>{let e={uid:this.$store.state.userInfo.userid,pNo:t,tid:"5e21b204-c206-11ed-a4cd-509a4c5b67cf",tit:this.wordData["projectName"],radio:this.wordData["radio"],checkList:JSON.stringify(this.wordData["checkList"]),schoolRadio:JSON.stringify(this.wordData["schoolRadio"]),applyParsonRadio:JSON.stringify(this.wordData["applyParsonRadio"]),applyParsonName:this.wordData["applyParsonName"],cid:this.wordData["college"],tel:this.wordData["tel"],beh:this.wordData["beginTime"],planEnd:this.wordData["endTime"],cs:JSON.stringify(this.wordData["studentS"]),ct:JSON.stringify(this.wordData["teacherS"]),bf:this.wordData["brief"],introduce:JSON.stringify(this.wordData["introduce"]).replaceAll(/%/g,"%25"),mon:JSON.stringify(this.wordData["fund"]),f:this.wordData["total"],apply:this.wordData["applicationDate"],mem:this.wordData["studentS"].length+this.wordData["teacherS"].length};this.ajax.post(this.$store.state.api+"/studentProjectWordApply",e).then((t=>{console.log(t),1==t["data"]?(this.$message.success("项目提交成功"),localStorage.getItem("StudentProjectApplyData")&&localStorage.removeItem("StudentProjectApplyData"),this.$router.push("/projectApplication")):this.$message.error("项目提交失败")}),(t=>{console.log(t)})).catch((t=>{console.log(t)}))}))},saveData(){localStorage.setItem("StudentProjectApplyData",JSON.stringify(this.wordData))}},mounted(){localStorage.getItem("StudentProjectApplyData")&&(this.wordData=JSON.parse(localStorage.getItem("StudentProjectApplyData"))),window.addEventListener("beforeunload",(()=>this.saveData()))},beforeRouteLeave(t,e,a){this.submitHint||this.saveData(),a()}},l=d,c=a(43736),u=(0,c.Z)(l,o,r,!1,null,"46f60490",null),h=u.exports},16079:function(t,e,a){a.d(e,{Z:function(){return i}});var o=a(36890),r=a(26125);const s={XM:"/getProjectNo",HD:"/getActivityNo",ZJ:"/getFundNo"};function i(t="XM"){return new Promise(((e,a)=>{o.Z.get(r.Z.state.api+s[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 o=a["data"][0][0]["No"],r=parseInt(o.slice(-7)),s=r+1,i=`${t}${s.toString().padStart(7,"0")}`;e(i)}))}))}}}]);
  2. //# sourceMappingURL=367.4ad5281a.js.map