<!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/jquery.js"></script>
|
<script src="../../js/jquery-1.11.1.js"></script>
|
<script src="../../js/jquery.xml2json.js.js"></script>
|
<script src="../../js/template-web.js"></script>
|
<link href="../../css/mui.min.css" rel="stylesheet" />
|
<link rel="stylesheet" type="text/css" href="../../css/iconfont.css" />
|
<link rel="stylesheet" type="text/css" href="../lyt/css/common_s.css" />
|
<style>
|
.mui-input-row label {
|
background-color: #F0F0F0;
|
font-size: 1.6rem;
|
}
|
|
.mui-input-row input {
|
font-size: 1.35rem;
|
}
|
|
.mui-input-row select {
|
font-size: 1.35rem;
|
position: absolute;
|
height: 3rem;
|
}
|
|
.mui-input-group .mui-input-row {
|
height: 3.2rem;
|
}
|
|
.font {
|
font-size: 1.6rem;
|
}
|
|
.item-height {
|
height: 4rem;
|
}
|
|
.item-fname {
|
position: absolute;
|
height: 1.8rem;
|
font-size: 1.6rem;
|
color: #000000;
|
}
|
|
.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">
|
<button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left">
|
<span class="mui-icon mui-icon-left-nav"></span>
|
</button>
|
<h1 class="mui-title font">PQC巡检录入</h1>
|
<span class="title-right" id="usr"></span>
|
<span class="title-right mui-icon mui-icon-camera" style="color:#0062CC" id="cameraId"></span>
|
<span class="title-right mui-icon mui-icon-bars" style="color:#0062CC;" id="recodeList"></span>
|
</header>
|
<div class="mui-content">
|
<div class="mui-input-group">
|
<div class="mui-input-row">
|
<label>班次</label>
|
<span class="radio_inline mui-radio">
|
<input name="radio1" type="radio" id="A" value="A">
|
<label for="A" style="background-color: #ffffff;">A</label>
|
<input name="radio1" type="radio" id="B" value="B">
|
<label for="B" style="background-color: #ffffff;">B</label>
|
</span>
|
</div>
|
<div class="mui-input-row">
|
<label>系列</label>
|
<select id="lineType" class="mui-input"></select>
|
</div>
|
<div class="mui-input-row">
|
<label>工序</label>
|
<select id="proc_num"></select>
|
</div>
|
<div class="mui-input-row">
|
<label>时间段</label>
|
<select id="selectPeriod" onchange="selPeriod()">
|
<!-- <option value=""></option> -->
|
</select>
|
</div>
|
<div class="mui-input-row">
|
<label>型号</label>
|
<input id="board_model" type="text" class="mui-input-clear">
|
</div>
|
<div class="mui-input-row">
|
<label>工单</label>
|
<input id="selectBatch" type="text" class="mui-input-clear">
|
</div>
|
<div class="mui-input-row" style="display: none;">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>文件编号</label>
|
<input id="filenum" type="text" class="mui-input-clear">
|
</div>
|
<div class="mui-input-row" style="display: none;">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>文件版本</label>
|
<input id="filever" type="text" class="mui-input-clear">
|
</div>
|
<div class="mui-input-row">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>检验单号</label>
|
<input id="fbill_no" type="text" disabled="disabled" style="background-color: #F5F5F5;"
|
class="mui-input-clear">
|
</div>
|
<div class="mui-input-row" style="display: none;">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>极性</label>
|
<input id="polarity" type="text" disabled="disabled" style="background-color: #F5F5F5;"
|
class="mui-input-clear">
|
</div>
|
<div class="mui-input-row">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>数量</label>
|
<input id="batch_count" type="text" disabled="disabled" style="background-color: #F5F5F5;"
|
class="mui-input-clear">
|
</div>
|
<div class="mui-input-row">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>检验人</label>
|
<input id="check_name" type="text" disabled="disabled" style="background-color: #F5F5F5;"
|
class="mui-input-clear">
|
</div>
|
<div class="mui-input-row">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>检验时间</label>
|
<input id="check_time" type="text" disabled="disabled" style="background-color: #F5F5F5;"
|
class="mui-input-clear">
|
</div>
|
<div class="mui-input-row" style="display: none;">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>批次号</label>
|
<input id="task_no" type="text" disabled="disabled" style="background-color: #F5F5F5;"
|
class="mui-input-clear">
|
</div>
|
|
<div class="mui-input-row">
|
<label onclick="clicked('commom/saomiao.html','premark','web/lyt/PQCxunjian.html');">
|
<span class="mui-icon iconfont icon-saomiao" id="num1"></span>备注信息
|
</label>
|
<input id="premark" type="text" class="mui-input-clear">
|
</div>
|
<div class="mui-input-row">
|
<label><span class="mui-icon iconfont" style="color: #FF8C00;"></span>检验结果</label>
|
<input id="presult" type="text" disabled="disabled" style="background-color: #F5F5F5;"
|
class="mui-input-clear">
|
</div>
|
<div class="mui-input-row" style="display: none;">
|
<ul class="mui-table-view">
|
<li class="mui-table-view-cell acss" id="getOkBtn"
|
style="width:100%;background-color: rgb(153,204,153);">
|
<a class="font">获取合格结果</a>
|
</li>
|
</ul>
|
</div>
|
<div class="mui-input-row">
|
<ul class="mui-table-view">
|
<li class="mui-table-view-cell acss" id="doAppearance"
|
style="width:100%;background-color: rgb(255, 145, 0);">
|
<a class="font">外观一键合格</a>
|
</li>
|
</ul>
|
</div>
|
<div class="mui-input-row">
|
<label>最终结果</label>
|
<span class="radio_inline mui-radio">
|
<input name="final_result" type="radio" value="合格">
|
<label for="合格" style="background-color: #ffffff;">合格</label>
|
<input name="final_result" type="radio" value="不合格">
|
<label for="不合格" style="background-color: #ffffff;">不合格</label>
|
</span>
|
</div>
|
<div class="mui-input-row" style="display: none;">
|
<ul class="mui-table-view" id="submitBtn">
|
<li class="mui-table-view-cell acss"
|
style="width:50%;float: left;background-color: rgb(184, 245, 184)">
|
<a class="font" data-code='送检'>送检</a>
|
</li>
|
<li class="mui-table-view-cell acss" style="width:50%;background-color: rgb(255, 167, 126)">
|
<a class="font" data-code='撤销送检'>撤销送检</a>
|
</li>
|
</ul>
|
</div>
|
<div class="mui-input-row">
|
<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='提交'>提交</a>
|
</li>
|
<li class="mui-table-view-cell acss" style="width:50%;background-color: rgb(255,153,102)">
|
<a class="font" data-code='撤销提交'>撤销提交</a>
|
</li>
|
</ul>
|
</div>
|
<div class="mui-input-row">
|
<ul class="mui-table-view">
|
<li class="mui-table-view-cell acss" id="delBtn"
|
style="width:100%;background-color: rgb(255, 145, 0);">
|
<a class="font" data-code='删除'>删除</a>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<script id='ui-template' type="text/template">
|
<% for(var i in record){ var item=record[i];var n = i>10?i%10:i; var colors=['99CCFF','FFCC33','FFFF33','FFCC00','66CC00','FFFF99','FF9900','FFFF00','0099CC','FFCC00','CCCC00'];var c=colors[n]; %>
|
<li class="mui-table-view-cell mui-media item-height">
|
<a href="javascript:;" class="mui-navigate-right font" id="<%=(item.ID)%>" sample_qty="<%=(item.CHECK_NUMBER)%>" fis_quan="<%=(item.FIS_QUAN)%>" mid="<%=(item.MID)%>" fname="<%=(item.FNAME)%>">
|
{{if item.FCHECK_RESULT=='合格'}}
|
<div class="font-seal font" style="color: #4CD964;border: 1px solid #4CD964"><%=(item.FCHECK_RESULT)%></div>
|
{{else if item.FCHECK_RESULT=='不合格'}}
|
<div class="font-seal font"><%=(item.FCHECK_RESULT)%></div>
|
{{else if item.FCHECK_RESULT=='/'}}
|
<div class="font-seal font" style="color: #4CD964;border: 1px solid #4CD964"><%=(item.FCHECK_RESULT)%></div>
|
{{else}}
|
{{/if}}
|
<span class="mui-media-object mui-pull-left" style="border-radius: 50%; height: 30px; width: 30px; display: inline-block; background: #<%=(c)%>; vertical-align: top;">
|
<span style="display: block; color: #FFFFFF; height: 30px; line-height: 30px; text-align: center"><%=(++i)%></span> </span>
|
</span>
|
<div class="mui-media-body">
|
<p class="item-fname"><%=(item.FNAME)%>
|
<%if(item.FLOWER){%>
|
<%=(item.FLOWER)%>-<%=(item.FUPPER)%>
|
<%}%></p><br>
|
<p class='mui-ellipsis' style="font-size: 1.2rem;"><%=(item.FREQU)%></p>
|
</div>
|
</a>
|
</li>
|
<% } %>
|
</script>
|
<input type="hidden" id="flot" value="" />
|
<input type="hidden" id="mid" value="" />
|
<ul class="mui-table-view" id="ulId">
|
</ul>
|
</div>
|
<script type="text/javascript" charset="utf-8">
|
window.addEventListener('refresh', function(e) { //监听页面返回事件
|
if ($("#flot").val() != "") {
|
getBacthInfoDet()
|
} else {
|
getDataById($('#fbill_no').val())
|
}
|
});
|
window.addEventListener("changeModel", function(e) {
|
var stat = e.detail.flot;
|
$("#board_model").val(stat)
|
clear()
|
})
|
window.addEventListener('changeBatch', function(e) {
|
//获取参数值
|
var stat = e.detail.task; //显示在页面上
|
var task = e.detail.flot //实际传递的值
|
//console.log(stat)
|
//console.log(task)
|
if (stat && task) {
|
$("#flot").val(task)
|
$("#selectBatch").val(stat)
|
var checkValue1 = $('input:radio[name="radio1"]:checked').val();
|
// var checkValue2 = $('input:radio[name="radio2"]:checked').val();
|
var checkValue2 = $('#lineType').val();
|
var period = $('#selectPeriod').val();
|
var batch = $("#flot").val()
|
if (checkValue1 != null && checkValue2 != "" && batch != "" && period != "" && batch != null) {
|
getBacthInfoDet()
|
}
|
}
|
});
|
// 监听记录查询 如果状态为待提交,获得待提交的检验单号
|
window.addEventListener('restart', function(e) {
|
var mid_id = e.detail.mid_id
|
getDataById(mid_id) // 检验单号
|
})
|
window.addEventListener("changeBar", function(e) { //扫码之后返回的数据
|
var inputId = e.detail.inputId
|
document.getElementById(inputId).value = e.detail.barcode;
|
if (inputId == "premark") {
|
var ftableName = "pqc_testbill_main"
|
var fchangeName = "FNG_REASON"
|
var fvalues = e.detail.barcode;
|
modifyValue(ftableName, fchangeName, fvalues)
|
}
|
});
|
mui.init({});
|
mui.plusReady(function() {
|
document.getElementById("usr").innerHTML = setUsrCode()
|
doAppearance()
|
getLineType()
|
getOkBtn()
|
//跳转到上传附件页面
|
document.getElementById('cameraId').addEventListener('tap', function(event) {
|
var mid = document.getElementById('mid').value;
|
if (mid == '' || mid == 'undefined') {
|
mui.toast('请先填写选择批次号')
|
return;
|
}
|
mui.openWindow({
|
id: 'PQC_pictrue_add',
|
url: 'PQC_pictrue_add.html?mid=' + mid + '&type=11',
|
extras: {
|
urlPath: storage["_basePath"] + '/lyt_file/uploadFilepqc',
|
getImgUrl: "/lyt_file/getFilesList",
|
getviewUrl: storage["_basePath"] + '/lyt_file/view',
|
},
|
waiting: { // 控制 弹出转圈框的信息
|
autoShow: true, //自动显示等待框,默认为true
|
title: '加载中' //等待对话框上显示的提示内容
|
}
|
});
|
|
});
|
//查询型号
|
document.getElementById('board_model').addEventListener('tap', function(event) {
|
if ($("#proc_num").val() == "" || $("#proc_num").val() == null) {
|
mui.toast("请先选择工序", {
|
duration: 'long',
|
type: 'div'
|
})
|
return false;
|
} else {
|
mui.openWindow({
|
id: 'pqc_task_xunjian',
|
url: 'pqc_task_xunjian.html',
|
extras: {
|
searchType: "型号",
|
urlId: "/pqc_patrol_input/getPatrolBatchNum",
|
fparam: {
|
"procno": $("#proc_num").val(),
|
"modelno": "",
|
"period": $("#selectPeriod").val(),
|
"lineType": $("#lineType").val()
|
}
|
},
|
waiting: { // 控制 弹出转圈框的信息
|
autoShow: true, //自动显示等待框,默认为true
|
title: '加载中' //等待对话框上显示的提示内容
|
}
|
});
|
}
|
});
|
//查询工单
|
document.getElementById('selectBatch').addEventListener('tap', function(event) {
|
if ($("#proc_num").val() == "" || $("#proc_num").val() == null ||
|
$("#board_model").val() == "" || $("#board_model").val() == null) {
|
mui.toast("请先选择工序和型号", {
|
duration: 'long',
|
type: 'div'
|
})
|
return false;
|
} else {
|
mui.openWindow({
|
id: 'pqc_task_xunjian',
|
url: 'pqc_task_xunjian.html',
|
extras: {
|
searchType: "工单",
|
urlId: "/pqc_patrol_input/getPatrolBatchNum",
|
fparam: {
|
"procno": $("#proc_num").val(),
|
"modelno": $("#board_model").val(),
|
"period": $("#selectPeriod").val()
|
}
|
},
|
waiting: { // 控制 弹出转圈框的信息
|
autoShow: true, //自动显示等待框,默认为true
|
title: '加载中' //等待对话框上显示的提示内容
|
}
|
});
|
}
|
});
|
})
|
|
//修改备注
|
$('#premark').bind('keyup', function(event) {
|
if (event.keyCode == "13") { //输入回车执行
|
var ftableName = "pqc_testbill_main"
|
var fchangeName = "fng_reason"
|
var fvalues = $('#premark').val()
|
modifyValue(ftableName, fchangeName, fvalues)
|
}
|
});
|
|
//修改字段数据
|
function modifyValue(ftableName, fchangeName, fvalues) { //表名,字段名,字段值
|
var fmid = document.getElementById('mid').value;
|
if (fmid == '' || fmid == 'undefined') {
|
mui.toast('请先填写选择批次号', {
|
duration: 'long',
|
type: 'div'
|
})
|
return false;
|
}
|
aj.post('/pqc_first_input/modifyPQCValue', {
|
"factory": api_localStorageGet("factory"),
|
"company": api_localStorageGet("company"),
|
userNo: api_localStorageGet("code"),
|
mid: fmid,
|
tableName: ftableName, //表名
|
changeName: fchangeName, //字段名
|
changeValue: fvalues, //字段值
|
}, function(data) {
|
if (data.result) {
|
console.log(JSON.stringify(data))
|
mui.toast('修改成功', {
|
duration: 'long',
|
type: 'div'
|
})
|
} else {
|
mui.alert(data.msg)
|
}
|
})
|
}
|
|
|
$('input:radio[name="radio1"]').click(function() {
|
var checkValue1 = $('input:radio[name="radio1"]:checked').val();
|
// var checkValue2 = $('input:radio[name="radio2"]:checked').val();
|
var checkValue2 = $('#lineType').val();
|
if (checkValue1 != null && checkValue2 != "") {
|
getProcInfo()
|
}
|
var batch = $("#flot").val()
|
if (batch != "") {
|
cleanDet()
|
}
|
})
|
|
$('input:radio[name="final_result"]').click(function() {
|
setFinal()
|
})
|
//修改最终结果
|
function setFinal() {
|
var fvalues = $('input:radio[name="final_result"]:checked').val();
|
var ftableName = "pqc_testbill_main"
|
var fchangeName = "ffinal_result"
|
modifyValue(ftableName, fchangeName, fvalues)
|
}
|
|
$("#lineType").on("change", function(e) {
|
var checkValue1 = $('input:radio[name="radio1"]:checked').val();
|
//var checkValue2 = $('input:radio[name="radio2"]:checked').val();
|
var checkValue2 = $('#lineType').val();
|
if (checkValue1 != null && checkValue2 != '') {
|
getProcInfo()
|
}
|
clear()
|
document.getElementById('board_model').value = ''
|
})
|
|
function selPeriod() { //选择时间段的触发事件
|
clear()
|
document.getElementById('board_model').value = ''
|
}
|
|
$("#proc_num").on("change", function() {
|
getPeriodData()
|
clear()
|
document.getElementById('board_model').value = ''
|
})
|
|
// 记录查询中状态为待提交,根据待提交的检验单号查询数据
|
function getDataById(mid_id) {
|
aj.post("/pqc_patrol_input/getBillReturn", {
|
"billNo": mid_id
|
}, function(data) {
|
// console.log(JSON.stringify(data.data.MAIN))
|
if (data.result) {
|
var main = data.data.MAIN[0]
|
$("#lineType").val(main.LINE_TYPE)
|
if (main.CLASS_NO == 'A') {
|
$('input:radio[name="radio1"]').eq(0).prop("checked", true)
|
} else if (main.CLASS_NO == 'B') {
|
$('input:radio[name="radio1"]').eq(1).prop("checked", true)
|
}
|
|
// 先获取到工序的option选项
|
var checkValue1 = $('input:radio[name="radio1"]:checked').val();
|
var checkValue2 = $('#lineType').val();
|
if (checkValue1 != null && checkValue2 != "") {
|
getProcInfo()
|
}
|
// 根据返回的工序编码选择option对应的工序名称
|
var opts = document.getElementById("proc_num");
|
var value = main.PROC_NO //这个值就是你获取的值;
|
// console.log(value)
|
if (value != "") {
|
// console.log(opts.options.length)
|
for (var i = 0; i < opts.options.length; i++) {
|
if (value == opts.options[i].value) {
|
opts.options[i].selected = 'selected';
|
// alert(opts.options[i].value);
|
break;
|
}
|
}
|
}
|
|
// 先获取到时间段的option选项
|
var mproc = $('#proc_num').val();
|
if (checkValue1 != "" || mproc != "" || checkValue1 != undefined || mproc != null) {
|
getPeriodData()
|
}
|
// 根据返回的时间段选择option对应的时间段
|
opts = document.getElementById("selectPeriod");
|
value = main.TIME_SLOT //这个值就是你获取的值;
|
if (value != "") {
|
for (var i = 0; i < opts.options.length; i++) {
|
if (value == opts.options[i].value) {
|
opts.options[i].selected = 'selected';
|
break;
|
}
|
}
|
}
|
|
$('#board_model').val(main.BOARD_MODEL) //型号
|
$('#selectBatch').val(main.FLOT_NO) // 工单
|
$("#batch_count").val(main.FLOT_QTY) //数量
|
$('#check_name').val(main.USFNAME) // 检验人员
|
$('#check_time').val(main.FTEST_DATE) //检验时间
|
$('#fbill_no').val(main.FBILL_NO) // 检验单号
|
$("#presult").val(main.FCHECK_RESULT) //检验结果
|
$("#premark").val(main.FNG_REASON) //备注信息
|
$("#mid").val(main.ID) //主表ID
|
if (main.FFINAL_RESULT == "合格") { // 最终结果
|
$('input:radio[name="final_result"]').eq(0).prop("checked", true)
|
} else if (main.FFINAL_RESULT == "不合格") {
|
$('input:radio[name="final_result"]').eq(1).prop("checked", true)
|
} else { //都未选择
|
var final_result = document.getElementsByName("final_result");
|
for (var i = 0; i < final_result.length; i++) {
|
if (final_result[i].checked == true) {
|
final_result[i].checked = false;
|
final_result[i].removeAttribute("checked");
|
}
|
}
|
}
|
|
//渲染检验项目
|
var cursor2 = checkZero(data.data.SUB) //对小数点前丢失的0进处理
|
document.getElementById('ulId').innerHTML = template('ui-template', {
|
"record": cursor2
|
});
|
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',
|
type: 'div'
|
});
|
}
|
});
|
}
|
|
function getBacthInfoDet() {
|
aj.post('/pqc_patrol_input/getPatrolBatchNumInfo', {
|
"factory": api_localStorageGet("factory"),
|
"company": api_localStorageGet("company"),
|
"userNo": api_localStorageGet("code"),
|
"lineType": $("#lineType").val(),
|
"procNo": $("#proc_num").val(),
|
"lotNo": $("#flot").val(),
|
"classNo": $("input[name='radio1']:checked").val(),
|
"period": $("#selectPeriod").val(),
|
}, function(data) {
|
if (data.result) {
|
// console.log(JSON.stringify(data.data.cursor1))
|
//console.log(JSON.stringify(data.data.cursor2))
|
//数值填置
|
var cursor1 = data.data.cursor1
|
$("#filenum").val(cursor1[0].FILE_NO)
|
$("#filever").val(cursor1[0].FILE_VERSION)
|
$("#proc_num").val(cursor1[0].PROC_NO)
|
$("#check_name").val(cursor1[0].BNAME)
|
$("#check_time").val(cursor1[0].FTEST_DATE)
|
$("#board_model").val(cursor1[0].BOARD_MODEL)
|
$("#batch_count").val(cursor1[0].FLOT_QTY)
|
$("#machine").val(cursor1[0].MACHINE_NO)
|
$("#task_no").val(cursor1[0].TASK_NO)
|
$("#presult").val(cursor1[0].FCHECK_RESULT)
|
$("#premark").val(cursor1[0].FNG_REASON)
|
$("#mid").val(cursor1[0].ID)
|
$("#polarity").val(cursor1[0].POLAR_TYPE)
|
$("#fbill_no").val(cursor1[0].FBILL_NO);
|
|
if (cursor1[0].FFINAL_RESULT == "合格") {
|
$('input:radio[name="final_result"]').eq(0).prop("checked", true)
|
} else if (cursor1[0].FFINAL_RESULT == "不合格") {
|
$('input:radio[name="final_result"]').eq(1).prop("checked", true)
|
} else { //都未选择
|
var final_result = document.getElementsByName("final_result");
|
for (var i = 0; i < final_result.length; i++) {
|
if (final_result[i].checked == true) {
|
final_result[i].checked = false;
|
final_result[i].removeAttribute("checked");
|
}
|
}
|
}
|
|
//填置列表
|
var cursor2 = checkZero(data.data.cursor2) //对小数点前丢失的0进处理
|
document.getElementById('ulId').innerHTML = template('ui-template', {
|
"record": cursor2
|
});
|
} else {
|
clear()
|
document.getElementById('board_model').value = ''
|
$("#flot").val("")
|
$("#selectBatch").val("")
|
$("#selectPeriod").val("")
|
mui.alert(data.msg)
|
}
|
})
|
}
|
|
function getPeriodData() {
|
var checkValue1 = $('input:radio[name="radio1"]:checked').val();
|
var mproc = $('#proc_num').val();
|
if (checkValue1 == "" || mproc == "" || checkValue1 == undefined || mproc == null) {
|
mui.toast("请先选择班次和工序", {
|
duration: 'long',
|
type: 'div'
|
})
|
return;
|
} else {
|
$.ajax({
|
url: storage['_basePath'] + "/pqc_patrol_input/getPeriod",
|
data: {
|
"factory": api_localStorageGet("factory"),
|
"company": api_localStorageGet("company"),
|
"classNo": checkValue1,
|
"proc": mproc
|
},
|
type: 'post',
|
dataType: "json",
|
async: false,
|
success: function(data) {
|
// console.log(JSON.stringify(data))
|
if (data.result) {
|
var period = data.data
|
$("#selectPeriod").empty()
|
$("#selectPeriod").append("<option value=''>请选择时间段</option>")
|
for (var i = 0; i < period.length; i++) {
|
$("#selectPeriod").append("<option value=" + period[i].TIME_SLOT + ">" + period[
|
i]
|
.TIME_SLOT + "</option>")
|
}
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',
|
type: 'div'
|
});
|
}
|
}
|
});
|
// aj.post("/pqc_patrol_input/getPeriod", {
|
// "factory": api_localStorageGet("factory"),
|
// "company": api_localStorageGet("company"),
|
// "classNo": checkValue1,
|
// "proc": mproc
|
// }, function(data) {
|
// console.log(JSON.stringify(data))
|
// if (data.result) {
|
// var period = data.data
|
// $("#selectPeriod").empty()
|
// $("#selectPeriod").append("<option value=''>请选择时间段</option>")
|
// for (var i = 0; i < period.length; i++) {
|
// $("#selectPeriod").append("<option value=" + period[i].TIME_SLOT + ">" + period[i]
|
// .TIME_SLOT + "</option>")
|
// }
|
// } else {
|
// mui.toast(data.msg, {
|
// duration: 'long',
|
// type: 'div'
|
// });
|
// }
|
// });
|
}
|
|
}
|
|
// function getProcInfo() {
|
// aj.post("/pqc_patrol_input/getPatrolBatchNum", {
|
// "factory": api_localStorageGet("factory"),
|
// "company": api_localStorageGet("company"),
|
// "ftype": "工序",
|
// "period": "",
|
// "procno": "",
|
// "modelno": "",
|
// "keyword": $("#lineType").val()
|
// }, function(data) {
|
// if (data.result) {
|
// //console.log(JSON.stringify(data) )
|
// $("#proc_num").empty()
|
// var data = data.data
|
// $("#proc_num").append("<option value=''>请选择</option>")
|
// for (var i = 0; i < data.length; i++) {
|
// var list = data[i]
|
// $("#proc_num").append("<option value=" + list.PROC_NO + ">" + list.PROC_NAME + "</option>")
|
// }
|
// } else {
|
// mui.toast(data.msg, {
|
// duration: 'long',
|
// type: 'div'
|
// });
|
// }
|
// });
|
// }
|
|
function getProcInfo() {
|
$.ajax({
|
url: storage['_basePath'] + "/pqc_patrol_input/getPatrolBatchNum",
|
data: {
|
"factory": api_localStorageGet("factory"),
|
"company": api_localStorageGet("company"),
|
"ftype": "工序",
|
"period": "",
|
"procno": "",
|
"modelno": "",
|
"keyword": $("#lineType").val()
|
},
|
type: 'post',
|
dataType: "json",
|
async: false,
|
success: function(data) {
|
if (data.result) {
|
//console.log(JSON.stringify(data) )
|
$("#proc_num").empty()
|
var data = data.data
|
$("#proc_num").append("<option value=''>请选择</option>")
|
for (var i = 0; i < data.length; i++) {
|
var list = data[i]
|
$("#proc_num").append("<option value=" + list.PROC_NO + ">" + list.PROC_NAME +
|
"</option>")
|
}
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',
|
type: 'div'
|
});
|
}
|
}
|
});
|
}
|
|
//外观一键合格
|
function doAppearance() {
|
document.querySelector('#doAppearance').addEventListener('tap', function() {
|
var flotId = document.getElementById('mid').value;
|
aj.post("/pqc_first_input/setOK", {
|
"factory": api_localStorageGet("factory"),
|
"company": api_localStorageGet("company"),
|
"userNo": api_localStorageGet("code"),
|
"checkId": flotId
|
}, function(data) {
|
//console.log(JSON.stringify(data))
|
if (data.result) {
|
if ($("#flot").val() != "") {
|
getBacthInfoDet()
|
} else {
|
getDataById($('#fbill_no').val())
|
}
|
mui.toast("操作成功", {
|
duration: 'long',
|
type: 'div'
|
})
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',
|
type: 'div'
|
});
|
}
|
});
|
});
|
}
|
|
function getOkBtn() {
|
document.querySelector('#getOkBtn').addEventListener('tap', function() {
|
var flotId = document.getElementById('mid').value;
|
aj.post("/pqc_patrol_input/getOkResult", {
|
"factory": api_localStorageGet("factory"),
|
"company": api_localStorageGet("company"),
|
"userNo": api_localStorageGet("code"),
|
"mid": flotId
|
}, function(data) {
|
//console.log(JSON.stringify(data))
|
if (data.result) {
|
getBacthInfoDet()
|
mui.toast("操作成功!", {
|
duration: 'long',
|
type: 'div'
|
})
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',
|
type: 'div'
|
});
|
}
|
});
|
});
|
}
|
|
function getLineType() {
|
aj.post("/pqc_patrol_input/getPatrolBatchNum", {
|
"factory": api_localStorageGet("factory"),
|
"company": api_localStorageGet("company"),
|
"ftype": "产线类型",
|
"period": "",
|
"procno": "",
|
"modelno": "",
|
"keyword": ""
|
}, function(data) {
|
if (data.result) {
|
//console.log(JSON.stringify(data) )
|
$("#lineType").empty()
|
var data = data.data
|
$("#lineType").append("<option value=''>请选择</option>")
|
for (var i = 0; i < data.length; i++) {
|
var list = data[i]
|
$("#lineType").append("<option value=" + list.LOOKUP_NAME + ">" + list.LOOKUP_NAME +
|
"</option>")
|
}
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',
|
type: 'div'
|
});
|
}
|
});
|
}
|
|
mui("#submitBtn").on("tap", "a", function(event) {
|
var code = this.getAttribute('data-code');
|
doSubmit(code);
|
})
|
mui("#submitBtn1").on("tap", "a", function(event) {
|
var code = this.getAttribute('data-code');
|
if (code == "提交") {
|
checker()
|
} else {
|
doSubmit(code);
|
}
|
})
|
|
mui("#delBtn").on("tap", "a", function(event) {
|
var elem = this;
|
var btnArray = ['确认', '取消'];
|
mui.confirm('确认删除该条记录?', '系统提示', btnArray, function(e) {
|
if (e.index == 0) {
|
var code = elem.getAttribute('data-code');
|
doSubmit(code);
|
}
|
});
|
})
|
|
function doSubmit(opertype) {
|
var mid = document.getElementById('mid').value;
|
if (mid == '' || mid == 'undefined') {
|
mui.toast('请先填写选择批次号', {
|
duration: 'long',
|
type: 'div'
|
})
|
return;
|
}
|
aj.post("/pqc_first_input/submitInfo", {
|
factory: api_localStorageGet("factory"),
|
company: api_localStorageGet("company"),
|
userNo: api_localStorageGet("code"),
|
checkId: mid,
|
operaType: opertype,
|
remarks: document.getElementById('premark').value
|
}, function(data) {
|
// console.log(JSON.stringify(data))
|
if (data.result) {
|
mui.toast('操作成功', {
|
duration: 'long',
|
type: 'div'
|
});
|
if (opertype == '删除') {
|
clear()
|
document.getElementById('board_model').value = ''
|
$("#flot").val("")
|
$("#selectBatch").val("")
|
}
|
} else {
|
mui.toast(data.msg, {
|
duration: 'long',
|
type: 'div'
|
});
|
}
|
});
|
}
|
|
function checker() {
|
var mid = document.getElementById('mid').value;
|
if (mid == '' || mid == 'undefined') {
|
mui.toast('请先填写选择批次号', {
|
duration: 'long',
|
type: 'div'
|
})
|
return;
|
}
|
var presult = document.getElementById('presult').value;
|
if (presult == '' || presult == 'undefined') {
|
mui.toast('检验结果为空,请检查', {
|
duration: 'long',
|
type: 'div'
|
})
|
return;
|
}
|
mui.openWindow({
|
id: 'pqc_checker',
|
url: 'pqc_checker.html',
|
extras: {
|
searchType: "checker",
|
urlId: "/pqc_first_input/getChecker",
|
fparam: {
|
"checkTask": $('#fbill_no').val(),
|
"mid": mid,
|
"premark": document.getElementById('premark').value
|
}
|
},
|
waiting: { // 控制 弹出转圈框的信息
|
autoShow: true, //自动显示等待框,默认为true
|
title: '加载中' //等待对话框上显示的提示内容
|
}
|
});
|
}
|
|
mui("#ulId").on("tap", "a", function() {
|
var id = this.getAttribute('id');
|
var fis_quan = this.getAttribute('fis_quan');
|
var fname = this.getAttribute('fname')
|
var lineType = $("#lineType").val()
|
var fboard_model = $("#board_model").val()
|
var url = 'PQC_check_add_update.html?did=' + id + '&num=' + this.getAttribute('sample_qty') +
|
'&mid=' + this.getAttribute('mid') + '&proc=' + $("#proc_num").val() + '&board_model=' +
|
encodeURI(
|
fboard_model) +
|
'&lineType=' + encodeURI(lineType) + '&fname=' + encodeURI(fname);
|
mui.openWindow({
|
id: id,
|
url: url,
|
extras: {
|
//自定义扩展参数,可以用来处理页面间传值
|
fis_quan: fis_quan
|
},
|
waiting: { // 控制 弹出转圈框的信息
|
autoShow: true, //自动显示等待框,默认为true
|
title: '加载中' //等待对话框上显示的提示内容
|
}
|
});
|
})
|
|
|
//清空数据
|
function clearUi() {
|
document.getElementById('ulId').innerHTML = template('ui-template', {
|
"record": []
|
});
|
document.getElementById('mid').value = '';
|
document.getElementById('flot').value = '';
|
document.getElementById('selectBatch').value = ''
|
var final_result = document.getElementsByName("final_result");
|
for (var i = 0; i < final_result.length; i++) {
|
if (final_result[i].checked == true) {
|
final_result[i].checked = false;
|
final_result[i].removeAttribute("checked");
|
}
|
}
|
}
|
|
function cleanDet() {
|
document.getElementById('filenum').value = ''
|
document.getElementById('filever').value = ''
|
//$("#selectBatch").empty()
|
//document.getElementById('proc_num').value = ''
|
document.getElementById('batch_count').value = ''
|
// document.getElementById('machine').value = ''
|
document.getElementById('task_no').value = ''
|
document.getElementById('premark').value = ''
|
document.getElementById('presult').value = ''
|
document.getElementById('polarity').value = ''
|
$('#fbill_no').val('');
|
clearUi()
|
}
|
|
function clear() {
|
cleanDet()
|
}
|
|
//对小数点前丢失的0进处理
|
function checkZero(cursor) {
|
for (var j = 0; j < cursor.length; j++) {
|
if (cursor[j].FLOWER != null) {
|
var f = cursor[j].FLOWER.substr(0, 1)
|
if (f == ".") {
|
var t = cursor[j].FLOWER.split(""); // 字符串处理
|
t.splice(0, 0, "0");
|
t = t.join("")
|
cursor[j].FLOWER = t
|
}
|
}
|
if (cursor[j].FUPPER != null) {
|
var f = cursor[j].FUPPER.substr(0, 1)
|
if (f == ".") {
|
var t = cursor[j].FUPPER.split(""); // 字符串处理
|
t.splice(0, 0, "0");
|
t = t.join("")
|
cursor[j].FUPPER = t
|
}
|
}
|
}
|
return cursor;
|
}
|
|
document.getElementById('recodeList').addEventListener('tap', function(e) {
|
mui.openWindow({
|
id: 'search_xunjian_record',
|
url: 'search_xunjian_record.html',
|
extras: {
|
searchType: "1025", //首检:1015
|
urlId: "/pqc_patrol_input/getRecordList",
|
},
|
waiting: { // 控制 弹出转圈框的信息
|
autoShow: true, //自动显示等待框,默认为true
|
title: '加载中' //等待对话框上显示的提示内容
|
}
|
});
|
})
|
|
function clicked(url, f1, urlId) {
|
OpenWindow(f1, url, {
|
urlId: urlId,
|
inputId: f1,
|
premark: $("#premark").val()
|
});
|
};
|
</script>
|
</body>
|
</html>
|