pda端问题修改

master
zhangdi 2 weeks ago
parent c906d3faf2
commit 82df365374
  1. 330
      pages/logistics/delivery.vue
  2. 224
      pages/logistics/packaging.vue
  3. 26
      pages/production/feibaDevice.vue
  4. 2
      pages/production/rackSet.vue

@ -1,6 +1,24 @@
<template>
<ifrm>
<uni-forms ref="wrForm" class="formBox" label-position="top">
<uni-forms-item label="扫描模式:" label-width="100px" class="label-left">
<view class="mode-switch">
<view
class="switch-btn"
:class="{ active: scanMode === 'bind' }"
@click="handleModeChange('bind')"
>
送料
</view>
<view
class="switch-btn"
:class="{ active: scanMode === 'unbind' }"
@click="handleModeChange('unbind')"
>
叫料
</view>
</view>
</uni-forms-item>
<uni-forms-item label="物料箱条码:" label-width="100px">
<view class="bottom-input-row">
<view class="weight-input-wrapper">
@ -16,16 +34,16 @@
/>
</view>
</view>
<button
<!-- <button
@click="handleSubmit"
:disabled="!startData || !endCenter"
class="submit-btn"
:class="{ 'btn-disabled': !startData || !endCenter }"
>
配送
</button>
</button> -->
</view>
<view v-if="boxData" class="box-info">
<!-- <view v-if="boxData" class="box-info">
<view class="info-section">
<text class="info-text">
包含订单:
@ -39,9 +57,13 @@
<button @click="detailsFn()" class="details-btn">
明细 <text class="arrow"></text>
</button>
</view>
</view> -->
</uni-forms-item>
<uni-forms-item label="配送起点:" label-width="100px">
<uni-forms-item
label="起点站点:"
label-width="100px"
v-if="scanMode === 'bind'"
>
<input
type="text"
v-model="startCode"
@ -56,7 +78,38 @@
<text class="confirm-text">已确认: {{ startData.stationName }}</text>
</view>
</uni-forms-item>
<uni-forms-item label="终点(作业中心):" label-width="150px">
<uni-forms-item label="起点区域:" label-width="100px" v-else>
<picker
mode="selector"
:range="startAreas"
range-key="name"
:value="startAreaIndex"
@change="handleStartAreaChange"
class="uni-input-border"
>
<view class="picker-input">
<text :class="startArea ? 'picker-value' : 'picker-placeholder'">
{{ startArea || "请选择起点区域" }}
</text>
</view>
</picker>
<picker
mode="selector"
:range="startStations"
range-key="name"
:value="startStationIndex"
@change="handleStartStationChange"
class="uni-input-border"
:disabled="!startArea"
>
<view class="picker-input">
<text :class="startStation ? 'picker-value' : 'picker-placeholder'">
{{ startStation || "请选择起点站点" }}
</text>
</view>
</picker>
</uni-forms-item>
<uni-forms-item label="终点区域:" label-width="150px">
<picker
mode="selector"
:range="workCenters"
@ -67,13 +120,37 @@
>
<view class="picker-input">
<text :class="endCenter ? 'picker-value' : 'picker-placeholder'">
{{ endCenter || "请选择终点" }}
{{ endCenter || "请选择作业中心" }}
</text>
</view>
</picker>
<picker
mode="selector"
:range="endAreas"
range-key="name"
:value="endAreaIndex"
@change="handleAreaChange"
class="uni-input-border"
:disabled="!endCenter"
>
<view class="picker-input">
<text :class="endArea ? 'picker-value' : 'picker-placeholder'">
{{ endArea || "请选择终点区域" }}
</text>
</view>
</picker>
</uni-forms-item>
</uni-forms>
<view class="footer-action">
<button
@click="handleSubmit"
:disabled="!startData || !endCenter"
class="submit-btn"
:class="{ 'btn-disabled': !startData || !endCenter }"
>
配送
</button>
</view>
<view v-if="showDetails" class="popup-overlay" @click="showDetails = false">
<view class="popup-content" @click.stop>
<view class="popup-header">
@ -128,6 +205,20 @@ export default {
},
workCenters: [],
yieldOrderList: [], //
scanMode: "bind",
hasData: false,
workCenters: [], //
endAreas: [], //
endCenter: "", //
endArea: "", //
endCenterIndex: 0, //
endAreaIndex: 0, //
startAreas: [], //
startStations: [], //
startArea: "", //
startStation: "", //
startAreaIndex: 0, //
startStationIndex: 0, //
};
},
computed: {
@ -143,6 +234,128 @@ export default {
this.getWorkCenterList();
},
methods: {
//
handleStartAreaChange(e) {
const index = e.detail.value;
this.startArea = this.startAreas[index].name;
this.startAreaIndex = this.startAreas[index].id;
//
this.startStation = "";
this.startStationIndex = 0;
//
this.getStartStationsList(this.startAreas[index].id);
},
//
handleStartStationChange(e) {
const index = e.detail.value;
this.startStation = this.startStations[index].name;
this.startStationIndex = this.startStations[index].id;
},
//
getStartAreasList() {
this.$u.api.getStartAreas().then((res) => {
this.startAreas = res.data.map((area) => ({
id: area.id,
name: area.areaName,
}));
});
},
// ID
getStartStationsList(areaId) {
if (!areaId) {
this.startStations = [];
return;
}
this.$u.api.getStartStations({ areaId }).then((res) => {
this.startStations = res.data.map((station) => ({
id: station.id,
name: station.stationName,
}));
//
if (this.startStations.length > 0) {
this.startStation = this.startStations[0].name;
this.startStationIndex = this.startStations[0].id;
}
});
},
//
handleEndChange(e) {
const index = e.detail.value;
this.endCenter = this.workCenters[index].name;
this.endCenterIndex = index;
//
this.endArea = "";
this.endAreaIndex = 0;
this.getEndAreaList(this.workCenters[index].id);
},
//
handleAreaChange(e) {
const index = e.detail.value;
this.endArea = this.endAreas[index].name;
this.endAreaIndex = index;
},
//
getWorkCenterList() {
// this.$u.api.getWorkCenter().then((res) => {
// this.workCenters = res.data.map((c) => ({
// id: c.id,
// name: c.wcName,
// }));
// });
},
// ID
getEndAreaList(workCenterId) {
if (!workCenterId) {
this.endAreas = [];
return;
}
// this.$u.api.getEndArea({ workCenterId }).then((res) => {
// this.endAreas = res.data.map((area) => ({
// id: area.id,
// name: area.areaName,
// }));
// });
},
handleModeChange(mode) {
this.scanMode = mode;
this.hasData = false;
//
this.boxCode = "";
this.boxData = null;
this.boxInputFocus = true;
//
this.startCode = "";
this.startData = null;
this.startInputFocus = false;
//
this.startArea = "";
this.startStation = "";
this.startAreaIndex = 0;
this.startStationIndex = 0;
this.startAreas = [];
this.startStations = [];
//
this.endCenter = "";
this.endArea = "";
this.endCenterIndex = 0;
this.endAreaIndex = 0;
this.endAreas = [];
//
if (mode === "unbind") {
this.getStartAreasList();
}
},
//
detailsFn() {
this.showDetails = true;
@ -219,27 +432,30 @@ export default {
title: "提交中...",
});
let query_ = {
boxBarcode: this.boxBarcode||'', //
boxBarcode: this.boxBarcode || "", //
startStationCode: this.startData.stationCode, //
endWcId: this.endCenterIndex, //
};
this.$u.api.boxBindingTesk(query_).then((res) => {
uni.showToast({
title: `成功配送至 ${this.endCenter}!`,
icon: "success",
this.$u.api
.boxBindingTesk(query_)
.then((res) => {
uni.showToast({
title: `成功配送至 ${this.endCenter}!`,
icon: "success",
});
uni.hideLoading();
this.boxCode = "";
this.boxData = null;
this.startCode = "";
this.startData = null;
this.endCenter = "";
this.boxInputFocus = true;
this.startInputFocus = false;
})
.catch((err) => {
uni.hideLoading();
});
uni.hideLoading()
this.boxCode = "";
this.boxData = null;
this.startCode = "";
this.startData = null;
this.endCenter = "";
this.boxInputFocus = true;
this.startInputFocus = false;
}).catch(err=>{
uni.hideLoading()
})
},
},
};
@ -603,4 +819,68 @@ export default {
.submit-btn.disabled {
opacity: 0.5;
}
.mode-switch {
display: flex;
width: 140px;
height: 34px;
border-radius: 4px;
border: 1px solid rgba(21, 93, 252, 1);
overflow: hidden;
margin-left: auto;
}
.switch-btn {
flex: 1;
text-align: center;
line-height: 32px;
font-size: 14px;
color: rgba(21, 93, 252, 1);
background-color: #fff;
transition: all 0.2s;
}
.switch-btn.active {
background-color: rgba(21, 93, 252, 1);
color: #fff;
}
.label-left {
flex-direction: row !important;
margin-top: 20rpx;
}
/* 底部固定按钮区域 */
.footer-action {
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 20rpx 32rpx;
background-color: #ffffff;
border-top: 2rpx solid #e2e8f0;
box-shadow: 0 -2rpx 8rpx rgba(0, 0, 0, 0.05);
z-index: 50;
}
.picker-input {
width: 100%;
padding: 16rpx;
}
.picker-value {
font-size: 28rpx;
font-weight: bold;
color: #0f172a;
}
.picker-placeholder {
font-size: 28rpx;
color: #94a3b8;
}
/* 禁用状态 */
.picker-input.disabled {
opacity: 0.5;
background-color: #f1f5f9;
}
.uni-input-border {
margin-bottom: 20rpx;
}
</style>

@ -1,19 +1,37 @@
<template>
<ifrm ref="ifrm">
<!-- <view class="header">
<button v-if="activeBox" @click="handleResetBox" class="header-btn">
换箱
</button>
</view> -->
<uni-forms ref="wrForm" class="formBox" label-position="top">
<!-- <uni-forms-item
label="扫描模式:"
label-width="100px"
label-position="left"
>
<u-subsection :list="list" :current="1"></u-subsection>
</uni-forms-item> -->
<uni-forms-item label="扫描模式:" label-width="100px" class="label-left">
<view class="mode-switch">
<view
class="switch-btn"
:class="{ active: scanMode === 'bind' }"
@click="handleModeChange('bind')"
>
绑定
</view>
<view
class="switch-btn"
:class="{ active: scanMode === 'unbind' }"
@click="handleModeChange('unbind')"
>
解绑
</view>
</view>
</uni-forms-item>
<uni-forms-item label="物料箱条码:" label-width="100px">
<template #label>
<view class="custom-label">
<text class="label-text">物料箱条码</text>
<text
v-if="scanMode === 'unbind'"
class="one-click-unbind-btn"
@click="handleOneClickUnbind"
>
一键解绑
</text>
</view>
</template>
<view class="bottom-input-row">
<view class="weight-input-wrapper">
<view class="input-box">
@ -29,9 +47,6 @@
/>
</view>
</view>
<button class="submit-btn" :disabled="!canSubmit" @tap="handleSubmit">
装箱
</button>
</view>
<view v-if="activeBox" class="box-stats">
<view class="stats-left">
@ -40,13 +55,13 @@
</view>
<view class="stats-right">
<view class="stats-item">
<text class="stats-label">总数量</text>
<text class="stats-value">{{ totalCount }} </text>
<text class="stats-label">配送终点</text>
<text class="stats-value">{{ totalCount }}</text>
</view>
<view class="stats-item">
<!-- <view class="stats-item">
<text class="stats-label">总重量</text>
<text class="stats-value-weight">{{ totalWeight }} g</text>
</view>
</view> -->
</view>
</view>
</uni-forms-item>
@ -67,12 +82,18 @@
</uni-forms>
<scroll-view class="orders-scroll" scroll-y>
<view class="orders-header">
<text class="orders-icon"></text>
<text class="orders-title"
>箱内明细 ({{
boxInfo.yieldOrderList ? boxInfo.yieldOrderList.length : 0
}})</text
>
<view class="orders-left">
<text class="orders-icon"></text>
<text class="orders-title"
>箱内明细 ({{
boxInfo.yieldOrderList ? boxInfo.yieldOrderList.length : 0
}})</text
>
</view>
<view class="orders-right">
<text class="orders-weight-label">总重量</text>
<text class="orders-weight-value">{{ totalWeight }} g</text>
</view>
</view>
<view v-if="boxInfo.yieldOrderList.length === 0" class="empty-tip">
@ -125,6 +146,8 @@ export default {
orders: [],
boxInputFocus: true,
cardInputFocus: false,
scanMode: "bind",
hasData: false,
};
},
computed: {
@ -147,6 +170,46 @@ export default {
},
},
methods: {
handleOneClickUnbind() {
if (!this.activeBox) {
uni.showToast({
title: "请先扫描物料箱",
icon: "none",
});
return;
}
uni.showModal({
title: "确认解绑",
content: `确定要解绑物料箱 ${this.activeBox} 中的所有流程卡吗?`,
success: (res) => {
if (res.confirm) {
this.$u.api
.boxUnbind({ boxBarcode: this.activeBox })
.then(() => {
this.boxInfo.yieldOrderList = [];
this.activeBox = null;
this.boxCode = "";
uni.showToast({
title: "解绑成功",
icon: "success",
});
this.boxInputFocus = true;
this.cardInputFocus = false;
})
.catch((err) => {
uni.showToast({
title: err || "解绑失败",
icon: "error",
});
});
}
},
});
},
handleModeChange(mode) {
this.scanMode = mode;
this.hasData = false;
},
handleDeleteOrder(order, index) {
uni.showModal({
title: "确认删除",
@ -353,12 +416,18 @@ export default {
.orders-header {
display: flex;
align-items: center;
justify-content: space-between;
color: #334155;
font-weight: bold;
margin-bottom: 16rpx;
padding: 0 8rpx;
}
.orders-left {
display: flex;
align-items: center;
}
.orders-icon {
font-size: 32rpx;
margin-right: 8rpx;
@ -368,6 +437,24 @@ export default {
font-size: 26rpx;
}
.orders-right {
display: flex;
align-items: center;
gap: 8rpx;
}
.orders-weight-label {
font-size: 24rpx;
color: #64748b;
font-weight: 500;
}
.orders-weight-value {
font-size: 26rpx;
color: #059669;
font-weight: bold;
}
.empty-tip {
text-align: center;
padding: 48rpx 0;
@ -533,4 +620,91 @@ export default {
background-color: #cc0000;
transform: scale(0.95);
}
.mode-switch {
display: flex;
width: 140px;
height: 34px;
border-radius: 4px;
border: 1px solid rgba(21, 93, 252, 1);
overflow: hidden;
margin-left: auto;
}
.switch-btn {
flex: 1;
text-align: center;
line-height: 32px;
font-size: 14px;
color: rgba(21, 93, 252, 1);
background-color: #fff;
transition: all 0.2s;
}
.switch-btn.active {
background-color: rgba(21, 93, 252, 1);
color: #fff;
}
.label-left {
flex-direction: row !important;
margin-top: 20rpx;
}
.barcode-header {
position: relative;
width: 100%;
}
.one-click-unbind-btn {
position: absolute;
right: 0;
top: 0;
color: rgba(21, 93, 252, 1);
font-size: 26rpx;
font-weight: 500;
padding: 8rpx 16rpx;
border-radius: 4rpx;
}
.one-click-unbind-btn:active {
background-color: rgba(21, 93, 252, 1);
color: #ffffff;
}
/* 替换原有的 .barcode-header 和 .one-click-unbind-btn */
.custom-label {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding-bottom: 16px;
}
.label-text {
font-size: 28rpx;
color: #333;
}
.one-click-unbind-btn {
color: rgba(21, 93, 252, 1);
font-size: 26rpx;
font-weight: 500;
padding: 4rpx 12rpx;
white-space: nowrap;
}
/* 调整原有的 bottom-input-row */
.bottom-input-row {
display: flex;
gap: 10px;
margin-bottom: 12px;
}
.weight-input-wrapper {
flex: 1;
}
.uni-forms-item {
margin-bottom: 40rpx;
}
</style>

@ -207,18 +207,20 @@ export default {
},
getHangNumFun() {
this.range = [];
this.$u.api.getHangNum({deviceCode:this.facilityObj.deviceCode}).then((res) => {
console.log(data);
let data = res.data;
if (data.length > 0) {
data.forEach((item) => {
this.range.push({
value: item.value,
text: item.label,
this.$u.api
.getHangNum({ deviceCode: this.facilityObj.deviceCode })
.then((res) => {
console.log(data);
let data = res.data;
if (data.length > 0) {
data.forEach((item) => {
this.range.push({
value: item.value,
text: item.label,
});
});
});
}
});
}
});
// this.$ajax.request({
// url: "comBox/basic/getHangNum",
// method: "POST",
@ -252,7 +254,7 @@ export default {
fsId: this.feibaObj.id,
ecId: this.facilityObj.id,
hangNumId: this.hangNum,
unFsBool: this.unFsBool,
unFsBool: this.unFsBool ? 1 : 0,
})
.then((data) => {
uni.showToast({

@ -222,7 +222,7 @@ export default {
planList.push(item.id);
});
this.$u.api
.gjBindingCrad({ ...this.bsRackSet,planListIds: planList.join(',') })
.gjBindingCrad({ ...this.bsRackSet,rsId:this.bsRackSet.id,planListIds: planList.join(',') })
.then((res) => {
uni.showToast({
title: "绑定成功",

Loading…
Cancel
Save