diff --git a/src/api/supermarket/smHotelMid.ts b/src/api/supermarket/smHotelMid.ts
index 6c4f50e1..f73b47d3 100644
--- a/src/api/supermarket/smHotelMid.ts
+++ b/src/api/supermarket/smHotelMid.ts
@@ -41,6 +41,15 @@ export function pullRoomsFromUpstream(id: string | number) {
})
}
+/** 仅拉取 getRoomPrice 房价样例(今天 1 天) */
+export function pullPriceFromUpstream(id: string | number) {
+ return request({
+ url: `/supermarket/smHotel/mid/pullPrice/${id}`,
+ method: "post",
+ timeout: 120000,
+ })
+}
+
export function pushToDownstream(id: string | number) {
return request({
url: `/supermarket/smHotel/mid/push/${id}`,
diff --git a/src/views/supermarket/smHotel/index.vue b/src/views/supermarket/smHotel/index.vue
index 4a0b5eb0..169e262e 100644
--- a/src/views/supermarket/smHotel/index.vue
+++ b/src/views/supermarket/smHotel/index.vue
@@ -148,7 +148,7 @@
{{ scope.row.dailyCount ?? 0 }}
-
+
拉取房间
+
+ 拉取房价
+
| null = null
const syncLoading = ref(false)
const syncingId = ref(null)
const pullingRoomsId = ref(null)
+const pullingPriceId = ref(null)
const pushLoading = ref(false)
const pushingId = ref(null)
const authHotelVisible = ref(false)
@@ -964,6 +976,27 @@ const handlePullRooms = async (row: any) => {
}
}
+const handlePullPrice = async (row: any) => {
+ const id = row?.id
+ if (!id) return
+ pullingPriceId.value = id
+ try {
+ const res: any = await pullPriceFromUpstream(id)
+ const data = res?.data || {}
+ const base = `房价接口(样例 ${data.sampleStart || "今天"}):产品 ${data.productCount ?? 0},日历 ${data.dailyCount ?? 0}`
+ if (Number(data.productCount || 0) <= 0 && Number(data.dailyCount || 0) <= 0) {
+ useMessage().warning(`${base}。无房价数据,请看服务端日志 getRoomPrice 返回`)
+ } else {
+ useMessage().success(base)
+ }
+ getDataList(false)
+ } catch (err: any) {
+ useMessage().error(err?.msg || err?.message || "拉取房价失败")
+ } finally {
+ pullingPriceId.value = null
+ }
+}
+
const handleSyncOne = async (id: string | number) => {
syncingId.value = id
try {