This commit is contained in:
parent
4e5cb7e0e1
commit
5b6a9a55f8
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-image :style="styles" v-bind="props"> </el-image>
|
||||
<el-image :style="styles" v-bind="props" :preview-teleported="true"> </el-image>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="file-item relative" :style="{ height: fileSize, width: fileSize }">
|
||||
<el-image class="image" v-if="type == 'image'" fit="contain" :src="uri"></el-image>
|
||||
<el-image class="image" v-if="type == 'image'" fit="contain" :src="uri" :preview-teleported="true"></el-image>
|
||||
<video class="video" v-else-if="type == 'video'" :src="uri"></video>
|
||||
<div
|
||||
v-if="type == 'video'"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<template #default>
|
||||
<!-- head -->
|
||||
<div class="flex">
|
||||
<el-image class="w-[50px] h-[50px]" :src="url" :fit="fit" />
|
||||
<el-image class="w-[50px] h-[50px]" :src="url" :fit="fit" :preview-teleported="true"/>
|
||||
<div class="flex flex-col ml-3 justify-between">
|
||||
<div style="font-size:16px">
|
||||
{{ orderType ? '【收银订单】' : '售后订单' }}
|
||||
|
@ -61,7 +61,7 @@
|
|||
<el-table-column label="商品信息" prop="build_area_text" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div class="flex w-[300px] items-center">
|
||||
<el-image class="w-[50px] h-[50px] mr-2" :src="row.cart_info.image" />
|
||||
<el-image class="w-[50px] h-[50px] mr-2" :src="row.cart_info.image" :preview-teleported="true"/>
|
||||
<span> {{ row.cart_info.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<el-table-column label="商品ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="商品图片" prop="image" min-width="80">
|
||||
<template #default="{ row }">
|
||||
<el-image style="width: 50px; height: 50px" :src="row.image" />
|
||||
<el-image style="width: 50px; height: 50px" :src="row.image" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="store_name" min-width="200" show-overflow-tooltip />
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<el-table-column label="详细地址" prop="detailed_address" show-overflow-tooltip />
|
||||
<el-table-column label="门店logo" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" />
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否显示" prop="is_show" show-overflow-tooltip>
|
||||
|
|
|
@ -1,15 +1,23 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
|
||||
<el-form-item label="门店" prop="store_name">
|
||||
<el-input v-model="formData.store_name" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="应收金额" prop="receivable">
|
||||
<el-input v-model="formData.receivable" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-switch v-model="formData.status" active-text="已转账" inactive-text="未转账" :active-value="1" :inactive-value="0" size="large" inline-prompt></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="凭证" prop="file">
|
||||
<material-picker v-model="formData.file" :limit="1" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
|
@ -40,8 +48,16 @@ const popupTitle = computed(() => {
|
|||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
|
||||
"id": '',
|
||||
"store_id": '',
|
||||
"cash_price": "",
|
||||
"receivable": "",
|
||||
"receipts": "",
|
||||
"admin_id": '',
|
||||
"file": "",
|
||||
"remark": "",
|
||||
"status": '',
|
||||
"store_name": ""
|
||||
})
|
||||
|
||||
|
||||
|
@ -59,8 +75,8 @@ const setFormData = async (data: Record<any, any>) => {
|
|||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
|
@ -74,9 +90,9 @@ const getDetail = async (row: Record<string, any>) => {
|
|||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiStoreCashFinanceFlowEdit(data)
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiStoreCashFinanceFlowEdit(data)
|
||||
: await apiStoreCashFinanceFlowAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
<el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建时间" prop="create_time">
|
||||
<el-input class="w-[280px]" v-model="queryParams.create_time" clearable placeholder="请输入创建时间" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="时间范围" prop="create_time">
|
||||
<el-date-picker v-model="startEndTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" @change="changeStartEndTime" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
|
@ -24,22 +25,27 @@
|
|||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<div>
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="门店" prop="store_id" show-overflow-tooltip />
|
||||
<el-table-column label="门店" prop="store_name" show-overflow-tooltip />
|
||||
<el-table-column label="交易金额" prop="cash_price" show-overflow-tooltip />
|
||||
<el-table-column label="应收金额" prop="receivable" show-overflow-tooltip />
|
||||
<el-table-column label="实收金额" prop="receipts" show-overflow-tooltip />
|
||||
<el-table-column label="操作人员" prop="admin_id" show-overflow-tooltip />
|
||||
<el-table-column label="图片" prop="file">
|
||||
<template #default="{ row }">
|
||||
<el-image style="width:50px;height:50px;" :src="row.file" />
|
||||
<el-image v-if="row.file&&row.file!=0" style="width:50px;height:50px;" :src="row.file" :preview-teleported="true"/>
|
||||
<span v-else>待上传</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.status==0" type="danger">待处理</el-tag>
|
||||
<el-tag v-else type="success">已确认</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="status" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
|
@ -50,14 +56,6 @@
|
|||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['store_cash_finance_flow.store_cash_finance_flow/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -78,18 +76,62 @@ import { timeFormat } from '@/utils/util'
|
|||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { apiSystemStoreLists } from '@/api/system_store'
|
||||
import moment from 'moment'
|
||||
|
||||
const shortcuts = [
|
||||
{
|
||||
text: '近一周',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setDate(start.getDate() - 7)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '近一月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setMonth(start.getMonth() - 1)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '近三月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setMonth(start.getMonth() - 3)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const startEndTime = ref([new Date(), new Date()]);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
store_id: '',
|
||||
create_time: ''
|
||||
start_time: moment(startEndTime.value[0]).format('YYYY-MM-DD') + ' 00:00:00',
|
||||
end_time: moment(startEndTime.value[1]).format('YYYY-MM-DD') + ' 23:59:59',
|
||||
})
|
||||
|
||||
const changeStartEndTime = ()=>{
|
||||
if(startEndTime.value[0] && startEndTime.value[1]){
|
||||
queryParams.start_time = moment(startEndTime.value[0]).format('YYYY-MM-DD') + ' 00:00:00';
|
||||
queryParams.end_time = moment(startEndTime.value[1]).format('YYYY-MM-DD') + ' 23:59:59';
|
||||
}else {
|
||||
queryParams.start_time = '';
|
||||
queryParams.end_time = '';
|
||||
}
|
||||
getLists();
|
||||
}
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
|
|
|
@ -12,9 +12,10 @@
|
|||
</el-form>
|
||||
</el-card> -->
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="id" prop="store_id" show-overflow-tooltip />
|
||||
<div>
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
|
||||
<el-table-column label="ID" prop="id" min-width="55"/>
|
||||
<el-table-column label="店铺ID" prop="store_id" show-overflow-tooltip />
|
||||
<el-table-column label="时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="收款方" prop="store_name" show-overflow-tooltip />
|
||||
<el-table-column label="结算金额" prop="money" show-overflow-tooltip />
|
||||
|
@ -26,12 +27,15 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="handleDelete(row.id)" v-if="row.status == 0">
|
||||
发送
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="handleClick(row)" v-if="row.status == 2">
|
||||
确认
|
||||
</el-button>
|
||||
<div class="flex" v-if="row.receivable">
|
||||
<el-button link type="primary" @click="handleDelete(row.id)" v-if="row.status == 0">
|
||||
发送
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="handleClick(row)" v-if="row.status == 2">
|
||||
确认
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -89,6 +93,19 @@ const queryParams = reactive({
|
|||
remark_time: ''
|
||||
})
|
||||
|
||||
const tableRowClassName = ({
|
||||
row,
|
||||
rowIndex,
|
||||
}) => {
|
||||
console.log(row.receivable);
|
||||
|
||||
if (!row.receivable) {
|
||||
return 'warning-row'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
|
@ -140,3 +157,8 @@ const handleConfirm = async (id: number | any[]) => {
|
|||
getLists()
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-table .warning-row {
|
||||
--el-table-tr-bg-color: var(--el-color-danger-light-9);
|
||||
}
|
||||
</style>
|
|
@ -35,7 +35,7 @@
|
|||
<el-table-column label="标签名字" prop="label_name" show-overflow-tooltip />
|
||||
<el-table-column label="logo(图片)" prop="logo">
|
||||
<template #default="{ row }">
|
||||
<el-image style="width:50px;height:50px;" :src="row.logo" />
|
||||
<el-image style="width:50px;height:50px;" :src="row.logo" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
<el-date-picker v-model="startEndTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" />
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" @change="getData" />
|
||||
<el-button type="primary" class="ml-4" @click="getData">查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,6 +25,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt-4 !border-none">
|
||||
<div class="mb-6 flex justify-between items-center">
|
||||
<span class="text-2xl">商品趋势</span>
|
||||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
<el-date-picker v-model="startEndTime2" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" @change="getData2" />
|
||||
<el-button type="primary" class="ml-4" @click="getData2">查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<v-charts style="height: 400px" :option="visitorOption" :autoresize="true" />
|
||||
</div>
|
||||
|
@ -34,16 +45,16 @@
|
|||
<span class="text-2xl">商品排行</span>
|
||||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
<el-date-picker v-model="startEndTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" />
|
||||
<el-button type="primary" class="ml-4" @click="getData">查询</el-button>
|
||||
<el-date-picker v-model="startEndTime3" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" @change="getList" />
|
||||
<el-button type="primary" class="ml-4" @click="getList">查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-table :data="sotreList">
|
||||
<el-table-column label="商品图片">
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" fit="cover" style="width: 50px; height: 50px" />
|
||||
<el-image :src="row.image" fit="cover" style="width: 50px; height: 50px" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="store_name" min-width="250" />
|
||||
|
@ -81,6 +92,17 @@ const shortcuts = [
|
|||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '本月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setDate(1)
|
||||
end.setMonth(end.getMonth() + 1)
|
||||
end.setDate(0)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '近一月',
|
||||
value: () => {
|
||||
|
@ -231,6 +253,8 @@ const basicList = reactive([
|
|||
}
|
||||
])
|
||||
const startEndTime = ref([new Date(), new Date()]);
|
||||
const startEndTime2 = ref([]);
|
||||
const startEndTime3 = ref([]);
|
||||
// 获取数据
|
||||
const getData = () => {
|
||||
let date = '';
|
||||
|
@ -243,6 +267,11 @@ const getData = () => {
|
|||
item.percent = res[item.type].percent;
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const getData2 = () => {
|
||||
let date = '';
|
||||
if (startEndTime2.value[0] && startEndTime2.value[1]) date = moment(startEndTime2.value[0]).format('YYYY/MM/DD') + '-' + moment(startEndTime2.value[1]).format('YYYY/MM/DD');
|
||||
apiGetTrend({
|
||||
date: date
|
||||
}).then(res => {
|
||||
|
@ -269,7 +298,7 @@ const getData = () => {
|
|||
const sotreList = ref([]);
|
||||
const getList = () => {
|
||||
let date = '';
|
||||
if (startEndTime.value[0] && startEndTime.value[1]) date = moment(startEndTime.value[0]).format('YYYY/MM/DD') + '-' + moment(startEndTime.value[1]).format('YYYY/MM/DD');
|
||||
if (startEndTime3.value[0] && startEndTime3.value[1]) date = moment(startEndTime3.value[0]).format('YYYY/MM/DD') + '-' + moment(startEndTime3.value[1]).format('YYYY/MM/DD');
|
||||
apiGetProductRanking({
|
||||
date: date
|
||||
}).then(res => {
|
||||
|
@ -279,6 +308,7 @@ const getList = () => {
|
|||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
getData2()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
<el-date-picker v-model="startEndTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" />
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" @change="getData" />
|
||||
<el-button type="primary" class="ml-4" @click="getData">查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,7 +25,19 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt-4 !border-none">
|
||||
<div>
|
||||
<div class="mb-6 flex justify-between items-center">
|
||||
<span class="text-2xl">用户趋势</span>
|
||||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
<el-date-picker v-model="startEndTime2" type="daterange" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts"
|
||||
@change="getData2" />
|
||||
<el-button type="primary" class="ml-4" @click="getData2">查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<v-charts style="height: 400px" :option="visitorOption" :autoresize="true" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -47,6 +59,17 @@ const shortcuts = [
|
|||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '本月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setDate(1)
|
||||
end.setMonth(end.getMonth() + 1)
|
||||
end.setDate(0)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '近一月',
|
||||
value: () => {
|
||||
|
@ -85,7 +108,7 @@ const visitorOption: any = reactive({
|
|||
formatter: '{value}'
|
||||
}
|
||||
},
|
||||
grid:{
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
|
@ -201,6 +224,7 @@ const basicList = reactive([
|
|||
}
|
||||
])
|
||||
const startEndTime = ref([new Date(), new Date()]);
|
||||
const startEndTime2 = ref([]);
|
||||
// 获取数据
|
||||
const getData = () => {
|
||||
let date = '';
|
||||
|
@ -213,6 +237,11 @@ const getData = () => {
|
|||
item.percent = res[item.type].percent;
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const getData2 = () => {
|
||||
let date = '';
|
||||
if (startEndTime2.value[0] && startEndTime2.value[1]) date = moment(startEndTime2.value[0]).format('YYYY/MM/DD') + '-' + moment(startEndTime2.value[1]).format('YYYY/MM/DD');
|
||||
apiGetUserTrend({
|
||||
date: date
|
||||
}).then(res => {
|
||||
|
@ -236,9 +265,9 @@ const getData = () => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
getData2()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
<el-date-picker v-model="startEndTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" />
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" @change="getData" />
|
||||
<el-button type="primary" class="ml-4" @click="getData">查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -92,6 +92,17 @@ const shortcuts = [
|
|||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '本月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setDate(1)
|
||||
end.setMonth(end.getMonth() + 1)
|
||||
end.setDate(0)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '近一月',
|
||||
value: () => {
|
||||
|
@ -124,7 +135,7 @@ const visitorOption: any = reactive({
|
|||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '数量',
|
||||
name: '金额',
|
||||
position: 'left',
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
<el-date-picker v-model="startEndTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" />
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" @change="getData" />
|
||||
<el-button type="primary" class="ml-4" @click="getData">查询</el-button>
|
||||
<el-button type="primary" class="ml-4" @click="clearData">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -82,6 +83,17 @@ const shortcuts = [
|
|||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '本月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setDate(1)
|
||||
end.setMonth(end.getMonth() + 1)
|
||||
end.setDate(0)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '近一月',
|
||||
value: () => {
|
||||
|
@ -190,33 +202,25 @@ const circleOption: any = reactive({
|
|||
// 颜色
|
||||
const colorList = ['#5DB1FF', '#4CD384', '#FFC46A', '#CAA5F1', '#FFC46A', '#4CD384', '#5DB1FF', '#CAA5F1']
|
||||
const basicList = reactive([
|
||||
{
|
||||
name: '门店收款金额',
|
||||
type: 'receipt_amount',
|
||||
icon: 'RectangleCopy',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
{
|
||||
name: '门店营业额',
|
||||
type: 'order_amount',
|
||||
icon: 'RectangleCopy49',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
name: '微信条码收款金额',
|
||||
type: 'wechat_code_amount',
|
||||
icon: 'RectangleCopy55',
|
||||
num: 0,
|
||||
},
|
||||
{
|
||||
name: '门店收益金额',
|
||||
type: 'income_amount',
|
||||
icon: 'RectangleCopy53',
|
||||
name: '支付宝条码收款金额',
|
||||
type: 'alipay_code_amount',
|
||||
icon: 'RectangleCopy52',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
{
|
||||
name: '核销订单金额',
|
||||
type: 'verify_amount',
|
||||
icon: 'RectangleCopy5',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
{
|
||||
name: '线下收银订单金额',
|
||||
|
@ -238,6 +242,27 @@ const basicList = reactive([
|
|||
icon: 'RectangleCopy59',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
{
|
||||
name: '门店收款金额',
|
||||
type: 'receipt_amount',
|
||||
icon: 'RectangleCopy',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
{
|
||||
name: '门店收益金额',
|
||||
type: 'income_amount',
|
||||
icon: 'RectangleCopy53',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
{
|
||||
name: '核销订单金额',
|
||||
type: 'verify_amount',
|
||||
icon: 'RectangleCopy5',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
{
|
||||
name: '门店成交用户数',
|
||||
|
@ -251,7 +276,6 @@ const basicList = reactive([
|
|||
type: 'deposit_amount',
|
||||
icon: 'RectangleCopy32',
|
||||
num: 0,
|
||||
|
||||
},
|
||||
])
|
||||
const startEndTime = ref([new Date(), new Date()]);
|
||||
|
@ -317,6 +341,11 @@ const getData = () => {
|
|||
|
||||
}
|
||||
|
||||
const clearData = () => {
|
||||
startEndTime.value = [new Date(), new Date()];
|
||||
store_id.value = '';
|
||||
getData();
|
||||
}
|
||||
|
||||
const storeloading = ref(false);
|
||||
const storeList = ref([]);
|
||||
|
@ -327,11 +356,6 @@ const remoteMethod = (e: string = '') => {
|
|||
page_size: 50
|
||||
}).then(res => {
|
||||
storeList.value = res.lists;
|
||||
if (store_id.value === '') {
|
||||
const index = Math.floor(Math.random() * res.lists.length)
|
||||
store_id.value = res.lists[index].id;
|
||||
getData();
|
||||
}
|
||||
setTimeout(() => {
|
||||
storeloading.value = false;
|
||||
}, 300)
|
||||
|
@ -343,7 +367,8 @@ const remoteMethod = (e: string = '') => {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
remoteMethod()
|
||||
remoteMethod();
|
||||
getData();
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<el-table-column label="商品名称" prop="store_name" show-overflow-tooltip />
|
||||
<el-table-column label="商品图片" prop="image" show-overflow-tooltip >
|
||||
<template #default="{ row }">
|
||||
<el-image class="w-[40px] h-[40px]" :src="row.image" />
|
||||
<el-image class="w-[40px] h-[40px]" :src="row.image" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="价格" prop="price" show-overflow-tooltip />
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<el-table-column label="分类名称" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="图片" prop="pic">
|
||||
<template #default="{ row }">
|
||||
<el-image style="width: 50px; height: 50px" :src="row.pic" />
|
||||
<el-image style="width: 50px; height: 50px" :src="row.pic" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" prop="data" show-overflow-tooltip />
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</el-descriptions-item>
|
||||
<el-descriptions-item label="商品分类">{{ formData.cate_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="商品图片" :span="2">
|
||||
<el-image :src="formData.image" class="w-20 h-20" />
|
||||
<el-image :src="formData.image" class="w-20 h-20" :preview-teleported="true"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="商品条码">
|
||||
{{ formData.bar_code }}
|
||||
|
@ -49,7 +49,7 @@
|
|||
<el-table-column label="门店名称" prop="system_store_name" min-width="200" />
|
||||
<el-table-column label="商品图" prop="image" width="80" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" />
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="store_name" min-width="150" />
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<el-table-column label="详细地址" prop="detailed_address" show-overflow-tooltip />
|
||||
<el-table-column label="门店logo" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" />
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="营业状态" prop="is_show" show-overflow-tooltip>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<el-table-column label="详细地址" prop="detailed_address" show-overflow-tooltip />
|
||||
<el-table-column label="门店logo" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" class="w-[40px] h-[40px]" />
|
||||
<el-image :src="row.image" class="w-[40px] h-[40px]" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="营业状态" prop="is_show" show-overflow-tooltip>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<el-table-column label="商品ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="商品图片" prop="image" min-width="80">
|
||||
<template #default="{ row }">
|
||||
<el-image style="width: 50px; height: 50px" :src="row.image" />
|
||||
<el-image style="width: 50px; height: 50px" :src="row.image" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="store_name" min-width="200" show-overflow-tooltip />
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<el-table-column label="商品ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="商品图片" prop="image" min-width="80">
|
||||
<template #default="{ row }">
|
||||
<el-image style="width: 50px; height: 50px" :src="row.image" />
|
||||
<el-image style="width: 50px; height: 50px" :src="row.image" :preview-teleported="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="store_name" min-width="200" show-overflow-tooltip />
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<el-table-column label="订单号" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="商品信息" prop="status" show-overflow-tooltip width="400">
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" class="w-16 h-16"></el-image>
|
||||
<el-image :src="row.image" class="w-16 h-16" :preview-teleported="true"></el-image>
|
||||
<div>{{ row.store_name }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<el-table-column label="商品信息" prop="store_name" show-overflow-tooltip width="400">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center">
|
||||
<el-image :src="row.image" class="w-16 h-16 mr-2"></el-image>
|
||||
<el-image :src="row.image" class="w-16 h-16 mr-2" :preview-teleported="true"></el-image>
|
||||
<div>{{ row.store_name }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -29,11 +29,12 @@
|
|||
<el-table-column label="订单号" prop="order_id" show-overflow-tooltip />
|
||||
<el-table-column label="商品信息" prop="order_id" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center mb-2" v-for="(item, index) in row.product" :key="index">
|
||||
<div class="flex items-center mb-2" v-for="(item, index) in row.product?.slice(0,3)" :key="index">
|
||||
<el-image class="w-[30px] h-[30px] mr-2 flex-shrink-0" :src="item.image" fit="cover"
|
||||
:preview-src-list="[item.image]" />
|
||||
:preview-src-list="[item.image]" :preview-teleported="true" />
|
||||
<p class="truncate text-[12px]">{{ item.store_name }}</p>
|
||||
</div>
|
||||
<div v-if="row.product?.length > 3" style="text-align: left">...</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户" prop="nickname" show-overflow-tooltip />
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<el-table-column label="用户信息" prop="nickname" min-width="120" show-overflow-tooltip>
|
||||
<!-- <template #default="{ row }">
|
||||
<div class="flex items-center">
|
||||
<el-image style="width: 50px; height: 50px" :src="row.avatar" class="mr-2" />
|
||||
<el-image style="width: 50px; height: 50px" :src="row.avatar" class="mr-2" :preview-teleported="true"/>
|
||||
{{ row.nickname }}
|
||||
</div>
|
||||
</template> -->
|
||||
|
@ -53,7 +53,7 @@
|
|||
<el-table-column label="商品信息" prop="project_level_text" show-overflow-tooltip min-width="180">
|
||||
<template #default="{ row }">
|
||||
<div v-for="(item, index) in row.product" :key="index" class="flex items-center">
|
||||
<el-image :src="item.cart_info.image" class="mr-2 w-[40px] h-[40px] !flex-shrink-0" />
|
||||
<el-image :src="item.cart_info.image" class="mr-2 w-[40px] h-[40px] !flex-shrink-0" :preview-teleported="true"/>
|
||||
<div class="text-[12px]">
|
||||
<p>{{ item.cart_info.name }}</p>
|
||||
<p>¥{{ item.cart_info.price }} x {{ item.cart_info.cart_num }}</p>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="订单号" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="商品信息" prop="status" show-overflow-tooltip width="400">
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" class="w-16 h-16" :preview-teleported="true"></el-image>
|
||||
<div>{{ row.store_name }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货时间" prop="id" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end" v-if="pager.lists.length<pager.count">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="deliverTable">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiStoreOrderLists, apiStoreOrderDelete } from '@/api/store_order'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
order_id: '',
|
||||
pay_type: ''
|
||||
})
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiStoreOrderLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
getLists
|
||||
})
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,46 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<div class="font-bold text-lg">用户信息</div>
|
||||
<div class="flex flex-wrap">
|
||||
<div class="mt-4 w-1/3">用户uid:{{ datas.uid }}</div>
|
||||
<div class="mt-4 w-1/3">用户昵称:{{ datas.real_name }}</div>
|
||||
<div class="mt-4 w-1/3">手机号:{{ datas.user_phone }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<div class="font-bold text-lg">收货信息</div>
|
||||
<div class="mt-4">收货人:{{ datas.real_name }}</div>
|
||||
<div class="mt-4">收货电话:{{ datas.user_phone }}</div>
|
||||
<div class="mt-4">收货地址:{{ datas.user_address }}</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<div class="font-bold text-lg">订单信息</div>
|
||||
<div class="flex flex-wrap">
|
||||
<div class="mt-4 w-1/3">创建时间:{{ datas.create_time }}</div>
|
||||
<div class="mt-4 w-1/3">商品总数:{{ datas.total_num }}</div>
|
||||
<div class="mt-4 w-1/3">商品总价:{{ datas.total_price }}</div>
|
||||
<div class="mt-4 w-1/3">优惠券金额:{{ datas.coupon_price }}</div>
|
||||
<div class="mt-4 w-1/3">积分抵扣:{{ datas.deduction_price }}</div>
|
||||
<div class="mt-4 w-1/3">支付时间:{{ datas.pay_time }}</div>
|
||||
<div class="mt-4 w-1/3 flex">支付方式:<dict-value :options="dictData.pay_type" :value="datas.pay_type"></dict-value></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="orderInfo">
|
||||
|
||||
import type { PropType } from 'vue'
|
||||
const props = defineProps({
|
||||
datas: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
|
@ -0,0 +1,43 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="订单ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="操作记录" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="操作时间" prop="id" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end" v-if="pager.lists.length<pager.count">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="orderTable">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiStoreOrderLists, apiStoreOrderDelete } from '@/api/store_order'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
order_id: '',
|
||||
pay_type: ''
|
||||
})
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiStoreOrderLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
getLists
|
||||
})
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,73 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-table :data="pager.lists" v-loading="pager.loading" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="商品信息" prop="store_name" show-overflow-tooltip width="400">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center">
|
||||
<el-image :src="row.image" class="w-16 h-16 mr-2" :preview-teleported="true"></el-image>
|
||||
<div>{{ row.store_name }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="cart_info.cart_num" show-overflow-tooltip />
|
||||
<el-table-column label="合计" prop="cart_info.total" show-overflow-tooltip />
|
||||
<el-table-column label="实付金额" prop="cart_info.price" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end" v-if="pager.lists.length<pager.count">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="storeTable">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiStoreOrderCartInfo } from '@/api/store_order'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
||||
const props = defineProps({
|
||||
oid: {
|
||||
type: [String,Number],
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const emit = defineEmits(['change'])
|
||||
|
||||
// 选中的数据
|
||||
const selectionList = ref([])
|
||||
|
||||
// 选中数据时触发
|
||||
const handleSelectionChange = (val: any) => {
|
||||
selectionList.value = val
|
||||
emit('change', selectionList.value)
|
||||
}
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
oid: '',
|
||||
pay_type: ''
|
||||
})
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiStoreOrderCartInfo,
|
||||
params: {
|
||||
...queryParams,
|
||||
oid: props.oid
|
||||
}
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
getLists
|
||||
})
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,114 @@
|
|||
<template>
|
||||
<el-drawer v-model="showDialog" title="订单详情" :size="1000">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>订单编号:{{formData.order_id}}</div>
|
||||
<!-- <el-button type="primary">发送货</el-button> -->
|
||||
</div>
|
||||
<div class="flex items-center justify-between m-4">
|
||||
<div class="flex flex-col">
|
||||
<div style="color: gray;">订单状态</div>
|
||||
<div style="color: black;">{{ formData.status_name }}</div>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<div style="color: gray;">实际支付</div>
|
||||
<div style="color: black;">¥{{ formData.pay_price }}</div>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<div style="color: gray;">支付方式</div>
|
||||
<div style="color: black;">
|
||||
<dict-value :options="dictData.pay_type" :value="formData.pay_type"></dict-value>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col flex-2">
|
||||
<div style="color: gray;">支付时间</div>
|
||||
<div style="color: black;">{{ formData.pay_time }}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" type="border-card">
|
||||
<el-tab-pane label="订单信息" name="first">
|
||||
<orderInfo :datas="formData" :dictData="dictData"></orderInfo>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="商品信息" name="second">
|
||||
<storeTable :oid="formData.id" ref="storeRef"></storeTable>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="订单记录" name="third">
|
||||
<orderTable ref="orderRef"></orderTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货记录" name="fourth">
|
||||
<deliverTable ref="deliverRef"></deliverTable>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="storeOrderDETAILS">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiStoreOrderAdd, apiStoreOrderEdit, apiStoreOrderDetail } from '@/api/store_order'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import moment from 'moment'
|
||||
import orderInfo from './components/orderInfo.vue'
|
||||
import storeTable from './components/storeTable.vue'
|
||||
import orderTable from './components/orderTable.vue'
|
||||
import deliverTable from './components/deliverTable.vue'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const showDialog = ref(false)
|
||||
const mode = ref('add')
|
||||
|
||||
const storeRef = ref(null);
|
||||
const orderRef = ref(null);
|
||||
const deliverRef = ref(null);
|
||||
|
||||
// 表单数据
|
||||
const formData = ref({
|
||||
id: ''
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
formData.value = {...data};
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
formData.value.id = row.id;
|
||||
handleClick({
|
||||
paneName:activeName.value
|
||||
});
|
||||
const data = await apiStoreOrderDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
showDialog.value = true;
|
||||
}
|
||||
|
||||
const activeName = ref('first')
|
||||
|
||||
const handleClick = (tab:any) => {
|
||||
if(tab.paneName == 'second') storeRef.value?.getLists();
|
||||
else if(tab.paneName == 'third') orderRef.value?.getLists();
|
||||
else if(tab.paneName == 'fourth') deliverRef.value?.getLists();
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,103 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="storeOrderEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiStoreOrderAdd, apiStoreOrderEdit, apiStoreOrderDetail } from '@/api/store_order'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑订单表' : '新增订单表'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiStoreOrderDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiStoreOrderEdit(data)
|
||||
: await apiStoreOrderAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,151 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="订单号" prop="order_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.order_id" @keydown.enter="resetPage" clearable placeholder="请输入订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="pay_type">
|
||||
<!-- <el-input class="w-[280px]" v-model="queryParams.pay_type" clearable placeholder="请输入支付方式" /> -->
|
||||
<el-select class="w-[280px]" v-model="queryParams.pay_type" placeholder="请选择支付方式" @change="resetPage">
|
||||
<el-option :label="item.name" :value="item.value" v-for="item in dictData.pay_type"
|
||||
:key="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="订单ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="订单号" prop="order_id" show-overflow-tooltip />
|
||||
<el-table-column label="商品信息" prop="order_id" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center mb-2" v-for="(item, index) in row.product?.slice(0,3)" :key="index">
|
||||
<el-image class="w-[30px] h-[30px] mr-2 flex-shrink-0" :src="item.image" fit="cover"
|
||||
:preview-src-list="[item.image]" :preview-teleported="true" />
|
||||
<p class="truncate text-[12px]">{{ item.store_name }}</p>
|
||||
</div>
|
||||
<div v-if="row.product?.length > 3" style="text-align: left">...</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户" prop="nickname" show-overflow-tooltip />
|
||||
<el-table-column label="实际支付金额" prop="pay_price" show-overflow-tooltip />
|
||||
<el-table-column label="订单状态" prop="status_name">
|
||||
<template #default="{row}">
|
||||
<el-tag v-if="row.status_name=='待收货'" type="success">{{ row.status_name }}</el-tag>
|
||||
<el-tag v-else-if="row.status_name=='已收货'" type="info">{{ row.status_name }}</el-tag>
|
||||
<el-tag v-else-if="row.status_name=='待发货'" type="warning">{{ row.status_name }}</el-tag>
|
||||
<el-tag v-else type="danger">{{ row.status_name }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" prop="pay_type" show-overflow-tooltip>
|
||||
<template #default="{row}">
|
||||
<dict-value :options="dictData.pay_type" :value="row.pay_type"></dict-value>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付时间" prop="pay_time" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button v-perms="['store_order.store_order/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['store_order.store_order/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button> -->
|
||||
<el-button type="primary" link @click="handleDetai(row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- <edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" /> -->
|
||||
<details-popup v-if="showDetails" ref="detailsRef" @success="getLists" @close="showDetails = false" :dictData="dictData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="store_order_transshipment">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiStoreOrderLists, apiStoreOrderDelete } from '@/api/store_order'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import DetailsPopup from './details.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailsRef = shallowRef<InstanceType<typeof DetailsPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDetails = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
order_id: '',
|
||||
pay_type: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('pay_type')
|
||||
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiStoreOrderLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 详情
|
||||
const handleDetai = async (data: any) => {
|
||||
showDetails.value = true
|
||||
await nextTick()
|
||||
detailsRef.value?.open()
|
||||
detailsRef.value?.getDetail(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiStoreOrderDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
|
@ -32,7 +32,7 @@
|
|||
<el-table-column label="ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="门店logo" prop="image" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" />
|
||||
<el-image :src="row.image" class="w-[50px] h-[50px]" :preview-teleported="true" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负责人" prop="staff_name" show-overflow-tooltip />
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<el-tab-pane label="基础信息" name="first">
|
||||
<el-descriptions class="margin-top" :column="2" border>
|
||||
<el-descriptions-item label="真实姓名">
|
||||
{{ formData.label_name }}
|
||||
{{ formData.real_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用户性别">
|
||||
<dict-value :options="dictData.sex" :value="formData.sex" />
|
||||
|
|
Loading…
Reference in New Issue