feat:每个货柜独立库存

This commit is contained in:
dzc committed 2025-04-18 14:35:48 +08:00
1 parent 89aa679c75
commit 95c3ad6c39
11 files changed
+340 -26

No files matched your search

+158
View File
@@ -0,0 +1,158 @@
<template>
<div v-loading="loading">
<el-descriptions v-if="detail" title="智能柜日志">
<el-descriptions-item labelClassName="no-colon">
<el-timeline>
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="info" style="width: 120px">用户授权</el-tag>
<span class="color-primary ml-2">{{ detail.createTime }}</span>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail.requestOpenTime">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="info" style="width: 120px">智能柜申请开门</el-tag>
<span class="color-primary ml-2">{{ detail.requestOpenTime }}</span>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail.openCallbackTime">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="info" style="width: 120px">智能柜开门响应</el-tag>
<span class="color-primary ml-2">{{ detail.openCallbackTime }}</span>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail.videoCallbackTime">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="info" style="width: 120px">智能柜视频回调</el-tag>
<span class="color-primary ml-2">{{ detail.videoCallbackTime }}</span>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail.skuSubmitTime">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="info" style="width: 120px">商品提交识别</el-tag>
<span class="color-primary ml-2">{{ detail.skuSubmitTime }}</span>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail.skuCallbackTime">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="info" style="width: 120px">商品识别响应</el-tag>
<span class="color-primary ml-2">{{ detail.skuCallbackTime }}</span>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail.payTime">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="info" style="width: 120px">订单结算</el-tag>
<span class="color-primary ml-2">{{ detail.payTime }}</span>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail.error && detail.errorDesc">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="danger" style="width: 120px">错误</el-tag>
<span class="color-danger ml-2">{{ detail.errorDesc }}</span>
</div>
</el-timeline-item>
</el-timeline>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script setup lang="ts" name="hard-door-log">
import * as hardFlowManager from "/@/api/hard/hard-door-flow"
type Props = {
orderId?: string
}
const props = withDefaults(defineProps<Props>(), { orderId: "" })
const detail = ref<any>({})
const loading = ref<boolean>(false)
watch(
() => props.orderId,
() => {
getFlow()
},
)
const getFlow = async () => {
if (!props.orderId) return
loading.value = true
try {
const _pa = { orderId: props.orderId }
const { data } = await hardFlowManager.getByOrderId(_pa)
detail.value = data
} catch (e) {
console.error(e)
} finally {
loading.value = false
}
}
onMounted(() => {
getFlow()
})
</script>
<style lang="scss" scoped>
// 时间线样式调整
:deep(.el-timeline) {
margin: 10px 0 0 160px;
.el-timeline-item__wrapper {
position: relative;
top: -20px;
.el-timeline-item__timestamp {
position: absolute !important;
top: 10px;
left: -150px;
}
}
.el-timeline-right-content {
display: flex;
align-items: center;
min-height: 30px;
padding: 10px;
background-color: #409eff;
&::before {
position: absolute;
top: 10px;
left: 13px;
border-color: transparent #409eff transparent transparent;
border-style: solid;
border-width: 8px;
content: "";
}
}
.el-timeline-item__node {
position: absolute;
left: -5px;
top: -50%;
transform: translateY(100%);
display: flex;
width: 20px;
height: 20px;
font-size: 10px;
background: #409eff;
border-radius: 50%;
justify-content: center;
align-items: center;
}
}
</style>
+1 -2
View File
@@ -54,8 +54,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 打开弹窗
const openDialog = (id: string) => {
@@ -124,6 +124,7 @@
</el-timeline>
</el-descriptions-item>
</el-descriptions>
<hard-door-log :orderId="globalData.detail.id" />
</div>
<refund-reject-form ref="refundRejectRef" @refresh="getDetail" />
@@ -142,6 +143,7 @@ import { ElLoading } from "element-plus"
// 引入组件
const RefundRejectForm = defineAsyncComponent(() => import("./refund-reject.vue"))
const HardDoorLog = defineAsyncComponent(() => import("../components/hard-door-log.vue"))
// 定义查询字典
const { hard_pay_type, hard_order_type, hard_order_status, hard_after_sale_way, hard_after_sale_type, hard_sale_status, hard_type } =
+34 -2
View File
@@ -2,6 +2,23 @@
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row>
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-row>
<el-form-item style="width: 300px" label="用户" prop="userId">
<select-user v-model="state.queryForm.userId" />
</el-form-item>
<el-form-item style="width: 300px" label="流程类型" prop="bizType">
<dict-select v-model="state.queryForm.bizType" dict-code="hard_door_flow_biz" />
</el-form-item>
<el-form-item style="width: 400px" label="创建时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
</el-form>
<div class="mb8" style="width: 100%">
<right-toolbar
v-model:showSearch="showSearch"
@@ -24,6 +41,19 @@
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="80" />
<el-table-column label="流程">
<el-table-column prop="bizType" label="流程类型" width="120">
<template #default="{ row }">
<dict-tag :options="hard_door_flow_biz" :value="row.bizType" />
</template>
</el-table-column>
<el-table-column prop="flowStatus" label="当前流程" width="120">
<template #default="{ row }">
<dict-tag :options="hard_door_flow" :value="row.flowStatus" />
</template>
</el-table-column>
<el-table-column prop="errorDesc" label="错误描述" width="120" />
</el-table-column>
<el-table-column label="购买用户">
<el-table-column prop="username" label="姓名" width="120" />
<el-table-column prop="userMobile" label="手机号" width="120" />
@@ -77,7 +107,9 @@
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" width="150"> </el-table-column>
<el-table-column label="支付流程">
<el-table-column prop="payTime" label="支付成功时间" width="180" />
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
@@ -92,7 +124,7 @@ import { useDict } from "/@/hooks/dict"
// 引入组件
// 定义查询字典
const { yes_no_type } = useDict("yes_no_type")
const { yes_no_type, hard_door_flow_biz, hard_door_flow } = useDict("yes_no_type", "hard_door_flow_biz", "hard_door_flow")
// 定义变量内容
// 搜索变量
const queryRef = ref()
@@ -177,18 +177,6 @@
</div>
</el-tab-pane>
</el-tabs>
<el-descriptions title="智能柜日志">
<el-descriptions-item labelClassName="no-colon">
<el-timeline>
<el-timeline-item v-for="v in new Array(2).fill({})" :key="v.id" timestamp="2025-1-1 222222" placement="top">
<div class="el-timeline-right-content">
<span>{{ "121121" }}</span>
</div>
</el-timeline-item>
</el-timeline>
</el-descriptions-item>
</el-descriptions>
</div>
<!-- 柜子设置 -->
+7 -1
View File
@@ -2,6 +2,11 @@
<el-dialog :title="form.id ? '编辑' : '新增'" width="40%" v-model="visible" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="120px" v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item label="柜门" prop="cabinetId">
<select-cabinet v-model="form.cabinetId" />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="商品" prop="spuId">
<select-hard-spu v-model="form.spuId" />
@@ -39,13 +44,14 @@ const loading = ref(false)
const form = reactive({
id: "",
userId: "",
hardId: "",
cabinetId: "",
spuId: "",
count: 5,
})
// 定义校验规则
const dataRules = ref({
cabinetId: [{ required: true, message: "请选择柜门", trigger: "change" }],
spuId: [{ required: true, message: "请选择商品", trigger: "change" }],
count: [{ required: true, message: "请输入库存量", trigger: "blur" }],
})
+2 -9
View File
@@ -69,13 +69,6 @@
</el-table-column>
</el-table-column>
<el-table-column prop="hardId" label="设备">
<el-table-column min-width="120" label="所属商家">
<template #default="{ row }">
<span class="color-primary">
{{ row.merchantName }}
</span>
</template>
</el-table-column>
<el-table-column min-width="120" label="设备名称">
<template #default="{ row }">
<span class="color-primary">
@@ -83,9 +76,9 @@
</span>
</template>
</el-table-column>
<el-table-column min-width="120" label="放置层数">
<el-table-column min-width="120" label="设备编号">
<template #default="{ row }">
<span class="color-primary"> {{ row.hardDoorNumber }}层 </span>
<span class="color-primary"> {{ row.deviceCode }}-{{ row.cabinetNo }} </span>
</template>
</el-table-column>
</el-table-column>