[update] 53537

This commit is contained in:
zhaomeijing
2022-06-06 18:57:23 +08:00
parent d70d77d0bf
commit b53511422a
+58 -57
View File
@@ -172,10 +172,10 @@
<depart-window ref="departWindow" @ok="modalFormOk"></depart-window>
<div class="drawer-bootom-button" v-show="!disableSubmit">
<a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"
:cancelText="$t('cancel')">
<a-button style="margin-right: .8rem">{{$t('cancel')}}</a-button>
</a-popconfirm>
<!-- <a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"-->
<!-- :cancelText="$t('cancel')">-->
<a-button style="margin-right: .8rem" @click="handleSubmit">{{$t('cancel')}}</a-button>
<!-- </a-popconfirm>-->
<!-- <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>-->
</div>
</a-drawer>
@@ -457,59 +457,60 @@
},
moment,
handleSubmit() {
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true
if (!values.birthday) {
values.birthday = ''
} else {
values.birthday = values.birthday.format(this.dateFormat)
}
let formData = Object.assign(this.model, values)
if (that.fileList != '') {
formData.avatar = that.fileList
} else {
formData.avatar = null
}
//update-begin-author:taoyan date:2020710 for:多租户配置
formData.relTenantIds = this.currentTenant.length > 0 ? this.currentTenant.join(',') : ''
//update-end-author:taoyan date:2020710 for:多租户配置
formData.selectedroles = this.selectedRole.length > 0 ? this.selectedRole.join(',') : ''
formData.selecteddeparts = this.userDepartModel.departIdList.length > 0 ? this.userDepartModel.departIdList.join(',') : ''
formData.userIdentity = this.identity
//如果是上级择传入departIds,否则为空
if (this.identity === '2') {
formData.departIds = this.departIds.join(',')
} else {
formData.departIds = ''
}
// that.addDepartsToUser(that,formData); // 调用根据当前用户添加部门信息的方法
let obj
if (!this.model.id) {
formData.id = this.userId
obj = addUser(formData)
} else {
obj = editUser(formData)
}
obj.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
that.checkedDepartNames = []
that.userDepartModel.departIdList = { userId: '', departIdList: [] }
that.close()
})
}
})
this.close()
// this.confirmLoading = false
// const that = this
// // 触发表单验证
// this.form.validateFields((err, values) => {
// if (!err) {
// that.confirmLoading = true
// if (!values.birthday) {
// values.birthday = ''
// } else {
// values.birthday = values.birthday.format(this.dateFormat)
// }
// let formData = Object.assign(this.model, values)
// if (that.fileList != '') {
// formData.avatar = that.fileList
// } else {
// formData.avatar = null
// }
// //update-begin-author:taoyan date:2020710 for:多租户配置
// formData.relTenantIds = this.currentTenant.length > 0 ? this.currentTenant.join(',') : ''
// //update-end-author:taoyan date:2020710 for:多租户配置
// formData.selectedroles = this.selectedRole.length > 0 ? this.selectedRole.join(',') : ''
// formData.selecteddeparts = this.userDepartModel.departIdList.length > 0 ? this.userDepartModel.departIdList.join(',') : ''
// formData.userIdentity = this.identity
// //如果是上级择传入departIds,否则为空
// if (this.identity === '2') {
// formData.departIds = this.departIds.join(',')
// } else {
// formData.departIds = ''
// }
// // that.addDepartsToUser(that,formData); // 调用根据当前用户添加部门信息的方法
// let obj
// if (!this.model.id) {
// formData.id = this.userId
// obj = addUser(formData)
// } else {
// obj = editUser(formData)
// }
// obj.then((res) => {
// if (res.success) {
// that.$message.success(res.message)
// that.$emit('ok')
// } else {
// that.$message.warning(res.message)
// }
// }).finally(() => {
// that.confirmLoading = false
// that.checkedDepartNames = []
// that.userDepartModel.departIdList = { userId: '', departIdList: [] }
// that.close()
// })
//
// }
// })
},
handleCancel() {
this.close()