增加班次剩料收集选择

This commit is contained in:
liuwu 2023-11-07 16:59:38 +08:00
parent 4bb9f8ba3c
commit 31cf133bbc
2 changed files with 23 additions and 3 deletions

View File

@ -106,6 +106,9 @@
<div class="head flex mui-row">
<div class="mui-col-sm-3" style="display:flex;align-items: center;">
<button class="btnc mui-btn-inline mui-btn-danger" onclick="handleBackMain()">返回</button>
<button class="btnc classes mui-btn-inline" onclick="handleClassClick(this,1,'早班')">早班</button>
<button class="btnc classes mui-btn-inline" onclick="handleClassClick(this,2,'中班')">中班</button>
<button class="btnc classes mui-btn-inline" onclick="handleClassClick(this,3,'晚班')">晚班</button>
</div>
<div class="mui-col-sm-9" style="display:flex;justify-content: flex-end;">
<button class="btnc mui-btn-inline mui-btn-danger" onclick="closeApp()" type='button'>关闭系统</button>
@ -135,6 +138,7 @@
</div>
</div>
<script type="text/javascript">
var batch = ''
var chartDom = document.getElementById('echarts_main_one');
var myChart = echarts.init(chartDom);
var option;
@ -171,6 +175,18 @@
});
}
function handleClassClick(obj,batch,name){
batch = batch
mui.toast(name+'切换成功');
var doms = document.getElementsByClassName('classes');
if (doms.length > 0) {
for (var i = 0; i < doms.length; i++) {
doms[i].setAttribute("class", 'btnc classes mui-btn-inline');
}
}
obj.setAttribute("class", 'btnc classes mui-btn-inline mui-btn-primary');
}
function closeApp() {
mui.confirm('确认关闭TMR饲喂系统', '提示', btnArray, function (e) {
if (e.index == 0) {} else {
@ -246,6 +262,10 @@
}
function nextCowshed(){
if(batch === ''){
mui.alert('请先选择班次')
return false
}
if(cowshedName === '收集重量'){
mui.alert('请先选择圈舍')
return false
@ -255,6 +275,7 @@
var obj = JSON.parse(loginUser);
var remainData = {
cowshedId: cowshedId,
batch: batch,
dateOf: currTimeFn(new Date()),
remain: _feedNum,
cowshedName: cowshedName,
@ -374,7 +395,6 @@
});
}, false);
}
console.log("bleData"+JSON.stringify(bleData));
blePicker.setData(bleData);
});
})(mui, document);

View File

@ -623,14 +623,14 @@ function hex2a(hexx) {
// }
function handleBackMain() {
mui.confirm('确认返回到首页?', '提示', btnArray, function (e) {
if (e.index == 0) {} else {
if (e.index === 0) {} else {
api.closeWin();
}
});
}
function closeApp() {
mui.confirm('确认关闭TMR饲喂系统', '提示', btnArray, function (e) {
if (e.index == 0) {} else {
if (e.index === 0) {} else {
api.closeWidget({
id: api.appId, //应用ID
retData: { name: 'closeWidget' },