|
@@ -269,10 +269,10 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
async updateChangeQuantity(transaction, pos, qty) {
|
|
|
- const orgPos = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, pos.pid);
|
|
|
+ const orgPos = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, pos.id);
|
|
|
const userOrder = this.ctx.stage.curAuditor ? this.ctx.stage.curAuditor.order : 0;
|
|
|
if (orgPos && orgPos.times === this.ctx.stage.times && orgPos.order === userOrder) {
|
|
|
- await transaction.update(this.tableName, {qc_qty: qty}, {where: {id: osp.id}});
|
|
|
+ await transaction.update(this.tableName, {qc_qty: qty}, {where: {id: orgPos.id}});
|
|
|
} else {
|
|
|
await transaction.insert(this.tableName, {
|
|
|
tid: this.ctx.tender.id,
|
|
@@ -310,6 +310,7 @@ module.exports = app => {
|
|
|
' ) As Gather';
|
|
|
const param = [tid, sid, lid];
|
|
|
const sqlParam = param.concat(param);
|
|
|
+ console.log(this.db.format(calcQtySql, sqlParam));
|
|
|
if (transaction) {
|
|
|
return await transaction.queryOne(calcQtySql, sqlParam);
|
|
|
} else {
|