|
@@ -252,7 +252,7 @@ module.exports = app => {
|
|
|
const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
|
const tp_data = await this.getTpData(transaction, materialId);
|
|
|
- await transaction.update(this.tableName, { id: audit.id, status: auditConst.status.checking, begin_time: new Date() });
|
|
|
+ await transaction.update(this.tableName, { id: audit.id, status: auditConst.status.checking, begin_time: new Date(), tp_data: JSON.stringify(tp_data) });
|
|
|
await transaction.update(this.ctx.service.material.tableName, {
|
|
|
id: materialId, status: auditConst.status.checking, tp_data: JSON.stringify(tp_data),
|
|
|
});
|
|
@@ -341,7 +341,7 @@ module.exports = app => {
|
|
|
// 复制一份下一审核人数据
|
|
|
// await this.ctx.service.stagePay.copyAuditStagePays(this.ctx.stage, this.ctx.stage.times, nextAudit.order, transaction);
|
|
|
// 流程至下一审批人
|
|
|
- await transaction.update(this.tableName, { id: nextAudit.id, status: auditConst.status.checking, begin_time: time });
|
|
|
+ await transaction.update(this.tableName, { id: nextAudit.id, status: auditConst.status.checking, begin_time: time, tp_data: JSON.stringify(tp_data) });
|
|
|
|
|
|
// 同步 期信息
|
|
|
await transaction.update(this.ctx.service.material.tableName, {
|
|
@@ -513,6 +513,7 @@ module.exports = app => {
|
|
|
await transaction.update(this.ctx.service.material.tableName, {
|
|
|
id: materialId, status: checkData.checkType,
|
|
|
times: times + 1,
|
|
|
+ tp_data: JSON.stringify(tp_data),
|
|
|
});
|
|
|
// 拷贝新一次审核流程列表
|
|
|
await transaction.insert(this.tableName, auditors);
|
|
@@ -616,6 +617,7 @@ module.exports = app => {
|
|
|
tid: audit.tid, mid: audit.mid, aid: preAuditor.aid,
|
|
|
times: audit.times, order: audit.order + 1, status: auditConst.status.checking,
|
|
|
begin_time: time,
|
|
|
+ tp_data: JSON.stringify(tp_data),
|
|
|
});
|
|
|
newAuditors.push({
|
|
|
tid: audit.tid, mid: audit.mid, aid: audit.aid,
|
|
@@ -712,6 +714,9 @@ module.exports = app => {
|
|
|
}
|
|
|
const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
|
+ const materialInfo = await this.ctx.service.material.getDataById(materialId);
|
|
|
+ const material_decimal = materialInfo && materialInfo.decimal ? JSON.parse(materialInfo.decimal) : materialConst.decimal;
|
|
|
+ const tp_data = await this.getTpData(transaction, materialId, material_decimal);
|
|
|
// 当前审批人2次添加至流程中
|
|
|
const newAuditors = [];
|
|
|
newAuditors.push({
|
|
@@ -723,6 +728,7 @@ module.exports = app => {
|
|
|
tid: audit.tid, mid: audit.mid, aid: audit.aid,
|
|
|
times: audit.times, order: audit.order + 2, status: auditConst.status.checking,
|
|
|
begin_time: time,
|
|
|
+ tp_data: JSON.stringify(tp_data),
|
|
|
});
|
|
|
await transaction.insert(this.tableName, newAuditors);
|
|
|
|
|
@@ -732,8 +738,6 @@ module.exports = app => {
|
|
|
id: materialId, status: auditConst.status.checking,
|
|
|
});
|
|
|
|
|
|
- const materialInfo = await this.ctx.service.material.getDataById(materialId);
|
|
|
- const material_decimal = materialInfo && materialInfo.decimal ? JSON.parse(materialInfo.decimal) : materialConst.decimal;
|
|
|
// 微信模板通知
|
|
|
const wechatData = {
|
|
|
qi: materialInfo.order,
|