增加班次剩料收集选择

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="head flex mui-row">
<div class="mui-col-sm-3" style="display:flex;align-items: center;"> <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 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>
<div class="mui-col-sm-9" style="display:flex;justify-content: flex-end;"> <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> <button class="btnc mui-btn-inline mui-btn-danger" onclick="closeApp()" type='button'>关闭系统</button>
@ -135,6 +138,7 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var batch = ''
var chartDom = document.getElementById('echarts_main_one'); var chartDom = document.getElementById('echarts_main_one');
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; 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() { function closeApp() {
mui.confirm('确认关闭TMR饲喂系统', '提示', btnArray, function (e) { mui.confirm('确认关闭TMR饲喂系统', '提示', btnArray, function (e) {
if (e.index == 0) {} else { if (e.index == 0) {} else {
@ -246,6 +262,10 @@
} }
function nextCowshed(){ function nextCowshed(){
if(batch === ''){
mui.alert('请先选择班次')
return false
}
if(cowshedName === '收集重量'){ if(cowshedName === '收集重量'){
mui.alert('请先选择圈舍') mui.alert('请先选择圈舍')
return false return false
@ -255,6 +275,7 @@
var obj = JSON.parse(loginUser); var obj = JSON.parse(loginUser);
var remainData = { var remainData = {
cowshedId: cowshedId, cowshedId: cowshedId,
batch: batch,
dateOf: currTimeFn(new Date()), dateOf: currTimeFn(new Date()),
remain: _feedNum, remain: _feedNum,
cowshedName: cowshedName, cowshedName: cowshedName,
@ -374,7 +395,6 @@
}); });
}, false); }, false);
} }
console.log("bleData"+JSON.stringify(bleData));
blePicker.setData(bleData); blePicker.setData(bleData);
}); });
})(mui, document); })(mui, document);

View File

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