| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | commonUrl:null, |
| | | condition:null, |
| | | tag: [], |
| | | data: [], |
| | | baseHttp:'http://', |
| | | baseIP:'', |
| | | basePORT:'', |
| | | baseUrl:'/jkwms' |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | |
| | | // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |
| | | eventChannel.on('acceptDataFromOpenerPage', function(data) { |
| | | that.baseIP = data.baseIP |
| | | that.basePORT = data.basePORT |
| | | eventChannel.on('commonUrl', function(data) { |
| | | that.commonUrl = data.commonUrl |
| | | that.showTag(1) |
| | | }) |
| | | }, |
| | |
| | | }); |
| | | uni.request({ |
| | | // url: "http://localhost:8081/jkwms/tag/list/pda/auth", |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/search/pda/auth', |
| | | url: that.commonUrl + '/mat/search/pda/auth', |
| | | data: { |
| | | condition: condition |
| | | }, |
| | |
| | | var res = result.data |
| | | if (res.code === 200 ) { |
| | | that.data = res.data |
| | | } else if (res.code == 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | showTag(parentId) { |
| | | let that = this |
| | | uni.vibrateShort(); |
| | | uni.showLoading(); |
| | | uni.request({ |
| | | // url: "http://localhost:8081/jkwms/tag/list/pda/auth", |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/tag/list/pda/auth', |
| | | url: that.commonUrl + '/tag/list/pda/auth', |
| | | header: { |
| | | 'token':uni.getStorageSync('token'), |
| | | }, |
| | | data: { |
| | | limit: 100000, |
| | | parentId: parentId |
| | | }, |
| | | method:"GET", |
| | | header: { |
| | | header: { |
| | | 'token':uni.getStorageSync('token'), |
| | | }, |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | that.tag = null |
| | | that.data = null |
| | | var res = result.data |
| | |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | uni.hideLoading(); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | return; |
| | | } |
| | | uni.request({ |
| | | // url: "http://localhost:8081/jkwms/mat/list/pda/auth", |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/list/pda/auth', |
| | | url: that.commonUrl + '/mat/list/pda/auth', |
| | | data: { |
| | | tagId: tagId |
| | | }, |
| | |
| | | 'token':uni.getStorageSync('token'), |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | that.tag = null |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | if (res.data != null && res.data.length > 0) { |
| | | uni.showLoading(); |
| | | that.data = res.data |
| | | uni.hideLoading(); |
| | | } else { |
| | | // that.tagId = parentId |
| | | } |
| | |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | |
| | | } |
| | | }); |
| | | }, |