|
@@ -449,9 +449,21 @@ module.exports = app => {
|
|
|
const ledgerData = await ctx.service.ledger.getData(ctx.tender.id);
|
|
|
const posData = this.ctx.tender.data.measure_type === measureType.tz.value
|
|
|
? await ctx.service.pos.getPosData({ tid: ctx.tender.id }) : [];
|
|
|
- const data = ctx.helper.checkBillsWithPos(ledgerData, posData,
|
|
|
+ const qtyData = ctx.helper.checkBillsWithPos(ledgerData, posData,
|
|
|
['sgfh_qty', 'qtcl_qty', 'sjcl_qty', 'quantity']);
|
|
|
- ctx.body = { err: 0, msg: '', data };
|
|
|
+ qtyData.error.forEach(x => { x.errorType = 'qty'; });
|
|
|
+ const tpData = ctx.helper.checkBillsTp(ledgerData, [
|
|
|
+ {qty: 'sgfh_qty', tp: 'sgfh_tp'}, {qty: 'qtcl_qty', tp: 'qtcl_tp'},
|
|
|
+ {qty: 'sjcl_qty', tp: 'sjcl_tp'}, {qty: 'quantity', tp: 'total_price'}
|
|
|
+ ], this.ctx.tender.info.decimal);
|
|
|
+ tpData.error.forEach(x => { x.errorType = 'tp'; });
|
|
|
+ ctx.body = { err: 0, msg: '', data: {
|
|
|
+ error: [...qtyData.error, ...tpData.error],
|
|
|
+ source: {
|
|
|
+ bills: [...qtyData.source.bills, ...tpData.source.bills],
|
|
|
+ pos: [...qtyData.source.pos, ...tpData.source.pos],
|
|
|
+ },
|
|
|
+ }};
|
|
|
} catch (err) {
|
|
|
this.log(err);
|
|
|
ctx.body = this.ajaxErrorBody(err, '检查数据错误');
|