|
|
@@ -47,7 +47,7 @@ module.exports = app => {
|
|
|
phasePays,
|
|
|
validStages,
|
|
|
auditConst: audit.common,
|
|
|
- jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.phasePay.list)
|
|
|
+ jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.phasePay.list),
|
|
|
};
|
|
|
await this.layout('phase_pay/index.ejs', renderData, 'phase_pay/modal.ejs');
|
|
|
} catch (err) {
|
|
|
@@ -68,7 +68,7 @@ module.exports = app => {
|
|
|
|
|
|
const pays = await ctx.service.phasePay.getAllPhasePay(ctx.tender.id, 'DESC');
|
|
|
const unCompleteCount = pays.filter(s => { return s.status !== audit.common.status.checked; }).length;
|
|
|
- if (unCompleteCount.length > 0) throw `最新一起未审批通过,请审批通过后再新增`;
|
|
|
+ if (unCompleteCount.length > 0) throw '最新一起未审批通过,请审批通过后再新增';
|
|
|
const stages = stage ? await ctx.service.stage.getAllDataByCondition({ where: { tid: ctx.tender.id, order: stage } }) : [];
|
|
|
|
|
|
const newPhase = await ctx.service.phasePay.add(ctx.tender.id, stages, date, memo);
|
|
|
@@ -177,6 +177,7 @@ module.exports = app => {
|
|
|
shenpiConst,
|
|
|
auditType: audit.auditType,
|
|
|
authMobile: pa.auth_mobile,
|
|
|
+ showAudit: true,
|
|
|
};
|
|
|
await this.layout('phase_pay/detail.ejs', renderData, 'phase_pay/detail_modal.ejs');
|
|
|
} catch (err) {
|
|
|
@@ -194,7 +195,7 @@ module.exports = app => {
|
|
|
|
|
|
const result = {};
|
|
|
for (const f of filter) {
|
|
|
- switch(f) {
|
|
|
+ switch (f) {
|
|
|
case 'pay':
|
|
|
result.pay = await this.ctx.service.phasePayDetail.getDetailData(ctx.phasePay);
|
|
|
break;
|
|
|
@@ -269,7 +270,7 @@ module.exports = app => {
|
|
|
async uploadFile(ctx) {
|
|
|
let stream;
|
|
|
try {
|
|
|
- const parts = ctx.multipart({autoFields: true});
|
|
|
+ const parts = ctx.multipart({ autoFields: true });
|
|
|
|
|
|
let index = 0;
|
|
|
const create_time = Date.parse(new Date()) / 1000;
|
|
|
@@ -306,7 +307,7 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
const result = await ctx.service.phasePayFile.addFiles(ctx.phasePay, 'pay', uploadfiles, user);
|
|
|
- ctx.body = {err: 0, msg: '', data: result};
|
|
|
+ ctx.body = { err: 0, msg: '', data: result };
|
|
|
} catch (error) {
|
|
|
ctx.log(error);
|
|
|
// 失败需要消耗掉stream 以防卡死
|
|
|
@@ -315,12 +316,12 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
async deleteFile(ctx) {
|
|
|
- try{
|
|
|
+ try {
|
|
|
const data = JSON.parse(ctx.request.body.data);
|
|
|
if (!data && !data.id) throw '缺少参数';
|
|
|
const result = await ctx.service.phasePayFile.delFiles(data.id);
|
|
|
ctx.body = { err: 0, msg: '', data: result };
|
|
|
- } catch(error) {
|
|
|
+ } catch (error) {
|
|
|
ctx.log(error);
|
|
|
ctx.ajaxErrorBody(error, '删除附件失败');
|
|
|
}
|