修改拣货、复核发货模块
This commit is contained in:
parent
1999865c88
commit
31eb640fc3
@ -168,6 +168,8 @@
|
|||||||
itemBarcodeCache: {},
|
itemBarcodeCache: {},
|
||||||
pickedItemKeys: [],
|
pickedItemKeys: [],
|
||||||
pickedStateStorageKey: 'order_picking_picked_state_v1',
|
pickedStateStorageKey: 'order_picking_picked_state_v1',
|
||||||
|
confirmedOrderIds: [],
|
||||||
|
confirmedOrderStateStorageKey: 'order_picking_confirmed_order_ids_v1',
|
||||||
boundCartNo: '',
|
boundCartNo: '',
|
||||||
boundCartName: '',
|
boundCartName: '',
|
||||||
bindCartNoInput: '',
|
bindCartNoInput: '',
|
||||||
@ -178,6 +180,7 @@
|
|||||||
bindCartQueryKeyword: '',
|
bindCartQueryKeyword: '',
|
||||||
boundCartStorageKey: 'order_picking_bound_cart_v1',
|
boundCartStorageKey: 'order_picking_bound_cart_v1',
|
||||||
submittingWavePickTask: false,
|
submittingWavePickTask: false,
|
||||||
|
currentWavePickSubmitPromise: null,
|
||||||
wavePickSubmitQueue: [],
|
wavePickSubmitQueue: [],
|
||||||
isNetworkConnected: true,
|
isNetworkConnected: true,
|
||||||
isFlushingWavePickSubmitQueue: false,
|
isFlushingWavePickSubmitQueue: false,
|
||||||
@ -362,7 +365,8 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await this.requestWavePickTaskSubmit(taskIdNumber, 8000);
|
const response = await this.requestWavePickTaskSubmit(taskIdNumber, 8000);
|
||||||
|
this.handleWavePickTaskSubmitResponse(response);
|
||||||
this.wavePickSubmitQueue.shift();
|
this.wavePickSubmitQueue.shift();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!this.isNetworkConnected || this.isWeakNetworkError(error)) {
|
if (!this.isNetworkConnected || this.isWeakNetworkError(error)) {
|
||||||
@ -462,6 +466,108 @@
|
|||||||
const map = this.loadPickedStateMap();
|
const map = this.loadPickedStateMap();
|
||||||
const restored = Array.isArray(map[String(taskIdNumber)]) ? map[String(taskIdNumber)] : [];
|
const restored = Array.isArray(map[String(taskIdNumber)]) ? map[String(taskIdNumber)] : [];
|
||||||
this.pickedItemKeys = restored.filter(Boolean);
|
this.pickedItemKeys = restored.filter(Boolean);
|
||||||
|
},
|
||||||
|
loadConfirmedOrderStateMap() {
|
||||||
|
try {
|
||||||
|
const raw = uni.getStorageSync(this.confirmedOrderStateStorageKey);
|
||||||
|
if (!raw) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
if (typeof raw === 'string') {
|
||||||
|
const parsed = JSON.parse(raw);
|
||||||
|
return parsed && typeof parsed === 'object' ? parsed : {};
|
||||||
|
}
|
||||||
|
return raw && typeof raw === 'object' ? raw : {};
|
||||||
|
} catch (error) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
saveConfirmedOrderStateMap(map) {
|
||||||
|
try {
|
||||||
|
uni.setStorageSync(this.confirmedOrderStateStorageKey, map || {});
|
||||||
|
} catch (error) {
|
||||||
|
// ignore storage write error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
normalizeConfirmedOrderIds(orderIds) {
|
||||||
|
if (!Array.isArray(orderIds)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return Array.from(new Set(orderIds
|
||||||
|
.map(id => Number(id))
|
||||||
|
.filter(id => Number.isFinite(id) && id > 0)));
|
||||||
|
},
|
||||||
|
persistConfirmedOrderIdsForCurrentTask(orderIds) {
|
||||||
|
const taskIdNumber = this.getCurrentTaskIdNumber();
|
||||||
|
const normalizedOrderIds = this.normalizeConfirmedOrderIds(orderIds);
|
||||||
|
if (!taskIdNumber) {
|
||||||
|
this.confirmedOrderIds = normalizedOrderIds;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const map = this.loadConfirmedOrderStateMap();
|
||||||
|
map[String(taskIdNumber)] = normalizedOrderIds;
|
||||||
|
this.saveConfirmedOrderStateMap(map);
|
||||||
|
this.confirmedOrderIds = normalizedOrderIds;
|
||||||
|
},
|
||||||
|
restoreConfirmedOrderIdsForCurrentTask() {
|
||||||
|
const taskIdNumber = this.getCurrentTaskIdNumber();
|
||||||
|
if (!taskIdNumber) {
|
||||||
|
this.confirmedOrderIds = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const map = this.loadConfirmedOrderStateMap();
|
||||||
|
this.confirmedOrderIds = this.normalizeConfirmedOrderIds(map[String(taskIdNumber)]);
|
||||||
|
},
|
||||||
|
clearConfirmedOrderIdsForTask(taskIdNumber) {
|
||||||
|
const normalizedTaskId = Number(taskIdNumber || 0);
|
||||||
|
if (!normalizedTaskId) {
|
||||||
|
this.confirmedOrderIds = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const map = this.loadConfirmedOrderStateMap();
|
||||||
|
delete map[String(normalizedTaskId)];
|
||||||
|
this.saveConfirmedOrderStateMap(map);
|
||||||
|
if (normalizedTaskId === this.getCurrentTaskIdNumber()) {
|
||||||
|
this.confirmedOrderIds = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
extractConfirmedOrderIdsFromSubmitResponse(response) {
|
||||||
|
const payload = response || {};
|
||||||
|
const candidateLists = [
|
||||||
|
payload?.confirmed_order_ids,
|
||||||
|
payload?.confirmedOrderIds,
|
||||||
|
payload?.data?.confirmed_order_ids,
|
||||||
|
payload?.data?.confirmedOrderIds,
|
||||||
|
payload?.data?.data?.confirmed_order_ids,
|
||||||
|
payload?.data?.data?.confirmedOrderIds,
|
||||||
|
payload?.result?.confirmed_order_ids,
|
||||||
|
payload?.result?.confirmedOrderIds,
|
||||||
|
payload?.result?.data?.confirmed_order_ids,
|
||||||
|
payload?.result?.data?.confirmedOrderIds
|
||||||
|
];
|
||||||
|
for (let i = 0; i < candidateLists.length; i += 1) {
|
||||||
|
const normalizedOrderIds = this.normalizeConfirmedOrderIds(candidateLists[i]);
|
||||||
|
if (normalizedOrderIds.length) {
|
||||||
|
return normalizedOrderIds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
handleWavePickTaskSubmitResponse(response) {
|
||||||
|
console.log('[pick.wavePickTaskSubmit] response:', response);
|
||||||
|
const confirmedOrderIds = this.extractConfirmedOrderIdsFromSubmitResponse(response);
|
||||||
|
console.log('[pick.wavePickTaskSubmit] confirmed_order_ids:', confirmedOrderIds);
|
||||||
|
if (!confirmedOrderIds.length) {
|
||||||
|
console.log('[pick.wavePickTaskSubmit] no confirmed_order_ids extracted');
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
const mergedOrderIds = [
|
||||||
|
...this.confirmedOrderIds,
|
||||||
|
...confirmedOrderIds
|
||||||
|
];
|
||||||
|
this.persistConfirmedOrderIdsForCurrentTask(mergedOrderIds);
|
||||||
|
console.log('[pick.wavePickTaskSubmit] merged confirmedOrderIds:', this.normalizeConfirmedOrderIds(mergedOrderIds));
|
||||||
|
return response;
|
||||||
},
|
},
|
||||||
getBoundCartTaskKey() {
|
getBoundCartTaskKey() {
|
||||||
return String(this.getCurrentTaskIdNumber() || '').trim();
|
return String(this.getCurrentTaskIdNumber() || '').trim();
|
||||||
@ -776,6 +882,9 @@
|
|||||||
return error;
|
return error;
|
||||||
},
|
},
|
||||||
requestWavePickTaskSubmit(taskIdNumber, timeoutMs = 8000) {
|
requestWavePickTaskSubmit(taskIdNumber, timeoutMs = 8000) {
|
||||||
|
console.log('[pick.wavePickTaskSubmit] request:', {
|
||||||
|
task_id: taskIdNumber
|
||||||
|
});
|
||||||
const requestPromise = this.$http('pick.wavePickTaskSubmit', {
|
const requestPromise = this.$http('pick.wavePickTaskSubmit', {
|
||||||
task_id: taskIdNumber
|
task_id: taskIdNumber
|
||||||
});
|
});
|
||||||
@ -789,48 +898,53 @@
|
|||||||
async submitWavePickTaskIntermediate() {
|
async submitWavePickTaskIntermediate() {
|
||||||
const taskIdNumber = this.getCurrentTaskIdNumber();
|
const taskIdNumber = this.getCurrentTaskIdNumber();
|
||||||
if (!taskIdNumber || this.submittingWavePickTask) {
|
if (!taskIdNumber || this.submittingWavePickTask) {
|
||||||
return;
|
return this.currentWavePickSubmitPromise;
|
||||||
}
|
}
|
||||||
if (!this.isNetworkConnected) {
|
this.currentWavePickSubmitPromise = (async () => {
|
||||||
this.enqueueWavePickSubmitTask(taskIdNumber);
|
|
||||||
uni.showToast({
|
|
||||||
title: '当前离线,已加入补提队列',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const maxAttempts = 3;
|
|
||||||
let lastError = null;
|
|
||||||
this.submittingWavePickTask = true;
|
|
||||||
try {
|
|
||||||
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
||||||
try {
|
|
||||||
await this.requestWavePickTaskSubmit(taskIdNumber, 8000);
|
|
||||||
this.dequeueWavePickSubmitTask(taskIdNumber);
|
|
||||||
return;
|
|
||||||
} catch (error) {
|
|
||||||
lastError = error;
|
|
||||||
const isWeakNetwork = this.isWeakNetworkError(error);
|
|
||||||
if (!this.isNetworkConnected) {
|
|
||||||
this.enqueueWavePickSubmitTask(taskIdNumber);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!isWeakNetwork || attempt >= maxAttempts) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
await this.sleep(attempt * 600);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.isNetworkConnected) {
|
if (!this.isNetworkConnected) {
|
||||||
|
this.enqueueWavePickSubmitTask(taskIdNumber);
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前离线,已加入补提队列',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const fallbackMessage = this.isWeakNetworkError(lastError)
|
const maxAttempts = 3;
|
||||||
? '网络较差,提交拣货中间态失败,请重试'
|
let lastError = null;
|
||||||
: '提交拣货中间态失败';
|
this.submittingWavePickTask = true;
|
||||||
this.showErrorModal(this.getApiErrorMessage(lastError, fallbackMessage));
|
try {
|
||||||
} finally {
|
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
||||||
this.submittingWavePickTask = false;
|
try {
|
||||||
}
|
const response = await this.requestWavePickTaskSubmit(taskIdNumber, 8000);
|
||||||
|
this.handleWavePickTaskSubmitResponse(response);
|
||||||
|
this.dequeueWavePickSubmitTask(taskIdNumber);
|
||||||
|
return;
|
||||||
|
} catch (error) {
|
||||||
|
lastError = error;
|
||||||
|
const isWeakNetwork = this.isWeakNetworkError(error);
|
||||||
|
if (!this.isNetworkConnected) {
|
||||||
|
this.enqueueWavePickSubmitTask(taskIdNumber);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!isWeakNetwork || attempt >= maxAttempts) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
await this.sleep(attempt * 600);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!this.isNetworkConnected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const fallbackMessage = this.isWeakNetworkError(lastError)
|
||||||
|
? '网络较差,提交拣货中间态失败,请重试'
|
||||||
|
: '提交拣货中间态失败';
|
||||||
|
this.showErrorModal(this.getApiErrorMessage(lastError, fallbackMessage));
|
||||||
|
} finally {
|
||||||
|
this.submittingWavePickTask = false;
|
||||||
|
this.currentWavePickSubmitPromise = null;
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
return this.currentWavePickSubmitPromise;
|
||||||
},
|
},
|
||||||
handleScanKeywordEntry(rawKeyword) {
|
handleScanKeywordEntry(rawKeyword) {
|
||||||
const scanText = this.normalizeScanResult(rawKeyword);
|
const scanText = this.normalizeScanResult(rawKeyword);
|
||||||
@ -1026,7 +1140,14 @@
|
|||||||
if (payload.mode === 2 && Array.isArray(options?.order_ids) && options.order_ids.length) {
|
if (payload.mode === 2 && Array.isArray(options?.order_ids) && options.order_ids.length) {
|
||||||
payload.order_ids = options.order_ids;
|
payload.order_ids = options.order_ids;
|
||||||
}
|
}
|
||||||
return this.$http('pick.wavePickTaskComplete', payload, '', false);
|
console.log('[pick.wavePickTaskComplete] request:', payload);
|
||||||
|
return this.$http('pick.wavePickTaskComplete', payload, '', false).then(response => {
|
||||||
|
console.log('[pick.wavePickTaskComplete] response:', response);
|
||||||
|
return response;
|
||||||
|
}).catch(error => {
|
||||||
|
console.log('[pick.wavePickTaskComplete] error:', error);
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleCompletePick() {
|
handleCompletePick() {
|
||||||
this.showActionSheet = false;
|
this.showActionSheet = false;
|
||||||
@ -1047,7 +1168,7 @@
|
|||||||
}
|
}
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '完成拣货',
|
title: '完成拣货',
|
||||||
content: '确认全部完成当前拣货任务吗?',
|
content: '确认完成当前拣货任务吗?',
|
||||||
success: async res => {
|
success: async res => {
|
||||||
if (!res?.confirm) {
|
if (!res?.confirm) {
|
||||||
return;
|
return;
|
||||||
@ -1056,8 +1177,19 @@
|
|||||||
title: '正在提交...'
|
title: '正在提交...'
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
|
if (this.currentWavePickSubmitPromise) {
|
||||||
|
await this.currentWavePickSubmitPromise;
|
||||||
|
}
|
||||||
|
const confirmedOrderIds = this.normalizeConfirmedOrderIds(this.confirmedOrderIds);
|
||||||
|
const completeMode = confirmedOrderIds.length ? 2 : 1;
|
||||||
|
console.log('[pick.wavePickTaskComplete] derived state:', {
|
||||||
|
task_id: taskIdNumber,
|
||||||
|
confirmedOrderIds,
|
||||||
|
completeMode
|
||||||
|
});
|
||||||
const response = await this.requestWavePickTaskComplete(taskIdNumber, {
|
const response = await this.requestWavePickTaskComplete(taskIdNumber, {
|
||||||
mode: 1
|
mode: completeMode,
|
||||||
|
order_ids: confirmedOrderIds
|
||||||
});
|
});
|
||||||
if (String(response?.flag || '').toLowerCase() === 'failure') {
|
if (String(response?.flag || '').toLowerCase() === 'failure') {
|
||||||
this.showErrorModal(response?.message || '完成拣货失败');
|
this.showErrorModal(response?.message || '完成拣货失败');
|
||||||
@ -1102,6 +1234,7 @@
|
|||||||
this.selectedBindCartItem = null;
|
this.selectedBindCartItem = null;
|
||||||
this.bindCartQueryKeyword = '';
|
this.bindCartQueryKeyword = '';
|
||||||
this.pickedItemKeys = [];
|
this.pickedItemKeys = [];
|
||||||
|
this.clearConfirmedOrderIdsForTask(taskIdNumber);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.showErrorModal(this.getApiErrorMessage(error, '完成拣货失败'));
|
this.showErrorModal(this.getApiErrorMessage(error, '完成拣货失败'));
|
||||||
} finally {
|
} finally {
|
||||||
@ -1254,6 +1387,7 @@
|
|||||||
}))
|
}))
|
||||||
};
|
};
|
||||||
this.restorePickedStateForCurrentTask();
|
this.restorePickedStateForCurrentTask();
|
||||||
|
this.restoreConfirmedOrderIdsForCurrentTask();
|
||||||
this.restoreBoundCartForCurrentTask();
|
this.restoreBoundCartForCurrentTask();
|
||||||
this.selectedIndex = 0;
|
this.selectedIndex = 0;
|
||||||
},
|
},
|
||||||
|
|||||||
@ -150,6 +150,38 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
<u-popup :show="showStationListPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showStationListPopup = false">
|
||||||
|
<view class="print-popup">
|
||||||
|
<view class="print-popup-title">打印台列表</view>
|
||||||
|
<scroll-view class="station-list-scroll" scroll-y>
|
||||||
|
<view v-if="printStationList.length === 0" class="station-list-empty">暂无打印台数据</view>
|
||||||
|
<view
|
||||||
|
v-for="station in printStationList"
|
||||||
|
:key="station.id"
|
||||||
|
class="station-list-item"
|
||||||
|
@click="handleStationListItemClick(station)"
|
||||||
|
>
|
||||||
|
<text class="station-list-item__name">{{ station.name }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="safe-bottom-in-popup"></view>
|
||||||
|
</scroll-view>
|
||||||
|
<view v-if="stationListTotal > 0" class="station-list-pagination">
|
||||||
|
<pagination
|
||||||
|
:pageNum.sync="stationListPage"
|
||||||
|
:pageSize="stationListPageSize"
|
||||||
|
:total="stationListTotal"
|
||||||
|
:showTotal="true"
|
||||||
|
:prevText="'上一页'"
|
||||||
|
:nextText="'下一页'"
|
||||||
|
:showFirstLast="true"
|
||||||
|
:firstText="'首页'"
|
||||||
|
:lastText="'末页'"
|
||||||
|
@change="handleStationListPageChange"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -165,11 +197,15 @@
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
paginationTotal: 0,
|
paginationTotal: 0,
|
||||||
|
showStationListPopup: false,
|
||||||
showPrintPopup: false,
|
showPrintPopup: false,
|
||||||
showPrintStationDropdown: false,
|
showPrintStationDropdown: false,
|
||||||
printStationName: '--',
|
printStationName: '--',
|
||||||
printStationId: '',
|
printStationId: '',
|
||||||
printStationList: [],
|
printStationList: [],
|
||||||
|
stationListPage: 1,
|
||||||
|
stationListPageSize: 20,
|
||||||
|
stationListTotal: 0,
|
||||||
printMessage: '',
|
printMessage: '',
|
||||||
pendingPrintCount: 0,
|
pendingPrintCount: 0,
|
||||||
printRequestCode: '',
|
printRequestCode: '',
|
||||||
@ -469,9 +505,9 @@
|
|||||||
buildPrintRecordWhere() {
|
buildPrintRecordWhere() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
buildPrintRecordParams() {
|
buildPrintRecordParams(page = 1) {
|
||||||
return {
|
return {
|
||||||
page: 1,
|
page: Math.max(1, Number(page || 1)),
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
where: this.buildPrintRecordWhere()
|
where: this.buildPrintRecordWhere()
|
||||||
};
|
};
|
||||||
@ -480,6 +516,23 @@
|
|||||||
const list = response?.data?.list || response?.data?.data?.list;
|
const list = response?.data?.list || response?.data?.data?.list;
|
||||||
return Array.isArray(list) ? list : [];
|
return Array.isArray(list) ? list : [];
|
||||||
},
|
},
|
||||||
|
extractPrintRecordTotal(response) {
|
||||||
|
const candidates = [
|
||||||
|
response?.data?.total,
|
||||||
|
response?.data?.pagination?.total,
|
||||||
|
response?.data?.data?.total,
|
||||||
|
response?.data?.count,
|
||||||
|
response?.total,
|
||||||
|
response?.count
|
||||||
|
];
|
||||||
|
for (let i = 0; i < candidates.length; i += 1) {
|
||||||
|
const value = Number(candidates[i]);
|
||||||
|
if (Number.isFinite(value) && value >= 0) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
normalizePrintStations(list) {
|
normalizePrintStations(list) {
|
||||||
return list
|
return list
|
||||||
.map(item => {
|
.map(item => {
|
||||||
@ -493,13 +546,18 @@
|
|||||||
})
|
})
|
||||||
.filter(item => !!item.id && !!item.name);
|
.filter(item => !!item.id && !!item.name);
|
||||||
},
|
},
|
||||||
async loadPrintStations() {
|
async loadPrintStations(page = 1) {
|
||||||
const response = await this.$http('print.getList', this.buildPrintRecordParams());
|
const response = await this.$http('print.getList', this.buildPrintRecordParams(page));
|
||||||
const list = this.extractPrintRecordList(response);
|
const list = this.extractPrintRecordList(response);
|
||||||
|
const total = this.extractPrintRecordTotal(response);
|
||||||
const stations = this.normalizePrintStations(list);
|
const stations = this.normalizePrintStations(list);
|
||||||
this.printStationList = stations;
|
this.printStationList = stations;
|
||||||
this.printStationId = stations[0]?.id || '';
|
this.stationListTotal = total;
|
||||||
this.printStationName = stations[0]?.name || '--';
|
this.stationListPage = Math.max(1, Number(page || 1));
|
||||||
|
if (stations.length && !this.printStationId) {
|
||||||
|
this.printStationId = stations[0]?.id || '';
|
||||||
|
this.printStationName = stations[0]?.name || '--';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
togglePrintStationDropdown() {
|
togglePrintStationDropdown() {
|
||||||
if (!this.printStationList.length) {
|
if (!this.printStationList.length) {
|
||||||
@ -757,8 +815,49 @@
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleUnboundPrintStationOnly() {
|
async toggleUnboundPrintStationOnly() {
|
||||||
this.showUnboundPrintStationOnly = true;
|
this.showUnboundPrintStationOnly = true;
|
||||||
|
this.stationListPage = 1;
|
||||||
|
this.stationListTotal = 0;
|
||||||
|
this.printStationList = [];
|
||||||
|
this.printStationId = '';
|
||||||
|
this.printStationName = '--';
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载打印台...'
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await this.loadPrintStations(1);
|
||||||
|
this.showStationListPopup = true;
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '打印台列表加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleStationListPageChange(page) {
|
||||||
|
const targetPage = Math.max(1, Number(page || 1));
|
||||||
|
if (targetPage === this.stationListPage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.stationListPage = targetPage;
|
||||||
|
this.loadPrintStations(targetPage);
|
||||||
|
},
|
||||||
|
handleStationListItemClick(station) {
|
||||||
|
if (!station || !station.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.showStationListPopup = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.printStationId = String(station.id);
|
||||||
|
this.printStationName = String(station.name || '--');
|
||||||
|
uni.showToast({
|
||||||
|
title: `已绑定打印台:${station.name}`,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}, 300);
|
||||||
},
|
},
|
||||||
getStatusText(status) {
|
getStatusText(status) {
|
||||||
const map = {
|
const map = {
|
||||||
@ -1312,4 +1411,48 @@
|
|||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.station-list-scroll {
|
||||||
|
max-height: 600rpx;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station-list-pagination {
|
||||||
|
padding: 16rpx 10rpx 4rpx;
|
||||||
|
border-top: 1rpx solid #f2f3f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station-list-empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 60rpx 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station-list-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 24rpx 20rpx;
|
||||||
|
border-bottom: 1rpx solid #f2f3f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station-list-item:active {
|
||||||
|
background: #f5f6fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station-list-item__name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #303133;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station-list-item__id {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.safe-bottom-in-popup {
|
||||||
|
height: calc(10rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user