|
@@ -791,11 +791,11 @@ module.exports = app => {
|
|
|
|
|
|
}
|
|
|
|
|
|
- async _generateChangeAudit(tid) {
|
|
|
- if (this.changeData.audit !== null) return;
|
|
|
+ async _generateChangeAudit() {
|
|
|
+ if (!!this.changeData.audit) return;
|
|
|
|
|
|
this.changeData.audit = [];
|
|
|
- for (const c of change) {
|
|
|
+ for (const c of this.changeData.change) {
|
|
|
const changeAudit = await this.ctx.service.changeAudit.getListGroupByTimes(c.cid, c.times);
|
|
|
this.changeData.audit.push(...changeAudit);
|
|
|
}
|
|
@@ -828,7 +828,7 @@ module.exports = app => {
|
|
|
await this.ctx.service.tender.checkTender(tid);
|
|
|
|
|
|
await this._generateChange(tid);
|
|
|
- await this._generateChangeAudit(tid);
|
|
|
+ await this._generateChangeAudit();
|
|
|
return this.changeData.audit;
|
|
|
} catch (err) {
|
|
|
return [];
|
|
@@ -1004,7 +1004,7 @@ module.exports = app => {
|
|
|
const material = this.ctx.helper._.find(materials, {order: material_order});
|
|
|
if (!material) return [];
|
|
|
const sql = 'SELECT m.id, m.tid, m.mid, m.t_type, m.code, m.name, m.unit, m.spec, m.m_type,' +
|
|
|
- ' m.basic_price, m.basic_times, m.remark, m.in_time,' +
|
|
|
+ ' m.basic_price, m.basic_times, m.remark, m.in_time, m.m_tax, m.m_tax_tp, m.tax_pre_tp,' +
|
|
|
' mh.quantity, mh.expr, mh.msg_tp, mh.msg_times, mh.msg_spread, mh.m_up_risk, mh.m_down_risk, mh.m_spread' +
|
|
|
' FROM ' + this.ctx.service.materialBills.tableName + ' m' +
|
|
|
' LEFT JOIN ' + this.ctx.service.materialBillsHistory.tableName + ' mh' +
|
|
@@ -1012,6 +1012,7 @@ module.exports = app => {
|
|
|
' WHERE mh.mid = ?';
|
|
|
const sqlParam = [material.id];
|
|
|
result = await this.ctx.app.mysql.query(sql, sqlParam);
|
|
|
+ console.log(result);
|
|
|
}
|
|
|
this._completeMaterialGl(result);
|
|
|
return result;
|