This commit is contained in:
liufumingren 2026-05-13 09:12:25 +08:00
parent 2194cd9cca
commit 33a47dad2c
2 changed files with 7 additions and 6 deletions

View File

@ -128,8 +128,8 @@ export function getComputer() {
}) })
} }
export function getComputerPrinter(id: string | number) { export function getComputerPrinter(computerId: string | number) {
const numId = Number(id) const numId = Number(computerId)
return request({ return request({
url: '/system', url: '/system',
method: 'post', method: 'post',
@ -138,7 +138,7 @@ export function getComputerPrinter(id: string | number) {
v, v,
timestamp: stamp() timestamp: stamp()
}, },
data: Number.isFinite(numId) ? { id: numId } : { id } data: Number.isFinite(numId) ? { id: numId } : { id: computerId }
}) })
} }

View File

@ -39,7 +39,7 @@
<el-option v-for="item in businessTypeOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in businessTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-select v-model="printSettings.station" placeholder="请选择打印台" size="small" @change="handleStationChange"> <el-select v-model="printSettings.station" placeholder="请选择打印台" size="small" @change="handleStationChange">
<el-option v-for="item in stationOptions" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in stationOptions" :key="item.id" :label="item.name" :value="item.computer_id" />
</el-select> </el-select>
<el-select v-model="printSettings.printer" placeholder="请选择打印机" size="small" :loading="printerLoading"> <el-select v-model="printSettings.printer" placeholder="请选择打印机" size="small" :loading="printerLoading">
<el-option v-for="item in printerOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in printerOptions" :key="item.value" :label="item.label" :value="item.value" />
@ -434,8 +434,9 @@ async function loadPrintOptions() {
if (stations && (stations.code === 200 || stations.code === 0)) { if (stations && (stations.code === 200 || stations.code === 0)) {
const rawList: any[] = stations.data?.list || stations.data || [] const rawList: any[] = stations.data?.list || stations.data || []
stationOptions.value = rawList.map((item: any) => ({ stationOptions.value = rawList.map((item: any) => ({
id: item.id, id: item.id ?? item.computer_id,
name: item.name || item.label || String(item.id) computer_id: item.computer_id ?? item.computerId ?? item.id,
name: item.name || item.label || String(item.computer_id ?? item.computerId ?? item.id)
})) }))
} else { } else {
console.warn('获取打印台列表失败:', stations) console.warn('获取打印台列表失败:', stations)