|
@@ -1243,7 +1243,7 @@ module.exports = app => {
|
|
* @param pos - 查询的部位
|
|
* @param pos - 查询的部位
|
|
* @return {Promise<*>} - 可用的变更令列表
|
|
* @return {Promise<*>} - 可用的变更令列表
|
|
*/
|
|
*/
|
|
- async getValidChanges(tender, stage, data, minusNoValue) {
|
|
|
|
|
|
+ async getValidChanges(tender, stage, data, noValue) {
|
|
const bills = data.bills, pos = data.pos;
|
|
const bills = data.bills, pos = data.pos;
|
|
const self = this;
|
|
const self = this;
|
|
const getFilterPart = function(field, value) {
|
|
const getFilterPart = function(field, value) {
|
|
@@ -1258,8 +1258,8 @@ module.exports = app => {
|
|
// if (data.pos) filter = filter + ' And ' + getFilterPart('cb.bwmx', pos.name);
|
|
// if (data.pos) filter = filter + ' And ' + getFilterPart('cb.bwmx', pos.name);
|
|
const sql =
|
|
const sql =
|
|
'SELECT c.cid, c.code, c.name, c.w_code, c.p_code, c.peg, c.org_name, c.org_code, c.new_name, c.new_code,' +
|
|
'SELECT c.cid, c.code, c.name, c.w_code, c.p_code, c.peg, c.org_name, c.org_code, c.new_name, c.new_code,' +
|
|
- ' c.content, c.basis, c.memo, c.type, c.class, c.quality, c.company, c.charge, ' +
|
|
|
|
- ' cb.id As cbid, cb.code As b_code, cb.name As b_name, cb.unit As b_unit, cb.samount As b_amount, cb.detail As b_detail, cb.bwmx As b_bwmx, cb.gcl_id, ' +
|
|
|
|
|
|
+ ' c.content, c.basis, c.memo, c.type, c.class, c.quality, c.company, c.charge,' +
|
|
|
|
+ ' cb.id As cbid, cb.code As b_code, cb.name As b_name, cb.unit As b_unit, cb.samount As b_amount, cb.detail As b_detail, cb.bwmx As b_bwmx, cb.gcl_id, cb.is_valuation, cb.delimit' +
|
|
' scb.used_amount' +
|
|
' scb.used_amount' +
|
|
' FROM ' + this.tableName + ' As c ' +
|
|
' FROM ' + this.tableName + ' As c ' +
|
|
' Left Join ' + this.ctx.service.changeAuditList.tableName + ' As cb On c.cid = cb.cid ' +
|
|
' Left Join ' + this.ctx.service.changeAuditList.tableName + ' As cb On c.cid = cb.cid ' +
|
|
@@ -1273,16 +1273,14 @@ module.exports = app => {
|
|
' ORDER BY c.in_time';
|
|
' ORDER BY c.in_time';
|
|
const sqlParam = [tender.id, stage.order, tender.id, audit.flow.status.checked];
|
|
const sqlParam = [tender.id, stage.order, tender.id, audit.flow.status.checked];
|
|
let changes = await this.db.query(sql, sqlParam);
|
|
let changes = await this.db.query(sql, sqlParam);
|
|
- if (minusNoValue) {
|
|
|
|
- if (data.minus) {
|
|
|
|
|
|
+ if (noValue) {
|
|
|
|
+ if (data.noValue) {
|
|
changes = changes.filter(c => {
|
|
changes = changes.filter(c => {
|
|
- c.bamount = c.b_amount ? parseFloat(c.b_amount) : 0;
|
|
|
|
- return c.bamount < 0;
|
|
|
|
|
|
+ return !c.is_valuation;
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
changes = changes.filter(c => {
|
|
changes = changes.filter(c => {
|
|
- c.bamount = c.b_amount ? parseFloat(c.b_amount) : 0;
|
|
|
|
- return c.bamount >= 0;
|
|
|
|
|
|
+ return c.is_valuation;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|