<!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" />
|
<script src="../../js/mui.min.js"></script>
|
<script src="../../js/api.js"></script>
|
<script src="../../js/common.js"></script>
|
<script src="../../js/template-web.js"></script>
|
<link href="../../css/mui.min.css" rel="stylesheet" />
|
<link href="../../css/mui.picker.min.css" rel="stylesheet" />
|
<link rel="stylesheet" type="text/css" href="../../css/iconfont.css" />
|
<script src="../../js/mui.picker.min.js"></script>
|
<style type="text/css">
|
.mui-content {
|
margin-top: 2px;
|
}
|
|
.search {
|
border: 1px solid #e0e0e0;
|
border-radius: 5px;
|
display: flex;
|
width: 100%;
|
align-items: center;
|
margin-top: 10px;
|
/* padding:0px 10px 0;*/
|
background-color: rgba(255, 255, 255, 1);
|
padding-left: 10px;
|
margin-bottom: 10px;
|
height: 40px;
|
}
|
|
.search input {
|
margin-bottom: 2px;
|
padding: 0px 0px;
|
background: none;
|
font-size: 1.6rem;
|
}
|
|
.font {
|
font-size: 1.6rem;
|
}
|
|
.item-height {
|
height: 3.5rem;
|
}
|
|
.mui-switch:before {
|
content: '未选';
|
color: #999;
|
}
|
|
.mui-switch.mui-active:before {
|
content: '已选';
|
color: #fff;
|
}
|
.mui-toast-container {
|
top: 50% !important;
|
}
|
|
.mui-toast-message {
|
font-size: 1rem;
|
padding: 10px 25px;
|
text-align: center;
|
color: #fff;
|
border-radius: 6px;
|
background-color: #323232;
|
}
|
</style>
|
</head>
|
|
<body class="mui-fullscreen">
|
<header class="mui-bar mui-bar-nav">
|
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
<h1 class="mui-title font">选择会签人</h1>
|
<span class="title-right" id="usr"></span>
|
<span class="title-right mui-icon mui-icon-camera" style="color:#ffffff;" id="cameraId"></span>
|
</header>
|
<div class="mui-content">
|
<!-- <div class="search">
|
<input type="search" class="mui-input-clear" id="keyword" placeholder="输入关键字查询">
|
<button type="button" data-loading-text="查询中" id="searchBtn" style="font-size:1.3rem;"
|
class="mui-btn mui-btn-green mui-icon mui-icon-plus">点击查询</button>
|
</div> -->
|
<div class="mui-scroll">
|
<ul class="mui-table-view" style="margin-top: 2px;" id="checker_list">
|
</ul>
|
<div class="mui-input-row" id="anniu">
|
<ul class="mui-table-view" id="submitBtn1">
|
<li class="mui-table-view-cell acss"
|
style="width:50%;float: left;background-color: rgb(153,204,153)">
|
<a class="font" data-code='提交' style="text-align: center;">确认</a>
|
</li>
|
<li class="mui-table-view-cell acss" style="width:50%;background-color: rgb(255,153,102)">
|
<a class="font" data-code='取消' style="text-align: center;">取消</a>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<script id='checker-template' type="text/template">
|
<% for(var i in record){ var item=record[i]; %>
|
<li class="mui-table-view-cell item-height" data-flot= "<%=(item.FNAME)%>">
|
<a class="mui-navigate-right font"><%=(item.FNAME)%></a>
|
<%if(item.SELECT_OK=='1'){%>
|
<div class="mui-switch mui-active" style="float: right;" data-index="<%=(i)%>" id="<%=(item.ID)%>">
|
<div class="mui-switch-handle"></div>
|
</div>
|
<%}else{%>
|
<div class="mui-switch" style="float: right;" data-index="<%=(i)%>" id="<%=(item.ID)%>">
|
<div class="mui-switch-handle"></div>
|
</div>
|
<%}%>
|
</li>
|
<% } %>
|
</script>
|
|
</div>
|
<script type="text/javascript" charset="utf-8">
|
mui.init({});
|
var urlId = '';
|
var checkTask = ""
|
var mid = ""
|
var premark =""
|
mui.plusReady(function() {
|
document.getElementById("usr").innerHTML = setUsrCode()
|
urlId = plus.webview.currentWebview().urlId;
|
searchType = plus.webview.currentWebview().searchType;
|
fparam = plus.webview.currentWebview().fparam;
|
checkTask = fparam.checkTask
|
mid = fparam.mid
|
premark = fparam.premark
|
getData(fparam.checkTask);
|
})
|
|
function getData(checkTask) {
|
aj.post(urlId, {
|
"checkTask": checkTask
|
}, function(data) {
|
// console.log(JSON.stringify(data))
|
if (data.result) {
|
if(data.data.cursor1==""){
|
mui.toast("检验人为空", {
|
duration: 'long',type:'div'
|
});
|
document.getElementById("anniu").style.display="none"
|
}
|
document.getElementById('checker_list').innerHTML = template('checker-template', {
|
"record": data.data.cursor1
|
});
|
|
|
for(var i=0;i<data.data.cursor1.length;i++){
|
mui('.mui-switch')['switch'](); //手动初始化
|
var main = data.data.cursor1[i]
|
if (main.SELECT_OK == '1') {
|
document.getElementById(main.ID).classList.add('mui-active');
|
} else {
|
document.getElementById(main.ID).classList.remove('mui-active');
|
}
|
}
|
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',type:'div'
|
});
|
}
|
});
|
}
|
|
mui("#submitBtn1").on("tap", "a", function(event) {
|
var code = this.getAttribute('data-code');
|
if(code=="取消"){
|
mui.back()
|
}else if(code=="提交"){
|
aj.post("/pqc_first_input/submitInfo", {
|
factory: api_localStorageGet("factory"),
|
company: api_localStorageGet("company"),
|
userNo: api_localStorageGet("code"),
|
checkId: mid,
|
operaType: code,
|
remarks: premark
|
}, function(data) {
|
// console.log(JSON.stringify(data))
|
mui.back()
|
if (data.result) {
|
mui.toast('操作成功', {
|
duration: 'long',type:'div'
|
});
|
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',type:'div'
|
});
|
}
|
});
|
|
}
|
})
|
|
mui("#checker_list").on("toggle", ".mui-switch", function(event) {
|
var id = this.getAttribute('id');
|
var index = this.getAttribute('data-index');
|
var va = '0'; //未选
|
var isActive = document.getElementById(id).classList.contains("mui-active");
|
if(!isActive){ //已选
|
va = '0'
|
}else{
|
va = '1'
|
}
|
saveValues(id, va, checkTask);
|
|
})
|
|
function saveValues(id, value, billNo) { //ID,值,单号
|
aj.post("/pqc_first_input/updataChecker", {
|
"id":id,
|
"status":value,
|
"billNo":billNo
|
}, function(data) {
|
if (data.result) {
|
//console.log(JSON.stringify(data))
|
mui.toast('修改成功!', {
|
duration: 'long',type:'div'
|
});
|
//getData()
|
} else {
|
// mui('.mui-switch').switch().toggle();
|
//console.log(JSON.stringify(data))
|
mui.toast(data.msg, {
|
duration: 'long',type:'div'
|
});
|
}
|
});
|
}
|
|
</script>
|
</body>
|
|
</html>
|