This commit is contained in:
cwchen 2024-11-09 15:09:41 +08:00
parent 1eede7311e
commit 5980209e48
5 changed files with 225 additions and 15 deletions

View File

@ -0,0 +1,81 @@
.layout {
display: flex;
align-items: center;
justify-content: center;
}
#main-box {
width: 100%;
height: 100%;
}
#detail-box {
width: 100%;
height: 60px;
background-color: #fff;
border-radius: 5px;
justify-content: start;
}
.detail {
flex-direction: column;
align-items: baseline;
justify-content: space-evenly;
height: 100%;
}
#iframe-box {
width: 100%;
box-sizing: border-box;
background-color: #fff;
height: calc(100% - 180px);
}
.layui-tab-brief {
border: 1px solid #f2f2f2;
border-radius: 5px;
background-color: #ffffff;
height: 80px;
overflow-x: auto;
/* 启用横向滚动 */
white-space: nowrap;
/* 不换行 */
}
.layui-tab-title {
display: inline-block;
/* 内联块级元素 */
}
.layui-tab-brief::-webkit-scrollbar {
width: 0;
height: 0;
}
.layui-tab-brief>.layui-tab-title .layui-this {
color: #409eff;
}
.layui-tab-brief>.layui-tab-more li.layui-this:after,
.layui-tab-brief>.layui-tab-title .layui-this:after {
border-bottom: 2px solid #409eff;
}
a {
color: #428bca;
text-decoration: none;
}
a:hover,
a:focus {
color: #2a6496;
text-decoration: underline;
}
.layuimini-container {
height: 89%;
}
.layui-tab .layui-tab-title li {
font-size: 16px;
}

View File

@ -0,0 +1,72 @@
let layer, element;
let objParam;
function setParams(obj) {
objParam = JSON.parse(obj);
console.log(obj);
$('#proName').html(objParam.proName);
setStatusColor(objParam.status);
layui.use(["layer", 'element'], function () {
form = layui.form;
table = layui.table;
element = layui.element;
// tab 切换事件
element.on('tab(demo-filter-tab)', function (data) {
let value = $(this).attr('value');
});
getShipmentBatch();
});
}
// 发货批次
function getShipmentBatch() {
let html = '';
let list = [{ name: '全部', value: '' }, { name: '第1批', value: '1' }, { name: '第2批', value: '2' }, { name: '第3批', value: '3' }, { name: '第4批', value: '4' },
{ name: '第5批', value: '5' }, { name: '第6批', value: '6' }, { name: '第7批', value: '7' }, { name: '第8批', value: '8' }, { name: '第9批', value: '9' },
{ name: '第10批', value: '10' }, { name: '第11批', value: '11' }, { name: '第12批', value: '12' }, { name: '第13批', value: '13' }, { name: '第14批', value: '14' },
{ name: '第15批', value: '15' }, { name: '第16批', value: '16' }, { name: '第17批', value: '17' }, { name: '第18批', value: '18' }, { name: '待发货', value: '0' }
];
/* if(list.length > 16){
} */
$.each(list, function (index, item) {
if (item.name === '待发货') {
html += '<li value="' + this.value + '" style="color:red">' + this.name + '</li>';
}else if(item.name === '全部'){
html += '<li value="' + this.value + '">' + this.name + '</li>';
} else {
html += '<li value="' + this.value + '"><span>'+item.name+'</span></li>';
}
})
$('.layui-tab-title').empty().append(html);
$('.layui-tab-title li').eq(0).addClass('layui-this');
var scrollableElement = document.getElementById('layui-tab-brief');
// 添加事件监听器来处理滚轮事件
scrollableElement.addEventListener('wheel', function (event) {
// 阻止默认的滚动行为
event.preventDefault();
// 检查滚动的方向
var delta = event.deltaY > 0 ? -20 : 20; // 根据需要调整滚动的步长
// 设置新的滚动位置
scrollableElement.scrollLeft += delta;
});
}
function setStatusColor(value) {
let color = "#409Eff";
let name = ''
if (value === 0) {
color = "#f56c6c";
name = '未发货';
} else if (value === 1) {
color = "#ff9900";
name = '部分发货'
} else if (value === 2) {
color = "#19be6b";
name = '全部发货'
}
let html = '<span style="color:' + color + ';font-weight:bold;">' + name + "</span>";
$('#status').html(html);
}

View File

@ -343,14 +343,11 @@ function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量
// 提交
function submitApply(data) {
let list = [];
// 校验发货附件是否上传
if (fileList.length === 0) {
return layer.msg('请上传发货附件', { icon: 7 });
}
// 校验机具发货数量
if (jjDetailArr.length === 0) {
return layer.msg('未填写发货数量', { icon: 7 });
}
// 校验调整量发生变化是否填写备注
for (let i = 0; i < jjDetailArr.length; i++) {
let obj = jjDetailArr[i];
@ -358,8 +355,19 @@ function submitApply(data) {
return layer.msg(obj.type + '-' + obj.name + '-' + obj.module + ',已修改调整量,请填写备注', { icon: 7 });
}
}
// 添加机具发货数据
for (let i = 0; i < jjDetailArr.length; i++) {
let obj = jjDetailArr[i];
if (obj.num > 0 || obj.tzNum > 0) {
list.push(obj);
}
}
// 校验机具发货数量
if (list.length === 0) {
return layer.msg('未填写发货数量', { icon: 7 });
}
data.field.proId = idParam;
data.field.list = jjDetailArr;
data.field.list = list;
data.field.addList = jjDataArr;
let formData = new FormData();
//遍历最终文件集合
@ -368,7 +376,6 @@ function submitApply(data) {
}
formData.append('params', JSON.stringify(data.field));
console.log(JSON.stringify(data.field));
let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' });
console.log(JSON.stringify(data.field));
let url = dataUrl + 'backstage/planOut/insertProOutPutInfo';

View File

@ -155,7 +155,7 @@ function initTable() {
unresize: true,
templet: function (d) {
let html = "";
html += "<a onclick=\"viewData('" + d.proId + "')\">详情</a>";
html += "<a onclick='deliveryDetail("+JSON.stringify(d)+")'>详情</a>";
html += "<div class='splitLine'>|</div><a onclick='sendGoods("+JSON.stringify(d)+")'>发货</a>";
return html;
},
@ -180,14 +180,18 @@ function setNumColor(value) {
// 发货状态颜色
function setStatusColor(value) {
let color = "#409Eff";
if (value === "未发货") {
let name = ''
if (value === 0) {
color = "#f56c6c";
} else if (value === "部分发货") {
name = '未发货';
} else if (value === 1) {
color = "#ff9900";
}else if (value === "全部发货") {
name = '部分发货'
} else if (value === 2) {
color = "#19be6b";
name = '全部发货'
}
return '<span style="color:' + color + '">' + value + "</span>";
return '<span style="color:' + color + '">' + name + "</span>";
}
// 设置进度值
@ -220,6 +224,11 @@ function exportExcel() {
exportExcelUtil(url,'机具公司发货数据');
}
// 发货详情
function deliveryDetail(obj) {
openIframeByParamObj("deliveryDetail","详情","./child/delivery_detail_list.html","92%","95%",obj);
}
// 发货
function sendGoods(obj) {
openIframeByParamObj("sendGoods","发货","./child/send_goods_form.html","92%","95%",obj);

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>发货详情</title>
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../../css/font.css" media="all">
<link rel="stylesheet" href="../../../css/public.css" media="all">
<link rel="stylesheet" href="../../../css/demandPlan/delivery_detail_list.css" media="all">
</head>
<body>
<div id="main-box">
<div id="detail-box" class="layout">
<div class="layout detail" style="margin: 0 20px;">
<p style="font-size: 18px;font-weight: bold;" id="proName"></p>
<p id="status"></p>
</div>
<div class="layout detail" style="margin-left: 10%;">
<p>计划数量</p>
<p style="color: #409EFF;">0</p>
</div>
</div>
<div class="layui-tab layui-tab-brief" id="layui-tab-brief" lay-filter="demo-filter-tab">
<ul class="layui-tab-title">
</ul>
</div>
<div id="iframe-box">
<iframe id="indexIframe2" width="100%" height="100%" frameborder="0" class="layadmin-iframe"
src=""></iframe>
</div>
</div>
</body>
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="../../../js/public.js" charset="utf-8"></script>
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/demandPlan/child/delivery_detail_list.js" charset="utf-8"></script>
</html>