提交 aefaf0d7 authored 作者: yaoxinguo's avatar yaoxinguo

签约派遣批量审批修改

上级 9582926b
const initSignFunc = () => { const initSignFunc = () => {
window.stuSigningAuditXueShengChu = (props) => { window.stuSigningAuditXueShengChu = (props) => {
// 在这里搞事情 // 在这里搞事情
//console.log(props); //console.log(props);
const { selectRows, setSubmitLoading, uaaRequest, examineMap, message, setVisible, callback } = props; const {
selectRows,
setSubmitLoading,
uaaRequest,
examineMap,
message,
setVisible,
callback
} = props;
let total = selectRows.length; let total = selectRows.length;
let selectTotal = 0;
let success = 0; let success = 0;
let fail = 0; let fail = 0;
/** /**
* *
* 第一步 获取选择的每一条审核数据需要盖章的图片 * 第一步 获取选择的每一条审核数据需要盖章的图片
...@@ -15,33 +24,61 @@ const initSignFunc = () => { ...@@ -15,33 +24,61 @@ const initSignFunc = () => {
const selectList = const selectList =
selectRows.map((g) => { selectRows.map((g) => {
let json = {}; let json = {};
json.isSealOrNot = g['LLzXaxdAYHU'] || "0";
json.signaturePicture = g['LLMbGiXIkvE']; json.signaturePicture = g['LLMbGiXIkvE'];
json.setUp = g['LLtAdXHnnVM'] ? JSON.parse(g['LLtAdXHnnVM']) : {}; json.setUp = g['LLtAdXHnnVM'] ? JSON.parse(g['LLtAdXHnnVM']) : {
setUp: []
};
json.enclosure = g['LHfENWqbwZs']; json.enclosure = g['LHfENWqbwZs'];
json.code = g['code']; json.code = g['code'];
json.taskId = g['taskId']; json.taskId = g['taskId'];
json.appId = g['appId']; json.appId = g['appId'];
return json; return json;
}) || []; }) || [];
//console.log("selectList",selectList); //console.log("selectList", selectList);
setSubmitLoading(true); // 显示为加载中 setSubmitLoading(true); // 显示为加载中
selectList.map((v, i) => {
if (v.isSealOrNot === "1") {
selectTotal++;
}
});
uaaRequest('/DataColumnApi/getSqlColumn', { uaaRequest('/DataColumnApi/getSqlColumn', {
token: 1, token: 1,
json: 'LLyJBlByfFM', json: 'LLyJBlByfFM',
param: '{}', param: '{}',
type: 1, type: 1,
}).then((result, com) => { }).then((result, com) => {
let { XAxisOffset, YAxisOffset } = result; let {
XAxisOffset,
YAxisOffset
} = result;
let promiseArray = []; let promiseArray = [];
// 姚 // 姚
for (var selectI in selectList) { for (var selectI in selectList) {
let selectData = selectList[selectI]; let selectData = selectList[selectI];
let { setUp, enclosure, signaturePicture, taskId, code, appId } = selectData; let {
setUp,
enclosure,
signaturePicture,
taskId,
code,
appId,
isSealOrNot
} = selectData;
if (enclosure.files == [] && enclosure.files.length == 0) {
console.log('->>>>>>>>>', '没有签章图片');
continue;
}
let background = enclosure.files[enclosure.files.length - 1].path; let background = enclosure.files[enclosure.files.length - 1].path;
// 这里还要加判断 如果没得图片能签章. 直接跳过这条数据 // 这里还要加判断 如果没得图片能签章. 直接跳过这条数据
const oneStudentTask = async () => {
let resOneStudentRes;
if (isSealOrNot === "1") { //盖章流程
setUp.objs.forEach((sv, si) => { setUp.objs.forEach((sv, si) => {
sv.x += XAxisOffset; sv.x += XAxisOffset;
sv.y += YAxisOffset; sv.y += YAxisOffset;
...@@ -49,24 +86,24 @@ const initSignFunc = () => { ...@@ -49,24 +86,24 @@ const initSignFunc = () => {
sv.path = signaturePicture.obtainEmploymentSeal; sv.path = signaturePicture.obtainEmploymentSeal;
} }
}); });
const oneStudentTask = async () => { resOneStudentRes = await uaaRequest('/ImageLibApi/merge', {
let resOneStudentRes = await uaaRequest('/ImageLibApi/merge', {
background: background, background: background,
content: JSON.stringify(setUp), content: JSON.stringify(setUp),
}).then((merge) => }).then((merge) => {
{
if (!merge) { if (!merge) {
console.log('->>>>>>>>>', '印章失败'); console.log('->>>>>>>>>', '印章失败');
return false; return false;
} }
if (enclosure.files == [] && enclosure.files.length == 0) {
console.log('->>>>>>>>>', '没有签章图片');
return false;
}
enclosure.files[enclosure.files.length - 1].originPath = background; enclosure.files[enclosure.files.length - 1].originPath = background;
enclosure.files[enclosure.files.length - 1].path = merge.path; enclosure.files[enclosure.files.length - 1].path = merge.path;
let taskForm = { LLIZZkKNsdc: enclosure }; //就业处审核表单 let taskForm = {
let examineMaps = { reason: '', ...JSON.parse(examineMap), code }; //审核意见 LLIZZkKNsdc: enclosure
}; //就业处审核表单
let examineMaps = {
reason: '',
...JSON.parse(examineMap),
code
}; //审核意见
let examineJson = { let examineJson = {
level: '', level: '',
code: code, code: code,
...@@ -74,23 +111,46 @@ const initSignFunc = () => { ...@@ -74,23 +111,46 @@ const initSignFunc = () => {
examineMap: JSON.stringify(examineMaps), examineMap: JSON.stringify(examineMaps),
taskForm: JSON.stringify(taskForm), taskForm: JSON.stringify(taskForm),
}; };
console.log('examineJson', examineJson); //console.log('examineJson', examineJson);
return uaaRequest('/UnifiedAppFormApi/examineProcess', examineJson).then((resProcess) => { return uaaRequest('/UnifiedAppFormApi/examineProcess', examineJson).then((resProcess) => {
if (!resProcess) { if (!resProcess) {
console.log('->>>>>>>>>', '审核失败'); console.log('->>>>>>>>>', '审核失败');
return false; return false;
} }
return true;
console.log('->>>>>>>>>', '审核成功'); console.log('->>>>>>>>>', '审核成功');
return true;
});
}); });
} else { //无需盖章流程跳过
let examineMaps = {
reason: '',
...JSON.parse(examineMap),
code
}; //审核意见
let examineJson = {
level: '',
code: code,
taskIds: taskId,
examineMap: JSON.stringify(examineMaps),
taskForm: JSON.stringify({}),
};
//console.log('examineJson', examineJson);
resOneStudentRes = await uaaRequest('/UnifiedAppFormApi/examineProcess', examineJson).then((resProcess) => {
if (!resProcess) {
console.log('->>>>>>>>>', '审核失败');
return false;
}
//console.log('->>>>>>>>>', '审核成功');
return true;
}); });
if(resOneStudentRes){ }
if (resOneStudentRes) {
success++; success++;
}else{ } else {
fail++; fail++;
} }
message.destroy(); message.destroy();
message.info(`正在进行批量签章审核,请耐心等待, 当前共审核成功${success}条, 失败${fail}.共需审核${total}条`, 2); message.info(`正在进行批量签章审核,请耐心等待, 当前共审核成功${success}条, 失败${fail}。共需审核${total}条,其中盖章${selectTotal}条,无需盖章${total - selectTotal}条`, 2);
return true; return true;
}; };
promiseArray.push(oneStudentTask); promiseArray.push(oneStudentTask);
...@@ -100,14 +160,14 @@ const initSignFunc = () => { ...@@ -100,14 +160,14 @@ const initSignFunc = () => {
// 钟 // 钟
let taskFunc = async () => { let taskFunc = async () => {
for(let i = 0; i < promiseArray.length; i++){ for (let i = 0; i < promiseArray.length; i++) {
let res1 = await promiseArray[i](); let res1 = await promiseArray[i]();
console.log(res1); console.log(res1);
} }
return true; return true;
} }
taskFunc().then((g) =>{ taskFunc().then((g) => {
if(g){ if (g) {
message.success('审核完成'); message.success('审核完成');
setSubmitLoading(false); setSubmitLoading(false);
setVisible(false); setVisible(false);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论