fix: 修改组织架构员工状态修改无效,员工编辑字段显示不全,密码修改等问题

feature/permission-0723-ch
ch 2 years ago
parent d657ae845f
commit 7f2ec0b94b

@ -66,13 +66,14 @@ const actions = {
return res;
},
enable: async ({ dispatch }, data) => {
const statusStr = data.isEnable ? '启用' : '禁用';
try {
await ElMessageBox.confirm('确定要禁用该组织吗?', '危险操作');
await ElMessageBox.confirm(`确定要${statusStr}该组织吗?`, '危险操作');
let res = await api.update(data);
if (res) {
ElMessage.success((data.isEnable ? '启用' : '禁用') + '成功');
ElMessage.success(statusStr + '成功');
} else {
ElMessage.error((data.isEnable ? '启用' : '禁用') + '失败');
ElMessage.error(statusStr + '失败');
}
} catch (e) {
console.info('取消删除', e);

@ -62,6 +62,9 @@ const actions = {
if (!data.id) {
data.id = res;
}
if (!data.roleIds) {
return false;
}
res = await api.savePermission(data.id, { roleIds: data.roleIds });
if (res) {
ElMessage.success('保存成功');

@ -292,7 +292,9 @@
label: '状态',
width: 160,
slots: {
default: ({ row }) => <ElSwitch v-model={row.isEnable} />,
default: ({ row }) => (
<ElSwitch v-model={row.isEnable} onClick={() => handleEmployeeEnabled(row)} />
),
},
},
{
@ -423,6 +425,13 @@
const handleEnabled = (row) => {
store.dispatch('dept/enable', row);
};
const handleEmployeeEnabled = (row) => {
const data = {
id: row.id,
isEnable: row.isEnable,
};
store.dispatch('employee/save', data);
};
const handleDelete = (row) => {
store.dispatch('dept/remove', [row.id]);
};

@ -86,11 +86,11 @@
</template>
</el-dialog>
</el-form-item>
<el-form-item>
<el-button @click="handleCancel"></el-button>
<el-button :disabled="loading" :loading="submitting" type="primary" @click="handleSave"></el-button>
</el-form-item>
</el-form>
<div class="form-footer">
<el-button @click="handleCancel"></el-button>
<el-button :disabled="loading" :loading="submitting" type="primary" @click="handleSave"></el-button>
</div>
</div>
</template>
@ -152,6 +152,9 @@
try {
await proxy.$validate(refsForm);
let data = { ...unref(form) };
if (!data.password) {
delete data.password;
}
data.voucherClueUrls = data.voucherClueUrls || [];
data.voucherClueUrl = data.voucherClueUrls.join(',');
let res = await store.dispatch('employee/save', data);
@ -216,6 +219,8 @@
<style lang="less" scoped>
.form-container {
flex-direction: row-reverse !important;
align-items: flex-start !important;
.el-form {
width: 480px;
}

Loading…
Cancel
Save