物流问题修改

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

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

Loading…
Cancel
Save