| | |
| | | </uni-segmented-control> |
| | | <view class="content"> |
| | | <view v-if="current === 0" class="headerstyle"> |
| | | <view class="itemstyle"> |
| | | <view class="itemstyle" v-if="warehouseId==1"> |
| | | <uni-forms label-width="180"> |
| | | <uni-forms-item label="æ¡ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="!focus" |
| | | v-model="barcode" @confirm="barcodeInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="RFID:"> |
| | | <uni-easyinput type="text" v-model="rfid" placeholder="è¯·æ«æçº¸å·RFID" ref='midInput' |
| | | :focus="focus" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="ç©æ:"> |
| | | <uni-easyinput type="text" placeholder="请è¾å
¥ç©æ" ref='midInput' v-model="materSn" /> |
| | |
| | | <uni-easyinput type="text" trim="all" placeholder="请è¾å
¥éé(kg)" ref='midInput' |
| | | v-model="weight" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="æ»é¿:"> |
| | | <uni-easyinput type="text" trim="all" placeholder="请è¾å
¥æ»é¿(m)" ref='midInput' |
| | | v-model="lengthStock" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="submit" type="primary" size="default" style="margin-top: 2%;">ç»ç</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | | </view> |
| | | <view v-if="current === 1" class="headerstyle" > |
| | | <view class="itemstyle"> |
| | | <view class="itemstyle" v-else> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="æçæ¡ç "> |
| | | <uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode" |
| | | placeholder="è¯·æ«ææçæ¡ç " ref='midInput' @input="inputChangebarcode" /> |
| | | <uni-easyinput type="text" :focus="!addressEmptyFocus" v-model="inboundCode" |
| | | placeholder="è¯·æ«ææçæ¡ç " ref='midInput' @confirm="inputChangeemptyCode" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å°åæ¡ç "> |
| | | <uni-easyinput type="text" v-model="address" :disabled="addressdisabled" |
| | | placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' :focus="addressFocus" /> |
| | | <uni-easyinput type="text" v-model="address" placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' |
| | | :focus="addressEmptyFocus" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="ç©æç¼ç "> |
| | | <uni-easyinput type="text" v-model="matCode" placeholder="请è¾å
¥ç©æç¼ç " ref='midInput' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å个æ°é"> |
| | | <uni-easyinput type="number" v-model="OneCount" placeholder="请è¾å
¥å个æ°é" ref='midInput' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="ç©ææ»æ°"> |
| | | <uni-easyinput type="number" v-model="matCount" placeholder="请è¾å
¥ç©ææ»æ°" ref='midInput' /> |
| | | </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 v-if="current === 1" class="headerstyle"> |
| | | <view class="itemstyle" v-if="warehouseId==1"> |
| | | <uni-forms label-width="180"> |
| | | <uni-forms-item label="æ¡ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æçº¸å·æ¡ç " ref='midInput' :focus="!focus" |
| | | v-model="bindCode" @confirm="barcodeInput" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item> |
| | | <button @click="Bindrfid" type="primary" size="default" style="margin-top: 2%;">ç»å®</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | | <view class="itemstyle" v-else> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="æçæ¡ç "> |
| | | <uni-easyinput type="text" :focus="!addressEmptyFocus" v-model="emptyCode" |
| | | placeholder="è¯·æ«ææçæ¡ç " ref='midInput' @confirm="inputChangeemptyCode" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å°åæ¡ç "> |
| | | <uni-easyinput type="text" v-model="addressEmpty" placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' |
| | | :focus="addressEmptyFocus" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="inEmpty" type="primary" size="default" style="margin-top: 2%;">å
¥åºç¡®è®¤</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | | </view> |
| | | <view v-if="current === 2" class="headerstyle"> |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="ç©æç¼ç "> |
| | | <uni-easyinput type="text" v-model="materialCode" placeholder="请è¾å
¥ç©æç¼ç " ref='midInput' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="åºåºæ°é"> |
| | | <uni-easyinput type="number" v-model="outCount" placeholder="请è¾å
¥åºåºæ°é" ref='midInput' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="åºåºç¹ä½"> |
| | | <uni-data-select placeholder="è¯·éæ©" v-model="targetId" |
| | | :localdata="startPointRange"></uni-data-select> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="OutBound" type="primary" size="default" |
| | | style="margin-top: 2%;">åºåºç¡®è®¤</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | items: ['ç»ç', 'å
¥åº'], //, 'åæ®ä¿¡æ¯', 'è§£ç' |
| | | materSn:"", |
| | | wide:"", |
| | | weight:"", |
| | | thickness:"", |
| | | items: ['ç»ç'], //, 'åæ®ä¿¡æ¯', 'è§£ç' |
| | | materSn: "", |
| | | wide: "", |
| | | weight: "", |
| | | lengthStock: "", |
| | | thickness: "", |
| | | barcode: "", |
| | | focus:false, |
| | | focus: false, |
| | | inboundBarcode: "", |
| | | address: "", |
| | | addressdisabled: true, |
| | | addressFocus: false, |
| | | current: 0, |
| | | inboundCode: "", |
| | | orderNo: "", |
| | | warehouseId: "", |
| | | Test: false, |
| | | emptyCode: "", |
| | | matCount: 0, |
| | | matCode: "", //ç©æç¼ç |
| | | addressEmpty: "", |
| | | OneCount: 0, |
| | | targetId: "", |
| | | materialCode: "", |
| | | bindCode: "", |
| | | rfidCode: "", |
| | | rfid:"", |
| | | outCount: 0, |
| | | addressEmptyFocus: false, |
| | | startPointRange: [] |
| | | } |
| | | }, |
| | | onShow() {}, |
| | | onLoad(res) { |
| | | this.focus = false; |
| | | this.addressFocus = false; |
| | | this.Test = false; |
| | | this.warehouseId = res.warehouseId; |
| | | if (this.warehouseId == 1) { |
| | | this.items=['ç»ç']; |
| | | if (this.warehouseId == 1) { |
| | | this.items = ['ç»ç','ç»å®RFID']; |
| | | } |
| | | if (this.warehouseId == 2) { |
| | | //ä»
æ¾ç¤ºuni-segmented-control为1å2çå¼ |
| | | this.items.push('è¾
æå
¥åº'); |
| | | this.items.push('空æå
¥åº'); |
| | | this.items.push('æå¨åºåº'); |
| | | //this.itemsç§»é¤ç»ç |
| | | this.items.splice(0, 1); |
| | | console.log(this.items) |
| | | this.getDictionary(); |
| | | } |
| | | }, |
| | | methods: { |
| | | onClickItem(e) { |
| | | this.barcodeFo = true; |
| | | this.focus = false; |
| | | this.addressFocus = false; |
| | | if (this.current !== e.currentIndex) { |
| | | this.current = e.currentIndex; |
| | | } |
| | | }, |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode.length > 0) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | inbound() { |
| | | if (this.inboundBarcode == "") { |
| | | inputChangeemptyCode() { |
| | | if (this.emptyCode.length > 0) { |
| | | this.addressEmptyFocus = true; |
| | | } else { |
| | | this.addressEmptyFocus = false; |
| | | } |
| | | |
| | | if (this.inboundCode) { |
| | | this.addressEmptyFocus = true; |
| | | } else { |
| | | this.addressEmptyFocus = false; |
| | | } |
| | | }, |
| | | inEmpty() { |
| | | if (this.emptyCode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«ææçæ¡ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (this.address == "") { |
| | | if (this.addressEmpty == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æå°åæ¡ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | var postData = { |
| | | MainData: { |
| | | "barcode": this.inboundBarcode, |
| | | "startPoint": this.address, |
| | | "warehouseId": this.warehouseId |
| | | } |
| | | } |
| | | this.$u.post('/api/Task/RequestInboundTask', postData).then(res => { |
| | | var url = "?barCode=" + this.emptyCode + "&startPoint=" + this.addressEmpty; |
| | | this.$u.post('/api/Task/EmptyBackTask' + url, {}).then(res => { |
| | | if (res.status) { |
| | | this.inboundBarcode = ""; |
| | | if (this.warehouseId != 5 && this.warehouseId != 3) this.address = ""; |
| | | this.stockInfoDetail = []; |
| | | this.emptyCode = ""; |
| | | this.addressEmpty = ""; |
| | | //è·åæ»æ°é |
| | | this.Summmary = 0; |
| | | setTimeout(() => { |
| | | this.addressFocus = false; |
| | | this.addressEmptyFocus = false; |
| | | this.$refs.uToast.show({ |
| | | title: "æå", |
| | | type: "success" |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | OutBound(){ |
| | | if (this.materialCode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥ç©æ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (this.outCount <= 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥åºåºæ°é", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (this.targetId == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·éæ©åºåºç¹ä½", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | var url = "?materialCode=" + this.materialCode+ "&outCount=" + this.outCount + "&targetId=" + this.targetId; |
| | | this.$u.post('/api/Task/RequestCPWMSTaskOut' + url, {}).then(res => { |
| | | if (res.status) { |
| | | this.materialCode = ""; |
| | | this.outCount = 0; |
| | | this.targetId = ""; |
| | | setTimeout(() => { |
| | | this.$refs.uToast.show({ |
| | | title: "æå", |
| | | type: "success" |
| | | }) |
| | | }, 200); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: err.message, |
| | | type: "error" |
| | | }) |
| | | }) |
| | | }, |
| | | getDictionary() { |
| | | var param = ["agvStationAreaEnum"]; |
| | | this.$u.post('api/Sys_Dictionary/GetVueDictionary', param).then(res => { |
| | | //å°res.dataä¸çvalueæ¹ætextï¼keyæ¹ævalue |
| | | res[0].data.forEach(item => { |
| | | var obj = { |
| | | value: item.key, |
| | | text: item.value |
| | | } |
| | | this.startPointRange.push(obj); |
| | | }) |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: err.message, |
| | | type: "error" |
| | | }) |
| | | }) |
| | | }, |
| | | Bindrfid(){ |
| | | if (this.bindCode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥æ¡ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | var url = "?palletCode=" + this.bindCode; |
| | | this.$u.post('/api/Task/PurchaseBoxing' + url, {}).then(res => { |
| | | if (res.status) { |
| | | this.bindCode = ""; |
| | | this.rfidCode = ""; |
| | | setTimeout(() => { |
| | | this.$refs.uToast.show({ |
| | | title: "æå", |
| | | type: "success" |
| | | }) |
| | | }, 200); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: err.message, |
| | | type: "error" |
| | | }) |
| | | }) |
| | | }, |
| | | inbound() { |
| | | if (this.matCount <= 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥ç©ææ»æ°", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | if (this.inboundCode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«ææçæ¡ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (this.address == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æå°åæ¡ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (this.matCode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥ç©æç¼ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (this.OneCount <= 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥å个æ°é", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (!this.Test) { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·ç¡®è®¤ç©ææ°é" + this.matCount, |
| | | type: "info" |
| | | }) |
| | | this.Test = true; |
| | | return; |
| | | } |
| | | var url = "?barCode=" + this.inboundCode + "&startPoint=" + this.address + "&matCode=" + this |
| | | .matCode + "&matCount=" + this.matCount + "&oneCount=" + this.OneCount; |
| | | this.$u.post('/api/Task/InboundFLTask' + url, {}).then(res => { |
| | | if (res.status) { |
| | | this.inboundCode = ""; |
| | | this.address = ""; |
| | | this.matCode = ""; |
| | | this.matCount = 0; |
| | | this.Test = false; |
| | | this.OneCount = 0; |
| | | //è·åæ»æ°é |
| | | setTimeout(() => { |
| | | this.addressEmptyFocus = false; |
| | | this.$refs.uToast.show({ |
| | | title: "æå", |
| | | type: "success" |
| | | }) |
| | | }, 200); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | this.Test = false; |
| | | } |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: err.message, |
| | | type: "error" |
| | | }) |
| | | }) |
| | | }, |
| | | submit() { |
| | | if (this.barcode == "") { |
| | | this.$refs.uToast.show({ |
| | |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('/api/StockInfo/ManualMaterielGroup' ,{ |
| | | if(this.rfid==""){ |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æRFID", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.thickness == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥ç´å¾", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.weight == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥éé", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.wide == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥å¹
宽", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.materSn == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥ç©æ", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.lengthStock == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥æ»é¿", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('/api/StockInfo/ManualMaterielGroup', { |
| | | MainData: { |
| | | "palletCode": this.barcode, |
| | | "thickness": this.thickness, |
| | | "weight": this.weight, |
| | | "wide": this.wide, |
| | | "materSn": this.materSn, |
| | | "lengthStock": this.lengthStock, |
| | | "fridCode":this.rfid, |
| | | // "isFull": this.check |
| | | "warehouseId": this.warehouseId |
| | | }, |
| | |
| | | }) |
| | | this.focus = false; |
| | | this.barcode = ""; |
| | | this.matInfos = []; |
| | | this.sns = []; |
| | | this.matTotal = []; |
| | | this.materSn = ""; |
| | | this.wide = ""; |
| | | this.weight = ""; |
| | | this.lengthStock = ""; |
| | | this.thickness = ""; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |