物流问题修改

master
zhangdi 2 weeks ago
parent d362e44e31
commit b53d05b4a1
  1. 96
      pages/logistics/delivery.vue

@ -108,6 +108,7 @@
:value="startAreaIndex" :value="startAreaIndex"
@change="handleStartAreaChange" @change="handleStartAreaChange"
class="uni-input-border" class="uni-input-border"
disabled
> >
<view class="picker-input"> <view class="picker-input">
<text :class="startArea ? 'picker-value' : 'picker-placeholder'"> <text :class="startArea ? 'picker-value' : 'picker-placeholder'">
@ -130,8 +131,15 @@
</text> </text>
</view> </view>
</picker> </picker>
<text style="color: red" v-if="startStations.length <= 0"
>暂无可配送物料</text
>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="终点区域:" label-width="150px"> <uni-forms-item
label="终点区域:"
label-width="150px"
v-if="scanMode === 'bind'"
>
<template #label> <template #label>
<view class="required-label"> <view class="required-label">
<text class="required-mark">*</text> <text class="required-mark">*</text>
@ -173,6 +181,21 @@
<text class="empty-text">暂无数据</text> <text class="empty-text">暂无数据</text>
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="终点区域:" label-width="150px" v-else>
<template #label>
<view class="required-label">
<text class="required-mark">*</text>
<text>终点区域</text>
</view>
<input
type="text"
v-model="endStationCode"
placeholder="请扫描区域码"
class="uni-input-border"
confirm-type="done"
/>
</template>
</uni-forms-item>
</uni-forms> </uni-forms>
<view class="footer-action"> <view class="footer-action">
<button <button
@ -216,10 +239,11 @@ export default {
endAreaIndex: 0, // endAreaIndex: 0, //
startAreas: [], // startAreas: [], //
startStations: [], // startStations: [], //
startArea: "", // startArea: "蓝色周转盒放置区", //
startStation: "", // startStation: "", //
startAreaIndex: 0, // startAreaIndex: 0, //
startStationIndex: 0, // startStationIndex: 0, //
endStationCode: "", //
}; };
}, },
computed: { computed: {
@ -228,7 +252,7 @@ export default {
return !this.startData || !this.endCenter; return !this.startData || !this.endCenter;
} }
if (this.scanMode == "unbind") { if (this.scanMode == "unbind") {
return !this.endCenter || !this.startStation; return !this.endStationCode || !this.startStation;
} }
// // // //
// if (!this.endCenterIndex) { // if (!this.endCenterIndex) {
@ -288,12 +312,46 @@ export default {
.getStationRegion() .getStationRegion()
.then((res) => { .then((res) => {
uni.hideLoading(); uni.hideLoading();
const list = res.data || [];
this.startAreas = res.data.map((area) => ({ this.startAreas = list.map((area) => ({
id: area.stationRegion, id: area.stationRegion,
name: area.stationRegion, name: area.stationRegion,
stationCodeList: area.stationCodeList || [], stationCodeList: area.stationCodeList || [],
})); }));
// ""
const targetRegion = this.startAreas.find(
(item) => item.name == "蓝色周转盒放置区"
);
if (targetRegion) {
//
const targetIndex = this.startAreas.findIndex(
(item) => item.id === targetRegion.id
);
if (targetIndex !== -1) {
this.startArea = targetRegion.name;
this.startAreaIndex = targetRegion.id;
//
const stationCodeList = targetRegion.stationCodeList || [];
if (stationCodeList && stationCodeList.length > 0) {
this.startStations = stationCodeList.map((code) => ({
id: code,
name: code,
}));
//
this.startStation = stationCodeList[0];
this.startStationIndex = 0;
}
}
} else {
this.startArea = "蓝色周转盒放置区";
this.startAreaIndex = "蓝色周转盒放置区";
this.startStation = null
}
}) })
.catch((err) => { .catch((err) => {
uni.hideLoading(); uni.hideLoading();
@ -474,20 +532,32 @@ export default {
title: "提交中...", title: "提交中...",
}); });
let startStationCode = ""; let startStationCode = "";
let query_ = {
boxBarcode: this.boxBarcode || "", //
// startStationCode: startStationCode, //
// endWcId: this.endCenterIndex, //
// endStationCode: this.endStationCode, //
// stationRegion: this.endArea,
};
if (this.scanMode === "bind") { if (this.scanMode === "bind") {
// startData // startData
startStationCode = this.startData.stationCode; query_.startStationCode = this.startData.stationCode;
query_.endWcId = this.endCenterIndex;
query_.stationRegion = this.endArea;
} else if (this.scanMode === "unbind") { } else if (this.scanMode === "unbind") {
// //
// startStations {id: code, name: code} query_.startStationCode = this.startStation;
startStationCode = this.startStation; query_.endStationCode = this.endStationCode;
} }
let query_ = { if (this.scanMode == "unbind" && this.endStationCode == "") {
boxBarcode: this.boxBarcode || "", // uni.showToast({
startStationCode: startStationCode, // title: `请选择终点区域!`,
endWcId: this.endCenterIndex, // icon: "none",
}; });
console.log(89898989898, query_); return;
}
this.$u.api this.$u.api
.boxBindingTesk(query_) .boxBindingTesk(query_)
.then((res) => { .then((res) => {

Loading…
Cancel
Save