|
@@ -411,7 +411,7 @@ module.exports = app => {
|
|
|
if ((isNaN(data.id) || data.id <= 0) ||
|
|
|
(!data.tid && data.tid <= 0) ||
|
|
|
(!data.block || data.block.length <= 0)) throw '参数错误';
|
|
|
- return await ctx.service.revise.pasteBlock(data.tid, data.id, data.block);
|
|
|
+ return await this.ctx.service.revise.pasteBlock(data.tid, data.id, data.block);
|
|
|
}
|
|
|
async _addStd(revise, data) {
|
|
|
if ((isNaN(data.id) || data.id <= 0) || !data.stdType || !data.stdNode) throw '参数错误';
|
|
@@ -420,12 +420,12 @@ module.exports = app => {
|
|
|
let stdLib, addType;
|
|
|
switch (data.stdType) {
|
|
|
case 'xmj':
|
|
|
- stdLib = ctx.service.stdXmj;
|
|
|
+ stdLib = this.ctx.service.stdXmj;
|
|
|
addType = stdDataAddType.withParent;
|
|
|
break;
|
|
|
case 'gcl':
|
|
|
- stdLib = ctx.service.stdGcl;
|
|
|
- const selectNode = await ctx.service.reviseBills.getDataByKid(ctx.tender.id, data.id);
|
|
|
+ stdLib = this.ctx.service.stdGcl;
|
|
|
+ const selectNode = await this.ctx.service.reviseBills.getDataByKid(revise.tid, data.id);
|
|
|
if (selectNode.b_code) {
|
|
|
addType = stdDataAddType.next;
|
|
|
} else {
|
|
@@ -438,17 +438,18 @@ module.exports = app => {
|
|
|
const stdData = await stdLib.getDataByDataId(data.stdLibId, data.stdNode);
|
|
|
switch (addType) {
|
|
|
case stdDataAddType.child:
|
|
|
- return await ctx.service.reviseBills.addStdNodeAsChild(ctx.tender.id, data.id, stdData, ctx.revise.id);
|
|
|
+ return await this.ctx.service.reviseBills.addStdNodeAsChild(revise.tid, data.id, stdData, revise.id);
|
|
|
break;
|
|
|
case stdDataAddType.next:
|
|
|
- return await ctx.service.reviseBills.addStdNode(ctx.tender.id, data.id, stdData, ctx.revise.id);
|
|
|
+ return await this.ctx.service.reviseBills.addStdNode(revise.tid, data.id, stdData, revise.id);
|
|
|
case stdDataAddType.withParent:
|
|
|
- return await ctx.service.reviseBills.addStdNodeWithParent(ctx.tender.id, stdData, stdLib, ctx.revise.id);
|
|
|
+ return await this.ctx.service.reviseBills.addStdNodeWithParent(revise.tid, stdData, stdLib, revise.id);
|
|
|
default:
|
|
|
throw '未知添加方式';
|
|
|
}
|
|
|
}
|
|
|
async _addDeal(revise, data) {
|
|
|
+ console.log(data);
|
|
|
if (!data.type || !data.dealBills) throw '数据错误';
|
|
|
if (data.type === 'child') {
|
|
|
return await this.ctx.service.reviseBills.addChild(revise.tid, data.id, data.dealBills, revise.id);
|