货柜列表 货柜详情 货柜补货
This commit is contained in:
1 parent
eb57fc50b0
commit
af4bc52c7f
7 files changed
+511
-97
No files matched your search
@@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<crud-layout title="货柜详情" mainIsScroll bg="/static/page/blue-bg.png">
|
||||||
|
<view v-if="state.detail.id">
|
||||||
|
<tm-sheet :margin="[0, 20]" class="second-text-28">
|
||||||
|
<tm-text font-size="32">基本信息</tm-text>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>设备编号:</text>
|
||||||
|
<text>{{ state.detail.deviceCode }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>设备名称:</text>
|
||||||
|
<text>{{ state.detail.hardName }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>设备IMEI卡号:</text>
|
||||||
|
<text>{{ state.detail.imei }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>货柜数量:</text>
|
||||||
|
<text>{{ state.detail.cabinetNum }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>单个货柜摄像头数量:</text>
|
||||||
|
<text>{{ state.detail.cabinetCameraNum }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>单个货柜称重单元数量:</text>
|
||||||
|
<text>{{ state.detail.cabinetWeightUnitNum }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>SIM卡号:</text>
|
||||||
|
<text>{{ state.detail.simSn }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>柜子层数:</text>
|
||||||
|
<text>{{ state.detail.doorCount }}</text>
|
||||||
|
</view>
|
||||||
|
</tm-sheet>
|
||||||
|
|
||||||
|
<tm-sheet :margin="[0, 20]" class="second-text-28">
|
||||||
|
<tm-text font-size="32">运行信息</tm-text>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>售卖状态:</text>
|
||||||
|
<tm-tag size="xs" v-if="state.detail.saleStatus == 1">在售</tm-tag>
|
||||||
|
<tm-tag size="xs" v-if="state.detail.saleStatus == 2" color="error">停售</tm-tag>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>电源状态:</text>
|
||||||
|
<tm-tag size="xs" v-if="state.detail.powerStatus == 1">通电</tm-tag>
|
||||||
|
<tm-tag size="xs" v-if="state.detail.powerStatus == 2" color="error">断电</tm-tag>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>在线状态:</text>
|
||||||
|
<tm-tag size="xs" v-if="state.detail.netStatus == 1">在线</tm-tag>
|
||||||
|
<tm-tag size="xs" v-if="state.detail.netStatus == 2" color="error">离线</tm-tag>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>媒体音量:</text>
|
||||||
|
<text class="c-red">{{ state.detail.mediaVolume }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>系统音量:</text>
|
||||||
|
<text class="c-red">{{ state.detail.systemVolume }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>SIM信号强度:</text>
|
||||||
|
<text>{{ state.detail.signalIntensity }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>信噪比:</text>
|
||||||
|
<text>{{ state.detail.signalRatio }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>SIM信号值更新时间:</text>
|
||||||
|
<text>{{ state.detail.signalTime }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>上次重启时间:</text>
|
||||||
|
<text>{{ state.detail.restartTime }}</text>
|
||||||
|
</view>
|
||||||
|
</tm-sheet>
|
||||||
|
|
||||||
|
<tm-sheet v-for="(item, index) in state.detail.cabinetList" :key="index" :margin="[0, 20]" class="second-text-28">
|
||||||
|
<tm-text font-size="32">{{ "柜门" + state.detail.deviceCode + "-" + item.cabinetNo }}</tm-text>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>货柜号:</text>
|
||||||
|
<text>{{ item.cabinetNo }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>锁在线:</text>
|
||||||
|
<tm-tag size="xs" v-if="item.isLockOnline == 'Y'">在线</tm-tag>
|
||||||
|
<tm-tag size="xs" v-if="item.isLockOnline == 2" color="error">离线</tm-tag>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>锁状态:</text>
|
||||||
|
<tm-tag size="xs" v-if="item.lockStatus == 1">锁关</tm-tag>
|
||||||
|
<tm-tag size="xs" v-if="item.lockStatus == 2" color="error">锁开</tm-tag>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>门状态:</text>
|
||||||
|
<tm-tag size="xs" v-if="item.doorStatus == 1">门关</tm-tag>
|
||||||
|
<tm-tag size="xs" v-if="item.doorStatus == 2" color="error">门开</tm-tag>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-between mt-1">
|
||||||
|
<text>货柜售卖状态:</text>
|
||||||
|
<tm-tag size="xs" v-if="item.saleStatus == 1">在售</tm-tag>
|
||||||
|
<tm-tag size="xs" v-if="item.saleStatus == 2" color="error">停售</tm-tag>
|
||||||
|
</view>
|
||||||
|
</tm-sheet>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="h-40rpx" />
|
||||||
|
</crud-layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { reactive } from "vue"
|
||||||
|
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||||
|
import { doorApi } from "@/sheep/api"
|
||||||
|
|
||||||
|
const state = reactive<any>({
|
||||||
|
hardDoorId: "",
|
||||||
|
detail: {},
|
||||||
|
})
|
||||||
|
|
||||||
|
onLoad((option: any) => {
|
||||||
|
if (!option.hardDoorId) return
|
||||||
|
state.hardDoorId = option.hardDoorId
|
||||||
|
})
|
||||||
|
|
||||||
|
onShow(async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: "加载中...", mask: true })
|
||||||
|
const res = await doorApi.hardDoorDetail({ hardDoorId: state.hardDoorId })
|
||||||
|
if (res.code == 0) {
|
||||||
|
state.detail = res.data
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.showToast({ title: res.msg, icon: "none" })
|
||||||
|
} catch (error: any) {
|
||||||
|
uni.showToast({ title: error.msg, icon: "none" })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -4,52 +4,66 @@
|
|||||||
ref="pageRef"
|
ref="pageRef"
|
||||||
height="100%"
|
height="100%"
|
||||||
:fixed="false"
|
:fixed="false"
|
||||||
|
v-model="pageHook.list"
|
||||||
|
:default-page-size="10"
|
||||||
safe-area-inset-bottom
|
safe-area-inset-bottom
|
||||||
:loading-more-enabled="true"
|
:loading-more-enabled="true"
|
||||||
:show-scrollbar="false"
|
:show-scrollbar="false"
|
||||||
|
@query="query"
|
||||||
:auto-clean-list-when-reload="false"
|
:auto-clean-list-when-reload="false"
|
||||||
:auto-scroll-to-top-when-reload="false"
|
:auto-scroll-to-top-when-reload="false"
|
||||||
|
@scroll="pageHook.scroll"
|
||||||
>
|
>
|
||||||
<view class="h-30rpx" />
|
<view class="h-30rpx" />
|
||||||
<tm-collapse :multiple="false">
|
<tm-sheet v-for="(item, index) in pageHook.list" :key="index" :margin="[0, 20]">
|
||||||
<tm-collapse-item
|
<tm-text font-size="32">{{ item.hardName }} {{ item.deviceCode }}</tm-text>
|
||||||
v-for="(item, index) in new Array(3).fill({})"
|
<view class="card flex justify-around items-center my-1 p-2">
|
||||||
:key="index"
|
<view class="flex-col items-center p-2 rounded-1 active:bg-#E8E8E8" @click="doDetail(item.hardId)">
|
||||||
left-icon="settings-line"
|
<image class="w-50 h-50" src="@/static/page/货柜详情.svg" />
|
||||||
:name="index"
|
<tm-text>货柜详情</tm-text>
|
||||||
title="柜子123"
|
|
||||||
>
|
|
||||||
<tm-text class="line-10">地址:123</tm-text>
|
|
||||||
<view class="card flex justify-around items-center">
|
|
||||||
<view class="flex-col items-center p-2 rounded-1 active:bg-#E8E8E8">
|
|
||||||
<image class="w-60 h-60" src="@/static/page/开门.svg" />
|
|
||||||
<text>货柜详情</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-col items-center p-2 rounded-1 active:bg-#E8E8E8" @click="replenishment">
|
|
||||||
<image class="w-60 h-60" src="@/static/page/开门.svg" />
|
|
||||||
<text>货柜补货</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-col items-center p-2 rounded-1 active:bg-#E8E8E8" @click="openPutaway">
|
|
||||||
<image class="w-60 h-60" src="@/static/page/开门.svg" />
|
|
||||||
<text>商品上架</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</tm-collapse-item>
|
<view class="flex-col items-center p-2 rounded-1 active:bg-#E8E8E8" @click="replenishment(item.hardId)">
|
||||||
</tm-collapse>
|
<image class="w-50 h-50" src="@/static/page/开门.svg" />
|
||||||
|
<tm-text>货柜补货</tm-text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col items-center p-2 rounded-1 active:bg-#E8E8E8" @click="openPutaway(item.hardId)">
|
||||||
|
<image class="w-50 h-50" src="@/static/page/货柜上架.svg" />
|
||||||
|
<tm-text>商品上架</tm-text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</tm-sheet>
|
||||||
</z-paging>
|
</z-paging>
|
||||||
</crud-layout>
|
</crud-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { router } from "@/sheep"
|
import { ref } from "vue"
|
||||||
|
import { hooks, router } from "@/sheep"
|
||||||
|
import { doorApi } from "@/sheep/api"
|
||||||
|
|
||||||
|
const pageRef = ref<any>(null)
|
||||||
|
|
||||||
|
const pageHook = hooks.usePage(pageRef, doorApi.hardDoorPage, null, "data.records")
|
||||||
|
|
||||||
|
const query = (page: number, pagesize: number) => {
|
||||||
|
pageHook.startPage(page, pagesize, false, {})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 货柜详情
|
||||||
|
const doDetail = (hardDoorId: string) => {
|
||||||
|
if (!hardDoorId) return
|
||||||
|
router.jump("/pages/cabinet/cabinetDetail", { hardDoorId }, 1)
|
||||||
|
}
|
||||||
|
|
||||||
// 商品补货
|
// 商品补货
|
||||||
const replenishment = () => {
|
const replenishment = (hardDoorId: string) => {
|
||||||
router.jump("/pages/cabinet/replenishment", {}, 1)
|
if (!hardDoorId) return
|
||||||
|
router.jump("/pages/cabinet/replenishment", { hardDoorId }, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 商品上架
|
// 商品上架
|
||||||
const openPutaway = () => {
|
const openPutaway = (hardDoorId: string) => {
|
||||||
router.jump("/pages/cabinet/putaway", {}, 1)
|
if (!hardDoorId) return
|
||||||
|
router.jump("/pages/cabinet/putaway", { hardDoorId }, 1)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -11,26 +11,38 @@
|
|||||||
:auto-scroll-to-top-when-reload="false"
|
:auto-scroll-to-top-when-reload="false"
|
||||||
>
|
>
|
||||||
<template #top>
|
<template #top>
|
||||||
<view class="h-30rpx" />
|
<view class="bg-white rounded-20rpx my-20rpx font-bold">
|
||||||
<tm-tabs
|
<z-tabs
|
||||||
item-width="50%"
|
:list="
|
||||||
gap="0"
|
state.detail.cabinetList?.length &&
|
||||||
line-full
|
state.detail.cabinetList.map((item:any, index:number) => {
|
||||||
line-height="4rpx"
|
return {
|
||||||
round="10"
|
name: state.detail.deviceCode + '-' + item.cabinetNo,
|
||||||
active-title-color=""
|
value: index,
|
||||||
:list="['门1', '门2']"
|
}
|
||||||
@change="doorTabsChange"
|
})
|
||||||
/>
|
"
|
||||||
<view class="h-10rpx" />
|
bar-width="150"
|
||||||
|
:active-style="{
|
||||||
|
fontSize: '30rpx',
|
||||||
|
}"
|
||||||
|
:inactive-style="{
|
||||||
|
fontSize: '30rpx',
|
||||||
|
}"
|
||||||
|
@change="doorTabsChange"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<view class="w-full w-full">
|
<view class="w-full w-full">
|
||||||
<view v-for="(item, index) in new Array(6).fill(new Array(10)).map((item) => item.fill({}))" :key="index">
|
<view v-for="(item, index) in state.cabinetList" :key="index">
|
||||||
<tm-text class="text-center mt-4">第 {{ index + 1 }} 层</tm-text>
|
<tm-text class="text-center">第 {{ index + 1 }} 层</tm-text>
|
||||||
<view class="flex flex-wrap">
|
<view class="flex flex-wrap mb-4">
|
||||||
<view v-for="(v, i) in item" :key="i" class="w-1/4 h-200 p-1">
|
<view v-for="(v, i) in item[index + 1]" :key="i" class="w-1/5 h-150 p-1">
|
||||||
<view class="card w-full h-full p-2 flex items-center justify-center active:bg-#e8e8e8!" @click="doPutaway">
|
<view v-if="v.spuId && v.spuDetail" class="card w-full h-full flex items-center justify-center">
|
||||||
|
<image class="w-full h-full" :src="v.spuDetail.pic" />
|
||||||
|
</view>
|
||||||
|
<view v-else class="card w-full h-full p-2 flex items-center justify-center active:bg-#e8e8e8!" @click="doPutaway">
|
||||||
<image class="w-half h-half" src="@/static/page/加号.svg" />
|
<image class="w-half h-half" src="@/static/page/加号.svg" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -91,30 +103,70 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref } from "vue"
|
import { computed, reactive } from "vue"
|
||||||
|
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
|
||||||
|
import { doorApi } from "@/sheep/api"
|
||||||
|
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||||
|
|
||||||
const state = reactive<any>({
|
const state = reactive<any>({
|
||||||
|
hardDoorId: "",
|
||||||
|
detail: {},
|
||||||
curDoorTabIndex: 0,
|
curDoorTabIndex: 0,
|
||||||
|
cabinetList: [],
|
||||||
|
|
||||||
curGoodsTabIndex: 0,
|
curGoodsTabIndex: 0,
|
||||||
showDrawer: false,
|
showDrawer: false,
|
||||||
checkboxValue: [],
|
checkboxValue: [],
|
||||||
})
|
})
|
||||||
|
const curCabinetNo = computed(() => {
|
||||||
|
if (state.detail.cabinetList) return state.detail.cabinetList[state.curDoorTabIndex].cabinetNo
|
||||||
|
})
|
||||||
|
|
||||||
const listview = ref<any>([
|
onLoad((option: any) => {
|
||||||
{ text: "科技创新引领制造业高质量发展", id: 1 },
|
if (!option.hardDoorId) return
|
||||||
{ text: "明确提出“建立保持制造业合理比重投入机制”。", id: 2 },
|
state.hardDoorId = option.hardDoorId
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 3 },
|
})
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 4 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 5 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 6 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 7 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 8 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 9 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 10 },
|
|
||||||
])
|
|
||||||
|
|
||||||
const doorTabsChange = (index: number) => {
|
onShow(async () => {
|
||||||
state.curDoorTabIndex = index
|
if (!state.hardDoorId) return
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: "加载中...", mask: true })
|
||||||
|
const res = await doorApi.hardDoorDetail({ hardDoorId: state.hardDoorId })
|
||||||
|
if (res.code == 0) {
|
||||||
|
state.detail = res.data
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg, icon: "none" })
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
uni.showToast({ title: error.msg, icon: "none" })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取货柜补货商品列表
|
||||||
|
await getCabinetList()
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取货柜商品列表
|
||||||
|
const getCabinetList = async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: "加载中...", mask: true })
|
||||||
|
const res = await doorApi.cabinetList({ hardId: state.hardDoorId, cabinetNo: curCabinetNo.value })
|
||||||
|
if (res.code == 0) {
|
||||||
|
state.cabinetList = res.data
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg, icon: "none" })
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
uni.showToast({ title: error.msg, icon: "none" })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const doorTabsChange = async (e: number) => {
|
||||||
|
state.curDoorTabIndex = e
|
||||||
|
await getCabinetList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const goodsTabsChange = (index: number) => {
|
const goodsTabsChange = (index: number) => {
|
||||||
|
|||||||
@@ -13,10 +13,15 @@
|
|||||||
<template #top>
|
<template #top>
|
||||||
<view class="bg-white rounded-20rpx my-20rpx font-bold">
|
<view class="bg-white rounded-20rpx my-20rpx font-bold">
|
||||||
<z-tabs
|
<z-tabs
|
||||||
:list="[
|
:list="
|
||||||
{ name: '门1', value: 1 },
|
state.detail.cabinetList?.length &&
|
||||||
{ name: '门2', value: 2 },
|
state.detail.cabinetList.map((item:any, index:number) => {
|
||||||
]"
|
return {
|
||||||
|
name: state.detail.deviceCode + '-' + item.cabinetNo,
|
||||||
|
value: index,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
"
|
||||||
bar-width="150"
|
bar-width="150"
|
||||||
:active-style="{
|
:active-style="{
|
||||||
fontSize: '30rpx',
|
fontSize: '30rpx',
|
||||||
@@ -29,18 +34,26 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<tm-sheet v-for="(item, index) in listview" :key="index" :margin="[0, 20]">
|
<tm-sheet v-for="(item, index) in state.cabinetPutawayList" :key="index" :margin="[0, 0, 0, 20]" :padding="15">
|
||||||
<view class="flex">
|
<view class="flex items-center">
|
||||||
<image class="w-120rpx h-120rpx" />
|
<image class="w-180rpx h-180rpx" :src="item.spuDetail?.pic" />
|
||||||
<view class="ml-2 flex-1 flex-col">
|
<view class="ml-2 flex-1 flex-col">
|
||||||
<tm-text font-size="32">更改圆角</tm-text>
|
<tm-text font-size="30">{{ item.spuDetail?.name }}</tm-text>
|
||||||
<view class="flex justify-between my-1">
|
<view class="flex justify-between mt-1">
|
||||||
<tm-text font-size="26">规格:</tm-text>
|
<tm-text font-size="26">种类:{{ item.spuDetail?.categoryName }}</tm-text>
|
||||||
<tm-text font-size="26">规格:</tm-text>
|
<tm-text font-size="26">售卖数量:{{ item.spuDetail?.salesCount }}</tm-text>
|
||||||
|
<tm-text font-size="26">层数:{{ item.hardDoorNumber }}</tm-text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-end items-center">
|
<view class="flex justify-between">
|
||||||
<tm-text font-size="30">库存:</tm-text>
|
<tm-text font-size="26">库存:{{ item.spuDetail?.repertoryCount || 0 }}</tm-text>
|
||||||
<tm-stepper width="200" v-model="item.stock" />
|
</view>
|
||||||
|
|
||||||
|
<view class="flex justify-between items-center">
|
||||||
|
<tm-text font-size="30" color="red">¥{{ displayPrice(item.spuDetail?.price) }}</tm-text>
|
||||||
|
<view class="flex items-center">
|
||||||
|
<tm-text font-size="28">补货数:</tm-text>
|
||||||
|
<tm-stepper width="200" v-model="item.plusCount" :max="99" splitBtn fontSize="30" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -49,39 +62,113 @@
|
|||||||
|
|
||||||
<template #main-bottom>
|
<template #main-bottom>
|
||||||
<view class="m-30rpx flex justify-between">
|
<view class="m-30rpx flex justify-between">
|
||||||
<tm-button block @click="openDoor" :disabled="!state.isUseDoor">一键补满</tm-button>
|
<tm-button block @click="openDoor" :disabled="false">开门补货</tm-button>
|
||||||
|
|
||||||
<tm-button block @click="openDoor" :disabled="!state.isUseDoor">开 门</tm-button>
|
<tm-button block @click="replenishmentComplete" :disabled="!state['flowId' + curCabinetNo.value]">补货完成</tm-button>
|
||||||
|
|
||||||
<tm-button block @click="save" :disabled="!state.isUseDoor">保 存</tm-button>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</crud-layout>
|
</crud-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref } from "vue"
|
import { computed, reactive } from "vue"
|
||||||
|
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||||
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
|
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
|
||||||
|
import { doorApi } from "@/sheep/api"
|
||||||
|
import { displayPrice } from "@/sheep/utils/formatMoney"
|
||||||
|
|
||||||
const listview = ref<any>([
|
const state = reactive<any>({
|
||||||
{ text: "科技创新引领制造业高质量发展", id: 1 },
|
hardDoorId: "",
|
||||||
{ text: "明确提出“建立保持制造业合理比重投入机制”。", id: 2 },
|
detail: {},
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 3 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 4 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 5 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 6 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 7 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 8 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 9 },
|
|
||||||
{ text: "改造提升传统产业,培育壮大新兴产业,布局建设未来产业,完善现代化产业体系", id: 10 },
|
|
||||||
])
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
curDoorTabIndex: 0,
|
curDoorTabIndex: 0,
|
||||||
|
cabinetPutawayList: [],
|
||||||
|
})
|
||||||
|
const curCabinetNo = computed(() => {
|
||||||
|
if (state.detail.cabinetList) return state.detail.cabinetList[state.curDoorTabIndex].cabinetNo
|
||||||
|
})
|
||||||
|
const putawayList = computed(() => state.cabinetPutawayList.map((item: any) => ({ hardSpuId: item.spuId, plusCount: item.plusCount || 0 })))
|
||||||
|
|
||||||
|
onLoad((option: any) => {
|
||||||
|
if (!option.hardDoorId) return
|
||||||
|
state.hardDoorId = option.hardDoorId
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onShow(async () => {
|
||||||
|
if (!state.hardDoorId) return
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: "加载中...", mask: true })
|
||||||
|
const res = await doorApi.hardDoorDetail({ hardDoorId: state.hardDoorId })
|
||||||
|
if (res.code == 0) {
|
||||||
|
state.detail = res.data
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg, icon: "none" })
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
uni.showToast({ title: error.msg, icon: "none" })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取货柜补货商品列表
|
||||||
|
await getCabinetPutawayList()
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取货柜补货商品列表
|
||||||
|
const getCabinetPutawayList = async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: "加载中...", mask: true })
|
||||||
|
const res = await doorApi.cabinetPutawayList({ hardDoorId: state.detail.id, cabinetNo: curCabinetNo.value })
|
||||||
|
if (res.code == 0) {
|
||||||
|
state.cabinetPutawayList = res.data
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg, icon: "none" })
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
uni.showToast({ title: error.msg, icon: "none" })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 柜门tab切换
|
// 柜门tab切换
|
||||||
const doorTabsChange = (e: number) => {
|
const doorTabsChange = async (e: number) => {
|
||||||
state.curDoorTabIndex = e
|
state.curDoorTabIndex = e
|
||||||
|
await getCabinetPutawayList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开门补货
|
||||||
|
const openDoor = async () => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: "正在开门", mask: true })
|
||||||
|
const res = await doorApi.openRepertory({ hardDoorId: state.detail.id, cabinetNo: curCabinetNo.value })
|
||||||
|
if (res.code == 0) {
|
||||||
|
state["flowId" + curCabinetNo.value] = res.data
|
||||||
|
uni.showToast({ title: "开门成功", icon: "none" })
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || "开门失败", icon: "none" })
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
uni.showToast({ title: error.msg, icon: "none" })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 补货完成
|
||||||
|
const replenishmentComplete = async () => {
|
||||||
|
if (!state["flowId" + curCabinetNo.value]) return uni.showToast({ title: "请先开门", icon: "none" })
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: "正在保存", mask: true })
|
||||||
|
const res = await doorApi.repertoryDone({ flowId: state["flowId" + curCabinetNo.value], list: putawayList.value })
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({ title: "保存成功", icon: "none" })
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || "保存失败", icon: "none" })
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
uni.showToast({ title: error.msg, icon: "none" })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
+115
-2
@@ -5,7 +5,6 @@ export default {
|
|||||||
* app获取智能柜授权信息
|
* app获取智能柜授权信息
|
||||||
* @param doorHardId 智能柜设备id
|
* @param doorHardId 智能柜设备id
|
||||||
* @param cabinetNo 货柜编号
|
* @param cabinetNo 货柜编号
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
appGetAuthHardDoor: (data: { doorHardId: any; cabinetNo: any }) =>
|
appGetAuthHardDoor: (data: { doorHardId: any; cabinetNo: any }) =>
|
||||||
request({
|
request({
|
||||||
@@ -20,7 +19,6 @@ export default {
|
|||||||
* app获取智能柜授权信息
|
* app获取智能柜授权信息
|
||||||
* @param authId 授权id
|
* @param authId 授权id
|
||||||
* @param authStatus 是否授权
|
* @param authStatus 是否授权
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
appAuthHardDoor: (data: { authId: any; authStatus: any }) =>
|
appAuthHardDoor: (data: { authId: any; authStatus: any }) =>
|
||||||
request({
|
request({
|
||||||
@@ -31,4 +29,119 @@ export default {
|
|||||||
showLoading: false,
|
showLoading: false,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
/**
|
||||||
|
* app查询智能柜列表(有分页)
|
||||||
|
*/
|
||||||
|
hardDoorPage: (params: any) =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-door-manager/app/page",
|
||||||
|
method: "GET",
|
||||||
|
params,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app查询智能柜详情
|
||||||
|
* @param hardDoorId 智能柜id
|
||||||
|
*/
|
||||||
|
hardDoorDetail: (params: { hardDoorId: any }): Promise<any> =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-door-manager/app/detail",
|
||||||
|
method: "GET",
|
||||||
|
params,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上架
|
||||||
|
* @param id 绑定id
|
||||||
|
* @param hardSpuId 商品id
|
||||||
|
*/
|
||||||
|
putaway: (data: { hardDoorId: any }) =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-spu/app/putaway",
|
||||||
|
method: "POST",
|
||||||
|
data,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下架
|
||||||
|
* @param id 绑定id
|
||||||
|
* @param hardSpuId 商品id
|
||||||
|
*/
|
||||||
|
unPutaway: (data: { hardDoorId: { id: any; hardSpuId: any } }) =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-spu/app/un-putaway",
|
||||||
|
method: "POST",
|
||||||
|
data,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
/**
|
||||||
|
* app查询货柜补货商品列表
|
||||||
|
* @param hardDoorId 智能柜编号
|
||||||
|
* @param cabinetNo 货柜编号
|
||||||
|
*/
|
||||||
|
cabinetPutawayList: (params: { hardDoorId: any; cabinetNo: any }): Promise<any> =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-spu/app/cabinet-putaway-list",
|
||||||
|
method: "GET",
|
||||||
|
params,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app查询货柜商品列表
|
||||||
|
* @param hardId 智能柜编号
|
||||||
|
* @param cabinetNo 货柜编号
|
||||||
|
*/
|
||||||
|
cabinetList: (params: { hardId: any; cabinetNo: any }): Promise<any> =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-spu/app/cabinet-list",
|
||||||
|
method: "GET",
|
||||||
|
params,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app上架完成
|
||||||
|
* @param flowId
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
repertoryDone: (data: { flowId: any; list: Array<{ hardSpuId: any; plusCount: any }> }): Promise<any> =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-spu-repertory/app/repertory-done",
|
||||||
|
method: "POST",
|
||||||
|
data,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上架开门
|
||||||
|
* @param hardDoorId 智能柜编号
|
||||||
|
* @param cabinetNo 货柜编号
|
||||||
|
*/
|
||||||
|
openRepertory: (data: { hardDoorId: string; cabinetNo: string }): Promise<any> =>
|
||||||
|
request({
|
||||||
|
url: "hard/hard-door-flow/app/open-repertory",
|
||||||
|
method: "POST",
|
||||||
|
data,
|
||||||
|
custom: {
|
||||||
|
showLoading: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1744889227103" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7002" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M788.7872 51.2c41.1648 0 75.264 30.72 80.896 71.9872l0.512 5.0176 0.2048 5.3248v705.7408c0 43.6224-33.792 79.6672-76.8 82.2272l-4.8128 0.1024h-4.608l-0.6144 3.584c-5.12 24.2176-24.7808 43.2128-49.6128 46.9504l-4.7104 0.512-4.3008 0.1536h-47.2064a59.904 59.904 0 0 1-57.4976-43.1616l-1.1264-4.4544-0.6656-3.584H405.504l-0.6656 3.584c-5.12 24.2176-24.7808 43.2128-49.5616 46.9504l-4.7616 0.512-4.3008 0.1536h-47.2064a59.904 59.904 0 0 1-57.4976-43.1616l-1.1264-4.4544-0.6144-3.584h-4.608a81.92 81.92 0 0 1-81.0496-72.7552l-0.4096-4.7616L153.6 839.2704V133.5296c0-43.6224 33.792-79.6672 76.8-82.176L235.2128 51.2h553.5744zM478.1568 117.4016H235.2128c-7.1168 0-13.312 5.6832-14.5408 13.4656l-0.2048 2.6624v705.7408c0 8.192 5.5296 14.6944 12.3904 15.872l2.3552 0.256h70.8096v51.2h33.28v-51.2H478.208V117.3504z m310.6304 0H545.792v737.9456h138.8544v51.2h33.28l0.0512-51.2h70.8096c7.1168 0 13.312-5.632 14.5408-13.4144l0.2048-2.6624V134.8096l-0.0512-2.7136a15.6672 15.6672 0 0 0-12.288-14.4384l-2.4064-0.256zM390.7072 409.6a25.6 25.6 0 0 1 25.6 25.6v153.6a25.6 25.6 0 1 1-51.2 0v-153.6a25.6 25.6 0 0 1 25.6-25.6zM640 409.6a25.6 25.6 0 0 1 25.6 25.6v153.6a25.6 25.6 0 1 1-51.2 0v-153.6a25.6 25.6 0 0 1 25.6-25.6z" fill="#0779FD" p-id="7003"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1744889168384" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6791" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M847.0016 922.4192H210.176C178.9952 922.4192 153.6 897.024 153.6 865.792V158.976C153.6 127.7952 178.9952 102.4 210.176 102.4h636.7232c31.232 0 56.576 25.3952 56.576 56.576v706.6112a55.808 55.808 0 0 1-16.384 40.1408c-10.7008 10.752-24.8832 16.6912-40.0896 16.6912zM223.5904 852.3776H833.536V172.4416H223.5904v679.936z" fill="#0779FD" p-id="6792"></path><path d="M868.608 422.4H188.6208a35.0208 35.0208 0 0 1 0-69.9904h679.936a35.0208 35.0208 0 0 1 0 69.9904z m-470.016-124.9792H318.976a35.0208 35.0208 0 0 1 0-70.0416h79.6672a35.0208 35.0208 0 0 1 0 70.0416z m0 249.9584H318.976a35.0208 35.0208 0 0 1 0-69.9904h79.6672a35.0208 35.0208 0 0 1 0 69.9904z m0 250.0096H318.976a35.0208 35.0208 0 0 1 0-69.9904h79.6672a35.0208 35.0208 0 0 1 0 69.9904z m470.016-124.9792H188.6208a35.0208 35.0208 0 0 1 0-69.9904h679.936a35.0208 35.0208 0 0 1 0 69.9904z" fill="#0779FD" p-id="6793"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
Reference in new issue
Block a user