Commit e985b214 authored by 李苏's avatar 李苏 💬

装配反馈接口变更

parent 379e31b3
......@@ -97,104 +97,76 @@
let that=e
that.gx=window.gxname||"获取失败"
}
/* 判定代码类型 登录页面*/
function zpfk_hqlx(e){
let that=e
return new Promise(function(y,n){
gas.post('kmes/gpfk/querySmlx ',{"wosnid":that.xlh,"bzlx":window.bzlx||"无"}, function(res){
if(res.data&&res.data.records){
let getinfor=res.data.records
y(getinfor.id||"")}
else{
n('nok')
}
});
})
}
/* 扫描物料 */
function zpfk_wlxh(z){
let that =z
if(!that.gd){
let msg="请先扫描工单序列号,获取工单号"
that.xlh=""
screenAlert(that.el,msg,2000)
zpfk_wrz(that,msg,'error')
return false
}
gas.post('kmes/gphy/zpwl',{"snid":that.xlh,"mid":that.fkid,"fkid":that.fkid,'gxid':window.bzlx}, function(res){
/* 获取计数 */
function zpfk_apigetjs(s){
let that=s
gas.post('kmes/gpfk/getDailyInfo',{}, function(res){
if(res.data&&res.data.records){
let msg="装配物料:"+that.xlh+"成功"
zpfk_wrz(that,msg)
zpfk_queryKwellWoinfo2(that).then(function(s){
zpfk_queryWoBomByWoid(that,s)
})
that.fksl=res.data.records.fksl||0
}else{
let msg=res.message||"查询装配物料:"+that.xlh+"失败"
that.xlh=""
zpfk_wrz(that,msg,"error")
let msg=res.message||"当前计数获取失败"
zpfk_wrz(that,msg,'error')
}
})
});
}
/* 刷新获取工单 */
function zpfk_queryKwellWoinfo2(e){
/* !new zpfk接口获取信息*/
function zpfk_apizpfk(e){
let that=e
that.okOrng=""
that.okOrng=""//ok标记
return new Promise(function(y,n){
gas.post('kmes/gpfk/queryKwellWoinfo',{"wosnid":that.cpsn,"bzlx":window.bzlx}, function(res){
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.wosnid;
that.ph = res.data.records.wlxxCode;
let woid = res.data.records.woid;
that.fkid=res.data.records.id
that.okOrng=res.data.zpbz
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||"查询:WLID"+that.wosncode+"成功"
zpfk_wrz(that,msg)
}
that.xlh=""
y(woid)
/** wobom查询 **/
/* 日志操作 */
/* pdf地址 */
}else{
let msg=res.message||"查询最新工单信息:"+that.cpsn+"失败"
let msg=res.message||"查询:"+that.xlh+"失败"
that.xlh=""
zpfk_wrz(that,msg,'error')
screenAlert(that.el,msg,2000)
}
});
})
}
/* 获取工序工单等信息 */
function zpfk_queryKwellWoinfo(e){
let that=e
return new Promise(function(y,n){
gas.post('kmes/gpfk/queryKwellWoinfo',{"wosnid":that.xlh,"bzlx":window.bzlx}, function(res){
if(res.data&&res.data.records){
let msg="查询工单信息:"+that.xlh+"成功"
zpfk_wrz(that,msg)
/* 赋值操作 */
that.gd = res.data.records.woDjid;
that.cpsn = res.data.records.wosnid;
that.ph = res.data.records.wlxxCode;
let woid = res.data.records.woid;
that.fkid=res.data.records.id
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){
......@@ -224,41 +196,6 @@
})
}
}
/* 总体扫描封装 */
function zpfk_zpfk(t){
let that=t
zpfk_hqlx(that).then(function(e){
if(e=="WOSNID"){
let msg="正在查询WOSNID:"+that.xlh
zpfk_wrz(that,msg)
zpfk_queryKwellWoinfo(that).then(function(s){
zpfk_queryWoBomByWoid(that,s)
zpfk_pdfshow(that,s)
})
}else if(e=="OKBZ"){
that.okOrng="OK"
that.xlh=""
}else if(e=="NGBZ"){
that.okOrng="NG"
that.xlh=""
}else if(e=="LOGOUT"){
zpfk_wrz(that,"即将退出系统")
localStorage.clear();
window.location.href ="loginscan_view";
}
/* 获取类型 */
})
.catch(function(e){
// let msg="正在查询WLID:"+that.xlh
// zpfk_wrz(that,msg)
zpfk_wlxh(that)
// console.log(e)
// let msg="无法识别该序列号:"+that.xlh
// zpfk_wrz(that,msg,'error')
// screenAlert(that.el,msg,2000)
that.xlh=""
})
}
/* 初始化表格 */
function zpfk_pageinit(q){
let that=q
......@@ -300,7 +237,7 @@
$(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'
that.okOrng='NG'
}
/* this.xlh="" */
......@@ -314,7 +251,7 @@
<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;">{{0}}</span></li>
<li class="tipuli2" style="margin-right: 200px;">计数: <span style="font-size: 16px;">{{fksl}}</span></li>
<li class="tipuli2"></li>
</ul>
......@@ -389,7 +326,7 @@
<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;">{{0}}</span></li>
<li class="tipuli2" style="margin-right: 10px;">计数: <span style="font-size: 16px;">{{fksl}}</span></li>
</ul>
......@@ -455,7 +392,7 @@
<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;">{{0}}</span></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>
......@@ -531,6 +468,7 @@
},
data: function() {
return {
fksl:0,
username:localStorage.getItem("username"),
okOrng:"",
pdfdom:"kwrkb01pdf",
......@@ -606,6 +544,7 @@
},
data:function(){
return{
fksl:0,
username:localStorage.getItem("username"),
okOrng:"N",
pdfdom:"kwrkb02pdf",
......@@ -683,6 +622,7 @@
},
data:function(){
return{
fksl:0,
username:localStorage.getItem("username"),
okOrng:"N",
pdfdom:"kwrkb03pdf",
......
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