Commit f331cb62 authored by 李苏's avatar 李苏 💬

大屏api对接1

parent 0236b79c
/* 获取真实数据 */
//时段产量
function apisetTimeProductionEchart(myChartSdcl){
HTTP.post("querySdcl", {}, function(result) {
if (result['success']) {
let data={}
data.xseriesList=result.data.records.xseriesList||[]
data.timeperiodMount=result.data.records.timeperiodMount||[]
setTimeProductionEchart(myChartSdcl,data); /*时段产量*/
} else {
console.log("请求失败")
}
});
}
//日排产
function apisetDailyDataEchart(chartRpcdcsj){
HTTP.post("queryWeekPcsl", {}, function(result) {
if (result['success']) {
let data=result.data.records
data.forEach(function(e,index){
data[index].jhrq=new Date(e.pcrq).toLocaleDateString().split('/').join('-')
})
setDailyDataEchart(chartRpcdcsj,data); /*日排产达成数据*/
} else {
console.log("请求失败")
}
});
}
//日计划
function apisetPieDailyChart(chartRjh){
HTTP.post("queryTodayPcsl", {}, function(result) {
if (result['success']) {
let data=result.data.records
let bfb
if(!data.wgsl){
data.wgsl=0
}
if(!data.jhsl){
data.jhsl=0
bfb=0
}
else{
bfb=(data.wgsl/data.jhsl)*100
bfb=bfb.toFixed(2)
}
$("#rjhs").text(data.jhsl)
$("#rwgs").text(data.wgsl)
setPieDailyChart(chartRjh,bfb,data);/*日计划*/
} else {
console.log("请求失败")
}
});
}
//月计划数量
function apisetPieDailyCharty(chartYjh){
HTTP.post("queryMonthPcsl", {}, function(result) {
if (result['success']) {
let data=result.data.records
let bfb
if(!data.wgsl){
data.wgsl=0
}
if(!data.jhsl){
data.jhsl=0
bfb=0
}
else{
bfb=(data.wgsl/data.jhsl)*100
bfb=bfb.toFixed(2)
}
$("#yjhs").text(data.jhsl)
$("#ywgs").text(data.wgsl)
setPieDailyChart(chartYjh,bfb,data);/*日计划*/
} else {
console.log("请求失败")
}
});
}
// 合格率
function apisetHglEchart(chartHgl){
HTTP.post("queryGpfkHgl", {}, function(result) {
if (result['success']) {
let data=result.data.records
result.data.records.forEach(function(e,index){
data[index].fkrq=new Date(e.fkrq).toLocaleDateString().split('/').join('-')
if(e.fksl==0){
data[index].hgl=0
}else{
let hgl=(e.hgsl/e.fksl)*100
hgl=hgl.toFixed(2)
data[index].hgl=hgl
}
})
setHglEchart(chartHgl,data);/*合格率*/
} else {
console.log("请求失败")
}
});
}
//生成进度跟进
function apiqueryWo(){
let allwglHtml=""
HTTP.post("queryWo", {}, function(result) {
if (result['success']) {
let data=result.data.records
data.forEach(function(e,index){
let xh=index+1
let djid=e.djid
let wlxxCode=e.wlxxCode
let wlxxName=e.wlxxName
let wgsl=e.wgsl
let pcsl=e.pcsl
let ywrq=new Date(e.ywrq).toLocaleDateString().split('/').join('-')
let dcl
if(pcsl==0){
dcl=0
}else{
dcl=(wgsl/pcsl)*100
dcl=dcl.toFixed(2)+"%"
}
let wglHtml=" <li>"+
"<div class=\"fontInner clearfix\">"+
"<span>"+
"<b>"+xh+"</b>"+
"</span>"+
"<span>"+djid+"</span>"+
"<span>"+wlxxCode+"</span>"+
"<span>"+wlxxName+"</span>"+
"<span>"+pcsl+"</span>"+
"<span>"+wgsl+"</span>"+
"<span>"+ywrq+"</span>"+
"<span>"+dcl+"</span>"+
"</div>"+
"</li>";
allwglHtml=allwglHtml+wglHtml
})
$("#FontScroll ul").html(allwglHtml)
} else {
console.log("请求失败")
}
});
}
/* 静电手环 */
function apiqueryringpoint(){
let $point=$(".allnav-right ul li").children()
let $point1=$(".allnav-right ul li>div").children()
console.log($point)
HTTP.post("/mes/kmes/point/queryringpoint", {}, function(result) {
if (result['success']) {
let data=result.data.records
data.forEach(function(e,index){
if(e.value==0){
$($point[index]).css("background-color","greenyellow");
}else if(e.value==1){
$($point[index]).css("background-color","red");
}else{
$($point[index]).css("background-color","skyblue");
}
$($point1[index]).html(e.itemId)
})
} else {
console.log("请求失败")
}
});
}
/* 日排除合格率 */
function apisetRpcHglEchart(chartHgl){
function gethgl(){
return new Promise(function(y,n){
HTTP.post("queryGpfkHgl", {}, function(result) {
if (result['success']) {
let data=result.data.records
result.data.records.forEach(function(e,index){
data[index].fkrq=new Date(e.fkrq).toLocaleDateString().split('/').join('-')
if(e.fksl==0){
data[index].hgl=0
}else{
let hgl=(e.hgsl/e.fksl)*100
hgl=hgl.toFixed(2)
data[index].hgl=hgl
}
y(data)
})
} else {
n("请求失败")
}
});
})
}
gethgl().then(function(ye){
HTTP.post("queryWeekPcsl", {}, function(result) {
if (result['success']) {
let data=result.data.records
data.forEach(function(e,index){
data[index].jhrq=new Date(e.pcrq).toLocaleDateString().split('/').join('-')
})
setRpcHglEchart(chartHgl,ye,data)
} else {
console.log("请求失败")
}
});
}).catch(function(e){
console.log(e||"请求失败")
})
}
function apiqueryWorkingWO(){
HTTP.post("queryWorkingWO", {}, function(result) {
if (result['success']) {
let data=result.data.records
$("#djid").text(data.djid||"请求失败")
$("#wlxxName").text(data.wlxxName||"请求失败")
$("#xqsl").text(data.xqsl||"请求失败")
$("#ywrq").text(new Date(data.ywrq).toLocaleDateString().split('/').join('-')||"请求失败")
$("#bz").text(data.bz||"无")
} else {
console.log("请求失败")
}
});
}
\ No newline at end of file
......@@ -1939,7 +1939,14 @@ $(function () {
});
/*时段产量图表*/
function setTimeProductionEchart(chart) {
function setTimeProductionEchart(chart,apidata) {
if(apidata){
var list=[]
apidata.xseriesList.forEach(function(e,index){
list[index]={date:e,value:apidata.timeperiodMount[index]}
})
var data=[{name: "产量",list:list}]
}else{
var data = [
{
name: "产量",
......@@ -1974,6 +1981,7 @@ function setTimeProductionEchart(chart) {
]
}
];
}
var dateList=[];
var yData1 = [];
data[0].list.forEach(function(item,index){
......@@ -1981,6 +1989,7 @@ function setTimeProductionEchart(chart) {
yData1.push(data[0].list[index].value);
});
var opsChart={
color: ['#e08f68'],
tooltip: {
trigger: 'axis',
......@@ -2013,6 +2022,7 @@ function setTimeProductionEchart(chart) {
type: 'category',
data: dateList,
axisLabel: {
interval: 4,
tooltip: {
show: true,
},
......@@ -2020,7 +2030,6 @@ function setTimeProductionEchart(chart) {
textStyle: {
fontSize: 14
},
interval: 0,
color: 'rgba(255,255,255,0.6)'
},
axisTick: {
......@@ -2093,7 +2102,25 @@ function setTimeProductionEchart(chart) {
}
/*日排产达成数据*/
function setDailyDataEchart(chart) {
function setDailyDataEchart(chart,apidata) {
let datelist=[]
let jslist=[]
let wglist=[]
if(apidata){
apidata.forEach(function(e,index){
datelist[index]=e.jhrq
})
}
if(apidata){
apidata.forEach(function(e,index){
jslist[index]=e.jhsl
})
}
if(apidata){
apidata.forEach(function(e,index){
wglist[index]=e.wgsl
})
}
var ops= {
color:["#67c23a","#409eff"],
tooltip: {
......@@ -2118,7 +2145,7 @@ function setDailyDataEchart(chart) {
xAxis: [
{
type: 'category',
data: ['1/01', '1/02', '1/03', '1/04', '1/05', '1/06', '1/07'],
data: datelist||['1/01', '1/02', '1/03', '1/04', '1/05', '1/06', '1/07'],
axisTick:{
show:true,
lineStyle:{
......@@ -2163,7 +2190,7 @@ function setDailyDataEchart(chart) {
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 90, 230, 210]
data: jslist||[120, 132, 101, 134, 90, 230, 210]
},
{
name: '完工',
......@@ -2172,7 +2199,7 @@ function setDailyDataEchart(chart) {
emphasis: {
focus: 'series'
},
data: [220, 182, 191, 234, 290, 330, 310]
data: wglist||[220, 182, 191, 234, 290, 330, 310]
}
]
};
......@@ -2182,12 +2209,20 @@ function setDailyDataEchart(chart) {
/*合格率*/
function setHglEchart(chart) {
function setHglEchart(chart,apidata) {
let datelist=[]
let hgllist=[]
if(apidata){
apidata.forEach(function(e){
datelist.push(e.fkrq)
hgllist.push(e.hgl)
})
}
var ops= {
color:["#409eff"],
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data:datelist|| ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick:{
show:true,
lineStyle:{
......@@ -2223,7 +2258,7 @@ function setHglEchart(chart) {
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
data:hgllist|| [150, 230, 224, 218, 135, 147, 260],
type: 'line',
itemStyle : { normal: {label : {show: true}}}
}
......@@ -2232,7 +2267,13 @@ function setHglEchart(chart) {
chart.setOption(ops,true);
}
function setPieDailyChart(chart,cerpent) {
function setPieDailyChart(chart,cerpent,pdata) {
let apidata={}
apidata.jhsl=0
apidata.wgsl=0
if(pdata){
apidata=pdata
}
var ops= {
color:["#A2E9FF","#409eff"],
tooltip: {
......@@ -2274,8 +2315,8 @@ function setPieDailyChart(chart,cerpent) {
}
},
data: [
{ value: 20, name: '未完工'},
{ value: 80, name: '完工' },
{ value: (apidata.jhsl-apidata.wgsl)||0, name: '未完工'},
{ value: apidata.wgsl||0, name: '完工' },
]
}
]
......@@ -2283,7 +2324,21 @@ function setPieDailyChart(chart,cerpent) {
chart.setOption(ops,true);
}
function setRpcHglEchart(chart) {
function setRpcHglEchart(chart,apidata1,apidata2) {
let datelist=[]
let hgllist=[]
let jslist=[]
let wglist=[]
if(apidata1&&apidata2){
apidata1.forEach(function(e){
datelist.push(e.fkrq)
hgllist.push(e.hgl)
})
apidata2.forEach(function(e){
jslist.push(e.jhsl)
wglist.push(e.wgsl)
})
}
var ops = {
color:["#409eff","#ffd03e"],
// tooltip: {
......@@ -2310,7 +2365,7 @@ function setRpcHglEchart(chart) {
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
data: datelist||['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
axisPointer: {
type: 'shadow'
},
......@@ -2399,7 +2454,7 @@ function setRpcHglEchart(chart) {
{
name: '计划',
type: 'bar',
data: [
data: jslist||[
2.6, 5.9, 9.0, 26.4, 28.7,
],
barWidth : 30,
......@@ -2421,7 +2476,7 @@ function setRpcHglEchart(chart) {
name: '合格率',
type: 'line',
yAxisIndex: 1,
data: [20,30,90,30,29],
data: hgllist||[20,30,90,30,29],
itemStyle:{
normal:{
label:{
......
......@@ -6,6 +6,20 @@
<link rel="stylesheet" href="../../css/dashboard/wodry.css">
<link rel="stylesheet" href="../../css/dashboard/index.css">
<link rel="stylesheet" href="../../css/dashboard/public.css">
<style type="text/css">
.allnav-circle li{
width: 32%!important;
}
.in{
text-align: center;
}
.in::before{
display: inline-block;
content: "";
height: 100%;
vertical-align: middle;
}
</style>
</head>
<body>
......@@ -53,10 +67,6 @@
<span class="circle circle-small circle-close"></span>
<span>关闭</span>
</li>
<li>
<span class="circle circle-small circle-offine"></span>
<span>离线</span>
</li>
<li>
<span class="circle circle-small circle-info"></span>
<span>警告</span>
......@@ -83,11 +93,9 @@
<div class="center-cen fl">
<div class="cen-top rightTop border">
<video width="100%" height="100%" controls id="firstVideo" autoplay="autoplay" muted>
<source src="https://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4">
<!-- <source src="http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4.ogg" type="video/ogg">-->
<!-- <source src="http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4.webm" type="video/webm">-->
<object data="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<embed src="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<source src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" type="video/mp4">
<object data="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
<embed src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
</object>
</video>
</div>
......@@ -255,8 +263,8 @@
<div id="chartRjh" class="allnav"></div>
</div>
<div style="position: absolute;bottom: 0;right: 0;left: 0;text-align: center">
<div>日计划数:<span>100</span></div>
<div>日完工数:<span>80</span></div>
<div>日计划数:<span id="rjhs">100</span></div>
<div>日完工数:<span id="rwgs">80</span></div>
</div>
</li>
<li style="float: left;width: 50%;height: 100%;position: relative;overflow:hidden;">
......@@ -264,8 +272,8 @@
<div id="chartYjh" class="allnav"></div>
</div>
<div style="position: absolute;bottom: 0;right: 0;left: 0;text-align: center">
<div>月计划数:<span>3000</span></div>
<div>月完工数:<span>2400</span></div>
<div>月计划数:<span id="yjhs">3000</span></div>
<div>月完工数:<span id="ywgs">2400</span></div>
</div>
</li>
</ul>
......@@ -281,7 +289,7 @@
<div class="right-bottom rightTop border">
<div class="title">工艺流程图</div>
<div class="chat">
<img src="../../images/dashboard/gylc.png" alt="" style="width: 100%;height: 100%">
<canvas id="gylct" style="width: 100%;height: 100%"></canvas>
</div>
</div>
</div>
......@@ -291,10 +299,16 @@
<script language="JavaScript" type="text/javascript" src="../../lib/easyui/jquery.min.js" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript" src="../../lib/gui/static/plugins/echarts/echarts.min.js"></script>
<script language="JavaScript" type="text/javascript" src="/mes/js/common/http.js"></script>
<!--PDf在线预览-->
<script language="JavaScript" type="text/javascript" src="../../lib/pdfjs/build/pdf.js"></script>
<script language="JavaScript" type="text/javascript" src="../../lib/pdfjs/web/viewer.js"></script>
<script src="../../js/dashboard/wodry.min.js"></script>
<script src="../../js/dashboard/fontscroll.js"></script>
<script src="../../js/dashboard/echarts.js"></script>
<script src="/mes/js/pdfshow.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/dashboard/api.js"></script>
<!--<script src="js/mymap.js"></script>-->
<script>
......@@ -305,7 +319,6 @@
var whei = $(window).width();
$("html").css({ fontSize: whei / 22 })
});
var myChartSdcl = echarts.init(document.getElementById('chartSdcl'));
var chartRpcdcsj=echarts.init(document.getElementById("chartRpcdcsj"));
var chartHgl=echarts.init(document.getElementById("chartHgl"));
......@@ -314,15 +327,31 @@
var chartJdshCirle=$("#chartJdshCirle");
setTimeProductionEchart(myChartSdcl); /*时段产量*/
setDailyDataEchart(chartRpcdcsj); /*日排产达成数据*/
setHglEchart(chartHgl);/*合格率*/
// setHglEchart(chartHgl);/*合格率*/
setPieDailyChart(chartRjh,80);/*日计划*/
setPieDailyChart(chartYjh);
setPieDailyChart(chartYjh,80);
$('.myscroll').myScroll({
speed: 60, //数值越大,速度越慢
rowHeight: 46 //li的高度
});
/* 调用 */
pdfshow("D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\pdf\\dashboard.pdf","gylct",20000)
function getAlldata(){
apisetTimeProductionEchart(myChartSdcl)
apisetDailyDataEchart(chartRpcdcsj)
apisetPieDailyChart(chartRjh)
apisetPieDailyCharty(chartYjh)
apisetHglEchart(chartHgl)
apiqueryWo()
apiqueryringpoint()
}
getAlldata()
setInterval(function(){
getAlldata()
},1000*60*5)
});
</script>
<script>
//顶部时间
......
......@@ -6,6 +6,32 @@
<link rel="stylesheet" href="../../css/dashboard/wodry.css">
<link rel="stylesheet" href="../../css/dashboard/index.css">
<link rel="stylesheet" href="../../css/dashboard/public.css">
<style type="text/css">
.allnav-circle li{
width: 32%!important;
}
.in{
text-align: center;
}
.in::before{
display: inline-block;
content: "";
height: 100%;
vertical-align: middle;
}
.listTxt{
display: flex;
flex-wrap: wrap;
align-items: center;
}
.listTxt p{
/* flex: 1; */
width: 50%;
}
.listTxt label{
width: auto!important;
}
</style>
</head>
<body>
......@@ -27,18 +53,18 @@
<div class="center-left fl" style="width: 33.3%">
<div class="left-top rightTop border">
<video width="100%" height="100%" controls id="firstVideo" autoplay="autoplay" muted>
<source src="https://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4">
<source src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" type="video/mp4">
<!-- <source src="http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4.ogg" type="video/ogg">-->
<!-- <source src="http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4.webm" type="video/webm">-->
<object data="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<embed src="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<object data="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
<embed src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
</object>
</video>
</div>
<div class="left-cen rightTop border">
<div class="title">工艺流程图</div>
<div class="bottom-b">
<img src="../../images/dashboard/gylc.png" alt="" style="width: 100%;height: 100%">
<canvas id="gylct" style="width: 100%;height: 100%"></canvas>
</div>
</div>
<div class="left-bottom rightTop border">
......@@ -68,10 +94,6 @@
<span class="circle circle-small circle-offine"></span>
<span>离线</span>
</li>
<li>
<span class="circle circle-small circle-info"></span>
<span>警告</span>
</li>
</ul>
</div>
<div class="allnav-right">
......@@ -244,11 +266,11 @@
<div class="allnav banner">
<div class="list clearfix">
<div class="listTxt">
<p><label>在制订单:</label> <span>11213131</span></p>
<p><label for="">订单数:</label><span>5000</span></p>
<p><label for="">订单日期:</label><span>2022-02-23</span> </p>
<p><label for="">产品名称:</label><span>电子产品、手机、电脑</span></p>
<p><label for="">备注:</label><span>全国 </span></p>
<p><label>在制订单:</label> <span id="djid">11213131</span></p>
<p><label for="">订单数:</label><span id="xqsl">5000</span></p>
<p><label for="">订单日期:</label><span id="ywrq">2022-02-23</span> </p>
<p><label for="">产品名称:</label><span id="wlxxName">电子产品、手机、电脑</span></p>
<p><label for="">备注:</label><span id="bz">全国 </span></p>
</div>
</div>
</div>
......@@ -305,9 +327,15 @@
<script language="JavaScript" type="text/javascript" src="../../lib/easyui/jquery.min.js" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript" src="../../lib/gui/static/plugins/echarts/echarts.min.js"></script>
<script language="JavaScript" type="text/javascript" src="/mes/js/common/http.js"></script>
<!--PDf在线预览-->
<script language="JavaScript" type="text/javascript" src="../../lib/pdfjs/build/pdf.js"></script>
<script language="JavaScript" type="text/javascript" src="../../lib/pdfjs/web/viewer.js"></script>
<script src="../../js/dashboard/wodry.min.js"></script>
<script src="../../js/dashboard/fontscroll.js"></script>
<script src="../../js/dashboard/echarts.js"></script>
<script src="/mes/js/pdfshow.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/dashboard/api.js"></script>
<!--<script src="js/mymap.js"></script>-->
......@@ -335,6 +363,24 @@
speed: 60, //数值越大,速度越慢
rowHeight: 46 //li的高度
});
/* 调用 */
pdfshow("D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\pdf\\dashboard.pdf","gylct",20000)
/* */
function getAlldata(){
apisetTimeProductionEchart(myChartSdcl)
apisetDailyDataEchart(chartRpcdcsj)
apisetPieDailyChart(chartRjh)
apisetPieDailyCharty(chartYjh)
apisetHglEchart(chartHgl)
apiqueryWo()
apiqueryringpoint()
apiqueryWorkingWO()
}
apiqueryWorkingWO()
getAlldata()
setInterval(function(){
getAlldata()
},1000*60*5)
});
</script>
<script>
......
......@@ -27,9 +27,9 @@
<div class="center-cen fl">
<div class="cen-top rightTop border">
<video width="100%" height="100%" controls id="firstVideo" autoplay="autoplay" muted>
<source src="https://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4">
<object data="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<embed src="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<source src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" type="video/mp4">
<object data="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
<embed src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
</object>
</video>
</div>
......@@ -202,8 +202,8 @@
<div id="chartRjh" class="allnav"></div>
</div>
<div style="position: absolute;bottom: 0;right: 0;left: 0;text-align: center">
<div>日计划数:<span>100</span></div>
<div>日完工数:<span>80</span></div>
<div>日计划数:<span id="rjhs">100</span></div>
<div>日完工数:<span id="rwgs">80</span></div>
</div>
</li>
<li style="float: left;width: 50%;height: 100%;position: relative;overflow:hidden;">
......@@ -211,8 +211,8 @@
<div id="chartYjh" class="allnav"></div>
</div>
<div style="position: absolute;bottom: 0;right: 0;left: 0;text-align: center">
<div>月计划数:<span>3000</span></div>
<div>月完工数:<span>2400</span></div>
<div>月计划数:<span id="yjhs">3000</span></div>
<div>月完工数:<span id="ywgs">2400</span></div>
</div>
</li>
</ul>
......@@ -238,9 +238,11 @@
<script language="JavaScript" type="text/javascript" src="../../lib/easyui/jquery.min.js" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript" src="../../lib/gui/static/plugins/echarts/echarts.min.js"></script>
<script language="JavaScript" type="text/javascript" src="/mes/js/common/http.js"></script>
<script src="../../js/dashboard/wodry.min.js"></script>
<script src="../../js/dashboard/fontscroll.js"></script>
<script src="../../js/dashboard/echarts.js"></script>
<script src="../../js/dashboard/api.js"></script>
<!--<script src="js/mymap.js"></script>-->
......@@ -268,6 +270,18 @@
speed: 60, //数值越大,速度越慢
rowHeight: 46 //li的高度
});
function getAlldata(){
apisetTimeProductionEchart(myChartSdcl)
apisetDailyDataEchart(chartRpcdcsj)
apisetPieDailyChart(chartRjh)
apisetPieDailyCharty(chartYjh)
apisetHglEchart(chartHgl)
apiqueryWo()
}
getAlldata()
setInterval(function(){
getAlldata()
},1000*60*5)
});
</script>
<script>
......
......@@ -6,6 +6,20 @@
<link rel="stylesheet" href="../../css/dashboard/wodry.css">
<link rel="stylesheet" href="../../css/dashboard/index.css">
<link rel="stylesheet" href="../../css/dashboard/public.css">
<style type="text/css">
.allnav-circle li{
width: 32%!important;
}
.in{
text-align: center;
}
.in::before{
display: inline-block;
content: "";
height: 100%;
vertical-align: middle;
}
</style>
</head>
<body>
......@@ -189,10 +203,6 @@
<span class="circle circle-small circle-close"></span>
<span>关闭</span>
</li>
<li>
<span class="circle circle-small circle-offine"></span>
<span>离线</span>
</li>
<li>
<span class="circle circle-small circle-info"></span>
<span>警告</span>
......@@ -224,9 +234,9 @@
<div class="center-cen fr" style="width: 60%">
<div class="cen-top rightTop border">
<video width="100%" height="100%" controls id="firstVideo" autoplay="autoplay" muted>
<source src="https://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4">
<object data="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<embed src="https://media.w3.org/2010/05/sintel/trailer.mp4" width="100%" height="100%">
<source src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" type="video/mp4">
<object data="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
<embed src="D:\\projectinfo\\kwell-mes\\gavel\\src\\main\\resources\\static\\video\\dashboard.mp4" width="100%" height="100%">
</object>
</video>
</div>
......@@ -245,8 +255,8 @@
<div id="chartRjh" class="allnav"></div>
</div>
<div style="position: absolute;bottom: 0;right: 0;left: 0;text-align: center">
<div>日计划数:<span>100</span></div>
<div>日完工数:<span>80</span></div>
<div>日计划数:<span id="rjhs">100</span></div>
<div>日完工数:<span id="rwgs">80</span></div>
</div>
</li>
<li style="float: left;width: 50%;height: 100%;position: relative;overflow:hidden;">
......@@ -254,8 +264,8 @@
<div id="chartYjh" class="allnav"></div>
</div>
<div style="position: absolute;bottom: 0;right: 0;left: 0;text-align: center">
<div>月计划数:<span>3000</span></div>
<div>月完工数:<span>2400</span></div>
<div>月计划数:<span id="yjhs">3000</span></div>
<div>月完工数:<span id="ywgs">2400</span></div>
</div>
</li>
</ul>
......@@ -269,9 +279,11 @@
<script language="JavaScript" type="text/javascript" src="../../lib/easyui/jquery.min.js" charset="utf-8"></script>
<script language="JavaScript" type="text/javascript" src="../../lib/gui/static/plugins/echarts/echarts.min.js"></script>
<script language="JavaScript" type="text/javascript" src="/mes/js/common/http.js"></script>
<script src="../../js/dashboard/wodry.min.js"></script>
<script src="../../js/dashboard/fontscroll.js"></script>
<script src="../../js/dashboard/echarts.js"></script>
<script src="../../js/dashboard/api.js"></script>
<!--<script src="js/mymap.js"></script>-->
......@@ -297,6 +309,20 @@
speed: 60, //数值越大,速度越慢
rowHeight: 46 //li的高度
});
/* 分割线 */
function getAlldata(){
apisetTimeProductionEchart(myChartSdcl)
apisetPieDailyChart(chartRjh)
apisetPieDailyCharty(chartYjh)
apisetRpcHglEchart(chartHgl)
apiqueryWo()
apiqueryringpoint()
}
getAlldata()
setInterval(function(){
getAlldata()
},1000*60*5)
});
</script>
<script>
......
<div id="bhgXqEdit" class="e-dialog-container" data-options="width:700,height:270">
<div class="e-dialog-body">
<div class="list" style="height: 100%"></div>
</div>
</div>
<div class="e-dialog-footer">
<a href="javascript:void(0);" class="e-dialog-cancel"></a>
</div>
</div>
<script>
$(function () {
var $dialog=$('#bhgXqEdit');
var res=[
{value:"1",text:"异物"},
{value:"2",text:"毛屑"},
{value:"3",text:"赃污"},
{value:"4",text:"划伤"},
{value:"5",text:"黑白影"},
{value:"6",text:"亮点"},
{value:"7",text:"漏光"},
{value:"8",text:"白点"},
{value:"9",text:"画面发暗"},
{value:"10",text:"压伤"},
{value:"11",text:"顶白"},
{value:"12",text:"嵌合不良"},
{value:"13",text:"标签外观不良"},
{value:"14",text:"FLIM组装不良"},
{value:"15",text:"FLIM多少组"},
{value:"16",text:"S/T不良"},
{value:"17",text:"L/B外观不良"},
{value:"18",text:"胶框外观不良"},
{value:"19",text:"扣点外观不良"},
{value:"20",text:"框线"},
{value:"21",text:"厚度NG"},
{value:"22",text:"其他"},
];
$dialog.find(".list").datalist({
valueField:"value",
textField:"text",
data:res
})
})
</script>
\ No newline at end of file
<div id="bhgXqGpwx" class="e-dialog-container" data-options="width:700,height:270">
<div class="e-dialog-body">
<div class="list" style="height: 100%"></div>
</div>
</div>
<div class="e-dialog-footer">
<a href="javascript:void(0);" class="e-dialog-cancel"></a>
</div>
</div>
<script>
$(function () {
var $dialog=$('#bhgXqGpwx');
var $fieldView=$dialog.find(".list");
var parmas=$dialog.parents("form").dialog("options").queryParams;
var columnsXm=[
{title: "序号", field: "xh", width: 50, align: "center"},
{title: "检验项目ID", field: "jyxmid", fieldType: "ftString", hidden: true},
{title: "检验项目编码", field: "jyxmcode", width: 120},
{title: "检验项目名称", field: "jyxmname",fieldType: "ftString", width: 140},
{title: "检验值", field: "jyz", width:120,},
];
$fieldView.datagrid({
title:"不合格项",
columns:[new $.common.formatterCol(columnsXm)],
pagination:false,
fitColumns:true,
scrollbarSize:0,
});
HTTP.post("/kmes/gpwx/getBhgJymx",{wosnid:parmas.wosnid||""},function (res) {
if(res.success){
$fieldView.datagrid("loadData",res.data.records||[])
}
})
})
</script>
\ No newline at end of file
<style>
#kmesGpwx .search-box-main{
margin: 10px auto;
}
#kmesGpwx .search-box-main .left{
padding-left: 8px;
font-weight: 700;
color: #666;
}
#kmesGpwx .e-dialog-body .textbox{
border: 1px solid #D3D3D3;
}
.kmesGpwx-box{
padding:0 0 0 20px;
}
.kmesGpwx-box .kmesGpwx-box1{
height: 100px;
text-align: center;
}
.kmesGpwx-box-label{
font-size: 18px;
font-family: "Microsoft YaHei", Arial, sans-serif;
font-weight: 500;
}
.kmesGpwx-contianer{
border: 1px solid #D3D3D3;height: 100%;
position: relative;
}
.kmesGpwx-box2{
transform: translate(-50%,-50%);
position: absolute;
left: 50%;
top: 20%;
}
.kmesGpwx-box3{
transform: translate(-50%,-50%);
position: absolute;
left: 50%;
top: 60%;
}
#kmesGpwxEdit_list{
max-height: 92px;
overflow-y: auto;
}
#kmesGpwxEdit_list label{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
width:64%;
}
.wxsh .textbox textarea.textbox-text{
border: 1px solid #D3D3D3;
}
.kmesGpwx-box1{
float: left;
width: 33%;
}
.toolbar-init .l-btn-text{
line-height: 48px!important;
padding: 0 10px;
font-size: 14px;
}
.toolbar-init{
height: 48px!important;
}
#kmesGpwxEdit .e-dialog-footer a{
height: 60px!important;
}
</style>
<div class="e-dialog-container" data-options="width:960,height:640" id="kmesGpwxEdit">
<div class="e-dialog-body">
<div style="width: 100%;height: 100%;overflow:hidden;position: relative">
<div class="e-dialog-form" style="background: aliceblue;margin: 10px 0" id="kmesGpwx_form1">
<div class="gui-row" >
<div class="gui-col-sm4">
<label class="gui-form-label">工序:</label>
<div class="gui-input-block">
<input type="text" name="gxid" data-toggle="gui-textbox" readonly>
</div>
</div>
<div class="gui-col-sm4">
<label class="gui-form-label">工作中心:</label>
<div class="gui-input-block">
<input type="text" name="gzzxid" data-toggle="gui-textbox" readonly>
</div>
</div>
<div class="gui-col-sm4">
<label class="gui-form-label">人员:</label>
<div class="gui-input-block">
<input type="text" name="fkrid" data-toggle="gui-textbox" data-options="" readonly>
</div>
</div>
</div>
</div>
<div class="mx-dataTable" style=" margin-top: 82px; bottom: 10px;">
<div class="gui-layout" style="width: 100%;height: 100%;" id="kmesJggdfLayout">
<div data-options="region:'west',split:true" style="width: 50%;padding: 10px">
<div class="search-box-main">
<div class="left">条码:</div>
<div class="right" style="">
<a id="gpwxsearchBtn" class="auxiliary-icon l-btn l-btn-small l-btn-plain" href="javascript:void(0)" style="height: 40px;background-color: #3c8dbc; padding: 5px 8px;color: white">
<span class="l-btn-left l-btn-icon-left" style=""><span class="l-btn-text">搜索</span>
<span class="l-btn-icon fa fa-check"></span></span>
</a>
</div>
<div class="clear"></div>
<div class="center">
<input class="gui-searchbox keyword" name="wosnid" id="gpwx_input" style="width: 100%"/></div>
</div>
<div class="e-dialog-form" id="gpwx_form">
<div class="gui-row" >
<div class="gui-col-sm6">
<label class="gui-form-label" style="text-align: left;font-weight: 700;">产品信息</label>
</div>
</div>
<div class="gui-row" >
<div class="gui-col-sm6">
<label class="gui-form-label">产品条码:</label>
<div class="gui-input-block">
<input type="text" name="cptm" data-toggle="gui-textbox" readonly>
</div>
</div>
<div class="gui-col-sm6">
<label class="gui-form-label">物料编码:</label>
<div class="gui-input-block">
<input type="text" name="wlxxCode" data-toggle="gui-textbox" readonly>
</div>
</div>
</div>
<div class="gui-row" >
<div class="gui-col-sm6">
<label class="gui-form-label">物料名称:</label>
<div class="gui-input-block">
<input type="text" name="wlxxName" data-toggle="gui-textbox" data-options="" readonly>
</div>
</div>
<div class="gui-col-sm6">
<label class="gui-form-label">规格型号:</label>
<div class="gui-input-block">
<input type="text" name="wlxxGg" data-toggle="gui-textbox" data-options="" readonly>
</div>
</div>
</div>
<div class="gui-row" >
<div class="gui-col-sm6">
<label class="gui-form-label">机种:</label>
<div class="gui-input-block">
<input type="text" name="jzname" data-toggle="gui-textbox" readonly>
</div>
</div>
<div class="gui-col-sm6">
<label class="gui-form-label">生产工单:</label>
<div class="gui-input-block">
<input type="text" name="djid" data-toggle="gui-textbox" readonly >
</div>
</div>
</div>
</div>
<div style="padding:0 10px;margin-top: 250px;position: absolute;bottom: 20px;left: 0;top: 0;width: 100%">
<div style="width: 100%;position: absolute;bottom: 114px;left: 0; top: 0;padding: 0 20px;">
<div class="e-dialog-terminal" >
<div class="terminal" id="gpwx_log">
<div class="log" style="height: 100%;"></div>
</div>
</div>
</div>
<div class="kmesGpwx-box" style="position: absolute;bottom: 0;width: 100%;left:0;right: 0 ">
<div class="kmesGpwx-box1" style="">
<div class="kmesGpwx-contianer">
<div class="kmesGpwx-box-label kmesGpwx-box2">完工数量</div>
<div class="kmesGpwx-box3 count-title">0</div>
</div>
</div>
<div class="kmesGpwx-box1" style="">
<div class="kmesGpwx-contianer">
<div class="kmesGpwx-box-label kmesGpwx-box2">合格数量</div>
<div class="kmesGpwx-box3 count-title">0</div>
</div>
</div>
<div class="kmesGpwx-box1" >
<div class="kmesGpwx-contianer">
<div class="kmesGpwx-box-label kmesGpwx-box2">报废数量</div>
<div class="kmesGpwx-box3 count-title">0</div>
</div>
</div>
</div>
</div>
</div>
<div data-options="region:'center',split:true" style="">
<div style="height: 30%;border: 1px solid #D3D3D3">
<div id="kmesGpwxEdit_xm" style="width: 100%;height: 100%"></div>
</div>
<div style="height: 10%;">
<a href="javascript:void(0)" class="toolbar-init toolbar" id="chooseWxxm"></a>
<a href="javascript:void(0)" class="toolbar-init toolbar" id="deleteWxxm"></a>
<a href="javascript:void(0)" class="toolbar-init toolbar" id="reviewWxxm"></a>
</div>
<div style="height: 30%;border: 1px solid #D3D3D3">
<div id="kmesGpwxEdit_list" style="width: 100%;height: 100%"></div>
</div>
<div style="height: 10%;">
<a href="javascript:void(0)" class="toolbar-init toolbar" id="chooseBhgyy"></a>
<a href="javascript:void(0)" class="toolbar-init toolbar" id="gpwxSplit"></a>
</div>
<div style="height: 20%;">
<div style="width: 100%;height:100%;" class="wxsh">
<input type="text" name="bz" id="gpwx_bz" data-options="multiline:true,prompt:'在此输入维修说明'" data-toggle="gui-textarea" style="width: 100%;height:100%;">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ajax-mantle"></div>
</div>
<div class="e-dialog-footer" style="text-align: center" id="gpwx_btns" >
<a href="javascript:void(0);" class="e-dialog-save" style="padding: 4px 10px;height: 60px;margin-right: 60px"></a>
<a href="javascript:void(0);" class="e-dialog-reset" style="padding: 4px 10px;height: 60px;display: none" ></a>
</div>
</div>
<script>
$(function () {
var $dialog=$("#kmesGpwxEdit");
var $form=$("#gpwx_form");
var $list=$("#kmesGpwxEdit_list");
var $xmList=$("#kmesGpwxEdit_xm");
var $input=$("#gpwx_input");
var $bzInput=$("#gpwx_bz");
var $btns=$("#gpwx_btns");
var $log=$("#gpwx_log").find(".log");
var $chooseWxxm=$("#chooseWxxm");
var $deleteWxxm=$("#deleteWxxm");
var $chooseBhgyy=$("#chooseBhgyy");
var $splitBtn=$("#gpwxSplit");
var $reviewWxxm=$("#reviewWxxm");
var $searchbox=$("#gpwxsearchBtn");
var $shadow=$dialog.find(".ajax-mantle");
var ajaxFlag=true;
var $form1=$("#kmesGpwx_form1");
var woid="";
var numberBox1=$dialog.find(".kmesGpwx-box .kmesGpwx-box3").eq(0);
var numberBox2=$dialog.find(".kmesGpwx-box .kmesGpwx-box3").eq(1);
var numberBox3=$dialog.find(".kmesGpwx-box .kmesGpwx-box3").eq(2);
$shadow.hide();
var gphyVOList=[];
var topList=[];
var isHistory=true;
var parmas=$dialog.parents("form").dialog("options").queryParams;
var jyData={
gxid:parmas.gxid,
gxName:parmas.gxName,
gzzxid:parmas.gzzxid,
gzzxname:parmas.gzzxname,
fkrid:parmas.fkrid,
fkrName:parmas.fkrName,
fkbx:parmas.bxid
};
var wxxmVOList=[];
var woInfo={};var isFlag=0;
var wosnid='';
function paramInit(ops){
}
function pageInit() {
var columns = [
{field:"ck",checkbox:true},
{title: "xxid", field: "xxid",width:200,hidden:true},
{title: "维修说明", field: "bz",width:200},
{title: "不合格现象", field: "bhgxxCode",width:200,hidden:true},
{title: "不合格现象", field: "bhgxxName",width:200},
{title: "不合格数量", field: "bhgsl",width:100,fieldType: "int",hidden:true},
{title: "不合格原因ID", field: "yyid",width:100,hidden:true},
{title: "不合格原因", field: "bhgyy", width: 280,},
{title: "反馈工序", field: "fkgx",width:120,hidden:true},
{title: "反馈工序", field: "bzgxName",width:120},
{title: "反馈时间",field: "cjsj",fieldType:"ftDateTime"},
{title: "反馈人",field: "cjr",width:120},
];
var columnsXm=[
{title: "id", field: "id",width:200,hidden:true},
{title: "编码", field: "code",width:100},
{title: "维修项目", field: "name",width:200},
{title: "wxxmid", field: "wxxmid",width:200,hidden:true},
];
$list.DataTableEditing({
title:"不合格信息",
columns:[new $.common.formatterCol(columns)],
pagination:false,
allowAdd:false,
fitColumns:true,
scrollbarSize:0,
singleSelect:true,
checkOnSelect:true,
selectOnCheck:true,
data:[],
});
$xmList.DataTableEditing({
title:"维修项目",
columns:[new $.common.formatterCol(columnsXm)],
pagination:false,
allowAdd:false,
fitColumns:true,
scrollbarSize:0,
onClickCell:function (rowIndex, field, value) {
},
data:[],
onBeginEdit:function (rowIndex,rowData) {
},
});
$chooseWxxm.iMenubutton({
text:"选择维修项目",
iconCls:"",
btnCls:"",
onClick:function (){
gas.Dialog({
title:"选择维修项目",
width:640,
height:360,
content:'<div id="wxxmList"></div>',
onInit:function (element) {
element.find("#wxxmList").datagrid({
columns:[[
{title: "", field: "",checkbox:true},
{title: "id", field: "id",width:200,hidden:true},
{title: "编码", field: "code",width:100,align:"center"},
{title: "名称", field: "name",width:300,align:"center"},
]],
fitColumns:true,
data:wxxmVOList,
singleSelect:true,
checkOnSelect:false,
selectOnCheck:false,
})
},
regResultHandler:function (element) {
var data=element.find("#wxxmList").datagrid("getChecked");
if(data.length==0&&element.find("#wxxmList").datagrid("getSelected")){
data.push(element.find("#wxxmList").datagrid("getSelected"))
}
$.each(data,function (i,item) {
item["wxxmid"]=item.id
})
$xmList.datagrid("loadData",data);
}
})
}
});
$reviewWxxm.iMenubutton({
text:"查看不合格检验项目",
iconCls:"",
btnCls:"",
onClick:function (){
gas.Dialog({
title:"不合格检验项目",
width:640,
height:360,
content:'<div class="gpwxReviewXm" style="width: 100%;height: 100%"></div>',
onInit:function (element) {
element.find(".gpwxReviewXm").datagrid({
columns:[ new $.common.formatterCol([
{title: "检验项目ID", field: "jyxmid", fieldType: "ftString", hidden: true},
{title: "检验项目编码", field: "jyxmcode", width: 120},
{title: "检验项目名称", field: "jyxmname",fieldType: "ftString", width: 140},
{title: "检验值", field: "jyz", width:120,fieldType:"float"},
{title: "上限值", field: "sxz",width:60,fieldType:"float"},
{title: "下限值", field: "xxz",width:60,fieldType:"float"},
{title: "标准值", field: "bzz",width:60,fieldType:"float"},
{title: "合格标志", field: "hg", width:60,fieldType:"checkbox"},
])],
fitColumns:true,
singleSelect:true,
rownumbers:true
});
gas.post("kmes/gpwx/getBhgJymx",{wosnid:wosnid},function (res) {
if(res.success){
element.find(".gpwxReviewXm").datagrid("loadData",res.data.records||[])
}
})
},
regResultHandler:function (element) {
}
})
}
});
$deleteWxxm.iMenubutton({
text:"删除维修项目",
iconCls:"",
btnCls:"",
onClick:function (){
gas.Dialog({
title:"选择维修项目",
width:640,
height:360,
content:'<div id="wxxmList"></div>',
onInit:function (element) {
element.find("#wxxmList").datagrid({
columns:[[
{title: "", field: "",checkbox:true},
{title: "id", field: "id",width:200,hidden:true},
{title: "编码", field: "code",width:100},
{title: "名称", field: "name",width:300},
]],
fitColumns:true,
data:wxxmVOList
})
},
regResultHandler:function (element) {
var data=element.find("#wxxmList").datagrid("getChecked");
$.each(data,function (i,item) {
item["wxxmid"]=item.id
})
$xmList.datagrid("loadData",data);
}
})
}
});
$chooseBhgyy.iMenubutton({
text:"选择不合格原因",
iconCls:"",
btnCls:"",
onClick:function (){
var data=$list.datagrid("getChecked")[0];
var rowIndex=$list.datagrid("getRowIndex",data);
var wlid=woInfo.wlid;
if(!data){
$.messager.alert("提示","这条数据无现象,不可查询原因");
return false
}
Resbox.dialog({
url: "zlgl/bhgyy/init/usedBhgyy",
allowEdit:true,
columns: [
{"field":"ck",checkbox:true},
{title: "编码", field: "code", fieldType: "ftString",width:120},
{title: "名称", field: "name", fieldType: "ftString",width:140},
{title: "维修说明", field: "bz", fieldType: "ftString",width:140,editor:{type:"textbox"}},
{title: "不合格现象", field: "bhgxxname", fieldType: "ftString",width:140,hidden:true},
{title: "物料编码", field: "wlcode", fieldType: "ftString",width:120,hidden:true},
{title: "物料名称", field: "wlname", fieldType: "ftString",width:140,hidden:true},
{title: "不合格分类", field: "flid", fieldType: "ftString",width:120,hidden:true},
],
data:{"wlid":wlid, "xxid":data.xxid},
title: "选择原因",
datagrid:{
singleSelect:true,
checkOnSelect:true,
selectOnCheck:true,
pagination:false
},
save:function(res){
if(res[0]){
var row=res[0];
$list.datagrid('updateRow', {
index:rowIndex,
row:{
yyid:row["id"],
bhgyy:row["name"],
bz:row["bz"]
}
});
}
},
});
}
});
$splitBtn.iMenubutton({
text:"拆装",
iconCls:"",
btnCls:"",
onClick:function (){
gas.Dialog({
title:"拆装",
width:960,
height:640,
footerIn:true,
href:"kmes/gpwx/split",
onInit:function (element) {
},
onBeforeLoad:function(){
$(this).dialog("options").queryParams={
wosnid:wosnid,
gphyVOList:gphyVOList,
gxid:jyData.gxid,
woid:woid,
isHistory:isHistory,
jyhistroy:topList
}
},
// regResultHandler:function (element) {
// gphyVOList=element.find("##gpwxSplitBottom").datagrid("getRows")
// },
onSaveCallback:function (res,data) {
gphyVOList=data.data||[];
topList=data.topData;
isHistory=data.isHistory
}
})
}
});
numberBox1.text(gpwx_wgsl);
numberBox2.text(gpwx_hgsl);
numberBox3.text(gpwx_bfsl);
}
/*数据初始化*/
function dataInit(obj){
gas.setData($dialog.find("input[textboxname='gxid']"),jyData.gxid,jyData.gxName);
gas.setData($dialog.find("input[textboxname='gzzxid']"),jyData.gzzxid,jyData.gzzxname);
gas.setData($dialog.find("input[textboxname='fkrid']"),jyData.fkrid,jyData.fkrName);
}
function run(res){
$input.iSearchbox({
searcher:function (value) {
wosnid=getWosnid();
rsf(wosnid)
}
});
$btns.find(".e-dialog-save").iMenubutton({
text:"维修完成",
iconCls:"",
btnCls:"gui-btn-continue",
onClick:function (){
var data=getFormData(wosnid,{hgbz:'Y'});
if($form.find("input[name='cptm']").val()==''){
return false
}
HTTP.post("kmes/gpwx/doGpwxfk",data,function (result) {
if(result.success){
appendlog(woInfo,wosnid,"维修完成");
gpwx_wgsl++;
gpwx_hgsl++;
numberBox1.text(gpwx_wgsl);
numberBox2.text(gpwx_hgsl);
clearData();
}else{
var time=new Date().Format("yyyy-MM-dd hh:mm:ss");
var m='<p><span class="res-item">'+time+'</span><span class="res-item">'+wosnid+result.message||"维修失败"+'</span></p>';
$log.prepend(m);
$input.textbox("setValue",'');
}
focusInput();
})
}
});
$btns.find(".e-dialog-reset").iMenubutton({
text:"报废",
iconCls:"",
btnCls:"gui-btn-danger",
onClick:function (){
var data=getFormData(wosnid,{hgbz:'N'});
if($form.find("input[name='cptm']").val()==''){
return false
}
HTTP.post("kmes/gpwx/doGpwxfk",data,function (result) {
if(result.success){
appendlog(woInfo,wosnid,'报废成功');
gpwx_wgsl++;
gpwx_bfsl++;
numberBox1.text(gpwx_wgsl);
numberBox3.text(gpwx_bfsl);
clearData();
}else{
var time=new Date().Format("yyyy-MM-dd hh:mm:ss");
var m='<p><span class="res-item">'+time+'</span><span class="res-item">'+wosnid+result.message||"报废失败"+'</span></p>';
infoAudio();
$log.prepend(m);
$input.textbox("setValue",'');
}
focusInput();
})
}
})
$searchbox.off().on("click",function () {
wosnid=getWosnid();
rsf(wosnid)
});
focusInput();
}
function rsf(wosnid) {
if(!ajaxFlag){
gas.showCenterTips("正在处理,请稍等");
return false
}
if($input.val()==""){
return false
}
$.ajax({
type:"POST",
url: "kmes/gpwx/queryWxinfo", contentType: "application/json", dataType: "json",
data:JSON.stringify({wosnid:wosnid,gxid:jyData.gxid}), async:true,
timeout:1000*60,
beforeSend: function () {
ajaxFlag=false;
$shadow.show();
$.messager.progress({
title: '提示',
msg: '数据请求中,请稍候……',
text: ''
});
},
complete: function (XHR, TS) {
$shadow.hide();
ajaxFlag=true;
$.messager.progress('close');
$input.textbox("setValue","");
// $form.find("input[textboxname]").textbox("setValue",'');
focusInput();
},
success: function (result) {
if(result.success){
if(result.data.records){
woInfo=result.data.records.hzWoVO;
if(woInfo){
woid=woInfo["id"];
}
showWlxxinfo($form,result.data.records.hzWoVO);
$form.find("input[textboxname='wosnid']").textbox("setValue",wosnid);
$list.datagrid("loadData",result.data.records.gpbhgmxVOList||[]);
$form.find("input[textboxname='cptm']").textbox("setValue",wosnid);
wxxmVOList=result.data.records.wxxmVOList||[];
appendlog(woInfo,wosnid);
}
}else{
var time=new Date().Format("yyyy-MM-dd hh:mm:ss");
var m='<p><span class="res-item">'+time+'</span><span class="res-item">'+wosnid+result.message||"扫描失败"+'</span></p>';
$log.prepend(m);
infoAudio();
$input.textbox("setValue",'');
}
focusInput();
},
error:function (result) {
if(result.statusText=="timeout"){
gas.showCenterTips("请求超时,请重新请求");
}else{
gas.showCenterTips(result.message)
}
}
});
}
function clearData() {
$form.find("input[textboxname]").textbox("setValue",'');
$input.textbox("setValue",'');
$bzInput.textbox("setValue",'');
wosnid='';
isFlag=0;
gphyVOList=[];
topList=[];
isHistory=true;
$list.datagrid("loadData",[]);
$xmList.datagrid("loadData",[]);
$input.next("span").find("input.textbox-text").focus();
}
/*获取所有参数*/
function getFormData(value,formData) {
var gphyVO={
"fkbx": jyData.fkbx,
"fkgx": jyData.gxid,
"wosnid":value,
"bz":DataBind.collectData($dialog).bz||"",
};
switch (formData.hgbz) {
case "Y":$.extend(gphyVO,{"hgbz": "Y", "hgsl": 1,"bhgsl":0});break;
case "N":$.extend(gphyVO,{"bhgsl": 1,"hgbz":"N","hgsl":0});break;
}
$xmList.datagrid("acceptChanges");
var data={
"gpwxmxVOList":$xmList.datagrid("getRows"),
"gpbhgmxVOList":$list.datagrid("getRows"),
"gpfkVO":gphyVO,
"gphyVOList":gphyVOList
};
return data
}
/*获取条码信息*/
function getWosnid(value) {
var formData=DataBind.collectData($dialog);
return formData.wosnid;
}
/*结果控制*/
function gphyResHandler(res) {
var woInfo=res.woInfo;
var wobomList=res.wobomList;
$.each(wobomList,function (i,item) {
item["_parentId"]=woInfo.wlid;
});
var rows=wobomList;
rows.push(woInfo);
var data = {total:rows.length,"rows": rows};
$tree.iTreegrid('loadData', data);
var wlxx={
time:new Date().Format("yyyy-MM-dd hh:mm:ss"),
wosnid: wosnid||'',
wlbm: woInfo.wlxxCode||"",
wlmc:woInfo.wlxxName||'',
gg:woInfo.wlxxGg||'',
message:{
start:"<span>开始装配扫描.....</span>",
end:"<span>扫描结束</span>"
}
};
var info='<span class="res-item">'+wlxx.time+'</span>'+
'<span class="res-item">'+wlxx.wosnid+'</span>'+
'<span class="res-item">'+wlxx.wlbm+'</span>'+
'<span class="res-item">'+wlxx.wlmc+'</span>'+
'<span class="res-item">('+wlxx.gg+')</span>';
var p1=$("<p class=''>"+info+wlxx.message.start+".</p>");
$log.prepend(p1);
}
/*物料信息*/
function appendlog(woInfo,wosnid,end){
var wlxx={
time:new Date().Format("yyyy-MM-dd hh:mm:ss"),
wosnid: wosnid||'',
wlbm: woInfo.wlxxCode||"",
wlmc:woInfo.wlxxName||'',
gg:woInfo.wlxxGg||'',
message:{
start:"<span>扫描完成</span>",
end:"<span>"+end+"</span>"
}
};
var info='<span class="res-item">'+wlxx.time+'</span>'+
'<span class="res-item">'+wlxx.wosnid+'</span>'+
'<span class="res-item">'+wlxx.wlbm+'</span>'+
'<span class="res-item">'+wlxx.wlmc+'</span>'+
'<span class="res-item">('+wlxx.gg+')</span>';
var p1=$("<p class='res-success'>"+info+wlxx.message.start+".</p>");
if(end){
p1=$("<p class=''>"+info+wlxx.message.end+".</p>");
}
$log.prepend(p1);
}
function focusInput() {
$input.next("span").find("input.textbox-text").focus();
}
gas.load(paramInit,pageInit,dataInit,run);
})
</script>
<div class="e-dialog-container" data-options="width:480,height:280" id="gpwxGx">
<div class="gui-fluid editTable">
<input type="hidden" name="gxName">
<input type="hidden" name="gzzxid">
<input type="hidden" name="gzzxname">
<div class="gui-row">
<div class="gui-col-sm12">
<label class="gui-form-label">工序:</label>
<div class="gui-input-block">
<input type="text" name="gxid" data-toggle="gui-combobox">
</div>
</div>
</div>
<div class="gui-row">
<div class="gui-col-sm12">
<label class="gui-form-label">班型:</label>
<div class="gui-input-block">
<input type="text" name="bxid" style="width: 100%;" data-options="required:true">
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
var $dialog=$("#gpwxGx");
var $inputGxid=$dialog.find("input[name='gxid']");
var $inputBx=$dialog.find("input[name='bxid']");
function paramInit(ops){
}
function pageInit() {
$inputGxid.iCombobox({valueField: "id", textField: "name", allowNull:false,required:true, allowEdit:false, url: 'gygl/bzgx/queryWxBzgx',onSelect:function (a) {
$dialog.find("input[name='gxName']").val(a.name)
$dialog.find("input[name='gzzxid']").val(a.gzzxid||'')
$dialog.find("input[name='gzzxname']").val(a.gzzxname||'')
},
loadFilter: function (a) {
var datas=a["data"]["records"]
$.each(datas,function (i,item) {
item["name"]=item["gzzxname"]+"-"+item["name"]
});
return datas
}});
$inputBx.iCombobox({valueField: "id", textField:"name", allowNull:false, allowEdit:false, url: 'kmes/bx/query',onSelect:function (a) {
}});
}
/*数据初始化*/
function dataInit(obj){
}
function run(res){
}
gas.load(paramInit,pageInit,dataInit,run);
})
</script>
\ No newline at end of file
<div id="gpwxSplitContainer" class="e-dialog-container" >
<div class="e-dialog-body" style="padding: 0">
<div class="gui-layout" style="width:100%;height:100%;">
<div data-options="region:'north',title:'记录',split:true" style="height:50%;">
<div style="width: 100%;height: 100%" id="gpwxList"></div>
</div>
<div data-options="region:'center'" style="">
<div class="search-box-main" style="padding-top: 4px">
<div class="left">条码:</div>
<div class="right" style="">
<a id="gpwxSplitBtn" class="auxiliary-icon l-btn l-btn-small l-btn-plain toolbar" href="javascript:void(0)">
<span class="l-btn-left l-btn-icon-left" style=""><span class="l-btn-text">搜索</span>
<span class="l-btn-icon fa fa-search"></span></span>
</a>
</div>
<div class="clear"></div>
<div class="center">
<input class="gui-searchbox keyword toolbar" name="wosnid" id="gpwxSplit_input" style="width: 100%"/></div>
</div>
<div class="mx-dataTable" style="margin-top: 48px;bottom: 0">
<div id="gpwxSplitBottom-toolbar" class="gui-toolbar" data-options="grid:{type:'datagrid',id:'gpwxSplitBottom'}">
<a class="toolbar deleteBtn" href="javascript:void(0)"></a>
</div>
<div style="width: 100%;height: 100%" id="gpwxSplitBottom"></div>
</div>
</div>
</div>
</div>
<div class="e-dialog-footer">
<a href="javascript:void(0);" class="e-dialog-ok"></a>
<a href="javascript:void(0);" class="e-dialog-cancel"></a>
</div>
</div>
<script>
$(function () {
var $container=$("#gpwxSplitContainer");
var $topList=$("#gpwxList");
var $btn=$("#gpwxSplitBtn");
var $input=$("#gpwxSplit_input");
var $bottomList=$("#gpwxSplitBottom");
var $toolbar=$("#gpwxSplitBottom-toolbar");
var deleBtn=$toolbar.find(".deleteBtn");
var parmas=$container.parent("").dialog("options").queryParams;
var jyhistroy=[];
var gphyVOList=[];
var isHistory=true;
if(parmas){
gphyVOList=parmas.gphyVOList;
jyhistroy=parmas.jyhistroy;
isHistory=parmas.isHistory;
}
var wosnid="";
function paramsInit(){
}
function pageInit(){
var $topColumns=[
{title: "条码", field: "wlsnid", fieldType: "ftString",width:200},
{title: "类型", field: "hylx", fieldType: "ftString",width:80,formatter:function (value) {
var text={
"BOM":"关键件",
"LINK":"关联件",
"MAC":"MAC地址",
"MZ":"模组码"
};
return text[value]||''
}},
{title: "流程", field: "ck",width:80, align:"center",formatter:function (value,row,index) {
return "<a href='javascript:gpwxSplit("+JSON.stringify(row)+","+index+")' style='text-decoration:underline; color: #003e52;'>拆除</a>"
}},
{title: "已装配数量", field: "yzpsl", fieldType: "int"},
{title: "物料id", field: "wlid", fieldType: "ftString",width:192,hidden:true},
{title: "物料编码", field: "wlxxCode", fieldType: "ftString",width:192},
{title: "物料名称", field: "wlxxName", fieldType: "ftString",width:240},
{title: "规格型号", field: "wlxxGg", fieldType: "ftString",width:200}
];
$topList.datagrid({
columns:[new $.common.formatterCol($topColumns)],
rownumbers:true,
data:jyhistroy
});
deleBtn.iMenubutton({
text:"删除",
iconCls:"fa fa-trash",
onClick:function () {
var rows= $bottomList.datagrid("getSelected");
if(rows){
var index=$bottomList.datagrid("getRowIndex",rows);
var topRows=$topList.datagrid("getRows");
$.each(topRows,function (i,item) {
if(item.wlsnid==rows.wlsnid){
$topList.datagrid("updateRow",{
index:i,
row:{
yzpsl:parseInt(rows.yzpsl)+1
}
})
return false
}
})
$.messager.confirm("提示","是否删除",function (r) {
if(r){
$bottomList.datagrid("deleteRow",index);
}
})
}
}
})
var $botmColumns=[
{title: "流程", field: "ck",width:80, align:"center",formatter:function (value,row) {
if(row.cxsl&&parseInt(row.cxsl)>0){
return "<span style='color: indianred'>拆除</span>"
}else if(row.zpsl&&parseInt(row.zpsl)>0){
return "<span style='color: green'>装配</span>"
}
}},
{title: "条码", field: "wlsnid", fieldType: "ftString",width:200},
{title: "类型", field: "hylx", fieldType: "ftString",width:80,formatter:function (value) {
var text={
"BOM":"关键件",
"LINK":"关联件",
"MAC":"MAC地址",
"MZ":"模组码"
};
return text[value]||''
}},
{title: "物料id", field: "wlid", fieldType: "ftString",width:192,hidden:true},
{title: "物料编码", field: "wlxxCode", fieldType: "ftString",width:192},
{title: "物料名称", field: "wlxxName", fieldType: "ftString",width:240},
{title: "规格型号", field: "wlxxGg", fieldType: "ftString",width:200},
{title: "拆卸数量", field: "cxsl", width:80,hidden:true},
{title: "装配数量", field: "zpsl", width:80,hidden:true},
];
$bottomList.DataTableEditing({
columns:[new $.common.formatterCol($botmColumns)],
rownumbers:true,
pagination:false,
data:gphyVOList
});
if(isHistory){
gas.post("kmes/gpwx/getZpxx",{wosnid:parmas.wosnid},function (res) {
if(res.success){
$topList.datagrid("loadData",res.data.records||[]);
}
});
isHistory=false;
}
$btn.unbind().bind("click",function (event) {
splitSearch($input.val())
});
$input.iSearchbox({
searcher:function (value) {
splitSearch(value)
}});
$container.find(".e-dialog-ok").iMenubutton({
text:"确定",
iconCls:"fa fa-save",
btnCls:"gui-btn-save",
onClick:function (){
$container.parent("").iDialog("setStatus",{"state":"ok",data:{
data:$bottomList.datagrid("getRows"),
topData:$topList.datagrid("getRows"),
isHistory:isHistory
}});
}
});
$container.find(".e-dialog-cancel").iMenubutton({
text:"取消",
iconCls:"fa fa-close",
btnCls:"gui-btn-danger",
onClick:function () {
$container.parent("").dialog("destroy");
}
});
}
function dataInit(){
}
function run(){
}
function splitSearch(value){
var rows= $bottomList.datagrid("getRows");
var wlsnids=[];
$.each(rows,function (i,item) {
wlsnids.push(item.wlsnid)
});
if(wlsnids.indexOf(value)>-1){
gas.showCenterTips("请勿重复扫描")
return false;
}
HTTP.post("kmes/gphy/queryWlxx",{wlsnid:value,gxid:parmas.gxid,woid:parmas.woid},function (result) {
if(result.success){
var handlerData={};
if(result.data.records){
handlerData=result.data.records;
$bottomList.datagrid("appendRow",{
"cxsl": 0,
"hylx": handlerData.hylx,
"wlid":handlerData.wlxxId||'',
"wlsnid":$input.val(),
"zpsl": handlerData.zpsl||1,
"wlxxCode":handlerData.wlxxCode||'',
"wlxxName":handlerData.wlxxName||'',
"wlxxGg":handlerData.wlxxGg||'',
})
}
}else{
gas.showCenterTips(result.message||"操作失败")
}
});
}
gas.load(paramsInit,pageInit,dataInit,run);
})
function gpwxSplit(rowString,$index) {
var $List=$("#gpwxList");
var $bootmList=$("#gpwxSplitBottom");
$List.datagrid("selectRow",$index);
var row=$List.datagrid("getSelected");
if(row.yzpsl&&row.yzpsl>=1){
$List.datagrid("updateRow",{
index:$index,
row:{
yzpsl:parseInt(row.yzpsl)-1
}
});
$bootmList.datagrid("appendRow",$.extend({},row,{zpsl:0,cxsl:1}));
}else{
gas.showCenterTips("已分配数量少于1,不可进行拆卸");
return false
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment