Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
28175255db
31 files changed
+1777
-123
No files matched your search
+2
-2
@@ -11,14 +11,14 @@ ENV = 'development'
|
||||
# VITE_ADMIN_PROXY_PATH = http://47.96.250.9:8089/api/ # 测试线上
|
||||
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
|
||||
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
|
||||
VITE_ADMIN_PROXY_PATH = http://192.168.101.81:9999/ # 邓-本地
|
||||
VITE_ADMIN_PROXY_PATH = http://192.168.101.107:9999/ # 邓-本地
|
||||
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
|
||||
|
||||
# 图片访问基础地址
|
||||
# VITE_IMAGE_BASE_PATH = http://47.96.250.9:8089/api # 测试线上
|
||||
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
|
||||
# VITE_IMAGE_BASE_PATH = http://localhost:9999
|
||||
VITE_IMAGE_BASE_PATH = http://192.168.101.81:9999 # 邓-本地
|
||||
VITE_IMAGE_BASE_PATH = http://192.168.101.107:9999 # 邓-本地
|
||||
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
|
||||
|
||||
# 代码生成服务地址
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-auth/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-auth",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/hard/hard-auth/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-auth",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-auth",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-broadcast/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-broadcast",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/hard/hard-broadcast/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-broadcast",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-broadcast",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
/**
|
||||
* 音量修改
|
||||
* @param hardId 设备id
|
||||
* @param systemVolume 系统音量
|
||||
* @param mediaVolume 媒体音量
|
||||
*/
|
||||
export function changeVolume(data?: { hardId: any; systemVolume: any; mediaVolume: any }) {
|
||||
return request({
|
||||
url: "/hard/hard-door-manager/change-volume",
|
||||
method: "post",
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-door-manager/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-door-manager/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function bind(obj?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-door-manager/bind",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/hard/hard-door-manager/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function getByHardId(params: any) {
|
||||
return request({
|
||||
url: "/hard/hard-door-manager/get-by-hard-id",
|
||||
method: "get",
|
||||
params,
|
||||
})
|
||||
}
|
||||
@@ -1,5 +1,39 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
/**
|
||||
* 根据设备id智能柜编号查询商品
|
||||
* @param hardId 设备id
|
||||
* @param cabinetNo 柜子编号
|
||||
*/
|
||||
export function getByCabinetNo(query?: { hardId: any; cabinetNo: any }) {
|
||||
return request({
|
||||
url: "/hard/hard-spu/get-by-cabinet-no",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 上架
|
||||
* @param id 绑定id
|
||||
* @param hardSpuId 商品id
|
||||
*/
|
||||
export function putaway(data?: { id: any; hardSpuId: any }) {
|
||||
return request({
|
||||
url: "/hard/hard-spu/putaway",
|
||||
method: "post",
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
export function asyncAll(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-spu/async-all",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function select(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-spu/select",
|
||||
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/third/third-door-log/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/third/third-door-log",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/third/third-door-log/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/third/third-door-log",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/third/third-door-log",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
@@ -16,9 +16,6 @@
|
||||
<el-option v-for="v in state.options" :key="v.id" :label="`${v.name}`" :value="v.id">
|
||||
<div class="flex items-center">
|
||||
<div class="color-primary">{{ v.name }}</div>
|
||||
<div class="flex items-center justify-center ml5">
|
||||
<el-tag size="small"> {{ v.merchantName }} </el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ export function useTable(options?: BasicTableProps) {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
pageSizes: [1, 10, 20, 50, 100, 200],
|
||||
pageSizes: [10, 20, 50, 100, 200, 500],
|
||||
layout: "total, sizes, prev, pager, next, jumper",
|
||||
} as Pagination,
|
||||
// 当前选中的数据项,默认为空数组
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="state.queryForm.phone" placeholder="请输入手机号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 250px" label="部门" prop="deptId">
|
||||
<select-dept v-model="state.queryForm.deptId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="Search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款状态" align="center">
|
||||
<el-table-column label="退款状态" align="center" min-width="120px">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="hard_sale_status" :value="row.status" />
|
||||
</template>
|
||||
@@ -69,7 +69,8 @@
|
||||
type="primary"
|
||||
v-auth="'hard_hardAfterSale_edit'"
|
||||
@click="formDialogRef.openDialog(row.id)"
|
||||
>编辑
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-if="false" icon="delete" text type="primary" v-auth="'hard_hardAfterSale_del'" @click="handleDelete([row.id])">
|
||||
删除
|
||||
|
||||
@@ -144,23 +144,16 @@ import { ElLoading } from "element-plus"
|
||||
const RefundRejectForm = defineAsyncComponent(() => import("./refund-reject.vue"))
|
||||
|
||||
// 定义查询字典
|
||||
const {
|
||||
hard_pay_type,
|
||||
hard_order_type,
|
||||
hard_order_status,
|
||||
hard_after_sale_way,
|
||||
hard_after_sale_type,
|
||||
hard_sale_status,
|
||||
hard_type,
|
||||
} = useDict(
|
||||
"hard_pay_type",
|
||||
"hard_order_type",
|
||||
"hard_order_status",
|
||||
"hard_after_sale_way",
|
||||
"hard_after_sale_type",
|
||||
"hard_sale_status",
|
||||
"hard_type",
|
||||
)
|
||||
const { hard_pay_type, hard_order_type, hard_order_status, hard_after_sale_way, hard_after_sale_type, hard_sale_status, hard_type } =
|
||||
useDict(
|
||||
"hard_pay_type",
|
||||
"hard_order_type",
|
||||
"hard_order_status",
|
||||
"hard_after_sale_way",
|
||||
"hard_after_sale_type",
|
||||
"hard_sale_status",
|
||||
"hard_type",
|
||||
)
|
||||
|
||||
const { query } = useRoute()
|
||||
const refundRejectRef = ref()
|
||||
@@ -182,8 +175,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)
|
||||
|
||||
onMounted(async () => {
|
||||
const type = query.type as unknown as any
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="预定用户" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入预定用户" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="硬件id" prop="hardId">
|
||||
<el-input v-model="form.hardId" placeholder="请输入硬件id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="是否授权" prop="authStatus">
|
||||
<el-input v-model="form.authStatus" placeholder="请输入是否授权" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="授权时间" prop="authTime">
|
||||
<el-input v-model="form.authTime" placeholder="请输入授权时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="是否完成" prop="isDone">
|
||||
<el-input v-model="form.isDone" placeholder="请输入是否完成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="完成时间" prop="isDoneTime">
|
||||
<el-input v-model="form.isDoneTime" placeholder="请输入完成时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="HardAuthDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as hardAuth from "/@/api/hard/hard-auth"
|
||||
import { rule } from "/@/utils/validate"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
userId: "",
|
||||
hardId: "",
|
||||
authStatus: "",
|
||||
authTime: "",
|
||||
isDone: "",
|
||||
isDoneTime: "",
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ""
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
|
||||
// 获取hardAuth信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
gethardAuthData(id)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await hardAuth.putObj(form) : await hardAuth.addObj(form)
|
||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化表单数据
|
||||
const gethardAuthData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
hardAuth
|
||||
.getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'hard_hardAuth_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'hard_hardAuth_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'hard_hardAuth_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="userId" label="预定用户" show-overflow-tooltip />
|
||||
<el-table-column prop="hardId" label="硬件id" show-overflow-tooltip />
|
||||
<el-table-column prop="authStatus" label="是否授权" show-overflow-tooltip />
|
||||
<el-table-column prop="authTime" label="授权时间" show-overflow-tooltip />
|
||||
<el-table-column prop="isDone" label="是否完成" show-overflow-tooltip />
|
||||
<el-table-column prop="isDoneTime" label="完成时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'hard_hardAuth_edit'" @click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'hard_hardAuth_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemHardAuth">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import * as hardAuth from "/@/api/hard/hard-auth"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: hardAuth.pageJoin,
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hardAuth/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardAuth.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id)
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await hardAuth.delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="预定用户" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入预定用户" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="硬件id" prop="hardId">
|
||||
<el-input v-model="form.hardId" placeholder="请输入硬件id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="mq主题" prop="topic">
|
||||
<el-input v-model="form.topic" placeholder="请输入mq主题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="关联业务编号" prop="bizId">
|
||||
<el-input v-model="form.bizId" placeholder="请输入关联业务编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="预定标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入预定标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="广播内容" prop="content">
|
||||
<el-input v-model="form.content" placeholder="请输入广播内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="当前广播次数" prop="broadcastCount">
|
||||
<el-input v-model="form.broadcastCount" placeholder="请输入当前广播次数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="最大广播次数" prop="broadcastMaxCount">
|
||||
<el-input v-model="form.broadcastMaxCount" placeholder="请输入最大广播次数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="是否广播语音" prop="isBroadcast">
|
||||
<el-input v-model="form.isBroadcast" placeholder="请输入是否广播语音" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="是否完成" prop="isDone">
|
||||
<el-input v-model="form.isDone" placeholder="请输入是否完成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="完成时间" prop="isDoneTime">
|
||||
<el-input v-model="form.isDoneTime" placeholder="请输入完成时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="HardBroadcastDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as hardBroadcastApi from "/@/api/hard/hard-broadcast"
|
||||
import { rule } from "/@/utils/validate"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
userId: "",
|
||||
hardId: "",
|
||||
topic: "",
|
||||
bizId: "",
|
||||
title: "",
|
||||
content: "",
|
||||
broadcastCount: "",
|
||||
broadcastMaxCount: "",
|
||||
isBroadcast: "",
|
||||
isDone: "",
|
||||
isDoneTime: "",
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ""
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
|
||||
// 获取hardBroadcast信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
gethardBroadcastData(id)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await hardBroadcastApi.putObj(form) : await hardBroadcastApi.addObj(form)
|
||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化表单数据
|
||||
const gethardBroadcastData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
hardBroadcastApi
|
||||
.getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'hard_hardBroadcast_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'hard_hardBroadcast_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'hard_hardBroadcast_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="userId" label="预定用户" show-overflow-tooltip />
|
||||
<el-table-column prop="hardId" label="硬件id" show-overflow-tooltip />
|
||||
<el-table-column prop="topic" label="mq主题" show-overflow-tooltip />
|
||||
<el-table-column prop="bizId" label="关联业务编号" show-overflow-tooltip />
|
||||
<el-table-column prop="title" label="预定标题" show-overflow-tooltip />
|
||||
<el-table-column prop="content" label="广播内容" show-overflow-tooltip />
|
||||
<el-table-column prop="broadcastCount" label="当前广播次数" show-overflow-tooltip />
|
||||
<el-table-column prop="broadcastMaxCount" label="最大广播次数" show-overflow-tooltip />
|
||||
<el-table-column prop="isBroadcast" label="是否广播语音" show-overflow-tooltip />
|
||||
<el-table-column prop="isDone" label="是否完成" show-overflow-tooltip />
|
||||
<el-table-column prop="isDoneTime" label="完成时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'hard_hardBroadcast_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'hard_hardBroadcast_del'" @click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemHardBroadcast">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import * as hardBroadcastApi from "/@/api/hard/hard-broadcast"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: hardBroadcastApi.pageJoin,
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hardBroadcast/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardBroadcast.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id)
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await hardBroadcastApi.delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="设备编号" prop="hardId">
|
||||
<el-input v-model="form.hardId" placeholder="请输入设备编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="设备 IMEI 号(15 位)" prop="imei">
|
||||
<el-input v-model="form.imei" placeholder="请输入设备 IMEI 号(15 位)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="货柜数量" prop="cabinetNum">
|
||||
<el-input v-model="form.cabinetNum" placeholder="请输入货柜数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="每个货柜中摄像头数量" prop="cabinetCameraNum">
|
||||
<el-input v-model="form.cabinetCameraNum" placeholder="请输入每个货柜中摄像头数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="每个货柜中称重单元数量" prop="cabinetWeightUnitNum">
|
||||
<el-input v-model="form.cabinetWeightUnitNum" placeholder="请输入每个货柜中称重单元数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="1:通电;2:断电" prop="powerStatus">
|
||||
<el-input v-model="form.powerStatus" placeholder="请输入1:通电;2:断电" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="在线状态。1:在线;2:离线" prop="netStatus">
|
||||
<el-input v-model="form.netStatus" placeholder="请输入在线状态。1:在线;2:离线" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="售卖状态。1:在售;2:停售" prop="saleStatus">
|
||||
<el-input v-model="form.saleStatus" placeholder="请输入售卖状态。1:在售;2:停售" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item
|
||||
label="sim 信号强度。大于-95 表示信号强度好;-95 到-105 表示信号强度中等;小于-105 表示信号差;"
|
||||
prop="signalIntensity"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.signalIntensity"
|
||||
placeholder="请输入sim 信号强度。大于-95 表示信号强度好;-95 到-105 表示信号强度中等;小于-105 表示信号差;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item
|
||||
label="信噪比,体现信道传输质量的参数。大于 15 表示质量好;15 到 0 表示质量中等;小于等于 0 表示质量差;"
|
||||
prop="signalRatio"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.signalRatio"
|
||||
placeholder="请输入信噪比,体现信道传输质量的参数。大于 15 表示质量好;15 到 0 表示质量中等;小于等于 0 表示质量差;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="sim 信号值更新时间。yyyy-MM-dd HH:mm:ss" prop="signalTime">
|
||||
<el-input v-model="form.signalTime" placeholder="请输入sim 信号值更新时间。yyyy-MM-dd HH:mm:ss" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="货柜列表JSON" prop="cabinetList">
|
||||
<el-input v-model="form.cabinetList" placeholder="请输入货柜列表JSON" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="上次重启时间" prop="restartTime">
|
||||
<el-input v-model="form.restartTime" placeholder="请输入上次重启时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="HardDoorManagerDialog">
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
hardId: "",
|
||||
imei: "",
|
||||
cabinetNum: "",
|
||||
cabinetCameraNum: "",
|
||||
cabinetWeightUnitNum: "",
|
||||
powerStatus: "",
|
||||
netStatus: "",
|
||||
saleStatus: "",
|
||||
signalIntensity: "",
|
||||
signalRatio: "",
|
||||
signalTime: "",
|
||||
cabinetList: "",
|
||||
restartTime: "",
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<el-dialog title="智能柜设置" v-model="visible" width="80%" :close-on-click-modal="true" draggable>
|
||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-row>
|
||||
<el-form-item style="width: 300px" label="商品名" prop="name">
|
||||
<el-input v-model="state.queryForm.name" placeholder="商品名" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 300px" label="商品类型" prop="skuType">
|
||||
<dict-select v-model="state.queryForm.skuType" dict-code="hard_ks_sku_type" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="Search" type="primary" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column type="index" label="#" width="80" />
|
||||
<el-table-column prop="name" width="120" label="商品名" />
|
||||
<el-table-column prop="pic" width="120" label="商品图片">
|
||||
<template #default="{ row }">
|
||||
<preview-image width="50px" height="50px" :src="row.pic" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="categoryName" width="120" label="分类" />
|
||||
<el-table-column prop="price" label="单价">
|
||||
<template #default="{ row }">
|
||||
<span class="color-success">{{ displayPrice(row.price) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="hard_ks_sku_type" :value="row.skuType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" width="240" label="规格">
|
||||
<template #default="{ row }">
|
||||
<span>口味:</span>
|
||||
<span class="color-primary">{{ row.specsTaste }}</span>
|
||||
<span>容量:</span>
|
||||
<span class="color-primary">{{ row.specsCapacity }}</span>
|
||||
<span>重量:</span>
|
||||
<span class="color-primary">{{ row.specsWeight }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesCount" label="销量">
|
||||
<template #default="{ row }">
|
||||
<span class="color-primary">{{ row.salesCount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="repertoryCount" label="库存">
|
||||
<template #default="{ row }">
|
||||
<span class="color-primary">{{ row.repertoryCount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" />
|
||||
<el-table-column prop="status" label="是否启用">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="yes_no_type" :value="row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isDefault" label="是否标品">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="yes_no_type" :value="row.isDefault" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template #default="{ row }">
|
||||
<el-button text type="primary" @click="confirmPutaway(row)">点击上架</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import * as hardSpu from "/@/api/hard/hard-spu"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
|
||||
const emit = defineEmits(["refreshDoor"])
|
||||
|
||||
const { yes_no_type, hard_ks_sku_type } = useDict("yes_no_type", "hard_ks_sku_type")
|
||||
const queryRef = ref()
|
||||
const visible = ref(false)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: hardSpu.pageJoin,
|
||||
})
|
||||
const curPos = reactive<{
|
||||
hardId: string
|
||||
floorIndex: number | undefined
|
||||
posIndex: number | undefined
|
||||
}>({ hardId: "", floorIndex: undefined, posIndex: undefined })
|
||||
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
|
||||
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields()
|
||||
getDataList()
|
||||
}
|
||||
|
||||
const openDialog = (hardId: string, floorIndex: number, posIndex: number) => {
|
||||
if (!hardId) return useMessage().error("设备id不存在")
|
||||
resetQuery()
|
||||
|
||||
curPos.hardId = hardId
|
||||
curPos.floorIndex = floorIndex
|
||||
curPos.posIndex = posIndex
|
||||
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
// 确认上架
|
||||
const confirmPutaway = (row: any) => {
|
||||
emit("refreshDoor", row, curPos)
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div v-loading="loading" class="layout-padding-auto layout-padding-view" style="overflow: scroll !important">
|
||||
<el-descriptions :column="3" title="经营信息" border>
|
||||
<template #extra>
|
||||
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
|
||||
<el-button circle icon="Refresh" @click="doRefresh" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-descriptions-item label="今日交易金额:">{{ displayPrice(0) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="本月交易金额:">{{ displayPrice(0) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="本年交易金额:">{{ displayPrice(0) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions :column="4" title="智能柜设置" border>
|
||||
<template #extra>
|
||||
<div class="flex justify-center items-center">
|
||||
<el-button icon="Edit" type="primary" @click="doBind">修改</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions-item label="商户名称:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备编号:">{{ doorSettingData.id }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备名称:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="机器编号:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="外部设备编号:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="SIM卡号:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="柜子层数:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="地址:">{{}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions :column="3" title="运行信息" border>
|
||||
<template #extra>
|
||||
<div class="flex justify-center items-center">
|
||||
<el-button icon="Edit" type="primary" @click="doVolumeSetting">音量设置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions-item label="销售状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="电源状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="网络状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="媒体音量:">{{ doorSettingData.mediaVolume }}</el-descriptions-item>
|
||||
<el-descriptions-item label="系统音量:">{{ doorSettingData.systemVolume }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions :column="0" title="货柜商品" border>
|
||||
<!-- <template #extra>
|
||||
<div class="flex justify-center items-center">
|
||||
<el-button icon="Edit" type="primary">设置</el-button>
|
||||
</div>
|
||||
</template> -->
|
||||
</el-descriptions>
|
||||
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="114514-1">
|
||||
<div v-for="(floorItem, floorIndex) in state.doorGoods" :key="floorIndex">
|
||||
<el-divider />
|
||||
<div class="text-black flex items-center">
|
||||
<div class="text-center w-24 text-lg font-bold">第 {{ floorIndex + 1 }} 层:</div>
|
||||
<div class="flex flex-wrap">
|
||||
<div class="flex flex-col items-center justify-start" v-for="(item, posIndex) in floorItem" :key="posIndex">
|
||||
<div
|
||||
class="bg-blue-50 w-20 h-20 border border-black mx-4 my-1 flex items-center justify-center cursor-pointer rounded-lg"
|
||||
@click="clickPutaway(floorIndex, posIndex)"
|
||||
>
|
||||
<div v-if="item.pic" class="relative">
|
||||
<el-icon
|
||||
@click.stop="deleteGoods(floorIndex, posIndex)"
|
||||
class="absolute right-[-8px] top-[-8px] text-xl text-blue-600 z-50"
|
||||
>
|
||||
<CircleClose />
|
||||
</el-icon>
|
||||
<preview-image width="86px" height="86px" :src="item.pic" @click.stop />
|
||||
</div>
|
||||
<span v-else>点击上架</span>
|
||||
</div>
|
||||
<div class="h-10">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="114514-2">22</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<!-- 柜子设置 -->
|
||||
<info-setting ref="infoSettingRef" @refreshInfo="refreshInfo" />
|
||||
|
||||
<!-- 音量设置 -->
|
||||
<volume-setting ref="volumeSettingRef" @refreshVolume="refreshVolume" />
|
||||
|
||||
<!-- 商品上架 -->
|
||||
<goods-putaway ref="goodsPutawayRef" @refreshDoor="refreshDoor" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="hardDoorManager">
|
||||
import { onMounted, ref } from "vue"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import * as hardDoorManager from "/@/api/hard/hard-door-manager"
|
||||
import { ElMessageBox } from "element-plus"
|
||||
|
||||
const InfoSetting = defineAsyncComponent(() => import("./info-setting.vue"))
|
||||
const VolumeSetting = defineAsyncComponent(() => import("./volume-setting.vue"))
|
||||
const GoodsPutaway = defineAsyncComponent(() => import("./goods-putaway.vue"))
|
||||
|
||||
const { query } = useRoute()
|
||||
const loading = ref(false)
|
||||
const doorSettingData = ref<any>({})
|
||||
const state = reactive<any>({
|
||||
mediaVolume: "",
|
||||
systemVolume: "",
|
||||
queryForm: {},
|
||||
doorGoods: new Array(6).fill([]).map(() => new Array(10).fill({})),
|
||||
})
|
||||
const infoSettingRef = ref()
|
||||
const volumeSettingRef = ref()
|
||||
const goodsPutawayRef = ref()
|
||||
|
||||
onMounted(async () => {
|
||||
await getDetail()
|
||||
})
|
||||
|
||||
const getDetail = async () => {
|
||||
const id = query.id as unknown as any
|
||||
if (!id) return useMessage().error("设备id不存在")
|
||||
state.queryForm.orderId = id
|
||||
|
||||
const { data: orderData } = await hardDoorManager.getByHardId({ hardId: id })
|
||||
if (orderData) {
|
||||
doorSettingData.value = orderData
|
||||
}
|
||||
if (!doorSettingData.value.hardId) {
|
||||
doorSettingData.value.hardId = id
|
||||
}
|
||||
}
|
||||
|
||||
// 绑定信息
|
||||
const doBind = async () => {
|
||||
if (infoSettingRef.value) {
|
||||
infoSettingRef.value.openDialog(doorSettingData.value.hardId)
|
||||
}
|
||||
}
|
||||
// 基本信息
|
||||
const refreshInfo = () => {}
|
||||
|
||||
// 音量设置
|
||||
const doVolumeSetting = async () => {
|
||||
if (volumeSettingRef.value) {
|
||||
volumeSettingRef.value.openDialog(doorSettingData.value.hardId)
|
||||
}
|
||||
}
|
||||
const refreshVolume = (data: { hardId: string; mediaVolume: number; systemVolume: number }) => {
|
||||
doorSettingData.value.mediaVolume = data.mediaVolume
|
||||
doorSettingData.value.systemVolume = data.systemVolume
|
||||
}
|
||||
|
||||
// 点击上架
|
||||
const clickPutaway = (floorIndex: number, posIndex: number) => {
|
||||
if (goodsPutawayRef.value) {
|
||||
goodsPutawayRef.value.openDialog(doorSettingData.value.hardId, floorIndex, posIndex)
|
||||
}
|
||||
}
|
||||
const refreshDoor = (row: any, curPos: { hardId: string; floorIndex: number; posIndex: number }) => {
|
||||
state.doorGoods[curPos.floorIndex][curPos.posIndex] = row
|
||||
}
|
||||
|
||||
// 删除商品
|
||||
const deleteGoods = async (floorIndex: number, posIndex: number) => {
|
||||
ElMessageBox.confirm("确定删除吗?", "删除", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then(async () => {
|
||||
state.doorGoods[floorIndex][posIndex] = {}
|
||||
})
|
||||
}
|
||||
|
||||
const doRefresh = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
await getDetail()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-descriptions) {
|
||||
&:not(:nth-child(1)) {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.el-descriptions__cell.is-bordered-label {
|
||||
width: 150px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.el-descriptions__cell.is-bordered-content {
|
||||
width: 200px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.el-descriptions__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&::before {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 20px;
|
||||
margin-right: 10px;
|
||||
background-color: #409eff;
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
|
||||
.el-descriptions-item__container {
|
||||
margin: 0 10px;
|
||||
.no-colon {
|
||||
margin: 0;
|
||||
&::after {
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<el-dialog title="智能柜设置" v-model="visible" :close-on-click-modal="true" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="120px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="设备IMEI卡号:" prop="imei">
|
||||
<el-input v-model="form.imei" placeholder="请输入设备IMEI卡号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="柜子层数:" prop="doorCount">
|
||||
<el-input v-model="form.doorCount" placeholder="请输入柜子层数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="volume-setting">
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as hardDoorManager from "/@/api/hard/hard-door-manager"
|
||||
|
||||
const emit = defineEmits(["refreshInfo"])
|
||||
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const form = reactive<any>({
|
||||
id: "",
|
||||
hardId: "",
|
||||
imei: "",
|
||||
doorCount: "",
|
||||
deviceCode: "",
|
||||
})
|
||||
|
||||
const dataRules = ref({
|
||||
imei: [{ required: true, message: "设备IMEI卡号不能为空", trigger: "blur" }],
|
||||
doorCount: [{ required: true, message: "柜子层数不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (hardId: string) => {
|
||||
visible.value = true
|
||||
form.hardId = hardId
|
||||
dataFormRef.value?.resetFields()
|
||||
if (hardId) {
|
||||
const res = await hardDoorManager.getByHardId({ hardId: hardId })
|
||||
Object.assign(form, res.data)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
if (!form.hardId) return useMessage().error("设备id不存在")
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await hardDoorManager.bind(form)
|
||||
if (res.code == 0) {
|
||||
useMessage().success("保存成功")
|
||||
visible.value = false
|
||||
emit("refreshInfo")
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<el-dialog title="音量设置" width="30%" v-model="visible" :close-on-click-modal="true" draggable>
|
||||
<el-form :model="form" label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="媒体音量:" prop="mediaVolume">
|
||||
<el-slider v-model="form.mediaVolume" :step="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="系统音量:" prop="systemVolume">
|
||||
<el-slider v-model="form.systemVolume" :step="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="volume-setting">
|
||||
import { changeVolume } from "/@/api/hard/hard-door-manager"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
|
||||
const emit = defineEmits(["refreshVolume"])
|
||||
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
|
||||
const form = reactive<{
|
||||
hardId: string
|
||||
mediaVolume: number
|
||||
systemVolume: number
|
||||
}>({
|
||||
hardId: "",
|
||||
mediaVolume: 80,
|
||||
systemVolume: 80,
|
||||
})
|
||||
|
||||
const openDialog = (id: string) => {
|
||||
if (!id) return useMessage().warning("设备id不存在")
|
||||
visible.value = true
|
||||
form.hardId = id
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
if (!form.hardId) {
|
||||
useMessage().error("设备id不存在")
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
await changeVolume(form)
|
||||
useMessage().success("保存成功")
|
||||
visible.value = false
|
||||
emit("refreshVolume", form)
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -61,7 +61,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="hardGroupName" width="200" label="分类" />
|
||||
<el-table-column prop="merchantName" width="100" label="商户" />
|
||||
<el-table-column prop="merchantName" width="150" label="商户" />
|
||||
<el-table-column prop="deptName" width="200" label="部门" />
|
||||
<el-table-column prop="uniqueCode" width="200" label="设备唯一编号" />
|
||||
<el-table-column prop="mainTopic" width="350" label="topic" />
|
||||
@@ -84,16 +84,19 @@
|
||||
<el-table-column prop="createTime" width="200" label="创建时间" />
|
||||
<el-table-column v-auths="['hard_hardManager_edit', 'hard_hardManager_del']" label="操作" fixed="right" width="400">
|
||||
<template #default="{ row }">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'hard_hardManager_edit'" @click="formDialogRef.openDialog(row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button v-if="row.type == '4'" icon="InfoFilled" text type="primary" v-auth="'hard_hardManager_edit'" @click="doInfo(row)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'hard_hardManager_edit'" @click="formDialogRef.openDialog(row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="TrendCharts" link type="primary" v-auth="'hard_hardManager_edit'" @click="mqformDialogRef.openDialog(row.id)">
|
||||
mq设置
|
||||
</el-button>
|
||||
<el-button icon="SetUp" link type="primary" v-auth="'hard_hardManager_edit'" @click="faceFormDialogRef.openDialog(row.id)">
|
||||
人脸sdk设置
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'hard_hardManager_del'" @click="handleDelete([row.id])"> 删除 </el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'hard_hardManager_del'" @click="handleDelete([row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -113,6 +116,8 @@ import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useUserInfo } from "/@/stores/userInfo"
|
||||
|
||||
const { push } = useRouter()
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const FaceFormDialog = defineAsyncComponent(() => import("./face-form.vue"))
|
||||
@@ -169,6 +174,11 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 硬件详情
|
||||
const doInfo = (row: any) => {
|
||||
push({ path: "/hard/hard-door-manager/index", query: { id: row.id } })
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
|
||||
@@ -357,23 +357,6 @@ const handleGetSelectNode = (curClickedNode: any, checkedTreeNodes: any, isDeepT
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// const adminRefund = async (row: any) => {
|
||||
// let loading: any = null
|
||||
// try {
|
||||
// await useMessage().delConfirm("是否同意退款?")
|
||||
// loading = ElLoading.service({
|
||||
// lock: true,
|
||||
// text: "提交中",
|
||||
// background: "rgba(0, 0, 0, 0.7)",
|
||||
// })
|
||||
// await hardInvoice.adminRefund({ id: row.id })
|
||||
// useMessage().success("操作成功")
|
||||
// getDataList()
|
||||
// } finally {
|
||||
// setTimeout(() => loading.close(), 500)
|
||||
// }
|
||||
// }
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hard-order/export", Object.assign(state.queryForm, { ids: selectObjs }), "订单记录.xlsx")
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" width="30%" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商户" prop="mchId">
|
||||
<select-mch v-model="form.mchId" :apiParams="{ types: '2' }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="分类名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名" />
|
||||
@@ -54,7 +49,6 @@ const form = reactive({
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
mchId: [{ required: true, message: "请选择商户", trigger: "change" }],
|
||||
name: [{ required: true, message: "分类名不能为空", trigger: "blur" }],
|
||||
sort: [{ required: true, message: "商户不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
@@ -51,11 +51,6 @@
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="分类名" show-overflow-tooltip />
|
||||
<el-table-column label="商户" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.merchantName }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
|
||||
@@ -2,20 +2,6 @@
|
||||
<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="100px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="设备" prop="hardId">
|
||||
<select-hard v-model="form.hardId" :apiParams="{ type: '4' }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item prop="hardDoorNumber">
|
||||
<template #label>
|
||||
<span>放置层数</span>
|
||||
<tip content="商品在智能柜的层数,按层数放置会提高识别率" />
|
||||
</template>
|
||||
<el-input-number :min="0" :step="1" v-model="form.hardDoorNumber" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商品名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入商品名" />
|
||||
@@ -31,6 +17,21 @@
|
||||
<upload-imgs v-model="form.pic" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="口味" prop="specsTaste">
|
||||
<el-input v-model="form.specsTaste" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="容量" prop="specsCapacity">
|
||||
<el-input v-model="form.specsCapacity" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="重量" prop="specsWeight">
|
||||
<el-input v-model="form.specsWeight" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-input-number :precision="2" :min="0" :step="1" v-model="form.price" placeholder="" />
|
||||
@@ -79,6 +80,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="HardSpuDialog">
|
||||
import { storePrice, displayPrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as hardSpu from "/@/api/hard/hard-spu"
|
||||
@@ -97,6 +99,9 @@ const form = reactive({
|
||||
spuCategoryId: "",
|
||||
name: "",
|
||||
pic: "",
|
||||
specsTaste: "",
|
||||
specsCapacity: "",
|
||||
specsWeight: "",
|
||||
price: 0,
|
||||
salesCount: 0,
|
||||
repertoryCount: 0,
|
||||
@@ -142,7 +147,8 @@ const onSubmit = async () => {
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await hardSpu.putObj(form) : await hardSpu.addObj(form)
|
||||
const _pa = { ...form, price: storePrice(form.price) }
|
||||
form.id ? await hardSpu.putObj(_pa) : await hardSpu.addObj(_pa)
|
||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
@@ -160,7 +166,7 @@ const gethardSpuData = (id: string) => {
|
||||
hardSpu
|
||||
.getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
Object.assign(form, res.data, { price: displayPrice(res.data.price, "", 0) })
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
|
||||
@@ -1,8 +1,23 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-row>
|
||||
<el-form-item style="width: 300px" label="商品名" prop="name">
|
||||
<el-input v-model="state.queryForm.name" placeholder="商品名" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 300px" label="商品类型" prop="skuType">
|
||||
<dict-select v-model="state.queryForm.skuType" dict-code="hard_ks_sku_type" />
|
||||
</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>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="Refresh" type="primary" class="ml10" @click="syncAll" v-auth="'hard_hardSpu_add'"> 拉取商品 </el-button>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'hard_hardSpu_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
@@ -37,26 +52,26 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="categoryName" width="120" label="分类" />
|
||||
<el-table-column width="150" label="商户">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.merchantName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="150" label="放置层数">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.hardDoorNumber }}层</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="150" label="设备名">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.hardName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="单价">
|
||||
<template #default="{ row }">
|
||||
<span class="color-success">{{ displayPrice(row.price) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="hard_ks_sku_type" :value="row.skuType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" width="240" label="规格">
|
||||
<template #default="{ row }">
|
||||
<span>口味:</span>
|
||||
<span class="color-primary">{{ row.specsTaste }}</span>
|
||||
<span>容量:</span>
|
||||
<span class="color-primary">{{ row.specsCapacity }}</span>
|
||||
<span>重量:</span>
|
||||
<span class="color-primary">{{ row.specsWeight }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesCount" label="销量">
|
||||
<template #default="{ row }">
|
||||
<span class="color-primary">{{ row.salesCount }}</span>
|
||||
@@ -107,7 +122,7 @@ import { displayPrice } from "/@/utils/formatMoney"
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
const { yes_no_type } = useDict("yes_no_type")
|
||||
const { yes_no_type, hard_ks_sku_type } = useDict("yes_no_type", "hard_ks_sku_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
@@ -145,6 +160,16 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 同步全部
|
||||
const syncAll = async () => {
|
||||
try {
|
||||
await useMessageBox().confirm("是否同步全部商品")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
hardSpu.asyncAll()
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="请求类型" prop="apiType">
|
||||
<el-input v-model="form.apiType" placeholder="请输入请求类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="api类型" prop="bizType">
|
||||
<el-input v-model="form.bizType" placeholder="请输入api类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="api类型id" prop="bizId">
|
||||
<el-input v-model="form.bizId" placeholder="请输入api类型id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="api url" prop="apiUrl">
|
||||
<el-input v-model="form.apiUrl" placeholder="请输入api url" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="res" prop="res">
|
||||
<el-input v-model="form.res" placeholder="请输入res" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="req" prop="req">
|
||||
<el-input v-model="form.req" placeholder="请输入req" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="调用错误" prop="error">
|
||||
<el-input v-model="form.error" placeholder="请输入调用错误" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="耗时(毫秒)" prop="timeConsuming">
|
||||
<el-input v-model="form.timeConsuming" placeholder="请输入耗时(毫秒)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ThirdDoorLogDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as thirdDoorLog from "/@/api/thirdparty/third-door-log"
|
||||
import { rule } from "/@/utils/validate"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
apiType: "",
|
||||
bizType: "",
|
||||
bizId: "",
|
||||
apiUrl: "",
|
||||
res: "",
|
||||
req: "",
|
||||
error: "",
|
||||
timeConsuming: "",
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ""
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
|
||||
// 获取thirdDoorLog信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getthirdDoorLogData(id)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await thirdDoorLog.putObj(form) : await thirdDoorLog.addObj(form)
|
||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化表单数据
|
||||
const getthirdDoorLogData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
thirdDoorLog
|
||||
.getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-row>
|
||||
<el-form-item style="width: 300px" label="请求类型" prop="thirdApiType">
|
||||
<dict-select v-model="state.queryForm.thirdApiType" dict-code="third_api_type" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 300px" label="接口类型" prop="thirdBizType">
|
||||
<dict-select v-model="state.queryForm.thirdBizType" dict-code="third_biz_type" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 450px" label="请求时间" prop="createTimeList">
|
||||
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||
</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>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="apiType" label="请求类型">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="third_api_type" :value="row.apiType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bizType" label="api类型">
|
||||
<template #default="{ row }">
|
||||
<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="req" label="req" show-overflow-tooltip />
|
||||
<el-table-column prop="error" label="调用错误" show-overflow-tooltip />
|
||||
<el-table-column prop="timeConsuming" label="耗时(毫秒)" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemThirdDoorLog">
|
||||
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"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
const { third_biz_type, third_api_type } = useDict("third_biz_type", "third_api_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: thirdDoorLog.fetchList,
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/third/thirdDoorLog/export", Object.assign(state.queryForm, { ids: selectObjs }), "thirdDoorLog.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id)
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await thirdDoorLog.delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -80,12 +80,15 @@ const openDialog = async (id: string) => {
|
||||
form.id = ""
|
||||
|
||||
// 重置表单数据
|
||||
dataFormRef.value?.resetFields()
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
form.walletTypeId = ""
|
||||
})
|
||||
|
||||
// 获取walletRechargeApply信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getwalletRechargeApplyData(id)
|
||||
await getwalletRechargeApplyData(id)
|
||||
}
|
||||
|
||||
const res = await getWalletTypeSimple()
|
||||
@@ -116,16 +119,18 @@ const onSubmit = async () => {
|
||||
}
|
||||
|
||||
// 初始化表单数据
|
||||
const getwalletRechargeApplyData = (id: string) => {
|
||||
const getwalletRechargeApplyData = async (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
try {
|
||||
const res = await getObj(id)
|
||||
if (res.code == 0) {
|
||||
Object.assign(form, res.data)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
} catch (err: any) {
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
|
||||
@@ -97,12 +97,12 @@ const state = reactive<any>({
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
pageSizes: [10, 20, 50, 100, 200, 500],
|
||||
},
|
||||
pageList: walletRechargeApplyApi.comparePageJoin,
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { tableStyle, downBlobFile } = useTable(state)
|
||||
const { downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
const data = reactive<any>({
|
||||
list: [],
|
||||
|
||||
@@ -3,14 +3,7 @@
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<div class="flex justify-center flex-col">
|
||||
<div>
|
||||
<el-form
|
||||
ref="dataFormRef"
|
||||
:model="form"
|
||||
:rules="dataRules"
|
||||
formDialogRef
|
||||
label-width="90px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="退款理由" prop="afterSaleRefundReasons">
|
||||
@@ -23,12 +16,7 @@
|
||||
multiple
|
||||
placeholder="请输入退款理由"
|
||||
>
|
||||
<el-option
|
||||
v-for="reason in form.afterSaleRefundReasons"
|
||||
:key="reason"
|
||||
:label="reason"
|
||||
:value="reason"
|
||||
/>
|
||||
<el-option v-for="reason in form.afterSaleRefundReasons" :key="reason" :label="reason" :value="reason" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -43,12 +31,7 @@
|
||||
multiple
|
||||
placeholder="请输入退货理由"
|
||||
>
|
||||
<el-option
|
||||
v-for="reason in form.afterSaleReturnReasons"
|
||||
:key="reason"
|
||||
:label="reason"
|
||||
:value="reason"
|
||||
/>
|
||||
<el-option v-for="reason in form.afterSaleReturnReasons" :key="reason" :label="reason" :value="reason" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
Reference in new issue
Block a user