|
@@ -143,7 +143,6 @@ module.exports = app => {
|
|
|
*/
|
|
|
async index(ctx) {
|
|
|
try {
|
|
|
- console.log(ctx.stage);
|
|
|
await this._getStageAuditViewData(ctx);
|
|
|
const renderData = await this._getDefaultRenderData(ctx);
|
|
|
[renderData.ledgerSpread, renderData.posSpread] = this._getSpreadSetting();
|
|
@@ -337,7 +336,6 @@ module.exports = app => {
|
|
|
*/
|
|
|
async detail(ctx) {
|
|
|
try {
|
|
|
- console.log(ctx.stage);
|
|
|
await this._getStageAuditViewData(ctx);
|
|
|
const renderData = await this._getDefaultRenderData(ctx);
|
|
|
renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stage.detail);
|
|
@@ -578,10 +576,10 @@ module.exports = app => {
|
|
|
const payCalculator = new PayCalculator(ctx, ctx.stage, ctx.tender.info);
|
|
|
await payCalculator.calculateAll(renderData.dealPay);
|
|
|
await this.ctx.service.stage.update({
|
|
|
- id: this.ctx.stage.id, check_calc: false,
|
|
|
+ check_calc: false,
|
|
|
contract_tp: payCalculator.cur.contract_tp, qc_tp: payCalculator.cur.qc_tp,
|
|
|
- yf: payCalculator.yf.tp,
|
|
|
- });
|
|
|
+ yf_tp: payCalculator.yf.tp,
|
|
|
+ }, {id: this.ctx.stage.id});
|
|
|
}
|
|
|
await this.layout('stage/pay.ejs', renderData, 'stage/pay_modal.ejs');
|
|
|
} catch (err) {
|
|
@@ -618,10 +616,10 @@ module.exports = app => {
|
|
|
responseData.data = await ctx.service.stagePay.getStagePays(ctx.stage);
|
|
|
await payCalculator.calculate(responseData.data);
|
|
|
await this.ctx.service.stage.update({
|
|
|
- id: this.ctx.stage.id, check_calc: false,
|
|
|
+ check_calc: false,
|
|
|
contract_tp: payCalculator.cur.contract_tp, qc_tp: payCalculator.cur.qc_tp,
|
|
|
- yf: payCalculator.yf.tp,
|
|
|
- });
|
|
|
+ yf_tp: payCalculator.yf.tp,
|
|
|
+ }, {id: this.ctx.stage.id});
|
|
|
|
|
|
break;
|
|
|
case 'changeOrder':
|
|
@@ -634,10 +632,10 @@ module.exports = app => {
|
|
|
responseData.data = await ctx.service.stagePay.getStagePays(ctx.stage);
|
|
|
await payCalculator.calculateAll(responseData.data);
|
|
|
await this.ctx.service.stage.update({
|
|
|
- id: this.ctx.stage.id, check_calc: false,
|
|
|
+ check_calc: false,
|
|
|
contract_tp: payCalculator.cur.contract_tp, qc_tp: payCalculator.cur.qc_tp,
|
|
|
- yf: payCalculator.yf.tp,
|
|
|
- });
|
|
|
+ yf_tp: payCalculator.yf.tp,
|
|
|
+ }, {id: this.ctx.stage.id});
|
|
|
} else {
|
|
|
if (data.updateData instanceof Array) {
|
|
|
responseData.data = await ctx.service.stagePay.getStagePay(ctx.stage, this.app._.map(responseData.data, 'id'));
|
|
@@ -651,10 +649,10 @@ module.exports = app => {
|
|
|
responseData.data = await ctx.service.stagePay.getStagePays(ctx.stage);
|
|
|
await payCalculator.calculateAll(responseData.data);
|
|
|
await this.ctx.service.stage.update({
|
|
|
- id: this.ctx.stage.id, check_calc: false,
|
|
|
+ check_calc: false,
|
|
|
contract_tp: payCalculator.cur.contract_tp, qc_tp: payCalculator.cur.qc_tp,
|
|
|
- yf: payCalculator.yf.tp,
|
|
|
- });
|
|
|
+ yf_tp: payCalculator.yf.tp,
|
|
|
+ }, {id: this.ctx.stage.id});
|
|
|
break;
|
|
|
}
|
|
|
|