Merge branch 'liys_dev' into fenquan
# Conflicts: # pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js # pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js # pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js # pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js # pc4mobx/hrmSalary/pages/salaryFile/index.js
This commit is contained in:
commit
fc16f570b8
|
|
@ -1,236 +1,286 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import { WeaTools } from "ecCom";
|
||||
|
||||
//数据采集-考勤引用-考勤数据列表
|
||||
export const getAttendanceList = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const checkOperation = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/checkOperation", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
//数据采集-考勤引用-考勤数据列表
|
||||
export const getAttendanceList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤数据-获取导入参数
|
||||
export const getImportAttendanceParam = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getImportParams', 'get', params);
|
||||
}
|
||||
export const getImportAttendanceParam = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/getImportParams",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-获取账套列表
|
||||
export const getLedgerList = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/selectSalarySobList', 'get', params);
|
||||
}
|
||||
export const getLedgerList = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/selectSalarySobList",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-获取引用考勤表单
|
||||
export const getAttendanceReferForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getSyncForm', 'get', params);
|
||||
}
|
||||
export const getAttendanceReferForm = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/getSyncForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-获取引用考勤表单周期数据
|
||||
export const getAttendanceReferPeriod = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle', 'post', params);
|
||||
}
|
||||
export const getAttendanceReferPeriod = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle",
|
||||
"post",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-同步引用考勤数据
|
||||
export const syncAttendanceRefer = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/syncAttendQuoteData', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const syncAttendanceRefer = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/syncAttendQuoteData", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-查看考勤数据
|
||||
export const getAttendanceDetail = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/view', 'get', params);
|
||||
}
|
||||
export const getAttendanceDetail = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/view", "get", params);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-删除考勤数据
|
||||
export const deleteAttendance = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/delete', 'POST', params);
|
||||
}
|
||||
export const deleteAttendance = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/delete",
|
||||
"POST",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-导出考勤数据
|
||||
export const exportAttendance = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/export', 'POST', params);
|
||||
}
|
||||
export const exportAttendance = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/export",
|
||||
"POST",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集- 考勤应用-导出模版+全量数据
|
||||
export const exportForTemplate = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/exportForTemplate', 'POST', params);
|
||||
}
|
||||
export const exportForTemplate = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/exportForTemplate",
|
||||
"POST",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤字段管理列表
|
||||
export const getAttendanceFieldList = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/fieldList', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
export const getAttendanceFieldList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/fieldList", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-获取考勤字段表单
|
||||
export const getAttendanceFieldForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getFieldForm', 'get', params);
|
||||
}
|
||||
export const getAttendanceFieldForm = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/getFieldForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-新建考勤字段
|
||||
export const saveAttendanceField = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/saveField', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const saveAttendanceField = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/saveField", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-修改考勤字段
|
||||
export const updateAttendanceField = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/updateField', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const updateAttendanceField = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/updateField", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-启用/停用自定义字段
|
||||
export const updateAttendanceFieldStatus = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/updateEnableStatus', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const updateAttendanceFieldStatus = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/updateEnableStatus", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-删除考勤字段
|
||||
export const deleteAttendanceField = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/deleteField', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
export const deleteAttendanceField = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/deleteField", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤引用字段设置-列表
|
||||
export const getAttendanceFieldSettingList = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const getAttendanceFieldSettingList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤引用字段设置-保存
|
||||
export const saveAttendanceFieldSetting = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/save', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const saveAttendanceFieldSetting = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/save", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
//数据采集-考勤引用-考勤引用字段设置-恢复默认设置
|
||||
export const returnToAttendanceFieldSettingDefault = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const returnToAttendanceFieldSettingDefault = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤引用字段设置-设为默认设置
|
||||
export const saveAttendanceFieldSettingAsDefault = params => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
export const saveAttendanceFieldSettingAsDefault = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 考勤导入模板下载
|
||||
export const downloadTemplate = (salaryYearMonth, salarySobId) => {
|
||||
// /api/bs/hrmsalary/attendQuote/downloadTemplate
|
||||
fetch('/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=' + salaryYearMonth + "&salarySobId=" + salarySobId).then(res => res.blob().then(blob => {
|
||||
var filename=`考勤导入模板.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
// /api/bs/hrmsalary/attendQuote/downloadTemplate
|
||||
fetch(
|
||||
"/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=" +
|
||||
salaryYearMonth +
|
||||
"&salarySobId=" +
|
||||
salarySobId
|
||||
).then((res) =>
|
||||
res.blob().then((blob) => {
|
||||
var filename = `考勤导入模板.xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 考勤导入预览
|
||||
export const previewAttendQuote = (params) => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/preview', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/preview", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 考勤数据导入
|
||||
export const importAttendQuoteData = (params) => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/importAttendQuoteData', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/importAttendQuoteData", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 查看考勤详情
|
||||
// 查看考勤详情
|
||||
export const viewAttendQuote = (ids) => {
|
||||
return fetch('/api/bs/hrmsalary/attendQuote/view', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(ids)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
return fetch("/api/bs/hrmsalary/attendQuote/view", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(ids),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 根据所属月和账套获取周期
|
||||
export const getSalaryCycleAndAttendCycle = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle', 'get', params);
|
||||
|
||||
}
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,85 +1,102 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import { WeaTools } from "ecCom";
|
||||
|
||||
//数据采集-累计专项附加扣除列表
|
||||
export const getCumDeductList = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpDeduction/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const getCumDeductList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpDeduction/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-累计专项附加扣除列表的高级搜索
|
||||
export const getCumDeductSaCondition = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/addUpDeduction/getSearchCondition', 'get', params);
|
||||
}
|
||||
export const getCumDeductSaCondition = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/addUpDeduction/getSearchCondition",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-累计专项附加扣除-导出
|
||||
export const exportCumDeductList = (ids = "") => {
|
||||
fetch('/api/bs/hrmsalary/addUpDeduction/export?ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`累计专项附加扣除.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
fetch("/api/bs/hrmsalary/addUpDeduction/export?ids=" + ids).then((res) =>
|
||||
res.blob().then((blob) => {
|
||||
var filename = `累计专项附加扣除.xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-累计专项附加扣除-获取导入参数
|
||||
export const getImportCumDeductParam = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/addUpDeduction/getImportParams', 'get', params);
|
||||
}
|
||||
export const getImportCumDeductParam = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/addUpDeduction/getImportParams",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-获取累计专项附加扣除记录
|
||||
export const getCumDeductDetailList = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpDeduction/getDetailList', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const getCumDeductDetailList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpDeduction/getDetailList", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-累计专项附加扣除-导出明细
|
||||
export const exportCumDeductDetailList = (id, ids="") => {
|
||||
fetch('/api/bs/hrmsalary/addUpDeduction/exportDetail?accumulatedSpecialAdditionalDeductionId='+id+'&ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`累计专项附加扣除.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
export const exportCumDeductDetailList = (id, ids = "") => {
|
||||
fetch(
|
||||
"/api/bs/hrmsalary/addUpDeduction/exportDetail?accumulatedSpecialAdditionalDeductionId=" +
|
||||
id +
|
||||
"&ids=" +
|
||||
ids
|
||||
).then((res) =>
|
||||
res.blob().then((blob) => {
|
||||
var filename = `累计专项附加扣除.xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 数据采集-获取累计专项附加扣除-导入
|
||||
export const importCumDeductParam = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpDeduction/importAddUpDeduction', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const importCumDeductParam = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpDeduction/importAddUpDeduction", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 数据采集-获取累计专项附加扣除-导入预览
|
||||
export const importCumDeductPreview = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpDeduction/preview', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const importCumDeductPreview = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpDeduction/preview", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,85 +1,102 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import { WeaTools } from "ecCom";
|
||||
|
||||
//数据采集-累计情况列表
|
||||
export const getCumSituationList = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpSituation/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const getCumSituationList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpSituation/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-累计情况列表的高级搜索
|
||||
export const getCumSituationSaCondition = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/addUpSituation/getSearchCondition', 'get', params);
|
||||
}
|
||||
export const getCumSituationSaCondition = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/addUpSituation/getSearchCondition",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-累计情况-导出
|
||||
export const exportCumSituationList = ids => {
|
||||
fetch('/api/bs/hrmsalary/addUpSituation/export?ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`往期累计情况(工资、薪金).xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
export const exportCumSituationList = (ids) => {
|
||||
fetch("/api/bs/hrmsalary/addUpSituation/export?ids=" + ids).then((res) =>
|
||||
res.blob().then((blob) => {
|
||||
var filename = `往期累计情况(工资、薪金).xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-累计情况-获取导入参数
|
||||
export const getImportCumSituationParam = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/addUpSituation/getImportParams', 'get', params);
|
||||
}
|
||||
export const getImportCumSituationParam = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/addUpSituation/getImportParams",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-获取累计情况记录
|
||||
export const getCumSituationDetailList = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpSituation/getDetailList', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const getCumSituationDetailList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpSituation/getDetailList", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-累计情况-导出明细
|
||||
export const exportCumSituationDetailList = (id, ids="") => {
|
||||
fetch('/api/bs/hrmsalary/addUpSituation/exportDetail?accumulatedSituationId='+id+'&ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`往期累计情况(工资、薪金).xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
export const exportCumSituationDetailList = (id, ids = "") => {
|
||||
fetch(
|
||||
"/api/bs/hrmsalary/addUpSituation/exportDetail?accumulatedSituationId=" +
|
||||
id +
|
||||
"&ids=" +
|
||||
ids
|
||||
).then((res) =>
|
||||
res.blob().then((blob) => {
|
||||
var filename = `往期累计情况(工资、薪金).xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 数据采集-累计情况-导入
|
||||
export const importCumSituationParam = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpSituation/importAddUpSituation', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const importCumSituationParam = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpSituation/importAddUpSituation", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 数据采集-累计情况-导入预览
|
||||
export const importCumSituationPreview = params => {
|
||||
return fetch('/api/bs/hrmsalary/addUpSituation/preview', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const importCumSituationPreview = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/addUpSituation/preview", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import { WeaTools } from "ecCom";
|
||||
|
||||
// form基础数据
|
||||
export const getBaseForm = params => {
|
||||
return WeaTools.callApi('/api/demo01/getFormDemo', 'GET', params);
|
||||
export const getBaseForm = (params) => {
|
||||
return WeaTools.callApi("/api/demo01/getFormDemo", "GET", params);
|
||||
};
|
||||
|
||||
// form保存
|
||||
export const doSaveBaseSet = params => {
|
||||
return WeaTools.callApi('/api/demo01/saveFormDemo', 'POST', params);
|
||||
export const doSaveBaseSet = (params) => {
|
||||
return WeaTools.callApi("/api/demo01/saveFormDemo", "POST", params);
|
||||
};
|
||||
|
||||
|
||||
// 获取高级搜索条件
|
||||
export const getCondition = params => {
|
||||
return WeaTools.callApi('/api/demo03/weatableConditonDemo', 'GET', params);
|
||||
export const getCondition = (params) => {
|
||||
return WeaTools.callApi("/api/demo03/weatableConditonDemo", "GET", params);
|
||||
};
|
||||
|
||||
// 获取table数据
|
||||
export const getTableDatas = params => {
|
||||
return WeaTools.callApi('/api/demo03/weatableDemo', 'GET', params);
|
||||
};
|
||||
export const getTableDatas = (params) => {
|
||||
return WeaTools.callApi("/api/demo03/weatableDemo", "GET", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,88 +1,107 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
|
||||
import { WeaTools } from "ecCom";
|
||||
|
||||
//数据采集-其他免税扣除列表
|
||||
export const getOtherDeductList = params => {
|
||||
return fetch('/api/bs/hrmsalary/otherDeduction/list', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const getOtherDeductList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/otherDeduction/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-其他免税扣除列表的高级搜索
|
||||
export const getOtherDeductSaCondition = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/getSearchCondition', 'get', params);
|
||||
}
|
||||
export const getOtherDeductSaCondition = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/otherDeduction/getSearchCondition",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-其他免税扣除-获取导入参数
|
||||
export const getImportOtherDeductParam = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/getImportParams', 'get', params);
|
||||
}
|
||||
export const getImportOtherDeductParam = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/otherDeduction/getImportParams",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-其他免税扣除-导出
|
||||
export const exportOtherDeductList = (ids = "") => {
|
||||
fetch('/api/bs/hrmsalary/otherDeduction/export?ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`其他免税扣除.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/export', 'POST', params);
|
||||
}
|
||||
fetch("/api/bs/hrmsalary/otherDeduction/export?ids=" + ids).then((res) =>
|
||||
res.blob().then((blob) => {
|
||||
var filename = `其他免税扣除.xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
);
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/otherDeduction/export",
|
||||
"POST",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-获取其他免税扣除记录
|
||||
export const getOtherDeductDetailList = params => {
|
||||
return fetch('/api/bs/hrmsalary/otherDeduction/getDetailList', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const getOtherDeductDetailList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/otherDeduction/getDetailList", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
//数据采集-其他免税扣除-导出明细
|
||||
export const exportOtherDeductDetailList = (id, ids) => {
|
||||
fetch('/api/bs/hrmsalary/otherDeduction/exportDetail?otherTaxExemptDeductionId='+id+'&ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`其他免税扣除.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
}))
|
||||
}
|
||||
fetch(
|
||||
"/api/bs/hrmsalary/otherDeduction/exportDetail?otherTaxExemptDeductionId=" +
|
||||
id +
|
||||
"&ids=" +
|
||||
ids
|
||||
).then((res) =>
|
||||
res.blob().then((blob) => {
|
||||
var filename = `其他免税扣除.xlsx`;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 数据采集-其他免税扣除-导入
|
||||
export const importOtherDeductionParam = params => {
|
||||
return fetch('/api/bs/hrmsalary/otherDeduction/importData', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
export const importOtherDeductionParam = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/otherDeduction/importData", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 数据采集-其他免税扣除-导入预览
|
||||
export const importOtherDeductionPreview = params => {
|
||||
return fetch('/api/bs/hrmsalary/otherDeduction/preview', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const importOtherDeductionPreview = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/otherDeduction/preview", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,41 +1,86 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
import { formPost } from '../util/request';
|
||||
|
||||
import { WeaTools } from "ecCom";
|
||||
import { formPost, postFetch } from "../util/request";
|
||||
|
||||
//个税扣缴义务人列表
|
||||
export const getTaxAgentList = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/list', 'GET', params);
|
||||
}
|
||||
export const getTaxAgentList = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/taxAgent/list", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
}).then((res) => res.json());
|
||||
};
|
||||
|
||||
// 系统管理员权限
|
||||
export const getPermission = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/taxAgent/permission",
|
||||
"GET",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//获取个税扣缴义务人表单
|
||||
export const getTaxAgentForm = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/getForm', 'get', params);
|
||||
}
|
||||
export const getTaxAgentForm = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/getForm", "get", params);
|
||||
};
|
||||
|
||||
//获取个税扣缴义务人基础信息表单
|
||||
export const getTaxAgentBaseForm = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/taxAgent/base/getForm",
|
||||
"get",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
||||
//新建个税扣缴义务人
|
||||
export const saveTaxAgent = params => {
|
||||
return formPost('/api/bs/hrmsalary/taxAgent/save', params)
|
||||
// return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/save', 'POST', params);
|
||||
}
|
||||
export const saveTaxAgent = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/save", params);
|
||||
};
|
||||
|
||||
//编辑个税扣缴义务人
|
||||
export const updateTaxAgent = params => {
|
||||
return formPost('/api/bs/hrmsalary/taxAgent/update', params)
|
||||
}
|
||||
export const updateTaxAgent = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/update", params);
|
||||
};
|
||||
//保存个税扣缴义务人基础信息
|
||||
export const taxAgentBaseSave = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/base/save", params);
|
||||
};
|
||||
|
||||
//删除个税扣缴义务人
|
||||
export const deleteTaxAgent = params => {
|
||||
return fetch('/api/bs/hrmsalary/taxAgent/delete', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
export const deleteTaxAgent = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/delete", params);
|
||||
};
|
||||
|
||||
//人员范围保存
|
||||
export const taxAgentRangeSave = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params);
|
||||
};
|
||||
//人员范围删除
|
||||
export const taxAgentRangeDelete = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/delete", params);
|
||||
};
|
||||
//人员范围列表
|
||||
export const getTaxAgentRangeListInclude = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/listInclude", params);
|
||||
};
|
||||
//人员范围排除列表
|
||||
export const getTaxAgentRangeListExclude = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/listExclude", params);
|
||||
};
|
||||
//获取人员范围表单
|
||||
export const getTaxAgentRangeForm = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/getForm", params);
|
||||
};
|
||||
|
||||
//个税扣缴义务人下拉列表
|
||||
export const getTaxAgentSelectList = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/taxAgent/selectList', 'GET', params);
|
||||
}
|
||||
export const getTaxAgentSelectList = (params) => {
|
||||
return WeaTools.callApi(
|
||||
"/api/bs/hrmsalary/taxAgent/selectList",
|
||||
"GET",
|
||||
params
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -50,12 +50,23 @@ export default class RefereAttendFormModal extends React.Component {
|
|||
|
||||
// 同步点击回调
|
||||
handleSync() {
|
||||
const { attendanceStore: {syncAttendanceRefer}} = this.props
|
||||
const { attendanceStore: {syncAttendanceRefer, checkOperation}} = this.props
|
||||
if(!this.validate()) {
|
||||
return
|
||||
}
|
||||
syncAttendanceRefer(this.state.request).then(() => {
|
||||
this.props.onCancel()
|
||||
const { salarySobId, salaryYearMonth:salaryYearMonthStr }=this.state.request
|
||||
const payload={
|
||||
salaryYearMonthStr,
|
||||
salarySobId
|
||||
}
|
||||
checkOperation(payload).then(({status, data, errorMsg})=>{
|
||||
if(status && data){
|
||||
syncAttendanceRefer(this.state.request).then(() => {
|
||||
this.props.onCancel()
|
||||
})
|
||||
}else{
|
||||
message.warning('已经核算过不可操作');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,153 +1,217 @@
|
|||
import React from 'react';
|
||||
import { Row, Col, Table, DatePicker } from "antd"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import { slideColumns} from './columns';
|
||||
import "./editSlideContent.less"
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
import moment from 'moment'
|
||||
import React from "react";
|
||||
import { Row, Col, Table, DatePicker } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import {
|
||||
WeaInput,
|
||||
WeaTextarea,
|
||||
WeaSearchGroup,
|
||||
WeaSelect,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import "./editSlideContent.less";
|
||||
import moment from "moment";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
|
||||
let emptyItem = {
|
||||
incomeLowerLimit: "0.00",
|
||||
incomeUpperLimit: "0.00",
|
||||
dutyFreeValue: "0.00",
|
||||
dutyFreeRate: "0.00",
|
||||
taxableIncomeLl: "0.00",
|
||||
taxableIncomeUl: "0.00",
|
||||
taxRate: "0.00",
|
||||
taxDeduction: "0.00"
|
||||
}
|
||||
incomeLowerLimit: "0.00",
|
||||
incomeUpperLimit: "0.00",
|
||||
dutyFreeValue: "0.00",
|
||||
dutyFreeRate: "0.00",
|
||||
taxableIncomeLl: "0.00",
|
||||
taxableIncomeUl: "0.00",
|
||||
taxRate: "0.00",
|
||||
taxDeduction: "0.00",
|
||||
};
|
||||
|
||||
@inject('cumDeductStore', "taxAgentStore")
|
||||
@inject("cumDeductStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class EditSlideContent extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taxAgentId: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
editable:
|
||||
this.props.editable === undefined ? "true" : this.props.editable,
|
||||
};
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taxAgentId: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
editable: this.props.editable === undefined ? "true": this.props.editable
|
||||
}
|
||||
componentWillMount() {
|
||||
// 初始化渲染页面
|
||||
const {
|
||||
taxAgentStore: { fetchTaxAgentOption },
|
||||
} = this.props;
|
||||
fetchTaxAgentOption();
|
||||
}
|
||||
|
||||
addItem() {
|
||||
const {
|
||||
taxRateStore: { setDataSource },
|
||||
} = this.props;
|
||||
let dataSource = [...this.props.taxRateStore.dataSource];
|
||||
let indexNum = 1;
|
||||
if (dataSource.length > 0) {
|
||||
indexNum = dataSource[dataSource.length - 1].indexNum + 1;
|
||||
}
|
||||
let item = { ...emptyItem };
|
||||
item.indexNum = indexNum;
|
||||
dataSource.push(item);
|
||||
setDataSource(dataSource);
|
||||
}
|
||||
|
||||
fetchCumDeductDetailList(param) {
|
||||
const { cumDeductStore } = this.props;
|
||||
const { getCumDeductDetailList, currentRecord } = cumDeductStore;
|
||||
getCumDeductDetailList(currentRecord.id, param);
|
||||
}
|
||||
|
||||
// 日期格式变化加载数据
|
||||
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
|
||||
let declareMonth = [];
|
||||
if (startDate != "" && startDate != undefined) {
|
||||
declareMonth.push(startDate);
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
fetchTaxAgentOption();
|
||||
if (endDate != "" && endDate != undefined) {
|
||||
declareMonth.push(endDate);
|
||||
}
|
||||
|
||||
addItem() {
|
||||
const { taxRateStore: {setDataSource}} = this.props;
|
||||
let dataSource = [...this.props.taxRateStore.dataSource];
|
||||
let indexNum = 1;
|
||||
if(dataSource.length > 0) {
|
||||
indexNum = dataSource[dataSource.length - 1].indexNum + 1
|
||||
}
|
||||
let item = {...emptyItem}
|
||||
item.indexNum = indexNum
|
||||
dataSource.push(item);
|
||||
setDataSource(dataSource)
|
||||
let item = {
|
||||
taxAgentId: taxAgentId,
|
||||
};
|
||||
if (declareMonth.length != 0) {
|
||||
item.declareMonth = declareMonth;
|
||||
}
|
||||
this.fetchCumDeductDetailList(item);
|
||||
}
|
||||
|
||||
fetchCumDeductDetailList(param) {
|
||||
const { cumDeductStore} = this.props;
|
||||
const { getCumDeductDetailList, currentRecord } = cumDeductStore;
|
||||
getCumDeductDetailList(currentRecord.id, param);
|
||||
}
|
||||
onSelectChange = (val) => {
|
||||
const { onChangeSlideSelectKey } = this.props;
|
||||
onChangeSlideSelectKey && onChangeSlideSelectKey(val);
|
||||
};
|
||||
|
||||
// 日期格式变化加载数据
|
||||
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
|
||||
let declareMonth = []
|
||||
if(startDate != "" && startDate != undefined) {
|
||||
declareMonth.push(startDate);
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
} = this.props;
|
||||
const { cumDeductStore } = this.props;
|
||||
const {
|
||||
slideTableStore,
|
||||
currentRecord,
|
||||
slideColumns,
|
||||
slidePageObj,
|
||||
slideTableDataSource,
|
||||
setSlidePageObj,
|
||||
slideLoading,
|
||||
} = cumDeductStore;
|
||||
const { startDate, endDate, taxAgentId } = this.state;
|
||||
|
||||
if(endDate != "" && endDate != undefined) {
|
||||
declareMonth.push(endDate);
|
||||
}
|
||||
let item = {
|
||||
taxAgentId: taxAgentId
|
||||
}
|
||||
if(declareMonth.length != 0) {
|
||||
item.declareMonth = declareMonth
|
||||
}
|
||||
this.fetchCumDeductDetailList(item)
|
||||
}
|
||||
const pagination = {
|
||||
total: slidePageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
setSlidePageObj({ ...slidePageObj, current, pageSize });
|
||||
},
|
||||
onChange(current) {
|
||||
setSlidePageObj({
|
||||
...slidePageObj,
|
||||
current,
|
||||
pageSize: slidePageObj.pageSize,
|
||||
});
|
||||
},
|
||||
};
|
||||
const newColumns = _.map([...slideColumns], (item) => {
|
||||
if (item.dataIndex === "declareMonth") {
|
||||
return {
|
||||
...item,
|
||||
width: 120,
|
||||
fixed: "left",
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
});
|
||||
const rowSelection = {
|
||||
selectedRowKeys: this.props.slideSelectedKey,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
return (
|
||||
<div className="cumDeductSlide">
|
||||
<Row className="topLabelBar">
|
||||
<Col span={4}>
|
||||
<span className="username">{currentRecord.username}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span className="formLabel">申报月份</span>
|
||||
<div className="weaRangePickerWrapper">
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker
|
||||
width={100}
|
||||
value={startDate}
|
||||
onChange={(v) => {
|
||||
let startDate = "";
|
||||
if (v != "" && v != undefined) {
|
||||
startDate = moment(v).format("YYYY-MM");
|
||||
}
|
||||
this.setState({ startDate });
|
||||
this.handleFetchCumDeductDetailList(
|
||||
startDate,
|
||||
endDate,
|
||||
taxAgentId
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="betweenLable">至</span>
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker
|
||||
width={100}
|
||||
value={endDate}
|
||||
onChange={(v) => {
|
||||
let endDate = "";
|
||||
if (v != "" && v != undefined) {
|
||||
endDate = moment(v).format("YYYY-MM");
|
||||
}
|
||||
this.setState({ endDate });
|
||||
this.handleFetchCumDeductDetailList(
|
||||
startDate,
|
||||
endDate,
|
||||
taxAgentId
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<span className="formLabel">个税扣缴义务人</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 100 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={(v) => {
|
||||
this.setState({ taxAgentId: v });
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, v);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: {taxAgentOption}} = this.props;
|
||||
const { cumDeductStore } = this.props;
|
||||
const { slideTableStore, currentRecord } = cumDeductStore;
|
||||
const { startDate, endDate, taxAgentId } = this.state;
|
||||
return (
|
||||
<div className="cumDeductSlide">
|
||||
<Row className="topLabelBar">
|
||||
<Col span={4}>
|
||||
<span className="username">{currentRecord.username}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span className="formLabel">申报月份</span>
|
||||
<div className="weaRangePickerWrapper">
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker width={100} value={startDate}
|
||||
onChange={(v) => {
|
||||
let startDate = "";
|
||||
if(v != "" && v!= undefined) {
|
||||
startDate = moment(v).format("YYYY-MM")
|
||||
}
|
||||
this.setState({startDate})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="betweenLable">
|
||||
至
|
||||
</span>
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker width={100}
|
||||
value={endDate}
|
||||
onChange={(v) => {
|
||||
let endDate = ""
|
||||
if(v != "" && v!= undefined) {
|
||||
endDate = moment(v).format("YYYY-MM")
|
||||
}
|
||||
this.setState({endDate})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<span className="formLabel">个税扣缴义务人</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 100 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={v => {
|
||||
this.setState({taxAgentId: v})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, v)
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={slideTableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
scroll={{x: slideTableStore.columns.length * 100}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
<div>
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={newColumns}
|
||||
dataSource={slideTableDataSource}
|
||||
pagination={pagination}
|
||||
loading={slideLoading}
|
||||
scroll={{ x: 900 }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,41 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, Modal, message, Row, Col } from 'antd';
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom';
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
import moment from 'moment';
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../../components/customTab';
|
||||
import ContentWrapper from '../../../components/contentWrapper';
|
||||
import ImportModal from '../../../components/importModal'
|
||||
import { columns, dataSource, modalColumns } from './columns';
|
||||
import { optionAddAll } from '../../../util/options'
|
||||
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { Button, DatePicker, Dropdown, Menu, message, Row, Col } from "antd";
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaDatePicker,
|
||||
WeaSelect,
|
||||
WeaHelpfulTip,
|
||||
WeaSlideModal,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import moment from "moment";
|
||||
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../../components/customTab";
|
||||
import ContentWrapper from "../../../components/contentWrapper";
|
||||
import ImportModal from "../../../components/importModal";
|
||||
import { modalColumns } from "./columns";
|
||||
import { optionAddAll } from "../../../util/options";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
import "./index.less"
|
||||
import "./index.less";
|
||||
|
||||
import SlideModalTitle from '../../../components/slideModalTitle';
|
||||
import EditSlideContent from './editSlideContent';
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import EditSlideContent from "./editSlideContent";
|
||||
|
||||
|
||||
@inject('cumDeductStore', "taxAgentStore")
|
||||
@inject("cumDeductStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class CumDeduct extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
selectedKey: [],
|
||||
slideSelectedKey: [], //详情表格的选中项
|
||||
visiable: false,
|
||||
monthValue: "",
|
||||
taxAgentId: "",
|
||||
|
|
@ -41,24 +43,31 @@ export default class CumDeduct extends React.Component {
|
|||
inited: false,
|
||||
modalParam: {
|
||||
declareMonth: "",
|
||||
taxAgentId: ""
|
||||
}
|
||||
}
|
||||
taxAgentId: "",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { cumDeductStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
componentWillMount() {
|
||||
// 初始化渲染页面
|
||||
const {
|
||||
cumDeductStore: { doInit },
|
||||
taxAgentStore: { fetchTaxAgentOption },
|
||||
} = this.props;
|
||||
doInit();
|
||||
fetchTaxAgentOption().then(() => {
|
||||
fetchTaxAgentOption().then((res) => {
|
||||
this.setState({
|
||||
inited: true
|
||||
})
|
||||
})
|
||||
inited: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getSearchsAdQuick() {
|
||||
const { monthValue, taxAgentId } = this.state;
|
||||
const { taxAgentStore: { taxAgentOption }, cumDeductStore: {form, getTableDatas} } = this.props;
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
cumDeductStore: { form, getTableDatas },
|
||||
} = this.props;
|
||||
return (
|
||||
<div className="searchConditionWrapper">
|
||||
<div className="searchConditionItem">
|
||||
|
|
@ -121,94 +130,139 @@ export default class CumDeduct extends React.Component {
|
|||
}
|
||||
|
||||
renderFormComponent() {
|
||||
const { modalParam } = this.state
|
||||
const { taxAgentStore: {taxAgentOption} } = this.props;
|
||||
const { modalParam } = this.state;
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
} = this.props;
|
||||
return (
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>税款所属期</span>
|
||||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={modalParam.declareMonth}
|
||||
onChange={value => this.setState({ modalParam: {...modalParam, declareMonth: value} })}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>个税扣缴义务人</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 200, display: "inline-block" }}
|
||||
options={taxAgentOption}
|
||||
value={modalParam.taxAgentId}
|
||||
allowClear={true}
|
||||
onChange={v => {
|
||||
this.setState({ modalParam: {...modalParam, taxAgentId: v} });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
)
|
||||
}
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<span
|
||||
className="formLabel"
|
||||
style={{ lineHeight: "30px", marginRight: "10px" }}>
|
||||
税款所属期
|
||||
</span>
|
||||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={modalParam.declareMonth}
|
||||
onChange={(value) =>
|
||||
this.setState({
|
||||
modalParam: { ...modalParam, declareMonth: value },
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span
|
||||
className="formLabel"
|
||||
style={{ lineHeight: "30px", marginRight: "10px" }}>
|
||||
个税扣缴义务人
|
||||
</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 200, display: "inline-block" }}
|
||||
options={taxAgentOption}
|
||||
value={modalParam.taxAgentId}
|
||||
onChange={(v) => {
|
||||
this.setState({ modalParam: { ...modalParam, taxAgentId: v } });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
onEdit = (record) => {
|
||||
const { cumDeductStore: { slideVisiable, setSlideVisiable, getCumDeductDetailList, setCurrentRecord } } = this.props;
|
||||
setSlideVisiable(true)
|
||||
setCurrentRecord(record)
|
||||
const {
|
||||
cumDeductStore: {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
getCumDeductDetailList,
|
||||
setCurrentRecord,
|
||||
},
|
||||
} = this.props;
|
||||
setSlideVisiable(true);
|
||||
setCurrentRecord(record);
|
||||
getCumDeductDetailList(record.id);
|
||||
}
|
||||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = (columns) => {
|
||||
let newColumns = '';
|
||||
newColumns = columns.map(column => {
|
||||
let newColumns = "";
|
||||
newColumns = columns.map((column) => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch(newColumn.dataIndex) {
|
||||
newColumn.render = (text, record, index) => {
|
||||
//前端元素转义
|
||||
let valueSpan =
|
||||
record[newColumn.dataIndex + "span"] !== undefined
|
||||
? record[newColumn.dataIndex + "span"]
|
||||
: record[newColumn.dataIndex];
|
||||
switch (newColumn.dataIndex) {
|
||||
case "username":
|
||||
return <a onClick={() => {this.onEdit(record)}}
|
||||
>{text}</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
{text}
|
||||
</a>
|
||||
);
|
||||
case "operate":
|
||||
return <a onClick={() => {this.onEdit(record)}}>查看明细</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
查看明细
|
||||
</a>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
return newColumns;
|
||||
}
|
||||
};
|
||||
|
||||
handleCancel() {
|
||||
const { cumDeductStore } = this.props;
|
||||
const { modalVisiable, setModalVisiable, setStep } = cumDeductStore
|
||||
const { modalVisiable, setModalVisiable, setStep } = cumDeductStore;
|
||||
setModalVisiable(false);
|
||||
setStep(0);
|
||||
}
|
||||
|
||||
|
||||
onOperatesClick = (record, index, operate, flag) => {
|
||||
switch(operate.index.toString()){
|
||||
case '0': // 查看明细
|
||||
switch (operate.index.toString()) {
|
||||
case "0": // 查看明细
|
||||
this.onEdit(record);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
showColumn = () => {
|
||||
const { cumDeductStore: { tableStore } } = this.props;
|
||||
const {
|
||||
cumDeductStore: { tableStore },
|
||||
} = this.props;
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化导入参数
|
||||
handleInitModal() {
|
||||
const { cumDeductStore: { setSlideDataSource, setImportResult }} = this.props;
|
||||
setSlideDataSource([])
|
||||
setImportResult({})
|
||||
const {
|
||||
cumDeductStore: { setSlideDataSource, setImportResult },
|
||||
} = this.props;
|
||||
setSlideDataSource([]);
|
||||
setImportResult({});
|
||||
}
|
||||
|
||||
onSelectChange = (val) => {
|
||||
this.setState({
|
||||
selectedKey: val,
|
||||
});
|
||||
};
|
||||
|
||||
handleSearch() {
|
||||
const { cumDeductStore:{getTableDatas} } = this.props;
|
||||
const { monthValue, taxAgentId } = this.state;
|
||||
|
|
@ -223,98 +277,219 @@ export default class CumDeduct extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { modalParam } = this.state;
|
||||
const { modalParam, slideSelectedKey, monthValue, taxAgentId } = this.state;
|
||||
const { cumDeductStore, taxAgentStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = cumDeductStore;
|
||||
const { taxAgentOption } = taxAgentStore
|
||||
const { slideVisiable, setSlideVisiable, modalVisiable, setModalVisiable, slideTableStore, step, setStep, slideDataSource, importResult } = cumDeductStore
|
||||
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
|
||||
const {
|
||||
loading,
|
||||
dataSource,
|
||||
columns,
|
||||
pageObj,
|
||||
hasRight,
|
||||
form,
|
||||
condition,
|
||||
tableStore,
|
||||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd,
|
||||
previewImport,
|
||||
importFile,
|
||||
} = cumDeductStore;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
modalVisiable,
|
||||
setModalVisiable,
|
||||
slideTableStore,
|
||||
step,
|
||||
setStep,
|
||||
slideDataSource,
|
||||
importResult,
|
||||
setPageObj,
|
||||
} = cumDeductStore;
|
||||
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
|
||||
|
||||
const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || [];
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
{
|
||||
key: 'BTN_COLUMN',
|
||||
icon: <i className='icon-coms-Custom' />,
|
||||
content: '显示列定制',
|
||||
onClick: this.showColumn
|
||||
},
|
||||
const rightMenu = [
|
||||
// 右键菜单
|
||||
// {
|
||||
// key: "BTN_COLUMN",
|
||||
// icon: <i className="icon-coms-Custom" />,
|
||||
// content: "显示列定制",
|
||||
// onClick: this.showColumn,
|
||||
// },
|
||||
];
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>,
|
||||
];
|
||||
|
||||
const topTab = [
|
||||
];
|
||||
const topTab = [];
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div></div>
|
||||
}
|
||||
return <div></div>;
|
||||
};
|
||||
|
||||
const handleButtonClick = () => {
|
||||
const { cumDeductStore: {exportCumDeductList}} = this.props;
|
||||
const {
|
||||
cumDeductStore: { exportCumDeductList },
|
||||
} = this.props;
|
||||
exportCumDeductList();
|
||||
}
|
||||
};
|
||||
|
||||
const handleMenuClick = () => {
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
if (this.state.selectedKey.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const { cumDeductStore: { exportCumDeductList } } = this.props;
|
||||
exportCumDeductList(selectedRowKeys.join(","))
|
||||
}
|
||||
const {
|
||||
cumDeductStore: { exportCumDeductList },
|
||||
} = this.props;
|
||||
exportCumDeductList(this.state.selectedKey.join(","));
|
||||
};
|
||||
|
||||
const handleBtnImport = () => {
|
||||
const { cumDeductStore: { setModalVisiable, setStep } } = this.props;
|
||||
const {
|
||||
cumDeductStore: { setModalVisiable, setStep },
|
||||
} = this.props;
|
||||
setStep(0);
|
||||
setModalVisiable(true)
|
||||
}
|
||||
|
||||
|
||||
setModalVisiable(true);
|
||||
};
|
||||
|
||||
const btns = [
|
||||
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleBtnImport();
|
||||
}}>
|
||||
导入
|
||||
</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={handleButtonClick}
|
||||
overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
]
|
||||
</Dropdown.Button>,
|
||||
];
|
||||
|
||||
const handleExportAllDetailClick = () => {
|
||||
const {cumDeductStore: {exportCumDeductDetailList, currentRecord} } =this.props;
|
||||
const {
|
||||
cumDeductStore: { exportCumDeductDetailList, currentRecord },
|
||||
} = this.props;
|
||||
exportCumDeductDetailList(currentRecord.id);
|
||||
}
|
||||
};
|
||||
|
||||
const handleExportSelectedDetailClick = () => {
|
||||
if(detailSelectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
if (this.state.slideSelectedKey.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const { cumDeductStore: { exportCumDeductDetailList, currentRecord } } = this.props;
|
||||
exportCumDeductDetailList(currentRecord.id, detailSelectedRowKeys.join(","))
|
||||
}
|
||||
const {
|
||||
cumDeductStore: { exportCumDeductDetailList, currentRecord },
|
||||
} = this.props;
|
||||
exportCumDeductDetailList(
|
||||
currentRecord.id,
|
||||
this.state.slideSelectedKey.join(",")
|
||||
);
|
||||
};
|
||||
|
||||
const renderBtns = () => {
|
||||
return (
|
||||
<Dropdown.Button onClick={handleExportAllDetailClick} overlay={
|
||||
<Menu onClick={handleExportSelectedDetailClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
<Dropdown.Button
|
||||
onClick={handleExportAllDetailClick}
|
||||
overlay={
|
||||
<Menu onClick={handleExportSelectedDetailClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
)
|
||||
}
|
||||
</Dropdown.Button>
|
||||
);
|
||||
};
|
||||
|
||||
const pagination = {
|
||||
total: pageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
setPageObj({ ...pageObj, current, pageSize });
|
||||
getTableDatas({
|
||||
current,
|
||||
pageSize,
|
||||
taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
onChange(current) {
|
||||
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
|
||||
getTableDatas({
|
||||
current,
|
||||
pageSize: pageObj.pageSize,
|
||||
taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys: this.state.selectedKey,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
const newColumns = _.map([...columns], (item) => {
|
||||
if (item.dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
width: 100,
|
||||
fixed: "left",
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
|
||||
{text}
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else if (item.dataIndex === "taxAgentName") {
|
||||
return {
|
||||
...item,
|
||||
width: 180,
|
||||
fixed: "left",
|
||||
};
|
||||
} else if (item.dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
width: 100,
|
||||
fixed: "right",
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
|
||||
查看明细
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="cumDeductWrapper">
|
||||
|
|
@ -323,39 +498,39 @@ export default class CumDeduct extends React.Component {
|
|||
>
|
||||
<WeaTop
|
||||
title="累计专项附加扣除" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
buttons={btns}
|
||||
>
|
||||
|
||||
buttons={btns}>
|
||||
<div className="weaTabWrapper">
|
||||
<WeaTab
|
||||
searchType={['base', 'advanced']} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
showSearchAd={showSearchAd} // 是否展开高级搜索面板
|
||||
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
|
||||
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
|
||||
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
|
||||
buttonsAd={adBtn} // 高级搜索内部按钮
|
||||
onSearch={() => this.handleSearch()} // 点搜索按钮时的回调
|
||||
searchsAdQuick={this.getSearchsAdQuick()}
|
||||
onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
|
||||
onSearchChange={(v) => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
|
||||
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
|
||||
/>
|
||||
</div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getColumns}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={newColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
scroll={{ x: 1300 }}
|
||||
/>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
{
|
||||
modalVisiable && <ImportModal
|
||||
{modalVisiable && (
|
||||
<ImportModal
|
||||
init={() => {
|
||||
this.handleInitModal()
|
||||
this.handleInitModal();
|
||||
}}
|
||||
params={modalParam}
|
||||
columns={modalColumns}
|
||||
|
|
@ -363,40 +538,59 @@ export default class CumDeduct extends React.Component {
|
|||
setStep={setStep}
|
||||
slideDataSource={slideDataSource}
|
||||
importResult={importResult}
|
||||
onFinish={() => {setModalVisiable(false); setStep(0); doSearch();}}
|
||||
previewImport={(params) => {previewImport(params)}}
|
||||
importFile={(params) => {importFile(params)}}
|
||||
onFinish={() => {
|
||||
setModalVisiable(false);
|
||||
setStep(0);
|
||||
doSearch();
|
||||
}}
|
||||
previewImport={(params) => {
|
||||
previewImport(params);
|
||||
}}
|
||||
importFile={(params) => {
|
||||
importFile(params);
|
||||
}}
|
||||
templateLink={"/api/bs/hrmsalary/addUpDeduction/downloadTemplate"}
|
||||
renderFormComponent={() => this.renderFormComponent()}
|
||||
visiable={modalVisiable}
|
||||
onCancel={() => { this.handleCancel() }}
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
slideVisiable && <WeaSlideModal visible={slideVisiable}
|
||||
top={0}
|
||||
width={60}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"累计专项附加扣除记录"}
|
||||
subTabs={[{title: "基础设置"}]}
|
||||
onSave={() => {this.state.currentOperate == "add" ? doSave() : doUpdate()}}
|
||||
editable={false}
|
||||
btns={
|
||||
renderBtns()
|
||||
}
|
||||
/>
|
||||
}
|
||||
content={(<EditSlideContent />)}
|
||||
onClose={() => setSlideVisiable(false)}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => setSlideVisiable(false)} />
|
||||
}
|
||||
renderFormComponent={() => this.renderFormComponent()}
|
||||
visiable={modalVisiable}
|
||||
onCancel={() => {
|
||||
this.handleCancel();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{slideVisiable && (
|
||||
<WeaSlideModal
|
||||
visible={slideVisiable}
|
||||
top={0}
|
||||
width={60}
|
||||
height={100}
|
||||
direction={"right"}
|
||||
measure={"%"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"累计专项附加扣除记录"}
|
||||
subTabs={[{ title: "基础设置" }]}
|
||||
onSave={() => {
|
||||
this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
}}
|
||||
editable={false}
|
||||
btns={renderBtns()}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<EditSlideContent
|
||||
slideSelectedKey={slideSelectedKey}
|
||||
onChangeSlideSelectKey={(val) =>
|
||||
this.setState({ slideSelectedKey: val })
|
||||
}
|
||||
/>
|
||||
}
|
||||
onClose={() => setSlideVisiable(false)}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => setSlideVisiable(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,47 @@
|
|||
.cumDeductWrapper {
|
||||
.weaTabWrapper {
|
||||
position: relative;
|
||||
.searchConditionWrapper {
|
||||
width: 600px;
|
||||
margin-left: 10px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.searchConditionItem {
|
||||
float: left;
|
||||
}
|
||||
.conditionFormLabel {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.helperWrapper {
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.weaTabWrapper {
|
||||
position: relative;
|
||||
|
||||
.searchConditionWrapper {
|
||||
width: 600px;
|
||||
margin-left: 10px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.wea-tab-search-ad-quick {
|
||||
.wea-tab-right-search-ad-quick {
|
||||
margin-top: 0px;
|
||||
}
|
||||
.wea-search-container-search-ad-quick {
|
||||
top: 46px;
|
||||
}
|
||||
.searchConditionItem {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.conditionFormLabel {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.helperWrapper {
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-tab-search-ad-quick {
|
||||
.wea-tab-right-search-ad-quick {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.wea-search-container-search-ad-quick {
|
||||
top: 46px;
|
||||
}
|
||||
}
|
||||
|
||||
.linkWapper {
|
||||
a {
|
||||
color: #4d7ad8;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,156 +1,222 @@
|
|||
import React from 'react';
|
||||
import { Row, Col, Table, DatePicker } from "antd"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import { slideColumns} from './columns';
|
||||
import "./editSlideContent.less"
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
import moment from 'moment'
|
||||
import React from "react";
|
||||
import { Row, Col, Table, DatePicker } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import {
|
||||
WeaInput,
|
||||
WeaTextarea,
|
||||
WeaSearchGroup,
|
||||
WeaSelect,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import { slideColumns } from "./columns";
|
||||
import "./editSlideContent.less";
|
||||
import moment from "moment";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
|
||||
let emptyItem = {
|
||||
incomeLowerLimit: "0.00",
|
||||
incomeUpperLimit: "0.00",
|
||||
dutyFreeValue: "0.00",
|
||||
dutyFreeRate: "0.00",
|
||||
taxableIncomeLl: "0.00",
|
||||
taxableIncomeUl: "0.00",
|
||||
taxRate: "0.00",
|
||||
taxDeduction: "0.00"
|
||||
}
|
||||
incomeLowerLimit: "0.00",
|
||||
incomeUpperLimit: "0.00",
|
||||
dutyFreeValue: "0.00",
|
||||
dutyFreeRate: "0.00",
|
||||
taxableIncomeLl: "0.00",
|
||||
taxableIncomeUl: "0.00",
|
||||
taxRate: "0.00",
|
||||
taxDeduction: "0.00",
|
||||
};
|
||||
|
||||
@inject('cumSituationStore', "taxAgentStore")
|
||||
@inject("cumSituationStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class EditSlideContent extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taxAgentId: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
editable: this.props.editable === undefined ? "true": this.props.editable
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taxAgentId: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
editable:
|
||||
this.props.editable === undefined ? "true" : this.props.editable,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
// 初始化渲染页面
|
||||
const {
|
||||
taxAgentStore: { fetchTaxAgentOption },
|
||||
} = this.props;
|
||||
fetchTaxAgentOption();
|
||||
}
|
||||
|
||||
addItem() {
|
||||
const {
|
||||
taxRateStore: { setDataSource },
|
||||
} = this.props;
|
||||
let dataSource = [...this.props.taxRateStore.dataSource];
|
||||
let indexNum = 1;
|
||||
if (dataSource.length > 0) {
|
||||
indexNum = dataSource[dataSource.length - 1].indexNum + 1;
|
||||
}
|
||||
let item = { ...emptyItem };
|
||||
item.indexNum = indexNum;
|
||||
dataSource.push(item);
|
||||
setDataSource(dataSource);
|
||||
}
|
||||
|
||||
fetchCumDeductDetailList(param) {
|
||||
const { cumSituationStore } = this.props;
|
||||
const { getCumDeductDetailList, currentRecord } = cumSituationStore;
|
||||
getCumDeductDetailList(currentRecord.id, param);
|
||||
}
|
||||
|
||||
// 日期格式变化加载数据
|
||||
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
|
||||
let declareMonth = [];
|
||||
if (startDate != "" && startDate != undefined) {
|
||||
declareMonth.push(startDate);
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
fetchTaxAgentOption();
|
||||
if (endDate != "" && endDate != undefined) {
|
||||
declareMonth.push(endDate);
|
||||
}
|
||||
|
||||
addItem() {
|
||||
const { taxRateStore: {setDataSource}} = this.props;
|
||||
let dataSource = [...this.props.taxRateStore.dataSource];
|
||||
let indexNum = 1;
|
||||
if(dataSource.length > 0) {
|
||||
indexNum = dataSource[dataSource.length - 1].indexNum + 1
|
||||
}
|
||||
let item = {...emptyItem}
|
||||
item.indexNum = indexNum
|
||||
dataSource.push(item);
|
||||
setDataSource(dataSource)
|
||||
let item = {
|
||||
taxAgentId: taxAgentId,
|
||||
};
|
||||
if (declareMonth.length != 0) {
|
||||
item.taxYearMonth = declareMonth;
|
||||
}
|
||||
this.fetchCumDeductDetailList(item);
|
||||
}
|
||||
|
||||
fetchCumDeductDetailList(param) {
|
||||
const { cumSituationStore} = this.props;
|
||||
const { getCumDeductDetailList, currentRecord } = cumSituationStore;
|
||||
getCumDeductDetailList(currentRecord.id, param);
|
||||
}
|
||||
onSelectChange = (val) => {
|
||||
const { onChangeSlideSelectKey } = this.props;
|
||||
onChangeSlideSelectKey && onChangeSlideSelectKey(val);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
} = this.props;
|
||||
const { cumSituationStore } = this.props;
|
||||
const {
|
||||
slideTableStore,
|
||||
currentRecord,
|
||||
slideColumns,
|
||||
slidePageObj,
|
||||
slideTableDataSource,
|
||||
setSlidePageObj,
|
||||
slideLoading,
|
||||
} = cumSituationStore;
|
||||
const { startDate, endDate, taxAgentId } = this.state;
|
||||
|
||||
// 日期格式变化加载数据
|
||||
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
|
||||
let declareMonth = []
|
||||
if(startDate != "" && startDate != undefined) {
|
||||
declareMonth.push(startDate);
|
||||
}
|
||||
const pagination = {
|
||||
total: slidePageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
setSlidePageObj({ ...slidePageObj, current, pageSize });
|
||||
},
|
||||
onChange(current) {
|
||||
setSlidePageObj({
|
||||
...slidePageObj,
|
||||
current,
|
||||
pageSize: slidePageObj.pageSize,
|
||||
});
|
||||
},
|
||||
};
|
||||
const newColumns = _.map([...slideColumns], (item) => {
|
||||
if (item.dataIndex === "declareMonth") {
|
||||
return {
|
||||
...item,
|
||||
width: 120,
|
||||
fixed: "left",
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
});
|
||||
const rowSelection = {
|
||||
selectedRowKeys: this.props.slideSelectedKey,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
return (
|
||||
<div className="cumDeductSlide">
|
||||
<Row className="topLabelBar">
|
||||
<Col span={4}>
|
||||
<span className="username">{currentRecord.username}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span className="formLabel">申报月份</span>
|
||||
<div className="weaRangePickerWrapper">
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker
|
||||
width={100}
|
||||
format="YYYY-MM"
|
||||
value={startDate}
|
||||
onChange={(v) => {
|
||||
let startDate = "";
|
||||
if (v != "" && v != undefined) {
|
||||
startDate = moment(v).format("YYYY-MM");
|
||||
}
|
||||
this.setState({ startDate });
|
||||
this.handleFetchCumDeductDetailList(
|
||||
startDate,
|
||||
endDate,
|
||||
taxAgentId
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="betweenLable">至</span>
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker
|
||||
width={100}
|
||||
value={endDate}
|
||||
onChange={(v) => {
|
||||
let endDate = "";
|
||||
if (v != "" && v != undefined) {
|
||||
endDate = moment(v).format("YYYY-MM");
|
||||
}
|
||||
this.setState({ endDate });
|
||||
this.handleFetchCumDeductDetailList(
|
||||
startDate,
|
||||
endDate,
|
||||
taxAgentId
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<span className="formLabel">个税扣缴义务人</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 100 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={(v) => {
|
||||
this.setState({ taxAgentId: v });
|
||||
this.fetchCumDeductDetailList({
|
||||
declareMonth: [startDate, endDate],
|
||||
taxAgentId: v,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
if(endDate != "" && endDate != undefined) {
|
||||
declareMonth.push(endDate);
|
||||
}
|
||||
let item = {
|
||||
taxAgentId: taxAgentId
|
||||
}
|
||||
if(declareMonth.length != 0) {
|
||||
item.taxYearMonth = declareMonth
|
||||
}
|
||||
this.fetchCumDeductDetailList(item)
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: {taxAgentOption}} = this.props;
|
||||
const { cumSituationStore } = this.props;
|
||||
const { slideTableStore, currentRecord } = cumSituationStore;
|
||||
const { startDate, endDate, taxAgentId } = this.state;
|
||||
return (
|
||||
<div className="cumDeductSlide">
|
||||
<Row className="topLabelBar">
|
||||
<Col span={4}>
|
||||
<span className="username">{currentRecord.username}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span className="formLabel">申报月份</span>
|
||||
<div className="weaRangePickerWrapper">
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker width={100} format="YYYY-MM" value={startDate}
|
||||
onChange={(v) => {
|
||||
let startDate = "";
|
||||
if(v != "" && v!= undefined) {
|
||||
startDate = moment(v).format("YYYY-MM")
|
||||
}
|
||||
this.setState({startDate})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="betweenLable">
|
||||
至
|
||||
</span>
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker width={100}
|
||||
value={endDate}
|
||||
onChange={(v) => {
|
||||
let endDate = ""
|
||||
if(v != "" && v!= undefined) {
|
||||
endDate = moment(v).format("YYYY-MM")
|
||||
}
|
||||
this.setState({endDate})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<span className="formLabel">个税扣缴义务人</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 100 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={v => {
|
||||
this.setState({taxAgentId: v})
|
||||
this.fetchCumDeductDetailList({
|
||||
declareMonth: [startDate, endDate],
|
||||
taxAgentId: v
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={slideTableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
scroll={{x: slideTableStore.columns.length * 100}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
<div>
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={newColumns}
|
||||
dataSource={slideTableDataSource}
|
||||
pagination={pagination}
|
||||
loading={slideLoading}
|
||||
scroll={{ x: 900 }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,62 +1,85 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, Modal, message, Row, Col } from 'antd';
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
DatePicker,
|
||||
Dropdown,
|
||||
Menu,
|
||||
Modal,
|
||||
message,
|
||||
Row,
|
||||
Col,
|
||||
} from "antd";
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom';
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
import moment from 'moment';
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../../components/customTab';
|
||||
import ContentWrapper from '../../../components/contentWrapper';
|
||||
import ImportModal from '../../../components/importModal'
|
||||
import { columns, dataSource, modalColumns } from './columns';
|
||||
import { optionAddAll } from '../../../util/options';
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaDatePicker,
|
||||
WeaSelect,
|
||||
WeaHelpfulTip,
|
||||
WeaSlideModal,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import moment from "moment";
|
||||
|
||||
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../../components/customTab";
|
||||
import ContentWrapper from "../../../components/contentWrapper";
|
||||
import ImportModal from "../../../components/importModal";
|
||||
import { modalColumns } from "./columns";
|
||||
import { optionAddAll } from "../../../util/options";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
import "./index.less"
|
||||
import "./index.less";
|
||||
|
||||
import SlideModalTitle from '../../../components/slideModalTitle';
|
||||
import EditSlideContent from './editSlideContent';
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import EditSlideContent from "./editSlideContent";
|
||||
|
||||
|
||||
@inject('cumSituationStore', "taxAgentStore")
|
||||
@inject("cumSituationStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class CumSituation extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
selectedKey: [],
|
||||
slideSelectedKey: [], //详情表格的选中项
|
||||
visiable: false,
|
||||
inited: false,
|
||||
monthValue: "",
|
||||
taxAgentId: "",
|
||||
modalParam: {
|
||||
taxYearMonth: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { cumSituationStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
componentWillMount() {
|
||||
// 初始化渲染页面
|
||||
const {
|
||||
cumSituationStore: { doInit },
|
||||
taxAgentStore: { fetchTaxAgentOption },
|
||||
} = this.props;
|
||||
doInit();
|
||||
fetchTaxAgentOption().then(() => {
|
||||
this.setState({
|
||||
inited: true
|
||||
})
|
||||
})
|
||||
inited: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getSearchsAdQuick() {
|
||||
const { monthValue, taxAgentId } = this.state;
|
||||
const { taxAgentStore: { taxAgentOption }, cumSituationStore: {form, getTableDatas} } = this.props;
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
cumSituationStore: { form, getTableDatas },
|
||||
} = this.props;
|
||||
return (
|
||||
<div className="searchConditionWrapper">
|
||||
<div className="searchConditionItem">
|
||||
|
|
@ -119,84 +142,124 @@ export default class CumSituation extends React.Component {
|
|||
|
||||
|
||||
renderFormComponent() {
|
||||
const { modalParam } = this.state
|
||||
const { taxAgentStore: {taxAgentOption} } = this.props;
|
||||
const { modalParam } = this.state;
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
} = this.props;
|
||||
return (
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>税款所属期</span>
|
||||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={modalParam.taxYearMonth}
|
||||
onChange={value => this.setState({ modalParam: {taxYearMonth: value} })}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
)
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<span
|
||||
className="formLabel"
|
||||
style={{ lineHeight: "30px", marginRight: "10px" }}>
|
||||
税款所属期
|
||||
</span>
|
||||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={modalParam.taxYearMonth}
|
||||
onChange={(value) =>
|
||||
this.setState({ modalParam: { taxYearMonth: value } })
|
||||
}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
onEdit = (record) => {
|
||||
const { cumSituationStore: { slideVisiable, setSlideVisiable, getCumDeductDetailList, setCurrentRecord } } = this.props;
|
||||
setSlideVisiable(true)
|
||||
setCurrentRecord(record)
|
||||
const {
|
||||
cumSituationStore: {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
getCumDeductDetailList,
|
||||
setCurrentRecord,
|
||||
},
|
||||
} = this.props;
|
||||
setSlideVisiable(true);
|
||||
setCurrentRecord(record);
|
||||
getCumDeductDetailList(record.id);
|
||||
}
|
||||
};
|
||||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = (columns) => {
|
||||
let newColumns = [];
|
||||
if(!columns) {
|
||||
return []
|
||||
if (!columns) {
|
||||
return [];
|
||||
}
|
||||
newColumns = columns.map(column => {
|
||||
newColumns = columns.map((column) => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch(newColumn.dataIndex) {
|
||||
newColumn.render = (text, record, index) => {
|
||||
//前端元素转义
|
||||
let valueSpan =
|
||||
record[newColumn.dataIndex + "span"] !== undefined
|
||||
? record[newColumn.dataIndex + "span"]
|
||||
: record[newColumn.dataIndex];
|
||||
switch (newColumn.dataIndex) {
|
||||
case "username":
|
||||
return <a onClick={() => {this.onEdit(record)}}
|
||||
dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}
|
||||
dangerouslySetInnerHTML={{ __html: valueSpan }}
|
||||
/>
|
||||
);
|
||||
case "operate":
|
||||
return <a onClick={() => {this.onEdit(record)}}>查看明细</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
查看明细
|
||||
</a>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
console.log("newColumns: ", newColumns);
|
||||
return newColumns;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
handleCancel() {
|
||||
const { cumSituationStore } = this.props;
|
||||
const { modalVisiable, setModalVisiable, setStep } = cumSituationStore
|
||||
const { modalVisiable, setModalVisiable, setStep } = cumSituationStore;
|
||||
setModalVisiable(false);
|
||||
setStep(0);
|
||||
}
|
||||
|
||||
|
||||
onOperatesClick = (record, index, operate, flag) => {
|
||||
switch(operate.index.toString()){
|
||||
case '0': // 查看明细
|
||||
switch (operate.index.toString()) {
|
||||
case "0": // 查看明细
|
||||
this.onEdit(record);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
showColumn = () => {
|
||||
const { cumSituationStore: { tableStore } } = this.props;
|
||||
const {
|
||||
cumSituationStore: { tableStore },
|
||||
} = this.props;
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
}
|
||||
};
|
||||
|
||||
// 导入参数初始化
|
||||
handleInitImport = () => {
|
||||
const { cumSituationStore: { setSlideDataSource, setImportResult } } = this.props;
|
||||
setSlideDataSource([])
|
||||
setImportResult({})
|
||||
}
|
||||
const {
|
||||
cumSituationStore: { setSlideDataSource, setImportResult },
|
||||
} = this.props;
|
||||
setSlideDataSource([]);
|
||||
setImportResult({});
|
||||
};
|
||||
|
||||
onSelectChange = (val) => {
|
||||
this.setState({
|
||||
selectedKey: val,
|
||||
});
|
||||
};
|
||||
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
|
|
@ -213,104 +276,226 @@ export default class CumSituation extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { cumSituationStore, taxAgentStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = cumSituationStore;
|
||||
const { taxAgentOption } = taxAgentStore
|
||||
const { slideVisiable, setSlideVisiable, modalVisiable, setModalVisiable, slideTableStore, step, setStep, slideDataSource, importResult } = cumSituationStore
|
||||
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
|
||||
const { modalParam } = this.state;
|
||||
const { cumSituationStore, taxAgentStore, slideSelectedKey } = this.props;
|
||||
const {
|
||||
loading,
|
||||
dataSource,
|
||||
columns,
|
||||
pageObj,
|
||||
hasRight,
|
||||
form,
|
||||
condition,
|
||||
tableStore,
|
||||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd,
|
||||
previewImport,
|
||||
importFile,
|
||||
} = cumSituationStore;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
modalVisiable,
|
||||
setModalVisiable,
|
||||
slideTableStore,
|
||||
step,
|
||||
setStep,
|
||||
slideDataSource,
|
||||
importResult,
|
||||
setPageObj,
|
||||
} = cumSituationStore;
|
||||
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
|
||||
const { modalParam, monthValue, taxAgentId } = this.state;
|
||||
const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || [];
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
{
|
||||
key: 'BTN_COLUMN',
|
||||
icon: <i className='icon-coms-Custom' />,
|
||||
content: '显示列定制',
|
||||
onClick: this.showColumn
|
||||
},
|
||||
const rightMenu = [
|
||||
// 右键菜单
|
||||
// {
|
||||
// key: "BTN_COLUMN",
|
||||
// icon: <i className="icon-coms-Custom" />,
|
||||
// content: "显示列定制",
|
||||
// onClick: this.showColumn,
|
||||
// },
|
||||
];
|
||||
const collectParams = { // 收藏功能配置
|
||||
favname: '往期累计情况(工资、薪金)',
|
||||
const collectParams = {
|
||||
// 收藏功能配置
|
||||
favname: "往期累计情况(工资、薪金)",
|
||||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: 'wui/index.html#/ns_demo03/index',
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1,
|
||||
};
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>,
|
||||
];
|
||||
|
||||
const topTab = [
|
||||
];
|
||||
const topTab = [];
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div></div>
|
||||
}
|
||||
return <div></div>;
|
||||
};
|
||||
|
||||
const handleButtonClick = () => {
|
||||
const { cumSituationStore: {exportCumDeductList}} = this.props;
|
||||
const {
|
||||
cumSituationStore: { exportCumDeductList },
|
||||
} = this.props;
|
||||
exportCumDeductList();
|
||||
}
|
||||
};
|
||||
|
||||
const handleMenuClick = () => {
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
if (selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const { cumSituationStore: { exportCumDeductList } } = this.props;
|
||||
exportCumDeductList(selectedRowKeys.join(","))
|
||||
}
|
||||
const {
|
||||
cumSituationStore: { exportCumDeductList },
|
||||
} = this.props;
|
||||
exportCumDeductList(selectedRowKeys.join(","));
|
||||
};
|
||||
|
||||
const handleBtnImport = () => {
|
||||
const { cumSituationStore: { setModalVisiable, setStep } } = this.props;
|
||||
const {
|
||||
cumSituationStore: { setModalVisiable, setStep },
|
||||
} = this.props;
|
||||
setStep(0);
|
||||
setModalVisiable(true)
|
||||
}
|
||||
|
||||
|
||||
setModalVisiable(true);
|
||||
};
|
||||
|
||||
const btns = [
|
||||
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleBtnImport();
|
||||
}}>
|
||||
导入
|
||||
</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={handleButtonClick}
|
||||
overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
]
|
||||
</Dropdown.Button>,
|
||||
];
|
||||
|
||||
const handleExportAllDetailClick = () => {
|
||||
const {cumSituationStore: {exportCumSituationDetailList, currentRecord} } =this.props;
|
||||
const {
|
||||
cumSituationStore: { exportCumSituationDetailList, currentRecord },
|
||||
} = this.props;
|
||||
exportCumSituationDetailList(currentRecord.id);
|
||||
}
|
||||
};
|
||||
|
||||
const handleExportSelectedDetailClick = () => {
|
||||
if(detailSelectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
if (this.state.slideSelectedKey.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const { cumSituationStore: { exportCumSituationDetailList, currentRecord } } = this.props;
|
||||
exportCumSituationDetailList(currentRecord.id, detailSelectedRowKeys.join(","))
|
||||
}
|
||||
const {
|
||||
cumSituationStore: { exportCumSituationDetailList, currentRecord },
|
||||
} = this.props;
|
||||
exportCumSituationDetailList(
|
||||
currentRecord.id,
|
||||
this.state.slideSelectedKey.join(",")
|
||||
);
|
||||
};
|
||||
|
||||
const renderBtns = () => {
|
||||
return (
|
||||
<Dropdown.Button onClick={handleExportAllDetailClick} overlay={
|
||||
<Menu onClick={handleExportSelectedDetailClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
<Dropdown.Button
|
||||
onClick={handleExportAllDetailClick}
|
||||
overlay={
|
||||
<Menu onClick={handleExportSelectedDetailClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
)
|
||||
}
|
||||
</Dropdown.Button>
|
||||
);
|
||||
};
|
||||
|
||||
const pagination = {
|
||||
total: pageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
setPageObj({ ...pageObj, current, pageSize });
|
||||
getTableDatas({
|
||||
current,
|
||||
pageSize,
|
||||
taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
onChange(current) {
|
||||
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
|
||||
getTableDatas({
|
||||
current,
|
||||
pageSize: pageObj.pageSize,
|
||||
taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys: this.state.selectedKey,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
const newColumns = _.map([...columns], (item) => {
|
||||
if (item.dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
width: 100,
|
||||
fixed: "left",
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
|
||||
{text}
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else if (item.dataIndex === "taxAgentName") {
|
||||
return {
|
||||
...item,
|
||||
width: 180,
|
||||
fixed: "left",
|
||||
};
|
||||
} else if (item.dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
width: 100,
|
||||
fixed: "right",
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
|
||||
查看明细
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else {
|
||||
return { ...item, width: 150 };
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="cumDeductWrapper">
|
||||
|
|
@ -319,19 +504,17 @@ export default class CumSituation extends React.Component {
|
|||
>
|
||||
<WeaTop
|
||||
title="往期累计情况(工资、薪金)" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
buttons={btns}
|
||||
>
|
||||
|
||||
buttons={btns}>
|
||||
<div className="weaTabWrapper">
|
||||
<WeaTab
|
||||
searchType={['base', 'advanced']} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
showSearchAd={showSearchAd} // 是否展开高级搜索面板
|
||||
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
|
||||
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
|
||||
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
|
||||
buttonsAd={adBtn} // 高级搜索内部按钮
|
||||
onSearch={() => this.handleSearch()} // 点搜索按钮时的回调
|
||||
|
|
@ -340,59 +523,80 @@ export default class CumSituation extends React.Component {
|
|||
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
|
||||
/>
|
||||
</div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getColumns}
|
||||
scroll={{x: this.getColumns(tableStore.columns).length * 100}}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={newColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
scroll={{ x: 1300 }}
|
||||
/>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
{
|
||||
modalVisiable && <ImportModal
|
||||
{modalVisiable && (
|
||||
<ImportModal
|
||||
init={() => {
|
||||
this.handleInitImport()
|
||||
this.handleInitImport();
|
||||
}}
|
||||
templateLink={"/api/bs/hrmsalary/addUpSituation/downloadTemplate"}
|
||||
params={modalParam}
|
||||
columns={modalColumns}
|
||||
step={step}
|
||||
setStep={setStep}
|
||||
onFinish={() => {setModalVisiable(false); setStep(0); doSearch();}}
|
||||
onFinish={() => {
|
||||
setModalVisiable(false);
|
||||
setStep(0);
|
||||
doSearch();
|
||||
}}
|
||||
slideDataSource={slideDataSource}
|
||||
importResult={importResult}
|
||||
previewImport={(params) => {previewImport(params)}}
|
||||
importFile={(params) => {importFile(params)}}
|
||||
renderFormComponent={() => this.renderFormComponent()}
|
||||
visiable={modalVisiable}
|
||||
onCancel={() => { this.handleCancel() }} />
|
||||
}
|
||||
{
|
||||
slideVisiable && <WeaSlideModal visible={slideVisiable}
|
||||
top={0}
|
||||
width={60}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"往期累计情况(工资、薪金)记录"}
|
||||
subTabs={[{title: "基础设置"}]}
|
||||
onSave={() => {this.state.currentOperate == "add" ? doSave() : doUpdate()}}
|
||||
editable={false}
|
||||
btns={
|
||||
renderBtns()
|
||||
}
|
||||
/>
|
||||
}
|
||||
content={(<EditSlideContent />)}
|
||||
onClose={() => setSlideVisiable(false)}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => setSlideVisiable(false)} />
|
||||
}
|
||||
previewImport={(params) => {
|
||||
previewImport(params);
|
||||
}}
|
||||
importFile={(params) => {
|
||||
importFile(params);
|
||||
}}
|
||||
renderFormComponent={() => this.renderFormComponent()}
|
||||
visiable={modalVisiable}
|
||||
onCancel={() => {
|
||||
this.handleCancel();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{slideVisiable && (
|
||||
<WeaSlideModal
|
||||
visible={slideVisiable}
|
||||
top={0}
|
||||
width={60}
|
||||
height={100}
|
||||
direction={"right"}
|
||||
measure={"%"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"往期累计情况(工资、薪金)记录"}
|
||||
subTabs={[{ title: "基础设置" }]}
|
||||
onSave={() => {
|
||||
this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
}}
|
||||
editable={false}
|
||||
btns={renderBtns()}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<EditSlideContent
|
||||
slideSelectedKey={slideSelectedKey}
|
||||
onChangeSlideSelectKey={(val) =>
|
||||
this.setState({ slideSelectedKey: val })
|
||||
}
|
||||
/>
|
||||
}
|
||||
onClose={() => setSlideVisiable(false)}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => setSlideVisiable(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,153 +1,218 @@
|
|||
import React from 'react';
|
||||
import { Row, Col, Table, DatePicker } from "antd"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import { slideColumns} from './columns';
|
||||
import "./editSlideContent.less"
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
import moment from 'moment'
|
||||
import React from "react";
|
||||
import { Row, Col, Table, DatePicker } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import {
|
||||
WeaInput,
|
||||
WeaTextarea,
|
||||
WeaSearchGroup,
|
||||
WeaSelect,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import "./editSlideContent.less";
|
||||
import moment from "moment";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
|
||||
let emptyItem = {
|
||||
incomeLowerLimit: "0.00",
|
||||
incomeUpperLimit: "0.00",
|
||||
dutyFreeValue: "0.00",
|
||||
dutyFreeRate: "0.00",
|
||||
taxableIncomeLl: "0.00",
|
||||
taxableIncomeUl: "0.00",
|
||||
taxRate: "0.00",
|
||||
taxDeduction: "0.00"
|
||||
}
|
||||
incomeLowerLimit: "0.00",
|
||||
incomeUpperLimit: "0.00",
|
||||
dutyFreeValue: "0.00",
|
||||
dutyFreeRate: "0.00",
|
||||
taxableIncomeLl: "0.00",
|
||||
taxableIncomeUl: "0.00",
|
||||
taxRate: "0.00",
|
||||
taxDeduction: "0.00",
|
||||
};
|
||||
|
||||
@inject('otherDeductStore', "taxAgentStore")
|
||||
@inject("otherDeductStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class EditSlideContent extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taxAgentId: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
editable:
|
||||
this.props.editable === undefined ? "true" : this.props.editable,
|
||||
};
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taxAgentId: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
editable: this.props.editable === undefined ? "true": this.props.editable
|
||||
}
|
||||
componentWillMount() {
|
||||
// 初始化渲染页面
|
||||
const {
|
||||
taxAgentStore: { fetchTaxAgentOption },
|
||||
} = this.props;
|
||||
fetchTaxAgentOption();
|
||||
}
|
||||
|
||||
addItem() {
|
||||
const {
|
||||
taxRateStore: { setDataSource },
|
||||
} = this.props;
|
||||
let dataSource = [...this.props.taxRateStore.dataSource];
|
||||
let indexNum = 1;
|
||||
if (dataSource.length > 0) {
|
||||
indexNum = dataSource[dataSource.length - 1].indexNum + 1;
|
||||
}
|
||||
let item = { ...emptyItem };
|
||||
item.indexNum = indexNum;
|
||||
dataSource.push(item);
|
||||
setDataSource(dataSource);
|
||||
}
|
||||
|
||||
fetchCumDeductDetailList(param) {
|
||||
const { otherDeductStore } = this.props;
|
||||
const { getOtherDeductDetailList, currentRecord } = otherDeductStore;
|
||||
getOtherDeductDetailList(currentRecord.id, param);
|
||||
}
|
||||
|
||||
// 日期格式变化加载数据
|
||||
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
|
||||
let declareMonth = [];
|
||||
if (startDate != "" && startDate != undefined) {
|
||||
declareMonth.push(startDate);
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
fetchTaxAgentOption();
|
||||
if (endDate != "" && endDate != undefined) {
|
||||
declareMonth.push(endDate);
|
||||
}
|
||||
|
||||
addItem() {
|
||||
const { taxRateStore: {setDataSource}} = this.props;
|
||||
let dataSource = [...this.props.taxRateStore.dataSource];
|
||||
let indexNum = 1;
|
||||
if(dataSource.length > 0) {
|
||||
indexNum = dataSource[dataSource.length - 1].indexNum + 1
|
||||
}
|
||||
let item = {...emptyItem}
|
||||
item.indexNum = indexNum
|
||||
dataSource.push(item);
|
||||
setDataSource(dataSource)
|
||||
let item = {
|
||||
taxAgentId: taxAgentId,
|
||||
};
|
||||
if (declareMonth.length != 0) {
|
||||
item.declareMonth = declareMonth;
|
||||
}
|
||||
this.fetchCumDeductDetailList(item);
|
||||
}
|
||||
|
||||
fetchCumDeductDetailList(param) {
|
||||
const { otherDeductStore} = this.props;
|
||||
const { getOtherDeductDetailList, currentRecord } = otherDeductStore;
|
||||
getOtherDeductDetailList(currentRecord.id, param);
|
||||
}
|
||||
onSelectChange = (val) => {
|
||||
const { onChangeSlideSelectKey } = this.props;
|
||||
onChangeSlideSelectKey && onChangeSlideSelectKey(val);
|
||||
};
|
||||
|
||||
// 日期格式变化加载数据
|
||||
handleFetchCumDeductDetailList(startDate, endDate, taxAgentId) {
|
||||
let declareMonth = []
|
||||
if(startDate != "" && startDate != undefined) {
|
||||
declareMonth.push(startDate);
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
} = this.props;
|
||||
const { otherDeductStore } = this.props;
|
||||
const {
|
||||
slideTableStore,
|
||||
currentRecord,
|
||||
slideColumns,
|
||||
slidePageObj,
|
||||
slideTableDataSource,
|
||||
setSlidePageObj,
|
||||
slideLoading,
|
||||
} = otherDeductStore;
|
||||
const { startDate, endDate, taxAgentId } = this.state;
|
||||
|
||||
if(endDate != "" && endDate != undefined) {
|
||||
declareMonth.push(endDate);
|
||||
}
|
||||
let item = {
|
||||
taxAgentId: taxAgentId
|
||||
}
|
||||
if(declareMonth.length != 0) {
|
||||
item.declareMonth = declareMonth
|
||||
}
|
||||
this.fetchCumDeductDetailList(item)
|
||||
}
|
||||
const pagination = {
|
||||
total: slidePageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
setSlidePageObj({ ...slidePageObj, current, pageSize });
|
||||
},
|
||||
onChange(current) {
|
||||
setSlidePageObj({
|
||||
...slidePageObj,
|
||||
current,
|
||||
pageSize: slidePageObj.pageSize,
|
||||
});
|
||||
},
|
||||
};
|
||||
const newColumns = _.map([...slideColumns], (item) => {
|
||||
if (item.dataIndex === "declareMonth") {
|
||||
return {
|
||||
...item,
|
||||
width: 120,
|
||||
fixed: "left",
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
});
|
||||
const rowSelection = {
|
||||
selectedRowKeys: this.props.slideSelectedKey,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
return (
|
||||
<div className="cumDeductSlide">
|
||||
<Row className="topLabelBar">
|
||||
<Col span={4}>
|
||||
<span className="username">{currentRecord.username}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span className="formLabel">申报月份</span>
|
||||
<div className="weaRangePickerWrapper">
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker
|
||||
width={100}
|
||||
format="YYYY-MM"
|
||||
value={startDate}
|
||||
onChange={(v) => {
|
||||
let startDate = "";
|
||||
if (v != "" && v != undefined) {
|
||||
startDate = moment(v).format("YYYY-MM");
|
||||
}
|
||||
this.setState({ startDate });
|
||||
this.handleFetchCumDeductDetailList(
|
||||
startDate,
|
||||
endDate,
|
||||
taxAgentId
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="betweenLable">至</span>
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker
|
||||
width={100}
|
||||
value={endDate}
|
||||
onChange={(v) => {
|
||||
let endDate = "";
|
||||
if (v != "" && v != undefined) {
|
||||
endDate = moment(v).format("YYYY-MM");
|
||||
}
|
||||
this.setState({ endDate });
|
||||
this.handleFetchCumDeductDetailList(
|
||||
startDate,
|
||||
endDate,
|
||||
taxAgentId
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<span className="formLabel">个税扣缴义务人</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 100 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={(v) => {
|
||||
this.setState({ taxAgentId: v });
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, v);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: {taxAgentOption}} = this.props;
|
||||
const { otherDeductStore } = this.props;
|
||||
const { slideTableStore, currentRecord } = otherDeductStore;
|
||||
const { startDate, endDate, taxAgentId } = this.state;
|
||||
return (
|
||||
<div className="cumDeductSlide">
|
||||
<Row className="topLabelBar">
|
||||
<Col span={4}>
|
||||
<span className="username">{currentRecord.username}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span className="formLabel">申报月份</span>
|
||||
<div className="weaRangePickerWrapper">
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker width={100} format="YYYY-MM" value={startDate}
|
||||
onChange={(v) => {
|
||||
let startDate = "";
|
||||
if(v != "" && v!= undefined) {
|
||||
startDate = moment(v).format("YYYY-MM")
|
||||
}
|
||||
this.setState({startDate})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="betweenLable">
|
||||
至
|
||||
</span>
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker width={100}
|
||||
value={endDate}
|
||||
onChange={(v) => {
|
||||
let endDate = ""
|
||||
if(v != "" && v!= undefined) {
|
||||
endDate = moment(v).format("YYYY-MM")
|
||||
}
|
||||
this.setState({endDate})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, taxAgentId)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<span className="formLabel">个税扣缴义务人</span>
|
||||
<WeaSelect
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 100 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={v => {
|
||||
this.setState({taxAgentId: v})
|
||||
this.handleFetchCumDeductDetailList(startDate, endDate, v)
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={slideTableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
scroll={{x: slideTableStore.columns.length * 100}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
<div>
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={newColumns}
|
||||
dataSource={slideTableDataSource}
|
||||
pagination={pagination}
|
||||
loading={slideLoading}
|
||||
scroll={{ x: 900 }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,62 +1,82 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, Modal, message, Row, Col } from 'antd';
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom';
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
import moment from 'moment';
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../../components/customTab';
|
||||
import ContentWrapper from '../../../components/contentWrapper';
|
||||
import ImportModal from '../../../components/importModal'
|
||||
import { columns, dataSource, modalColumns } from './columns';
|
||||
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
DatePicker,
|
||||
Dropdown,
|
||||
Menu,
|
||||
Modal,
|
||||
message,
|
||||
Row,
|
||||
Col,
|
||||
} from "antd";
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaDatePicker,
|
||||
WeaSelect,
|
||||
WeaHelpfulTip,
|
||||
WeaSlideModal,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import moment from "moment";
|
||||
import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../../components/customTab";
|
||||
import ContentWrapper from "../../../components/contentWrapper";
|
||||
import ImportModal from "../../../components/importModal";
|
||||
import { modalColumns } from "./columns";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
import "./index.less"
|
||||
import "./index.less";
|
||||
|
||||
import SlideModalTitle from '../../../components/slideModalTitle';
|
||||
import EditSlideContent from './editSlideContent';
|
||||
import { optionAddAll } from '../../../util/options';
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import EditSlideContent from "./editSlideContent";
|
||||
import { optionAddAll } from "../../../util/options";
|
||||
|
||||
|
||||
@inject('otherDeductStore', "taxAgentStore")
|
||||
@inject("otherDeductStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class OtherDeduct extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
selectedKey: [],
|
||||
slideSelectedKey: [], //详情表格的选中项
|
||||
visiable: false,
|
||||
monthValue: "",
|
||||
taxAgentId: "",
|
||||
inited: false,
|
||||
modalParam: {
|
||||
declareMonth: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { otherDeductStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
||||
componentWillMount() {
|
||||
// 初始化渲染页面
|
||||
const {
|
||||
otherDeductStore: { doInit },
|
||||
taxAgentStore: { fetchTaxAgentOption },
|
||||
} = this.props;
|
||||
doInit();
|
||||
fetchTaxAgentOption().then(() => {
|
||||
this.setState({
|
||||
inited: true
|
||||
})
|
||||
})
|
||||
inited: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getSearchsAdQuick() {
|
||||
const { monthValue, taxAgentId } = this.state;
|
||||
const { taxAgentStore: { taxAgentOption }, otherDeductStore: {form, getTableDatas} } = this.props;
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
otherDeductStore: { form, getTableDatas },
|
||||
} = this.props;
|
||||
return (
|
||||
<div className="searchConditionWrapper">
|
||||
<div className="searchConditionItem">
|
||||
|
|
@ -118,81 +138,121 @@ export default class OtherDeduct extends React.Component {
|
|||
}
|
||||
|
||||
onEdit = (record) => {
|
||||
const { otherDeductStore: { slideVisiable, setSlideVisiable, getOtherDeductDetailList, setCurrentRecord } } = this.props;
|
||||
setSlideVisiable(true)
|
||||
setCurrentRecord(record)
|
||||
const {
|
||||
otherDeductStore: {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
getOtherDeductDetailList,
|
||||
setCurrentRecord,
|
||||
},
|
||||
} = this.props;
|
||||
setSlideVisiable(true);
|
||||
setCurrentRecord(record);
|
||||
getOtherDeductDetailList(record.id);
|
||||
}
|
||||
};
|
||||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = (columns) => {
|
||||
let newColumns = '';
|
||||
newColumns = columns.map(column => {
|
||||
let newColumns = "";
|
||||
newColumns = columns.map((column) => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch(newColumn.dataIndex) {
|
||||
newColumn.render = (text, record, index) => {
|
||||
//前端元素转义
|
||||
let valueSpan =
|
||||
record[newColumn.dataIndex + "span"] !== undefined
|
||||
? record[newColumn.dataIndex + "span"]
|
||||
: record[newColumn.dataIndex];
|
||||
switch (newColumn.dataIndex) {
|
||||
case "username":
|
||||
return <a onClick={() => {this.onEdit(record)}}
|
||||
dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}
|
||||
dangerouslySetInnerHTML={{ __html: valueSpan }}
|
||||
/>
|
||||
);
|
||||
case "operate":
|
||||
return <a onClick={() => {this.onEdit(record)}}>查看明细</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.onEdit(record);
|
||||
}}>
|
||||
查看明细
|
||||
</a>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
return newColumns;
|
||||
}
|
||||
};
|
||||
|
||||
handleCancel() {
|
||||
const { otherDeductStore } = this.props;
|
||||
const { modalVisiable, setModalVisiable, setStep } = otherDeductStore
|
||||
const { modalVisiable, setModalVisiable, setStep } = otherDeductStore;
|
||||
setModalVisiable(false);
|
||||
setStep(0);
|
||||
}
|
||||
|
||||
|
||||
onOperatesClick = (record, index, operate, flag) => {
|
||||
switch(operate.index.toString()){
|
||||
case '0': // 查看明细
|
||||
switch (operate.index.toString()) {
|
||||
case "0": // 查看明细
|
||||
this.onEdit(record);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
renderFormComponent() {
|
||||
const { modalParam } = this.state
|
||||
const { taxAgentStore: {taxAgentOption} } = this.props;
|
||||
const { modalParam } = this.state;
|
||||
const {
|
||||
taxAgentStore: { taxAgentOption },
|
||||
} = this.props;
|
||||
return (
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<span className="formLabel" style={{ lineHeight: "30px", marginRight: "10px" }}>税款所属期</span>
|
||||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={modalParam.declareMonth}
|
||||
onChange={value => this.setState({ modalParam: {declareMonth: value} })}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
</Row>
|
||||
)
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<span
|
||||
className="formLabel"
|
||||
style={{ lineHeight: "30px", marginRight: "10px" }}>
|
||||
税款所属期
|
||||
</span>
|
||||
<WeaDatePicker
|
||||
format="yyyy-MM"
|
||||
value={modalParam.declareMonth}
|
||||
onChange={(value) =>
|
||||
this.setState({ modalParam: { declareMonth: value } })
|
||||
}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
showColumn = () => {
|
||||
const { otherDeductStore: { tableStore } } = this.props;
|
||||
const {
|
||||
otherDeductStore: { tableStore },
|
||||
} = this.props;
|
||||
tableStore.setColSetVisible(true);
|
||||
tableStore.tableColSet(true);
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化导入参数
|
||||
handleInitImport() {
|
||||
const { otherDeductStore: {setSlideDataSource, setImportResult}} = this.props;
|
||||
setSlideDataSource([])
|
||||
setImportResult({})
|
||||
const {
|
||||
otherDeductStore: { setSlideDataSource, setImportResult },
|
||||
} = this.props;
|
||||
setSlideDataSource([]);
|
||||
setImportResult({});
|
||||
}
|
||||
|
||||
onSelectChange = (val) => {
|
||||
this.setState({
|
||||
selectedKey: val,
|
||||
});
|
||||
};
|
||||
|
||||
handleSearch() {
|
||||
const { otherDeductStore:{getTableDatas} } = this.props;
|
||||
const { monthValue, taxAgentId } = this.state;
|
||||
|
|
@ -207,105 +267,228 @@ export default class OtherDeduct extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { otherDeductStore, taxAgentStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, previewImport, importFile } = otherDeductStore;
|
||||
const { taxAgentOption } = taxAgentStore
|
||||
const { slideVisiable, setSlideVisiable, modalVisiable, setModalVisiable, slideTableStore, step, setStep, slideDataSource, importResult } = otherDeductStore
|
||||
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
|
||||
const { modalParam } = this.state;
|
||||
const { otherDeductStore, taxAgentStore, slideSelectedKey } = this.props;
|
||||
const {
|
||||
loading,
|
||||
dataSource,
|
||||
columns,
|
||||
pageObj,
|
||||
hasRight,
|
||||
form,
|
||||
condition,
|
||||
tableStore,
|
||||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd,
|
||||
previewImport,
|
||||
importFile,
|
||||
} = otherDeductStore;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
modalVisiable,
|
||||
setModalVisiable,
|
||||
slideTableStore,
|
||||
step,
|
||||
setStep,
|
||||
slideDataSource,
|
||||
importResult,
|
||||
setPageObj,
|
||||
} = otherDeductStore;
|
||||
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
|
||||
const { modalParam, monthValue, taxAgentId } = this.state;
|
||||
|
||||
const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || [];
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
{
|
||||
key: 'BTN_COLUMN',
|
||||
icon: <i className='icon-coms-Custom' />,
|
||||
content: '显示列定制',
|
||||
onClick: this.showColumn
|
||||
},
|
||||
const rightMenu = [
|
||||
// 右键菜单
|
||||
// {
|
||||
// key: "BTN_COLUMN",
|
||||
// icon: <i className="icon-coms-Custom" />,
|
||||
// content: "显示列定制",
|
||||
// onClick: this.showColumn,
|
||||
// },
|
||||
];
|
||||
const collectParams = { // 收藏功能配置
|
||||
favname: '其他免税扣除',
|
||||
const collectParams = {
|
||||
// 收藏功能配置
|
||||
favname: "其他免税扣除",
|
||||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: 'wui/index.html#/ns_demo03/index',
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1,
|
||||
};
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>,
|
||||
];
|
||||
|
||||
const topTab = [
|
||||
];
|
||||
const topTab = [];
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div></div>
|
||||
}
|
||||
return <div></div>;
|
||||
};
|
||||
|
||||
const handleButtonClick = () => {
|
||||
const { otherDeductStore: {exportOtherDeductList}} = this.props;
|
||||
const {
|
||||
otherDeductStore: { exportOtherDeductList },
|
||||
} = this.props;
|
||||
exportOtherDeductList();
|
||||
}
|
||||
};
|
||||
|
||||
const handleMenuClick = () => {
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
if (selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const { otherDeductStore: { exportOtherDeductList } } = this.props;
|
||||
exportOtherDeductList(selectedRowKeys.join(","))
|
||||
}
|
||||
const {
|
||||
otherDeductStore: { exportOtherDeductList },
|
||||
} = this.props;
|
||||
exportOtherDeductList(selectedRowKeys.join(","));
|
||||
};
|
||||
|
||||
const handleBtnImport = () => {
|
||||
const { otherDeductStore: { setModalVisiable, setStep } } = this.props;
|
||||
const {
|
||||
otherDeductStore: { setModalVisiable, setStep },
|
||||
} = this.props;
|
||||
setStep(0);
|
||||
setModalVisiable(true)
|
||||
}
|
||||
|
||||
|
||||
setModalVisiable(true);
|
||||
};
|
||||
|
||||
const btns = [
|
||||
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleBtnImport();
|
||||
}}>
|
||||
导入
|
||||
</Button>,
|
||||
<Dropdown.Button
|
||||
onClick={handleButtonClick}
|
||||
overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
]
|
||||
</Dropdown.Button>,
|
||||
];
|
||||
|
||||
const handleExportAllDetailClick = () => {
|
||||
const {otherDeductStore: {exportOtherDeductDetailList, currentRecord} } =this.props;
|
||||
const {
|
||||
otherDeductStore: { exportOtherDeductDetailList, currentRecord },
|
||||
} = this.props;
|
||||
exportOtherDeductDetailList(currentRecord.id);
|
||||
}
|
||||
};
|
||||
|
||||
const handleExportSelectedDetailClick = () => {
|
||||
if(detailSelectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
if (this.state.slideSelectedKey.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const { otherDeductStore: { exportOtherDeductDetailList, currentRecord } } = this.props;
|
||||
exportOtherDeductDetailList(currentRecord.id, detailSelectedRowKeys.join(","))
|
||||
}
|
||||
const {
|
||||
otherDeductStore: { exportOtherDeductDetailList, currentRecord },
|
||||
} = this.props;
|
||||
exportOtherDeductDetailList(
|
||||
currentRecord.id,
|
||||
this.state.slideSelectedKey.join(",")
|
||||
);
|
||||
};
|
||||
|
||||
const renderBtns = () => {
|
||||
return (
|
||||
<Dropdown.Button onClick={handleExportAllDetailClick} overlay={
|
||||
<Menu onClick={handleExportSelectedDetailClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
<Dropdown.Button
|
||||
onClick={handleExportAllDetailClick}
|
||||
overlay={
|
||||
<Menu onClick={handleExportSelectedDetailClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
)
|
||||
}
|
||||
</Dropdown.Button>
|
||||
);
|
||||
};
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys: this.state.selectedKey,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
const pagination = {
|
||||
total: pageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
setPageObj({ ...pageObj, current, pageSize });
|
||||
getTableDatas({
|
||||
current,
|
||||
pageSize,
|
||||
taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
onChange(current) {
|
||||
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
|
||||
getTableDatas({
|
||||
current,
|
||||
pageSize: pageObj.pageSize,
|
||||
taxAgentId,
|
||||
declareMonth: monthValue && [monthValue],
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const newColumns = _.map([...columns], (item) => {
|
||||
if (item.dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
width: 100,
|
||||
fixed: "left",
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
|
||||
{text}
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else if (item.dataIndex === "taxAgentName") {
|
||||
return {
|
||||
...item,
|
||||
width: 180,
|
||||
fixed: "left",
|
||||
};
|
||||
} else if (item.dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
width: 100,
|
||||
fixed: "right",
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => this.onEdit(record)}>
|
||||
查看明细
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="cumDeductWrapper">
|
||||
|
|
@ -314,80 +497,99 @@ export default class OtherDeduct extends React.Component {
|
|||
>
|
||||
<WeaTop
|
||||
title="其他免税扣除" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
buttons={btns}
|
||||
>
|
||||
|
||||
buttons={btns}>
|
||||
<div className="weaTabWrapper">
|
||||
<WeaTab
|
||||
searchType={['base', 'advanced']} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
showSearchAd={showSearchAd} // 是否展开高级搜索面板
|
||||
setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控
|
||||
setShowSearchAd={(bool) => setShowSearchAd(bool)} //高级搜索面板受控
|
||||
searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据
|
||||
buttonsAd={adBtn} // 高级搜索内部按钮
|
||||
onSearch={() => this.handleSearch()} // 点搜索按钮时的回调
|
||||
searchsAdQuick={this.getSearchsAdQuick()}
|
||||
onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
|
||||
onSearchChange={(v) => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
|
||||
searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
|
||||
/>
|
||||
</div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getColumns}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={newColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
scroll={{ x: 1300 }}
|
||||
/>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
{
|
||||
modalVisiable && <ImportModal
|
||||
{modalVisiable && (
|
||||
<ImportModal
|
||||
init={() => {
|
||||
this.handleInitImport()
|
||||
this.handleInitImport();
|
||||
}}
|
||||
templateLink={"/api/bs/hrmsalary/otherDeduction/downloadTemplate"}
|
||||
params={modalParam}
|
||||
columns={modalColumns}
|
||||
step={step}
|
||||
setStep={setStep}
|
||||
onFinish={() => {setModalVisiable(false); setStep(0); doSearch();}}
|
||||
onFinish={() => {
|
||||
setModalVisiable(false);
|
||||
setStep(0);
|
||||
doSearch();
|
||||
}}
|
||||
importResult={importResult}
|
||||
slideDataSource={slideDataSource}
|
||||
previewImport={(params) => {previewImport(params)}}
|
||||
importFile={(params) => {importFile(params)}}
|
||||
renderFormComponent={() => this.renderFormComponent()}
|
||||
visiable={modalVisiable}
|
||||
onCancel={() => { this.handleCancel() }}
|
||||
/>
|
||||
}
|
||||
{
|
||||
slideVisiable && <WeaSlideModal visible={slideVisiable}
|
||||
top={0}
|
||||
width={60}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"其他免税扣除记录"}
|
||||
subTabs={[{title: "基础设置"}]}
|
||||
onSave={() => {this.state.currentOperate == "add" ? doSave() : doUpdate()}}
|
||||
editable={false}
|
||||
btns={
|
||||
renderBtns()
|
||||
}
|
||||
/>
|
||||
}
|
||||
content={(<EditSlideContent />)}
|
||||
onClose={() => setSlideVisiable(false)}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => setSlideVisiable(false)} />
|
||||
}
|
||||
previewImport={(params) => {
|
||||
previewImport(params);
|
||||
}}
|
||||
importFile={(params) => {
|
||||
importFile(params);
|
||||
}}
|
||||
renderFormComponent={() => this.renderFormComponent()}
|
||||
visiable={modalVisiable}
|
||||
onCancel={() => {
|
||||
this.handleCancel();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{slideVisiable && (
|
||||
<WeaSlideModal
|
||||
visible={slideVisiable}
|
||||
top={0}
|
||||
width={60}
|
||||
height={100}
|
||||
direction={"right"}
|
||||
measure={"%"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"其他免税扣除记录"}
|
||||
subTabs={[{ title: "基础设置" }]}
|
||||
onSave={() => {
|
||||
this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
}}
|
||||
editable={false}
|
||||
btns={renderBtns()}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<EditSlideContent
|
||||
slideSelectedKey={slideSelectedKey}
|
||||
onChangeSlideSelectKey={(val) =>
|
||||
this.setState({ slideSelectedKey: val })
|
||||
}
|
||||
/>
|
||||
}
|
||||
onClose={() => setSlideVisiable(false)}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => setSlideVisiable(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
.cumDeductWrapper {
|
||||
.linkWapper {
|
||||
a {
|
||||
color: #4d7ad8;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,134 +1,181 @@
|
|||
import React from 'react'
|
||||
import { Modal, Button, Row, Col, Radio } from 'antd'
|
||||
import { WeaSelect, WeaBrowser } from "ecCom"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import RequiredLabelTip from '../../components/requiredLabelTip';
|
||||
import React from "react";
|
||||
import { Modal, Button, Row, Col, Radio } from "antd";
|
||||
import { WeaSelect, WeaBrowser } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip";
|
||||
|
||||
const objectOptions = [
|
||||
{
|
||||
key: "EMPLOYEE",
|
||||
showname: "人员",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: "DEPT",
|
||||
showname: "部门",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: "POSITION",
|
||||
showname: "岗位",
|
||||
selected: false
|
||||
}
|
||||
|
||||
]
|
||||
{
|
||||
key: "EMPLOYEE",
|
||||
showname: "人员",
|
||||
selected: false,
|
||||
},
|
||||
{
|
||||
key: "SUBCOMPANY",
|
||||
showname: "分部",
|
||||
selected: false,
|
||||
},
|
||||
{
|
||||
key: "DEPT",
|
||||
showname: "部门",
|
||||
selected: false,
|
||||
},
|
||||
{
|
||||
key: "POSITION",
|
||||
showname: "岗位",
|
||||
selected: false,
|
||||
},
|
||||
];
|
||||
|
||||
@inject('ledgerStore')
|
||||
@inject("ledgerStore")
|
||||
@observer
|
||||
export default class AddUserModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
selectedKey: "EMPLOYEE",
|
||||
radioValue: "ALL",
|
||||
ids: ""
|
||||
}
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "EMPLOYEE",
|
||||
radioValue: "ALL",
|
||||
ids: "",
|
||||
};
|
||||
}
|
||||
|
||||
onRadioChange(e) {
|
||||
this.setState({radioValue: e.target.value})
|
||||
}
|
||||
onRadioChange(e) {
|
||||
this.setState({ radioValue: e.target.value });
|
||||
}
|
||||
|
||||
// 保存
|
||||
handleSave() {
|
||||
const { ledgerStore: {saveLedgerPersonRange, salarySobId, includeType} } = this.props;
|
||||
saveLedgerPersonRange({
|
||||
salarySobId: salarySobId,
|
||||
includeType: includeType,
|
||||
employeeStatus: this.state.radioValue,
|
||||
targetParams: this.state.ids.split(",").map(id => ({targetType: this.state.selectedKey, targetId: id}))
|
||||
})
|
||||
}
|
||||
// 保存
|
||||
handleSave() {
|
||||
const {
|
||||
ledgerStore: { saveLedgerPersonRange, salarySobId, includeType },
|
||||
} = this.props;
|
||||
saveLedgerPersonRange({
|
||||
salarySobId: salarySobId,
|
||||
includeType: includeType,
|
||||
employeeStatus: this.state.radioValue,
|
||||
targetParams: this.state.ids
|
||||
.split(",")
|
||||
.map((id) => ({ targetType: this.state.selectedKey, targetId: id })),
|
||||
});
|
||||
}
|
||||
|
||||
// 重置
|
||||
handleReset() {
|
||||
this.setState({
|
||||
selectedKey: "EMPLOYEE",
|
||||
radioValue: "ALL",
|
||||
ids: ""
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
handleReset() {
|
||||
this.setState({
|
||||
selectedKey: "EMPLOYEE",
|
||||
radioValue: "ALL",
|
||||
ids: "",
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={600}
|
||||
title="关联人员"
|
||||
footer={
|
||||
<div style={{display:"inlne-block"}}>
|
||||
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
|
||||
<Button type="default" onClick={() => {this.handleReset()}}>重置</Button>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div style={{padding: "20px"}}>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={8}>对象类型<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<div style={{display: "inline-block", verticalAlign: "top"}}>
|
||||
<WeaSelect style={{height: "30px", marginRight: "10px"}} options={objectOptions} value={this.state.selectedKey} onChange={(value) => {
|
||||
this.setState({selectedKey: value, ids: ""})
|
||||
}}/>
|
||||
</div>
|
||||
<div style={{display: "inline-block", verticalAlign: "middle"}}>
|
||||
{
|
||||
this.state.selectedKey == "EMPLOYEE" && <WeaBrowser
|
||||
type={17}
|
||||
title={"人员选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ids})
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
this.state.selectedKey == "DEPT" && <WeaBrowser
|
||||
type={57}
|
||||
title={"部门选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ids})
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
this.state.selectedKey == "POSITION" && <WeaBrowser
|
||||
type={278}
|
||||
title={"岗位选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ids})
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={8}>选择员工状态<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<Radio.Group onChange={(e) => this.onRadioChange(e)} value={this.state.radioValue}>
|
||||
<Radio value={"ALL"}>全部</Radio>
|
||||
<Radio value={"NORMAL"}>在职</Radio>
|
||||
<Radio value={"UNAVAILABLE"}>离职</Radio>
|
||||
</Radio.Group>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<Modal
|
||||
visible={this.props.visible}
|
||||
onCancel={() => {
|
||||
this.props.onCancel();
|
||||
}}
|
||||
width={600}
|
||||
title="关联人员"
|
||||
footer={
|
||||
<div style={{ display: "inlne-block" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
this.handleSave();
|
||||
}}>
|
||||
保存
|
||||
</Button>
|
||||
<Button
|
||||
type="default"
|
||||
onClick={() => {
|
||||
this.handleReset();
|
||||
}}>
|
||||
重置
|
||||
</Button>
|
||||
</div>
|
||||
}>
|
||||
<div style={{ padding: "20px" }}>
|
||||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={8}>
|
||||
对象类型
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<div style={{ display: "inline-block", verticalAlign: "top" }}>
|
||||
<WeaSelect
|
||||
style={{ height: "30px", marginRight: "10px" }}
|
||||
options={objectOptions}
|
||||
value={this.state.selectedKey}
|
||||
onChange={(value) => {
|
||||
this.setState({ selectedKey: value, ids: "" });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: "inline-block", verticalAlign: "middle" }}>
|
||||
{this.state.selectedKey == "EMPLOYEE" && (
|
||||
<WeaBrowser
|
||||
type={17}
|
||||
title={"人员选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{this.state.selectedKey == "DEPT" && (
|
||||
<WeaBrowser
|
||||
type={57}
|
||||
title={"部门选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{this.state.selectedKey == "SUBCOMPANY" && (
|
||||
<WeaBrowser
|
||||
type={164}
|
||||
title={"分部选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{this.state.selectedKey == "POSITION" && (
|
||||
<WeaBrowser
|
||||
type={278}
|
||||
title={"岗位选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={8}>
|
||||
选择员工状态
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<Radio.Group
|
||||
onChange={(e) => this.onRadioChange(e)}
|
||||
value={this.state.radioValue}>
|
||||
<Radio value={"ALL"}>全部</Radio>
|
||||
<Radio value={"NORMAL"}>在职</Radio>
|
||||
<Radio value={"UNAVAILABLE"}>离职</Radio>
|
||||
</Radio.Group>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,12 +77,16 @@ export default class CalRulesForm extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { ledgerStore: {sobItemRuleDataSource}} = this.props;
|
||||
const { ledgerStore: {sobItemRuleDataSource,baseInfoRequest}} = this.props;
|
||||
const { canEdit="true" } = baseInfoRequest;
|
||||
let datas = this.convertDataSource(sobItemRuleDataSource)
|
||||
return (
|
||||
<div className="calRulesForm">
|
||||
<div className="headerIcon">
|
||||
<Icon className="iconItem" type="plus-square" onClick={() => {this.setState({modalVisible: true})}}/>
|
||||
{
|
||||
canEdit ==='true'&&
|
||||
<Icon className="iconItem" type="plus-square" onClick={() => {this.setState({modalVisible: true})}}/>
|
||||
}
|
||||
</div>
|
||||
<div className="tableWrapper">
|
||||
<WeaTable dataSource={datas} columns={this.state.slideStep4Columns} pagination={false}/>
|
||||
|
|
|
|||
|
|
@ -1,30 +1,36 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
|
||||
import { Button, Table, DatePicker, Switch, Modal } from 'antd';
|
||||
import { Button, Table, DatePicker, Switch, Modal, Dropdown, Menu } from "antd";
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch, WeaSlideModal } from 'ecCom';
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../components/customTab';
|
||||
import ContentWrapper from '../../components/contentWrapper';
|
||||
import StepSlide from '../../components/stepSlide'
|
||||
import SlideBaseForm from './slideBaseForm'
|
||||
import SlideRefereUser from './slideRefereUser'
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaInputSearch,
|
||||
WeaSlideModal,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../components/customTab";
|
||||
import ContentWrapper from "../../components/contentWrapper";
|
||||
import StepSlide from "../../components/stepSlide";
|
||||
import SlideBaseForm from "./slideBaseForm";
|
||||
import SlideRefereUser from "./slideRefereUser";
|
||||
|
||||
import { columns, dataSource } from './columns';
|
||||
import SalaryItemForm from './salaryItemForm';
|
||||
import CalRulesForm from './calcRulesForm';
|
||||
import ValidRulesForm from './validRulesForm';
|
||||
import SlideModalTitle from '../../components/slideModalTitle'
|
||||
import CopyFormModal from './copyFormModal'
|
||||
import { columns } from "./columns";
|
||||
import SalaryItemForm from "./salaryItemForm";
|
||||
import CalRulesForm from "./calcRulesForm";
|
||||
import ValidRulesForm from "./validRulesForm";
|
||||
import SlideModalTitle from "../../components/slideModalTitle";
|
||||
import CopyFormModal from "./copyFormModal";
|
||||
import "./index.less";
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
@inject('ledgerStore')
|
||||
@inject("ledgerStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class Ledger extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -39,224 +45,393 @@ export default class Ledger extends React.Component {
|
|||
selectedTab: 0,
|
||||
currentReocrd: {},
|
||||
searchValue: "",
|
||||
step1Request: {}
|
||||
}
|
||||
step1Request: {},
|
||||
};
|
||||
}
|
||||
|
||||
handleSearch(value) {
|
||||
const{ ledgerStore: {getTableDatas}} = this.props;
|
||||
getTableDatas({name: value})
|
||||
const {
|
||||
ledgerStore: { getTableDatas },
|
||||
} = this.props;
|
||||
getTableDatas({ name: value });
|
||||
}
|
||||
|
||||
refereUser() {
|
||||
this.setState({
|
||||
editSlideVisible: true,
|
||||
selectedTab: 1
|
||||
})
|
||||
selectedTab: 1,
|
||||
});
|
||||
}
|
||||
|
||||
onEdit() {
|
||||
this.setState({
|
||||
editSlideVisible: true
|
||||
})
|
||||
editSlideVisible: true,
|
||||
});
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { ledgerStore : {doInit}} = this.props;
|
||||
doInit()
|
||||
const {
|
||||
ledgerStore: { doInit },
|
||||
taxAgentStore: { fetchTaxAgentOption },
|
||||
} = this.props;
|
||||
doInit();
|
||||
fetchTaxAgentOption();
|
||||
}
|
||||
|
||||
|
||||
handleItemStatusChange(value, record) {
|
||||
const { ledgerStore: { changeLedgerStatus }} = this.props;
|
||||
const {
|
||||
ledgerStore: { changeLedgerStatus },
|
||||
} = this.props;
|
||||
changeLedgerStatus(record.id, value ? 0 : 1);
|
||||
}
|
||||
|
||||
|
||||
handleItemClick(record, selectedTab = 0) {
|
||||
const { ledgerStore: {setSalarySobId} } = this.props;
|
||||
setSalarySobId(record.id)
|
||||
const {
|
||||
ledgerStore: { setSalarySobId },
|
||||
} = this.props;
|
||||
setSalarySobId(record.id);
|
||||
this.setState({
|
||||
selectedTab,
|
||||
editSlideVisible: true,
|
||||
request: record
|
||||
})
|
||||
request: record,
|
||||
});
|
||||
}
|
||||
|
||||
// 编辑Slide保存按钮
|
||||
handleEditSlideSave() {
|
||||
const { selectedTab, step1Request } = this.state;
|
||||
const { ledgerStore: {saveLedgerItem, saveAdjustmentRule, saveLedgerBasic, baseInfoRequest}} = this.props;
|
||||
if(selectedTab == 0) {
|
||||
saveLedgerBasic(baseInfoRequest)
|
||||
} else if(selectedTab == 2) {
|
||||
saveLedgerItem()
|
||||
} else if(selectedTab == 3) {
|
||||
saveAdjustmentRule()
|
||||
}
|
||||
const {
|
||||
ledgerStore: {
|
||||
saveLedgerItem,
|
||||
saveAdjustmentRule,
|
||||
saveLedgerBasic,
|
||||
baseInfoRequest,
|
||||
},
|
||||
} = this.props;
|
||||
if (selectedTab == 0) {
|
||||
saveLedgerBasic(baseInfoRequest);
|
||||
} else if (selectedTab == 2) {
|
||||
saveLedgerItem();
|
||||
} else if (selectedTab == 3) {
|
||||
saveAdjustmentRule();
|
||||
}
|
||||
}
|
||||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = (columns) => {
|
||||
let newColumns = '';
|
||||
newColumns = columns.map(column => {
|
||||
let newColumns = "";
|
||||
newColumns = columns.map((column) => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch(newColumn.dataIndex) {
|
||||
case 'name':
|
||||
return <a onClick={() => {this.handleItemClick(record)}}>{text}</a>
|
||||
newColumn.render = (text, record, index) => {
|
||||
//前端元素转义
|
||||
let valueSpan =
|
||||
record[newColumn.dataIndex + "span"] !== undefined
|
||||
? record[newColumn.dataIndex + "span"]
|
||||
: record[newColumn.dataIndex];
|
||||
switch (newColumn.dataIndex) {
|
||||
case "name":
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleItemClick(record);
|
||||
}}>
|
||||
{text}
|
||||
</a>
|
||||
);
|
||||
case "disable":
|
||||
return <Switch checked={text == 0} onChange={(value) => {this.handleItemStatusChange(value, record)}}/>
|
||||
return (
|
||||
<Switch
|
||||
checked={text == 0}
|
||||
onChange={(value) => {
|
||||
this.handleItemStatusChange(value, record);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
case "operate":
|
||||
return <a onClick={() => {this.handleItemClick(record, 1)}}>关联人员</a>
|
||||
return (
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleItemClick(record, 1);
|
||||
}}>
|
||||
关联人员
|
||||
</a>
|
||||
);
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
return newColumns;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onOperatesClick = (record, index, operate, flag) => {
|
||||
const { ledgerStore: { deleteLedger }} = this.props;
|
||||
switch(operate.index.toString()){
|
||||
onOperatesClick = (record, type) => {
|
||||
const {
|
||||
ledgerStore: { deleteLedger },
|
||||
} = this.props;
|
||||
switch (type.toString()) {
|
||||
case "0": // 编辑
|
||||
this.handleItemClick(record)
|
||||
this.handleItemClick(record);
|
||||
break;
|
||||
case '1': // 复制
|
||||
case "1": // 复制
|
||||
this.setState({
|
||||
copyFormVisible: true,
|
||||
currentReocrd: record
|
||||
})
|
||||
currentReocrd: record,
|
||||
});
|
||||
break;
|
||||
case "3": // 关联人员
|
||||
this.handleItemClick(record, 1)
|
||||
this.handleItemClick(record, 1);
|
||||
break;
|
||||
case "4": // 删除
|
||||
Modal.confirm({
|
||||
title: '信息确认',
|
||||
content: '确认删除',
|
||||
onOk:() => {
|
||||
deleteLedger([record.id])
|
||||
},
|
||||
onCancel: () => {
|
||||
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
onOk: () => {
|
||||
deleteLedger([record.id]);
|
||||
},
|
||||
onCancel: () => {},
|
||||
});
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
handleCopySave = (value) => {
|
||||
const { ledgerStore: { doCopy}} = this.props
|
||||
const {
|
||||
ledgerStore: { doCopy },
|
||||
} = this.props;
|
||||
doCopy(this.state.currentReocrd.id, value).then(() => {
|
||||
this.setState({copyFormVisible: false})
|
||||
})
|
||||
}
|
||||
this.setState({ copyFormVisible: false });
|
||||
});
|
||||
};
|
||||
|
||||
handleNew = () => {
|
||||
const { ledgerStore: { initSlideData }} = this.props;
|
||||
const {
|
||||
ledgerStore: { initSlideData },
|
||||
} = this.props;
|
||||
initSlideData();
|
||||
this.setState({stepSlideVisible: true, currentStep: 0})
|
||||
}
|
||||
this.setState({ stepSlideVisible: true, currentStep: 0 });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { ledgerStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = ledgerStore;
|
||||
const {
|
||||
loading,
|
||||
dataSource,
|
||||
columns,
|
||||
pageObj,
|
||||
setPageObj,
|
||||
hasRight,
|
||||
form,
|
||||
condition,
|
||||
tableStore,
|
||||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd,
|
||||
baseInfoRequest,
|
||||
} = ledgerStore;
|
||||
const { canEdit = "true" } = baseInfoRequest;
|
||||
const { currentStep, selectedTab } = this.state;
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
{
|
||||
key: 'BTN_COLUMN',
|
||||
icon: <i className='icon-coms-Custom' />,
|
||||
content: '显示列定制',
|
||||
onClick: this.showColumn
|
||||
const rightMenu = [
|
||||
// 右键菜单
|
||||
{
|
||||
key: "BTN_COLUMN",
|
||||
icon: <i className="icon-coms-Custom" />,
|
||||
content: "显示列定制",
|
||||
onClick: this.showColumn,
|
||||
},
|
||||
];
|
||||
const collectParams = { // 收藏功能配置
|
||||
favname: '薪资账套',
|
||||
const collectParams = {
|
||||
// 收藏功能配置
|
||||
favname: "薪资账套",
|
||||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: 'wui/index.html#/ns_demo03/index',
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1,
|
||||
};
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>,
|
||||
];
|
||||
|
||||
const topTab = [
|
||||
];
|
||||
const topTab = [];
|
||||
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Button type="primary" style={{marginRight: "10px"}} onClick={() => this.handleNew()}>新建</Button>
|
||||
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() => this.handleNew()}>
|
||||
新建
|
||||
</Button>
|
||||
<WeaInputSearch
|
||||
value={this.state.searchValue}
|
||||
onChange={(value) => {
|
||||
this.setState({ searchValue: value });
|
||||
}}
|
||||
onSearch={(value) => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const nextStep = () => {
|
||||
const { currentStep } = this.state;
|
||||
this.setState({currentStep: currentStep + 1})
|
||||
}
|
||||
this.setState({ currentStep: currentStep + 1 });
|
||||
};
|
||||
|
||||
const prevStep = () => {
|
||||
const { currentStep } = this.state;
|
||||
this.setState({currentStep: currentStep - 1});
|
||||
}
|
||||
this.setState({ currentStep: currentStep - 1 });
|
||||
};
|
||||
const steps = [
|
||||
"基础设置",
|
||||
"关联人员",
|
||||
"薪资项目",
|
||||
"调薪记薪规则",
|
||||
// "校验规则",
|
||||
]
|
||||
];
|
||||
|
||||
const handleStep1Save = () => {
|
||||
const { step1Request } = this.state;
|
||||
const { ledgerStore: {saveLedgerBasic, baseInfoRequest} } = this.props;
|
||||
const {
|
||||
ledgerStore: { saveLedgerBasic, baseInfoRequest },
|
||||
} = this.props;
|
||||
saveLedgerBasic(baseInfoRequest).then(() => {
|
||||
nextStep();
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
const handleStep3Save = () => {
|
||||
const { ledgerStore: {saveAdjustmentRule} } = this.props;
|
||||
const {
|
||||
ledgerStore: { saveAdjustmentRule },
|
||||
} = this.props;
|
||||
saveAdjustmentRule().then(() => {
|
||||
nextStep()
|
||||
})
|
||||
}
|
||||
nextStep();
|
||||
});
|
||||
};
|
||||
|
||||
const handleStepSave = () => {
|
||||
const { currentStep } = this.state;
|
||||
const { ledgerStore: { saveLedgerBasic, saveLedgerItem, saveAdjustmentRule, baseInfoRequest }} = this.props;
|
||||
if(currentStep == 0) {
|
||||
const {
|
||||
ledgerStore: {
|
||||
saveLedgerBasic,
|
||||
saveLedgerItem,
|
||||
saveAdjustmentRule,
|
||||
baseInfoRequest,
|
||||
},
|
||||
} = this.props;
|
||||
if (currentStep == 0) {
|
||||
saveLedgerBasic(baseInfoRequest).then(() => {
|
||||
nextStep();
|
||||
})
|
||||
} else if(currentStep == 1) {
|
||||
nextStep()
|
||||
}else if(currentStep == 2) {
|
||||
});
|
||||
} else if (currentStep == 1) {
|
||||
nextStep();
|
||||
} else if (currentStep == 2) {
|
||||
saveLedgerItem().then(() => {
|
||||
nextStep()
|
||||
})
|
||||
} else if(currentStep == 3) {
|
||||
nextStep();
|
||||
});
|
||||
} else if (currentStep == 3) {
|
||||
saveAdjustmentRule().then(() => {
|
||||
this.setState({stepSlideVisible: false})
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setState({ stepSlideVisible: false });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const pagination = {
|
||||
total: pageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
setPageObj({ ...pageObj, current, pageSize });
|
||||
getTableDatas({ current, pageSize, name: this.state.searchValue });
|
||||
},
|
||||
onChange(current) {
|
||||
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
|
||||
getTableDatas({
|
||||
current,
|
||||
pageSize: pageObj.pageSize,
|
||||
name: this.state.searchValue,
|
||||
});
|
||||
},
|
||||
};
|
||||
const newColumns = _.map([...columns], (item) => {
|
||||
if (item.dataIndex === "name") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a
|
||||
href="javaScript:void(0);"
|
||||
onClick={() => {
|
||||
this.handleItemClick(record);
|
||||
}}>
|
||||
{text}
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else if (item.dataIndex === "disable") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => (
|
||||
<Switch
|
||||
checked={text == 0}
|
||||
onChange={(value) => {
|
||||
this.handleItemStatusChange(value, record);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
};
|
||||
} else if (item.dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a
|
||||
onClick={() => {
|
||||
this.handleItemClick(record, 1);
|
||||
}}>
|
||||
关联人员
|
||||
</a>
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu
|
||||
onClick={(item) => this.onOperatesClick(record, item.key)}>
|
||||
<Menu.Item key="0">编辑</Menu.Item>
|
||||
<Menu.Item key="1">复制</Menu.Item>
|
||||
<Menu.Item key="3">关联人员</Menu.Item>
|
||||
<Menu.Item key="4">删除</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a className="ant-dropdown-link" href="javaScript:void(0);">
|
||||
<i className="icon-coms-more" style={{ marginLeft: 18 }} />
|
||||
</a>
|
||||
</Dropdown>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
|
|
@ -266,140 +441,181 @@ export default class Ledger extends React.Component {
|
|||
>
|
||||
<WeaTop
|
||||
title="薪资账套" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
onChange={(v) => {
|
||||
|
||||
}}
|
||||
/>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
|
||||
getColumns={this.getColumns}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
<CustomTab
|
||||
searchOperationItem={renderRightOperation()}
|
||||
onChange={(v) => {}}
|
||||
/>
|
||||
{
|
||||
this.state.stepSlideVisible && <StepSlide
|
||||
visible={this.state.stepSlideVisible}
|
||||
steps={steps}
|
||||
currentStep={currentStep}
|
||||
onCancel={() => {this.setState({stepSlideVisible: false})}}
|
||||
customOperate = {
|
||||
<div style={{display: "inline-block"}}>
|
||||
{
|
||||
currentStep == 0 && <Button type="primary" onClick={() => {handleStep1Save()}}>保存并进入下一步</Button>
|
||||
}
|
||||
{
|
||||
currentStep == 1 && <div style={{display: "inline-block"}}>
|
||||
<Button type="default" onClick={() => {this.setState({stepSlideVisible: false})}}>完成,跳过所有步骤</Button>
|
||||
<Button type="primary" style={{marginLeft: "10px"}} onClick={() => {handleStepSave()}}>下一步</Button>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
currentStep == 2 && <div>
|
||||
<Button type="default" onClick={() => {this.setState({stepSlideVisible: false})}}>完成,跳过所有步骤</Button>
|
||||
<Button type="default" style={{marginLeft: "10px"}} onClick={() => {prevStep()}}>上一步</Button>
|
||||
<Button type="primary" style={{marginLeft: '10px'}} onClick={() => {handleStepSave()}}>保存并进入下一步</Button>
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
columns={newColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
scroll={{ x: 1300 }}
|
||||
/>
|
||||
{this.state.stepSlideVisible && (
|
||||
<StepSlide
|
||||
visible={this.state.stepSlideVisible}
|
||||
steps={steps}
|
||||
currentStep={currentStep}
|
||||
onCancel={() => {
|
||||
this.setState({ stepSlideVisible: false });
|
||||
}}
|
||||
customOperate={
|
||||
<div style={{ display: "inline-block" }}>
|
||||
{currentStep == 0 && (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleStep1Save();
|
||||
}}>
|
||||
保存并进入下一步
|
||||
</Button>
|
||||
)}
|
||||
{currentStep == 1 && (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Button
|
||||
type="default"
|
||||
onClick={() => {
|
||||
this.setState({ stepSlideVisible: false });
|
||||
}}>
|
||||
完成,跳过所有步骤
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginLeft: "10px" }}
|
||||
onClick={() => {
|
||||
handleStepSave();
|
||||
}}>
|
||||
下一步
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
currentStep == 3 &&
|
||||
)}
|
||||
{currentStep == 2 && (
|
||||
<div>
|
||||
<Button type="default" style={{marginRight: "10px"}} onClick={() => {prevStep()}}>上一步</Button>
|
||||
<Button type="primary" onClick={() => {handleStepSave()}}>完成</Button>
|
||||
<Button
|
||||
type="default"
|
||||
onClick={() => {
|
||||
this.setState({ stepSlideVisible: false });
|
||||
}}>
|
||||
完成,跳过所有步骤
|
||||
</Button>
|
||||
<Button
|
||||
type="default"
|
||||
style={{ marginLeft: "10px" }}
|
||||
onClick={() => {
|
||||
prevStep();
|
||||
}}>
|
||||
上一步
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginLeft: "10px" }}
|
||||
onClick={() => {
|
||||
handleStepSave();
|
||||
}}>
|
||||
保存并进入下一步
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
}
|
||||
</div>
|
||||
}
|
||||
title="新建账套"
|
||||
content={
|
||||
<div>
|
||||
{
|
||||
currentStep == 0 && <SlideBaseForm />
|
||||
}
|
||||
{
|
||||
currentStep == 1 && <SlideRefereUser />
|
||||
}
|
||||
{
|
||||
currentStep == 2 && <SalaryItemForm />
|
||||
}
|
||||
{
|
||||
currentStep == 3 && <CalRulesForm />
|
||||
}
|
||||
{/* {
|
||||
)}
|
||||
{currentStep == 3 && (
|
||||
<div>
|
||||
<Button
|
||||
type="default"
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() => {
|
||||
prevStep();
|
||||
}}>
|
||||
上一步
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleStepSave();
|
||||
}}>
|
||||
完成
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
title="新建账套"
|
||||
content={
|
||||
<div>
|
||||
{currentStep == 0 && <SlideBaseForm />}
|
||||
{currentStep == 1 && <SlideRefereUser />}
|
||||
{currentStep == 2 && <SalaryItemForm />}
|
||||
{currentStep == 3 && <CalRulesForm />}
|
||||
{/* {
|
||||
currentStep == 4 && <ValidRulesForm />
|
||||
} */}
|
||||
|
||||
</div>
|
||||
|
||||
}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
|
||||
{
|
||||
this.state.editSlideVisible &&
|
||||
<WeaSlideModal visible={this.state.editSlideVisible}
|
||||
{this.state.editSlideVisible && (
|
||||
<WeaSlideModal
|
||||
visible={this.state.editSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
direction={"right"}
|
||||
measure={"%"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
<SlideModalTitle
|
||||
subtitle={"编辑账套"}
|
||||
tabs={[{title: '基础设置', key: 0}, {title: "关联人员", key: 1}, {title: "薪资项目", key: 2}, {title: '调薪计薪规则', key: 3}]}
|
||||
editable={true}
|
||||
tabs={[
|
||||
{ title: "基础设置", key: 0 },
|
||||
{ title: "关联人员", key: 1 },
|
||||
{ title: "薪资项目", key: 2 },
|
||||
{ title: "调薪计薪规则", key: 3 },
|
||||
]}
|
||||
editable={canEdit === "true"}
|
||||
selectedTab={selectedTab}
|
||||
onSave={() => this.handleEditSlideSave()}
|
||||
subItemChange={
|
||||
(item) => {this.setState({selectedTab: item.key})}
|
||||
}
|
||||
subItemChange={(item) => {
|
||||
this.setState({ selectedTab: item.key });
|
||||
}}
|
||||
/>
|
||||
}
|
||||
content={<div>
|
||||
{
|
||||
selectedTab == 0 && <SlideBaseForm edit={true} />
|
||||
}
|
||||
{
|
||||
selectedTab == 1 && <SlideRefereUser edit={true} />
|
||||
}
|
||||
{
|
||||
selectedTab == 2 && <SalaryItemForm edit={true}/>
|
||||
}
|
||||
{
|
||||
selectedTab == 3 && <CalRulesForm edit={true}/>
|
||||
}
|
||||
{/* {
|
||||
content={
|
||||
<div>
|
||||
{selectedTab == 0 && <SlideBaseForm edit={true} />}
|
||||
{selectedTab == 1 && <SlideRefereUser edit={true} />}
|
||||
{selectedTab == 2 && <SalaryItemForm edit={true} />}
|
||||
{selectedTab == 3 && <CalRulesForm edit={true} />}
|
||||
{/* {
|
||||
selectedTab == 4 && <ValidRulesForm edit={true}/>
|
||||
} */}
|
||||
</div>}
|
||||
onClose={() => this.setState({editSlideVisible: false})}
|
||||
</div>
|
||||
}
|
||||
onClose={() => this.setState({ editSlideVisible: false })}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
|
||||
}
|
||||
closeMaskOnClick={() =>
|
||||
this.setState({ editSlideVisible: false })
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
|
||||
{
|
||||
this.state.copyFormVisible &&
|
||||
<CopyFormModal
|
||||
{this.state.copyFormVisible && (
|
||||
<CopyFormModal
|
||||
visible={this.state.copyFormVisible}
|
||||
onSave={(value) => this.handleCopySave(value)}
|
||||
onCancel={() => {this.setState({copyFormVisible: false})}}
|
||||
onCancel={() => {
|
||||
this.setState({ copyFormVisible: false });
|
||||
}}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,146 +1,187 @@
|
|||
.slideBaseForm {
|
||||
.leftContentWrapper {
|
||||
margin: 10px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
}
|
||||
.rightContentWrapper {
|
||||
margin: 10px;
|
||||
}
|
||||
.leftContentWrapper {
|
||||
margin: 10px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.rightContentWrapper {
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.rightContentWrapper {
|
||||
.greytip {
|
||||
color: #999;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.tipLabel {
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
}
|
||||
.higelinered {
|
||||
color: red;
|
||||
}
|
||||
.greytip {
|
||||
color: #999;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tipLabel {
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.higelinered {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.slideRefereUser {
|
||||
.tabItem {
|
||||
cursor: pointer;
|
||||
.tabItem {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.refereUserHeader {
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.headerLeft {
|
||||
display: inline-block;
|
||||
color: #666;
|
||||
|
||||
.selectedCrumbs {
|
||||
color: #4ba9f2;
|
||||
}
|
||||
.refereUserHeader {
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.headerLeft {
|
||||
display: inline-block;
|
||||
color: #666;
|
||||
.selectedCrumbs {
|
||||
color: #4ba9f2;
|
||||
}
|
||||
|
||||
}
|
||||
.headerIcon {
|
||||
float: right;
|
||||
}
|
||||
.searchInput {
|
||||
margin-top: 10px;
|
||||
float: right;
|
||||
}
|
||||
.headerIcon {
|
||||
color: #4ba9f2;
|
||||
display: inline-block;
|
||||
.iconItem {
|
||||
cursor: pointer;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.headerIcon {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.searchInput {
|
||||
margin-top: 10px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.headerIcon {
|
||||
color: #4ba9f2;
|
||||
display: inline-block;
|
||||
|
||||
.iconItem {
|
||||
cursor: pointer;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.salaryItemForm {
|
||||
padding: 10px 20px;
|
||||
.btnBar {
|
||||
height: 47px;
|
||||
.btns {
|
||||
display: inline-block;
|
||||
}
|
||||
.searchInputWrapper {
|
||||
float: right;
|
||||
display: inline-block;
|
||||
}
|
||||
padding: 10px 20px;
|
||||
|
||||
.btnBar {
|
||||
height: 47px;
|
||||
|
||||
.btns {
|
||||
display: inline-block;
|
||||
}
|
||||
.userInfoWrapper {
|
||||
overflow: hidden;
|
||||
.rightBtnsWrapper {
|
||||
float: right;
|
||||
display: inline-block;
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
|
||||
.searchInputWrapper {
|
||||
float: right;
|
||||
display: inline-block;
|
||||
}
|
||||
.userInfoSelected {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.userInfoWrapper {
|
||||
overflow: hidden;
|
||||
|
||||
.rightBtnsWrapper {
|
||||
float: right;
|
||||
display: inline-block;
|
||||
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
.tableItemWrapper {
|
||||
margin-top: 10px;
|
||||
.rightBtnsWrapper {
|
||||
float: right;
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
.itemTitle {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.userInfoSelected {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.tableItemWrapper {
|
||||
margin-top: 10px;
|
||||
|
||||
.rightBtnsWrapper {
|
||||
float: right;
|
||||
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
|
||||
.itemTitle {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.calRulesForm {
|
||||
padding: 10px 20px;
|
||||
.headerIcon {
|
||||
float: right;
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
.tableWrapper {
|
||||
margin-top: 20px;
|
||||
padding: 10px 20px;
|
||||
|
||||
.headerIcon {
|
||||
float: right;
|
||||
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.validRulesForm {
|
||||
padding: 10px 20px;
|
||||
.headerBar {
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
.inputSearch {
|
||||
margin-top: 8px;
|
||||
float: right;
|
||||
}
|
||||
.btnsWrapper {
|
||||
float: right;
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
padding: 10px 20px;
|
||||
|
||||
.headerBar {
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
|
||||
.inputSearch {
|
||||
margin-top: 8px;
|
||||
float: right;
|
||||
}
|
||||
.tableWrapper {
|
||||
margin-top: 20px;
|
||||
|
||||
.btnsWrapper {
|
||||
float: right;
|
||||
|
||||
.iconItem {
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.mySalaryBenefitsWrapper {
|
||||
.linkWapper {
|
||||
a {
|
||||
color: #4d7ad8;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -83,14 +83,15 @@ export default class SalaryItemForm extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible}} = this.props;
|
||||
const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible, baseInfoRequest}} = this.props;
|
||||
const { canEdit="true" } = baseInfoRequest;
|
||||
const { previewVisible } = this.state;
|
||||
return (
|
||||
<div className="salaryItemForm">
|
||||
<div className="btnBar">
|
||||
<div className="btns">
|
||||
<Button type="default" onClick={() => {setAddCategoryVisible(true)}}>新增分类</Button>
|
||||
<Button type="default" style={{marginLeft: "10px"}} onClick={() => {this.handlePreview()}}>预览</Button>
|
||||
<Button type="default" onClick={() => {setAddCategoryVisible(true)}} disabled={canEdit !== 'true'}>新增分类</Button>
|
||||
<Button type="default" style={{marginLeft: "10px"}} onClick={() => {this.handlePreview()}} disabled={canEdit !== "true"}>预览</Button>
|
||||
</div>
|
||||
{/* <div className="searchInputWrapper">
|
||||
<WeaInputSearch style={{width: "150px"}} />
|
||||
|
|
@ -120,11 +121,8 @@ export default class SalaryItemForm extends React.Component {
|
|||
if(item.items) {
|
||||
item.items && item.items.map(i => {i.key = i.id})
|
||||
return (
|
||||
<CanMoveItem dataSource={toJS(item.items)}
|
||||
onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}} title={item.name}
|
||||
onGroupDelete={() => {this.handleGroupDelete(item)}}
|
||||
onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
|
||||
)
|
||||
<CanMoveItem disabled={canEdit !== "true"} dataSource={toJS(item.items)} onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}} title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
|
||||
)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,151 +1,319 @@
|
|||
import React from 'react'
|
||||
import { Row, Col } from 'antd'
|
||||
import { WeaSelect, WeaTextarea, WeaInput, WeaCheckbox } from "ecCom"
|
||||
import "./index.less"
|
||||
import TipLabel from '../../components/TipLabel'
|
||||
import { daysOptions, cycleTypeOption } from './options'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip"
|
||||
import { getCurrentYearMonth, getCurrentMonth, getSubtractMonthYearMonth, getAddMonthYearMonth} from '../../util/date'
|
||||
import React from "react";
|
||||
import { Row, Col } from "antd";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaSelect, WeaTextarea, WeaInput, WeaCheckbox } from "ecCom";
|
||||
import "./index.less";
|
||||
import TipLabel from "../../components/TipLabel";
|
||||
import { daysOptions, cycleTypeOption } from "./options";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip";
|
||||
import {
|
||||
getCurrentYearMonth,
|
||||
getCurrentMonth,
|
||||
getSubtractMonthYearMonth,
|
||||
getAddMonthYearMonth,
|
||||
} from "../../util/date";
|
||||
|
||||
@inject('ledgerStore')
|
||||
@inject("ledgerStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class SlideBaseForm extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
name: "",
|
||||
taxableItems: 1
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
name: "",
|
||||
taxableItems: 1,
|
||||
};
|
||||
}
|
||||
componentWillMount() {
|
||||
const { edit } = this.props;
|
||||
const {
|
||||
ledgerStore: { initBaseInfoRequest },
|
||||
} = this.props;
|
||||
if (edit) {
|
||||
const {
|
||||
ledgerStore: { getLedgerBasicForm },
|
||||
} = this.props;
|
||||
getLedgerBasicForm();
|
||||
} else {
|
||||
initBaseInfoRequest();
|
||||
}
|
||||
componentWillMount() {
|
||||
const { edit } = this.props;
|
||||
const { ledgerStore: {initBaseInfoRequest}} = this.props;
|
||||
if(edit) {
|
||||
const { ledgerStore: { getLedgerBasicForm }} = this.props;
|
||||
getLedgerBasicForm()
|
||||
} else {
|
||||
initBaseInfoRequest();
|
||||
}
|
||||
}
|
||||
|
||||
handleChange(params) {
|
||||
const {
|
||||
ledgerStore: { baseInfoRequest, setBaseInfoRequest },
|
||||
} = this.props;
|
||||
let request = { ...baseInfoRequest };
|
||||
Object.keys(params).map((key) => {
|
||||
request[key] = params[key];
|
||||
});
|
||||
setBaseInfoRequest(request);
|
||||
}
|
||||
|
||||
// 获取开始日期
|
||||
getStartDate(salaryCycleType, day) {
|
||||
day = Number(day);
|
||||
return this.getMonth(salaryCycleType) + "-" + (day < 10 ? "0" + day : day);
|
||||
}
|
||||
|
||||
// 获取开始月份
|
||||
getMonth(salaryCycleType) {
|
||||
switch (salaryCycleType) {
|
||||
case "1": // 上上月
|
||||
return getSubtractMonthYearMonth(2);
|
||||
case "2": // 上月
|
||||
return getSubtractMonthYearMonth(1);
|
||||
case "3": // 本月
|
||||
return getCurrentYearMonth();
|
||||
case "4": // 下月
|
||||
return getAddMonthYearMonth(1);
|
||||
}
|
||||
}
|
||||
|
||||
handleChange(params) {
|
||||
const { ledgerStore: {baseInfoRequest, setBaseInfoRequest}} = this.props;
|
||||
let request= {...baseInfoRequest}
|
||||
Object.keys(params).map(key => {
|
||||
request[key] = params[key]
|
||||
})
|
||||
setBaseInfoRequest(request)
|
||||
}
|
||||
render() {
|
||||
const { request, ledgerStore, taxAgentStore, edit } = this.props;
|
||||
const { baseInfoRequest } = ledgerStore;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const {
|
||||
canEdit="true",
|
||||
name,
|
||||
taxAgentId,
|
||||
taxableItems,
|
||||
salaryCycleType,
|
||||
salaryCycleFromDay,
|
||||
taxCycleType,
|
||||
attendCycleType,
|
||||
attendCycleFromDay,
|
||||
socialSecurityCycleType,
|
||||
description,
|
||||
} = baseInfoRequest;
|
||||
return (
|
||||
<div className="slideBaseForm">
|
||||
<Row>
|
||||
<Col span={18}>
|
||||
<div className="leftContentWrapper">
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
账套名称
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput
|
||||
disabled={canEdit !== "true"}
|
||||
style={{ width: "190px" }}
|
||||
value={name}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ name: value });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
个税扣缴义务人
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true" || edit}
|
||||
showSearch // 设置select可搜索
|
||||
style={{ width: 190 }}
|
||||
options={taxAgentOption}
|
||||
value={taxAgentId}
|
||||
onChange={(v) => {
|
||||
this.handleChange({ taxAgentId: v });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
薪资类型
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true"}
|
||||
options={[
|
||||
{
|
||||
key: "1",
|
||||
selected: true,
|
||||
showname: "正常工资薪金所得",
|
||||
},
|
||||
]}
|
||||
style={{ width: "190px" }}
|
||||
value={taxableItems}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ taxableItems: value });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
薪资周期
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true"}
|
||||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={salaryCycleType}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ salaryCycleType: value });
|
||||
}}
|
||||
/>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true"}
|
||||
options={daysOptions}
|
||||
style={{ width: "90px", marginLeft: "10px" }}
|
||||
value={salaryCycleFromDay}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ salaryCycleFromDay: value });
|
||||
}}
|
||||
/>
|
||||
<span style={{ marginLeft: "10px" }}>至本月最后一天</span>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
税款所属期
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true"}
|
||||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={taxCycleType}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ taxCycleType: value });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
考勤周期
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true"}
|
||||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={attendCycleType}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ attendCycleType: value });
|
||||
}}
|
||||
/>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true"}
|
||||
options={daysOptions}
|
||||
style={{ width: "90px", marginLeft: "10px" }}
|
||||
value={attendCycleFromDay}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ attendCycleFromDay: value });
|
||||
}}
|
||||
/>
|
||||
<span style={{ marginLeft: "10px" }}>至本月最后一天</span>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
福利台账月份
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
disabled={canEdit !== "true"}
|
||||
options={cycleTypeOption}
|
||||
style={{ width: "90px" }}
|
||||
value={socialSecurityCycleType}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ socialSecurityCycleType: value });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
// 获取开始日期
|
||||
getStartDate(salaryCycleType, day) {
|
||||
day = Number(day)
|
||||
return this.getMonth(salaryCycleType) + "-" + (day < 10 ? "0" + day : day)
|
||||
}
|
||||
|
||||
// 获取开始月份
|
||||
getMonth(salaryCycleType) {
|
||||
switch(salaryCycleType) {
|
||||
case "1": // 上上月
|
||||
return getSubtractMonthYearMonth(2)
|
||||
case "2": // 上月
|
||||
return getSubtractMonthYearMonth(1)
|
||||
case "3": // 本月
|
||||
return getCurrentYearMonth()
|
||||
case "4": // 下月
|
||||
return getAddMonthYearMonth(1)
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { request, ledgerStore } = this.props;
|
||||
const { baseInfoRequest } = ledgerStore;
|
||||
const { name, taxableItems, salaryCycleType, salaryCycleFromDay,
|
||||
taxCycleType, attendCycleType, attendCycleFromDay, socialSecurityCycleType,
|
||||
description} = baseInfoRequest
|
||||
return (
|
||||
<div className="slideBaseForm">
|
||||
<Row>
|
||||
<Col span={18}>
|
||||
<div className="leftContentWrapper">
|
||||
<Row className="formItem">
|
||||
<Col span={6}>账套名称<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaInput style={{width: "190px"}} value={name} onChange={(value) => {this.handleChange({name: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>薪资类型<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={[{
|
||||
key: "1",
|
||||
selected: true,
|
||||
showname: "正常工资薪金所得"
|
||||
}]} style={{width: "190px"}} value={taxableItems} onChange={(value) => {this.handleChange({taxableItems: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>薪资周期<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={salaryCycleType} onChange={(value) => {this.handleChange({salaryCycleType: value})}}/>
|
||||
<WeaSelect options={daysOptions} style={{width: "90px", marginLeft: '10px'}} value={salaryCycleFromDay} onChange={(value) => {this.handleChange({salaryCycleFromDay: value})}}/>
|
||||
<span style={{marginLeft: "10px"}}>至本月最后一天</span>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>税款所属期<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={taxCycleType} onChange={(value) => {this.handleChange({taxCycleType: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>考勤周期<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={attendCycleType} onChange={(value) => {this.handleChange({attendCycleType: value})}}/>
|
||||
<WeaSelect options={daysOptions} style={{width: "90px", marginLeft: "10px"}} value={attendCycleFromDay} onChange={(value) => {this.handleChange({attendCycleFromDay: value})}}/>
|
||||
<span style={{marginLeft: "10px"}}>至本月最后一天</span>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>福利台账月份<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={socialSecurityCycleType} onChange={(value) => {this.handleChange({socialSecurityCycleType: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className="formItem">
|
||||
<Col span={6}>核算人员范围<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaCheckbox value={true} viewAttr={1} content="【入职日期≤薪资周期止】且【离职日期≥薪资周期起】" />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>备注</Col>
|
||||
<Col span={18}>
|
||||
<WeaTextarea style={{width: "190px"}} value={description} onChange={(value) => {this.handleChange({description: value})}} />
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<div className="rightContentWrapper">
|
||||
<TipLabel title="月份周期说明">
|
||||
<p className="greytip">例:薪资所属月是<span className="higelinered">{getCurrentYearMonth()}</span>(即核算员工<span className="higelinered">{getCurrentMonth()}</span>月的工资)</p>
|
||||
<p className="greytip">根据您当前的选择,相应的周期为:</p>
|
||||
<div className="tipLabel">薪资周期</div>
|
||||
<p className="greytip"><span className="higelinered">{this.getStartDate(salaryCycleType, salaryCycleFromDay)}</span>至<span className="higelinered">{this.getMonth(salaryCycleType)}-30</span></p>
|
||||
<div className="tipLabel">税款所属期</div>
|
||||
<p className="greytip higelinered">{this.getMonth(taxCycleType)}</p>
|
||||
<div className="tipLabel">考勤取值周期</div>
|
||||
<p className="greytip"><span className="higelinered">{this.getStartDate(attendCycleType, attendCycleFromDay)}</span>至<span className="higelinered">{this.getMonth(attendCycleType)}-30</span></p>
|
||||
<div className="tipLabel">福利台账月份</div>
|
||||
<p className="greytip">引用<span className="higelinered">{this.getMonth(socialSecurityCycleType)}</span>的福利台账数据</p>
|
||||
</TipLabel>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>
|
||||
核算人员范围
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaCheckbox
|
||||
value={true}
|
||||
viewAttr={1}
|
||||
content="【入职日期≤薪资周期止】且【离职日期≥薪资周期起】"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>备注</Col>
|
||||
<Col span={18}>
|
||||
<WeaTextarea
|
||||
disabled={canEdit !== "true"}
|
||||
style={{ width: "190px" }}
|
||||
value={description}
|
||||
onChange={(value) => {
|
||||
this.handleChange({ description: value });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<div className="rightContentWrapper">
|
||||
<TipLabel title="月份周期说明">
|
||||
<p className="greytip">
|
||||
例:薪资所属月是
|
||||
<span className="higelinered">{getCurrentYearMonth()}</span>
|
||||
(即核算员工
|
||||
<span className="higelinered">{getCurrentMonth()}</span>
|
||||
月的工资)
|
||||
</p>
|
||||
<p className="greytip">根据您当前的选择,相应的周期为:</p>
|
||||
<div className="tipLabel">薪资周期</div>
|
||||
<p className="greytip">
|
||||
<span className="higelinered">
|
||||
{this.getStartDate(salaryCycleType, salaryCycleFromDay)}
|
||||
</span>
|
||||
至
|
||||
<span className="higelinered">
|
||||
{this.getMonth(salaryCycleType)}-30
|
||||
</span>
|
||||
</p>
|
||||
<div className="tipLabel">税款所属期</div>
|
||||
<p className="greytip higelinered">
|
||||
{this.getMonth(taxCycleType)}
|
||||
</p>
|
||||
<div className="tipLabel">考勤取值周期</div>
|
||||
<p className="greytip">
|
||||
<span className="higelinered">
|
||||
{this.getStartDate(attendCycleType, attendCycleFromDay)}
|
||||
</span>
|
||||
至
|
||||
<span className="higelinered">
|
||||
{this.getMonth(attendCycleType)}-30
|
||||
</span>
|
||||
</p>
|
||||
<div className="tipLabel">福利台账月份</div>
|
||||
<p className="greytip">
|
||||
引用
|
||||
<span className="higelinered">
|
||||
{this.getMonth(socialSecurityCycleType)}
|
||||
</span>
|
||||
的福利台账数据
|
||||
</p>
|
||||
</TipLabel>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ export default class SlideRefereUser extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { ledgerStore: {includeType, userTableStore, addUserModalVisible, setAddUserModalVisible}} = this.props;
|
||||
const { ledgerStore: {includeType, userTableStore, addUserModalVisible, setAddUserModalVisible, baseInfoRequest}} = this.props;
|
||||
const { canEdit="true" } = baseInfoRequest;
|
||||
let { columns, list} = userTableStore
|
||||
const { selectedRowKeys } = this.state
|
||||
columns = columns || []
|
||||
|
|
@ -74,10 +75,13 @@ export default class SlideRefereUser extends React.Component {
|
|||
<div className="refereUserHeader">
|
||||
<div className="headerLeft"><span className={includeType == 1 ? "selectedCrumbs" : "tabItem"} onClick={() => {this.handleTabClick(1)}}>关联人员范围</span> {' '} | {' '} <span className={includeType == 0 ? "selectedCrumbs" : "tabItem"} onClick={() => {this.handleTabClick(0)}}>从范围中排除</span></div>
|
||||
<WeaInputSearch className="searchInput" value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
<div className="headerIcon">
|
||||
{
|
||||
canEdit === 'true' &&
|
||||
<div className="headerIcon">
|
||||
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleTabDelete()}}/>
|
||||
<Icon className="iconItem" type="plus-square" onClick={() => {setAddUserModalVisible(true)}}/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
<Table rowSelection={rowSelection} dataSource={list} columns={columns} pagination={{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react'
|
||||
import React,{ Fragment } from 'react'
|
||||
import { Icon, Table, message, Modal } from 'antd'
|
||||
import { WeaTable } from 'ecCom'
|
||||
import { slideStep3Columns } from '../columns'
|
||||
|
|
@ -133,7 +133,7 @@ export default class CanMoveItem extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {ledgerStore: {setAddItemVisible, addItemVisible}} = this.props;
|
||||
const {disabled, ledgerStore: {setAddItemVisible, addItemVisible}} = this.props;
|
||||
const { selectedRowKeys, formalModalVisible, addCategoryVisible } = this.state;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
|
|
@ -149,15 +149,25 @@ export default class CanMoveItem extends React.Component {
|
|||
<span className="itemTitle">{this.props.title}
|
||||
{
|
||||
this.props.title !== "未分类" && <span>
|
||||
<i className="icon-coms-edit" style={{marginLeft: "10px", marginRight: "10px", cursor:"pointer"}} onClick={() => {this.handleEditGroupIconClick(this.props.title)}}/>
|
||||
<i className="icon-coms-Delete" style={{cursor:"pointer"}} onClick={() => {this.handleDeleteGroupIconClick()}}/>
|
||||
{
|
||||
!disabled &&
|
||||
<Fragment>
|
||||
<i className="icon-coms-edit" style={{marginLeft: "10px", marginRight: "10px", cursor:"pointer"}} onClick={() => {this.handleEditGroupIconClick(this.props.title)}}/>
|
||||
<i className="icon-coms-Delete" style={{cursor:"pointer"}} onClick={() => {this.handleDeleteGroupIconClick()}}/>
|
||||
</Fragment>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
|
||||
</span>
|
||||
<span className="rightBtnsWrapper">
|
||||
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleDelete()}}/>
|
||||
<Icon className="iconItem" type="plus-square" onClick={() => { this.setState({addItemVisible: true}) }}/>
|
||||
{
|
||||
!disabled &&
|
||||
<Fragment>
|
||||
<Icon className="iconItem" type="minus-square" onClick={() => {this.handleDelete()}}/>
|
||||
<Icon className="iconItem" type="plus-square" onClick={() => { this.setState({addItemVisible: true}) }}/>
|
||||
</Fragment>
|
||||
}
|
||||
<Icon type={this.state.showContent ? "down" : 'left'} style={{cursor: "pointer"}} onClick={() => {this.handleTiggleContent()}}/>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,34 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, message } from 'antd';
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
DatePicker,
|
||||
Dropdown,
|
||||
Menu,
|
||||
message,
|
||||
Modal,
|
||||
} from "antd";
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable,
|
||||
WeaInputSearch, WeaSlideModal, WeaCheckbox, WeaHelpfulTip } from 'ecCom';
|
||||
import {
|
||||
WeaTop,
|
||||
WeaTab,
|
||||
WeaRightMenu,
|
||||
WeaRangePicker,
|
||||
WeaTable,
|
||||
WeaInputSearch,
|
||||
WeaSlideModal,
|
||||
WeaCheckbox,
|
||||
WeaHelpfulTip,
|
||||
} from "ecCom";
|
||||
|
||||
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../components/customTab';
|
||||
import ContentWrapper from '../../components/contentWrapper';
|
||||
import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../components/customTab";
|
||||
import ContentWrapper from "../../components/contentWrapper";
|
||||
|
||||
import { columns, dataSource } from './columns';
|
||||
import { columns, dataSource } from "./columns";
|
||||
|
||||
import ChangeSalaryModal from "./changeSalaryModal"
|
||||
import EditAgentModal from './editAgentModal';
|
||||
|
|
@ -24,10 +41,10 @@ import CustomPaginationTable from "../../components/customPaginationTable"
|
|||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
import "./index.less"
|
||||
import CustomTable from '../../components/customTable';
|
||||
import "./index.less";
|
||||
import CustomTable from "../../components/customTable";
|
||||
|
||||
@inject('salaryFileStore')
|
||||
@inject("salaryFileStore")
|
||||
@observer
|
||||
export default class SalaryFile extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -52,113 +69,136 @@ export default class SalaryFile extends React.Component {
|
|||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: {doInit} } = this.props;
|
||||
const {
|
||||
salaryFileStore: { doInit },
|
||||
} = this.props;
|
||||
doInit();
|
||||
}
|
||||
|
||||
// 设置导入步数
|
||||
setStep(step) {
|
||||
this.setState({step})
|
||||
this.setState({ step });
|
||||
}
|
||||
|
||||
// 渲染导入模板附加元素
|
||||
renderFormComponent() {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<WeaCheckbox id="importData" content="导出现有数据" />
|
||||
<WeaHelpfulTip
|
||||
width={200}
|
||||
title="提示:建议先导出现有最新数据,修改后再导入"
|
||||
placement="topLeft"
|
||||
/>
|
||||
width={200}
|
||||
title="提示:建议先导出现有最新数据,修改后再导入"
|
||||
placement="topLeft"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 导入预览
|
||||
handlePreviewImport(params) {
|
||||
const { salaryFileStore: {importPreview}} = this.props;
|
||||
const {
|
||||
salaryFileStore: { importPreview },
|
||||
} = this.props;
|
||||
params.importType = this.state.importType;
|
||||
importPreview(params)
|
||||
importPreview(params);
|
||||
}
|
||||
|
||||
// 导入档案
|
||||
handleImportFile(params) {
|
||||
const { salaryFileStore: {importSalaryArchive}} = this.props;
|
||||
params.importType = this.state.importType
|
||||
importSalaryArchive(params).then(data => {
|
||||
data.errorData = data.errorNotice
|
||||
const {
|
||||
salaryFileStore: { importSalaryArchive },
|
||||
} = this.props;
|
||||
params.importType = this.state.importType;
|
||||
importSalaryArchive(params).then((data) => {
|
||||
data.errorData = data.errorNotice;
|
||||
this.setState({
|
||||
importResult: data
|
||||
})
|
||||
})
|
||||
importResult: data,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 导入完成按钮操作
|
||||
handleImportFinish() {
|
||||
this.setState({modalVisiable: false, step: 0})
|
||||
this.setState({ modalVisiable: false, step: 0 });
|
||||
}
|
||||
|
||||
// 导出全部
|
||||
handleExportAll() {
|
||||
const { salaryFileStore: {exportSalaryArchive}} = this.props;
|
||||
const {
|
||||
salaryFileStore: { exportSalaryArchive },
|
||||
} = this.props;
|
||||
exportSalaryArchive();
|
||||
}
|
||||
|
||||
// 定制列
|
||||
getColumns() {
|
||||
const { salaryFileStore: {tableStore}} = this.props;
|
||||
return tableStore.columns.filter(item => item.display == "true").map(item => {
|
||||
item.width = item.oldWidth
|
||||
if(item.dataIndex == "operate") {
|
||||
item.render = (text, record) => (
|
||||
<a onClick={() => this.handleEdit(record)}>查看</a>
|
||||
)
|
||||
item.fixed = 'right'
|
||||
} else if(item.dataIndex == "username"){
|
||||
item.fixed = 'left'
|
||||
}
|
||||
return item
|
||||
})
|
||||
const {
|
||||
salaryFileStore: { tableStore },
|
||||
} = this.props;
|
||||
return tableStore.columns
|
||||
.filter((item) => item.display == "true")
|
||||
.map((item) => {
|
||||
item.width = item.oldWidth;
|
||||
if (item.dataIndex == "operate") {
|
||||
item.render = (text, record) => (
|
||||
<a onClick={() => this.handleEdit(record)}>查看</a>
|
||||
);
|
||||
item.fixed = "right";
|
||||
} else if (item.dataIndex == "username") {
|
||||
item.fixed = "left";
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
// 编辑行
|
||||
handleEdit(record) {
|
||||
this.setState({editSlideVisible: true})
|
||||
const { salaryFileStore: {setCurrentId}} = this.props;
|
||||
setCurrentId(record.id)
|
||||
this.setState({ editSlideVisible: true });
|
||||
const {
|
||||
salaryFileStore: { setCurrentId },
|
||||
} = this.props;
|
||||
setCurrentId(record.id);
|
||||
}
|
||||
|
||||
// 显示调整个税扣缴义务人表单
|
||||
handSildeOptionMenuClick(e) {
|
||||
const { salaryFileStore: {setEditAgentVisible}} = this.props;
|
||||
setEditAgentVisible(true)
|
||||
const {
|
||||
salaryFileStore: { setEditAgentVisible },
|
||||
} = this.props;
|
||||
setEditAgentVisible(true);
|
||||
}
|
||||
|
||||
// 查看 Slide 头部操作按钮
|
||||
renderEditSlideOperate() {
|
||||
return <div style={{display: "inline-block"}}>
|
||||
<Dropdown.Button type="primary" overlay={
|
||||
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
|
||||
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
|
||||
</Menu>
|
||||
} onClick={() => {this.setState({changeSalaryVisible: true})}}>调薪</Dropdown.Button>
|
||||
return (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Dropdown.Button
|
||||
type="primary"
|
||||
overlay={
|
||||
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
|
||||
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
onClick={() => {
|
||||
this.setState({ changeSalaryVisible: true });
|
||||
}}>
|
||||
调薪
|
||||
</Dropdown.Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// table选中条目
|
||||
onSelectChange = selectedRowKeys => {
|
||||
onSelectChange = (selectedRowKeys) => {
|
||||
this.setState({ selectedRowKeys });
|
||||
};
|
||||
|
||||
// 显示影响搜索面板
|
||||
handleShowSearchBar = () => {
|
||||
this.setState({
|
||||
showSearchBar: !this.state.showSearchBar
|
||||
})
|
||||
}
|
||||
showSearchBar: !this.state.showSearchBar,
|
||||
});
|
||||
};
|
||||
|
||||
// 页面跳转
|
||||
handlePageChange = (value) => {
|
||||
|
|
@ -174,78 +214,120 @@ export default class SalaryFile extends React.Component {
|
|||
|
||||
// 搜索
|
||||
handleSearch(value) {
|
||||
const { salaryFileStore: {getTableDatas, form}} = this.props;
|
||||
getTableDatas({username: value})
|
||||
const {
|
||||
salaryFileStore: { getTableDatas, form },
|
||||
} = this.props;
|
||||
getTableDatas({ username: value });
|
||||
}
|
||||
|
||||
// 初始化导入参数
|
||||
handleInitModal() {
|
||||
const { salaryFileStore: { setPreviewDataSource } } = this.props;
|
||||
setPreviewDataSource([])
|
||||
const {
|
||||
salaryFileStore: { setPreviewDataSource },
|
||||
} = this.props;
|
||||
setPreviewDataSource([]);
|
||||
this.setState({
|
||||
importResult: {}
|
||||
})
|
||||
importResult: {},
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const { salaryFileStore } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryFileStore;
|
||||
const { importType, previewColumns, previewDataSource, dataSource, currentId, editAgentVisible, setEditAgentVisible, pageInfo } = salaryFileStore;
|
||||
|
||||
const {
|
||||
loading,
|
||||
hasRight,
|
||||
form,
|
||||
condition,
|
||||
tableStore,
|
||||
showSearchAd,
|
||||
getTableDatas,
|
||||
doSearch,
|
||||
setShowSearchAd,
|
||||
} = salaryFileStore;
|
||||
const {
|
||||
importType,
|
||||
previewColumns,
|
||||
previewDataSource,
|
||||
dataSource,
|
||||
currentId,
|
||||
editAgentVisible,
|
||||
setEditAgentVisible,
|
||||
pageInfo,
|
||||
} = salaryFileStore;
|
||||
|
||||
const { selectedTab, step, selectedRowKeys } = this.state;
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
{
|
||||
key: 'BTN_COLUMN',
|
||||
icon: <i className='icon-coms-Custom' />,
|
||||
content: '显示列定制',
|
||||
onClick: this.showColumn
|
||||
const rightMenu = [
|
||||
// 右键菜单
|
||||
{
|
||||
key: "BTN_COLUMN",
|
||||
icon: <i className="icon-coms-Custom" />,
|
||||
content: "显示列定制",
|
||||
onClick: this.showColumn,
|
||||
},
|
||||
];
|
||||
const collectParams = { // 收藏功能配置
|
||||
favname: '薪资档案',
|
||||
const collectParams = {
|
||||
// 收藏功能配置
|
||||
favname: "薪资档案",
|
||||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: 'wui/index.html#/ns_demo03/index',
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1,
|
||||
};
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>,
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>,
|
||||
];
|
||||
|
||||
const topTab = [
|
||||
];
|
||||
const topTab = [];
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
|
||||
}
|
||||
const renderSearchOperationItem = () => {};
|
||||
|
||||
const handleMenuClick = (e) => {
|
||||
this.setState({importType: e.key, modalVisiable: true, step: 0})
|
||||
}
|
||||
const { key } = e;
|
||||
if (key === "init") {
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入,点击确定继续导入`,
|
||||
onOk: () => {
|
||||
this.setState({ importType: e.key, modalVisiable: true, step: 0 });
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
} else {
|
||||
this.setState({ importType: e.key, modalVisiable: true, step: 0 });
|
||||
}
|
||||
};
|
||||
|
||||
const handleMenuClick2 = () => {
|
||||
const { electedRowKeys } = this.state;
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
if (selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
const { salaryFileStore: {exportSalaryArchive}} = this.props;
|
||||
exportSalaryArchive(selectedRowKeys.join(","))
|
||||
}
|
||||
const {
|
||||
salaryFileStore: { exportSalaryArchive },
|
||||
} = this.props;
|
||||
exportSalaryArchive(selectedRowKeys.join(","));
|
||||
};
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
{
|
||||
importType.map(item => (
|
||||
<Menu.Item key={item.id}>{item.content}</Menu.Item>
|
||||
))
|
||||
}
|
||||
{importType.map((item) => (
|
||||
<Menu.Item key={item.id}>{item.content}</Menu.Item>
|
||||
))}
|
||||
</Menu>
|
||||
);
|
||||
|
||||
|
|
@ -257,53 +339,82 @@ export default class SalaryFile extends React.Component {
|
|||
);
|
||||
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block", position: 'relative'}} className="salaryFileTabWrapper">
|
||||
<WeaHelpfulTip
|
||||
style={{marginRight: '10px'}}
|
||||
width={200}
|
||||
title="导入按钮使用场景说明:\n
|
||||
return (
|
||||
<div
|
||||
style={{ display: "inline-block", position: "relative" }}
|
||||
className="salaryFileTabWrapper">
|
||||
<WeaHelpfulTip
|
||||
style={{ marginRight: "10px" }}
|
||||
width={200}
|
||||
title="导入按钮使用场景说明:\n
|
||||
1.档案初始化:\n
|
||||
a.初次使用薪酬模块,全量导入员工的薪资档案数据;\n
|
||||
b.员工入职,导入新入职的员工的薪资档案数据(若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入);\n
|
||||
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴;\n
|
||||
2.调薪:档案中已存在的人员批量调整薪资项目值(包括返聘人员的情况);\n
|
||||
3.调整个税扣缴义务人:档案中已存在的人员批量调整个税扣缴义务人(包括返聘人员的情况);\n"
|
||||
placement="topLeft"
|
||||
/>
|
||||
<Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu}>导入</Dropdown.Button>
|
||||
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu2} onClick={() => {this.handleExportAll()}}>导出全部</Dropdown.Button>
|
||||
<Button type="default" style={{marginRight: "10px"}} onClick={() => {this.setState({recordSlideVisible: true})}}>调薪记录</Button>
|
||||
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({
|
||||
searchValue: value
|
||||
})}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
{/* <Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button> */}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
placement="topLeft"
|
||||
/>
|
||||
<Dropdown.Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu}>
|
||||
导入
|
||||
</Dropdown.Button>
|
||||
<Dropdown.Button
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu2}
|
||||
onClick={() => {
|
||||
this.handleExportAll();
|
||||
}}>
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
<Button
|
||||
type="default"
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() => {
|
||||
this.setState({ recordSlideVisible: true });
|
||||
}}>
|
||||
调薪记录
|
||||
</Button>
|
||||
<WeaInputSearch
|
||||
value={this.state.searchValue}
|
||||
onChange={(value) => {
|
||||
this.setState({
|
||||
searchValue: value,
|
||||
});
|
||||
}}
|
||||
onSearch={(value) => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
{/* <Button type="default" onClick={() =>{this.handleShowSearchBar()}}>高级搜索</Button> */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const handleSlideMoreMenuClick = () => {
|
||||
|
||||
}
|
||||
const handleSlideMoreMenuClick = () => {};
|
||||
|
||||
const slideMoreMenu = (
|
||||
<Menu onClick={handleSlideMoreMenuClick}>
|
||||
<Menu.Item key="1">导出全部</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
|
||||
const renderCustomOperate = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Dropdown.Button type="primary" overlay={slideMoreMenu}>导出</Dropdown.Button>
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Dropdown.Button type="primary" overlay={slideMoreMenu}>
|
||||
导出
|
||||
</Dropdown.Button>
|
||||
<Button type="default">自定义列</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -314,8 +425,8 @@ export default class SalaryFile extends React.Component {
|
|||
>
|
||||
<WeaTop
|
||||
title="薪资档案" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
|
|
@ -326,7 +437,7 @@ export default class SalaryFile extends React.Component {
|
|||
}
|
||||
/>
|
||||
|
||||
<CustomPaginationTable
|
||||
<CustomPaginationTable
|
||||
loading={loading}
|
||||
rowSelection={rowSelection}
|
||||
columns={this.getColumns()}
|
||||
|
|
@ -346,12 +457,10 @@ export default class SalaryFile extends React.Component {
|
|||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
|
||||
|
||||
{
|
||||
this.state.modalVisiable &&
|
||||
<ImportModal
|
||||
{this.state.modalVisiable && (
|
||||
<ImportModal
|
||||
init={() => {
|
||||
this.handleInitModal()
|
||||
this.handleInitModal();
|
||||
}}
|
||||
params={{}}
|
||||
columns={previewColumns}
|
||||
|
|
@ -359,89 +468,110 @@ export default class SalaryFile extends React.Component {
|
|||
setStep={this.setStep.bind(this)}
|
||||
slideDataSource={previewDataSource}
|
||||
importResult={this.state.importResult}
|
||||
onFinish={() => {this.handleImportFinish()}}
|
||||
previewImport={(params) => {
|
||||
this.handlePreviewImport(params)
|
||||
onFinish={() => {
|
||||
this.handleImportFinish();
|
||||
}}
|
||||
previewImport={(params) => {
|
||||
this.handlePreviewImport(params);
|
||||
}}
|
||||
importFile={(params) => {
|
||||
this.handleImportFile(params);
|
||||
}}
|
||||
templateLink={
|
||||
"/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" +
|
||||
this.state.importType
|
||||
}
|
||||
renderFormComponent={() => {
|
||||
this.renderFormComponent();
|
||||
}}
|
||||
visiable={this.state.modalVisiable}
|
||||
onCancel={() => {
|
||||
this.setState({ modalVisiable: false });
|
||||
}}
|
||||
importFile={(params) => {this.handleImportFile(params)}}
|
||||
templateLink={"/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" + this.state.importType}
|
||||
renderFormComponent={() => {this.renderFormComponent()}}
|
||||
visiable={this.state.modalVisiable}
|
||||
onCancel={() => { this.setState({modalVisiable: false})}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
this.state.changeSalaryVisible && <ChangeSalaryModal
|
||||
)}
|
||||
{this.state.changeSalaryVisible && (
|
||||
<ChangeSalaryModal
|
||||
currentId={currentId}
|
||||
visible={this.state.changeSalaryVisible}
|
||||
onCancel={() => {this.setState({changeSalaryVisible: false})}}
|
||||
onCancel={() => {
|
||||
this.setState({ changeSalaryVisible: false });
|
||||
}}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
|
||||
{
|
||||
editAgentVisible && <EditAgentModal
|
||||
{editAgentVisible && (
|
||||
<EditAgentModal
|
||||
currentId={currentId}
|
||||
visible={editAgentVisible}
|
||||
onCancel={() => {setEditAgentVisible(false)}}
|
||||
onCancel={() => {
|
||||
setEditAgentVisible(false);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
|
||||
{/* 操作记录 */}
|
||||
{
|
||||
this.state.recordSlideVisible &&
|
||||
<WeaSlideModal visible={this.state.recordSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"操作记录"}
|
||||
tabs={[{title: '薪资项目', key: 0}, {title: "个税扣缴义务人", key: 1}]}
|
||||
editable={false}
|
||||
selectedTab={selectedTab}
|
||||
customOperate={() => {renderCustomOperate()}}
|
||||
subItemChange={
|
||||
(item) => {this.setState({selectedTab: item.key})}
|
||||
}
|
||||
/>
|
||||
}
|
||||
content={<div>
|
||||
{
|
||||
selectedTab == 0 && <SlideSalaryItem />
|
||||
}
|
||||
{
|
||||
selectedTab == 1 && <SlideAgent />
|
||||
}
|
||||
</div>}
|
||||
onClose={() => this.setState({recordSlideVisible: false})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({recordSlideVisible: false})} />
|
||||
}
|
||||
{this.state.recordSlideVisible && (
|
||||
<WeaSlideModal
|
||||
visible={this.state.recordSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={"right"}
|
||||
measure={"%"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"操作记录"}
|
||||
tabs={[
|
||||
{ title: "薪资项目", key: 0 },
|
||||
{ title: "个税扣缴义务人", key: 1 },
|
||||
]}
|
||||
editable={false}
|
||||
selectedTab={selectedTab}
|
||||
customOperate={() => {
|
||||
renderCustomOperate();
|
||||
}}
|
||||
subItemChange={(item) => {
|
||||
this.setState({ selectedTab: item.key });
|
||||
}}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<div>
|
||||
{selectedTab == 0 && <SlideSalaryItem />}
|
||||
{selectedTab == 1 && <SlideAgent />}
|
||||
</div>
|
||||
}
|
||||
onClose={() => this.setState({ recordSlideVisible: false })}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() =>
|
||||
this.setState({ recordSlideVisible: false })
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
{
|
||||
this.state.editSlideVisible &&
|
||||
<WeaSlideModal visible={this.state.editSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"员工薪资档案"}
|
||||
editable={false}
|
||||
customOperate={this.renderEditSlideOperate()}
|
||||
/>
|
||||
}
|
||||
content={<SalaryFileViewSlide id={currentId} />}
|
||||
onClose={() => this.setState({editSlideVisible: false})}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({editSlideVisible: false})} />
|
||||
}
|
||||
|
||||
{this.state.editSlideVisible && (
|
||||
<WeaSlideModal
|
||||
visible={this.state.editSlideVisible}
|
||||
top={0}
|
||||
width={40}
|
||||
height={100}
|
||||
direction={"right"}
|
||||
measure={"%"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={"员工薪资档案"}
|
||||
editable={false}
|
||||
customOperate={this.renderEditSlideOperate()}
|
||||
/>
|
||||
}
|
||||
content={<SalaryFileViewSlide id={currentId} />}
|
||||
onClose={() => this.setState({ editSlideVisible: false })}
|
||||
showMask={true}
|
||||
closeMaskOnClick={() => this.setState({ editSlideVisible: false })}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,155 @@
|
|||
import React from "react";
|
||||
import { Modal, Button, Row, Col, Radio, Checkbox } from "antd";
|
||||
import { WeaSelect, WeaBrowser } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip";
|
||||
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
|
||||
export default class AddTaxAgentModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedKey: "EMPLOYEE",
|
||||
checkboxValue: [],
|
||||
ids: "",
|
||||
};
|
||||
}
|
||||
|
||||
onCheckboxChange = (checkboxValue) => {
|
||||
this.setState({ checkboxValue });
|
||||
};
|
||||
|
||||
// 保存
|
||||
handleSave = () => {
|
||||
const { onTaxAgentSave } = this.props;
|
||||
const { checkboxValue, ids, selectedKey } = this.state;
|
||||
const payload = {
|
||||
employeeStatus: checkboxValue,
|
||||
targetParams: _.map(ids.split(","), (it) => ({
|
||||
targetType: selectedKey,
|
||||
targetId: it,
|
||||
})),
|
||||
};
|
||||
onTaxAgentSave && onTaxAgentSave(payload);
|
||||
};
|
||||
|
||||
// 重置
|
||||
handleReset = () => {
|
||||
this.setState({
|
||||
selectedKey: "EMPLOYEE",
|
||||
checkboxValue: [],
|
||||
ids: "",
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { employeeStatus, targetTypeList, visible, onCancel, loading } =
|
||||
this.props;
|
||||
return (
|
||||
<Modal
|
||||
visible={visible}
|
||||
onCancel={onCancel}
|
||||
width={600}
|
||||
title="关联人员"
|
||||
footer={
|
||||
<div style={{ display: "inlne-block" }}>
|
||||
<Button type="primary" laoding={loading} onClick={this.handleSave}>
|
||||
保存
|
||||
</Button>
|
||||
<Button type="default" onClick={this.handleReset}>
|
||||
重置
|
||||
</Button>
|
||||
</div>
|
||||
}>
|
||||
<div style={{ padding: "20px" }}>
|
||||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={8}>
|
||||
对象类型
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<div style={{ display: "inline-block", verticalAlign: "top" }}>
|
||||
<WeaSelect
|
||||
style={{ height: "30px", marginRight: "10px" }}
|
||||
options={_.map(targetTypeList, (it) => ({
|
||||
...it,
|
||||
key: it.id,
|
||||
showname: it.name,
|
||||
selected: false,
|
||||
}))}
|
||||
value={this.state.selectedKey}
|
||||
onChange={(value) => {
|
||||
this.setState({ selectedKey: value, ids: "" });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: "inline-block", verticalAlign: "middle" }}>
|
||||
{this.state.selectedKey == "EMPLOYEE" && (
|
||||
<WeaBrowser
|
||||
type={17}
|
||||
title={"人员选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{this.state.selectedKey == "DEPT" && (
|
||||
<WeaBrowser
|
||||
type={57}
|
||||
title={"部门选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{this.state.selectedKey == "SUBCOMPANY" && (
|
||||
<WeaBrowser
|
||||
type={164}
|
||||
title={"分部选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{this.state.selectedKey == "POSITION" && (
|
||||
<WeaBrowser
|
||||
type={278}
|
||||
title={"岗位选择"}
|
||||
isSingle={false}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) => {
|
||||
this.setState({ ids });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{ lineHeight: "40px" }}>
|
||||
<Col span={8}>
|
||||
选择员工状态
|
||||
<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<CheckboxGroup
|
||||
options={_.map(employeeStatus, (it) => ({
|
||||
label: it.name,
|
||||
value: it.id,
|
||||
}))}
|
||||
value={this.state.checkboxValue}
|
||||
onChange={(e) => this.onCheckboxChange(e)}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 表单渲染condition
|
||||
* Date: 2022-05-30 22:39:03
|
||||
* LastEditTime: 2022-05-31 20:34:07
|
||||
*/
|
||||
export const editConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 14,
|
||||
rules: "required|string",
|
||||
label: "名称",
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 3,
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
title: "人力资源",
|
||||
type: "1",
|
||||
viewAttr: 3,
|
||||
rules: "required",
|
||||
},
|
||||
colSpan: 1,
|
||||
conditionType: "BROWSER",
|
||||
rules: "required|string",
|
||||
domkey: ["adminUserIds"],
|
||||
fieldcol: 14,
|
||||
label: "管理员",
|
||||
labelcol: 6,
|
||||
viewAttr: 3,
|
||||
},
|
||||
{
|
||||
colSpan: 1,
|
||||
conditionType: "TEXTAREA",
|
||||
domkey: ["description"],
|
||||
fieldcol: 14,
|
||||
label: "备注",
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2,
|
||||
},
|
||||
],
|
||||
defaultshow: true,
|
||||
},
|
||||
];
|
||||
|
|
@ -1,82 +1,179 @@
|
|||
import React from 'react'
|
||||
import { Button, Modal, Row, Col, message } from 'antd';
|
||||
import { WeaTextarea, WeaInput } from "ecCom";
|
||||
import { logColumns, dataSource } from "../../common/columns"
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip"
|
||||
import React from "react";
|
||||
import { Button, Row, Col, message } from "antd";
|
||||
import {
|
||||
WeaDialog,
|
||||
WeaFormItem,
|
||||
WeaSearchGroup,
|
||||
WeaSteps,
|
||||
WeaTab,
|
||||
} from "ecCom";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
import PersonalScope from "./personalScope";
|
||||
|
||||
const titleOuter = {
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
};
|
||||
const left = {
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
};
|
||||
const stepWrapper = {
|
||||
padding: "20px 200px",
|
||||
};
|
||||
|
||||
const Step = WeaSteps.Step;
|
||||
|
||||
export default class EditModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
name: "",
|
||||
remark: ""
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
date: "",
|
||||
};
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
const { onSubmit, btnType, onPrev } = this.props;
|
||||
const { form } = this.props.taxAgentStore;
|
||||
if (btnType === "prev") {
|
||||
onPrev && onPrev();
|
||||
return;
|
||||
}
|
||||
form.validateForm().then((f) => {
|
||||
if (f.isValid) {
|
||||
const formData = form.getFormParams();
|
||||
const { adminUserIds, ...extraVal } = formData;
|
||||
onSubmit &&
|
||||
onSubmit({ adminUserIds: adminUserIds.split(","), ...extraVal });
|
||||
} else {
|
||||
f.showErrors();
|
||||
this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
renderEditForm = () => {
|
||||
const { editConditions } = this.props;
|
||||
const { form } = this.props.taxAgentStore;
|
||||
const { isFormInit } = form;
|
||||
let group = [];
|
||||
isFormInit &&
|
||||
editConditions.map((c, index) => {
|
||||
let items = [];
|
||||
c.items.map((field, idx) => {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem
|
||||
ecId={`tasAgent_WeaFormItem@jsxoq6@${index}@${idx}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{ span: `${field.labelcol}` }}
|
||||
error={form.getError(field)}
|
||||
tipPosition="bottom"
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch
|
||||
ecId={`tasAgent_WeaSwitch@r2lhga@${index}@${idx}`}
|
||||
fieldConfig={field}
|
||||
form={form}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
),
|
||||
col: 1,
|
||||
hide: form.isHide(field, (keys, allParams) => {
|
||||
return false;
|
||||
}),
|
||||
});
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup
|
||||
ecId={`tasAgent_WeaSearchGroup@3y8h9i@${index}`}
|
||||
needTigger={false}
|
||||
title={c.title}
|
||||
showGroup={c.defaultshow}
|
||||
items={items}
|
||||
/>
|
||||
);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { date } = this.state;
|
||||
const {
|
||||
visible,
|
||||
title,
|
||||
current,
|
||||
btnType,
|
||||
editType,
|
||||
editId,
|
||||
saveloading,
|
||||
onClose,
|
||||
onChangeTab,
|
||||
taxAgentStore,
|
||||
editConditions,
|
||||
} = this.props;
|
||||
const { form } = taxAgentStore;
|
||||
return (
|
||||
<WeaDialog
|
||||
onCancel={() => {
|
||||
form.resetForm();
|
||||
onClose && onClose();
|
||||
}}
|
||||
title={
|
||||
<div style={titleOuter}>
|
||||
<div style={left}>
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
<div className="right">
|
||||
{editType !== "set" && (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={this.handleSubmit}
|
||||
loading={saveloading}>
|
||||
{btnType === "save"
|
||||
? "保存并进入下一步"
|
||||
: btnType === "prev"
|
||||
? "上一步"
|
||||
: "保存"}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
this.setState({
|
||||
name: this.props.name,
|
||||
remark: this.props.remark
|
||||
})
|
||||
}
|
||||
|
||||
validate() {
|
||||
if(this.state.name == "") {
|
||||
message.warning("个税扣缴义务人名称不能为空");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
submitAdd() {
|
||||
if(this.validate()) {
|
||||
this.props.onSubmitAdd({name: this.state.name, description: this.state.remark})
|
||||
}
|
||||
}
|
||||
|
||||
submitUpdate() {
|
||||
if(this.validate) {
|
||||
this.props.onSubmitUpdate({id: this.props.currentId, name: this.state.name, description: this.state.remark})
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal title={this.props.title} visible={this.props.visible}
|
||||
onOk={() => {
|
||||
this.props.operate == "add" ? this.submitAdd() : this.submitUpdate();
|
||||
}} onCancel={this.props.onCancel}
|
||||
>
|
||||
<Row gutter={16}>
|
||||
<Col span={6}>
|
||||
<div className="formLabel">名称:<RequiredLabelTip /></div>
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput
|
||||
id="name"
|
||||
value={this.state.name}
|
||||
onChange={(v) => {this.setState({
|
||||
name: v
|
||||
})}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={16} style={{ marginTop: "16px" }}>
|
||||
<Col span={6}>
|
||||
<div className="formLabel">备注:</div>
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaTextarea value={this.state.remark} onChange={
|
||||
(v) => {
|
||||
this.setState({
|
||||
remark: v
|
||||
})
|
||||
}
|
||||
} />
|
||||
</Col>
|
||||
</Row>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
visible={visible}
|
||||
style={{ width: 800, minHeight: 350 }}
|
||||
hasScroll>
|
||||
{title.indexOf("编辑") >= 0 && (
|
||||
<WeaTab
|
||||
datas={[
|
||||
{
|
||||
title: "基础设置",
|
||||
viewcondition: 0,
|
||||
},
|
||||
{
|
||||
title: "人员范围",
|
||||
viewcondition: 1,
|
||||
},
|
||||
]}
|
||||
keyParam="viewcondition" //主键
|
||||
selectedKey={current}
|
||||
onChange={(v) => onChangeTab && onChangeTab(v)}
|
||||
/>
|
||||
)}
|
||||
{(btnType === "save" || title.indexOf("编辑") < 0) && (
|
||||
<div style={stepWrapper}>
|
||||
<WeaSteps current={current} size="small">
|
||||
<Step description="基础设置" />
|
||||
<Step description="人员范围" />
|
||||
</WeaSteps>
|
||||
</div>
|
||||
)}
|
||||
{current == 0 ? (
|
||||
this.renderEditForm()
|
||||
) : (
|
||||
<PersonalScope taxAgentId={editId} />
|
||||
)}
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,225 +1,451 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { Row, Col, Switch, message, Modal, Menu, Dropdown } from "antd";
|
||||
import {
|
||||
WeaTop,
|
||||
WeaRightMenu,
|
||||
WeaSearchGroup,
|
||||
WeaFormItem,
|
||||
WeaTable,
|
||||
} from "ecCom";
|
||||
import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import EditModal from "./editModal";
|
||||
import TipLabel from "../../components/TipLabel";
|
||||
import { editConditions } from "./editConditions";
|
||||
import "./index.less";
|
||||
|
||||
import { Button, Table, DatePicker, Row, Col, Modal, Form, Input } from 'antd';
|
||||
const { TextArea } = Input;
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaInputSearch, WeaInput, WeaTextarea } from 'ecCom';
|
||||
|
||||
import { WeaTableNew } from 'comsMobx';
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from '../../components/customTab';
|
||||
import ContentWrapper from '../../components/contentWrapper';
|
||||
import "./index.less"
|
||||
|
||||
import { columns, dataSource } from './columns';
|
||||
|
||||
import { logColumns } from '../../common/columns'
|
||||
import LogViewModal from '../../components/logViewModal';
|
||||
import EditModal from './editModal'
|
||||
import TipLabel from '../../components/TipLabel'
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
@inject('taxAgentStore')
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
export default class TaxAgent extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
searchValue: "",
|
||||
logViewVisiable: false,
|
||||
modalVisiable: false,
|
||||
remarkValue: "",
|
||||
nameValue: "",
|
||||
title: "新增个税扣缴义务人",
|
||||
currentOperate: "add",
|
||||
currentId: "",
|
||||
}
|
||||
editModalProps: {
|
||||
title: "新增个税扣缴义务人",
|
||||
visible: false,
|
||||
current: 0,
|
||||
btnType: "save", //save: 添加, edit: 编辑, prev: '上一步'
|
||||
editId: "",
|
||||
editType: "save",
|
||||
},
|
||||
editModalLoading: {
|
||||
saveloading: false,
|
||||
},
|
||||
devolutionStatus: 0,
|
||||
conditions: editConditions,
|
||||
permission: {},
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() { // 初始化渲染页面
|
||||
const { taxAgentStore: { doInit } } = this.props;
|
||||
componentWillMount() {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { doInit } = taxAgentStore;
|
||||
doInit();
|
||||
this.getPermission();
|
||||
}
|
||||
|
||||
showLogView = () => {
|
||||
this.setState({logViewVisiable: true})
|
||||
}
|
||||
|
||||
onEdit = (record) => {
|
||||
this.setState({
|
||||
remarkValue: record.description,
|
||||
nameValue: record.name,
|
||||
title: "编辑个税扣缴义务人",
|
||||
currentOperate: "update",
|
||||
currentId: record.id
|
||||
})
|
||||
const {taxAgentStore : { setModalVisiable }} = this.props
|
||||
setModalVisiable(true)
|
||||
}
|
||||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = (columns) => {
|
||||
let newColumns = '';
|
||||
newColumns = columns.map(column => {
|
||||
let newColumn = column;
|
||||
newColumn.render = (text, record, index) => { //前端元素转义
|
||||
let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
|
||||
switch(newColumn.dataIndex) {
|
||||
case "name":
|
||||
return <a onClick={() => {this.onEdit(record)}}
|
||||
dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
case "operate":
|
||||
return <a onClick={() => {this.onEdit(record)}}>编辑</a>
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
}
|
||||
}
|
||||
return newColumn;
|
||||
});
|
||||
return newColumns;
|
||||
}
|
||||
|
||||
onOperatesClick = (record, index, operate, flag) => {
|
||||
const {taxAgentStore : {doDelete}} = this.props;
|
||||
switch(operate.index.toString()){
|
||||
case '0': // 删除
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除吗?",
|
||||
onOk() {
|
||||
doDelete([record.id])
|
||||
},
|
||||
onCancel() {}
|
||||
getPermission = () => {
|
||||
const { getPermission } = this.props.taxAgentStore;
|
||||
getPermission().then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ permission: data }, () => {
|
||||
this.getTaxAgentBaseForm();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
getTaxAgentBaseForm = () => {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { getTaxAgentBaseForm } = taxAgentStore;
|
||||
getTaxAgentBaseForm().then(({ status, data }) => {
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const { devolutionStatus } = data;
|
||||
this.setState({ devolutionStatus });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
taxAgentBaseSave = (devolutionStatus) => {
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确认${!devolutionStatus ? "停用" : "启用"}分权?`,
|
||||
onOk: () => {
|
||||
const paylaod = { devolutionStatus };
|
||||
const { taxAgentStore } = this.props;
|
||||
const { taxAgentBaseSave, doInit, pageObj } = taxAgentStore;
|
||||
taxAgentBaseSave(paylaod).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success(`${!devolutionStatus ? "停用" : "启用"}分权成功`);
|
||||
this.getTaxAgentBaseForm();
|
||||
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
|
||||
} else {
|
||||
message.error(
|
||||
errormsg || `${!devolutionStatus ? "停用" : "启用"}分权失败`
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
};
|
||||
|
||||
getTaxAgentForm = (id, current) => {
|
||||
const { conditions } = this.state;
|
||||
const { taxAgentStore } = this.props;
|
||||
const { getTaxAgentForm, getCondition } = taxAgentStore;
|
||||
getTaxAgentForm({ id }).then(({ status, data }) => {
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const [conditionItem] = conditions;
|
||||
const conditionMap = _.map(conditionItem.items, (it) => {
|
||||
const key = it.domkey.join("");
|
||||
if (it.conditionType === "BROWSER") {
|
||||
return {
|
||||
...it,
|
||||
browserConditionParam: {
|
||||
...it.browserConditionParam,
|
||||
replaceDatas: _.map(data[key], (b) => ({
|
||||
id: b.id,
|
||||
name: b.content,
|
||||
})),
|
||||
},
|
||||
viewAttr: current == 1 ? 1 : it.viewAttr,
|
||||
};
|
||||
} else {
|
||||
if (data[key]) {
|
||||
return {
|
||||
...it,
|
||||
value: data[key],
|
||||
viewAttr: current == 1 ? 1 : it.viewAttr,
|
||||
};
|
||||
}
|
||||
}
|
||||
return { ...it, viewAttr: current == 1 ? 1 : it.viewAttr };
|
||||
});
|
||||
this.setState(
|
||||
{
|
||||
conditions: [{ defaultshow: true, items: conditionMap }],
|
||||
},
|
||||
() => {
|
||||
getCondition(this.state.conditions);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
showEditModal = (editId, current) => {
|
||||
this.setState(
|
||||
{
|
||||
editModalProps: {
|
||||
...this.state.editModalProps,
|
||||
visible: true,
|
||||
title: editId ? "编辑个税扣缴义务人" : "新增个税扣缴义务人",
|
||||
btnType: editId ? "edit" : "save",
|
||||
editId: editId,
|
||||
editType: current ? "set" : editId && !current ? "edit" : "save",
|
||||
current: current ? current : 0,
|
||||
},
|
||||
},
|
||||
() => {
|
||||
editId && this.getTaxAgentForm(editId, current);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
closeModal = () => {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { form, getCondition } = taxAgentStore;
|
||||
this.setState(
|
||||
{
|
||||
editModalProps: {
|
||||
...this.state.editModalProps,
|
||||
title: "新增个税扣缴义务人",
|
||||
current: 0,
|
||||
btnType: "save",
|
||||
editId: "",
|
||||
editType: "save",
|
||||
visible: false,
|
||||
},
|
||||
conditions: editConditions,
|
||||
},
|
||||
() => {
|
||||
form.resetForm();
|
||||
getCondition(this.state.conditions);
|
||||
}
|
||||
);
|
||||
};
|
||||
/**
|
||||
* name:表单提交
|
||||
* return {*}
|
||||
*/
|
||||
handleSubmit = (module) => {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { editModalProps } = this.state;
|
||||
const { doInit, saveTaxAgent, updateTaxAgent, pageObj } = taxAgentStore;
|
||||
const { btnType, editId, editType } = editModalProps;
|
||||
if (btnType === "save") {
|
||||
// 新增
|
||||
this.setState({
|
||||
editModalLoading: {
|
||||
saveloading: true,
|
||||
},
|
||||
});
|
||||
const payload = { ...module };
|
||||
saveTaxAgent(payload).then(({ status, errormsg, data }) => {
|
||||
this.setState({
|
||||
editModalLoading: {
|
||||
saveloading: false,
|
||||
},
|
||||
});
|
||||
if (status) {
|
||||
message.success("新增成功");
|
||||
this.setState({
|
||||
editModalProps: {
|
||||
...editModalProps,
|
||||
editId: data,
|
||||
current: 1,
|
||||
btnType: "prev",
|
||||
},
|
||||
});
|
||||
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
|
||||
} else {
|
||||
message.error(errormsg || "新增失败");
|
||||
}
|
||||
});
|
||||
} else if (btnType === "edit") {
|
||||
// 编辑
|
||||
this.setState({
|
||||
editModalLoading: {
|
||||
saveloading: true,
|
||||
},
|
||||
});
|
||||
const payload = { ...module, id: editId };
|
||||
updateTaxAgent(payload).then(({ status, errormsg }) => {
|
||||
this.setState({
|
||||
editModalLoading: {
|
||||
saveloading: false,
|
||||
},
|
||||
});
|
||||
if (status) {
|
||||
message.success("更新成功");
|
||||
if (editType === "edit") {
|
||||
this.closeModal();
|
||||
} else {
|
||||
this.setState({
|
||||
editModalProps: {
|
||||
...editModalProps,
|
||||
current: 1,
|
||||
btnType: "prev",
|
||||
},
|
||||
});
|
||||
}
|
||||
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
|
||||
} else {
|
||||
message.error(errormsg || "更新失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* name: 删除个税扣缴义务人
|
||||
* param {*} agentId
|
||||
* return {*}
|
||||
*/
|
||||
deleteTaxAgent = (agentId) => {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { deleteTaxAgent, pageObj, doInit } = taxAgentStore;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确认要删除吗?`,
|
||||
onOk: () => {
|
||||
deleteTaxAgent([agentId]).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("删除成功");
|
||||
doInit({ current: pageObj.current, pageSize: pageObj.pageSize });
|
||||
} else {
|
||||
message.error(errormsg || "删除失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { loading, hasRight, form, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd, doInsert } = taxAgentStore;
|
||||
const { modalVisiable, setModalVisiable, doUpdate } = taxAgentStore;
|
||||
const {
|
||||
editModalProps,
|
||||
editModalLoading,
|
||||
devolutionStatus,
|
||||
conditions,
|
||||
permission,
|
||||
} = this.state;
|
||||
const { loading, pageObj, dataSource, columns, doInit, hasRight } =
|
||||
taxAgentStore;
|
||||
|
||||
const topTab = [
|
||||
];
|
||||
|
||||
|
||||
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
if (!hasRight && !loading) {
|
||||
// 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
// {
|
||||
// key: 'BTN_COLUMN',
|
||||
// icon: <i className='icon-coms-Custom' />,
|
||||
// content: '操作日志',
|
||||
// onClick: this.showLogView
|
||||
// },
|
||||
];
|
||||
|
||||
const initEditModal = () => {
|
||||
this.setState({
|
||||
nameValue: '',
|
||||
remarkValue: "",
|
||||
title: "新增个税扣缴义务人",
|
||||
currentOperate: "add"
|
||||
})
|
||||
}
|
||||
|
||||
const showEditModal = () => {
|
||||
|
||||
initEditModal();
|
||||
setModalVisiable(true)
|
||||
}
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div>
|
||||
<Button type="primary" onClick={() => { showEditModal() }}>新增</Button>
|
||||
{' '}
|
||||
<WeaInputSearch
|
||||
value={this.state.searchValue}
|
||||
placeholder={'请输入个税扣缴义务人名称'}
|
||||
onSearch={(name) => doSearch(name)}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
const renderTipsLabel = () => {
|
||||
const tipList = [
|
||||
"1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;",
|
||||
"2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;"
|
||||
]
|
||||
return (
|
||||
<TipLabel
|
||||
tipList={tipList}
|
||||
/>
|
||||
)
|
||||
}
|
||||
"2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;",
|
||||
];
|
||||
return <TipLabel tipList={tipList} />;
|
||||
};
|
||||
|
||||
const pagination = {
|
||||
total: pageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
doInit({ current, pageSize });
|
||||
},
|
||||
onChange(current) {
|
||||
doInit({ current, pageSize: pageObj.pageSize });
|
||||
},
|
||||
};
|
||||
const newColumns = _.map(
|
||||
[
|
||||
...columns,
|
||||
{
|
||||
title: "操作",
|
||||
key: "operation",
|
||||
render: (text, record) => (
|
||||
<div className="operationWapper">
|
||||
<a
|
||||
href="javaScript:void(0);"
|
||||
onClick={() => this.showEditModal(record.id)}>
|
||||
编辑
|
||||
</a>
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item key="0">
|
||||
<a
|
||||
href="javaScript:void(0);"
|
||||
onClick={() => this.deleteTaxAgent(record.id)}>
|
||||
删除
|
||||
</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a className="ant-dropdown-link" href="javaScript:void(0);">
|
||||
<i className="icon-coms-more" />
|
||||
</a>
|
||||
</Dropdown>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
],
|
||||
(item) => {
|
||||
if (item.dataIndex === "employeeRange") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<div className="employeeRangeWapper">
|
||||
<a
|
||||
href="javaScript:void(0);"
|
||||
onClick={() => this.showEditModal(record.id, 1)}>
|
||||
{text}
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
} else {
|
||||
return { ...item };
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaRightMenu
|
||||
datas={rightMenu} // 右键菜单
|
||||
>
|
||||
<WeaRightMenu>
|
||||
<WeaTop
|
||||
title="个税扣缴义务人" // 文字
|
||||
icon={<i className='icon-coms-meeting' />} // 左侧图标
|
||||
iconBgcolor='#F14A2D' // 左侧图标背景色
|
||||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
>
|
||||
<CustomTab topTab={topTab}
|
||||
searchOperationItem={
|
||||
renderSearchOperationItem()
|
||||
}
|
||||
onChange={(v) => {
|
||||
this.setState({ selectedKey: v })
|
||||
}}
|
||||
/>
|
||||
<Row gutter={16} style={{overflow: "hidden", width: "100%"}}>
|
||||
<Row
|
||||
gutter={16}
|
||||
style={{ overflow: "hidden", width: "100%", marginTop: 8 }}>
|
||||
<Col sm={24} md={24} lg={18} xl={18}>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={tableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
getColumns={this.getColumns}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
<div className="mySalaryTableWrapper">
|
||||
{permission.isChief && (
|
||||
<WeaSearchGroup title={"基础信息"} showGroup>
|
||||
<WeaFormItem
|
||||
label="启用分权"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 20 }}>
|
||||
<Switch
|
||||
checked={devolutionStatus === 1}
|
||||
onChange={this.taxAgentBaseSave}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
</WeaSearchGroup>
|
||||
)}
|
||||
<WeaSearchGroup
|
||||
title={
|
||||
<div className="titleWrapper">
|
||||
<div className="title">个税扣缴义务人</div>
|
||||
<i
|
||||
className="icon-coms-Add-to"
|
||||
title="新增"
|
||||
onClick={() => this.showEditModal()}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
showGroup>
|
||||
<WeaTable
|
||||
columns={newColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
/>
|
||||
</WeaSearchGroup>
|
||||
</div>
|
||||
</Col>
|
||||
<Col sm={24} md={24} lg={6} xl={6}>
|
||||
{renderTipsLabel()}
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
|
||||
{
|
||||
modalVisiable && <EditModal
|
||||
title={this.state.title}
|
||||
visible={modalVisiable}
|
||||
name={this.state.nameValue}
|
||||
remark={this.state.remarkValue}
|
||||
onCancel={() => {setModalVisiable(false)}}
|
||||
onSubmitAdd={(params) => {doInsert(params)}}
|
||||
operate={this.state.currentOperate}
|
||||
onSubmitUpdate={(params) => {doUpdate(params)}}
|
||||
currentId={this.state.currentId}
|
||||
/>
|
||||
}
|
||||
|
||||
<LogViewModal
|
||||
visible={this.state.logViewVisiable}
|
||||
onCancel={() => {this.setState({logViewVisiable: false})}}
|
||||
/>
|
||||
{editModalProps.visible && (
|
||||
<EditModal
|
||||
{...editModalProps}
|
||||
{...editModalLoading}
|
||||
editConditions={conditions}
|
||||
taxAgentStore={taxAgentStore}
|
||||
onPrev={() =>
|
||||
this.setState({
|
||||
editModalProps: {
|
||||
...editModalProps,
|
||||
current: 0,
|
||||
btnType: "edit",
|
||||
},
|
||||
})
|
||||
}
|
||||
onChangeTab={(current) => {
|
||||
this.setState({
|
||||
editModalProps: {
|
||||
...editModalProps,
|
||||
current,
|
||||
},
|
||||
});
|
||||
}}
|
||||
onClose={this.closeModal}
|
||||
onSubmit={this.handleSubmit}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,81 @@
|
|||
.logViewModal {
|
||||
.searchBar {
|
||||
.mySalaryBenefitsWrapper {
|
||||
height: 100%;
|
||||
|
||||
.wea-new-top-wapper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.mySalaryTableWrapper {
|
||||
.wea-search-group {
|
||||
padding: 0;
|
||||
|
||||
.wea-content {
|
||||
padding-left: 16px;
|
||||
|
||||
.ant-switch {
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.titleWrapper {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
i {
|
||||
color: #2db7f5;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.searchBarLabel {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.ant-table-row:hover {
|
||||
a.ant-dropdown-link {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.searchBarItem {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.searchDateRange {
|
||||
width: 300px;
|
||||
}
|
||||
.searchBtn {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
|
||||
.operationWapper,
|
||||
.employeeRangeWapper {
|
||||
a {
|
||||
color: #4d7ad8;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.ant-dropdown-link {
|
||||
margin-left: 18px;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.logViewModal {
|
||||
.searchBar {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.searchBarLabel {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.searchBarItem {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.searchDateRange {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.searchBtn {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 个税扣缴义务人-人员范围
|
||||
* Date: 2022-05-31 09:51:59
|
||||
* LastEditTime: 2022-06-01 17:57:42
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { message, Modal } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import SlideTaxagentUser from "./slideTaxagentUser";
|
||||
import "./index.less";
|
||||
|
||||
const personScopeWarrper = {
|
||||
padding: "0 25px",
|
||||
};
|
||||
|
||||
@inject("taxAgentStore", "ledgerStore")
|
||||
@observer
|
||||
export default class PersonalScope extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
queryLoading: false,
|
||||
submitLoading: false,
|
||||
targetTypeList: [],
|
||||
employeeStatus: [],
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
pageObj: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
}
|
||||
componentDidMount() {
|
||||
this.getTaxAgentRangeForm();
|
||||
this.getTaxAgentRangeListInclude();
|
||||
}
|
||||
|
||||
getTaxAgentRangeForm = () => {
|
||||
const { getTaxAgentRangeForm } = this.props.taxAgentStore;
|
||||
getTaxAgentRangeForm().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { employeeStatus, targetTypeList } = data;
|
||||
this.setState({ employeeStatus, targetTypeList });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
getTaxAgentRangeListInclude = (pageModule = {}) => {
|
||||
const { taxAgentId } = this.props;
|
||||
const { getTaxAgentRangeListInclude } = this.props.taxAgentStore;
|
||||
this.setState({ queryLoading: true });
|
||||
getTaxAgentRangeListInclude({ ...pageModule, taxAgentId }).then(
|
||||
({ status, data }) => {
|
||||
this.setState({ queryLoading: false });
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const {
|
||||
columns,
|
||||
list: dataSource,
|
||||
pageNum: current,
|
||||
pageSize,
|
||||
total,
|
||||
} = data;
|
||||
this.setState({
|
||||
columns,
|
||||
dataSource,
|
||||
pageObj: {
|
||||
current,
|
||||
pageSize,
|
||||
total,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
getTaxAgentRangeListExclude = (pageModule = {}) => {
|
||||
const { taxAgentId } = this.props;
|
||||
const { getTaxAgentRangeListExclude } = this.props.taxAgentStore;
|
||||
this.setState({ queryLoading: true });
|
||||
getTaxAgentRangeListExclude({ ...pageModule, taxAgentId }).then(
|
||||
({ status, data }) => {
|
||||
this.setState({ queryLoading: false });
|
||||
if (status && !_.isEmpty(data)) {
|
||||
const {
|
||||
columns,
|
||||
list: dataSource,
|
||||
pageNum: current,
|
||||
pageSize,
|
||||
total,
|
||||
} = data;
|
||||
this.setState({
|
||||
columns,
|
||||
dataSource,
|
||||
pageObj: {
|
||||
current,
|
||||
pageSize,
|
||||
total,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
taxAgentRangeDelete = ({ ids, tab }) => {
|
||||
const { taxAgentRangeDelete } = this.props.taxAgentStore;
|
||||
const { pageObj } = this.state;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确认删除该条数据吗?`,
|
||||
onOk: () => {
|
||||
taxAgentRangeDelete(ids).then(({ status, errorMsg }) => {
|
||||
if (status) {
|
||||
message.success("删除成功");
|
||||
tab == "1"
|
||||
? this.getTaxAgentRangeListInclude({
|
||||
current: pageObj.current,
|
||||
pageSize: pageObj.pageSize,
|
||||
})
|
||||
: this.getTaxAgentRangeListExclude({
|
||||
current: pageObj.current,
|
||||
pageSize: pageObj.pageSize,
|
||||
});
|
||||
} else {
|
||||
message.error(errorMsg || "删除失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
};
|
||||
|
||||
taxAgentRangeSave = (module) => {
|
||||
const { taxAgentId } = this.props;
|
||||
const { pageObj } = this.state;
|
||||
const { includeType } = module;
|
||||
const { taxAgentRangeSave } = this.props.taxAgentStore;
|
||||
this.setState({ submitLoading: true });
|
||||
taxAgentRangeSave({ ...module, taxAgentId }).then(
|
||||
({ status, errorMsg }) => {
|
||||
this.setState({ submitLoading: false });
|
||||
if (status) {
|
||||
this.tagAgentRef.closeModal();
|
||||
message.success("新增成功");
|
||||
includeType == "1"
|
||||
? this.getTaxAgentRangeListInclude({
|
||||
current: pageObj.current,
|
||||
pageSize: pageObj.pageSize,
|
||||
})
|
||||
: this.getTaxAgentRangeListExclude({
|
||||
current: pageObj.current,
|
||||
pageSize: pageObj.pageSize,
|
||||
});
|
||||
} else {
|
||||
message.error(errorMsg || "新增失败");
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
dataSource,
|
||||
columns,
|
||||
pageObj,
|
||||
employeeStatus,
|
||||
targetTypeList,
|
||||
submitLoading,
|
||||
queryLoading,
|
||||
} = this.state;
|
||||
return (
|
||||
<div style={personScopeWarrper}>
|
||||
<SlideTaxagentUser
|
||||
ref={(dom) => (this.tagAgentRef = dom)}
|
||||
dataSource={dataSource}
|
||||
columns={columns}
|
||||
pageObj={pageObj}
|
||||
submitLoading={submitLoading}
|
||||
queryLoading={queryLoading}
|
||||
setPageObj={(params) => {
|
||||
const { current, pageSize, tab } = params;
|
||||
this.setState(
|
||||
{
|
||||
pageObj: {
|
||||
...pageObj,
|
||||
current,
|
||||
pageSize,
|
||||
},
|
||||
},
|
||||
() => {
|
||||
tab == "1"
|
||||
? this.getTaxAgentRangeListInclude({ ...pageObj, ...params })
|
||||
: this.getTaxAgentRangeListExclude({ ...pageObj, ...params });
|
||||
}
|
||||
);
|
||||
}}
|
||||
employeeStatus={employeeStatus}
|
||||
targetTypeList={targetTypeList}
|
||||
onDeleteTaxAgent={this.taxAgentRangeDelete}
|
||||
onTaxAgentSave={this.taxAgentRangeSave}
|
||||
onTaxAngetSearch={({ targetName, tab }) => {
|
||||
tab == "1"
|
||||
? this.getTaxAgentRangeListInclude({ targetName })
|
||||
: this.getTaxAgentRangeListExclude({ targetName });
|
||||
}}
|
||||
onChangeTab={(tab) => {
|
||||
tab == "1"
|
||||
? this.getTaxAgentRangeListInclude()
|
||||
: this.getTaxAgentRangeListExclude();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
import React from "react";
|
||||
import { Icon, Table, message } from "antd";
|
||||
import { WeaInputSearch } from "ecCom";
|
||||
import AddTaxAgentModal from "./addTaxAgentModal";
|
||||
|
||||
export default class SlideTaxagentUser extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
addTaxagentModalVisible: false,
|
||||
includeType: 1,
|
||||
selectedRowKeys: [],
|
||||
searchValue: "",
|
||||
};
|
||||
}
|
||||
|
||||
handleTabClick(includeType) {
|
||||
const { onChangeTab } = this.props;
|
||||
this.setState(
|
||||
{
|
||||
includeType,
|
||||
},
|
||||
() => {
|
||||
onChangeTab && onChangeTab(includeType);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
onSelectChange = (selectedRowKeys) => {
|
||||
this.setState({ selectedRowKeys });
|
||||
};
|
||||
|
||||
handleTabDelete = () => {
|
||||
const { onDeleteTaxAgent } = this.props;
|
||||
const { includeType } = this.state;
|
||||
if (this.state.selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
onDeleteTaxAgent({ ids: this.state.selectedRowKeys, tab: includeType });
|
||||
};
|
||||
|
||||
handleSearch = (value) => {
|
||||
const { includeType } = this.state;
|
||||
const { onTaxAngetSearch } = this.props;
|
||||
onTaxAngetSearch({
|
||||
tab: includeType,
|
||||
targetName: value,
|
||||
});
|
||||
};
|
||||
|
||||
closeModal = () => {
|
||||
this.setState({
|
||||
addTaxagentModalVisible: false,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
includeType,
|
||||
selectedRowKeys,
|
||||
searchValue,
|
||||
addTaxagentModalVisible,
|
||||
} = this.state;
|
||||
const {
|
||||
submitLoading,
|
||||
queryLoading,
|
||||
dataSource,
|
||||
columns: taxAgentColumns,
|
||||
pageObj,
|
||||
setPageObj,
|
||||
employeeStatus,
|
||||
targetTypeList,
|
||||
onTaxAgentSave,
|
||||
} = this.props;
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange,
|
||||
};
|
||||
const pagination = {
|
||||
total: pageObj.total,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
setPageObj &&
|
||||
setPageObj({
|
||||
current,
|
||||
pageSize,
|
||||
tab: includeType,
|
||||
targetName: searchValue,
|
||||
});
|
||||
},
|
||||
onChange: (current) => {
|
||||
setPageObj &&
|
||||
setPageObj({
|
||||
current,
|
||||
tab: includeType,
|
||||
targetName: searchValue,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="slideRefereUser">
|
||||
<div
|
||||
style={{
|
||||
height: "47px",
|
||||
lineHeight: "47px",
|
||||
paddingLeft: "10px",
|
||||
paddingRight: "10px",
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
}}>
|
||||
<div
|
||||
style={{
|
||||
display: "inlineBlock",
|
||||
color: "#666",
|
||||
}}>
|
||||
<span
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
color: includeType == 1 ? "#4ba9f2" : "#000",
|
||||
}}
|
||||
onClick={() => {
|
||||
this.handleTabClick(1);
|
||||
}}>
|
||||
关联人员范围
|
||||
</span>{" "}
|
||||
{" "} | {" "}{" "}
|
||||
<span
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
color: includeType == 0 ? "#4ba9f2" : "#000",
|
||||
}}
|
||||
onClick={() => {
|
||||
this.handleTabClick(0);
|
||||
}}>
|
||||
从范围中排除
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
style={{
|
||||
color: "#4ba9f2",
|
||||
display: "inlineBlock",
|
||||
float: "left",
|
||||
}}>
|
||||
<Icon
|
||||
style={{ cursor: "pointer", marginRight: "10px" }}
|
||||
type="minus-square"
|
||||
onClick={() => {
|
||||
this.handleTabDelete();
|
||||
}}
|
||||
/>
|
||||
<Icon
|
||||
style={{ cursor: "pointer", marginRight: "10px" }}
|
||||
type="plus-square"
|
||||
onClick={() => this.setState({ addTaxagentModalVisible: true })}
|
||||
/>
|
||||
</div>
|
||||
<WeaInputSearch
|
||||
style={{ marginTop: "8px", float: "right" }}
|
||||
value={searchValue}
|
||||
onChange={(value) => {
|
||||
this.setState({ searchValue: value });
|
||||
}}
|
||||
onSearch={(value) => {
|
||||
this.handleSearch(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Table
|
||||
rowKey="id"
|
||||
loading={queryLoading}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={dataSource}
|
||||
columns={taxAgentColumns}
|
||||
pagination={pagination}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AddTaxAgentModal
|
||||
loading={submitLoading}
|
||||
employeeStatus={employeeStatus}
|
||||
targetTypeList={targetTypeList}
|
||||
onTaxAgentSave={(val) =>
|
||||
onTaxAgentSave &&
|
||||
onTaxAgentSave({ ...val, includeType: includeType })
|
||||
}
|
||||
visible={addTaxagentModalVisible}
|
||||
onCancel={() => {
|
||||
this.setState({ addTaxagentModalVisible: false });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { observable, action, toJS } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
|
||||
import * as API from '../apis/attendance'; // 引入API接口文件
|
||||
import * as API from "../apis/attendance"; // 引入API接口文件
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
export class AttendanceStore {
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable attendTableStore = new TableStore();
|
||||
@observable attendTableStore = new TableStore();
|
||||
@observable form = new WeaForm(); // nrew 一个form
|
||||
@observable condition = []; // 存储后台得到的form数据
|
||||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
@observable step = 0 ;
|
||||
@observable step = 0;
|
||||
@observable modalVisiable = false;
|
||||
@observable slideVisiable = false;
|
||||
@observable currentItem = {};
|
||||
|
|
@ -40,7 +40,7 @@ export class AttendanceStore {
|
|||
@observable previewAttendQuoteList = []; // 导入-预览列表
|
||||
@observable previewAttendQuoteColumns = []; // 导入预览-列表对应列
|
||||
@observable previewAttendQuoteDataSource = []; // 导入预览-列表
|
||||
@observable importResult = {}
|
||||
@observable importResult = {};
|
||||
|
||||
// 考勤数据详情
|
||||
@observable attendQuoteDetailPageInfo = {}; // 详情列表分页数据
|
||||
|
|
@ -48,104 +48,107 @@ export class AttendanceStore {
|
|||
|
||||
@observable cycle = {};
|
||||
|
||||
// ** 设置导入参数 start **
|
||||
// ** 设置导入参数 start **
|
||||
@action
|
||||
setPreviewAttendQuoteColumns = (previewAttendQuoteColumns) => {
|
||||
this.previewAttendQuoteColumns = previewAttendQuoteColumns;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
setPreviewAttendQuoteDataSource = (previewAttendQuoteDataSource) => {
|
||||
this.previewAttendQuoteDataSource = previewAttendQuoteDataSource
|
||||
}
|
||||
this.previewAttendQuoteDataSource = previewAttendQuoteDataSource;
|
||||
};
|
||||
|
||||
@action
|
||||
setImportResult = (importResult) => {
|
||||
this.importResult = importResult
|
||||
}
|
||||
// ** 设置导入参数 end **
|
||||
|
||||
this.importResult = importResult;
|
||||
};
|
||||
// ** 设置导入参数 end **
|
||||
|
||||
@action
|
||||
searchFieldSettingList = (value) => {
|
||||
if(value != "") {
|
||||
if (value != "") {
|
||||
let requestFeildAttendList = [...this.requestFeildAttendList];
|
||||
this.fieldSettingAttendList = requestFeildAttendList.filter(item => item.name.indexOf(value) > -1)
|
||||
let requestFeildCustomList = [...this.requestFeildCustomList]
|
||||
this.fieldSettingCustomList = requestFeildCustomList.filter(item => item.name.indexOf(value) > -1)
|
||||
this.fieldSettingAttendList = requestFeildAttendList.filter(
|
||||
(item) => item.name.indexOf(value) > -1
|
||||
);
|
||||
let requestFeildCustomList = [...this.requestFeildCustomList];
|
||||
this.fieldSettingCustomList = requestFeildCustomList.filter(
|
||||
(item) => item.name.indexOf(value) > -1
|
||||
);
|
||||
} else {
|
||||
this.fieldSettingAttendList = [...this.requestFeildAttendList];
|
||||
this.fieldSettingCustomList = [...this.requestFeildCustomList];
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
setFieldSettingAttendList = fieldSettingAttendList =>
|
||||
{
|
||||
this.fieldSettingAttendList = fieldSettingAttendList
|
||||
let requestFeildAttendList = [...this.requestFeildAttendList]
|
||||
requestFeildAttendList.map(item => {
|
||||
this.fieldSettingAttendList.map(inner => {
|
||||
|
||||
if(inner.id == item.id && inner.checked != item.checked) {
|
||||
item.checked = inner.checked
|
||||
setFieldSettingAttendList = (fieldSettingAttendList) => {
|
||||
this.fieldSettingAttendList = fieldSettingAttendList;
|
||||
let requestFeildAttendList = [...this.requestFeildAttendList];
|
||||
requestFeildAttendList.map((item) => {
|
||||
this.fieldSettingAttendList.map((inner) => {
|
||||
if (inner.id == item.id && inner.checked != item.checked) {
|
||||
item.checked = inner.checked;
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
this.requestFeildAttendList = requestFeildAttendList;
|
||||
}
|
||||
};
|
||||
|
||||
@action
|
||||
setFieldSettingCustomList = fieldSettingCustomList =>
|
||||
{
|
||||
this.fieldSettingCustomList = fieldSettingCustomList
|
||||
let requestFeildCustomList = [...this.requestFeildCustomList]
|
||||
requestFeildCustomList.map(item => {
|
||||
this.fieldSettingCustomList.map(inner => {
|
||||
if(inner.id == item.id && inner.checked != item.checked) {
|
||||
item.checked = inner.checked
|
||||
setFieldSettingCustomList = (fieldSettingCustomList) => {
|
||||
this.fieldSettingCustomList = fieldSettingCustomList;
|
||||
let requestFeildCustomList = [...this.requestFeildCustomList];
|
||||
requestFeildCustomList.map((item) => {
|
||||
this.fieldSettingCustomList.map((inner) => {
|
||||
if (inner.id == item.id && inner.checked != item.checked) {
|
||||
item.checked = inner.checked;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@action
|
||||
setCurrentItem = currentItem => this.currentItem = currentItem;
|
||||
setCurrentItem = (currentItem) => (this.currentItem = currentItem);
|
||||
|
||||
@action
|
||||
setCurrentItemOperate = currentItemOperate => this.currentItemOperate = currentItemOperate;
|
||||
setCurrentItemOperate = (currentItemOperate) =>
|
||||
(this.currentItemOperate = currentItemOperate);
|
||||
|
||||
@action
|
||||
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
|
||||
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
|
||||
|
||||
@action
|
||||
setStep = step => this.step = step
|
||||
setStep = (step) => (this.step = step);
|
||||
|
||||
@action
|
||||
setModalVisiable = modalVisiable => this.modalVisiable = modalVisiable
|
||||
|
||||
setModalVisiable = (modalVisiable) => (this.modalVisiable = modalVisiable);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
// this.getCondition();
|
||||
// this.getTableDatas();
|
||||
this.getAttendanceList({})
|
||||
this.getAttendanceList({});
|
||||
// this.getAttendanceFieldSettingList({sourceType:'IMPORT'})
|
||||
}
|
||||
};
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
getCondition = () => {
|
||||
API.getCondition().then(action(res => {
|
||||
if (res.api_status) { // 接口请求成功/失败处理
|
||||
this.condition = res.condition;
|
||||
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}));
|
||||
}
|
||||
API.getCondition().then(
|
||||
action((res) => {
|
||||
if (res.api_status) {
|
||||
// 接口请求成功/失败处理
|
||||
this.condition = res.condition;
|
||||
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染table数据
|
||||
@action
|
||||
|
|
@ -153,298 +156,318 @@ export class AttendanceStore {
|
|||
this.loading = true;
|
||||
const formParams = this.form.getFormParams() || {};
|
||||
params = params || formParams;
|
||||
API.getTableDatas(params).then(action(res => {
|
||||
if (res.api_status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.datas); // table 请求数据
|
||||
this.hasRight = res.hasRight;
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
API.getTableDatas(params).then(
|
||||
action((res) => {
|
||||
if (res.api_status) {
|
||||
// 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.datas); // table 请求数据
|
||||
this.hasRight = res.hasRight;
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
setShowSearchAd = (bool) => (this.showSearchAd = bool);
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 字段列表
|
||||
@action getAttendanceFieldList = (params) => {
|
||||
this.loading = true;
|
||||
API.getAttendanceFieldList(params).then(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
API.getAttendanceFieldList(params).then((res) => {
|
||||
if (res.status) {
|
||||
// 接口请求成功/失败处理
|
||||
this.fieldTableStore.getDatas(res.data.dataKey.datas); // table 请求数据
|
||||
this.fieldDataSource = res.data.pageInfo.list
|
||||
this.fieldPageInfo = res.data.pageInfo
|
||||
this.fieldDataSource = res.data.pageInfo.list;
|
||||
this.fieldPageInfo = res.data.pageInfo;
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@action saveAttendanceField = (params) => {
|
||||
API.saveAttendanceField(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("保存成功")
|
||||
API.saveAttendanceField(params).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("保存成功");
|
||||
} else {
|
||||
message.error(res.errormsg ||"保存失败")
|
||||
message.error(res.errormsg || "保存失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@action deleteAttendanceField = (params) => {
|
||||
API.deleteAttendanceField(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("删除成功")
|
||||
API.deleteAttendanceField(params).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("删除成功");
|
||||
} else {
|
||||
message.error(res.errormsg ||"删除失败")
|
||||
message.error(res.errormsg || "删除失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 批量删除
|
||||
@action
|
||||
doBatchDelete = () => {
|
||||
let ids = toJS(this.tableStore.selectedRowKeys)
|
||||
if(ids.length == 0) {
|
||||
let ids = toJS(this.tableStore.selectedRowKeys);
|
||||
if (ids.length == 0) {
|
||||
message.warning("未选择任何条目");
|
||||
return
|
||||
return;
|
||||
}
|
||||
API.deleteAttendanceField(this.tableStore.selectedRowKeys).then(res => {
|
||||
if(res.status) {
|
||||
message.success("删除成功")
|
||||
API.deleteAttendanceField(this.tableStore.selectedRowKeys).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("删除成功");
|
||||
} else {
|
||||
message.error(res.errormsg || "删除失败")
|
||||
message.error(res.errormsg || "删除失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 更新
|
||||
@action
|
||||
updateAttendanceField = (params) => {
|
||||
API.updateAttendanceField(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("修改成功")
|
||||
API.updateAttendanceField(params).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("修改成功");
|
||||
} else {
|
||||
message.error(res.errormsg || "修改失败")
|
||||
message.error(res.errormsg || "修改失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 更新状态
|
||||
@action
|
||||
updateAttendanceFieldStatus = (params) => {
|
||||
return API.updateAttendanceFieldStatus(params).then(res => {
|
||||
if(res.status) {
|
||||
return API.updateAttendanceFieldStatus(params).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("修改成功");
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(true);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
message.error( res.errormsg || "修改失败")
|
||||
message.error(res.errormsg || "修改失败");
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(false);
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 考勤数据列表
|
||||
@action
|
||||
getAttendanceList = (params) => {
|
||||
this.loading = true;
|
||||
API.getAttendanceList(params).then(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
API.getAttendanceList(params).then((res) => {
|
||||
if (res.status) {
|
||||
// 接口请求成功/失败处理
|
||||
// this.attendTableStore.getDatas(res.data.datas); // table 请求数据
|
||||
this.attendanceDataSource = res.data.list;
|
||||
this.attendancePageInfo = res.data;
|
||||
this.attendanceColumns = res.data.columns
|
||||
this.attendanceColumns = res.data.columns;
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤引用字段设置-列表
|
||||
@action
|
||||
getAttendanceFieldSettingList = (params) => {
|
||||
this.loading = true;
|
||||
API.getAttendanceFieldSettingList(params).then(res => {
|
||||
if(res.status) {
|
||||
this.requestFeildAttendList = res.data[0] ? res.data[0].items : []
|
||||
this.fieldSettingAttendList = this.requestFeildAttendList
|
||||
this.requestFeildCustomList = res.data[1] ? res.data[1].items : []
|
||||
API.getAttendanceFieldSettingList(params).then((res) => {
|
||||
if (res.status) {
|
||||
this.requestFeildAttendList = res.data[0] ? res.data[0].items : [];
|
||||
this.fieldSettingAttendList = this.requestFeildAttendList;
|
||||
this.requestFeildCustomList = res.data[1] ? res.data[1].items : [];
|
||||
this.fieldSettingCustomList = this.requestFeildCustomList;
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!")
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤引用字段设置-保存
|
||||
@action
|
||||
@action
|
||||
saveAttendanceFieldSetting = (sourceType = "IMPORT") => {
|
||||
let attendList = this.requestFeildAttendList.map(item => ({id: item.id, checked: item.checked}))
|
||||
let customList = this.requestFeildCustomList.map(item => ({id: item.id, checked: item.checked}))
|
||||
let attendList = this.requestFeildAttendList.map((item) => ({
|
||||
id: item.id,
|
||||
checked: item.checked,
|
||||
}));
|
||||
let customList = this.requestFeildCustomList.map((item) => ({
|
||||
id: item.id,
|
||||
checked: item.checked,
|
||||
}));
|
||||
let request = {
|
||||
sourceType: sourceType,
|
||||
currentSettingFields: [...attendList, ...customList]
|
||||
}
|
||||
API.saveAttendanceFieldSetting(request).then(res => {
|
||||
if(res.status) {
|
||||
message.success("保存成功")
|
||||
currentSettingFields: [...attendList, ...customList],
|
||||
};
|
||||
API.saveAttendanceFieldSetting(request).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("保存成功");
|
||||
} else {
|
||||
message.error(res.errormsg || "保存失败")
|
||||
message.error(res.errormsg || "保存失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤引用字段设置-恢复默认设置
|
||||
@action
|
||||
returnToAttendanceFieldSettingDefault = (sourceType = "IMPORT") => {
|
||||
API.returnToAttendanceFieldSettingDefault({sourceType: sourceType}).then(res => {
|
||||
if(res.status) {
|
||||
this.requestFeildAttendList = res.data[0] ? res.data[0].items : []
|
||||
this.fieldSettingAttendList = this.requestFeildAttendList
|
||||
this.requestFeildCustomList = res.data[1] ? res.data[1].items : []
|
||||
this.fieldSettingCustomList = this.requestFeildCustomList;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取数据失败")
|
||||
API.returnToAttendanceFieldSettingDefault({ sourceType: sourceType }).then(
|
||||
(res) => {
|
||||
if (res.status) {
|
||||
this.requestFeildAttendList = res.data[0] ? res.data[0].items : [];
|
||||
this.fieldSettingAttendList = this.requestFeildAttendList;
|
||||
this.requestFeildCustomList = res.data[1] ? res.data[1].items : [];
|
||||
this.fieldSettingCustomList = this.requestFeildCustomList;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取数据失败");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
//数据采集-考勤引用-考勤引用字段设置-设为默认设置
|
||||
@action
|
||||
saveAttendanceFieldSettingAsDefault = (sourceType = "IMPORT") => {
|
||||
|
||||
let attendList = this.requestFeildAttendList.map(item => ({id: item.id, checked: item.checked}))
|
||||
let customList = this.requestFeildCustomList.map(item => ({id: item.id, checked: item.checked}))
|
||||
let attendList = this.requestFeildAttendList.map((item) => ({
|
||||
id: item.id,
|
||||
checked: item.checked,
|
||||
}));
|
||||
let customList = this.requestFeildCustomList.map((item) => ({
|
||||
id: item.id,
|
||||
checked: item.checked,
|
||||
}));
|
||||
let request = {
|
||||
sourceType:sourceType,
|
||||
currentSettingFields: [...attendList, ...customList]
|
||||
}
|
||||
API.saveAttendanceFieldSettingAsDefault(request).then(res => {
|
||||
if(res.status) {
|
||||
message.success("设置成功")
|
||||
sourceType: sourceType,
|
||||
currentSettingFields: [...attendList, ...customList],
|
||||
};
|
||||
API.saveAttendanceFieldSettingAsDefault(request).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("设置成功");
|
||||
} else {
|
||||
message.error( res.errormsg || "设置失败")
|
||||
message.error(res.errormsg || "设置失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 导入表单-账套列表
|
||||
@action
|
||||
getLedgerList = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getLedgerList({}).then(res => {
|
||||
if(res.status) {
|
||||
this.importLedgerList = res.data
|
||||
resolve(this.importLedgerList)
|
||||
API.getLedgerList({}).then((res) => {
|
||||
if (res.status) {
|
||||
this.importLedgerList = res.data;
|
||||
resolve(this.importLedgerList);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 下载导入模板
|
||||
@action
|
||||
downloadTemplate = (salaryYearMonth, salarySobId) => {
|
||||
API.downloadTemplate(salaryYearMonth, salarySobId)
|
||||
}
|
||||
API.downloadTemplate(salaryYearMonth, salarySobId);
|
||||
};
|
||||
|
||||
// 导入预览
|
||||
@action
|
||||
previewAttendQuote = (params) => {
|
||||
API.previewAttendQuote(params).then(res => {
|
||||
if(res.status) {
|
||||
this.previewAttendQuoteList = res.data
|
||||
API.previewAttendQuote(params).then((res) => {
|
||||
if (res.status) {
|
||||
this.previewAttendQuoteList = res.data;
|
||||
this.previewAttendQuoteColumns = res.data.headers.map((item, index) => {
|
||||
let column = {}
|
||||
column.title = item;
|
||||
let column = {};
|
||||
column.title = item;
|
||||
column.dataIndex = "" + index;
|
||||
column.key = index + ""
|
||||
return column
|
||||
})
|
||||
column.key = index + "";
|
||||
return column;
|
||||
});
|
||||
|
||||
this.previewAttendQuoteDataSource = res.data.list.map((item) => {
|
||||
let data = {}
|
||||
let data = {};
|
||||
item.map((i, index) => {
|
||||
data[index + ''] = i
|
||||
})
|
||||
return data
|
||||
})
|
||||
|
||||
data[index + ""] = i;
|
||||
});
|
||||
return data;
|
||||
});
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 考勤导入
|
||||
@action
|
||||
importAttendQuoteData = (params) => {
|
||||
API.importAttendQuoteData(params).then(res => {
|
||||
if(res.status) {
|
||||
this.importResult = res.data
|
||||
API.importAttendQuoteData(params).then((res) => {
|
||||
if (res.status) {
|
||||
this.importResult = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "导入失败")
|
||||
message.error(res.errormsg || "导入失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
// 考勤数据详情
|
||||
@action
|
||||
viewAttendQuote = (params = {}) => {
|
||||
API.viewAttendQuote(params).then(res => {
|
||||
if(res.status) {
|
||||
this.attendQuoteDetailPageInfo = res.data.pageInfo
|
||||
this.attendQuoteDetailTableStore.getDatas(res.data.dataKey.datas)
|
||||
API.viewAttendQuote(params).then((res) => {
|
||||
if (res.status) {
|
||||
this.attendQuoteDetailPageInfo = res.data.pageInfo;
|
||||
this.attendQuoteDetailTableStore.getDatas(res.data.dataKey.datas);
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 考勤引用同步
|
||||
@action
|
||||
syncAttendanceRefer = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.syncAttendanceRefer(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("同步成功")
|
||||
resolve()
|
||||
API.syncAttendanceRefer(params).then((res) => {
|
||||
if (res.status) {
|
||||
message.success("同步成功");
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "同步失败")
|
||||
message.error(res.errormsg || "同步失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// 考勤引用同步
|
||||
@action
|
||||
checkOperation = (params) => {
|
||||
return API.checkOperation(params);
|
||||
};
|
||||
|
||||
// 根据所属月和账套获取周期
|
||||
@action
|
||||
getSalaryCycleAndAttendCycle = (salaryYearMonthStr, salarySobId) => {
|
||||
API.getSalaryCycleAndAttendCycle({salaryYearMonthStr, salarySobId}).then(res => {
|
||||
if(res.status) {
|
||||
this.cycle = res.data
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
API.getSalaryCycleAndAttendCycle({ salaryYearMonthStr, salarySobId }).then(
|
||||
(res) => {
|
||||
if (res.status) {
|
||||
this.cycle = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { observable, action, toJS } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
|
||||
import * as API from '../apis/cumDeduct'; // 引入API接口文件
|
||||
import * as TaxAgentApi from '../apis/taxAgent'
|
||||
import { removePropertyCondition } from '../util/response';
|
||||
import * as API from "../apis/cumDeduct"; // 引入API接口文件
|
||||
import * as TaxAgentApi from "../apis/taxAgent";
|
||||
import { removePropertyCondition } from "../util/response";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -16,61 +16,87 @@ export class CumDeductStore {
|
|||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
@observable slideLoading = true; // 详情数据加载状态
|
||||
@observable step = 0; // 当前所在第几步
|
||||
@observable slideVisiable = false; // slide 是否隐藏
|
||||
|
||||
@observable slideDataSource = [];
|
||||
|
||||
@observable importResult = {}
|
||||
@observable importResult = {};
|
||||
@observable modalVisiable = false; // 模态框显示
|
||||
|
||||
@observable currentRecord = {}; // 当前record
|
||||
@observable columns = [];
|
||||
@observable pageObj = {}; //列表数据
|
||||
@observable dataSource = []; //列表数据
|
||||
@observable slideColumns = []; //详情列数据
|
||||
@observable slidePageObj = {}; //详情分页列表数据
|
||||
@observable slideTableDataSource = []; //详情列表数据
|
||||
|
||||
// ** 设置导入参数 start **
|
||||
// ** 设置导入参数 start **
|
||||
@action
|
||||
setSlideDataSource = (slideDataSource) => {
|
||||
this.slideDataSource = slideDataSource
|
||||
}
|
||||
this.slideDataSource = slideDataSource;
|
||||
};
|
||||
|
||||
@action
|
||||
setImportResult = (importResult) => {
|
||||
this.importResult = importResult
|
||||
}
|
||||
// ** 设置导入参数 end **
|
||||
this.importResult = importResult;
|
||||
};
|
||||
// ** 设置导入参数 end **
|
||||
|
||||
@action
|
||||
setCurrentRecord = currentRecord => this.currentRecord = currentRecord;
|
||||
setColumns = (columns) => (this.columns = columns);
|
||||
|
||||
@action
|
||||
setModalVisiable = visiable => this.modalVisiable = visiable
|
||||
setPageObj = (pageObj) => (this.pageObj = pageObj);
|
||||
|
||||
@action
|
||||
setStep = step => this.step = step;
|
||||
setDataSource = (dataSource) => (this.dataSource = dataSource);
|
||||
|
||||
// 详情列表数据
|
||||
@action
|
||||
setSlideColumns = (columns) => (this.slideColumns = columns);
|
||||
|
||||
@action
|
||||
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
|
||||
setSlidePageObj = (pageObj) => (this.slidePageObj = pageObj);
|
||||
|
||||
@action
|
||||
setSlideTableDataSource = (dataSource) =>
|
||||
(this.slideTableDataSource = dataSource);
|
||||
|
||||
@action
|
||||
setCurrentRecord = (currentRecord) => (this.currentRecord = currentRecord);
|
||||
|
||||
@action
|
||||
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
|
||||
|
||||
@action
|
||||
setStep = (step) => (this.step = step);
|
||||
|
||||
@action
|
||||
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
this.getCondition();
|
||||
this.getTableDatas();
|
||||
}
|
||||
};
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
getCondition = () => {
|
||||
API.getCumDeductSaCondition().then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}));
|
||||
}
|
||||
API.getCumDeductSaCondition().then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
// 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.data.condition);
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染table数据
|
||||
@action
|
||||
|
|
@ -78,71 +104,106 @@ export class CumDeductStore {
|
|||
params = params || {};
|
||||
this.loading = true;
|
||||
let requestParams = this.form.getFormParams() || {};
|
||||
requestParams = {...requestParams, ...params}
|
||||
API.getCumDeductList(requestParams).then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.data.datas); // table 请求数据
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
requestParams = {
|
||||
...requestParams,
|
||||
...params,
|
||||
current: this.pageObj.current,
|
||||
pageSize: this.pageObj.pageSize,
|
||||
};
|
||||
API.getCumDeductList(requestParams).then(
|
||||
action(({ status, data, errormsg }) => {
|
||||
this.loading = false;
|
||||
if (status) {
|
||||
// 接口请求成功/失败处理
|
||||
const { columns, list, total, pageNum: current, pageSize } = data;
|
||||
this.setColumns(columns);
|
||||
this.setDataSource(list);
|
||||
this.setPageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
});
|
||||
} else {
|
||||
this.setDataSource([]);
|
||||
this.setPageObj({
|
||||
...this.pageObj,
|
||||
total: 0,
|
||||
});
|
||||
message.error(errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
setShowSearchAd = (bool) => (this.showSearchAd = bool);
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 导入
|
||||
@action importFile = (params) => {
|
||||
API.importCumDeductParam(params).then(action(res => {
|
||||
if(res.status) {
|
||||
this.importResult = res.data
|
||||
}
|
||||
}))
|
||||
}
|
||||
API.importCumDeductParam(params).then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
this.importResult = res.data;
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 导入预览
|
||||
@action previewImport = (params) => {
|
||||
API.importCumDeductPreview(params).then(action(res => {
|
||||
if(res.status) {
|
||||
this.slideDataSource = res.data.preview
|
||||
} else {
|
||||
message.error(res.errormsg || '预览失败')
|
||||
}
|
||||
}))
|
||||
}
|
||||
API.importCumDeductPreview(params).then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
this.slideDataSource = res.data.preview;
|
||||
} else {
|
||||
message.error(res.errormsg || "预览失败");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 导出
|
||||
@action exportCumDeductList = (ids = "") => {
|
||||
API.exportCumDeductList(ids)
|
||||
}
|
||||
API.exportCumDeductList(ids);
|
||||
};
|
||||
|
||||
// 查询明细
|
||||
@action getCumDeductDetailList = (id, param = {}) => {
|
||||
let requestParams = {"accumulatedSpecialAdditionalDeductionId": id};
|
||||
requestParams = {...requestParams, ...param}
|
||||
API.getCumDeductDetailList(requestParams).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.slideTableStore.getDatas(res.data.datas); // table 请求数据
|
||||
let requestParams = { accumulatedSpecialAdditionalDeductionId: id };
|
||||
requestParams = { ...requestParams, ...param };
|
||||
this.slideLoading = true;
|
||||
API.getCumDeductDetailList(requestParams).then(
|
||||
({ data, status, errormsg }) => {
|
||||
this.slideLoading = false;
|
||||
if (status) {
|
||||
const { columns, list, total, pageNum: current, pageSize } = data;
|
||||
this.setSlideColumns(columns);
|
||||
this.setSlideTableDataSource(list);
|
||||
this.setSlidePageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
});
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
this.setSlideTableDataSource(list);
|
||||
this.setSlidePageObj({
|
||||
...this.slidePageObj,
|
||||
total: 0,
|
||||
});
|
||||
message.error(errormsg || "接口调用失败!");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// 导出明细
|
||||
@action exportCumDeductDetailList = (id, ids = "") => {
|
||||
API.exportCumDeductDetailList(id, ids)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
API.exportCumDeductDetailList(id, ids);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { removePropertyCondition } from '../util/response';
|
||||
import { observable, action, toJS } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
import { removePropertyCondition } from "../util/response";
|
||||
|
||||
import * as API from '../apis/cumSituation'; // 引入API接口文件
|
||||
import * as TaxAgentApi from '../apis/taxAgent'
|
||||
import * as API from "../apis/cumSituation"; // 引入API接口文件
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -19,56 +18,84 @@ export class CumSituationStore {
|
|||
@observable step = 0; // 当前所在第几步
|
||||
@observable slideVisiable = false; // slide 是否隐藏
|
||||
@observable slideDataSource = [];
|
||||
@observable importResult = {}
|
||||
@observable importResult = {};
|
||||
@observable modalVisiable = false; // 模态框显示
|
||||
@observable currentRecord = {}; // 当前record
|
||||
|
||||
@observable columns = [];
|
||||
@observable pageObj = {}; //列表数据
|
||||
@observable dataSource = []; //列表数据
|
||||
@observable slideColumns = []; //详情列数据
|
||||
@observable slidePageObj = {}; //详情分页列表数据
|
||||
@observable slideTableDataSource = []; //详情列表数据
|
||||
|
||||
// ** 设置导入参数 start **
|
||||
@action
|
||||
setSlideDataSource = (slideDataSource) => {
|
||||
this.slideDataSource = slideDataSource
|
||||
}
|
||||
this.slideDataSource = slideDataSource;
|
||||
};
|
||||
|
||||
@action
|
||||
setImportResult = (importResult) => {
|
||||
this.importResult = importResult
|
||||
}
|
||||
this.importResult = importResult;
|
||||
};
|
||||
// ** 设置导入参数 end **
|
||||
|
||||
@action
|
||||
setCurrentRecord = currentRecord => this.currentRecord = currentRecord;
|
||||
setColumns = (columns) => (this.columns = columns);
|
||||
|
||||
@action
|
||||
setModalVisiable = visiable => this.modalVisiable = visiable
|
||||
setPageObj = (pageObj) => (this.pageObj = pageObj);
|
||||
|
||||
@action
|
||||
setStep = step => this.step = step;
|
||||
setDataSource = (dataSource) => (this.dataSource = dataSource);
|
||||
|
||||
// 详情列表数据
|
||||
@action
|
||||
setSlideColumns = (columns) => (this.slideColumns = columns);
|
||||
|
||||
@action
|
||||
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
|
||||
setSlidePageObj = (pageObj) => (this.slidePageObj = pageObj);
|
||||
|
||||
@action
|
||||
setSlideTableDataSource = (dataSource) =>
|
||||
(this.slideTableDataSource = dataSource);
|
||||
|
||||
@action
|
||||
setCurrentRecord = (currentRecord) => (this.currentRecord = currentRecord);
|
||||
|
||||
@action
|
||||
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
|
||||
|
||||
@action
|
||||
setStep = (step) => (this.step = step);
|
||||
|
||||
@action
|
||||
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
this.getCondition();
|
||||
this.getTableDatas();
|
||||
}
|
||||
};
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
getCondition = () => {
|
||||
API.getCumSituationSaCondition().then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}));
|
||||
}
|
||||
API.getCumSituationSaCondition().then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
// 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.data.condition);
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染table数据
|
||||
@action
|
||||
|
|
@ -76,72 +103,102 @@ export class CumSituationStore {
|
|||
params = params || {};
|
||||
this.loading = true;
|
||||
let requestParams = this.form.getFormParams() || {};
|
||||
requestParams = {...requestParams, ...params}
|
||||
API.getCumSituationList(requestParams).then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.data.datas); // table 请求数据
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
requestParams = { ...requestParams, ...params };
|
||||
API.getCumSituationList(requestParams).then(
|
||||
action(({ status, data, errormsg }) => {
|
||||
this.loading = false;
|
||||
if (status) {
|
||||
// 接口请求成功/失败处理
|
||||
const { columns, list, total, pageNum: current, pageSize } = data;
|
||||
this.setColumns(columns);
|
||||
this.setDataSource(list);
|
||||
this.setPageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
});
|
||||
} else {
|
||||
this.setDataSource([]);
|
||||
this.setPageObj({
|
||||
...this.pageObj,
|
||||
total: 0,
|
||||
});
|
||||
message.error(errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
setShowSearchAd = (bool) => (this.showSearchAd = bool);
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 导入
|
||||
// 导入
|
||||
@action importFile = (params) => {
|
||||
API.importCumSituationParam(params).then(action(res => {
|
||||
if(res.status) {
|
||||
this.importResult = res.data
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}))
|
||||
}
|
||||
API.importCumSituationParam(params).then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
this.importResult = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 导入预览
|
||||
@action previewImport = (params) => {
|
||||
API.importCumSituationPreview(params).then(action(res => {
|
||||
if(res.status) {
|
||||
this.slideDataSource = res.data.preview
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}))
|
||||
}
|
||||
API.importCumSituationPreview(params).then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
this.slideDataSource = res.data.preview;
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 导出
|
||||
@action exportCumSituationList = (ids = "") => {
|
||||
API.exportCumSituationList(ids)
|
||||
}
|
||||
API.exportCumSituationList(ids);
|
||||
};
|
||||
|
||||
// 查询明细
|
||||
@action getCumDeductDetailList = (id, param = {}) => {
|
||||
let requestParams = {"accumulatedSituationId": id};
|
||||
requestParams = {...requestParams, ...param}
|
||||
API.getCumSituationDetailList(requestParams).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.slideTableStore.getDatas(res.data.datas); // table 请求数据
|
||||
let requestParams = { accumulatedSituationId: id };
|
||||
requestParams = { ...requestParams, ...param };
|
||||
API.getCumSituationDetailList(requestParams).then(
|
||||
({ status, data, errormsg }) => {
|
||||
if (status) {
|
||||
// 接口请求成功/失败处理
|
||||
const { columns, list, total, pageNum: current, pageSize } = data;
|
||||
this.setSlideColumns(columns);
|
||||
this.setSlideTableDataSource(list);
|
||||
this.setSlidePageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
});
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
this.setSlideTableDataSource([]);
|
||||
this.setSlidePageObj({
|
||||
...this.slidePageObj,
|
||||
total: 0,
|
||||
});
|
||||
message.error(errormsg || "接口调用失败!");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// 导出明细
|
||||
@action exportCumSituationDetailList = (id, ids = "") => {
|
||||
API.exportCumSituationDetailList(id, ids)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
API.exportCumSituationDetailList(id, ids);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +1,10 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { removePropertyCondition } from '../util/response';
|
||||
import { observable, action, toJS } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
import { removePropertyCondition } from "../util/response";
|
||||
|
||||
import * as API from '../apis/otherDeduct'; // 引入API接口文件
|
||||
import * as TaxAgentApi from '../apis/taxAgent'
|
||||
import * as API from "../apis/otherDeduct"; // 引入API接口文件
|
||||
import * as TaxAgentApi from "../apis/taxAgent";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -16,60 +16,88 @@ export class OtherDeductStore {
|
|||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
@observable slideLoading = true; // 详情数据加载状态
|
||||
@observable step = 0; // 当前所在第几步
|
||||
@observable slideVisiable = false; // slide 是否隐藏
|
||||
|
||||
@observable slideDataSource = [];
|
||||
|
||||
@observable importResult = {}
|
||||
@observable importResult = {};
|
||||
@observable modalVisiable = false; // 模态框显示
|
||||
|
||||
@observable currentRecord = {}; // 当前record
|
||||
|
||||
// ** 设置导入参数 start **
|
||||
@observable columns = [];
|
||||
@observable pageObj = {}; //列表数据
|
||||
@observable dataSource = []; //列表数据
|
||||
@observable slideColumns = []; //详情列数据
|
||||
@observable slidePageObj = {}; //详情分页列表数据
|
||||
@observable slideTableDataSource = []; //详情列表数据
|
||||
|
||||
// ** 设置导入参数 start **
|
||||
@action
|
||||
setSlideDataSource = (slideDataSource) => {
|
||||
this.slideDataSource = slideDataSource
|
||||
}
|
||||
this.slideDataSource = slideDataSource;
|
||||
};
|
||||
@action
|
||||
setImportResult = (importResult) => {
|
||||
this.importResult = importResult
|
||||
}
|
||||
// ** 设置导入参数 end **
|
||||
this.importResult = importResult;
|
||||
};
|
||||
|
||||
@action
|
||||
setCurrentRecord = currentRecord => this.currentRecord = currentRecord;
|
||||
setColumns = (columns) => (this.columns = columns);
|
||||
|
||||
@action
|
||||
setModalVisiable = visiable => this.modalVisiable = visiable
|
||||
setPageObj = (pageObj) => (this.pageObj = pageObj);
|
||||
|
||||
@action
|
||||
setStep = step => this.step = step;
|
||||
setDataSource = (dataSource) => (this.dataSource = dataSource);
|
||||
|
||||
// 详情列表数据
|
||||
@action
|
||||
setSlideColumns = (columns) => (this.slideColumns = columns);
|
||||
|
||||
@action
|
||||
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
|
||||
setSlidePageObj = (pageObj) => (this.slidePageObj = pageObj);
|
||||
|
||||
@action
|
||||
setSlideTableDataSource = (dataSource) =>
|
||||
(this.slideTableDataSource = dataSource);
|
||||
|
||||
// ** 设置导入参数 end **
|
||||
|
||||
@action
|
||||
setCurrentRecord = (currentRecord) => (this.currentRecord = currentRecord);
|
||||
|
||||
@action
|
||||
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
|
||||
|
||||
@action
|
||||
setStep = (step) => (this.step = step);
|
||||
|
||||
@action
|
||||
setSlideVisiable = (slideVisiable) => (this.slideVisiable = slideVisiable);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
this.getCondition();
|
||||
this.getTableDatas();
|
||||
}
|
||||
};
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
getCondition = () => {
|
||||
API.getOtherDeductSaCondition().then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}));
|
||||
}
|
||||
API.getOtherDeductSaCondition().then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
// 接口请求成功/失败处理
|
||||
let condition = removePropertyCondition(res.data.condition);
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 渲染table数据
|
||||
@action
|
||||
|
|
@ -77,72 +105,101 @@ export class OtherDeductStore {
|
|||
params = params || {};
|
||||
this.loading = true;
|
||||
let requestParams = this.form.getFormParams() || {};
|
||||
requestParams = {...requestParams, ...params}
|
||||
API.getOtherDeductList(requestParams).then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.tableStore.getDatas(res.data.datas); // table 请求数据
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
requestParams = { ...requestParams, ...params };
|
||||
API.getOtherDeductList(requestParams).then(
|
||||
action(({ status, data, errormsg }) => {
|
||||
if (status) {
|
||||
const { columns, list, total, pageNum: current, pageSize } = data;
|
||||
this.setColumns(columns);
|
||||
this.setDataSource(list);
|
||||
this.setPageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
});
|
||||
} else {
|
||||
this.setDataSource([]);
|
||||
this.setPageObj({
|
||||
...this.pageObj,
|
||||
total: 0,
|
||||
});
|
||||
message.error(errormsg || "接口调用失败!");
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
setShowSearchAd = (bool) => (this.showSearchAd = bool);
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = () => {
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 导入
|
||||
@action importFile = (params) => {
|
||||
API.importOtherDeductionParam(params).then(action(res => {
|
||||
if(res.status) {
|
||||
this.importResult = res.data
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}))
|
||||
}
|
||||
API.importOtherDeductionParam(params).then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
this.importResult = res.data;
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 导入预览
|
||||
@action previewImport = (params) => {
|
||||
API.importOtherDeductionPreview(params).then(action(res => {
|
||||
if(res.status) {
|
||||
this.slideDataSource = res.data.preview
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
}))
|
||||
}
|
||||
API.importOtherDeductionPreview(params).then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
this.slideDataSource = res.data.preview;
|
||||
} else {
|
||||
message.error(res.errormsg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// 导出
|
||||
@action exportOtherDeductList = (ids = "") => {
|
||||
API.exportOtherDeductList(ids)
|
||||
}
|
||||
API.exportOtherDeductList(ids);
|
||||
};
|
||||
|
||||
// 查询明细
|
||||
@action getOtherDeductDetailList = (id, param = {}) => {
|
||||
let requestParams = {"otherTaxExemptDeductionId": id};
|
||||
requestParams = {...requestParams, ...param}
|
||||
API.getOtherDeductDetailList(requestParams).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.slideTableStore.getDatas(res.data.datas); // table 请求数据
|
||||
let requestParams = { otherTaxExemptDeductionId: id };
|
||||
requestParams = { ...requestParams, ...param };
|
||||
this.slideLoading = true;
|
||||
API.getOtherDeductDetailList(requestParams).then(
|
||||
({ status, data, errormsg }) => {
|
||||
if (status) {
|
||||
const { columns, list, total, pageNum: current, pageSize } = data;
|
||||
this.setSlideColumns(columns);
|
||||
this.setSlideTableDataSource(list);
|
||||
this.setSlidePageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
});
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
this.setSlideTableDataSource([]);
|
||||
this.setSlidePageObj({
|
||||
...this.slidePageObj,
|
||||
total: 0,
|
||||
});
|
||||
message.error(errormsg || "接口调用失败!");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// 导出明细
|
||||
@action exportOtherDeductDetailList = (id, ids = "") => {
|
||||
API.exportOtherDeductDetailList(id, ids)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
API.exportOtherDeductDetailList(id, ids);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,138 +1,155 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import moment from 'moment'
|
||||
import { observable, action, toJS } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
import moment from "moment";
|
||||
|
||||
import * as API from '../apis/taxAgent'; // 引入API接口文件
|
||||
import { columns } from '../pages/socialSecurityBenefits/archives/columns';
|
||||
import { dataSource } from '../pages/mySalary/columns';
|
||||
import * as API from "../apis/taxAgent"; // 引入API接口文件
|
||||
import { columns } from "../pages/socialSecurityBenefits/archives/columns";
|
||||
import { dataSource } from "../pages/mySalary/columns";
|
||||
import { editConditions } from "../pages/taxAgent/editConditions";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
export class TaxAgentStore {
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable form = new WeaForm(); // nrew 一个form
|
||||
@observable form = new WeaForm(); //表单实体
|
||||
@observable condition = []; // 存储后台得到的form数据
|
||||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
|
||||
@observable modalVisiable = false; // EditModal 模态框
|
||||
|
||||
@observable loading = false; // 数据加载状态
|
||||
@observable modalVisiable = false; // EditModal 模态框
|
||||
@observable columns = [];
|
||||
@observable dataSource = [];
|
||||
@observable pageObj = {}; //列表数据
|
||||
@observable dataSource = []; //列表数据
|
||||
@observable taxAgentOption = []; // 个税扣缴义务人
|
||||
|
||||
@action
|
||||
setModalVisiable = (visiable) => (this.modalVisiable = visiable);
|
||||
|
||||
@action
|
||||
setModalVisiable = visiable => this.modalVisiable = visiable;
|
||||
setColumns = (columns) => (this.columns = columns);
|
||||
|
||||
@action
|
||||
setColumns = columns => this.columns = columns;
|
||||
setPageObj = (pageObj) => (this.pageObj = pageObj);
|
||||
|
||||
@action
|
||||
setDataSource = dataSource => this.dataSource = dataSource;
|
||||
setDataSource = (dataSource) => (this.dataSource = dataSource);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
this.getTableDatas();
|
||||
}
|
||||
doInit = (params) => {
|
||||
this.getTaxAgentList(params);
|
||||
this.getCondition(editConditions);
|
||||
};
|
||||
|
||||
// 获得高级搜索表单数据
|
||||
@action
|
||||
getCondition = () => {
|
||||
API.getCondition().then(action(res => {
|
||||
if (res.api_status) { // 接口请求成功/失败处理
|
||||
this.condition = res.condition;
|
||||
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
}));
|
||||
}
|
||||
getCondition = (condition) => {
|
||||
this.form.initFormFields(condition);
|
||||
};
|
||||
|
||||
// 渲染table数据
|
||||
@action
|
||||
getTableDatas = (params) => {
|
||||
getTaxAgentList = (params) => {
|
||||
this.loading = true;
|
||||
params = params || {};
|
||||
API.getTaxAgentList(params).then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
let current = this.tableStore.current || 1;
|
||||
let sortParams = this.tableStore.sortParams.toJS() || [];
|
||||
this.tableStore.getDatas(res.data.datas)
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
API.getTaxAgentList(params).then(
|
||||
action(({ data, status }) => {
|
||||
this.loading = false;
|
||||
if (status) {
|
||||
// 接口请求成功/失败处理
|
||||
const { columns, list, total, pageNum: current, pageSize } = data;
|
||||
this.setColumns(columns);
|
||||
this.setDataSource(list);
|
||||
this.setPageObj({
|
||||
total,
|
||||
current,
|
||||
pageSize,
|
||||
});
|
||||
} else {
|
||||
message.error(res.msg || "接口调用失败!");
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
@action
|
||||
setShowSearchAd = bool => this.showSearchAd = bool;
|
||||
setShowSearchAd = (bool) => (this.showSearchAd = bool);
|
||||
|
||||
// 高级搜索 - 搜索
|
||||
@action doSearch = (name) => {
|
||||
this.getTableDatas({name});
|
||||
this.getTaxAgentList({ name });
|
||||
this.showSearchAd = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 新增
|
||||
@action doInsert = (params) => {
|
||||
API.saveTaxAgent(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("新增成功");
|
||||
this.setModalVisiable(false)
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
} else {
|
||||
message.error( res.errormsg || "新增失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
@action saveTaxAgent = (params) => {
|
||||
return API.saveTaxAgent(params);
|
||||
};
|
||||
|
||||
// 更新
|
||||
@action doUpdate = (params) => {
|
||||
API.updateTaxAgent(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("更新成功");
|
||||
this.setModalVisiable(false)
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
} else {
|
||||
message.error(res.errormsg || "新增失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
@action updateTaxAgent = (params) => {
|
||||
return API.updateTaxAgent(params);
|
||||
};
|
||||
|
||||
@action doDelete = (params) => {
|
||||
API.deleteTaxAgent(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("删除成功");
|
||||
this.setModalVisiable(false)
|
||||
this.getTableDatas();
|
||||
this.showSearchAd = false;
|
||||
} else {
|
||||
message.error( res.errormsg || "删除失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取个税扣缴义务人基础信息表单
|
||||
@action getTaxAgentBaseForm = (params) => {
|
||||
return API.getTaxAgentBaseForm(params);
|
||||
};
|
||||
|
||||
// 获取个税扣缴义务人表单
|
||||
@action getTaxAgentForm = (params) => {
|
||||
return API.getTaxAgentForm(params);
|
||||
};
|
||||
|
||||
// 保存个税扣缴义务人基础信息
|
||||
@action taxAgentBaseSave = (params) => {
|
||||
return API.taxAgentBaseSave(params);
|
||||
};
|
||||
|
||||
@action deleteTaxAgent = (params) => {
|
||||
return API.deleteTaxAgent(params);
|
||||
};
|
||||
|
||||
@action getPermission = (params) => {
|
||||
return API.getPermission(params);
|
||||
};
|
||||
// 人员范围列表
|
||||
@action getTaxAgentRangeListInclude = (params) => {
|
||||
return API.getTaxAgentRangeListInclude(params);
|
||||
};
|
||||
// 人员范围排除列表
|
||||
@action getTaxAgentRangeListExclude = (params) => {
|
||||
return API.getTaxAgentRangeListExclude(params);
|
||||
};
|
||||
// 获取人员范围表单
|
||||
@action getTaxAgentRangeForm = (params) => {
|
||||
return API.getTaxAgentRangeForm(params);
|
||||
};
|
||||
// 人员范围保存
|
||||
@action taxAgentRangeSave = (params) => {
|
||||
return API.taxAgentRangeSave(params);
|
||||
};
|
||||
// 人员范围删除
|
||||
@action taxAgentRangeDelete = (params) => {
|
||||
return API.taxAgentRangeDelete(params);
|
||||
};
|
||||
|
||||
@action fetchTaxAgentOption = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getTaxAgentSelectList().then(action(res => {
|
||||
if(res.status) {
|
||||
let options = res.data.list.map(item => {return {key: item.id, showname: item.content}})
|
||||
this.taxAgentOption = options
|
||||
resolve()
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
}
|
||||
}))
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
API.getTaxAgentSelectList().then(
|
||||
action((res) => {
|
||||
if (res.status) {
|
||||
this.taxAgentOption = res.data.map((item) => {
|
||||
return { key: item.id, showname: item.content };
|
||||
});
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败");
|
||||
reject();
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
position: relative;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
|
||||
>div {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
|
@ -29,3 +30,7 @@
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.ant-checkbox-wrapper+.ant-checkbox-wrapper {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
Loading…
Reference in New Issue