diff --git a/css/welcome/data_detail_list.css b/css/welcome/data_detail_list.css index fff7229..d9d25fa 100644 --- a/css/welcome/data_detail_list.css +++ b/css/welcome/data_detail_list.css @@ -55,4 +55,5 @@ body { #demo{ width: calc(100% - 120px); + height: auto; } \ No newline at end of file diff --git a/js/welcome/data_datail_dispatch_list.js b/js/welcome/data_datail_dispatch_list.js index cf59827..b6f6876 100644 --- a/js/welcome/data_datail_dispatch_list.js +++ b/js/welcome/data_datail_dispatch_list.js @@ -132,7 +132,7 @@ function initTable() { title: "名称", unresize: true, align: "center", - sort:true, + sort: true, }, { field: "model", @@ -140,7 +140,7 @@ function initTable() { title: "规格", unresize: true, align: "center", - sort:true, + sort: true, }, { field: "unit", @@ -148,15 +148,28 @@ function initTable() { title: "单位", unresize: true, align: "center", - sort:true, + sort: true, }, { field: "remark", - width: '20%', + width: '18%', title: "说明(根据车辆/吊车自动生成)", unresize: true, align: "center", - sort:true, + sort: true, + templet: function (d) { + if (d.typeName === 1) { // 车辆 + return d.remark; + } else if (d.typeName === 2) { // 吊车 + if (d.remark) { + let remarkArr = d.remark.split('@'); + return '

' + d.planDay + '天 单价:¥' + (d.isDayOrMonth === '1' ? (d.dayPrice + '(元/日/台)') : (d.monthPrice + '(元/月/台)')) + '

' + + '

' + remarkArr[0] + '

' + + '

' + remarkArr[1] + '

'; + } + return ''; + } + }, }, { field: "money", @@ -164,7 +177,7 @@ function initTable() { width: '8%', unresize: true, align: "center", - sort:true, + sort: true, templet: function (d) { return '¥ ' + d.money + '' }, @@ -175,26 +188,26 @@ function initTable() { title: "付款状态", unresize: true, align: "center", - sort:true, + sort: true, templet: function (d) { - let color = "",name = ""; + let color = "", name = ""; if (d.payStatus === '待付款') { color = "#f56c6c"; name = '待付款'; } else if (d.payStatus === '已付款') { color = "#19be6b"; name = '已付款' - }else{ + } else { return '--' } - return ''+name+''; + return '' + name + ''; } }, { field: "code", width: '10%', title: "需求计划编号", - sort:true, + sort: true, unresize: true, align: "center", templet: function (d) { @@ -209,7 +222,7 @@ function initTable() { width: '8%', unresize: true, align: "center", - sort:true, + sort: true, }, { field: "supName", @@ -217,15 +230,15 @@ function initTable() { width: '8%', unresize: true, align: "center", - sort:true, + sort: true, }, { field: "dispatchDay", title: "派车日期", - width: '8%', + width: '10%', unresize: true, align: "center", - sort:true, + sort: true, }, ], ], diff --git a/js/welcome/data_datail_plan_list.js b/js/welcome/data_datail_plan_list.js index 8c622db..6d13485 100644 --- a/js/welcome/data_datail_plan_list.js +++ b/js/welcome/data_datail_plan_list.js @@ -43,7 +43,7 @@ function getFilterParams() { let strArr = layId.split('-'); if (strArr[0] === 'company') { let name = replaceChinese($(this).html()); - filterParams.companyName = name; + filterParams.companyId = name; } else if (strArr[0] === 'dispatch') { filterParams.dispatchStatus = strArr[1]; } else if (strArr[0] === 'year') { diff --git a/js/welcome/data_datail_pro_list.js b/js/welcome/data_datail_pro_list.js index 49cffdd..ed527b5 100644 --- a/js/welcome/data_datail_pro_list.js +++ b/js/welcome/data_datail_pro_list.js @@ -24,7 +24,7 @@ function getFilterParams() { let strArr = layId.split('-'); if (strArr[0] === 'company') { let name = replaceChinese($(this).html()); - filterParams.companyName = name; + filterParams.companyId = name; } else if (strArr[0] === 'dispatch') { filterParams.dispatchStatus = strArr[1]; } else if (strArr[0] === 'year') { diff --git a/js/welcome/data_detail_list.js b/js/welcome/data_detail_list.js index 8f65a80..6fda5e3 100644 --- a/js/welcome/data_detail_list.js +++ b/js/welcome/data_detail_list.js @@ -15,13 +15,6 @@ function setParams(obj) { } setFilter(objParam.type); setFilterData(objParam.type); - if(objParam.type === 1 || objParam.type === 2){ - let height = $('.tag-box').eq(0).height(); - if(height > 35){ - $('#open').removeAttr('style'); - $('#demo button').css('margin-bottom','5px'); - } - } layui.config({ base: "../../lib/layui-v2.9.18/layui/modules/", //此处路径请自行处理, 可以使用绝对路径 }).extend({ @@ -119,6 +112,16 @@ function setParams(obj) { } else if (objParam.type === 3 || objParam.type === 4 || objParam.type === 5 || objParam.type === 6) { // 派车详情 loadScript("../../js/welcome/data_datail_dispatch_list.js"); } + setTimeout(() => { + if (objParam.type === 1 || objParam.type === 2) { + let height = $('div#demo.layui-btn-container.tag').height(); + if (height > 30) { + $('#open').removeAttr('style'); + $('#demo button').css('margin-bottom', '5px'); + $('#demo').css({ 'height': '30px', 'overflow': 'hidden', 'text-overflow': 'ellipsis' }) + } + } + }, 100); }); } @@ -132,7 +135,8 @@ function loadScript(url) { // 保留中文汉字和数字 function replaceChinese(value) { - let str = value.match(/[\u4e00-\u9fa5]|\d/g).join(""); + // let str = value.match(/[\u4e00-\u9fa5]|\d|[a-z][A-Z]/g).join(""); + let str = value.replace('', ''); return str; } @@ -294,11 +298,11 @@ function setInitCheckData() { } else if (objParam.type === 4) { // 吊车量-派车详情 checkTabId.push('type-2'), checkTabName.push('吊车'); } else if (objParam.type === 5) { // 已付款金额-派车详情 - if(!objParam.notUse){ + if (!objParam.notUse) { checkTabId.push('pay-1'), checkTabName.push('已付款'); } } else if (objParam.type === 6) { // 待付款金额-派车详情 - if(!objParam.notUse){ + if (!objParam.notUse) { checkTabId.push('pay-2'), checkTabName.push('未付款'); } }