修改小组提交报错的问题
This commit is contained in:
parent
c7c7f462d6
commit
aa24c02143
|
@ -12,6 +12,7 @@ enum Api {
|
||||||
save='/zyInfoStudent/zyInfoStudent/add',
|
save='/zyInfoStudent/zyInfoStudent/add',
|
||||||
edit='/zyInfoStudent/zyInfoStudent/edit',
|
edit='/zyInfoStudent/zyInfoStudent/edit',
|
||||||
zyscStu='/zyInfoStudent/zyInfoStudent/zyscStu',
|
zyscStu='/zyInfoStudent/zyInfoStudent/zyscStu',
|
||||||
|
zyscStuBatch='/zyInfoStudent/zyInfoStudent/zyscStuBatch',
|
||||||
stuWpKsjc='/zyInfoStudent/zyInfoStudent/stuWpKsjc',
|
stuWpKsjc='/zyInfoStudent/zyInfoStudent/stuWpKsjc',
|
||||||
editCdlx='/zyInfoStudent/zyInfoStudent/editCdlx',
|
editCdlx='/zyInfoStudent/zyInfoStudent/editCdlx',
|
||||||
deleteOne = '/zyInfoStudent/zyInfoStudent/delete',
|
deleteOne = '/zyInfoStudent/zyInfoStudent/delete',
|
||||||
|
@ -129,6 +130,10 @@ export const zyscStu = (params, isUpdate) => {
|
||||||
let url = Api.zyscStu;
|
let url = Api.zyscStu;
|
||||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
}
|
}
|
||||||
|
export const zyscStuBatch = (params, isUpdate) => {
|
||||||
|
let url = Api.zyscStuBatch;
|
||||||
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
|
}
|
||||||
|
|
||||||
export const stuWpKsjc = (params, isUpdate) => {
|
export const stuWpKsjc = (params, isUpdate) => {
|
||||||
let url = Api.stuWpKsjc;
|
let url = Api.stuWpKsjc;
|
||||||
|
|
|
@ -132,7 +132,7 @@
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||||
import { getValueType } from '/@/utils';
|
import { getValueType } from '/@/utils';
|
||||||
import { saveOrUpdate,zyscStu,stuWpKsjc } from '../ZyInfoStudent.api';
|
import { saveOrUpdate,zyscStu,stuWpKsjc,zyscStuBatch } from '../ZyInfoStudent.api';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
import {getFileAccessHttpUrl} from "/@/utils/common/compUtils";
|
import {getFileAccessHttpUrl} from "/@/utils/common/compUtils";
|
||||||
import {useGlobSetting} from "/@/hooks/setting";
|
import {useGlobSetting} from "/@/hooks/setting";
|
||||||
|
@ -280,18 +280,17 @@ function handleKcnr(kcnr) {
|
||||||
|
|
||||||
function submitZy(model, ids, isUpdate) {
|
function submitZy(model, ids, isUpdate) {
|
||||||
let models = [model];
|
let models = [model];
|
||||||
|
|
||||||
if (Array.isArray(ids) && ids.length > 0) {
|
if (Array.isArray(ids) && ids.length > 0) {
|
||||||
ids.forEach(id => {
|
ids.forEach(id => {
|
||||||
let newModel = { ...model, stuId: id.id };
|
let newModel = { ...model, stuId: id.id };
|
||||||
models.push(newModel);
|
models.push(newModel);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
console.log(`🚀 ~ submitZy ~ models:`, models)
|
||||||
let msgr = true
|
let msgr = true
|
||||||
let msg = '操作成功'
|
let msg = '操作成功'
|
||||||
models.forEach(async m_ => {
|
models.forEach(async m_ => {
|
||||||
await zyscStu(m_, isUpdate)
|
await zyscStu(m_, isUpdate).then((res) => {
|
||||||
.then((res) => {
|
|
||||||
console.log(`🚀 ~ .then ~ res:`, res)
|
console.log(`🚀 ~ .then ~ res:`, res)
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
//异步提交维普
|
//异步提交维普
|
||||||
|
@ -319,6 +318,31 @@ function submitZy(model, ids, isUpdate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function submitBatchZy(model, ids, isUpdate) {
|
||||||
|
let models = model;
|
||||||
|
if (Array.isArray(ids) && ids.length > 0) {
|
||||||
|
ids.forEach(async id => {
|
||||||
|
models.stuId = id.id;
|
||||||
|
await zyscStuBatch(models, isUpdate).then((res) => {
|
||||||
|
console.log(`🚀 ~ .then ~ res:`, res)
|
||||||
|
if (res.success) {
|
||||||
|
//异步提交维普
|
||||||
|
// stuWpKsjc(model, isUpdate).then((res) => { })
|
||||||
|
createMessage.success("操作成功");
|
||||||
|
emit('ok');
|
||||||
|
confirmLoading.value = false;
|
||||||
|
emit('closeLoading');
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交数据
|
* 提交数据
|
||||||
*/
|
*/
|
||||||
|
@ -361,7 +385,9 @@ async function submitForm() {
|
||||||
model.mainId = zyInfo.value.id;
|
model.mainId = zyInfo.value.id;
|
||||||
if(xzxstjzy.value == 'Y'){
|
if(xzxstjzy.value == 'Y'){
|
||||||
const zys = stuZyIds.value.filter(stu => stu.id != model.stuId)
|
const zys = stuZyIds.value.filter(stu => stu.id != model.stuId)
|
||||||
submitZy(model,zys,isUpdate.value)
|
console.log(`🚀 ~ stuZyIds:`, stuZyIds)
|
||||||
|
console.log(`🚀 ~ zys:`, zys)
|
||||||
|
submitBatchZy(model,zys,isUpdate.value)
|
||||||
}else{
|
}else{
|
||||||
submitZy(model,[],isUpdate.value)
|
submitZy(model,[],isUpdate.value)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue