提交监督考核

lsf-dev
秦子超 2024-10-15 16:11:21 +08:00
parent f8931a9518
commit cbc06063f0
2 changed files with 25 additions and 7 deletions

View File

@ -40,12 +40,12 @@ async function send(url, options) {
}
const { code } = res.data;
if (code === 401) {
//debugger;
//window.location.href = '/mgr/home';// /mgr/home /login
window.location.href = '/tsg/#/login';
// window.location.hash = '#/login';
}
// if (code === 401) {
// // debugger;
// //window.location.href = '/mgr/home';// /mgr/home /login
// window.location.href = '/tsg/#/login';
// // window.location.hash = '#/login';
// }
return res.data;
} catch (e) {
//message.error(e);

View File

@ -241,6 +241,23 @@ const EditableRow = ({ index, ...props }) => {
})
return arr
}
const handleTableData2 = (obj) => {
const names = Object.values(obj)?.[0]?.map(o=>o.teamUserName)
const obj2 = {}
for(let key in obj){
const arr = []
names?.map((name)=>{
obj?.[key]?.map((item)=>{
if(name===item.teamUserName){
arr.push(item)
}
})
})
obj2[key] = arr
}
return obj2
}
// 获取清单查看数据
const [qdColumns, setQdColumns] = useState(newcolumns)
const [qdWidth, setQdWidth] = useState()
@ -248,7 +265,8 @@ const EditableRow = ({ index, ...props }) => {
try {
const res = await httpget2(apiurl.rcgl.jdkh.khrwgl.qdView + `/${id}`)
if (res.code == 200) {
const result = handleTableData(res.data);
const linshi = handleTableData2(res.data)//将接口里用户的顺序统一
const result = handleTableData(linshi);
const insertCols = [];
result.forEach((item, index, arr) => {
const total = arr?.reduce((total, cur) => total + (cur["assessScore" + index] || 0), 0)