This commit is contained in:
weiwei committed 2025-04-21 17:40:00 +08:00
commit 5ee54bc7d8
16 files changed
+562 -77

No files matched your search

+21 -2
View File
@@ -1,8 +1,27 @@
import request from "/@/utils/request"
export function fetchList(query?: Object) {
/**
* 流程错误手动处理
*/
export function errorChange(data?: Object) {
return request({
url: "/hard/hard-door-flow/page",
url: "/hard/hard-auth/error-change",
method: "post",
data,
})
}
export function pageJoin(query?: Object) {
return request({
url: "/hard/hard-door-flow/page-join",
method: "get",
params: query,
})
}
export function getByOrderId(query?: Object) {
return request({
url: "/hard/hard-door-flow/get-by-order-id",
method: "get",
params: query,
})
+11
View File
@@ -1,5 +1,16 @@
import request from "/@/utils/request"
/**
* 柜门下拉查询
*/
export function selectCabinet(params?: { hardDoorId: any; cabinetNo: any }) {
return request({
url: "/hard/hard-door-manager/select-cabinet",
method: "get",
params,
})
}
/**
* 刷新智能柜货柜二维码
* @param hardDoorId 柜子编号
+55
View File
@@ -0,0 +1,55 @@
<template>
<div>
<el-button :style="jsonViewStyle" type="text" link @click="jsonViewVisible = true">
<div :style="jsonViewStyle" class="json-view">{{ jsonView }}</div>
</el-button>
<el-dialog append-to-body v-model="jsonViewVisible">
<vue-json-pretty :data="jsonData" showLength showLineNumber showIcon :collapsedOnClickBrackets="false" />
<template #footer>
<el-button @click="jsonViewVisible = false">关闭</el-button>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="preview-json">
import VueJsonPretty from "vue-json-pretty"
import "vue-json-pretty/lib/styles.css"
type Props = {
width?: number
json?: string
}
const props = withDefaults(defineProps<Props>(), {
width: 0,
json: "",
})
const jsonViewVisible = ref<boolean>(false)
const jsonData = computed(() => {
if (!props.json) return ""
if (typeof props.json == "string") return JSON.parse(props.json)
return props.json
})
const jsonView = computed(() => {
if (!props.json) return ""
if (typeof props.json != "string") return JSON.stringify(props.json)
return props.json
})
const jsonViewStyle = computed(() => {
if (!props.width) return { width: "160px !important" }
return { width: `${props.width}px !important` }
})
</script>
<style lang="scss" scoped>
.json-view {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
+115
View File
@@ -0,0 +1,115 @@
<template>
<el-select
style="width: 100%"
v-model="state.selectId"
:placeholder="props.placeholder"
:clearable="props.clearable"
remote-show-suffix
filterable
remote
:disabled="props.disabled"
:remote-method="remoteSearch"
:loading="state.loading"
@visible-change="(e: boolean) => e && getOptions()"
@change="change"
>
<el-option v-for="v in state.options" :key="v.id" :label="`${v.deviceCode}-${v.cabinetNo}`" :value="v.id">
<div class="flex items-center">
<div class="color-primary">{{ v.deviceCode }}-{{ v.cabinetNo }}</div>
<div class="flex items-center justify-center ml5">
<el-tag size="small"> {{ v.hardName }} </el-tag>
</div>
</div>
</el-option>
</el-select>
</template>
<script setup lang="ts" name="select-wallet-type">
import { reactive } from "vue"
import { useDict } from "/@/hooks/dict"
import * as hardDoorManagerApi from "/@/api/hard/hard-door-manager"
const emit = defineEmits(["change"])
const selectId = defineModel()
const props = withDefaults(
defineProps<{
placeholder?: string
disabled?: boolean
clearable?: boolean
autoFirst?: boolean
apiParams?: any
}>(),
{
placeholder: "请选择",
disabled: false,
clearable: true,
autoFirst: false,
apiParams: {},
},
)
const queryForm = reactive<any>({
cabinetNo: "",
current: 1,
size: 10,
})
const state = reactive<any>({
loading: true,
selectId: selectId,
options: [],
walletType: [],
})
watch(
selectId,
(newVal, oldValue) => {
if (newVal == oldValue) return
state.selectId = newVal
getOptions()
},
{ immediate: true },
)
async function getOptions() {
try {
state.loading = true
const _pa = {
...queryForm,
...props.apiParams,
}
const { data } = await hardDoorManagerApi.selectCabinet(_pa)
state.options = data.records ?? []
if (props.autoFirst && state.options.length != 0) {
state.selectId = state.options[0].id
emit("change", selectId)
}
const { wallet_type } = useDict("wallet_type")
state.walletType = wallet_type
} finally {
setTimeout(() => (state.loading = false), 500)
}
}
function remoteSearch(params: string) {
if (params != queryForm.cabinetNo) {
queryForm.cabinetNo = params
getOptions()
}
}
function clear() {
state.selectId = null
getOptions()
}
function change() {
emit("change", selectId)
}
onMounted(() => {
props.autoFirst && getOptions()
})
</script>
+4
View File
@@ -12,6 +12,7 @@ import Tip from "/@/components/Tip/index.vue"
import TagList from "/@/components/TagList/index.vue"
import SvgIcon from "/@/components/SvgIcon/index.vue"
import PreviewImage from "/@/components/PreviewImage/index.vue"
import PreviewJson from "/@/components/PreviewJson/index.vue"
import DraggableDepTree from "/@/components/DraggableDepTree/index.vue"
// 业务组件
@@ -31,6 +32,7 @@ import SelectHard from "/@/components/Select/SelectHard.vue"
import SelectHardSpu from "/@/components/Select/SelectHardSpu.vue"
import SelectHardGroup from "/@/components/Select/selectHardGroup.vue"
import SelectRole from "/@/components/Select/SelectRole.vue"
import SelectCabinet from "/@/components/Select/SelectCabinet.vue"
// 第三方组件
import ElementPlus from "element-plus"
@@ -66,6 +68,7 @@ export default {
app.component("TagList", TagList)
app.component("SvgIcon", SvgIcon)
app.component("PreviewImage", PreviewImage)
app.component("PreviewJson", PreviewJson)
app.component("DraggableDepTree", DraggableDepTree)
app.component("TreeMultipleSelect", TreeMultipleSelect)
app.component("SelectHard", SelectHard)
@@ -83,6 +86,7 @@ export default {
app.component("SelectSupplier", SelectSupplier)
app.component("SelectMchRule", SelectMchRule)
app.component("SelectRole", SelectRole)
app.component("SelectCabinet", SelectCabinet)
// 导入全部的elmenet-plus的图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+241
View File
@@ -0,0 +1,241 @@
<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>
<el-button v-if="!detail?.hardAuth?.manualChangeUserId" class="ml-2" link @click="visibleErrorChangeDiaog = true">
处理
</el-button>
</div>
</el-timeline-item>
</el-timeline>
<el-timeline v-if="detail?.hardAuth?.manualChangeUserId">
<el-timeline-item placement="top">
<div class="el-timeline-right-content">
<el-tag type="warning" style="width: 120px">手动处理智能柜订单</el-tag>
<span class="color-warning ml-2">{{ detail.hardAuth.manualChangeTime }}</span>
<span class="color-warning ml-2">{{ detail.hardAuth.manualChangeRemark }}</span>
<div class="ml-2" v-if="detail.hardAuth.manualChangePic">
<preview-image width="40px" height="40px" :src="detail.hardAuth.manualChangePic" />
</div>
</div>
</el-timeline-item>
</el-timeline>
</el-descriptions-item>
</el-descriptions>
<el-dialog
title="手动处理智能柜订单"
width="30%"
@close="dialogClose"
v-model="visibleErrorChangeDiaog"
:close-on-click-modal="false"
draggable
>
<el-form ref="formRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="formLoading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item label="设备名" prop="image">
<upload-imgs v-model="form.image" />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="处理原因" prop="remark">
<el-input v-model="form.remark" placeholder="请输入处理原因" type="textarea" :autosize="{ minRows: 6 }" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogClose">取消</el-button>
<el-button type="primary" @click="onSubmit" :disabled="formLoading">确认</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts" name="hard-door-log">
import * as hardFlowManager from "/@/api/hard/hard-door-flow"
import { useMessage } from "/@/hooks/message"
type Props = {
orderId?: string
}
const props = withDefaults(defineProps<Props>(), { orderId: "" })
const formRef = ref()
const visibleErrorChangeDiaog = ref<boolean>(false)
const detail = ref<any>({})
const loading = ref<boolean>(false)
const formLoading = ref<boolean>(false)
// 提交表单数据
const form = reactive({
flowId: "",
image: "",
remark: "用户未购买商品",
})
// 定义校验规则
const dataRules = ref({
remark: [{ required: true, message: "处理原因不能为空", trigger: "blur" }],
})
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
}
}
const dialogClose = async () => {
formRef.value?.resetFields()
visibleErrorChangeDiaog.value = false
}
const onSubmit = async () => {
const valid = await formRef.value.validate().catch(() => {})
if (!valid) return false
try {
formLoading.value = true
await hardFlowManager.errorChange({ ...form, flowId: detail.value.id })
useMessage().success("处理成功")
dialogClose()
} catch (error: any) {
useMessage().error(error.msg)
} finally {
formLoading.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 } =
+2 -2
View File
@@ -113,14 +113,14 @@
<div :class="{ 'color-danger': row.orderRefundCont != 0 }">{{ row.orderRefundCont }}次</div>
</template>
</el-table-column>
<el-table-column prop="orderProfitPrice" label="盈利金额" align="center" min-width="90">
<el-table-column prop="orderProfitPrice" label="消费净金额" align="center" min-width="120">
<template #default="{ row }">
<div :class="{ 'color-success': row.orderProfitPrice != 0 }">
{{ displayPrice(row.orderProfitPrice) }}
</div>
</template>
</el-table-column>
<el-table-column prop="orderProfitCont" label="盈利次数" align="center" min-width="90">
<el-table-column prop="orderProfitCont" label="消费净次数" align="center" min-width="120">
<template #default="{ row }">
<div :class="{ 'color-success': row.orderProfitCont != 0 }">{{ row.orderProfitCont }}次</div>
</template>
+89 -18
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"
@@ -23,22 +40,76 @@
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="orderId" label="订单编号" show-overflow-tooltip />
<el-table-column prop="authId" label="授权编号" show-overflow-tooltip />
<el-table-column prop="openEventId" label="开门事件编号" show-overflow-tooltip />
<el-table-column prop="openOutOpenNo" label="商户自定义开门请求号" show-overflow-tooltip />
<el-table-column prop="openCallbackRes" label="开门回调结果" show-overflow-tooltip />
<el-table-column prop="openCallbackTime" label="开门回调时间" show-overflow-tooltip />
<el-table-column prop="videoCallbackRes" label="视频回调结果" show-overflow-tooltip />
<el-table-column prop="videoCallbackTime" label="视频回调时间" show-overflow-tooltip />
<el-table-column prop="skuKsRecogId" label="识别任务唯一ID,用于结果获取,重新发起售后识别" show-overflow-tooltip />
<el-table-column prop="skuSubmitTime" label="sku识别提交时间" show-overflow-tooltip />
<el-table-column prop="skuCallbackRes" label="sku识别回调结果" show-overflow-tooltip />
<el-table-column prop="skuCallbackTime" label="sku识别回调时间" show-overflow-tooltip />
<el-table-column prop="skuDrivingRes" label="sku识别主动获取结果" show-overflow-tooltip />
<el-table-column prop="skuDrivingTime" label="sku识别主动获取时间" show-overflow-tooltip />
<el-table-column label="操作" width="150"> </el-table-column>
<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" />
</el-table-column>
<el-table-column label="开门流程">
<el-table-column prop="requestOpenDto" label="请求开门参数" width="180">
<template #default="{ row }">
<preview-json :json="row.requestOpenDto" />
</template>
</el-table-column>
<el-table-column prop="requestOpenVo" label="请求开门返回" width="180">
<template #default="{ row }">
<preview-json :json="row.requestOpenVo" />
</template>
</el-table-column>
<el-table-column prop="isOpen" label="是否开门" width="100">
<template #default="{ row }">
<dict-tag :options="yes_no_type" :value="row.isOpen" />
</template>
</el-table-column>
<el-table-column prop="requestOpenTime" label="请求开门时间" width="160" />
<el-table-column prop="openCallbackVo" label="开门回调返回" width="180">
<template #default="{ row }">
<preview-json :json="row.requestOpenVo" />
</template>
</el-table-column>
<el-table-column prop="openCallbackTime" label="开门回调时间" width="160" />
</el-table-column>
<el-table-column label="识别流程">
<el-table-column prop="videoCallbackTime" label="视频回调时间" width="160" />
<el-table-column prop="videoCallbackVo" label="视频回调结果" width="180">
<template #default="{ row }">
<preview-json :json="row.videoCallbackVo" />
</template>
</el-table-column>
<el-table-column prop="skuSubmitTime" label="商品识别提交时间" width="160" />
<el-table-column prop="skuSubmitDto" label="商品识别提交参数" width="180">
<template #default="{ row }">
<preview-json :json="row.skuSubmitDto" />
</template>
</el-table-column>
<el-table-column prop="skuSubmitVo" label="商品识别提交返回" width="180">
<template #default="{ row }">
<preview-json :json="row.skuSubmitVo" />
</template>
</el-table-column>
<el-table-column prop="skuCallbackTime" label="商品识别回调时间" width="180" />
<el-table-column prop="skuCallbackVo" label="商品识别回调返回" width="180">
<template #default="{ row }">
<preview-json :json="row.skuCallbackVo" />
</template>
</el-table-column>
</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>
@@ -53,7 +124,7 @@ import { useDict } from "/@/hooks/dict"
// 引入组件
// 定义查询字典
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()
@@ -64,7 +135,7 @@ const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: hardDoorFlow.fetchList,
pageList: hardDoorFlow.pageJoin,
})
// table hook
@@ -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>
<!-- 柜子设置 -->
+2 -2
View File
@@ -86,14 +86,14 @@
</span>
</template>
</el-table-column>
<el-table-column label="实际消费金额" align="center" prop="totalProfitPrice">
<el-table-column label="消费净金额" align="center" prop="totalProfitPrice" min-width="120">
<template #default="{ row }">
<span class="color-success">
{{ displayPrice(row.totalProfitPrice) }}
</span>
</template>
</el-table-column>
<el-table-column label="实际消费次数" align="center" prop="totalProfitCount">
<el-table-column label="消费净次数" align="center" prop="totalProfitCount" min-width="120">
<template #default="{ row }">
<span class="color-success">
{{ row.totalProfitCount || 0 }}
+2 -2
View File
@@ -87,14 +87,14 @@
</span>
</template>
</el-table-column>
<el-table-column label="实际消费金额" align="center" prop="totalProfitPrice">
<el-table-column label="消费净金额" align="center" prop="totalProfitPrice" min-width="120">
<template #default="{ row }">
<span class="color-success">
{{ displayPrice(row.totalProfitPrice) }}
</span>
</template>
</el-table-column>
<el-table-column label="实际消费次数" align="center" prop="totalProfitCount">
<el-table-column label="消费净次数" align="center" prop="totalProfitCount" min-width="120">
<template #default="{ row }">
<span class="color-success">
{{ row.totalProfitCount || 0 }}
+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>
+8 -27
View File
@@ -39,20 +39,18 @@
<dict-tag :options="third_biz_type" :value="row.bizType" />
</template>
</el-table-column>
<el-table-column prop="apiUrl" label="api url" show-overflow-tooltip />
<el-table-column prop="res" label="res" show-overflow-tooltip>
<el-table-column prop="apiUrl" label="api url" />
<el-table-column prop="res" label="res">
<template #default="{ row }">
<el-button v-if="row.res" text type="primary" @click="row.res && handleClickJsonView(row.res)">查看</el-button>
<div v-else class="color-danger">null</div>
<preview-json :json="row.res" />
</template>
</el-table-column>
<el-table-column prop="req" label="req" show-overflow-tooltip>
<el-table-column prop="req" label="req">
<template #default="{ row }">
<el-button v-if="row.req" text type="primary" @click="row.req && handleClickJsonView(row.req)">查看</el-button>
<div v-else class="color-danger">null</div>
<preview-json :json="row.req" />
</template>
</el-table-column>
<el-table-column prop="error" label="调用错误" show-overflow-tooltip>
<el-table-column prop="error" label="调用错误">
<template #default="{ row }">
<el-button
v-if="row.error"
@@ -67,8 +65,8 @@
<div v-else class="color-danger">null</div>
</template>
</el-table-column>
<el-table-column prop="timeConsuming" label="耗时(毫秒)" show-overflow-tooltip />
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip />
<el-table-column prop="timeConsuming" label="耗时(毫秒)" />
<el-table-column prop="createTime" label="创建时间" />
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
@@ -76,14 +74,6 @@
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<!-- json查看 -->
<el-dialog v-model="jsonViewVisible">
<vue-json-pretty :data="jsonData" showLength showLineNumber showIcon :collapsedOnClickBrackets="false" />
<template #footer>
<el-button @click="jsonViewVisible = false">关闭</el-button>
</template>
</el-dialog>
<!-- 调用错误 -->
<log-detail ref="logDetailRef" />
</div>
@@ -94,8 +84,6 @@ import { BasicTableProps, useTable } from "/@/hooks/table"
import * as thirdDoorLog from "/@/api/thirdparty/third-door-log"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import VueJsonPretty from "vue-json-pretty"
import "vue-json-pretty/lib/styles.css"
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const LogDetail = defineAsyncComponent(() => import("./detail.vue"))
@@ -108,7 +96,6 @@ const queryRef = ref()
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
const jsonViewVisible = ref<boolean>()
const jsonData = ref()
const logDetailRef = ref()
@@ -140,12 +127,6 @@ const selectionChangHandle = (objs: { id: string }[]) => {
multiple.value = !objs.length
}
// 点击查看json
const handleClickJsonView = (json: any) => {
jsonViewVisible.value = true
jsonData.value = JSON.parse(json)
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {