|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onLoad() { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // this.dataList = uni.getStorageSync('zlPakinDataList') | 
|---|
|  |  |  | // if (this.dataList === '') { | 
|---|
|  |  |  | //    this.dataList = [] | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShow() { | 
|---|
|  |  |  | this.baseUrl = uni.getStorageSync('baseUrl'); | 
|---|
|  |  |  | 
|---|
|  |  |  | }, 100); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 检验当前物料是否是在当前Bom表中 | 
|---|
|  |  |  | checkBom() { | 
|---|
|  |  |  | checkBom(mat) { | 
|---|
|  |  |  | let _this = this | 
|---|
|  |  |  | uni.request({ | 
|---|
|  |  |  | url: _this.baseUrl + '/mobile/pda/decrees/check', | 
|---|
|  |  |  | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | switch(res.data.status) { | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | _this.findMat() | 
|---|
|  |  |  | // _this.findMat() | 
|---|
|  |  |  | _this.checkMat(mat) | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | // 相同制令货物补货 | 
|---|
|  |  |  | 
|---|
|  |  |  | selectMat() { | 
|---|
|  |  |  | let that = this | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: "../mat/matQuery", | 
|---|
|  |  |  | url: "../mat/matQueryByOrder", | 
|---|
|  |  |  | success: function(res) { | 
|---|
|  |  |  | // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的 | 
|---|
|  |  |  | res.eventChannel.emit('commonUrl', { | 
|---|
|  |  |  | 
|---|
|  |  |  | events: { | 
|---|
|  |  |  | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的 | 
|---|
|  |  |  | acceptDataFromOpenedPage: function(data) { | 
|---|
|  |  |  | that.matnr = data.data | 
|---|
|  |  |  | that.checkBom(that.matnr) | 
|---|
|  |  |  | that.matnr = data.data.matnr | 
|---|
|  |  |  | that.checkBom(data.data) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | that.matnr = '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$forceUpdate() // 强制刷新 | 
|---|
|  |  |  | this.maxAnfme = '' | 
|---|
|  |  |  | uni.setStorageSync('zlPakinDataList', this.dataList); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 修改批号 | 
|---|
|  |  |  | revise(item, i) { | 
|---|
|  |  |  | 
|---|
|  |  |  | const innerAudioContext = uni.createInnerAudioContext(); | 
|---|
|  |  |  | innerAudioContext.src = '/static/music/pakinOk.mp3'; | 
|---|
|  |  |  | innerAudioContext.play() | 
|---|
|  |  |  | that.dataList = [] | 
|---|
|  |  |  | uni.setStorageSync('zlPakinDataList', that.dataList); | 
|---|
|  |  |  | uni.showToast({ title: '组托成功', icon: "success", position: 'top' }) | 
|---|
|  |  |  | } else if (res.code == 403) { | 
|---|
|  |  |  | uni.showToast({ title: res.msg, icon: "error", position: 'top' }) | 
|---|
|  |  |  | setTimeout(() => { | 
|---|