|
@@ -27,8 +27,8 @@
|
|
|
</evanForm>
|
|
|
</view>
|
|
|
<view class="form-footer-btn flex align_center justify_center">
|
|
|
- <u-button shape="circle" v-if="isEdit&&formData.isManager==0" @click="delPerson()" :custom-style="{width:'300rpx',marginRight:'20rpx' }">删除</u-button>
|
|
|
- <u-button shape="circle" type="info" :custom-style="{ background: '#066cff', color: '#fff',width:'300rpx' }" @click="save('formData')">保存</u-button>
|
|
|
+ <u-button shape="circle" :disabled="loading" v-if="isEdit&&formData.isManager==0" @click="delPerson()" :custom-style="{width:'300rpx',marginRight:'20rpx' }">删除</u-button>
|
|
|
+ <u-button shape="circle" :disabled="loading" type="info" :custom-style="{ background: '#066cff', color: '#fff',width:'300rpx' }" @click="save('formData')">保存</u-button>
|
|
|
</view>
|
|
|
<u-popup v-model="showRoles" mode="bottom">
|
|
|
<view style="width: 100%;">
|
|
@@ -69,6 +69,7 @@
|
|
|
},
|
|
|
data(){
|
|
|
return{
|
|
|
+ loading: false,
|
|
|
showRoles: false,
|
|
|
roleList: [], // 角色 数据列表
|
|
|
roleArr: [], // 当前所选角色
|
|
@@ -161,14 +162,17 @@
|
|
|
if(!this.formData.roleNames && this.formData.isManager==0){
|
|
|
uni.showToast({icon: 'none', title: '请选择岗位'})
|
|
|
}else{
|
|
|
+ this.loading = true
|
|
|
+ uni.showLoading({title:'正在保存...'})
|
|
|
saveEmployee(data).then(res=>{
|
|
|
- console.log(res)
|
|
|
+ uni.hideLoading()
|
|
|
if(res.status == 200){
|
|
|
uni.showToast({icon: 'none', title:'保存成功'})
|
|
|
this.cancel()
|
|
|
}else{
|
|
|
uni.showToast({icon: 'none', title: res.message})
|
|
|
}
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -183,11 +187,15 @@
|
|
|
content: '数据删除后无法恢复, 确认删除吗?',
|
|
|
success: (ret) => {
|
|
|
if(ret.confirm||ret.index==0){
|
|
|
+ _this.loading = true
|
|
|
+ uni.showLoading({title:'正在删除...'})
|
|
|
// 删除数据
|
|
|
delEmployee({id: item.id}).then(res=>{
|
|
|
+ uni.hideLoading()
|
|
|
if(res.status == 200){
|
|
|
this.cancel()
|
|
|
}
|
|
|
+ _this.loading = false
|
|
|
uni.showToast({icon: 'none', title: res.message})
|
|
|
})
|
|
|
}
|