Commit b8fa5a5a authored by 上官's avatar 上官

1.MES_PAD 打开界面的飞天兔图片被拉伸 调整

2.MES_PAD 提交成功和失败分别作了音效提示
3.MES_PAD 我的任务界面 明细选中变色 调整
4.MES_PAD主界面 间隔2秒内后退返回桌面
parent 00a09019
...@@ -369,6 +369,22 @@ ...@@ -369,6 +369,22 @@
this.today = this.dateTime; this.today = this.dateTime;
this.getData(); this.getData();
}, },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
getData: function() { getData: function() {
var that = this; var that = this;
var tempdate = this.dateTime + " 00:00:00"; var tempdate = this.dateTime + " 00:00:00";
...@@ -634,6 +650,7 @@ ...@@ -634,6 +650,7 @@
}, },
submit: function() { submit: function() {
if (!this.checkValue()) { if (!this.checkValue()) {
this.playVoice("sb.mp3");
return; return;
} }
var para = { var para = {
...@@ -654,12 +671,14 @@ ...@@ -654,12 +671,14 @@
that.getDataDetail2(1); //获取左边列表明细 今日实报 that.getDataDetail2(1); //获取左边列表明细 今日实报
that.getDataDetail2(2); //获取左边列表明细 单款实报 that.getDataDetail2(2); //获取左边列表明细 单款实报
that.getCompleteRatio(that.IndexID) //订单进度 that.getCompleteRatio(that.IndexID) //订单进度
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}); });
...@@ -690,12 +709,15 @@ ...@@ -690,12 +709,15 @@
that.getTatolNum(); //获取今日完成数量 that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 that.getDataDetail2(1); //获取左边列表明细
that.getCompleteRatio(that.IndexID) //订单进度 that.getCompleteRatio(that.IndexID) //订单进度
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}); });
...@@ -859,6 +881,7 @@ ...@@ -859,6 +881,7 @@
}, },
selectDisplay:function(n){ selectDisplay:function(n){
var opt = document.getElementById("item1" ) var opt = document.getElementById("item1" )
var opt2 = document.getElementById("item2" ) var opt2 = document.getElementById("item2" )
var n1 = document.getElementById("n1" ) var n1 = document.getElementById("n1" )
......
...@@ -528,15 +528,22 @@ ...@@ -528,15 +528,22 @@
that.getTatolNum(); //获取今日完成数量 that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细 that.getDataDetail2(2); //获取左边列表明细
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
mui.toast("提交失败: " + e.success.message); that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.message);
} }
}); },function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message))
});
}, },
submit: function() { submit: function() {
var that =this; var that =this;
if (!this.checkValue()) { if (!this.checkValue()) {
this.playVoice("sb.mp3");
return; return;
} }
for (var i = 0; i < this.sizeNum.length; i++) { for (var i = 0; i < this.sizeNum.length; i++) {
...@@ -792,7 +799,22 @@ ...@@ -792,7 +799,22 @@
this.size = n; this.size = n;
}, },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
......
...@@ -636,6 +636,7 @@ ...@@ -636,6 +636,7 @@
}, },
submit: function() { submit: function() {
if (!this.checkValue()) { if (!this.checkValue()) {
this.playVoice("sb.mp3");
return; return;
} }
var para = { var para = {
...@@ -656,12 +657,14 @@ ...@@ -656,12 +657,14 @@
that.getDataDetail2(1); //获取左边列表明细 今日实报 that.getDataDetail2(1); //获取左边列表明细 今日实报
that.getDataDetail2(2); //获取左边列表明细 单款实报 that.getDataDetail2(2); //获取左边列表明细 单款实报
that.getCompleteRatio(that.IndexID) //订单进度 that.getCompleteRatio(that.IndexID) //订单进度
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}); });
...@@ -692,12 +695,14 @@ ...@@ -692,12 +695,14 @@
that.getTatolNum(); //获取今日完成数量 that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 that.getDataDetail2(1); //获取左边列表明细
that.getCompleteRatio(that.IndexID) //订单进度 that.getCompleteRatio(that.IndexID) //订单进度
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}); });
...@@ -1067,6 +1072,22 @@ ...@@ -1067,6 +1072,22 @@
mui('.scroll3').scroll().scrollTo(0,0,100); mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100); mui('.scroll4').scroll().scrollTo(0,0,100);
}, //selecttime }, //selecttime
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back() mui.back()
// plus.screen.lockOrientation("portrait-primary") //横屏 // plus.screen.lockOrientation("portrait-primary") //横屏
......
...@@ -316,6 +316,7 @@ ...@@ -316,6 +316,7 @@
Api.post(html, para, function(e) { Api.post(html, para, function(e) {
if (e.success) { if (e.success) {
that.playVoice("cg.mp3");
mui.toast("操作成功"); mui.toast("操作成功");
that.selectLeftBack(0); that.selectLeftBack(0);
that.IndexID = 0; that.IndexID = 0;
...@@ -325,17 +326,34 @@ ...@@ -325,17 +326,34 @@
that.getData(1); that.getData(1);
} else { } else {
that.playVoice("sb.mp3");
mui.toast("操作失败: " + e.message); mui.toast("操作失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast("操作失败" + JSON.stringify(bbb.message)) mui.toast("操作失败" + JSON.stringify(bbb.message))
}) })
}, },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back(); mui.back();
}, },
......
...@@ -534,15 +534,22 @@ ...@@ -534,15 +534,22 @@
that.getTatolNum(); //获取今日完成数量 that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细 that.getDataDetail2(2); //获取左边列表明细
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.success.message); mui.toast("提交失败: " + e.success.message);
} }
},function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message))
}); });
}, },
submit: function() { submit: function() {
var that = this; var that = this;
if (!this.checkValue()) { if (!this.checkValue()) {
this.playVoice("sb.mp3");
return; return;
} }
for (var i = 0; i < this.sizeNum.length; i++) { for (var i = 0; i < this.sizeNum.length; i++) {
...@@ -820,7 +827,23 @@ ...@@ -820,7 +827,23 @@
// } // }
// //
// }, // },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back(); mui.back();
// plus.screen.lockOrientation("portrait-primary") //横屏 // plus.screen.lockOrientation("portrait-primary") //横屏
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<ul class="mui-table-view" style="margin-top: 5px;" v-if="itemsLeft.length == 0"> <ul class="mui-table-view" style="margin-top: 5px;" v-if="itemsLeft.length == 0">
<li class="mui-table-view-cell">无明细数据.请选择其他日期</li> <li class="mui-table-view-cell">无明细数据.请选择其他日期</li>
</ul> </ul>
<ul class="mui-table-view" style="margin-top: 5px;" v-for=" itemsDetail ,n in itemsLeft" @click="nextPage(itemsDetail)"> <ul :id="itemsDetail.IndexID" class="mui-table-view bg" style="margin-top: 5px;" v-for=" itemsDetail ,n in itemsLeft" @click="nextPage(itemsDetail)">
<li style=" padding: 0px 15px;"> <li style=" padding: 0px 15px;">
<p style="float: left;width: 16%; color: #060606; padding: 0; margin: 0;"> 指令号: </p> <p style="float: left;width: 16%; color: #060606; padding: 0; margin: 0;"> 指令号: </p>
<p style="float: left;width: 40%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.IndexNo}} </p> <p style="float: left;width: 40%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.IndexNo}} </p>
...@@ -238,7 +238,21 @@ ...@@ -238,7 +238,21 @@
that.itemsLeft = e.items that.itemsLeft = e.items
}) })
}, },
select_background: function(n) {
var bg = document.getElementsByClassName("bg");
var bgc = document.getElementById(n)
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
}
if (n != 0) {
bgc.style.background = "#02C1ED"
}
},
nextday: function(n) { nextday: function(n) {
...@@ -258,6 +272,7 @@ ...@@ -258,6 +272,7 @@
// mui('.scroll4').scroll().scrollTo(0, 0, 100); // mui('.scroll4').scroll().scrollTo(0, 0, 100);
}, },
nextPage: function(o) { nextPage: function(o) {
this.select_background(o.IndexID);
var that = this; var that = this;
this.IndexID = o.IndexID; this.IndexID = o.IndexID;
this.selectDetail = o; this.selectDetail = o;
...@@ -429,19 +444,37 @@ ...@@ -429,19 +444,37 @@
Api.post('/api/vMES/MyTask/Save', para, function(e) { Api.post('/api/vMES/MyTask/Save', para, function(e) {
if (e.success) { if (e.success) {
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
that.nextPage(that.selectDetail); that.nextPage(that.selectDetail);
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}) })
}, },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back() mui.back()
}, },
......
...@@ -316,6 +316,7 @@ ...@@ -316,6 +316,7 @@
Api.post(html, para, function(e) { Api.post(html, para, function(e) {
if (e.success) { if (e.success) {
that.playVoice("cg.mp3");
mui.toast("操作成功"); mui.toast("操作成功");
that.selectLeftBack(0); that.selectLeftBack(0);
that.IndexID = 0; that.IndexID = 0;
...@@ -325,17 +326,34 @@ ...@@ -325,17 +326,34 @@
that.getData(1); that.getData(1);
} else { } else {
that.playVoice("sb.mp3");
mui.toast("操作失败: " + e.message); mui.toast("操作失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast("操作失败" + JSON.stringify(bbb.message)) mui.toast("操作失败" + JSON.stringify(bbb.message))
}) })
}, },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back(); mui.back();
}, },
......
...@@ -472,10 +472,12 @@ ...@@ -472,10 +472,12 @@
submit_2:function(){ submit_2:function(){
this.searchPersonListAfter this.searchPersonListAfter
if( this.searchPersonListAfter.length == 0){ if( this.searchPersonListAfter.length == 0){
this.playVoice("sb.mp3");
mui.toast("请勾选人员"); mui.toast("请勾选人员");
return; return;
} }
if(this.PersonList.length == 0){ if(this.PersonList.length == 0){
this.playVoice("sb.mp3");
mui.toast("请先进入人员选择界面"); mui.toast("请先进入人员选择界面");
return; return;
} }
...@@ -711,6 +713,7 @@ ...@@ -711,6 +713,7 @@
} }
} }
if (tempPara.length == 0) { if (tempPara.length == 0) {
this.playVoice("sb.mp3");
mui.toast("请选择派工人员"); mui.toast("请选择派工人员");
return; return;
} }
...@@ -722,6 +725,7 @@ ...@@ -722,6 +725,7 @@
} }
Api.post('/api/vMES/TaskWork/Save', para, function(e) { Api.post('/api/vMES/TaskWork/Save', para, function(e) {
if (e.success) { if (e.success) {
that.playVoice("cg.mp3");
mui.toast("保存成功"); mui.toast("保存成功");
var che = document.getElementsByClassName("che"); var che = document.getElementsByClassName("che");
for (var j = 0; j < che.length; j++) { for (var j = 0; j < che.length; j++) {
...@@ -732,10 +736,11 @@ ...@@ -732,10 +736,11 @@
that.nextPage(that.selectDetail, 1); that.nextPage(that.selectDetail, 1);
} else { } else {
that.playVoice("sb.mp3");
mui.toast("保存失败: " + e.message); mui.toast("保存失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}) })
...@@ -862,14 +867,16 @@ ...@@ -862,14 +867,16 @@
Api.post('/api/vMES/TaskWork/Submit', para, function(e) { Api.post('/api/vMES/TaskWork/Submit', para, function(e) {
if (e.success) { if (e.success) {
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}) })
...@@ -877,6 +884,22 @@ ...@@ -877,6 +884,22 @@
} }
}, },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back(); mui.back();
}, },
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>针车品检</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="../dest/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../dest/css/mui.picker.min.css" />
<style type="text/css">
th{
border-width: 1px;
border-style: solid;
border-color: #a9c6c9;
}
.altrowstable {
border-width: 1px;
/*padding: 2px;*/
border-style: solid;
border-color: #a9c6c9;
background: white;
height:200%;
/*background-color: #F6F6F6;*/
}
</style>
</head>
<body>
<div id="app">
<!-- <header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @tap="back"></a>
<h1 class="mui-title">针车实报</h1>
</header> -->
<div class="mui-content" >
<!-- <div id="left" style="border: solid #000000; display: inline-block; width: 30%; "></div> -->
<div id="left" style=" display: inline-block; width: 30%; ">
<div id="left-1" style="position: absolute; top: 1px;">
<!-- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @tap="back"></a> -->
<label style=" text-align: center; position: relative; left: 50px;">今日次品数量:{{number}} </label>
</div>
<div id="left-2" >
<div class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block; width: 30%; top: 25px;">
<div class="mui-scroll">
<table class="mui-table">
<thead class="mui-table-view">
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">指令号</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">数量</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">类型</th>
</tr>
</thead>
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @tap="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody>
</tr>
</table>
</div>
</div>
</div>
</div>
<div id="right" style=" display: inline-block; width: 69%; ">
<div id="right-2" style=" position: relative;top:2px">
<div style="border: solid #DAE6EF 1px ; display: inline-block; width: 80%;">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<p style="float: left;width: 16%; color: #060606;"> 指令号: </p>
<p style="float: left;width: 40%; color: #060606;">&nbsp;{{itemsDetail.IndexNo}} </p>
<p style="float: left;width: 12%; color: #060606;">日期: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.Date}} </p>
</li>
<li class="mui-table-view-cell">
<p style="float: left;width: 16%; color: #060606;"> 货号: </p>
<p style="float: left;width: 40%;color: #1B83FE;">&nbsp;{{itemsDetail.StyleCode}} </p>
<p style="float: left;width: 12%; color: #060606;">颜色: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.ColorName}} </p>
</li>
<li class="mui-table-view-cell">
<p style="float: left;width: 16%; color: #060606;"> 数量: </p>
<p style="float: left;width: 40%; color: red;">&nbsp;{{itemsDetail.Qty}} </p>
<p style="float: left;width: 12%; color: #060606;">班组: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.WorkTeam}} </p>
</li>
</ul>
</div>
<div style=" display: inline-block; width: 17%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @tap="reportDelete()" >撤回品检</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" @tap="back">返回时报</button>
</div>
</div>
<div id="right-3" style="border: solid #DAE6EF 1px ;position: relative;top : -10px">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr style=" height: 50px">
<td class="altrowstable" style="background: white;height: 50px" >尺码:</td>
<td class="altrowstable" style=" height: 50px" v-for="itemdef in itemsSizeDef" v-if="itemsSize.length ==0">
<button class="bg" type="button" style="width: 100%;height: 50px" class="mui-btn mui-btn-blue mui-btn-outlined" >{{itemdef}}</button>
</td>
<td class="altrowstable" style=" height: 50px" v-for="itemd,isize in itemsSize" >
<button class="bg" :style="stylebg(isize)" style="width: 100%;height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectSize(itemd)">{{itemd}}</button>
</td>
</tr>
</tbody>
</table>
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr style=" height: 50px">
<td class="altrowstable" style="background: white;height: 50px">完工数量:</td>
<td class="altrowstable"><button style="width: 100%; height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(1)">1</button></td>
<td class="altrowstable"><button style="width: 100%; height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(2)">2</button></td>
<td class="altrowstable"><button style="width: 100%; height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(3)">3</button></td>
<td class="altrowstable"><button style="width: 100%; height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(4)">4</button></td>
<td class="altrowstable"><button style="width: 100%; height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(5)">5</button></td>
<td class="altrowstable"><button style="width: 100%; height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(10)">10</button></td>
<td class="altrowstable">
<input style="width: 100% ;height: 100%; text-align: center;color: red; border-style:none;" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
:onchange="changeValue()" />
</td>
</tr>
</tbody>
</table>
</div>
<div id="right-4" style=" margin-top: 10px ;">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr style="height:60px ;" v-for="itemq , n in itemsDetail1_ar" >
<td :id="'Quality_'+ itemqq.ID" class="altrowstable Quality" style="height: 60px;" v-for ="itemqq , n in itemq" @tap ="selectQQ(itemqq.ID)">{{itemqq.Name}} </td>
</tr>
</tbody>
</table>
</div>
<div id="right-5" style=" border: solid,red,3px; position: absolute; bottom: 0px;">
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;" @tap ="selectProcessingType(1)">返修</button>
<button id="ProcessingType_2" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;" @tap ="selectProcessingType(2)">报废</button>
</div>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="position: absolute; right: 0px; bottom: 0px;margin-bottom: 0px; width: 120px; " :disabled="disable_save_button2" @tap="submit">提交</button>
</div>
</div>
</div>
<script src="../dest/js/mui.min.js"></script>
<script src="../dest/js/mui.picker.min.js"></script>
<script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript">
mui.plusReady(function() {
initPage();
});
function initPage() {
plus.screen.lockOrientation("landscape-secondary") //横屏
app.init();
}
var app = new Vue({
el: '#app',
data: {
number: 0,
qty: 0,
size: 0,
dateTime: "",
qualityID : 0,
itemsDetail: [], //订单明细
itemsDetail1: [], //品检项目
itemsDetail1_ar:[],
itemsDetail2: [],
itemsHead: [],
itemsLeft: [],
itemsSize: [],
SizeQty: [],
itemsSizeDef:[40,41,42,43,44,45,46],
itemsSizetest: [11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14,
15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15,
],
IndexID: 0,
disable_save_button: 'disabled',
disable_reportDelete: 'disabled',
ProcessingType:0,
ReportID: 0,
Model:0, //0 可以提交 1 不可以提交
},
computed: {
disable_save_button2: function () {
if( this.qty !=0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0 && this.Model == 0 ){
return null;
}
else{
return 'disabled';
}
}
},
methods: {
init: function() {
mui.init();
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.dateTime = moment().format().substring(0,10)
this.IndexID = mui.currentWebview.IndexID;
this.itemsDetail= mui.currentWebview.itemsDetail;
this.itemsSize= mui.currentWebview.itemsSize;
this.getDataInit();
},
getDataInit:function(){
this.getDataDetail1();
this.getDataDetail2();
this.getTatolNum();
},
getData: function() {
var that = this;
var para = {
ReportType: 1,
IndexID: this.IndexID
};
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
that.itemsHead = e.items;
if (e.items.length > 0) {
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
that.getDataDetail1();
that.getDataDetail2();
that.getTatolNum();
that.qty=0;
that.disable_reportDelete='disabled';
}
else{
that.itemsDetail=[];
that.IndexID =0;
that.itemsDetail1 =[];
that.itemsSize=[];
that.size=0;
that.itemsLeft=[];
that.number=0;
that.qty=0;
that.disable_reportDelete='disabled'
}
});
},
//品检明细
getDataDetail1: function() {
var that = this;
var para = {
ReportType: 1,
IndexID: this.IndexID
};
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
that.itemsDetail1 = e.items;
that.itemsDetail1_ar=[];
for(var i=0,len=e.items.length;i<len;i+=6){
that.itemsDetail1_ar.push(e.items.slice(i,i+6));
}
});
},
//完成信息明细
getDataDetail2: function() {
var that = this;
var para = {
ReportType: 1,
Date: this.dateTime + " 00:00:00",
IndexID: this.IndexID,
PageSize: 200,
PageIndex: 1,
};
Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
console.log(JSON.stringify(e));
that.itemsLeft = e.items;
});
},
getTatolNum: function() {
var that = this;
var para = {
ReportType: 1,
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/InspectionReport/TotalQty', para, function(e) {
that.number = e.data;
});
},
getReportDetail:function(){
var that = this;
var para = {
ReportID:this.ReportID
};
Api.post('/api/vMES/InspectionReport/ReportDetail', para, function(e) {
if(e.success){
that.ReportID = e.data.ReportID;
that.itemsDetail = e.data;
that.itemsSize = e.data.SizeName;
that.qualityID = e.data.QIDetailID;
that.ProcessingType = e.data.ProcessingType;
that.size = e.data.UnQualifiedSizeName;
that.qty =e.data.UnQualifiedQty;
that.Model = 1;
that.selectQQ(that.qualityID);
that.selectSize(that.size);
that.selectProcessingType(that.ProcessingType);
}
});
},
reportDelete: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/InspectionReport/Delete', para, function(e) {
if(e.success){
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.qualityID = 0;
that.selectQQ(0);
that.selectReport(0);
that.selectProcessingType(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.Model =0;
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + e.success.message)
}
});
},
SizeQtyA: function() {
for (var i = 0; i < this.itemsSize.length; i++) {
var tempa = {
size: this.itemsSize[i],
qty: 0
}
this.SizeQty.push(tempa);
}
},
submit: function() {
if (!this.checkValue()) {
return;
}
var para = {
IndexID: this.IndexID,
SizeName: this.size,
Qty: this.qty,
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID,
}
var that = this;
Api.post('/api/vMES/InspectionReport/Save', para, function(e) {
if (e.success) {
that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.ProcessingType = 0;
that.qualityID = 0;
that.selectQQ(0);
that.selectProcessingType(0);
that.selectSize(0);
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.success.message);
}
});
},
displayReport:function(){
this.getReportDetail();
},
selectProcessingType:function(n){
var fx = document.getElementById("ProcessingType_1" );
var bf = document.getElementById("ProcessingType_2" );
if(n==1){
fx.style.background ="#02C1ED";
bf.style.background =""
}
if(n==2){
fx.style.background ="";
bf.style.background ="#02C1ED";
}
else if(n==0){
fx.style.background ="";
bf.style.background ="";
}
this.ProcessingType = n;
},
selectQQ:function(qq){
var op = document.getElementById("Quality_" + qq)
this.qualityID = qq;
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType !=0) {
this.disable_save_button = null;
}
var reportele = document.getElementsByClassName("Quality");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(qq != 0){op.style.background = "#02C1ED";}
},
selectIndex:function(idx){
this.IndexID = idx
if(this.IndexID != 0){
this.getDataDetail1();
this.getDataDetail2();
this.getTatolNum();
this.qty=0;
this.size=0;
this.disable_reportDelete='disabled';
}
else{
this.itemsDetail=[];
this.IndexID =0;
this.itemsDetail1 =[];
this.itemsSize=[];
this.size=0;
this.itemsLeft=[];
this.number=0;
this.qty=0;
this.disable_reportDelete='disabled'
}
},
selectReport: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
var reportele = document.getElementsByClassName("Report");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(obj != 0){
op.style.background = "#02C1ED";
this.displayReport();
}
},
changeValue: function() {
if (isNaN(parseInt(this.qty))) {
this.qty = 0;
this.disable_save_button = 'disabled';
}
if (parseInt(this.qty) > 0) {
this.qty = parseInt(this.qty);
this.disable_save_button = null;
}
},
checkValue: function() {
//数量不正确
if (isNaN(parseInt(this.qty)) || parseInt(this.qty) <= 0) {
mui.toast("数量不正确")
return false;
}
//尺码不正确
else if (this.size == 0) {
mui.toast("尺码不正确")
return false;
} else if (this.IndexID == 0) {
mui.toast("订单号不正确")
return false;
}else if (this.qualityID ==0){
mui.toast("请选择品检项目")
return false;
}
else if (this.ProcessingType ==0){
mui.toast("请选择处理类型")
return false;
}
else {
return true;
}
},
selectNumber: function(n) {
this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
},
selectSize: function(n) {
var bg = document.getElementsByClassName("bg");
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
if (bg[i].innerHTML == n) {
bg[i].style.background = "#02C1ED"
}
}
// if(n==0){
//
// bg[0].style.background = "#02C1ED"
// }
this.size = n;
},
stylebg: function(n) {
// if (n == 0) {
// return {
// "background": "#02C1ED"
//
// }
// }
},
back: function() {
mui.back();
// plus.screen.lockOrientation("portrait-primary") //横屏
}
}
})
</script>
</body>
</html>
...@@ -527,15 +527,22 @@ ...@@ -527,15 +527,22 @@
that.getTatolNum(); //获取今日完成数量 that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细 that.getDataDetail2(2); //获取左边列表明细
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.success.message); mui.toast("提交失败: " + e.success.message);
} }
}); },function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message))
});
}, },
submit: function() { submit: function() {
var that = this; var that = this;
if (!this.checkValue()) { if (!this.checkValue()) {
this.playVoice("sb.mp3");
return; return;
} }
for (var i = 0; i < this.sizeNum.length; i++) { for (var i = 0; i < this.sizeNum.length; i++) {
...@@ -789,7 +796,22 @@ ...@@ -789,7 +796,22 @@
}, },
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back(); mui.back();
// plus.screen.lockOrientation("portrait-primary") //横屏 // plus.screen.lockOrientation("portrait-primary") //横屏
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>针车实报</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="../dest/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../dest/css/mui.picker.min.css" />
<style type="text/css">
th{
border-width: 1px;
border-style: solid;
border-color: #a9c6c9;
}
.altrowstable {
border-width: 1px;
/*padding: 2px;*/
border-style: solid;
border-color: #a9c6c9;
background: white;
height:200%;
/*background-color: #F6F6F6;*/
}
</style>
</head>
<body>
<div id="app">
<!-- <header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @tap="back"></a>
<h1 class="mui-title">针车实报</h1>
</header> -->
<div class="mui-content" >
<!-- <div id="left" style="border: solid #000000; display: inline-block; width: 30%; "></div> -->
<div id="left" style=" display: inline-block; width: 30%; ">
<div id="left-1" style="position: absolute; top: 1px;">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @tap="back"></a>
<label style=" text-align: center; position: relative; left: 50px;">今日完成数量:{{number}} </label>
</div>
<div id="left-2" >
<div class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block; width: 30%; top: 25px;">
<div class="mui-scroll">
<table class="mui-table">
<thead class="mui-table-view">
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">指令号</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">数量</th>
</tr>
</thead>
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @tap="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
</tbody>
</tr>
</table>
</div>
</div>
</div>
</div>
<div id="right" style=" display: inline-block; width: 69%; ">
<div id="right-1" style=" ">
<div style="border: solid #DCDCE1 1px ; display: inline-block; width: 10%; position: relative;top: -20px; height: 38px;">
<button style="text-align: center;border-style:none; width: 100%;height: 100%; background: white;">指令号:</button>
</div>
<div class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" style=" display: inline-block; width: 66%; position: relative;top: 1px;">
<div class="mui-scroll">
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index mui-active" style="background:#02C1ED ;" v-for="itemh,i in itemsHead" v-if= "i == 0" @tap="selectIndex(itemh.IndexID)">
{{itemh.IndexNo}}
</a>
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index" style="" v-for="itemh,i in itemsHead" v-if= "i != 0" @tap="selectIndex(itemh.IndexID)">
{{itemh.IndexNo}}
</a>
</div>
</div>
<div style="border: solid #DCDCE1 1px ; display: inline-block; width: 22% ;position: relative;top: -20px; height: 38px; ">
<a class=" mui-icon mui-icon-left-nav mui-pull-left" @tap="nextday(-1)"></a>
<button style=" width: 60%;height: 100%;" id="selectdate" data-options='{"type":"date"}' name="shipdate" @tap="selecttime()">{{dateTime}}</button>
<a class=" mui-icon mui-icon-arrowright mui-pull-right" style="" @tap="nextday(1)"></a>
</div>
</div>
<div id="right-2" style="">
<div style="border: solid #DAE6EF 1px ; display: inline-block; width: 80%;">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<p style="float: left;width: 16%; color: #060606;"> 指令号: </p>
<p style="float: left;width: 40%; color: #060606;">&nbsp;{{itemsDetail.IndexNo}} </p>
<p style="float: left;width: 12%; color: #060606;">日期: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.Date}} </p>
</li>
<li class="mui-table-view-cell">
<p style="float: left;width: 16%; color: #060606;"> 货号: </p>
<p style="float: left;width: 40%;color: #1B83FE;">&nbsp;{{itemsDetail.StyleCode}} </p>
<p style="float: left;width: 12%; color: #060606;">颜色: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.ColorName}} </p>
</li>
<li class="mui-table-view-cell">
<p style="float: left;width: 16%; color: #060606;"> 数量: </p>
<p style="float: left;width: 40%; color: red;">&nbsp;{{itemsDetail.Qty}} </p>
<p style="float: left;width: 12%; color: #060606;">班组: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.WorkTeam}} </p>
</li>
</ul>
</div>
<div style=" display: inline-block; width: 17%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @tap="reportDelete()" >撤回实报</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_qq" @tap ="nextPage()">品质问题</button>
</div>
</div>
<div id="right-3" style="border: solid #DAE6EF 1px ; position: relative; top: -15px;">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr style="height: 50px;" >
<td class="altrowstable" style="background: white;height: 50px;" >尺码:</td>
<td class="altrowstable" style="height: 50px;" v-for="itemdef in itemsSizeDef" v-if="itemsSize.length ==0">
<button class="bg" type="button" style="width: 100%;height: 50px" class="mui-btn mui-btn-blue mui-btn-outlined" >{{itemdef}}</button>
</td>
<td class="altrowstable" style = "height: 50px;"v-for="itemd,isize in itemsSize" >
<button class="bg" :style="stylebg(isize)" style="width: 100% ;height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectSize(itemd)">{{itemd}}</button>
</td>
</tr>
</tbody>
</table>
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr style="height: 50px;">
<td class="altrowstable" style="background: white;">完工数量:</td>
<td class="altrowstable"><button style="width: 100%; height:50px; border-color: #DCDCE1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(1)">1</button></td>
<td class="altrowstable"><button style="width: 100%; height:50px; border-color: #DCDCE1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(2)">2</button></td>
<td class="altrowstable"><button style="width: 100%; height:50px; border-color: #DCDCE1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(3)">3</button></td>
<td class="altrowstable"><button style="width: 100%; height:50px; border-color: #DCDCE1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(4)">4</button></td>
<td class="altrowstable"><button style="width: 100%; height:50px; border-color: #DCDCE1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(5)">5</button></td>
<td class="altrowstable"><button style="width: 100%; height:50px; border-color: #DCDCE1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectNumber(10)">10</button></td>
<td class="altrowstable">
<input style="width: 100% ;height: 100%; text-align: center;color: red; border-style:none;" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
:onchange="changeValue()" />
</td>
</tr>
</tbody>
</table>
</div>
<div id="right-4" style=" margin-top: 10px ;">
<div style=" display: inline-block; width: 80%;">
<table class="mui-table ">
<thead class="mui-table-view">
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">尺码</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">数量</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">合格数</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">不合格数</th>
</tr>
</thead>
</table>
<div class="mui-scroll-wrapper " style=" display: inline-block; width: 55.4%; left: 30.4%; top: 360px;">
<div class="mui-scroll">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr v-for="itemdetail in itemsDetail1">
<td class="altrowstable" align="center">{{itemdetail.SizeName}}</td>
<td class="altrowstable" align="center">{{itemdetail.Qty}}</td>
<td class="altrowstable" align="center">{{itemdetail.QualifiedQty}}</td>
<td class="altrowstable" align="center">{{itemdetail.UnQualifiedQty}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style=" display: inline-block; position: absolute;bottom: 10px; width: 12%; right: 15px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_save_button_C" @tap="submit">提交</button>
</div>
</div>
</div>
</div>
</div>
<script src="../dest/js/mui.min.js"></script>
<script src="../dest/js/mui.picker.min.js"></script>
<script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script>
<script type="text/javascript">
mui.plusReady(function() {
initPage();
});
function initPage() {
plus.screen.lockOrientation("landscape-secondary") //横屏
app.init();
}
var app = new Vue({
el: '#app',
data: {
number: 0,
qty: 0,
size: 0,
dateTime: "",
dateTimeFull :new Date(),
items: [11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11,
21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15,
],
itemsDetail: [], //订单明细
itemsDetail1: [],
itemsDetail2: [],
itemsHead: [],
itemsLeft: [],
itemsSize: [],
SizeQty: [],
itemsSizeDef:[40,41,42,43,44,45,46],
itemsSizetest: [11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14,
15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15,
],
IndexID: 0,
// disable_save_button: 'disabled',
disable_reportDelete: 'disabled',
disable_qq:null,
ReportID: 0,
Model:0,
},
computed:{
disable_save_button_C :function(){
if(this.size !=0 && this.qty !=0 && this.IndexID !=0 && this.Model == 0 ){
return null;
}
else {
return 'disabled' ;
}
},
},
methods: {
init: function() {
mui.init();
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.dateTime = new Date().toLocaleDateString();
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.getData();
},
getData: function() {
var that = this;
var tempdate = this.dateTime + " 00:00:00";
var para = {
ReportType: 1,
Date: tempdate
};
Api.post('/api/vMES/ProductionReport/ProductIndexNo', para, function(e) {
that.itemsHead = e.items;
if (e.items.length > 0) {
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
that.getDataDetail1();
that.getDataDetail2();
that.getTatolNum();
that.qty=0;
that.disable_reportDelete='disabled';
}
else{
that.itemsDetail=[];
that.IndexID =0;
that.itemsDetail1 =[];
that.itemsSize=[];
that.size=0;
that.itemsLeft=[];
that.number=0;
that.qty=0;
that.disable_reportDelete='disabled'
}
});
},
getDataDetail1: function() {
var that = this;
var para = {
IndexID: this.IndexID,
};
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
console.log("eeee:::" +JSON.stringify(e))
that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName;
that.size = e.data.SizeName[0];
});
},
getDataDetail2: function() {
var that = this;
var para = {
ReportType: 1,
Date: this.dateTime + " 00:00:00",
IndexID: this.IndexID,
PageSize: 200,
PageIndex: 1,
};
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
that.itemsLeft = e.items;
});
},
getTatolNum: function() {
var that = this;
var para = {
ReportType: 1,
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/ProductionReport/TotalQty', para, function(e) {
that.number = e.data;
});
},
reportDelete: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/ProductionReport/Delete', para, function(e) {
if(e.success){
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.selectReport(0)
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.Model =0 ;
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + e.success.message)
}
});
},
getDataByReportID:function(){
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/ProductionReport/ReportIndexNoDetail', para, function(e) {
if(e.success){
that.itemsDetail = e.data;
that.itemsSize =e.data.SizeName;
that.itemsDetail1 = e.data.ReportDetail ;
that.size = e.data.ReportSizeName;
that.qty = e.data.ReportQty;
that.selectSize(e.data.ReportSizeName);
}
else{
mui.toast("获取明细失败:" + e.message)
}
});
},
SizeQtyA: function() {
for (var i = 0; i < this.itemsSize.length; i++) {
var tempa = {
size: this.itemsSize[i],
qty: 0
}
this.SizeQty.push(tempa);
}
},
submit: function() {
if (!this.checkValue()) {
return;
}
var para = {
IndexID: this.IndexID,
SizeName: this.size,
Qty: this.qty,
}
var that = this;
Api.post('/api/vMES/ProductionReport/Save', para, function(e) {
if (e.success) {
// that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.message);
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
selectIndex:function(idx){
var indxx = document.getElementsByClassName("Index");
if (this.Model == 1) {
setTimeout(function() {
for (var i = 0; i < indxx.length; i++) {
indxx[i].className ="mui-control-item Index"
}
}, 50);
return;
}
var indx = document.getElementById("Index_" + idx)
for (var i = 0; i < indxx.length; i++) {
indxx[i].style.background ="";
}
indx.style.background = "#02C1ED";
this.IndexID = idx
if(this.IndexID != 0){
this.getDataDetail1();
this.getDataDetail2();
this.getTatolNum();
this.qty=0;
this.size=0;
this.disable_reportDelete='disabled';
}
else{
this.itemsDetail=[];
this.IndexID =0;
this.itemsDetail1 =[];
this.itemsSize=[];
this.size=0;
this.itemsLeft=[];
this.number=0;
this.qty=0;
this.disable_reportDelete='disabled'
}
},
selectReport: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
var reportele = document.getElementsByClassName("Report");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(obj != 0){
op.style.background = "#02C1ED";
this.Model =1 ;
this.getDataByReportID();
}
},
changeValue: function() {
if (isNaN(parseInt(this.qty))) {
this.qty = 0;
// this.disable_save_button = 'disabled';
}
if (parseInt(this.qty) > 0) {
this.qty = parseInt(this.qty);
// this.disable_save_button = null;
}
},
checkValue: function() {
//数量不正确
if (isNaN(parseInt(this.qty)) || parseInt(this.qty) <= 0) {
mui.toast("数量不正确")
return false;
}
//尺码不正确
else if (this.size == 0) {
mui.toast("尺码不正确")
return false;
} else if (this.IndexID == 0) {
mui.toast("订单号不正确")
return false;
} else {
return true;
}
},
selectNumber: function(n) {
if (this.Model == 1) {
return;
}
this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
console.log(this.qty )
},
selectSize: function(n) {
var bg = document.getElementsByClassName("bg");
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
if (bg[i].innerHTML == n) {
bg[i].style.background = "#02C1ED"
}
}
if(n!=0 ){
this.size = n;
console.log(this.size);
// bg[0].style.background = "#02C1ED"
}
},
nextday:function(n){
console.log(n)
var d = new Date(this.dateTime);
d.setTime(d.getTime()+24*60*60*1000*n);
var s = d.getFullYear()+"-" + (d.getMonth()+1) + "-" + d.getDate();
this.dateTime = s;
},
stylebg: function(n) {
if (n == 0) {
return {
"background": "#02C1ED"
}
}
},
nextPage: function() {
var url_;
var id_;
url_ = "Needlecarquality.html";
id_ = "Needlecarquality.html";
mui.openWindow({
url: url_,
id: id_,
extras: {
IndexID:this.IndexID,
dateTime:this.dateTime,
itemsDetail:this.itemsDetail,
itemsSize:this.itemsSize
},
});
},
selecttime: function() {
var that = this;
var _self = document.getElementById("selectdate")
if (_self.picker) {
_self.picker.show(function(rs) {
_self.innerText = rs.text
_self.picker.dispose();
_self.picker = null;
});
} else {
var optionsJson = _self.getAttribute('data-options') || '{}';
var options = JSON.parse(optionsJson);
var id = _self.getAttribute('id');
/*
* 首次显示时实例化组件
* 示例为了简洁,将 options 放在了按钮的 dom 上
* 也可以直接通过代码声明 optinos 用于实例化 DtPicker
*/
_self.picker = new mui.DtPicker(options);
_self.picker.show(function(rs) {
/*
* rs.value 拼合后的 value
* rs.text 拼合后的 text
* rs.y 年,可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
* rs.m 月,用法同年
* rs.d 日,用法同年
* rs.h 时,用法同年
* rs.i 分(minutes 的第二个字母),用法同年
*/
console.log(rs.value)
_self.innerText = rs.text;
that.dateTime = rs.text;
that.getData();
/*
* 返回 false 可以阻止选择框的关闭
* return false;
*/
/*
* 释放组件资源,释放后将将不能再操作组件
* 通常情况下,不需要示放组件,new DtPicker(options) 后,可以一直使用。
* 当前示例,因为内容较多,如不进行资原释放,在某些设备上会较慢。
* 所以每次用完便立即调用 dispose 进行释放,下次用时再创建新实例。
*/
_self.picker.dispose();
_self.picker = null;
});
}
}, //selecttime
back: function() {
plus.screen.lockOrientation("portrait-primary") //横屏
}
}
})
</script>
</body>
</html>
...@@ -631,6 +631,7 @@ ...@@ -631,6 +631,7 @@
}, },
submit: function() { submit: function() {
if (!this.checkValue()) { if (!this.checkValue()) {
this.playVoice("sb.mp3");
return; return;
} }
var para = { var para = {
...@@ -651,12 +652,14 @@ ...@@ -651,12 +652,14 @@
that.getDataDetail2(1); //获取左边列表明细 今日实报 that.getDataDetail2(1); //获取左边列表明细 今日实报
that.getDataDetail2(2); //获取左边列表明细 单款实报 that.getDataDetail2(2); //获取左边列表明细 单款实报
that.getCompleteRatio(that.IndexID) //订单进度 that.getCompleteRatio(that.IndexID) //订单进度
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}); });
...@@ -687,12 +690,14 @@ ...@@ -687,12 +690,14 @@
that.getTatolNum(); //获取今日完成数量 that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 that.getDataDetail2(1); //获取左边列表明细
that.getCompleteRatio(that.IndexID) //订单进度 that.getCompleteRatio(that.IndexID) //订单进度
that.playVoice("cg.mp3");
mui.toast("提交成功"); mui.toast("提交成功");
} else { } else {
that.playVoice("sb.mp3");
mui.toast("提交失败: " + e.message); mui.toast("提交失败: " + e.message);
} }
}, function(b, bb, bbb) { }, function(b, bb, bbb) {
that.playVoice("sb.mp3");
mui.toast(JSON.stringify(bbb.message)) mui.toast(JSON.stringify(bbb.message))
}); });
...@@ -1060,6 +1065,22 @@ ...@@ -1060,6 +1065,22 @@
mui('.scroll3').scroll().scrollTo(0,0,100); mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100); mui('.scroll4').scroll().scrollTo(0,0,100);
}, //selecttime }, //selecttime
playVoice:function(filename){
if ( plus.audio == undefined ) {
} else{
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/"+ filename);
p.play( function () {
//alert( "Audio play success!" );
}, function ( e ) {
//alert( "Audio play failed: " + e.message );
});
}
},
back: function() { back: function() {
mui.back() mui.back()
// plus.screen.lockOrientation("portrait-primary") //横屏 // plus.screen.lockOrientation("portrait-primary") //横屏
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
var pages = ['Needlecarreport_new','Cutting',"Forming","FormingHandover","NeedlecarHandover","MyWork","NeedlecarPBB"]; var pages = ['Needlecarreport_new','Cutting',"Forming","FormingHandover","NeedlecarHandover","MyWork","NeedlecarPBB"];
//var tits = ['色卡档案', '样品企划', '样品客户意见', '款式图片档案', '下单管理', '生产进度表', '消息提醒', '业务审批', '订货主场','针车实报','设置']; //var tits = ['色卡档案', '样品企划', '样品客户意见', '款式图片档案', '下单管理', '生产进度表', '消息提醒', '业务审批', '订货主场','针车实报','设置'];
var lab1 = document.getElementsByTagName("a"); var lab1 = document.getElementsByTagName("a");
var back__first = null;
function onGetDataSuccess(e){ function onGetDataSuccess(e){
...@@ -222,8 +222,9 @@ ...@@ -222,8 +222,9 @@
openSettingWindow() openSettingWindow()
}); });
} }
var back__first = null;
mui.back = function() { mui.back = function() {
if(!back__first) { if(!back__first) {
back__first = new Date().getTime(); back__first = new Date().getTime();
mui.toast('再按一次退出应用'); mui.toast('再按一次退出应用');
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"id" : "H544710A8", /*应用的标识,创建应用时自动生成,勿手动修改*/ "id" : "H544710A8", /*应用的标识,创建应用时自动生成,勿手动修改*/
"name" : "飞天兔MES", /*应用名称,程序桌面图标名称*/ "name" : "飞天兔MES", /*应用名称,程序桌面图标名称*/
"version" : { "version" : {
"name" : "1.0.0.3", /*应用版本名称*/ "name" : "1.0.0.5", /*应用版本名称*/
"code" : "338" "code" : "338"
}, },
"description" : "飞天兔MES平板版", /*应用描述信息*/ "description" : "飞天兔MES平板版", /*应用描述信息*/
...@@ -252,8 +252,8 @@ ...@@ -252,8 +252,8 @@
"mdpi" : "", /*普通屏启动图片,分辨率:240x282*/ "mdpi" : "", /*普通屏启动图片,分辨率:240x282*/
"ldpi" : "", "ldpi" : "",
"hdpi" : "unpackage/splash/640X1136.png", "hdpi" : "unpackage/splash/640X1136.png",
"xhdpi" : "unpackage/splash/750X1334.png", "xhdpi" : "unpackage/splash/1024x748.png",
"xxhdpi" : "unpackage/splash/1242X2208.png" "xxhdpi" : "unpackage/splash/2048x1496.png"
} }
}, },
"debug" : false "debug" : false
......
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