提交 e3b2e942 编写于 作者: tony001's avatar tony001

zpc--支持批量添加-fix6

上级 3cd9698a
......@@ -37,74 +37,35 @@
</#list>
];
</#if>
console.log(this.context);
console.log(args);
const data: any = {};
if (args && args.length > 0 && args[0].srfsourcekey) {
Object.assign(data, { srfsourcekey: args[0].srfsourcekey })
}
const _this: any = this;
if (_this.srfparentdata) {
Object.assign(data, { srfparentdata: _this.srfparentdata });
}
if(batchAddPSAppViews.length == 0){
if(batchAddPSAppViews.length == 0 || !this.context.srfparentdename){
this.$Notice.warning({ title: '错误', desc: '批量添加需添加N:N关系' });
return;
}
batchAddPSAppViews.forEach((item:any,index:number) =>{
if(item.res){
item.res.forEach((curRes:any) =>{
if(Object.is(curRes,_this.srfparentdata.srfparentmode)){
item.curRes = true;
}
})
}
let openViewModel:any = batchAddPSAppViews.find((item:any) =>{
return (item.res && (item.res[0] !== this.context.srfparentdename));
})
<#-- const openPopupModal = (view: any, data: any) => {
let container: Subject<any> = this.$appmodal.openModal(view, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
// 处理参数
if(result.datas && result.datas.length == 0){
return;
}
let keys = '';
const viewParam:any = {};
if (_this.srfparentdata) {
Object.assign(viewParam,{ srfparentdata: _this.srfparentdata});
}
result.datas.forEach((record:any) => {
let key = record.srfkey;
if (!Object.is(keys, '')) {
keys += ';';
}
keys += key;
});
Object.assign(viewParam,{srfkeys:keys});
// 发送批处理请求
const url:string ="${app.getPKGCodeName()?lower_case}/${de.getPSSystemModule().codeName?lower_case}/${de.codeName?lower_case}/addbatch";
this.$http.post(url,viewParam).then((response:any) =>{
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '批处理操作失败' });
return;
}
if (!xData || !(xData.refresh instanceof Function)) {
return;
}
xData.refresh(result.datas);
})
});
}
let curView:any ={};
batchAddPSAppViews.forEach((item:any) =>{
if(!item.curRes){
Object.assign(curView,item.view)
let container: Subject<any> = this.$appmodal.openModal(openViewModel.view, JSON.parse(JSON.stringify(this.context)), args[0]);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
})
const view: any = curView;
openPopupModal(view, data); -->
if(result.datas && result.datas.length == 0){
return;
}
result.datas.forEach((record:any) => {
});
// this.$http.post(url,viewParam).then((response:any) =>{
// if (!response || response.status !== 200) {
// this.$Notice.error({ title: '错误', desc: '批处理操作失败' });
// return;
// }
// if (!xData || !(xData.refresh instanceof Function)) {
// return;
// }
// xData.refresh(result.datas);
// })
});
<#elseif viewlogic.isBatchAddOnly()>
this.$Notice.warning({ title: '错误', desc: '只支持批添加未实现' });
<#elseif viewlogic.getNewDataPSAppView()??>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册