问题修改

This commit is contained in:
cwchen 2025-01-21 10:11:33 +08:00
parent 94b12eecc2
commit 6896c387ee
5 changed files with 45 additions and 27 deletions

View File

@ -55,4 +55,5 @@ body {
#demo{
width: calc(100% - 120px);
height: auto;
}

View File

@ -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 '<p>' + d.planDay + '天 单价:¥' + (d.isDayOrMonth === '1' ? (d.dayPrice + '(元/日/台)') : (d.monthPrice + '(元/月/台)')) + '</p>' +
'<p>' + remarkArr[0] + '</p>' +
'<p>' + remarkArr[1] + '</p>';
}
return '';
}
},
},
{
field: "money",
@ -164,7 +177,7 @@ function initTable() {
width: '8%',
unresize: true,
align: "center",
sort:true,
sort: true,
templet: function (d) {
return '<span>¥ ' + d.money + '</span>'
},
@ -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 '<span style="color:' + color + '"> ● </span>'+name+'';
return '<span style="color:' + color + '"> ● </span>' + 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,
},
],
],

View File

@ -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') {

View File

@ -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') {

View File

@ -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('<i class="layui-icon layui-unselect tag-close">ဆ</i>', '');
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('未付款');
}
}