function DataShow(type, uuid) { this.type = type; this.uuid = uuid; } DataShow.prototype.showHint = function(){ let htmlText=''; switch (this.type) { case 'locNo': htmlText += '

库位编号:'+ this.uuid +'

'; $.ajax({ url: top.baseUrl + '/three/query/loc/detl/v1?locNo=' + this.uuid, type: "GET", async: false, success: function (res) { if (res.code === 200) { let data = res.data; htmlText += '

库位状态:'+ data.locSts +'

'; if (data.locDetls) { for (let locDetl of data.locDetls) { htmlText += '

————————————————

'; htmlText += '

商品编号:'+ locDetl.matnr +'

'; htmlText += '

商品名称:'+ locDetl.maktx +'

'; if (locDetl.batch) { htmlText += '

批号:'+ locDetl.batch +'

'; } htmlText += '

库存数量:'+ locDetl.anfme + "" + (locDetl.unit?locDetl.unit:"") +'

'; } } } else { console.error(res.msg); } } }) break case "wrkNo": htmlText+='

任务编号:'+ this.uuid +'

'; $.ajax({ url: top.baseUrl + '/three/query/wrk/detl/v1?wrkNo=' + this.uuid, type: "GET", async: false, success: function (res) { if (res.code === 200) { let data = res.data; htmlText += '

任务状态:'+ data.wrkSts +'

'; if (data.sourceLocNo) { htmlText += '

源库位:'+ data.sourceLocNo +'

'; } if (data.destLocNo) { htmlText += '

目标库位:'+ data.destLocNo +'

'; } if (data.wrkDetls) { for (let wrkDetl of data.wrkDetls) { htmlText += '

————————————————

'; htmlText += '

商品编号:'+ wrkDetl.matnr +'

'; htmlText += '

商品名称:'+ wrkDetl.maktx +'

'; if (wrkDetl.batch) { htmlText += '

批号:'+ wrkDetl.batch +'

'; } htmlText += '

任务数量:'+ wrkDetl.anfme + "" + (wrkDetl.unit?wrkDetl.unit:"") +'

'; } } } else { console.error(res.msg); } } }) break default: break } return htmlText; }