| | |
| | | <template> |
| | | <view> |
| | | <scroll-view scroll-y> |
| | | <view class="pak-seach-box"> |
| | | <!-- <view class="pak-seach-box"> |
| | | <view class="box-top"> |
| | | <view class="color-block-blue"></view> |
| | | <text class="title">选择站台</text> |
| | |
| | | <uni-combox @input="getCheckDetl" emptyTips="暂无数据" :candidates="staNoList" v-model="staNo" placeholder="请选择"></uni-combox> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | |
| | | <view class="square-2"> |
| | | <view class="square-title"> |
| | |
| | | <button class="cu-btn lg" @click="resst()">重置</button> |
| | | </view> |
| | | <view> |
| | | <button class="cu-btn lg pakin-btn bg-blue" @click="adjust()">确认</button> |
| | | <button class="cu-btn lg pakin-btn bg-blue" @click="confirm()">确认</button> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | commonUrl:null, |
| | | matList:[], |
| | | staNoList:[], |
| | | barcode: '', |
| | |
| | | this.baseIP = UIP; |
| | | const UPORT = uni.getStorageSync('UPORT'); |
| | | this.basePORT = UPORT |
| | | const PROJ = uni.getStorageSync('UPROJ'); |
| | | this.baseUrl = PROJ |
| | | this.getUrl() |
| | | this.getOutBound(); |
| | | }, |
| | | methods: { |
| | | // 获取url |
| | | getUrl() { |
| | | this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl |
| | | }, |
| | | getOutBound() { // 获取出库口 |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/available/take/check/site', |
| | | url: that.commonUrl + '/available/take/check/site', |
| | | method: 'POST', |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | |
| | | getCheckDetl() { // 获取出库口货物信息 |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/checkDetl/auth', |
| | | url: that.commonUrl + '/mobile/checkDetl/auth', |
| | | method: 'POST', |
| | | data: { |
| | | staNo:that.staNo |
| | |
| | | findMat() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth', |
| | | url: that.commonUrl + '/plate/out/startFree', |
| | | data: { |
| | | matnr:that.matnr |
| | | barcode:that.barcode |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | |
| | | |
| | | }, |
| | | confirm() { |
| | | this.matList[this.rowNum].anfme = this.count |
| | | this.$refs.revise.close() |
| | | let that = this; |
| | | console.log("当前条码是:", that.barcode); |
| | | |
| | | if (!that.barcode) { |
| | | uni.showToast({ |
| | | title: '请先输入或扫码托盘条码', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | uni.request({ |
| | | url: that.commonUrl + '/plate/out/startFree', |
| | | method: 'POST', |
| | | data: JSON.stringify(that.barcode), // 注意这里直接传字符串 |
| | | header: { |
| | | 'token': uni.getStorageSync('token'), |
| | | 'Content-Type': 'application/json' // 重要,告诉后端你发的是 JSON 字符串 |
| | | }, |
| | | success(result) { |
| | | uni.vibrateShort(); |
| | | let res = result.data; |
| | | |
| | | if (res.code === 200) { |
| | | uni.showToast({ |
| | | title: res.msg || '出库启动成功', |
| | | icon: 'success' |
| | | }); |
| | | |
| | | // 清空托盘条码 |
| | | that.barcode = ''; |
| | | |
| | | // 如果有 matData 再跳转 |
| | | if (res.data) { |
| | | that.matData = res.data; |
| | | |
| | | uni.navigateTo({ |
| | | url: "matQuery", |
| | | events: { |
| | | matList: function(data) { |
| | | that.matList.push(data.data); |
| | | }, |
| | | }, |
| | | success: function(res) { |
| | | res.eventChannel.emit('matData', { |
| | | data: that.matData |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg || '出库启动失败', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | }, |
| | | fail(err) { |
| | | uni.showToast({ |
| | | title: '网络请求失败', |
| | | icon: 'none' |
| | | }); |
| | | console.error('请求失败:', err); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | resst() { |
| | | this.matList = [] |
| | | this.staNo = '' |
| | |
| | | adjust() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/adjust/auth', |
| | | url: that.commonUrl + '/adjust/auth', |
| | | method: 'POST', |
| | | data: { |
| | | combParam: that.matList |