hz-zhhq-app/unpackage/dist/build/wit-rear/static/js/pages-myInfo-myInfo.83e4d4b...

1 line
42 KiB
JavaScript
Raw Normal View History

2025-01-22 10:53:47 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-myInfo-myInfo"],{"2e61":function(e,t,i){var n=i("8aa5f");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i("4f06").default;a("4c6c9551",n,!0,{sourceMap:!1,shadowMode:!1})},"7e2f":function(e,t,i){"use strict";var n=i("ee27");i("99af"),i("a434"),i("4d63"),i("ac1f"),i("25f0"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(i("f6ba")),o=i("37f6"),r=i("b742"),s=((new Date).getTime(),{data:function(){return{userInfo:(0,r.getStorage)("userInfo"),deptmentList:[{name:"请选择..."}],deptmentListIndex:0,userTypeList:[{name:"请选择..."},{name:"内部人员"},{name:"支撑人员"}],userTypeIndex:0,imgs:[],lifeImgs:[],showCar2:!1,eAccount:{name:"",jobNum:"",mealCardNum:"",idCardNum:"",carIdNumOne:"",carIdNumTwo:"",phoneNum:"",userType:"",departmentId:"",departmentName:"",img:"",lifeImg:""},carIdNumOneNew:"",carIdNumTwoNew:"",buttonText:"确认",items:[{name:"内部人员"},{name:"支撑人员"}]}},components:{uniCalendar:a.default},created:function(){},onLoad:function(){this.getDepartment(),this.loadData()},methods:{radioChange:function(e){this.eAccount.userType=e.detail.value},changeUserType:function(e){this.userTypeIndex=e.detail.value},loadData:function(){var e=this,t=this.userInfo.userId,i={method:o.getEAccount,data:{userId:t}};(0,r.callbackRequest)(i).then((function(t){if(t=t.data,console.log("9999--",t),"1"==t.returnCode)if(t.returnData){if(t.returnData.eAccount){var i=t.returnData.eAccount;e.eAccount=i,e.eAccount.carIdNumOne=i.carIdNumOne||"",e.eAccount.carIdNumTwo=i.carIdNumTwo||"",e.carIdNumOneNew=e.eAccount.carIdNumOne,e.carIdNumTwoNew=e.eAccount.carIdNumTwo,e.eAccount.carIdNumTwo&&(e.showCar2=!0);for(var n=0;n<e.deptmentList.length;n++)e.deptmentList[n].name==i.departmentName&&(e.deptmentListIndex=n);i.img&&e.imgs.push(i.img),i.lifeImg&&e.lifeImgs.push(i.lifeImg),e.buttonText="确认修改"}else if(t.returnData.userInfo){var a=t.returnData.userInfo;e.eAccount.name=a.realName,e.eAccount.phoneNum=a.mobile||"",e.eAccount.idCardNum=a.idCard||"",e.eAccount.userType=1==a.isInner?"内部人员":"";for(n=0;n<e.deptmentList.length;n++)e.deptmentList[n].name==a.departmentName&&(e.deptmentListIndex=n)}}else e.eAccount.name=e.userInfo.userName}))},addCarId:function(){this.showCar2=!0},clearCarId:function(){this.showCar2=!1,this.carIdNumTwo=""},changeDepartment:function(e){this.deptmentListIndex=e.detail.value},getDepartment:function(){var e=this,t={method:o.getAllDept,data:{}};(0,r.callbackRequest)(t).then((function(t){1==t.data.returnCode&&(e.deptmentList=e.deptmentList.concat(t.data.returnData))}))},submit:function(){var e=this.eAccount,t=new RegExp("[`~!@#$^&*=|{}':;',\\[\\].<>/?~@#¥……&*——|{}【】‘;:”“'。,、?]");if(e.jobNum)if(e.jobNum&&t.test(e.jobNum))(0,r.alertTip)("工号不得含有特殊字符");else if(e.mealCardNum)if(e.mealCardNum&&t.test(e.mealCardNum))(0,r.alertTip)("餐卡号不得含有特殊字符");else if(e.idCardNum)if(!e.idCardNum||r.regIdCard.test(e.idCardNum))if(e.userType=1,"请选择..."!=this.deptmentList[this.deptmentListIndex].name)if(e.phoneNum)if(r.regPhone.test(e.phoneNum))if(e.img=this.imgs[0],e.lifeImg=this.lifeImgs[0],e.img)if(e.lifeImg){e.userId=this.userInfo.id,e.departmentId=this.deptmentList[this.deptmentListIndex].id+"",e.departmentName=this.deptmentList[this.deptmentListIndex].name,e.carIdNumOneNew=this.carIdNumOneNew,e.carIdNumTwoNew=this.carIdNumTwoNew,this.$delete(e,"id"),this.$delete(e,"createdTime"),this.$delete(e,"updateTime");var i="确定提交吗?";(0,r.sureAlterTip)("提示",i,!0).then((function(t){if(200===t){var i={method:o.saveEAccount,data:e};(0,r.callbackRequest)(i).then((function(e){e=e.data,"1"==e.returnCode?((0,r.alertTip)(e.returnMsg),setTimeout((function(e){uni.redirectTo({url:"/pages/index/index"})}),2e3)):(0,r.alertTip)(e.returnMsg)}))}}))}else(0,r.alertTip)("请上传自拍大头照");else(0,r.alertTip)("请上传证件照");else(0,r.alertTip)("手机号格式有误");else(0,r.alertTip)("请填写手机号");else(0,r.al