Browse Source

看板取值与界面调整

master
fyw 2 years ago
parent
commit
a54fd73106
  1. 176
      NFine.Application/SRM/WatchPanelApp.cs
  2. 143
      NFine.Web/Areas/SRM/Views/WatchPanel/PanelWIPZhiXingDa2.cshtml

176
NFine.Application/SRM/WatchPanelApp.cs

@ -1201,11 +1201,11 @@ ORDER BY 销售车号,物料编码,报工人
string where1 = "";
string SqlText = "";
SqlText = @" select * from(
select isnull(mpproduct,0) as ,isnull(mpsaleout,0) from ICSZXBoardPlan
where moth = CONVERT(CHAR(10),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120) )a
left join (
select isnull(mpproduct,0) as ,isnull(mpsaleout,0) from ICSZXBoardPlan
where moth = CONVERT(CHAR(10),DATEADD(month,-1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120) ) b on 1=1";
select isnull(mpproduct,0) as ,isnull(mpsaleout,0) from ICSZXBoardPlan
where moth = CONVERT(CHAR(10),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120) )a
left join (
select isnull(realsaleout,0) from ICSZXBoardSaleout
where id = '1') b on 1=1";
DataTable dt = Repository().GetDataTableBySql_Other(SqlText, "MESconnstr", null);
return dt;
}
@ -1342,61 +1342,117 @@ ORDER BY 销售车号,物料编码,报工人
{
string SqlText = "";
SqlText = @"
if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempMO'))
drop table #tempMO
if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempM'))
drop table #tempM
--
select mocode,max(MOSEQ) as moseq
into #tempMO
from icsmo
where MTIME between CONVERT(CHAR(10),DATEADD(month,-11,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and CONVERT(CHAR(10),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
group by mocode
--
select *
into #tempM
from
(select
CONVERT(CHAR(7),DATEADD(month,-11,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-10,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-9,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-8,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-7,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-6,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-5,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-4,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-3,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-2,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,-1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
union select
CONVERT(CHAR(7),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont) TempM
--
select Mont,isnull(num,0) as num from #tempM tm
left join (
select convert(varchar(7),EndTime ,111) endtime, count(*) num
from ICSLOTONWIP wip
left join #tempMO mo on mo.moseq = wip.MOSEQ and mo.MOCODE = wip.MOCODE
where wip.ACTIONRESULT = 'COLLECT_END'
group by convert(varchar(7),EndTime ,111)) wip on tm.Mont= wip.endtime
if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempMO'))
drop table #tempMO
if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempM'))
drop table #tempM
";
//SqlText = @"
// if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempMO'))
// drop table #tempMO
// if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempM'))
// drop table #tempM
// --获取当前月份前十一个月的最大工单行数据
// select mocode,max(MOSEQ) as moseq
// into #tempMO
// from icsmo
// where MTIME between CONVERT(CHAR(10),DATEADD(month,-11,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
// and CONVERT(CHAR(10),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
// group by mocode
// --查询出当前年月向前十二月数据
// select *
// into #tempM
// from
// (select
// CONVERT(CHAR(7),DATEADD(month,-11,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-10,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-9,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-8,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-7,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-6,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-5,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-4,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-3,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-2,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,-1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont
// union select
// CONVERT(CHAR(7),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont) TempM
// --获取前十二月数据
// select Mont,isnull(num,0) as num from #tempM tm
// left join (
// select convert(varchar(7),EndTime ,111) endtime, count(*) num
// from ICSLOTONWIP wip
// left join #tempMO mo on mo.moseq = wip.MOSEQ and mo.MOCODE = wip.MOCODE
// where wip.ACTIONRESULT = 'COLLECT_END'
// group by convert(varchar(7),EndTime ,111)) wip on tm.Mont= wip.endtime
// if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempMO'))
// drop table #tempMO
// if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempM'))
// drop table #tempM
// ";
SqlText = @" if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempNum'))
drop table #tempNum
--
select tmo.socode,tmo.monum,isnull(wip.wipnum ,0) as wipnum ,wip.EndTime
into #tempNum
from
(
select tso.socode ,count(*) as monum from
icsso tso
left join icsmo tmo on tso.socode = tmo.molotcode
group by tso.socode
) tmo
left join (
select tso.socode ,count(*) as wipnum,min(wip.EndTime) EndTime from
icsso tso
left join (select mocode,molotcode from icsmo group by mocode,molotcode) tmo on tso.socode = tmo.molotcode
LEFT JOIN ICSLOTSIMULATION wip on tmo.mocode = wip.mocode
where wip.iscom='1'
group by tso.socode
) wip on tmo.socode = wip.socode
select count(*) num , CONVERT(CHAR(7),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont from #tempNum t
where t.wipnum = t.monum and t.EndTime between
CONVERT(CHAR(10),DATEADD(month,-1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
and CONVERT(CHAR(10),DATEADD(month,0,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
union
select count(*) num , CONVERT(CHAR(7),DATEADD(month,-1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont from #tempNum t
where t.wipnum = t.monum and t.EndTime between
CONVERT(CHAR(10),DATEADD(month,-2,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
and CONVERT(CHAR(10),DATEADD(month,-1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
union
select count(*) num,CONVERT(CHAR(7),DATEADD(month,-2,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont from #tempNum t
where t.wipnum = t.monum and t.EndTime between
CONVERT(CHAR(10),DATEADD(month,-3,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
and CONVERT(CHAR(10),DATEADD(month,-2,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
union
select count(*) num,CONVERT(CHAR(7),DATEADD(month,-3,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont from #tempNum t
where t.wipnum = t.monum and t.EndTime between
CONVERT(CHAR(10),DATEADD(month,-4,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
and CONVERT(CHAR(10),DATEADD(month,-3,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
union
select count(*) num,CONVERT(CHAR(7),DATEADD(month,-4,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont from #tempNum t
where t.wipnum = t.monum and t.EndTime between
CONVERT(CHAR(10),DATEADD(month,-5,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
and CONVERT(CHAR(10),DATEADD(month,-4,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
union
select count(*) num,CONVERT(CHAR(7),DATEADD(month,-5,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111) Mont from #tempNum t
where t.wipnum = t.monum and t.EndTime between
CONVERT(CHAR(10),DATEADD(month,-6,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
and CONVERT(CHAR(10),DATEADD(month,-5,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),120)
if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#tempNum'))
drop table #tempNum
";
DataTable dt = Repository().GetDataTableBySql_Other(SqlText, "MESconnstr", null);
return dt;

143
NFine.Web/Areas/SRM/Views/WatchPanel/PanelWIPZhiXingDa2.cshtml

@ -20,9 +20,9 @@
<script src="~/Content/Cust003/js/jquery.numscroll.js"
type="text/javascript"
charset="utf-8"></script>
<script src="~/Content/js/echarts/echarts5.3.3.js"></script>
<script src="~/Content/js/echarts/echarts5.3.3.js"></script>
<script src="~/Content/js/echarts4.8/echarts-liquidfill.js"></script>
<style>
@ -42,11 +42,11 @@
}
.CustDiv1 ul li:nth-child(1), .CustDiv1 div div ul li:nth-child(1) {
width: 20% !important;
width: 5% !important;
}
.CustDiv1 ul li:nth-child(2), .CustDiv1 div div ul li:nth-child(2) {
width: 28% !important;
/* width: 28% !important; */
}
.CustDiv1 ul li:nth-child(3), .CustDiv1 div div ul li:nth-child(3) {
@ -160,7 +160,7 @@
.TopNameTime {
vertical-align: middle;
text-align: right;
font-size: 20px;
font-size: 10px;
font-weight: 700;
color: white;
}
@ -177,42 +177,44 @@
}
#div1-C1 {
font-size: 18px;
margin-left: 115px;
margin-top: 50px;
}
#div1-C1 div {
margin-top: 10px;
margin-top: 20px;
color: white;
border: solid 1px #AFEEEE;
text-align: center;
width: 130px;
}
#div1-C2 {
font-size: 18px;
margin-left: 15px;
margin-top: 50px;
}
#div1-C2 div {
margin-top: 10px;
border: solid 1px #AFEEEE;
margin-top: 23px;
width: 200px;
height: 22.5px;
height: 20px;
background-color: #0000CD;
text-align: center;
}
#div1-C3 {
font-size: 18px;
margin-left: 15px;
margin-top: 50px;
}
#div1-C3 div {
margin-top: 10px;
margin-top: 20px;
color: white;
/*border-left:solid 1px #AFEEEE;
border-right:solid 1px #AFEEEE;
border-radius:25px;*/
border: solid 1px #AFEEEE;
text-align: center;
width: 30px;
}
@ -233,31 +235,30 @@
#div3-C1-C1 {
text-align: center;
width: 100%;
font-size: 25px;
background-color: #6495ED;
}
#div3-C1-C2 {
margin-top: 10px;
display: flex;
}
#div3-C1-C2-div1 {
width: 25px;
margin-left: 20px;
border: solid 1px blue;
}
#div3-C1-C2-div2 {
width: 25px;
margin-left: 20px;
border: solid 1px blue;
}
#div3-C2-C1 {
text-align: center;
width: 100%;
width: 97%;
font-size: 25px;
background-color: #6495ED;
}
#div3-C2-C2 {
@ -267,12 +268,10 @@
#div3-C2-C2-div1 {
width: 25px;
border: solid 2px blue;
}
#div3-C2-C2-div2 {
width: 20px;
border: solid 2px blue;
}
#div3-C1-C2 span {
@ -282,13 +281,13 @@
#div3-C2-C2 span {
margin-left: 20px;
text-align:center;
text-align: center;
}
#div1-C2 {
color: white;
text-align: center;
}
</style>
<script type="text/javascript">
document.documentElement.style.fontSize =
@ -438,7 +437,7 @@
<div id="div3">
<div id="div3-C1">
<div id="div3-C1-C1">
</div>
<div id="div3-C1-C2">
@ -454,7 +453,7 @@
</div>
<div id="div3-C2">
<div id="div3-C2-C1">
</div>
<div id="div3-C2-C2">
<span>完成数量</span>
@ -481,7 +480,12 @@
<div class="rightMain_bottom">
<div class="rightMain_bottomIn">
<h3 style="margin-left:290px"> 月完工车辆统计</h3>
<h3 style=" text-align: center;
width: 97%;
font-size:25px;
background-color:#6495ED;">
月完工车辆统计
</h3>
<div class="biaoge biaoge_list" id="div4"
style="width: 100%; ">
@*<div class="biaoge_listIn CustDiv2">
@ -522,7 +526,7 @@
var _barBorderRadius_M = 2;
var myChart4 = echarts.init(document.getElementById('div4'));
var myChartArea3 = echarts.init(document.getElementById('div3pie'));
$(function () {
getTime();
@ -801,10 +805,9 @@
async: false,
success: function (data) {
if (data != false && data != null) {
//月度生产 月度发车 上月实际生产 月度实际发车 上月完成数量 上上月完成数量
//月度生产 月度发车 上月实际生产 月度实际发车 上月完成数量 上上月完成数量
$("#mothPlan").html(data[0].月度生产);
$("#motnSales").html(data[0].月度发车);
$("#lastMothPlan").html(data[0].上月度生产);
$("#lastMothSales").html(data[0].上月度发车);
} else {
$("#" + marqueeID).html("");
@ -817,7 +820,7 @@
}
function GetArea3() {
// 基于准备好的dom,初始化echarts实例
//var MonthArray = new Array();
//var MonthPercent = new Array();
@ -828,6 +831,7 @@
dataType: "json",
async: false,
success: function (data) {
console.log(data);
if (data != false && data != null && data.length > 0) {
var value = 0;
var value1 = 0;
@ -847,9 +851,10 @@
value6 = data[0].前月;
value7 = data[0].上月;
}
$("#div3-C1-C1").html(value7 +"月完成率");
$("#div3-C2-C1").html(value6 +"月完成率");
$("#div3-C1-C1").html(value7 + "月完成率");
$("#div3-C2-C1").html(value6 + "月完成率");
$("#div3-C1-C2-div1").html(value3);
$("#lastMothPlan").html(value3);
$("#div3-C1-C2-div2").html(value2);
$("#div3-C2-C2-div1").html(value1);
$("#div3-C2-C2-div2").html(value);
@ -857,7 +862,7 @@
var data = [value5, value5, value5];
var option3 = {
title: [
{
text: value7 + '月完成率',
@ -903,13 +908,13 @@
},
{
offset: 1,
color: '#2ca3e2',
color: '#0000FF',
},
],
globalCoord: false,
},
],
data: [value4, value4, value4], // data个数代表波浪数
data: [value5, value5, value5], // data个数代表波浪数
backgroundStyle: {
borderWidth: 1,
color: 'RGBA(51, 66, 127, 0.7)',
@ -926,8 +931,8 @@
// show: false
borderDistance: 0,
itemStyle: {
borderWidth: 2,
borderColor: '#112165',
borderWidth: 6,
borderColor: '#0000FF',
},
},
},
@ -957,7 +962,7 @@
globalCoord: false,
},
],
data: [value5, value5,value5], // data个数代表波浪数
data: [value4, value4, value4], // data个数代表波浪数
backgroundStyle: {
borderWidth: 1,
color: 'RGBA(51, 66, 127, 0.7)',
@ -974,8 +979,8 @@
// show: false
borderDistance: 0,
itemStyle: {
borderWidth: 2,
borderColor: '#112165',
borderWidth: 6,
borderColor: '#08bbc9',
},
},
},
@ -1063,7 +1068,7 @@
//区域四
function GetArea4() {
// 基于准备好的dom,初始化echarts实例
var MonthArray = new Array();
var MonthNum = new Array();
var MonthPercent_BZ = new Array();
@ -1074,8 +1079,9 @@
async: false,
success: function (data) {
if (data != false && data != null && data.length > 0) {
console.log(data);
for (var i = 6; i < data.length; i++) {
for (var i = 0; i < data.length; i++) {
//console.log(i);
MonthArray.push(data[i].Mont);
MonthNum.push(data[i].num);
@ -1114,21 +1120,27 @@
},
max: 20
},
series: [
{
data: MonthNum,
type: 'line',
lineStyle: {
color: 'skyblue'
},
markPoint: {
data: [
{ type: 'max', name: '最大值' },
{ type: 'min', name: '最小值' }
]
}
}
]
series: [{
data: MonthNum,
type: 'line',
lineStyle: {
color: 'skyblue',
width: 3 // 设置线条宽度为2
},
areaStyle: {
color: 'rgba(240, 240, 240, 0.3)' // 设置曲线下部区域为30%透明度的白灰色
},
markPoint: {
data: [
{ type: 'max', name: '最大值' },
{ type: 'min', name: '最小值' }
]
},
itemStyle: {
color: 'skyblue'
},
animation: true // 开启动画效果
}]
};
@ -1185,23 +1197,24 @@
async: false,
success: function (data) {
if (data != false && data != null) {
//序号 生产编号 产品名称 用户单位 客户交货期 生产状态 生产进度
var html = "";
for (var i = 0; i < data.length; i++) {
html += ' <ul class="ul_con"> ';
html += ' <li >' + data[i].序号 + '</li> ';
html += ' <li >' + data[i].销售车辆号 + '</li> <li >' + data[i].产品名称 + '</li> <li >' + data[i].用户单位 +'</li>';
html += ' <li >' + data[i].客户交货期 + '</li> <li >' + data[i].生产状态 + '</li>';
html += ' <li >' + data[i].进度 + '</li> </ul> ';
html += '<ul class="ul_con">';
html += '<li>' + data[i].序号 + '</li>';
html += '<li>' + data[i].销售车辆号 + '</li><li>' + data[i].产品名称 + '</li><li>' + data[i].用户单位 + '</li>';
html += '<li>' + data[i].客户交货期 + '</li><li>' + data[i].生产状态 + '</li>';
html += '<li>' + data[i].进度 + '</li></ul>';
}
html += "</ul>";
$("#" + marqueeID).html(html);
// Set background color of odd-indexed ul elements to black
$("#" + marqueeID + " ul:nth-child(odd)").css("background-color", "rgba(0, 1, 0, 0.1)");
} else {
$("#" + marqueeID).html("");
}
},
error: function (aa) {
// Handle error
}
});
}

Loading…
Cancel
Save