|
@@ -145,6 +145,7 @@ function formatTableData(data){
|
|
|
function renderTab(data,hisId,activePage){
|
|
|
data = data.records;
|
|
|
let str = ''
|
|
|
+ // console.log(orderList)
|
|
|
for(let i = 0; i < data.length; i++){
|
|
|
const item = data[i]
|
|
|
// console.log(item,'=====================item');
|
|
@@ -153,12 +154,10 @@ function renderTab(data,hisId,activePage){
|
|
|
<td class="textCenter">${(activePage-1)*15 + i+1}</td>`
|
|
|
for(var j = 0; j < orderTitle.length; j++) {
|
|
|
let tmpKey = orderTitle[j]
|
|
|
-
|
|
|
if(tmpKey=='deptName'||tmpKey=='doctorName'){
|
|
|
- str += `<td dept-id="${item.deptId || ""}" data-tid="${orderList[j].id}" data-doc="${item.doctorName}" dept-name="${item.deptName || ""}" data-id="${item.numId || ""}" data-name="${orderKey[j] || ""}">${item[tmpKey]+'' || "-"}</td>`
|
|
|
+ str += `<td dept-id="${item.deptId || ""}" data-tid="${item[tmpKey.replace('name','id')]}" data-doc="${item.doctorName}" dept-name="${item.deptName || ""}" data-id="${item.numId || ""}" data-name="${item[tmpKey] || ""}">${item[tmpKey.replace('name','num')]+'' || "-"}</td>`
|
|
|
}else{
|
|
|
- // str += `<td class="goHomeDetail" data-tid="${orderList[j].id}" data-doc="${item.doctorName}" dept-id="${item.deptId || ""}" dept-name="${item.deptName || ""}" data-id="${item.numId || ""}" data-name="${orderKey[j] || ""}">${item[tmpKey]+'' || "-"}</td>`
|
|
|
- str += `<td class="goHomeDetail" data-tid="${orderList[j].id}" dept-id="${item.deptId || ""}" dept-name="${item.deptName || ""}" data-id="${item.numId || ""}" data-name="${orderKey[j] || ""}" data-doctor="${item.doctorName || ""}">${item[tmpKey]+'' || "-"}</td>`
|
|
|
+ str += `<td class="goHomeDetail" data-tid="${item[tmpKey.replace('name','id')]}" dept-id="${item.deptId || ""}" dept-name="${item.deptName || ""}" data-id="${item.numId || ""}" data-name="${item[tmpKey] || ""}" data-doctor="${item.doctorName || ""}">${item[tmpKey.replace('name','num')]+'' || "-"}</td>`
|
|
|
}
|
|
|
}
|
|
|
str += `</tr>`
|
|
@@ -209,20 +208,19 @@ function getDeptList(){
|
|
|
// 渲染table表头
|
|
|
function renderTabTitle(data){
|
|
|
isfirstRenderTitle = true
|
|
|
- let str = `
|
|
|
- <th class="moduleName" style="width: 65px;">序号</th>`
|
|
|
+ let str = `<th class="moduleName" style="width: 65px;">序号</th>`
|
|
|
+ // data.sort(des)
|
|
|
for(let i = 0; i < data.length; i++){
|
|
|
const item = data[i]
|
|
|
if(item.isShow == 1){
|
|
|
- // str += `<th class="textCenter beHospitalId" code="${item.fieldName}">${item.columnName}</th>`
|
|
|
str += `<th class="textCenter beHospitalId">${item.columnName}</th>`
|
|
|
orderList.push(item)
|
|
|
}
|
|
|
}
|
|
|
- orderList.sort(des)
|
|
|
- function des(a,b){
|
|
|
- return a['orderNo']-b['orderNo']
|
|
|
- }
|
|
|
+ // orderList.sort(des)
|
|
|
+ // function des(a,b){
|
|
|
+ // return a['orderNo']-b['orderNo']
|
|
|
+ // }
|
|
|
orderTitleLis(orderList)
|
|
|
$(".tabTitle").html(str)
|
|
|
// bindOrder()
|
|
@@ -230,7 +228,7 @@ function renderTabTitle(data){
|
|
|
function orderTitleLis(data){
|
|
|
for(let i = 0;i < data.length;i++){
|
|
|
let key = data[i].columnName
|
|
|
- orderTitle.push(explainTitle[key])
|
|
|
+ orderTitle.push(data[i].fieldName)
|
|
|
orderKey.push(key)
|
|
|
}
|
|
|
}
|