From 9a886d711d8b21adc335fdf8c39350584c7ba6fd Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 14 十月 2025 02:12:14 +0800
Subject: [PATCH] 更新代码,取消MES出库单号同步标识,平库转立库功能,寄售周期判断取消,精品标识等
---
代码管理/淮安PDA/pages/stash/OutProOrder.vue | 350 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 312 insertions(+), 38 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/OutProOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/OutProOrder.vue"
index f2e15aa..3aa09ab 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/OutProOrder.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/OutProOrder.vue"
@@ -3,22 +3,31 @@
<view class="itemstyle">
<uni-forms label-width="180">
<uni-forms-item label="澶栫鐮�:">
- <uni-easyinput type="text" placeholder="璇锋壂鎻忓绠辩爜" ref='midInput' :focus="!focus" v-model="barcode"
- @input="barcodeInput" />
- </uni-forms-item>
- <uni-forms-item>
- <button @click="InEmpty" type="primary" size="default" style="margin-top: 2%;">鍑鸿揣</button>
+ <uni-easyinput type="text" placeholder="璇锋壂鎻忓绠辩爜" ref='midInput' v-model="barcode" :focus="!focus"
+ class="search_box" :disabled="isDisable" @confirm="handleKeyPress"/>
</uni-forms-item>
</uni-forms>
</view>
- <view style="padding: 0 14rpx 20rpx;">
+ <view style="padding: 0 0rpx 0rpx;">
<!-- 褰撳墠鍑哄簱澶栧寘鍙� -->
- <view v-for="(i,index) in listOutBags" :key="index" class="item_box">
- <view style="line-height: 17px;color: #596671;font-size: 14px;text-align: left;font-weight: bold;">澶栧寘鍙凤細{{i}}
- </view>
+ <view class="item_boxItem">
+ <uni-list>
+ <uni-list-item direction="column" v-for="(item,index) in listShow" :key="index">
+ <template v-slot:body>
+ <view class="uni-list-box">
+ <uni-icons type="trash" size="22" style="position: absolute;right: 5%;"
+ @click="deleteList(index)">
+ </uni-icons>
+ <view class="uni-content">
+ <view class="uni-title-sub uni-ellipsis-2">澶栧寘锛歿{item.code}} 鏁伴噺锛歿{item.qty}}</view>
+ </view>
+ </view>
+ </template>
+ </uni-list-item>
+ </uni-list>
</view>
</view>
- <view style="padding: 0 14rpx 20rpx;">
+ <view style="padding: 0 14rpx 200rpx;">
<!-- 鏄庣粏 -->
<view v-for="i in list" :key="i.id" class="item_box">
<view style="line-height: 17px;color: #596671;font-size: 14px;text-align: left;font-weight: bold;">璁㈠崟鏄庣粏琛屽彿锛歿{i.rowId}}
@@ -26,12 +35,24 @@
<view style="margin-top: 22rpx;height: 140rpx;display: flex;flex-direction: column;justify-content: space-around;">
<view style="color: #00070F;font-size: 12px;">瀹㈡埛浠e彿锛歿{i.customer}}</view>
<view style="color: #00070F;font-size: 12px;">浜у搧缂栧彿锛歿{i.pCode}}</view>
- <view style="color: #00070F;font-size: 12px;">璁㈠崟鏁伴噺锛歿{i.qtyPcs}}</view>
- <view style="color: #00070F;font-size: 12px;">宸插嚭鏁伴噺锛歿{i.overQtyPcs}}</view>
+ <view style="color: #00070F;font-size: 12px;">閿�鍞鍗曪細{{i.saleOrder}}</view>
+ <view style="color: #f56c6c;font-size: 12px;">璁㈠崟鏁伴噺锛歿{i.qtyPcs}}</view>
+ <view style="color: #67c23a;font-size: 12px;">宸插嚭鏁伴噺锛歿{i.overQtyPcs}}</view>
+ </view>
+ <view style="width: 100%;height: 1rpx;background-color: #00070F;margin-top: 28rpx;">
</view>
</view>
</view>
- <uni-load-more :status="status" v-if="loadVisible"></uni-load-more>
+ <view style="padding:20rpx;position: fixed;bottom: 0;left: 0;background-color:lightgray;width: 100%;z-index: 999;display: flex;justify-content: space-between;">
+ <view style="margin-bottom: 22rpx;padding-left: 16rpx;line-height: 80rpx;">
+ <view style="font-size: 24rpx;font-weight: bold;color: #f56c6c;">璁㈠崟鎬绘暟閲忥細<text>{{orderQty}}</text></view>
+ <view style="font-size: 24rpx;font-weight: bold;color: #67c23a;">宸叉壂鎬绘暟閲忥細<text>{{total}}</text></view>
+ </view>
+ <view style="display: flex;height: 110rpx;margin-top: 40rpx;">
+ <button @click="reset" type="default" size="default" style="margin-top: 2%;width: 160rpx;border: 1rpx solid #007aff;color: #007aff;margin-right: 30rpx;">閲嶇疆</button>
+ <button @click="InEmpty" type="primary" size="default" style="margin-top: 2%;width: 160rpx;">鍑鸿揣</button>
+ </view>
+ </view>
<u-toast ref="uToast" />
</view>
</template>
@@ -46,7 +67,11 @@
proOutNo: "",
id: null,
list:[],
- listOutBags:[]
+ listOutBags:[],
+ listShow:[],
+ total:0,
+ orderQty:0,
+ isDisable:false
}
},
onShow() {},
@@ -54,15 +79,121 @@
this.proOutNo=res.proOutNo;
this.GetDetail(res.id);
this.id=res.id;
- //宸插嚭绠卞彿
+ uni.hideKeyboard(); //闅愯棌杞敭鐩�
},
methods: {
+ handleKeyPress(e) {
+ console.log(e);
+ // 鍥炶溅绗︼紙ASCII 13锛夎〃绀烘壂鐮佺粨鏉�
+ this.isDisable=true;
+ this.focus=true;
+ this.$nextTick(function(x) {
+ var values= this.barcode.split(',');
+ if(values.length==5){
+ // if (values.length != 5) {
+ // this.$refs.uToast.show({
+ // title: "鎵弿鏍煎紡閿欒"+value,
+ // type: 'error'
+ // })
+ // this.barcode="";
+ // this.$refs.midInput.focus();
+ // return;
+ // }
+ this.$u.post('/api/ProOutOrder/CheckCode?code='+this.barcode,{}).then(
+ res => {
+ if (res.status) {
+ //鍒ゆ柇鏄惁閲嶅
+ if (this.listShow.some(item => item.code === values[0])) {
+ this.barcode="";
+ setTimeout(() => {
+ this.isDisable=false;
+ this.focus=false;
+ },200);
+ this.$refs.uToast.show({
+ title: "閲嶅鎵弿"+values[0]+"宸插瓨鍦�",
+ type: 'error'
+ })
+ return;
+ }
+ if (this.list.some(item => item.pCode === values[1])) {
+ var outCode=values[0];
+ var outQty=parseInt(values[4]);
+ //鍒ゆ柇outQty涓烘暟瀛�
+ if (isNaN(outQty)) {
+ this.barcode="";
+ setTimeout(() => {
+ this.isDisable=false;
+ this.focus=false;
+ },200);
+ this.$refs.uToast.show({
+ title: "鎵弿鏍煎紡閿欒"+values[4],
+ type: 'error'
+ })
+ return;
+ }
+ //鍒ゆ柇outQty鏄惁澶т簬0
+ if (outQty<=0) {
+ this.barcode="";
+ setTimeout(() => {
+ this.isDisable=false;
+ this.focus=false;
+ },200);
+ this.$refs.uToast.show({
+ title: "鏍囩鏁板繀椤诲ぇ浜�0",
+ type: 'error'
+ })
+ return;
+ }
+ this.total+=outQty;
+ if(this.orderQty<this.total){
+ this.barcode="";
+ setTimeout(() => {
+ this.isDisable=false;
+ this.focus=false;
+ },200);
+ this.$refs.uToast.show({
+ title: "璁㈠崟鏁拌秴鍑�",
+ type: 'error'
+ })
+ return;
+ }
+ this.listShow.unshift({code:outCode,qty:outQty});
+ console.log(this.listShow);
+ //鍘婚櫎this.barcode鐨勭┖鏍�
+ this.listOutBags.push(this.barcode.replace(/\s*/g, ""));
+ this.barcode="";
+ setTimeout(() => {
+ this.isDisable=false;
+ this.focus=false;
+ },200);
+
+ }else{
+ this.barcode="";
+ setTimeout(() => {
+ this.isDisable=false;
+ this.focus=false;
+ },200);
+ this.$refs.uToast.show({
+ title: "鎵弿"+values[1]+"鎵瑰彿涓嶅湪璁㈠崟涓�",
+ type: 'error'
+ })
+ return;
+ }
+ }
+ })
+ }
+ })
+ },
GetDetail(value) {
this.$u.post('/api/ProOutOrder/GetOrderDetails?keyId='+value).then(
res => {
if (res.status) {
this.list=res.data.proOutOrderDetails;
- this.listOutBags=res.data.outBags;
+ this.orderQty=this.list.map(x=>{
+ return x.qtyPcs
+ }).reduce((a,b)=>{
+ return a+b
+ });
} else {
this.$refs.uToast.show({
title: res.message,
@@ -71,42 +202,173 @@
}
})
},
- voiceSpeech(src) {
- innerAudioContext.src = src; // '../../static/success.mp3';
- innerAudioContext.play();
- },
- barcodeInput(value) {
- this.$nextTick(function(x) {
- if (this.barcode.length > 0) {
- this.focus = true;
- this.barcode=value.split(',')[0];
+ // voiceSpeech(src) {
+ // innerAudioContext.src = src; // '../../static/success.mp3';
+ // innerAudioContext.play();
+ // },
+ // barcodeInput(value) {
+ // this.isDisable=true;
+ // this.focus=true;
+ // setTimeout(x=>{
+ // this.$nextTick(function(x) {
+ // var values= this.barcode.split(',');
+ // if(values.length==5){
+ // // if (values.length != 5) {
+ // // this.$refs.uToast.show({
+ // // title: "鎵弿鏍煎紡閿欒"+value,
+ // // type: 'error'
+ // // })
+ // // this.barcode="";
+ // // this.$refs.midInput.focus();
+ // // return;
+ // // }
+ // this.$u.post('/api/ProOutOrder/CheckCode?code='+this.barcode,{}).then(
+ // res => {
+ // if (res.status) {
+ // //鍒ゆ柇鏄惁閲嶅
+ // if (this.listShow.some(item => item.code === values[0])) {
+ // this.barcode="";
+ // setTimeout(() => {
+ // this.isDisable=false;
+ // this.focus=false;
+ // },200);
+ // this.$refs.uToast.show({
+ // title: "閲嶅鎵弿"+values[0]+"宸插瓨鍦�",
+ // type: 'error'
+ // })
+ // return;
+ // }
+ // if (this.list.some(item => item.pCode === values[1])) {
+ // var outCode=values[0];
+ // var outQty=parseInt(values[4]);
+ // //鍒ゆ柇outQty涓烘暟瀛�
+ // if (isNaN(outQty)) {
+ // this.barcode="";
+ // setTimeout(() => {
+ // this.isDisable=false;
+ // this.focus=false;
+ // },200);
+ // this.$refs.uToast.show({
+ // title: "鎵弿鏍煎紡閿欒"+values[4],
+ // type: 'error'
+ // })
+ // return;
+ // }
+ // //鍒ゆ柇outQty鏄惁澶т簬0
+ // if (outQty<=0) {
+ // this.barcode="";
+ // setTimeout(() => {
+ // this.isDisable=false;
+ // this.focus=false;
+ // },200);
+ // this.$refs.uToast.show({
+ // title: "鏍囩鏁板繀椤诲ぇ浜�0",
+ // type: 'error'
+ // })
+ // return;
+ // }
+ // this.total+=outQty;
+ // if(this.orderQty<this.total){
+ // this.barcode="";
+ // setTimeout(() => {
+ // this.isDisable=false;
+ // this.focus=false;
+ // },200);
+ // this.$refs.uToast.show({
+ // title: "璁㈠崟鏁拌秴鍑�",
+ // type: 'error'
+ // })
+ // return;
+ // }
+ // this.listShow.unshift({code:outCode,qty:outQty});
+ // console.log(this.listShow);
+ // //鍘婚櫎this.barcode鐨勭┖鏍�
+ // this.listOutBags.push(this.barcode.replace(/\s*/g, ""));
+ // this.barcode="";
+ // setTimeout(() => {
+ // this.isDisable=false;
+ // this.focus=false;
+ // },200);
+
+ // }else{
+ // this.barcode="";
+ // setTimeout(() => {
+ // this.isDisable=false;
+ // this.focus=false;
+ // },200);
+ // this.$refs.uToast.show({
+ // title: "鎵弿"+values[1]+"鎵瑰彿涓嶅湪璁㈠崟涓�",
+ // type: 'error'
+ // })
+ // return;
+ // }
+ // }
+ // })
+ // }
+ // })
+ // },200)
+ // },
+ deleteList(res) {
+ let indexExist =-1;
+ //鏌ヨthis.listOutBags涓槸鍚︽湁this.listShow[res].code
+ this.listOutBags.forEach((item,index) => {
+ //item鏄惁鍖呭惈 this.listShow[res].code
+ if (item.includes(this.listShow[res].code)) {
+ indexExist=index;
}
- })
+ });
+ console.log(indexExist);
+ if (indexExist !=-1) { // 濡傛灉鎵惧埌浜嗙储寮曪紝鍒欐墽琛屽垹闄ゆ搷浣�
+ this.total-=this.listShow[res].qty;
+ this.listOutBags.splice(indexExist, 1); // 浠庣储寮曚綅缃紑濮嬪垹闄や竴涓厓绱�
+ this.listShow.splice(res, 1);
+ }
+ setTimeout(() => {
+ this.isDisable=false;
+ },200);
+ this.barcode="";
+ },
+ reset(){
+ this.listShow=[];
+ this.total=0;
+ this.listOutBags=[];
+ this.focus=true;
+ this.barcode="";
+ setTimeout(() => {
+ this.barcode="";
+ this.isDisable=false;
+ this.focus=false;
+ }, 200);
},
InEmpty() {
- if (this.barcode == "") {
- this.$refs.uToast.show({
- title: "璇锋壂鎻忓绠辩爜",
- type: 'error'
- })
- return;
+ // if (this.barcode == "") {
+ // this.$refs.uToast.show({
+ // title: "璇锋壂鎻忓绠辩爜",
+ // type: 'error'
+ // })
+ // return;
+ // }
+ if(this.orderQty!==this.total){
+ this.$refs.uToast.show({
+ title: "璇锋壂鎻�"+this.orderQty+"鏁伴噺",
+ type: 'error'
+ })
+ return;
}
var postData = {
MainData: {
-
+ "outProOrderNo":this.proOutNo
},
- DelKeys:[this.barcode]
+ DelKeys:this.listOutBags
}
- this.$u.post('/api/ProOutOrder/OutProductPK?proOutNo='+this.proOutNo,postData).then(
+ this.$u.post('/api/ProOutOrder/OutProScanCodeSync',postData).then(
res => {
if (res.status) {
this.$refs.uToast.show({
title: "鎴愬姛",
type: "success"
})
- this.barcode = "";
- this.focus = false;
- this.address = "";
+ this.reset();
this.GetDetail(this.id);
} else {
this.$refs.uToast.show({
@@ -146,7 +408,19 @@
line-height: 34rpx;
margin-top: 20rpx;
}
+ .item_boxItem {
+ background-color: white;
+ padding: 40rpx 38rpx 28rpx 34rpx;
+ // height: 344rpx;
+ border-radius: 12rpx;
+ font-size: 24rpx;
+ line-height: 17rpx;
+ }
.headerstyle {
width: 90%;
}
+ .search_box {
+ padding: 10rpx 20rpx 20rpx;
+ background-color: white;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3