feat: Update HR employee synchronization functionality; add sync button and improve user feedback

This commit is contained in:
Ling 2025-10-09 16:38:41 +08:00
parent 5e4960c96d
commit e9725b4674
4 changed files with 60 additions and 51 deletions

View File

@ -15,7 +15,7 @@ if (process.env.NODE_ENV == 'development') {
axios.defaults.baseURL = 'http://localhost:9991/' axios.defaults.baseURL = 'http://localhost:9991/'
} else if (process.env.NODE_ENV == 'production') { } 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('/')) { if (!axios.defaults.baseURL.endsWith('/')) {
axios.defaults.baseURL += '/' axios.defaults.baseURL += '/'

View File

@ -20,6 +20,39 @@ let extension = {
tableAction: '', //(,) tableAction: '', //(,)
buttons: { view: [], box: [], detail: [] }, // buttons: { view: [], box: [], detail: [] }, //
methods: { 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() { // onInit() { //
this.buttons.unshift({ 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() { onInited() {

View File

@ -33,7 +33,7 @@ let extension = {
render: (h, { row, column, index }) => { render: (h, { row, column, index }) => {
return ( return (
<div> <div>
<el-buton <el-button
style="color:#2882df;font-size:12px;" style="color:#2882df;font-size:12px;"
onClick={() => { onClick={() => {
this.edit(row); this.edit(row);
@ -41,8 +41,8 @@ let extension = {
type="text" type="text"
> >
编辑 编辑
</el-buton> </el-button>
<el-buton <el-button
style="color:#2882df;font-size:12px;margin-left:10px;" style="color:#2882df;font-size:12px;margin-left:10px;"
onClick={() => { onClick={() => {
this.request('Run', row, 'once'); this.request('Run', row, 'once');
@ -50,8 +50,8 @@ let extension = {
type="text" type="text"
> >
执行一次 执行一次
</el-buton> </el-button>
<el-buton <el-button
style="color:#2882df;font-size:12px;margin-left:10px;" style="color:#2882df;font-size:12px;margin-left:10px;"
onClick={() => { onClick={() => {
if (row.Status == 1) { if (row.Status == 1) {
@ -64,8 +64,8 @@ let extension = {
type="text" type="text"
> >
{row.Status == 1 ? '恢复' : '暂停'} {row.Status == 1 ? '恢复' : '暂停'}
</el-buton> </el-button>
<el-buton <el-button
style="color:#2882df;font-size:12px;margin-left:10px;" style="color:#2882df;font-size:12px;margin-left:10px;"
onClick={() => { onClick={() => {
this.$store.getters.data().quartzId = row.Id; this.$store.getters.data().quartzId = row.Id;
@ -74,7 +74,7 @@ let extension = {
type="text" type="text"
> >
日志 日志
</el-buton> </el-button>
</div> </div>
); );
} }

View File

@ -26,50 +26,9 @@ const { table, editFormFields, editFormOptions, searchFormFields, searchFormOpti
let gridRef; 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) => { const onInit = async ($vm) => {
gridRef = $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 () => { const onInited = async () => {