修改逻辑

master
zhangdi 3 weeks ago
parent aefea7d75d
commit 29211f6a37
  1. 40
      pages/logistics/delivery.vue
  2. 122
      pages/logistics/packaging.vue

@ -18,9 +18,9 @@
</view>
<button
@click="handleSubmit"
:disabled="!boxData || !startData || !endCenter"
:disabled="!startData || !endCenter"
class="submit-btn"
:class="{ 'btn-disabled': !boxData || !startData || !endCenter }"
:class="{ 'btn-disabled': !startData || !endCenter }"
>
配送
</button>
@ -63,10 +63,9 @@
range-key="name"
:value="endCenterIndex"
@change="handleEndChange"
:disabled="!boxData"
class="uni-input-border"
>
<view class="picker-input" :class="{ 'picker-disabled': !boxData }">
<view class="picker-input">
<text :class="endCenter ? 'picker-value' : 'picker-placeholder'">
{{ endCenter || "请选择终点" }}
</text>
@ -78,14 +77,12 @@
<view v-if="showDetails" class="popup-overlay" @click="showDetails = false">
<view class="popup-content" @click.stop>
<view class="popup-header">
<text class="popup-title"
> {{ boxData.boxBarcode }} 明细</text
>
<text class="popup-title"> {{ boxData.boxBarcode }} 明细</text>
</view>
<scroll-view class="popup-scroll" scroll-y>
<view class="popup-orders">
<view
v-for="(order,index) in yieldOrderList"
v-for="(order, index) in yieldOrderList"
:key="index"
class="popup-order-item"
>
@ -130,7 +127,7 @@ export default {
ST002: { stationCode: "ST002", stationName: "A区暂存点" },
},
workCenters: [],
yieldOrderList:[],//
yieldOrderList: [], //
};
},
computed: {
@ -147,13 +144,14 @@ export default {
},
methods: {
//
detailsFn(){
detailsFn() {
this.showDetails = true;
this.$u.api.boxbarcodeDetails({boxBarcode:this.boxData.boxBarcode}).then(res=>{
console.log(9999,res.data)
this.yieldOrderList = res.data.yieldOrderList
})
this.$u.api
.boxbarcodeDetails({ boxBarcode: this.boxData.boxBarcode })
.then((res) => {
console.log(9999, res.data);
this.yieldOrderList = res.data.yieldOrderList;
});
},
handleBoxConfirm() {
const code = this.boxCode.trim();
@ -217,17 +215,20 @@ export default {
},
handleSubmit() {
uni.showLoading({
title: "提交中...",
});
let query_ = {
boxBarcode: this.boxData.boxBarcode, //
boxBarcode: this.boxBarcode||'', //
startStationCode: this.startData.stationCode, //
endWcId: this.endCenterIndex, //
};
this.$u.api.boxBindingTesk(query_).then((res) => {
console.log(89898989898, res.data);
uni.showToast({
title: `成功配送至 ${this.endCenter}!`,
icon: "success",
});
uni.hideLoading()
this.boxCode = "";
this.boxData = null;
@ -236,8 +237,9 @@ export default {
this.endCenter = "";
this.boxInputFocus = true;
this.startInputFocus = false;
});
}).catch(err=>{
uni.hideLoading()
})
},
},
};

@ -16,7 +16,6 @@
@confirm="handleBoxConfirm"
placeholder="物料箱条码"
class="uni-input-border"
confirm-type="done"
:focus="boxInputFocus"
/>
</view>
@ -51,7 +50,6 @@
placeholder="流程卡号"
class="uni-input-border"
:class="{ 'input-disabled': !activeBox }"
confirm-type="done"
:focus="cardInputFocus"
/>
</uni-forms-item>
@ -79,7 +77,10 @@
class="order-card"
:class="{ 'order-latest': index === 0 }"
>
<view v-if="index === 0" class="latest-badge">最新</view>
<!-- <view v-if="index === 0" class="latest-badge">最新</view> -->
<view class="delete-btn" @tap="handleDeleteOrder(order, index)">
<text class="delete-icon"></text>
</view>
<view class="order-header">
<text class="order-no">{{ order.woOrder }}订单号</text>
<text class="order-no">{{ order.cardNo }}</text>
@ -133,15 +134,41 @@ export default {
},
},
methods: {
//
handleDeleteOrder(order, index) {
uni.showModal({
title: "确认删除",
content: `确定要删除流程卡 ${order.cardNo} 吗?`,
success: (res) => {
if (res.confirm) {
this.boxInfo.yieldOrderList.splice(index, 1);
uni.showToast({
title: "删除成功",
icon: "success",
});
}
},
});
},
//
handleBoxConfirm() {
const code = this.boxCode.trim();
if (!code) return;
uni.showLoading({
title: "查询中...",
});
this.boxInfo = {
yieldOrderList: [],
};
this.$u.api
.boxbarcodeDetails({ boxBarcode: this.boxCode })
.then((res) => {
this.boxInfo = res.data;
});
if (res.data.yieldOrderList == null) {
this.boxInfo.yieldOrderList = [];
}
uni.hideLoading();
this.activeBox = code;
// ,
uni.showToast({
@ -149,46 +176,69 @@ export default {
icon: "success",
});
this.boxCode = "";
this.$nextTick(() => {
this.boxInputFocus = false;
this.cardInputFocus = true;
});
});
},
handleCardConfirm() {
const code = this.cardCode.trim();
if (!code) return;
// const code = this.cardCode.trim();
// if (!code) return;
if (this.cardCode) {
if (!this.activeBox) {
uni.showToast({
title: "请先扫描物料箱条码",
icon: "none",
});
this.$nextTick(() => {
this.boxInputFocus = true;
});
return;
}
if (this.boxInfo.yieldOrderList.some((o) => o.cardNo === this.cardCode)) {
if (
this.boxInfo.yieldOrderList.some((o) => o.cardNo === this.cardCode)
) {
uni.showToast({
title: `订单 ${this.cardCode} 已在该箱中!`,
icon: "none",
});
this.cardCode = "";
return;
}
this.$u.api.queryCardNo({ cardNo: this.cardCode }).then((res) => {
this.boxInfo.yieldOrderList.push(res.data);
if (!res.data.cardNo) {
uni.showToast({
title: `流程卡 ${code} 不存在或未称重`,
icon: "none",
this.cardInputFocus = false;
this.$nextTick(() => {
this.cardInputFocus = true;
});
this.cardCode = "";
return;
}
uni.showLoading({
title: "查询中...",
});
this.$u.api
.queryCardNo({ cardNo: this.cardCode })
.then((res) => {
uni.hideLoading();
this.boxInfo.yieldOrderList.push(res.data);
uni.showToast({
title: `流程卡 ${code} 装箱成功`,
icon: "success",
});
this.cardCode = "";
this.cardInputFocus = false;
this.$nextTick(() => {
this.cardInputFocus = true;
});
})
.catch((err) => {
uni.hideLoading();
this.cardCode = "";
this.cardInputFocus = false;
this.$nextTick(() => {
this.cardInputFocus = true;
});
});
}
},
handleResetBox() {
@ -197,21 +247,30 @@ export default {
this.orders = [];
this.boxInputFocus = true;
this.cardInputFocus = false;
this.boxInfo.yieldOrderList = [];
},
//
handleSubmit() {
uni.showLoading({
title: "提交中...",
});
this.$u.api
.boxBinding({
boxBarcode: this.activeBox, //
orderIdList: this.boxInfo.yieldOrderList.map((o) => o.cardNo),
})
.then((res) => {
uni.hideLoading();
uni.showToast({
title: `装箱成功`,
icon: "success",
});
this.cardCode = "";
this.boxInfo.yieldOrderList = [];
})
.catch((err) => {
uni.hideLoading();
});
},
},
@ -322,7 +381,7 @@ export default {
}
.order-latest {
border-color: #fb923c;
/* border-color: #fb923c; */
box-shadow: 0 0 0 2rpx rgba(251, 146, 60, 0.2);
}
@ -435,4 +494,31 @@ export default {
.submit-btn.disabled {
opacity: 0.5;
}
/* 在 style scoped 中添加 */
.delete-btn {
position: absolute;
top: -20rpx;
right: 0rpx;
width: 40rpx;
height: 40rpx;
background-color: #ff4444;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
box-shadow: 0 2rpx 8rpx rgba(255, 68, 68, 0.3);
}
.delete-icon {
color: #ffffff;
font-size: 24rpx;
font-weight: bold;
line-height: 1;
}
.delete-btn:active {
background-color: #cc0000;
transform: scale(0.95);
}
</style>

Loading…
Cancel
Save