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

装配反馈接口变更

parent 379e31b3
...@@ -97,104 +97,76 @@ ...@@ -97,104 +97,76 @@
let that=e let that=e
that.gx=window.gxname||"获取失败" that.gx=window.gxname||"获取失败"
} }
/* 判定代码类型 登录页面*/ /* 获取计数 */
function zpfk_hqlx(e){ function zpfk_apigetjs(s){
let that=e let that=s
return new Promise(function(y,n){ gas.post('kmes/gpfk/getDailyInfo',{}, function(res){
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){
if(res.data&&res.data.records){ if(res.data&&res.data.records){
let msg="装配物料:"+that.xlh+"成功" that.fksl=res.data.records.fksl||0
zpfk_wrz(that,msg)
zpfk_queryKwellWoinfo2(that).then(function(s){
zpfk_queryWoBomByWoid(that,s)
})
}else{ }else{
let msg=res.message||"查询装配物料:"+that.xlh+"失败" let msg=res.message||"当前计数获取失败"
that.xlh="" zpfk_wrz(that,msg,'error')
zpfk_wrz(that,msg,"error")
} }
}) });
} }
/* 刷新获取工单 */ /* !new zpfk接口获取信息*/
function zpfk_queryKwellWoinfo2(e){ function zpfk_apizpfk(e){
let that=e let that=e
that.okOrng="" that.okOrng=""//ok标记
return new Promise(function(y,n){ 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){ if(res.data&&res.data.records){
/* 赋值操作 */ /* 赋值操作 */
that.gd = res.data.records.woDjid; that.gd = res.data.records.woDjid;
that.cpsn = res.data.records.wosnid; that.cpsn = res.data.records.wosnid;
that.ph = res.data.records.wlxxCode; that.ph = res.data.records.wlxxCode;
let woid = res.data.records.woid; let woid = res.data.records.woid;
that.fkid=res.data.records.id that.fkid=res.data.records.id||""
that.okOrng=res.data.zpbz that.okOrng=res.data.records.zpbz||""
y(woid) if(res.data.records.sntype=="WOSNID")
/** wobom查询 **/ {
that.wosncode=that.xlh
/* 日志操作 */ let msg=res.message||"查询WOSNID:"+that.wosncode+"成功"
/* pdf地址 */ zpfk_wrz(that,msg)
}else{ }else if(res.data.records.sntype=="WLID"){
let msg=res.message||"查询最新工单信息:"+that.cpsn+"失败" let msg=res.message||"查询:WLID"+that.wosncode+"成功"
that.xlh="" zpfk_wrz(that,msg)
zpfk_wrz(that,msg,'error')
screenAlert(that.el,msg,2000)
} }
}); that.xlh=""
})
}
/* 获取工序工单等信息 */
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) y(woid)
/** wobom查询 **/ /** wobom查询 **/
/* 日志操作 */ /* 日志操作 */
/* pdf地址 */ /* pdf地址 */
}else{ }else{
let msg=res.message||"查询工单信息:"+that.xlh+"失败" let msg=res.message||"查询:"+that.xlh+"失败"
that.xlh="" that.xlh=""
zpfk_wrz(that,msg,'error') zpfk_wrz(that,msg,'error')
screenAlert(that.el,msg,2000) 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=>执行) */ /* wobom查询 .then(e=>执行) */
function zpfk_queryWoBomByWoid(e,woid){ function zpfk_queryWoBomByWoid(e,woid){
let that=e let that=e
that.xlh="" that.xlh=""
gas.post('kmes/gpfk/queryWoBomByWoid',{"woid":woid,"wosn":that.cpsn,"bzlx":window.bzlx}, function(res){ gas.post('kmes/gpfk/queryWoBomByWoid',{"woid":woid,"wosn":that.cpsn,"bzlx":window.bzlx}, function(res){
if(res.data&&res.data.records){ if(res.data&&res.data.records){
...@@ -224,41 +196,6 @@ ...@@ -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){ function zpfk_pageinit(q){
let that=q let that=q
...@@ -300,7 +237,7 @@ ...@@ -300,7 +237,7 @@
$(that.el).find(".rz").append("<br>>" + "<span style='color: red;'>" +msg+"</sapn>") $(that.el).find(".rz").append("<br>>" + "<span style='color: red;'>" +msg+"</sapn>")
that.addtop = that.addtop + 600 that.addtop = that.addtop + 600
$(that.el).find(".rz").scrollTop(that.addtop) $(that.el).find(".rz").scrollTop(that.addtop)
// that.okOrng='NG' that.okOrng='NG'
} }
/* this.xlh="" */ /* this.xlh="" */
...@@ -314,7 +251,7 @@ ...@@ -314,7 +251,7 @@
<li>当前工序:{{gx}}</li> <li>当前工序:{{gx}}</li>
<li>{{username}}</li> <li>{{username}}</li>
<li class="tipuli2" style="width: 250px;">{{systime}}</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> <li class="tipuli2"></li>
</ul> </ul>
...@@ -389,7 +326,7 @@ ...@@ -389,7 +326,7 @@
<button type="button" ><b style="color: #666666;font-style:oblique;">SUBMIT</b></button> <button type="button" ><b style="color: #666666;font-style:oblique;">SUBMIT</b></button>
</li> </li>
<li class="tipuli2" style="width: 250px;">{{systime}}</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> </ul>
...@@ -455,7 +392,7 @@ ...@@ -455,7 +392,7 @@
<li class="tipulmid">{{username}}</li> <li class="tipulmid">{{username}}</li>
<li class="tipulmid">甲班</li> <li class="tipulmid">甲班</li>
<li class="tipuli2" style="width: 250px;">{{systime}}</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> <li class="tipuli2" style="margin-right: 10px;">当前工序:{{gx}}</li>
</ul> </ul>
</div> </div>
...@@ -531,6 +468,7 @@ ...@@ -531,6 +468,7 @@
}, },
data: function() { data: function() {
return { return {
fksl:0,
username:localStorage.getItem("username"), username:localStorage.getItem("username"),
okOrng:"", okOrng:"",
pdfdom:"kwrkb01pdf", pdfdom:"kwrkb01pdf",
...@@ -606,6 +544,7 @@ ...@@ -606,6 +544,7 @@
}, },
data:function(){ data:function(){
return{ return{
fksl:0,
username:localStorage.getItem("username"), username:localStorage.getItem("username"),
okOrng:"N", okOrng:"N",
pdfdom:"kwrkb02pdf", pdfdom:"kwrkb02pdf",
...@@ -683,6 +622,7 @@ ...@@ -683,6 +622,7 @@
}, },
data:function(){ data:function(){
return{ return{
fksl:0,
username:localStorage.getItem("username"), username:localStorage.getItem("username"),
okOrng:"N", okOrng:"N",
pdfdom:"kwrkb03pdf", 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