| | |
| | | <template> |
| | | <view> |
| | | <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"> |
| | | </uni-segmented-control> |
| | | <view class="content"> |
| | | <!-- <view v-if="current === 0" class="headerstyle"> |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="180"> |
| | | <uni-forms-item :label="label"> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="æçæ¡ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="!focus" |
| | | v-model="barcode" @input="barcodeInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å
ç®±æ ç¾:"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æå
ç®±æ ç¾" ref='midInput' :focus="focus" |
| | | v-model="materSn" @input="snInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <checkbox checked="check">æ¯å¦æ»¡ç</checkbox> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="submit" type="primary" size="default" style="margin-top: 2%;">ç»ç</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <uni-list> |
| | | <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode"> |
| | | <template v-slot:body> |
| | | <view class="uni-list-box"> |
| | | <view class="uni-content"> |
| | | <view class="uni-title-sub uni-ellipsis-2">ç©æç¼ç ï¼{{item.matCode}}</view> |
| | | <view class="uni-title-sub uni-ellipsis-2">æ°éï¼{{item.matQuantity}}</view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | </uni-list-item> |
| | | <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="item.sn"> |
| | | <template v-slot:body> |
| | | <view class="uni-list-box"> |
| | | <uni-icons type="trash" size="22" style="position: absolute;right: 5%;" |
| | | @click="deleteList(item.sn)"> |
| | | </uni-icons> |
| | | <view class="uni-content"> |
| | | <view class="uni-title-sub uni-ellipsis-2">订åå·ï¼{{item.orderNo}}</view> |
| | | <view class="uni-note">ç©æç¼ç ï¼{{item.matCode}}</view> |
| | | <view class="uni-note">æ°éï¼{{item.matQty}}</view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | </uni-list-item> |
| | | </uni-list> |
| | | </view> |
| | | </view> --> |
| | | <view v-if="current === 0" class="headerstyle"> |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="ç¼åæ¶ç¼å·"> |
| | | <uni-easyinput type="text" v-model="stationcode" placeholder="请æ«çç¼åæ¶ç¼å·" ref='midInput':focus="addressFocus"/> |
| | | </uni-forms-item> |
| | | <!-- <uni-forms-item label="æçæ¡ç "> |
| | | <uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode" |
| | | placeholder="è¯·æ«ææçæ¡ç " ref='midInput' @input="inputChangebarcode" /> |
| | | </uni-forms-item> --> |
| | | <uni-forms-item label="æçç¼å·"> |
| | | <uni-easyinput type="text" v-model="PalletCode" placeholder="è¯·æ«ææçç¼å·" ref='midInput' |
| | | :focus="addressFocus" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">åºåºç¡®è®¤</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <template> |
| | | <view> |
| | | <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"> |
| | | </uni-segmented-control> |
| | | <view class="content"> |
| | | <view v-if="current === 0" class="headerstyle"> |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="ç¼åæ¶ç¼å·"> |
| | | <uni-easyinput type="text" :focus="!addressFocus" v-model="stationcode" |
| | | placeholder="请æ«çç¼åæ¶ç¼å·" ref='midInput' @input="inputChangebarcode" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="ç©æç±»å"> |
| | | <uni-easyinput type="text" :focus="!addressFocus" v-model="PalletCode" |
| | | placeholder="è¯·æ«æç©æç±»å" ref='midInput' @input="inputChangebarcode" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="inbound" type="primary" size="default" |
| | | style="margin-top: 2%;">åºåºç¡®è®¤</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <u-toast ref="uToast" /> |
| | | </view> |
| | | </template> |
| | | <u-toast ref="uToast" /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | | export default { |
| | | data() { |
| | | return { |
| | | // items: ['ç»ç', 'å
¥åº', 'åæ®ä¿¡æ¯', 'è§£ç'], |
| | | items: ['åºåº'], |
| | | current: 0, |
| | | matTotal: [], |
| | | matInfos: [], |
| | | orderNo: "", |
| | | label: "", |
| | | orderDetail: [], |
| | | focus: false, |
| | | barcode: "", |
| | | materSn: "", |
| | | sns: [], |
| | | addressFocus: false, |
| | | materialtype:"", |
| | | stationcode: "", |
| | | address: "", |
| | | check: true, |
| | | value: "", |
| | | matInfo: [], |
| | | value2: "", |
| | | matTotals: [] |
| | | } |
| | | }, |
| | | onShow() {}, |
| | | onLoad(res) { |
| | | this.focus = false; |
| | | this.addressFocus = false; |
| | | this.orderNo = res.orderNo; |
| | | this.label = "åæ®ç¼å·ï¼" + this.orderNo; |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | voiceSpeech(src) { |
| | | innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | innerAudioContext.play(); |
| | | }, |
| | | |
| | | updateFocus() { |
| | | this.$nextTick(() => { |
| | | this.materSn = ''; |
| | | if (!this.focus) { |
| | | this.focus = true; |
| | | } |
| | | }); |
| | | }, |
| | | barcodeFocus() { |
| | | this.barcode = ''; |
| | | if (this.focus) { |
| | | this.focus = false; |
| | | <script> |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | | export default { |
| | | data() { |
| | | return { |
| | | items: ['åºåº'], |
| | | current: 0, |
| | | matTotal: [], |
| | | matInfos: [], |
| | | orderNo: "", |
| | | label: "", |
| | | orderDetail: [], |
| | | focus: false, |
| | | barcode: "", |
| | | materSn: "", |
| | | sns: [], |
| | | addressFocus: false, |
| | | materialtype: "", |
| | | stationcode: "", |
| | | address: "", |
| | | check: true, |
| | | value: "", |
| | | matInfo: [], |
| | | value2: "", |
| | | matTotals: [], |
| | | rangs: [] // åå¨ç©æç±»åæ°æ® |
| | | } |
| | | }, |
| | | getData() { |
| | | var postData = this.orderNo |
| | | |
| | | this.$u.post('/api/InboundOrder/GetInboundOrderDetail', postData).then((res) => { |
| | | if (res.status) { |
| | | this.orderDetail = res.data; |
| | | if (this.orderDetail.length > 3) { |
| | | this.loadVisible = true; |
| | | } |
| | | } |
| | | }) |
| | | onShow() { |
| | | this.getMaterialTypes(); // 页颿¾ç¤ºæ¶è·åç©æç±»åæ°æ® |
| | | }, |
| | | onClickItem(e) { |
| | | onLoad(res) { |
| | | this.focus = false; |
| | | this.addressFocus = false; |
| | | if (this.current !== e.currentIndex) { |
| | | this.current = e.currentIndex; |
| | | if (this.current == 2) { |
| | | this.getData(); |
| | | } |
| | | } |
| | | this.orderNo = res.orderNo; |
| | | this.label = "åæ®ç¼å·ï¼" + this.orderNo; |
| | | this.getData(); |
| | | }, |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode.length > 0) { |
| | | this.focus = true; |
| | | } |
| | | }) |
| | | }, |
| | | inbound() { |
| | | var postData = { |
| | | MainData: { |
| | | "stationcode": this.stationcode, |
| | | "PalletCode": this.PalletCode, |
| | | } |
| | | } |
| | | this.$u.post('/api/Task/OutboundTasks', postData).then(res => { |
| | | if (res.status) { |
| | | uni.$showMsg("任塿·»å æå"); |
| | | this.stationcode = ""; |
| | | this.PalletCode = ""; |
| | | // setTimeout(() => { |
| | | // this.materialtype = false; |
| | | // }, 200); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: err.message, |
| | | type: "error" |
| | | }) |
| | | }) |
| | | }, |
| | | inputChangebarcode() { |
| | | this.addressFocus = false; |
| | | this.$nextTick(function(x) { |
| | | if (this.stationcode != '') { |
| | | this.addressFocus = true; |
| | | } |
| | | }) |
| | | }, |
| | | deleteList(res) { |
| | | var sn = ''; |
| | | this.matInfos.map((item, index) => { |
| | | if (item.sn == res) { |
| | | this.matInfos.splice(index, 1); |
| | | sn = item.sn; |
| | | var tmp = this.matTotal.find(x => x.matCode == item.matCode); |
| | | if (tmp) { |
| | | tmp.matQuantity -= parseInt(item.matQty); |
| | | } else { |
| | | methods: { |
| | | voiceSpeech(src) { |
| | | innerAudioContext.src = src; |
| | | innerAudioContext.play(); |
| | | }, |
| | | |
| | | updateFocus() { |
| | | this.$nextTick(() => { |
| | | this.materSn = ''; |
| | | if (!this.focus) { |
| | | this.focus = true; |
| | | } |
| | | }); |
| | | }, |
| | | barcodeFocus() { |
| | | this.barcode = ''; |
| | | if (this.focus) { |
| | | this.focus = false; |
| | | } |
| | | }, |
| | | getData() { |
| | | var postData = this.orderNo; |
| | | |
| | | this.$u.post('/api/InboundOrder/GetInboundOrderDetail', postData).then((res) => { |
| | | if (res.status) { |
| | | this.orderDetail = res.data; |
| | | if (this.orderDetail.length > 3) { |
| | | this.loadVisible = true; |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | getMaterialTypes() { |
| | | this.$u.post('/api/MaterielInfo/GetMaterialTypes').then((res) => { |
| | | if (res.status) { |
| | | console.log(res.data); |
| | | this.rangs = res.data.map(item => { |
| | | return { |
| | | value: item.number, // å设å端è¿åçæ°æ®ä¸æ id å name åæ®µ |
| | | text: item.number |
| | | }; |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: err.message, |
| | | type: "error" |
| | | }); |
| | | }); |
| | | }, |
| | | onClickItem(e) { |
| | | this.focus = false; |
| | | this.addressFocus = false; |
| | | if (this.current !== e.currentIndex) { |
| | | this.current = e.currentIndex; |
| | | if (this.current == 2) { |
| | | this.getData(); |
| | | } |
| | | } |
| | | }) |
| | | this.sns.map((item, index) => { |
| | | if (item == res) { |
| | | this.sns.splice(index, 1); |
| | | }, |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode.length > 0) { |
| | | this.focus = true; |
| | | } |
| | | }) |
| | | }, |
| | | inbound() { |
| | | var postData = { |
| | | MainData: { |
| | | "stationcode": this.stationcode, |
| | | "PalletCode": this.PalletCode, |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | submit() { |
| | | if (this.barcode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«ææçæ¡ç ", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.sns.length == 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æå
ç®±æ ç¾", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('/api/Bill_group_stock/PDA_ScanInStock', { |
| | | MainData: { |
| | | "pallet_barcode": this.barcode, |
| | | "orderNo": this.orderNo, |
| | | "isFull": this.check |
| | | }, |
| | | DelKeys: this.sns |
| | | }).then(res => { |
| | | if (res.status) { |
| | | this.$u.post('/api/Task/OutboundTasks', postData).then(res => { |
| | | if (res.status) { |
| | | uni.$showMsg("任塿·»å æå"); |
| | | this.stationcode = ""; // æ¸
空ç¼åæ¶ç¼å· |
| | | this.PalletCode = ""; // æ¸
ç©ºç©æç±»å |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: "ç»çæå", |
| | | type: "success" |
| | | }) |
| | | this.focus = false; |
| | | this.barcode = ""; |
| | | this.matInfos = []; |
| | | this.sns = []; |
| | | this.matTotal = []; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | title: err.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | inputChangebarcode() { |
| | | this.addressFocus = false; |
| | | this.$nextTick(function(x) { |
| | | if (this.stationcode != '') { |
| | | this.addressFocus = true; |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import '@/common/uni-ui.scss'; |
| | | <style lang="scss"> |
| | | @import '@/common/uni-ui.scss'; |
| | | |
| | | .content { |
| | | display: flex; |
| | | height: 150px; |
| | | } |
| | | .content { |
| | | display: flex; |
| | | height: 150px; |
| | | } |
| | | |
| | | .content-text { |
| | | font-size: 14px; |
| | | color: #666; |
| | | } |
| | | .content-text { |
| | | font-size: 14px; |
| | | color: #666; |
| | | } |
| | | |
| | | .itemstyle { |
| | | margin-top: 30px; |
| | | margin-left: 5%; |
| | | } |
| | | .itemstyle { |
| | | margin-top: 30px; |
| | | margin-left: 5%; |
| | | } |
| | | |
| | | .headerstyle { |
| | | width: 90%; |
| | | } |
| | | </style> |
| | | .headerstyle { |
| | | width: 90%; |
| | | } |
| | | </style> |