|
@@ -4,15 +4,61 @@
|
|
|
<view class="cbox">
|
|
|
<view class="chtop flexc">
|
|
|
<image :src="line"></image>
|
|
|
- <view>员工信息</view>
|
|
|
+ <view>{{rzflag?'完善':'员工'}}信息</view>
|
|
|
</view>
|
|
|
<view class="chmain">
|
|
|
+ <view class="plr6 mt12">
|
|
|
+ <view class="rztit">请上传身份证照片</view>
|
|
|
+ <view class="flexcj mb10">
|
|
|
+ <view class="carbox" @click="getaddImagea('front')">
|
|
|
+ <image :src="baseUrl+datainfo.idCardBack" class="img" v-if="datainfo.idCardBack"></image>
|
|
|
+ <image :src="cardz" class="img" v-else></image>
|
|
|
+ <view class="tit">拍摄人像面</view>
|
|
|
+ </view>
|
|
|
+ <view class="carbox" @click="getaddImagea('back')">
|
|
|
+ <image :src="baseUrl+datainfo.idCardFront" class="img" v-if="datainfo.idCardFront"></image>
|
|
|
+ <image :src="cardf" class="img" v-else></image>
|
|
|
+ <view class="tit">拍摄国徽面</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="mb4">
|
|
|
+ <view class="cardtip">身份信息会根据上传的证件照片自动识别,支持手动输入。</view>
|
|
|
+ <view class="cardtip">如果识别错误,可尝试再次拍照。</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <uni-forms-item label="物业小区" name="tenantId">
|
|
|
+ <w-select
|
|
|
+ style="margin-left: 20rpx;"
|
|
|
+ v-model="chooseValue"
|
|
|
+ :list='voList'
|
|
|
+ valueName='dictLabel'
|
|
|
+ keyName="dictValue"
|
|
|
+ :chosevalue="tenantName?tenantName:statusFormats(datainfo.tenantId,voList,'tenant')"
|
|
|
+ :filterable='filterable'
|
|
|
+ @change='getchange'
|
|
|
+ >
|
|
|
+ </w-select>
|
|
|
+ </uni-forms-item>
|
|
|
<uni-forms-item label="人员姓名" name="staffName">
|
|
|
<view class="flexc">
|
|
|
<uni-easyinput :disabled="isdisabled" v-model="datainfo.staffName" :inputBorder='false' placeholder="请输入人员姓名" />
|
|
|
<view class="rimg"><image :src="rimg"></image></view>
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
+ <uni-forms-item label="上传头像" name="facePhoto">
|
|
|
+ <view class="addimgs">
|
|
|
+ <block v-if="datainfo.avatarPhoto">
|
|
|
+ <view class="assimg" @click="getPreview(datainfo.avatarPhoto)">
|
|
|
+ <image :src="baseUrl+datainfo.avatarPhoto" class="img"></image>
|
|
|
+ <image :src="rdelimg" class="delimg" @click.stop="getDelFn()"></image>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ <view class="addbox" @click="getaddImagea('avatar')">
|
|
|
+ <image :src="aphoto"></image>
|
|
|
+ <view>添加图片</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-forms-item>
|
|
|
<uni-forms-item label="人员性别" name="gender">
|
|
|
<view class="flexc">
|
|
|
<view class="flex1"></view>
|
|
@@ -69,12 +115,16 @@
|
|
|
|
|
|
<script>
|
|
|
import config from '@/config'
|
|
|
+ const userType=config.userType;
|
|
|
import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
|
|
|
- import {staffAdd,staffPut,staffDet} from "@/api/work/people.js"
|
|
|
+ import {staffAdd,staffPut,staffDet,staffAddgly,staffrzDet,staffPutgly} from "@/api/work/people.js"
|
|
|
import {getDictionaryFn} from "@/api/system/user.js"
|
|
|
- import {selectValueKey} from "@/utils/common.js"
|
|
|
+ import {selectValueKey,uploadIdentify} from "@/utils/common.js"
|
|
|
+ import wSelect from "@/people/components/w-select/w-select.vue"
|
|
|
+ import {gettenantList} from "@/api/login.js"
|
|
|
+ import {getOcrIdCard} from "@/api/system/card.js"
|
|
|
export default {
|
|
|
- components: {},
|
|
|
+ components: {wSelect},
|
|
|
data() {
|
|
|
return {
|
|
|
line: require('@/car/static/car/line.png'),
|
|
@@ -83,6 +133,10 @@
|
|
|
aphoto: require('@/people/static/people/aphoto.png'),
|
|
|
check: require('@/people/static/people/check.png'),
|
|
|
ncheck: require('@/people/static/people/ncheck.png'),
|
|
|
+ cardz:require('@/health/static/health/cardz.png'),
|
|
|
+ cardf:require('@/health/static/health/cardf.png'),
|
|
|
+ aphoto: require('@/service/static/service/photo.png'),
|
|
|
+ rdelimg: require('@/service/static/service/rdel.png'),
|
|
|
baseUrl: config.baseUrl,
|
|
|
checkflag:true,
|
|
|
datainfo: {
|
|
@@ -93,10 +147,12 @@
|
|
|
"staffCategory":"",//员工类别,1:保安 2:维修人员 3:物业管理
|
|
|
"maintenanceCategory":"",//维修分类
|
|
|
"phoneNumber":"",//手机号码
|
|
|
- // "avatarPhoto":"",//头像
|
|
|
+ "tenantId":"",//租户id
|
|
|
+ "avatarPhoto":"",//头像
|
|
|
"idCard":"",//身份证号码
|
|
|
- // "idCardFront":"",//身份证正面
|
|
|
- // "idCardBack":"",//身份证反面
|
|
|
+ // "examine":'',//审核状态 1:未审核 2:审核通过 3:审核未通过
|
|
|
+ "idCardFront":"",//身份证正面,国徽面
|
|
|
+ "idCardBack":"",//身份证反面,人像面
|
|
|
// "certificate":"",//相关证件
|
|
|
},
|
|
|
rules: {
|
|
@@ -116,10 +172,26 @@
|
|
|
id:'',
|
|
|
ptype:'add',
|
|
|
isdisabled:false,
|
|
|
+ rzflag:false,
|
|
|
+ tenantName:'',
|
|
|
+ chooseValue:'',
|
|
|
+ voList:[],
|
|
|
+ filterable:true,
|
|
|
+ rztype:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(e) {
|
|
|
this.init()
|
|
|
+ // 认证过来的,需要审核
|
|
|
+ if(e.type){
|
|
|
+ this.rztype=e.type
|
|
|
+ this.rzflag=true;
|
|
|
+ this.datainfo.phoneNumber=this.$store.state.user.phonenumber;
|
|
|
+ this.datainfo.userId=this.$store.state.user.userId;
|
|
|
+ var userId=this.$store.state.user.userId;
|
|
|
+ this.staffrzDet(userId)
|
|
|
+ }
|
|
|
+ this.gettenantList();
|
|
|
if(e.id){
|
|
|
this.id=e.id;
|
|
|
this.ptype='edit';
|
|
@@ -139,9 +211,29 @@
|
|
|
this.yglbidx=aite.key
|
|
|
}else if(type=='vxlb'){
|
|
|
this.vxlbidx=aite.key;
|
|
|
+ }else if(type=='tenant'){
|
|
|
+ this.tenantName=aite.actions
|
|
|
}
|
|
|
return aite.actions;
|
|
|
},
|
|
|
+ // 获取租户列表
|
|
|
+ gettenantList(){
|
|
|
+ gettenantList().then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ if(res.data.voList&&res.data.voList.length){
|
|
|
+ this.voList = res.data.voList.map(v => {
|
|
|
+ return {
|
|
|
+ dictLabel: v.companyName,
|
|
|
+ dictValue: v.tenantId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.$toast(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
init(){
|
|
|
// 员工类别
|
|
|
getDictionaryFn('yaungong').then(res=>{
|
|
@@ -177,6 +269,14 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getchange(e){
|
|
|
+ console.log(e)
|
|
|
+ this.datainfo.tenantId=e.dictValue;
|
|
|
+ // this.datainfo.houseAddress=e.dictLabel;
|
|
|
+ // if(this.tabval=='1'){
|
|
|
+ // this.datainfo.detailAddress=e.location;
|
|
|
+ // }
|
|
|
+ },
|
|
|
bindDateChange(e){
|
|
|
var val=e.detail.value;
|
|
|
var vala=this.yglbList[val].dictValue;
|
|
@@ -213,33 +313,74 @@
|
|
|
return
|
|
|
}
|
|
|
if(this.ptype=='add'){
|
|
|
- staffAdd(params).then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.$toast("新增成功")
|
|
|
- setTimeout(function(){
|
|
|
- uni.$emit("refStaffList")
|
|
|
- uni.navigateBack({
|
|
|
- delta:1
|
|
|
- })
|
|
|
- },1500)
|
|
|
- }
|
|
|
- })
|
|
|
+ if(this.rzflag){
|
|
|
+ staffAdd(params).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$toast("新增成功,请等待审核")
|
|
|
+ setTimeout(function(){
|
|
|
+ uni.$emit("refStaffList")
|
|
|
+ var initFace='N';
|
|
|
+ that.$store.dispatch('checkInitFace', initFace).then(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ },1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // params.examine=2;
|
|
|
+ params.userType=userType;
|
|
|
+ staffAddgly(params).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$toast("新增成功")
|
|
|
+ setTimeout(function(){
|
|
|
+ uni.$emit("refStaffList")
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ },1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}else{
|
|
|
- staffPut(params).then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.$toast("修改成功")
|
|
|
- setTimeout(function(){
|
|
|
- uni.$emit("refStaffList")
|
|
|
- uni.navigateBack({
|
|
|
- delta:1
|
|
|
- })
|
|
|
- },1500)
|
|
|
- }
|
|
|
- })
|
|
|
+ if(this.rzflag){
|
|
|
+ staffPut(params).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$toast("修改成功")
|
|
|
+ setTimeout(function(){
|
|
|
+ uni.$emit("refStaffList")
|
|
|
+ var initFace='N';
|
|
|
+ that.$store.dispatch('checkInitFace', initFace).then(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ },1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 管理员修改
|
|
|
+ staffPutgly(params).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$toast("修改成功")
|
|
|
+ setTimeout(function(){
|
|
|
+ uni.$emit("refStaffList")
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ },1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+ // 员工信息详情
|
|
|
getDetailFn(){
|
|
|
staffDet(this.id).then(res=>{
|
|
|
if(res.code==200){
|
|
@@ -247,60 +388,94 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // getaddImage(e) {
|
|
|
- // let that = this;
|
|
|
- // let file = [],
|
|
|
- // count = 9
|
|
|
- // uni.chooseImage({
|
|
|
- // count: 1,
|
|
|
- // success: function(res) {
|
|
|
- // let img = res.tempFilePaths;
|
|
|
- // if (img.length + file.length > count) {
|
|
|
- // uni.showToast({
|
|
|
- // title: '最多上传' + count + '张图片',
|
|
|
- // icon: 'none',
|
|
|
- // duration: 2000
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // let imglen = res.tempFilePaths.length;
|
|
|
- // var fuwufile = [];
|
|
|
- // uploadIdentify('/common/upload', img, 0, 0, 0, imglen, fuwufile, function(rs) {
|
|
|
- // var resurl = rs[0];
|
|
|
- // if (e == 'front') {
|
|
|
- // that.datainfo.front = resurl.fileName;
|
|
|
- // } else {
|
|
|
- // that.datainfo.back = resurl.fileName;
|
|
|
- // }
|
|
|
- // if (rs && rs.length > 0) {
|
|
|
- // var obj = {
|
|
|
- // type: e,
|
|
|
- // url: resurl.urlOnline
|
|
|
- // }
|
|
|
- // that.getOcrIdCard(obj)
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
- // getOcrIdCard(obj) {
|
|
|
- // var params = {
|
|
|
- // image: obj.url,
|
|
|
- // idCardSide: obj.type
|
|
|
- // }
|
|
|
- // getOcrIdCard(params).then(res => {
|
|
|
- // if (res.code == 200) {
|
|
|
- // var datainfo = res.data;
|
|
|
- // if (obj.type == 'front') {
|
|
|
- // this.datainfo.realName = datainfo.realName;
|
|
|
- // this.datainfo.idCard = datainfo.idCard;
|
|
|
- // this.datainfo.address = datainfo.address;
|
|
|
- // } else {
|
|
|
- // this.datainfo.expirationDate = datainfo.expirationDate
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
+ // 认证信息详情 ,admin,首页切换到幸福里,修改
|
|
|
+ staffrzDet(id){
|
|
|
+ staffrzDet(id).then(res=>{
|
|
|
+ if(res.code==200&&res.data){
|
|
|
+ if(this.rztype=='rzadd'){
|
|
|
+ // this.datainfo=res.data.filter()
|
|
|
+ }else{
|
|
|
+ this.ptype='edit';
|
|
|
+ this.datainfo=res.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 头像
|
|
|
+ getPreview(url) {
|
|
|
+ var newArr=[];
|
|
|
+ var ds=this.baseUrl+url
|
|
|
+ newArr.push(ds)
|
|
|
+ uni.previewImage({
|
|
|
+ urls: newArr,
|
|
|
+ current:0,
|
|
|
+ success: function(data) {},
|
|
|
+ fail: function(err) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getDelFn(){
|
|
|
+ var that=this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '确认删除',
|
|
|
+ content: "是否确认删除",
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确认',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.datainfo.avatarPhoto=''
|
|
|
+ } else if (res.cancel) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getaddImagea(e) {
|
|
|
+ let that = this;
|
|
|
+ let file = []
|
|
|
+ uni.chooseImage({
|
|
|
+ count: 1,
|
|
|
+ success: function(res) {
|
|
|
+ let img = res.tempFilePaths;
|
|
|
+ let imglen = res.tempFilePaths.length;
|
|
|
+ var fuwufile = [];
|
|
|
+ uploadIdentify('/common/upload', img, 0, 0, 0, imglen, fuwufile, function(rs) {
|
|
|
+ var resurl = rs[0];
|
|
|
+ console.log(resurl)
|
|
|
+ if (e == 'front') {
|
|
|
+ that.datainfo.idCardBack = resurl.fileName;
|
|
|
+ if (rs && rs.length > 0) {
|
|
|
+ var obj = {
|
|
|
+ type: e,
|
|
|
+ url: resurl.urlOnline
|
|
|
+ }
|
|
|
+ that.getOcrIdCard(obj)
|
|
|
+ }
|
|
|
+ } else if(e=='back') {
|
|
|
+ that.datainfo.idCardFront = resurl.fileName;
|
|
|
+ }else if(e=='avatar'){
|
|
|
+ that.datainfo.avatarPhoto = resurl.fileName;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getOcrIdCard(obj) {
|
|
|
+ var params = {
|
|
|
+ image: obj.url,
|
|
|
+ idCardSide: obj.type
|
|
|
+ }
|
|
|
+ getOcrIdCard(params).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ var datainfo = res.data;
|
|
|
+ if (obj.type == 'front') {
|
|
|
+ this.datainfo.staffName = datainfo.realName;
|
|
|
+ this.datainfo.idCard = datainfo.idCard;
|
|
|
+ // this.datainfo.idCardAddress = datainfo.address;
|
|
|
+ // } else {
|
|
|
+ // this.datainfo.expirationDate = datainfo.expirationDate
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -308,6 +483,7 @@
|
|
|
page{background: #F3F3F0;}
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
+.check /deep/ .select-wrap{border: none;width: 100%;}
|
|
|
.check /deep/ .uni-forms-item__error{left:auto;right: 0;margin-top: 10rpx;z-index: 1;}
|
|
|
.check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
|
|
|
.check .cbox /deep/ .uni-forms-item:last-child{border: none;}
|
|
@@ -343,4 +519,30 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+.rztit{font-weight: bold;font-size: 30rpx;color: #222327;margin-bottom: 30rpx;}
|
|
|
+ .carbox{width: 300rpx;border-radius: 14rpx;overflow: hidden;
|
|
|
+ .img{width: 300rpx;height: 208rpx;}
|
|
|
+ .tit{width: 100%;height: 56rpx;background: #7CC2A8;text-align: center;font-weight: 500;
|
|
|
+font-size: 26rpx;line-height: 56rpx;
|
|
|
+color: #FFFFFF;}
|
|
|
+ }
|
|
|
+ .cardtip{font-weight: 500;font-size: 24rpx;color: #999999;line-height: 40rpx;}
|
|
|
+.addimgs{display: flex;align-items: center;flex-wrap: wrap;justify-content: flex-end;
|
|
|
+
|
|
|
+ .assimg{width: 128rpx;height: 128rpx;position: relative;overflow: hidden;margin: 0 0 20rpx 24rpx;
|
|
|
+ .img{width: 100%;height: 100%;}
|
|
|
+ .delimg{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
|
|
|
+ }
|
|
|
+}
|
|
|
+.addimgs{display: flex;align-items: center;flex-wrap: wrap;justify-content: flex-end;
|
|
|
+
|
|
|
+ .assimg{width: 128rpx;height: 128rpx;position: relative;overflow: hidden;margin: 0 0 20rpx 24rpx;
|
|
|
+ .img{width: 100%;height: 100%;}
|
|
|
+ .delimg{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
|
|
|
+ }
|
|
|
+}
|
|
|
+.addbox{width: 160rpx;height: 128rpx;background: #F0F0F0;border-radius: 20rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;margin-left: 24rpx;flex: 0 0 auto;
|
|
|
+ image{width: 48rpx;height: 42rpx;margin-bottom: 12rpx;}
|
|
|
+ view{font-weight: 500;font-size: 24rpx;color: #666666;}
|
|
|
+ }
|
|
|
</style>
|