feat: Update HR employee synchronization functionality; add sync button and improve user feedback
This commit is contained in:
parent
5e4960c96d
commit
e9725b4674
|
@ -15,7 +15,7 @@ if (process.env.NODE_ENV == 'development') {
|
|||
axios.defaults.baseURL = 'http://localhost:9991/'
|
||||
} else if (process.env.NODE_ENV == 'production') {
|
||||
//部署的后台接口地址
|
||||
axios.defaults.baseURL = 'http://api.volcore.xyz/'
|
||||
axios.defaults.baseURL = 'http://localhost:9991/'
|
||||
}
|
||||
if (!axios.defaults.baseURL.endsWith('/')) {
|
||||
axios.defaults.baseURL += '/'
|
||||
|
|
|
@ -20,6 +20,39 @@ let extension = {
|
|||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
|
||||
|
||||
//同步这个用户
|
||||
syncThis(row){
|
||||
this.$confirm('是否同步该用户?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
// this.http.post(url, {}, '生成关联关系中').then((reslut) => {
|
||||
// this.$Message.success('生成完成,请点击查询进行刷新');
|
||||
// this.search();
|
||||
// });
|
||||
//点击确定
|
||||
const res = await this.http.post('api/HR_EmployeeSync/SyncYSEmpToDingTalk', row.EmpYSID,'正在同步信息...');
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '同步成功!'
|
||||
});
|
||||
// gridRef.load();
|
||||
this.search();
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
//取消操作
|
||||
});
|
||||
},
|
||||
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() { //框架初始化配置前,
|
||||
this.buttons.unshift({
|
||||
|
@ -37,6 +70,23 @@ let extension = {
|
|||
}
|
||||
});
|
||||
|
||||
this.columns.push({
|
||||
title: '操作', //按钮名称
|
||||
field: '操作',
|
||||
align: 'center',
|
||||
width: 70,
|
||||
fixed: 'right',
|
||||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button
|
||||
onClick={($e) => { this.syncThis(row) }}
|
||||
type="primary" link>同步这个用户</el-button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
onInited() {
|
||||
|
|
|
@ -33,7 +33,7 @@ let extension = {
|
|||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
<el-buton
|
||||
<el-button
|
||||
style="color:#2882df;font-size:12px;"
|
||||
onClick={() => {
|
||||
this.edit(row);
|
||||
|
@ -41,8 +41,8 @@ let extension = {
|
|||
type="text"
|
||||
>
|
||||
编辑
|
||||
</el-buton>
|
||||
<el-buton
|
||||
</el-button>
|
||||
<el-button
|
||||
style="color:#2882df;font-size:12px;margin-left:10px;"
|
||||
onClick={() => {
|
||||
this.request('Run', row, 'once');
|
||||
|
@ -50,8 +50,8 @@ let extension = {
|
|||
type="text"
|
||||
>
|
||||
执行一次
|
||||
</el-buton>
|
||||
<el-buton
|
||||
</el-button>
|
||||
<el-button
|
||||
style="color:#2882df;font-size:12px;margin-left:10px;"
|
||||
onClick={() => {
|
||||
if (row.Status == 1) {
|
||||
|
@ -64,8 +64,8 @@ let extension = {
|
|||
type="text"
|
||||
>
|
||||
{row.Status == 1 ? '恢复' : '暂停'}
|
||||
</el-buton>
|
||||
<el-buton
|
||||
</el-button>
|
||||
<el-button
|
||||
style="color:#2882df;font-size:12px;margin-left:10px;"
|
||||
onClick={() => {
|
||||
this.$store.getters.data().quartzId = row.Id;
|
||||
|
@ -74,7 +74,7 @@ let extension = {
|
|||
type="text"
|
||||
>
|
||||
日志
|
||||
</el-buton>
|
||||
</el-button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -26,50 +26,9 @@ const { table, editFormFields, editFormOptions, searchFormFields, searchFormOpti
|
|||
|
||||
let gridRef;
|
||||
|
||||
//同步这个用户
|
||||
const syncThis = async (row) => {
|
||||
proxy.$confirm('是否同步该用户?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
//点击确定
|
||||
const res = await proxy.http.post('api/HR_EmployeeSync/SyncYSEmpToDingTalk', row.EmpYSID,'正在同步信息...');
|
||||
if (res.success) {
|
||||
proxy.$message({
|
||||
type: 'success',
|
||||
message: '同步成功!'
|
||||
});
|
||||
gridRef.load();
|
||||
} else {
|
||||
proxy.$message({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
//取消操作
|
||||
});
|
||||
}
|
||||
const onInit = async ($vm) => {
|
||||
gridRef = $vm;
|
||||
//最后添加一行保存按钮
|
||||
columns.push({
|
||||
title: '操作', //按钮名称
|
||||
field: '操作',
|
||||
align: 'center',
|
||||
width: 70,
|
||||
fixed: 'right',
|
||||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button
|
||||
onClick={($e) => { syncThis(row) }}
|
||||
type="primary" link>同步这个用户</el-button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
|
|
Loading…
Reference in New Issue