Commit 532295fe authored by 李苏's avatar 李苏 💬

加工反馈

parent 4d332a13
<script src="js/pdfshow.js" type="text/javascript" charset="utf-8"></script>
<script src="js/dbenlarge.js" type="text/javascript" charset="utf-8"></script>
<script src="js/gethash.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="css/zpfk.css"/>
<style type="text/css">
video{
object-fit:cover!important;
}
.errdialog{
min-width:35%;
/* width: 35%; */
height: 40px;
text-align: center;
line-height: 40px;
position: absolute;
top: 50px;
right: 50%;
color: #FFFFFF;
background-color: rgba(255,0,0,0.5);
transform: translateX(50%);
border-radius: 5px;
}
</style>
<div>
<div class="btn-group" >
<button id="btnqh" type="button" class="btn btn-default" style="color: white;position: absolute;right: 5px;z-index: 9999999999;height: 50px;width: 200px;border: 0 solid #00AAFF;background-color: #00AAFF;display: none;">切换风格</button>
</div>
</div>
<script type="text/javascript">
$("#btnqh").click(function(){
if($("#kwrkb01").css("display")=="flex"){
$("#kwrkb01").css("display","none")
$("#kwrkb02").css("display","flex")
$("#kwrkb03").css("display","none")
}else if($("#kwrkb02").css("display")=="flex"){
$("#kwrkb01").css("display","none")
$("#kwrkb02").css("display","none")
$("#kwrkb03").css("display","flex")
}else{
$("#kwrkb01").css("display","flex")
$("#kwrkb02").css("display","none")
$("#kwrkb03").css("display","none")
}
})
/* 取登录值 */
/* 通用代码 */
/* 通用pdf参数 */
const pdfUr="kmes/gpfk/queryPdfByWoidAndZpgx"
var urlo="kmes/gpfkfj/queryFjBybzgx/"+window.bzlx+"/O"
var urlt="kmes/gpfkfj/queryFjBybzgx/"+window.bzlx+"/T"
var urlm="kmes/gpfkfj/queryFjBybzgx/"+window.bzlx+"/M"
/* 大屏内部弹框 */
function screenAlert(dom,msg,timeNum){
let getdom=$(dom)
getdom.css('position','relative')
let dialog="<div class='errdialog'>"+msg+"</div>"
getdom.prepend(dialog)
setTimeout(function(){
$('.errdialog').remove();
},timeNum)
}
/* 通用表格参数 */
var zpfk_columns=[
[{
field: 'wlxxCode',
title: '品号',
width: '20%',
align:"center"
},
{
field: 'wlxxName',
title: '品名',
width: '23%',
align:"center"
},
{
field: 'wlxxGg',
title: '规格型号',
width: '20%',
align:"center"
},
{
field: 'dwyl',
title: '数量',
width: '20%',
align:"center"
},
{
field: 'zpsl',
title: '装配数量',
width: '20%',
align:"center"
},
]
]
/* 初始化工序 */
function zpfk_getgx(e){
let that=e
that.gx=window.gxname||"获取失败"
}
/* 获取计数 */
function zpfk_apigetjs(s){
let that=s
gas.post('kmes/gpfk/getDailyInfo',{}, function(res){
if(res.data&&res.data.records){
that.fksl=res.data.records.fksl||0
}else{
let msg=res.message||"当前计数获取失败"
zpfk_wrz(that,msg,'error')
}
});
}
/* 重查 */
function zpfk_showzpfk(e){
let that=e
that.okOrng=""//ok标记
gas.post('kmes/gpfk/zpfk',{"sncode":that.wosncode||"","bzgxid":window.bzlx||"","wosncode":that.wosncode||""}, function(res){
if(res.data&&res.data.records){
/* 赋值操作 */
that.okOrng=res.data.records.zpbz||""
that.xlh=""
}else{
}
});
}
/* !new zpfk接口获取信息*/
function zpfk_apizpfk(e){
let that=e
that.okOrng=""//ok标记
return new Promise(function(y,n){
gas.post('kmes/gpfk/zpfk',{"sncode":that.xlh,"bzgxid":window.bzlx||"","wosncode":that.wosncode||""}, function(res){
if(res.data&&res.data.records){
/* 赋值操作 */
that.gd = res.data.records.woDjid;
that.cpsn = res.data.records.wosnCode;
that.ph = res.data.records.wlxxCode;
let woid = res.data.records.woid;
that.fkid=res.data.records.id||""
that.okOrng=res.data.records.zpbz||""
if(res.data.records.sntype=="WOSNID")
{
that.wosncode=that.xlh
let msg=res.message||"查询WOSNID:"+that.wosncode+"成功"
zpfk_wrz(that,msg)
}else if(res.data.records.sntype=="WLID"){
let msg=res.message||"当前装配SN:"+that.wosncode+";品号"+res.data.records.curwlsncode+";品名"+res.data.records.curwlsnname+"成功!"
zpfk_wrz(that,msg)
zpfk_showzpfk(that)
}
that.xlh=""
y(woid)
/** wobom查询 **/
/* 日志操作 */
/* pdf地址 */
}else{
let msg=res.message||"查询:"+that.xlh+"失败"
that.xlh=""
zpfk_wrz(that,msg,'error')
screenAlert(that.el,msg,2000)
}
});
})
}
/* new整体封装 */
function zpfk_zpfk(t){
let that=t
if(that.xlh=="logout")
{
zpfk_wrz(that,"即将退出系统")
localStorage.clear();
window.location.href ="loginscan_view";
return
}
zpfk_apigetjs(that)
zpfk_apizpfk(that).then(function(s){
zpfk_queryWoBomByWoid(that,s)
zpfk_pdfshow(that,s)
})
//
}
/* wobom查询 .then(e=>执行) */
function zpfk_queryWoBomByWoid(e,woid){
let that=e
that.xlh=""
gas.post('kmes/gpfk/queryWoBomByWoid',{"woid":woid,"wosn":that.cpsn,"bzlx":window.bzlx}, function(res){
if(res.data&&res.data.records){
// let msg="查询装配表格:"+woid+"成功"
// zpfk_wrz(that,msg)
that.tabdata = res.data.records;
that.initpage()
}else{
let msg=res.message||"查询装配表格:"+woid+"失败"
// zpfk_wrz(that,msg,'error')
screenAlert(that.el,msg,2000)
}
});
}
/* pdfshow gxid登录页传进来 */
function zpfk_pdfshow(e,woid){
console.log("pdf")
let that=e
let newpdfurl=pdfUr+"/"+woid+"/"+window.bzlx
if (newpdfurl!=that.pdfurl){
that.pdfurl=newpdfurl
if(that.sivpdf){
clearInterval(that.sivpdf)
}
/*
老pdf禁用
pdfshow(that.pdfurl, that.pdfdom, 10000).then(e => {
that.sivpdf = e
}) */
}
}
/* 初始化表格 */
function zpfk_pageinit(q){
let that=q
let $tab = $(that.el).find('.showtab')
that.$tab=$tab
that.taboptions = {
height: '100%',
width:"100%",
fitColumns: false,
// rowStyler:function(index,row){
// if(index<2){
// return 'background-color:#6293BB;color:#fff;';
// }
// },
columns:zpfk_columns,
data: that.tabdata
}
$tab.datagrid(that.taboptions);
}
/* 时间 */
function zpfk_pagetime(w){
let that=w
let nowtime
nowtime=new Date().getTime()
that.systime=new Date(nowtime).Format("yyyy-MM-dd hh:mm")
that.sivtimer=setInterval(function(){
nowtime=new Date().getTime()
that.systime=new Date(nowtime).Format("yyyy-MM-dd hh:mm")
},20000)
}
/* 日志事件汇总,写在请求内部或者单独拿出 */
function zpfk_wrz(o,msg,type){
let that=o
if(type!='error'){
$(that.el).find(".rz").append("<br>>" + "<span>" +msg+"</sapn>")
that.addtop = that.addtop + 600
$(that.el).find(".rz").scrollTop(that.addtop)
}else{
$(that.el).find(".rz").append("<br>>" + "<span style='color: red;'>" +msg+"</sapn>")
that.addtop = that.addtop + 600
$(that.el).find(".rz").scrollTop(that.addtop)
that.okOrng='NG'
}
/* this.xlh="" */
}
/* 弹框封装 */
</script>
<div id="kwrkb01">
<!-- 顶部信息条 -->
<div class="toptitle">
<ul class="tipul" style="height: 100%;">
<li>当前工序:{{gx}}</li>
<li>{{username}}</li>
<li class="tipuli2" style="width: 250px;">{{systime}}</li>
<li class="tipuli2" style="margin-right: 200px;">计数: <span style="font-size: 16px;">{{fksl}}</span></li>
<li class="tipuli2"></li>
</ul>
</div>
<!-- 左侧信息条 -->
<div class="left" style="width: 30%;">
<!-- 左上信息表 -->
<div class="cbinfor">
<div class="cpif">
<!-- top -->
<div class="cpiftop" style="display: flex;align-items: center;">
<span>序列号&nbsp;&nbsp;</span><input style="width: 84%;" class="easyuitext" name="xlh" @keydown="scanxlh()" v-model="xlh" placeholder="请扫码条码" />
</div>
<!-- bot -->
<div class="cpifbot" style="display: flex;flex-wrap: wrap;">
<div class="ery">
<span>工序</span><input class="easyuitext wid70" v-model="gx" name="gx" />
</div>
<div class="ery">
<span>工单</span><input class="easyuitext wid70" v-model="gd" name="gd" />
</div>
<div class="ery">
<span>SN</span><input class="easyuitext wid70" v-model="cpsn" name="cpsn" />
</div>
<div class="ery">
<span>品号</span><input class="easyuitext wid70" v-model="ph" name="ph" />
</div>
</div>
</div>
<!-- 日志 -->
<div class="cprz">
<div style="height: 20px;line-height: 20px;background-color: grey;color: white;text-align: center;">
日志
</div>
<div style="height: calc(100% - 20px);display: flex;">
<div class="rz" style="width: 80%;height: 100%;background-color: #393456;color: #FFFFFF;overflow: auto;">
</div>
<div :class="{'ok-item' : okOrng=='OK','nok-item' : okOrng=='NG','n-item': okOrng!='OK'&&okOrng!='NG'}"
style="width: 20%;height: 100%;color: white;display: flex;align-items: center;justify-content: center;font-size: 30px;">
<b>{{okOrng}}</b>
</div>
</div>
</div>
</div>
<!-- 左下表格 -->
<div class="tab">
<div class="maintab">
<table class="showtab">
</table>
</div>
</div>
</div>
<!-- 右侧信息pdf -->
<div class="right" style="width: 45%;">
<canvas id="kwrkb01pdf" class="rightPdf"></canvas>
</div>
<!-- new右侧 -->
<div class="right" style="width: 25%;">
<div style="height: 50%;overflow: hidden;">
<video width="100%" height="100%" :src="urlm" controls muted autoplay="autoplay" loop="loop">
</video>
</div>
<div ref="scrollmain" style="height: 50%;overflow: auto;border-bottom: 1px solid #EEEEEE;">
<canvas id="kwrkb01rpdf" ref="scroll" style="width: 100%;height: 160%;" ></canvas>
</div>
</div>
</div>
<!-- div2 -->
<div id="kwrkb02" style="display: none;">
<!-- 顶部信息条 -->
<div class="toptitle" style="position: relative;">
<ul style="position: absolute;right: 50%;transform: translateX(50%);">
<li class="tipulmid"></li>
<li class="tipulmid" style="width: 130px;">{{username}}</li>
<li class="tipulmid">甲班</li>
<li class="tipulmid" style="width: 200px;">当前工序:{{gx}}</li>
</ul>
<ul class="tipul" style="height: 100%;width: 100%;">
<li style="width: 400px;">
<input class="easyuitext" style="width: 250px;" @keydown="scanxlh()" placeholder="请扫码条码" name="xlh" v-model="xlh" />
<button type="button" ><b style="color: #666666;font-style:oblique;">SUBMIT</b></button>
</li>
<li class="tipuli2" style="width: 250px;">{{systime}}</li>
<li class="tipuli2" style="margin-right: 10px;">计数: <span style="font-size: 16px;">{{fksl}}</span></li>
</ul>
</div>
<!-- 左侧信息条 -->
<div class="left">
<!-- 左上信息表 -->
<div class="cbinfor">
<div class="cpif">
<!-- top -->
<div class="cpileft" style="width: 70%;height: 100%;">
<div class="ery">
<span>工单</span><input class="easyuitext" v-model="gd" style="width: 70%;" name="gd" />
</div>
<div class="ery">
<span>SN</span><input class="easyuitext" v-model="cpsn" style="width: 70%" name="cpsn" />
</div>
<div class="ery">
<span>品号</span><input class="easyuitext" v-model="ph" style="width: 70%" name="ph" />
</div>
</div>
<div class="cpiright" style="width: 30%;height: 100%;padding: 10px;">
<div
:class="{'ok-item' : okOrng=='OK','nok-item' : okOrng=='NG','n-item': okOrng!='OK'&&okOrng!='NG'}"
style="width: 100%;height: 100%;background-color: #1890FF;color: white;display: flex;align-items: center;justify-content: center;font-size: 30px;">
<b>{{okOrng}}</b>
</div>
</div>
<!-- bot -->
</div>
<!-- 日志 -->
<div class="cprz" >
<div style="height: 20px;line-height: 20px;background-color: grey;color: white;text-align: center;">
日志
</div>
<div style="height: calc(100% - 20px);display: flex;">
<div class="rz" style="width: 100%;height: 100%;background-color: #393456;color: #FFFFFF;overflow: auto;">
</div>
</div>
</div>
</div>
<!-- 左下表格 -->
<div class="tab">
<div class="maintab">
<table class="showtab">
</table>
</div>
</div>
</div>
<!-- 右侧信息pdf -->
<div class="right">
<canvas id="kwrkb02pdf" class="rightPdf"></canvas>
</div>
</div>
<!-- 界面3 -->
<div id="kwrkb03" style="display: none;">
<!-- 顶部信息条 -->
<div class="toptitle" style="position: relative;">
<ul class="tipul" style="height: 100%;width: 100%;">
<li class="tipulmid">ADMIN</li>
<li class="tipulmid">{{username}}</li>
<li class="tipulmid">甲班</li>
<li class="tipuli2" style="width: 250px;">{{systime}}</li>
<li class="tipuli2" style="margin-right: 10px;">计数: <span style="font-size: 16px;">{{fksl}}</span></li>
<li class="tipuli2" style="margin-right: 10px;">当前工序:{{gx}}</li>
</ul>
</div>
<!-- 标题下信息 -->
<div class="titdow" style="width: 100%;height: 35px;display: flex;">
<div class="titdowinfor" style="padding-left: 10px;">
<input class="easyuitext" style="width:70%" placeholder="扫描条码" name="xlh" @keydown="scanxlh()" v-model="xlh" />
<button type="button" ><b style="color: #666666;font-style:oblique;">SUBMIT</b></button>
</div>
<div class="titdowinfor">
<span>工单</span><input class="easyuitext" style="width:70%" name="gd" v-model="gd" />
</div>
<div class="titdowinfor">
<span>SN</span><input class="easyuitext" style="width:70%" name="cpsn" v-model="cpsn" />
</div>
<div class="titdowinfor">
<span>品号</span><input class="easyuitext" style="width:70%" name="ph" v-model="ph" />
</div>
</div>
<!-- 左侧信息条 -->
<div class="left">
<!-- 左上信息表 -->
<div class="cbinfor">
<!-- 日志 -->
<div class="cprz" style="position: relative;">
<div class="cpiright" style="width:30%;height: 50%;padding: 10px;position: absolute;right: 0px;top: 20px;">
<div
:class="{'ok-item' : okOrng=='OK','nok-item' : okOrng=='NG','n-item': okOrng!='OK'&&okOrng!='NG'}"
style="width: 100%;height: 100%;background-color: #1890FF;color: white;display: flex;align-items: center;justify-content: center;font-size: 30px;">
<b>{{okOrng}}</b>
</div>
</div>
<div style="height: 20px;line-height: 20px;background-color: grey;color: white;text-align: center;">
日志
</div>
<div style="height: calc(100% - 20px);display: flex;">
<div class="rz" style="width: 100%;height: 100%;background-color: #393456;color: #FFFFFF;overflow: auto;">
</div>
</div>
</div>
</div>
<!-- 左下表格 -->
<div class="tab">
<div class="maintab">
<table class="showtab">
</table>
</div>
</div>
</div>
<!-- 右侧信息pdf -->
<div class="right">
<canvas id="kwrkb03pdf" class="rightPdf"></canvas>
</div>
</div>
<script type="text/javascript">
let Vkwrkb01 = new Vue({
el: "#kwrkb01",
mounted() {
zpfk_getgx(this)
this.initpage()
dbenlarge('kwrkb01', 1, this.initpage)
$(this.el).dblclick()
this.scroll()
this.gettime()
this.isFocus()
this.appdestory()
},
destroyed() {
clearInterval(this.sivdestory)
clearInterval(this.sivpdf)
clearInterval(this.sivrpdf)
clearInterval(this.sivtimer)
clearInterval(this.sivscroll)
},
data: function() {
return {
urlm:urlm,
fksl:0,
username:localStorage.getItem("username"),
okOrng:"",
pdfdom:"kwrkb01pdf",
el:"#kwrkb01",
pdfurl:"kmes/gpfk/queryPdfByWoidAndZpgx",
addtop:0,
xlh:"",
gx:"",
gd:"",
cpsn:"",
ph:"",
systime: "",
tabdata: [
],
sivtimer: null, //时间计数器
sivpdf: null,
sivdestory: null,
sivscroll:null,
sivrpdf:null
}
},
methods: {
scroll(){
console.log(urlo)
/* test */
pdfshow(urlo,'kwrkb01pdf', 10000).then(e => {
that.sivpdf = e
})
/* test */
pdfshow(urlt,'kwrkb01rpdf', 10000).then(e => {
that.sivrpdf = e
})
const mainData=this.$refs.scrollmain
const divData =this.$refs.scroll
this.sivscroll=setInterval(() => {
mainData.scrollTop += 1
if (mainData.clientHeight + mainData.scrollTop+10 > mainData.scrollHeight) {
mainData.scrollTop = 0
}
}, 100)
},
// 扫码接口
apiscanxlh(){
let that=this
zpfk_zpfk(that)
},
isFocus(){
let $xlh=$(this.el).find('input[name="xlh"]')
$xlh.focus()
},
// 扫码事件
scanxlh(e){
var evt = window.event || e;
if (evt.keyCode == 13) {
this.apiscanxlh()
}
},
// 初始化页面
initpage() {
let that=this
zpfk_pageinit(that)
},
/* 展示时间 */
gettime() {
let that = this
zpfk_pagetime(that)
},
appdestory() {
let that = this
this.sivdestory = setInterval(function() {
if (!$("#kwrkb01").height()) {
Vkwrkb01.$destroy()
}
}, 3000)
}
}
})
/* 示例2 */
let Vkwrkb02= new Vue({
el:"#kwrkb02",
mounted() {
zpfk_getgx(this)
// $(this.el).hide()
dbenlarge('kwrkb02',1,this.initpage)
// this.sivpdf=
this.initpage()
this.gettime()
this.appdestory()
},
destroyed() {
clearInterval(this.sivdestory)
clearInterval(this.sivpdf)
clearInterval(this.sivtimer)
},
data:function(){
return{
fksl:0,
username:localStorage.getItem("username"),
okOrng:"N",
pdfdom:"kwrkb02pdf",
el:"#kwrkb02",
pdfurl:"kmes/gpfk/queryPdfByWoidAndZpgx",
addtop:0,
xlh:"",
gx:"",
gd:"",
cpsn:"",
ph:"",
systime: "",
tabdata: [
],
sivtimer: null, //时间计数器
sivpdf: null,
sivdestory: null,
}
},
methods:{
isFocus(){
let $xlh=$(this.el).find('input[name="xlh"]')
$xlh.focus()
},
// 扫码接口
apiscanxlh(){
let that=this
zpfk_zpfk(that)
},
// 扫码事件
scanxlh(e){
var evt = window.event || e;
if (evt.keyCode == 13) {
this.apiscanxlh()
$("#kwrkb02").find(".rz").append("<br>>" + "<span>" +"正在查询:"+this.xlh+"</sapn>")
this.addtop = this.addtop + 600
$("#kwrkb02").find(".rz").scrollTop(this.addtop)
/* this.xlh="" */
}
},
// 初始化页面
initpage() {
let that=this
zpfk_pageinit(that)
},
/* 展示时间 */
gettime(){
let that = this
zpfk_pagetime(that)
},
appdestory(){
let that=this
this.sivdestory=setInterval(function(){
if(!$("#kwrkb02").height()){
Vkwrkb02.$destroy()
}
},3000)
}
}
})
let Vkwrkb03= new Vue({
el:"#kwrkb03",
mounted() {
zpfk_getgx(this)
dbenlarge('kwrkb03',1,this.initpage)
// this.sivpdf=
this.initpage()
this.gettime()
this.appdestory()
},
destroyed() {
clearInterval(this.sivdestory)
clearInterval(this.sivpdf)
clearInterval(this.sivtimer)
},
data:function(){
return{
fksl:0,
username:localStorage.getItem("username"),
okOrng:"N",
pdfdom:"kwrkb03pdf",
el:"#kwrkb03",
pdfurl:"kmes/gpfk/queryPdfByWoidAndZpgx",
addtop:0,
xlh:"",
gx:"",
gd:"",
cpsn:"",
ph:"",
systime: "",
tabdata: [
],
sivtimer: null, //时间计数器
sivpdf: null,
sivdestory: null,
}
},
methods:{
isFocus(){
let $xlh=$(this.el).find('input[name="xlh"]')
$xlh.focus()
},
// 扫码接口
apiscanxlh(){
let that=this
zpfk_zpfk(that)
},
// 扫码事件
scanxlh(e){
var evt = window.event || e;
if (evt.keyCode == 13) {
this.apiscanxlh()
$("#kwrkb03").find(".rz").append("<br>>" + "<span>" +"正在查询:"+this.xlh+"</sapn>")
this.addtop = this.addtop + 600
$("#kwrkb03").find(".rz").scrollTop(this.addtop)
/* this.xlh="" */
}
},
// 初始化页面
initpage(){
let that=this
zpfk_pageinit(that)
},
/* 展示时间 */
gettime(){
let that = this
zpfk_pagetime(that)
},
appdestory(){
let that=this
this.sivdestory=setInterval(function(){
if(!$("#kwrkb03").height()){
Vkwrkb03.$destroy()
}
},3000)
}
}
})
</script>
<div id="kmesGpfkindex" class="gui-div">
<table class="toolbar-table" data-options="id: 'kmesGpfkindexTable',herf:'kzzx/gridset/query'"></table>
<!-- 表格工具栏开始 -->
<div id="kmesGpfkindexTable-toolbar" class="gui-toolbar" data-options="grid:{type:'datagrid',id:'kmesGpfkindexTable'}">
<div class="navbar-toolbar">
<a class="toolbar-print toolbar" href="javascript:void(0)"></a>
<a class="toolbar-export toolbar" href="javascript:void(0)"></a>
<a class="toolbar-reload toolbar" href="javascript:void(0)"></a>
<!--<a class="toolbar-add toolbar" href="javascript:void(0)"></a>-->
<a class="toolbar-cancelzp toolbar" href="javascript:void(0)"></a>
</div>
<div class="form-sub">
<form class="query-criteria">
<ul>
<li class="gui-form-row" >
<div class="gui-col-sm2">
<label class="gui-form-label">产品条码:</label>
<div class="gui-input-block">
<input type="text" name="wosnid" style="width: 100%" ></div>
</div>
<div class="gui-col-sm4">
<div class="gui-col-sm6">
<label class="gui-form-label">加工日期:</label>
<div class="gui-input-date-start">
<input type="text" name="start" style="width: 100%">
</div>
</div>
<div class="gui-col-sm6">
<div class="gui-input-date-end">
<input type="text" name="end" style="width: 100%">
</div>
</div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">生产工单:</label>
<div class="gui-input-block">
<input type="text" name="wodjid" style="width: 100%" >
</div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">工序:</label>
<div class="gui-input-block">
<input type="text" name="bzgxid" style="width: 100%" >
</div>
</div>
<!--<input type="hidden" name="bxid"/>-->
<input type="hidden" name="fkrid"/>
<input type="hidden" name="bzbzgxid"/>
</li>
</ul>
<span class="toolbar-search-span"><a class="toolbar-search1" style="color:white;" href="javascript:void(0)"></a></span>
</form>
</div>
</div>
</div>
<!-- 表格工具栏结束 -->
<script>
$(function () {
/*js初始化*/
var $div=$('#kmesGpfkindex');
var $datagrid=$div.find(".toolbar-table");
var $datStart=$div.find("input[name='start']");
var $datEnd=$div.find("input[name='end']");
var $txtScgd=$div.find('input[name="wodjid"]');
var $txtWosnid=$div.find('input[name="wosnid"]');
var $bzgxid=$div.find('input[name="bzgxid"]');
var gxName='';var gzzxid="";
var gzzxname="";var fkrName="";
function paramsInit() {
}
function pageInit() {
$datStart.iDatebox();
$datEnd.iDatebox();
$txtScgd.iTextbox();
$txtWosnid.iTextbox();
var options = {
url: 'kmes/gpfk',
noRequest: true,
columns: [[
{title: "产品条码", field: "wosnid", fieldType: "ftString",width:160},
//{title: "工序编码", field: "bzgxCode", fieldType: "ftString",width:100},
{title: "标准工序", field: "bzgxName", fieldType: "ftString",width:100},
{title: "反馈工序", field: "fkgx", fieldType: "ftString",width:100,hidden:true},
//{title: "规格型号", field: "wlxxGg", fieldType: "ftString",width:200},
{title: "合格", field: "hgbz",align:"center", fieldType: "ftString",width:100, formatter:function(value,index,row){
var map={Y:"合格",N:"不合格"};
if(value=="Y"){
return "<span style='color: #216d4c'>"+map[value]+"</span>";
}else if(value=="N"){
return "<span style='color: indianred'>"+map[value]+"</span>";
}else{
return ''
}
}
},
{title: "合格数量", field: "hgsl",fieldType: "int",width:100},
{title: "不合格数量", field: "bhgsl", fieldType: "int",width:100},
{title: "反馈数量", field: "fksl", fieldType: "int",width:100},
{title: "反馈人", field: "fkr", fieldType: "ftString"},
{title: "反馈时间", field: "fksj", fieldType: "ftDateTime"},
{title: "生产工单", field: "woDjid", fieldType: "ftString",width:140},
{title: "物料编码", field: "wlxxCode", fieldType: "ftString",width:120},
{title: "物料名称", field: "wlxxName", fieldType: "ftString",width:160}
]],
dialog: {
footerIn: true,
href: 'kmes/gpfk/edit',
maximized:true,
width:1080,
height:640,
modal: true,
draggable:false,
onSaveCallback:function () {
},
onBeforeLoad:function () {
$(this).dialog("options").queryParams=$.extend({},DataBind.collectData($div),{
gxName:gxName,
gzzxid:gzzxid,
gzzxname:gzzxname,
fkrName:fkrName
})
},
messager:function () {
var flag=true;
if($div.find("input[name='bzgxid']").val()==""){
gas.confirm("您尚未选择工序,无法进行反馈操作。是否重新选择工序?",function () {
run();
flag=false;
},function () {
flag=true
});
}else{
flag=false
}
return flag
},
onDestroy:function () {
$datagrid.datagrid("load",DataBind.collectData($div));
}
}
};
$div.Holder(options);
$("#kmesGpfkindexTable-toolbar").find(".toolbar-cancelzp").iMenubutton({
event:'doAjax',
text:'取消装配',
onClick:function () {
var selectedRow=$div.find('.toolbar-table').datagrid('getSelected');
if(selectedRow==null){
$.messager.alert('提示','请选中一条数据进行操作');
return false;
}
gas.confirm("是否执行该操作",function () {
var index=$div.find('.toolbar-table').datagrid("getRowIndex",selectedRow);
HTTP.post('kmes/gphy/delGpzp',{gpfkid:selectedRow.id},function (result) {
if(result['success']){
$div.find('.toolbar-table').datagrid("deleteRow",index);
$.messager.alert('提示','取消装配成功!');
}else{
$.messager.alert('提示',result['message']||'取消装配失败,请重新操作!');
}
})
})
}
});
$("#kmesGpfkindexTable-toolbar").find(".toolbar-search1").iMenubutton({
text:'搜索',
iconCls:"fa fa-search",
btnCls:"",
onClick:function () {
if($div.find("input[name='bzgxid']").val()==""){
gas.confirm("您尚未选择工序,是否重新选择工序?",function () {
run();
});
}else{
$datagrid.datagrid("load",DataBind.collectData($div));
}
}
});
}
/*数据初始化*/
function dataInit(obj){
}
/*用户操作*/
function run(res){
$bzgxid.iCombobox({valueField: "id", textField: "name", allowNull:false,required:true,allowEdit:false, url: 'gygl/bzgx/queryZpBzgx',onSelect:function (a) {
// $dialog.find("input[name='gxName']").val(a.name);
// $dialog.find("input[name='gzzxid']").val(a.gzzxid||'');
// $dialog.find("input[name='gzzxname']").val(a.gzzxname||'')
gxName=a.name||""
gzzxid=a.gzzxid||""
gzzxname=a.gzzxname||""
},
loadFilter: function (a) {
var datas=a["data"]["records"];
$.each(datas,function (i,item) {
item["name"]=item["gzzxname"]+"-"+item["name"]
});
return datas
}
})
// gas.Dialog({
// title:"选择工序",
// width:480,
// height:280,
// minimizable:false,
// maximizable:false,
// href:"kmes/gphy/gx",
// onInit:function (element) {
// },
// regResultHandler:function (element) {
// if(!element.form("validate")){
// return false
// }
// var data=DataBind.collectData(element);
// $div.find("input[name='bxid']").val(data.bxid||"");
// $div.find("input[name='bzgxid']").val(data.gxid||"");
// $div.find("input[name='fkrid']").val(window.sessionStorage.getItem('userId'));
// fkrName=window.sessionStorage.getItem('userName');
// gxName=data.gxName||"";
// gzzxid=data.gzzxid||'';
// gzzxname=data.gzzxname||"";
// $datagrid.datagrid("options").url="kmes/gpfk/query";
// $datagrid.datagrid("load",DataBind.collectData($div))
// }
// })
}
gas.load(paramsInit,pageInit,dataInit,run);
})
</script>
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