|
@@ -371,11 +371,11 @@ $(document).ready(function() {
|
|
|
await filingObj.loadFiles(node, 1);
|
|
|
filingObj.refreshFilesTable();
|
|
|
}
|
|
|
- if (filingObj.curFiling.source_node.filing_type === 5) {
|
|
|
- $('#rela-file-btn').show();
|
|
|
- } else {
|
|
|
- $('#rela-file-btn').hide();
|
|
|
- }
|
|
|
+ // if (filingObj.curFiling.source_node.filing_type === 5) {
|
|
|
+ // $('#rela-file-btn').show();
|
|
|
+ // } else {
|
|
|
+ // $('#rela-file-btn').hide();
|
|
|
+ // }
|
|
|
setLocalCache(this.curFilingKey, filingObj.curFiling.id);
|
|
|
}
|
|
|
findFiling(id) {
|
|
@@ -969,6 +969,9 @@ $(document).ready(function() {
|
|
|
$('#tf-stage').change(function() {
|
|
|
self.selectTfStage(this.value);
|
|
|
});
|
|
|
+ $('#tf-select').change(function() {
|
|
|
+ self.selectTfId(this.value);
|
|
|
+ });
|
|
|
$('#rela-file-ok').click(function() {
|
|
|
const selectFiles = self.getSelectRelaFile();
|
|
|
filingObj.relaFiles(selectFiles, function() {
|
|
@@ -1041,9 +1044,19 @@ $(document).ready(function() {
|
|
|
await this.setCurTender(firstNode);
|
|
|
}
|
|
|
}
|
|
|
+ refreshTenderFileSelectId() {
|
|
|
+ if (['change', 'change_apply', 'change_plan', 'change_project'].indexOf(this.rfType.type) >= 0) {
|
|
|
+ const type = this.tenderFileType.find(x => { return x.value === this.rfType.type; });
|
|
|
+ const html = type.select.map(x => { return `<option value="${x.value}">${x.text}</option>`});
|
|
|
+ $('#tf-select').html(html.join('')).show();
|
|
|
+ this.rfType.selectId = type.select[0].value;
|
|
|
+ } else {
|
|
|
+ $('#tf-select').html('').hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
refreshTenderFileStage() {
|
|
|
if (this.rfType.sub_type) {
|
|
|
- const type = this.tenderFileType.find(x => { return x.value === this.rfType.type});
|
|
|
+ const type = this.tenderFileType.find(x => { return x.value === this.rfType.type; });
|
|
|
const subType = type.subType ? type.subType.find(x => { return x.value === this.rfType.sub_type; }) : null;
|
|
|
if (subType) {
|
|
|
this.rfType.stage = subType.stage[0].value;
|
|
@@ -1088,6 +1101,8 @@ $(document).ready(function() {
|
|
|
value: 'stage', text: '计量期',
|
|
|
subType: [
|
|
|
{ value: 'att', text: '计量附件', stage: JSON.parse(JSON.stringify(stages)) },
|
|
|
+ { value: 'dealPay', text: '合同支付', stage: JSON.parse(JSON.stringify(stages)) },
|
|
|
+ { value: 'stageIm', text: '中间计量', stage: JSON.parse(JSON.stringify(stages)) },
|
|
|
],
|
|
|
});
|
|
|
}
|
|
@@ -1105,10 +1120,44 @@ $(document).ready(function() {
|
|
|
value: 'advance', text: '预付款', subType: advanceType
|
|
|
});
|
|
|
}
|
|
|
+ if (tender.change && tender.change.length > 0) {
|
|
|
+ const selects = [];
|
|
|
+ tender.change.forEach(x => {
|
|
|
+ selects.push({ value: x.cid, text: x.code })
|
|
|
+ });
|
|
|
+ this.tenderFileType.push({ value: 'change', text: '变更令', select: selects });
|
|
|
+ }
|
|
|
+ if (tender.change_plan && tender.change_plan.length > 0) {
|
|
|
+ const selects = [];
|
|
|
+ tender.change_plan.forEach(x => {
|
|
|
+ selects.push({ value: x.cpid, text: x.code })
|
|
|
+ });
|
|
|
+ this.tenderFileType.push({ value: 'change_plan', text: '变更方案', select: selects });
|
|
|
+ }
|
|
|
+ if (tender.change_project && tender.change_project.length > 0) {
|
|
|
+ const selects = [];
|
|
|
+ tender.change_project.forEach(x => {
|
|
|
+ selects.push({ value: x.cid, text: x.code })
|
|
|
+ });
|
|
|
+ this.tenderFileType.push({ value: 'change_project', text: '变更立项', select: selects });
|
|
|
+ }
|
|
|
+ if (tender.change_apply && tender.change_apply.length > 0) {
|
|
|
+ const selects = [];
|
|
|
+ tender.change_apply.forEach(x => {
|
|
|
+ selects.push({ value: x.cid, text: x.code })
|
|
|
+ });
|
|
|
+ this.tenderFileType.push({ value: 'change_apply', text: '变更申请', select: selects });
|
|
|
+ }
|
|
|
this.rfType = { type: this.tenderFileType[0].value };
|
|
|
this.refreshTenderFileType();
|
|
|
this.refreshTenderFileSubType();
|
|
|
this.refreshTenderFileStage();
|
|
|
+ this.refreshTenderFileSelectId();
|
|
|
+ }
|
|
|
+ async selectTfId(id) {
|
|
|
+ this.rfType.selectId = id;
|
|
|
+ await this.loadFiles();
|
|
|
+ this.refreshFileTable();
|
|
|
}
|
|
|
async selectTfStage(stage){
|
|
|
this.rfType.stage = stage;
|
|
@@ -1125,13 +1174,14 @@ $(document).ready(function() {
|
|
|
this.rfType.type = type;
|
|
|
this.refreshTenderFileSubType();
|
|
|
this.refreshTenderFileStage();
|
|
|
+ this.refreshTenderFileSelectId();
|
|
|
await this.loadFiles();
|
|
|
this.refreshFileTable();
|
|
|
}
|
|
|
refreshFileTable() {
|
|
|
const html = [];
|
|
|
const typeStr = [];
|
|
|
- const selectOption = $('option:selected');
|
|
|
+ const selectOption = $('option:selected', '#rela-file');
|
|
|
selectOption.each((i, x) => {
|
|
|
typeStr.push(x.innerText);
|
|
|
});
|
|
@@ -1186,11 +1236,63 @@ $(document).ready(function() {
|
|
|
if (!advance.files) advance.files = await this._loadRelaFiles(rfType);
|
|
|
this.curFiles = advance.files;
|
|
|
}
|
|
|
+ async _loadChangeFile() {
|
|
|
+ const rfType = this.rfType;
|
|
|
+ const change = this.curTender.source_node.change.find(x => {
|
|
|
+ return x.cid === rfType.selectId;
|
|
|
+ });
|
|
|
+ if (!change) {
|
|
|
+ this.curFiles = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!change.files) change.files = await this._loadRelaFiles(rfType);
|
|
|
+ this.curFiles = change.files;
|
|
|
+ }
|
|
|
+ async _loadChangePlanFile() {
|
|
|
+ const rfType = this.rfType;
|
|
|
+ const change = this.curTender.source_node.change_plan.find(x => {
|
|
|
+ return x.id === rfType.selectId;
|
|
|
+ });
|
|
|
+ if (!change) {
|
|
|
+ this.curFiles = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!change.files) change.files = await this._loadRelaFiles(rfType);
|
|
|
+ this.curFiles = change.files;
|
|
|
+ }
|
|
|
+ async _loadChangeProjectFile() {
|
|
|
+ const rfType = this.rfType;
|
|
|
+ const change = this.curTender.source_node.change_project.find(x => {
|
|
|
+ return x.id === rfType.selectId;
|
|
|
+ });
|
|
|
+ if (!change) {
|
|
|
+ this.curFiles = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!change.files) change.files = await this._loadRelaFiles(rfType);
|
|
|
+ this.curFiles = change.files;
|
|
|
+ }
|
|
|
+ async _loadChangeApplyFile() {
|
|
|
+ const rfType = this.rfType;
|
|
|
+ const change = this.curTender.source_node.change_apply.find(x => {
|
|
|
+ return x.id === rfType.selectId;
|
|
|
+ });
|
|
|
+ if (!change) {
|
|
|
+ this.curFiles = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!change.files) change.files = await this._loadRelaFiles(rfType);
|
|
|
+ this.curFiles = change.files;
|
|
|
+ }
|
|
|
async loadFiles() {
|
|
|
switch (this.rfType.type) {
|
|
|
case 'ledger': await this._loadLedgerFile(); break;
|
|
|
case 'stage': await this._loadStageFile(); break;
|
|
|
case 'advance': await this._loadAdvanceFile(); break;
|
|
|
+ case 'change': await this._loadChangeFile(); break;
|
|
|
+ case 'change_plan': await this._loadChangePlanFile(); break;
|
|
|
+ case 'change_project': await this._loadChangeProjectFile(); break;
|
|
|
+ case 'change_apply': await this._loadChangeApplyFile(); break;
|
|
|
}
|
|
|
this.initFilesId(this.curFiles);
|
|
|
}
|