cellsysArt/repairFileAudit.js
2025-02-25 09:47:45 +08:00

55 lines
1.6 KiB
JavaScript

import AuditRecord from "./auditRecord";
import { Query, QueryTask, EditTask } from "./artUtil";
import { artApi } from "./artApi";
import ArtRepairFile from "./artRepairFile";
class RepairFileAudit extends AuditRecord {
constructor(params = {}) {
super(params);
this.reviewerSignatureImage = params.reviewer_signature_image; //审核人签名
this.status = params.status;
this.applicantsignatureImage = params.applicant_signature_image; //申请人签名
this.repairFile = {
id: params.repair_record_id,
name: params.repair_record ? params.repair_record["name"] : null,
};
}
queryRepairFile() {
let query = new Query();
query.addFilter("id", "=", this.repairFile.id);
let queryTask = new QueryTask(artApi.viewRepairRecord, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
let resArr = res.map((item) => {
return new ArtRepairFile(item);
});
resolve(resArr);
})
.catch((err) => {
reject(err);
});
});
}
//修复档案审核
updateRepairFileReview(params = {}) {
let editTask = new EditTask(artApi.repairRecordArchiveReviewUpdate);
editTask.addParam("_id", this.id);
editTask.addParam("_repair_record_id", this.repairFile.id);
editTask.addParam("_remark", params.remark);
editTask.addParam("_status", params.status);
editTask.addParam(
"_reviewer_signature_image",
params.reviewerSignatureImage
);
return editTask.execute();
}
}
export default RepairFileAudit;