|
@@ -1,24 +1,36 @@
|
|
|
const rptOtherStage = (function (){
|
|
|
const info = {
|
|
|
- advance: { title: '请选择预付款', colHeader: ['选择', '类型', '期', '审批状态'] },
|
|
|
+ advance: { title: '请选择预付款', colHeader: ['类型', '期', '审批状态'], colValue: ['typeStr', 'orderStr', 'statusStr'] },
|
|
|
+ pm_deal: { title: '请选择合同管理', colHeader: ['名称'], colValue: ['name'], active: true },
|
|
|
};
|
|
|
const data = {};
|
|
|
let curType = '';
|
|
|
const initList = function () {
|
|
|
- const header = info[curType].colHeader;
|
|
|
- const type = info[curType].type;
|
|
|
- $('#sos-header').html(`<tr class="text-center"><th>${header[0]}</th><th>${header[1]}</th><th>${header[2]}</th><th>${header[3]}</th></tr>`);
|
|
|
+ const header = info[curType].colHeader, value = info[curType].colValue;
|
|
|
+ const headerHtml = [];
|
|
|
+ headerHtml.push('<tr class="text-center"><th>选择</th>');
|
|
|
+ for (const h of header) {
|
|
|
+ headerHtml.push(`<th>${h}</th>`);
|
|
|
+ }
|
|
|
+ headerHtml.push('</tr>');
|
|
|
+ $('#sos-header').html(headerHtml.join());
|
|
|
const html = [], arr = data[curType];
|
|
|
for (const a of arr) {
|
|
|
+ const aHtml = [];
|
|
|
const checked = a.selected ? 'checked' : '';
|
|
|
- html.push('<tr class="text-center">', `<td><input type="checkbox" name="sos-check" ${checked} value="${a.id}"></td>`, `<td>${a.typeStr}</td>`, `<td>第${a.order}期</td>`, `<td>${a.statusStr}</td>`, '</tr>');
|
|
|
+ aHtml.push(`<tr class="text-center"><td><input type="checkbox" name="sos-check" ${checked} value="${a.id}"></td>`);
|
|
|
+ for (const v of value) {
|
|
|
+ aHtml.push(`<td>${a[v]}</td>`);
|
|
|
+ }
|
|
|
+ aHtml.push('</tr>');
|
|
|
+ html.push(aHtml.join());
|
|
|
}
|
|
|
$('#sos-list').html(html.join(''));
|
|
|
};
|
|
|
const showOtherStage = async function (type) {
|
|
|
curType = type;
|
|
|
document.getElementById('sos-title').innerText = info[type].title;
|
|
|
- if (!data[type]) {
|
|
|
+ if (!data[type] || info[curType].active) {
|
|
|
const result = await postDataAsync(`/tender/${window.location.pathname.split('/')[2]}/load`, { filter: curType });
|
|
|
data[curType] = result[curType];
|
|
|
}
|