|
|
|
@ -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) => { |
|
|
|
|