|
|
@@ -219,6 +219,8 @@ module.exports = app => {
|
|
|
jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.budget.detail),
|
|
|
needGcl,
|
|
|
validDskProjType: ValidDskProject[ctx.params.btype],
|
|
|
+ optimize_rate: this.ctx.budget[ctx.params.btype + '_optimize_rate'] || 0,
|
|
|
+ profit: this.ctx.budget[ctx.params.btype + '_profit'] || 0,
|
|
|
};
|
|
|
[renderData.stdBills, renderData.stdChapters] = await ctx.service.budgetStd.getStdList(ctx.budget.std_id, ctx.params.btype);
|
|
|
await this.layout('budget/detail.ejs', renderData, 'budget/detail_modal.ejs');
|
|
|
@@ -440,6 +442,21 @@ module.exports = app => {
|
|
|
this.ajaxErrorBody(err, '保存小数位数失败');
|
|
|
}
|
|
|
}
|
|
|
+ async extraInfo(ctx) {
|
|
|
+ try {
|
|
|
+ if (!ctx.budget) throw '项目数据错误';
|
|
|
+ if (ctx.budget.readOnly) throw '你无权修改附加属性';
|
|
|
+
|
|
|
+ const data = JSON.parse(ctx.request.body.data);
|
|
|
+ if (!data || !data.btype) throw '缺少必要参数';
|
|
|
+
|
|
|
+ const refreshData = await ctx.service.budget.saveExtraInfo(data, data.btype);
|
|
|
+ ctx.body = { err: 0, msg: '', data: refreshData };
|
|
|
+ } catch (err) {
|
|
|
+ this.log(err);
|
|
|
+ this.ajaxErrorBody(err, '保存附加属性失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return BudgetController;
|