订单完善以及退款相关

This commit is contained in:
SjS 2025-05-06 19:52:12 +08:00
parent be6c682e37
commit a724a1acad
11 changed files with 323 additions and 139 deletions

View File

@ -42,3 +42,12 @@ export function delLightingNum(id) {
method: 'delete'
})
}
// 赠送爆用户灯次数
export function giftLightingNum(data) {
return request({
url: '/bst/lightingNum/giftLightingNum',
method: 'put',
data: data
})
}

View File

@ -110,6 +110,12 @@ export const constantRoutes = [
name: 'DeviceView',
meta: { title: '设备详情' }
},
{
path: 'store/:storeId?',
component: () => import('@/views/bst/store/storeDetail.vue'),
name: 'StoreView',
meta: { title: '店铺详情详情' }
},
]
},
{

View File

@ -196,19 +196,8 @@
<el-card class="box-card">
<el-descriptions title="归属信息" :column="1">
<template #extra>
<!-- <el-row type="flex">-->
<!-- <bind-agent-button v-else :device-id="deviceData.deviceId" @success="getDevice"-->
<!-- style="margin-right: 0.5em"/>-->
<!-- <el-button size="small" plain icon="el-icon-link" type="danger" @click="handleUnbind"-->
<!-- v-if="deviceData.userId != null">解绑商户-->
<!-- </el-button>-->
<!-- <bind-mch-button v-else :device-id="deviceData.deviceId" @success="getDevice"-->
<!-- style="margin-left: 0.5em"/>-->
<!-- </el-row>-->
</template>
<el-descriptions-item label="所属商户">
<user-link :name="deviceData.userName" :id="deviceData.userId"/>
<user-link :text="deviceData.userName" :id="deviceData.userId"/>
</el-descriptions-item>
<el-descriptions-item label="店铺名称">
<store-link :name="deviceData.storeName" :id="deviceData.storeId"/>
@ -237,6 +226,7 @@ import {refreshIot} from "@/api/bst/deviceIot";
import {getDevice} from "@/api/bst/device";
import {switchDevice} from "@/api/bst/deviceIot";
import UserLink from "@/views/system/user/UserLink.vue";
import StoreLink from "@/views/bst/store/StoreLink.vue";
export default {
name: 'DeviceView',
@ -249,6 +239,7 @@ export default {
'model_type',
],
components: {
StoreLink,
UserLink,
DotStatus,
LineField,
@ -410,22 +401,6 @@ export default {
})
})
},
handleUnbindAgent() {
this.$confirm('是否强制解绑该代理商?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.loading = true;
unbindAgent(this.deviceData.deviceId).then(res => {
if (res.code === 200) {
this.$message.success("操作成功");
}
}).finally(() => {
this.getDevice();
})
})
},
handleSwitch(open) {
this.$confirm(`是否确认强制${open ? '开启' : '关闭'}设备?`, '警告', {
confirmButtonText: '确定',

View File

@ -112,9 +112,6 @@
</template>
</el-table-column>
<el-table-column label="型号" align="center" prop="modelName" />
<!-- <el-table-column label="图片" align="center" prop="customPicture" >-->
<!-- <image-preview slot-scope="d" :src="d.row.customPicture" :width="50" :height="50"/>-->
<!-- </el-table-column>-->
<el-table-column label="MAC-1" align="center" prop="mac" />
<el-table-column label="MAC-2" align="center" prop="mac2" />
<el-table-column label="在线状态" align="center" prop="onlineStatus">
@ -141,7 +138,7 @@
type="text"
icon="el-icon-view"
@click="handleSee(scope.row)"
v-hasPermi="['system:device:detail']"
v-has-permi="['bst:device:detail']"
>详情</el-button>
<el-button
size="mini"
@ -229,6 +226,12 @@ export default {
name: "Device",
mixins: [$showColumns],
dicts: ['device_status', 'device_online_status', 'device_power_status'],
props: {
query: {
type: Object,
default: () => ({})
}
},
components: {DeviceSn, FormCol},
data() {
return {
@ -297,6 +300,7 @@ export default {
wxs: null,
lastRecoverTime: null
},
//
form: {},
//
@ -320,6 +324,10 @@ export default {
};
},
created() {
this.queryParams = {
...this.queryParams,
...this.query
}
this.getList();
this.getModelList();
},

View File

@ -63,13 +63,13 @@
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-has-permi="['bst:lightingNum:edit']"
>修改</el-button>
<el-button
type="text"
icon="el-icon-present"
size="mini"
@click="handleOpenGift(scope.row)"
v-has-permi="['bst:lightingNum:give']"
>赠送次数</el-button>
<el-button
size="mini"
type="text"
@ -89,28 +89,35 @@
@pagination="getList"
/>
<!-- 添加或修改爆灯次数列表对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<form-col :span="span" label="用户名" prop="userName">
<el-input v-model="form.userId" placeholder="请输入用户名" />
</form-col>
<form-col :span="span" label="店铺id" prop="storeName">
<el-input v-model="form.storeId" placeholder="请输入店铺名" />
</form-col>
</el-row>
<!-- 赠送爆灯次数列表对话框 -->
<el-dialog title="赠送爆灯次数" :visible.sync="openGift" width="500px" append-to-body>
<el-form ref="formGift" :model="form" :rules="rules" label-width="100px">
<!-- <el-form-item label="用户手机号" prop="phone">-->
<!-- <el-input v-model="form.phone" placeholder="请输入用户手机号"/>-->
<!-- </el-form-item>-->
<el-form-item label="赠送次数" prop="number">
<el-input-number
v-model="form.number"
:min="1"
controls-position="right"
style="width: 100%"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button @click="openGift = false"> </el-button>
<el-button type="primary" @click="submitGift"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listLightingNum, getLightingNum, delLightingNum, addLightingNum, updateLightingNum } from "@/api/bst/lightingNum";
import {
listLightingNum,
delLightingNum,
giftLightingNum
} from "@/api/bst/lightingNum";
import { $showColumns } from '@/utils/mixins';
import FormCol from "@/components/FormCol/index.vue";
@ -126,6 +133,7 @@ export default {
components: {FormCol},
data() {
return {
span: 24,
//
columns: [
@ -138,6 +146,8 @@ export default {
orderSorts: ['ascending', 'descending', null],
//
loading: true,
storeOptions: [], //
parentOptions: [], //
//
ids: [],
//
@ -165,27 +175,24 @@ export default {
storeId: null,
number: null,
},
openGift: false,
//
form: {},
form: {
userId: null,
storeId: null,
number : 1
},
//
rules: {
userId: [
{ required: true, message: "用户id不能为空", trigger: "blur" }
],
storeId: [
{ required: true, message: "店铺id不能为空", trigger: "blur" }
],
number: [
{ required: true, message: "爆灯次数不能为空", trigger: "blur" }
],
createTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
this.getStoreList();
},
methods: {
/** 当排序按钮被点击时触发 **/
@ -240,42 +247,33 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加爆灯次数列表";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getLightingNum(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改爆灯次数列表";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateLightingNum(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addLightingNum(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
handleOpenGift(row) {
this.openGift = true
this.form = {
userId: row.userId,
storeId: row.storeId,
number: 1
}
},
submitGift() {
this.$refs.formGift.validate(valid => {
if (valid) {giftLightingNum
giftLightingNum({
userId: this.form.userId,
storeId: this.form.storeId,
number: this.form.number
}).then(() => {
this.$modal.msgSuccess("赠送成功")
this.openGift = false
this.getList() //
}).catch(error => {
this.$modal.msgError(error.msg || "操作失败")
})
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;

View File

@ -180,7 +180,7 @@ export default {
components: {DeptSelect, FormCol},
data() {
return {
storeOptions: [], //
storeOptions: [], //
parentOptions: [], //
cascaderProps: {
value: 'partId',

View File

@ -74,6 +74,25 @@
<template v-else-if="column.key === 'status'">
<dict-tag :options="dict.type.refund_status" :value="d.row[column.key]" />
</template>
<template v-else-if="column.key === 'amount'">
<el-col :span="24">
<div style="line-height: 24px">
<div style="margin-bottom: 8px">
<span style="font-weight: 500">退款金额</span>
<span style="font-weight: bold">
{{ d.row.amount | fix2 | dv }}
</span>
</div>
<div>
<span style="font-weight: 500">爆灯次数</span>
<span style="font-weight: bold">
{{ d.row.number | dv }}
</span>
</div>
</div>
</el-col>
</template>
<template v-else>
{{d.row[column.key]}}
</template>
@ -117,7 +136,7 @@ export default {
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
{key: 'no', visible: true, label: '退款编号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'payNo', visible: true, label: '支付单号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'amount', visible: true, label: '退款金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'amount', visible: true, label: '退款', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'reason', visible: true, label: '原因', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'userId', visible: false, label: '操作人ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},

View File

@ -0,0 +1,31 @@
<template>
<el-link type="primary" @click="handleClick" :disabled="id == null">{{name | defaultValue}}</el-link>
</template>
<script>
import { UserType } from '@/utils/constants'
export default {
name: 'StoreLink',
props: {
id: {
type: String,
default: null
},
name: {
type: String,
default: null,
},
},
methods: {
handleClick() {
this.$emit('click');
if (this.$store.getters.userType === UserType.APP) {
this.$router.push(`/business/store/${this.id}`)
} else {
this.$router.push({path: '/mch/storeDetail', query: {storeId: this.id}})
}
}
}
}
</script>

View File

@ -25,38 +25,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="营业开始时间" prop="startTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.startTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择营业开始时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="营业结束时间" prop="endTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.endTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择营业结束时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="经度" prop="longitude">-->
<!-- <el-input-->
<!-- v-model="queryParams.longitude"-->
<!-- placeholder="请输入经度"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="纬度" prop="latitude">-->
<!-- <el-input-->
<!-- v-model="queryParams.latitude"-->
<!-- placeholder="请输入纬度"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="地址" prop="address">
<el-input
v-model="queryParams.address"
@ -122,10 +90,20 @@
</el-table-column>
<el-table-column label="商户" align="center" prop="userName"/>
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column label="营业开始时间" align="center" prop="startTime" />
<el-table-column label="营业结束时间" align="center" prop="endTime" />
<el-table-column label="营业时间" align="center">
<template #default="scope">
{{ scope.row.startTime }} {{ scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleSee(scope.row)"
v-has-permi="['bst:device:detail']"
>详情</el-button>
<el-button
size="mini"
type="text"
@ -258,14 +236,10 @@ export default {
{key: 'storeName', visible: true, label: '店铺名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'address', visible: true, label: '详细地址', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'picture', visible: true, label: '门店照片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
//{key: 'userId', visible: true, label: '', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'userName', visible: true, label: '商户', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'phone', visible: true, label: '联系电话', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'startTime', visible: true, label: '营业开始时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
{key: 'endTime', visible: true, label: '营业结束时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
// {key: 'longitude', visible: true, label: '', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
//{key: 'latitude', visible: true, label: '', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],
@ -338,6 +312,10 @@ export default {
this.getList();
},
methods: {
//
handleSee(row) {
this.$router.push({path: `/view/store/${row.storeId}`})
},
onSubmitAddress(addr) {
this.form.address = addr.name;
this.form.latitude = addr.lat;

View File

@ -0,0 +1,160 @@
<template>
<div class="app-container" v-loading="loading">
<el-card class="box-card" header="店铺详情">
<el-row type="flex">
<image-preview :src="store.picture" :width="80" :height="80"/>
<div style="flex: 1;margin-left: 2em">
<el-descriptions :column="3">
<el-descriptions-item label="店铺名称">{{store.storeName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{store.createTime | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="营业时间">
{{store.startTime | defaultValue}} {{store.endTime | defaultValue}}
</el-descriptions-item>
<el-descriptions-item label="联系方式">{{store.userName | defaultValue}}({{store.phone | defaultValue}})</el-descriptions-item>
<el-descriptions-item label="店铺地址" :span="2">
{{store.province}}{{store.city}}{{store.county}}{{store.address}}
</el-descriptions-item>
</el-descriptions>
</div>
</el-row>
</el-card>
<el-row :gutter="16">
<el-col :span="18">
<el-card class="box-card" >
<el-row type="flex">
<el-statistic
group-separator=","
:precision="2"
:value="store.todayIncome"
suffix="¥"
title="今日收入"
></el-statistic>
<el-statistic
group-separator=","
:precision="2"
:value="store.monthIncome"
suffix="¥"
title="本月收入"
></el-statistic>
<el-statistic
group-separator=","
:precision="2"
:value="store.lastMonthIncome"
suffix="¥"
title="上月收入"
></el-statistic>
<el-statistic
group-separator=","
:value="store.deviceCount"
suffix="台"
title="设备总数"
></el-statistic>
<el-statistic
group-separator=","
:value="store.onlineCount"
suffix="台"
title="在线设备"
></el-statistic>
<el-statistic
group-separator=","
:value="store.offlineCount"
suffix="台"
title="离线设备"
></el-statistic>
</el-row>
</el-card>
<el-card class="box-card">
<my-store-recharge-report :store-id="store.storeId"/>
</el-card>
</el-col>
<el-col :span="6">
<el-card class="box-card">
<place-search-map
v-if="showMap"
height="534px"
:init-lng="store.lng"
:init-lat="store.lat"
enable-geo
marker-type="store"
/>
</el-card>
</el-col>
</el-row>
<el-card class="box-card">
<el-tabs>
<el-tab-pane label="设备列表" :lazy="true">
<device v-if="store.storeId != null" :query="{storeId: store.storeId}"/>
</el-tab-pane>
<!-- <el-tab-pane label="员工列表" :lazy="true">-->
<!-- <my-store-staff :query="{storeId: store.storeId}" :view="views.store"/>-->
<!-- </el-tab-pane>-->
<el-tab-pane label="订单列表" :lazy="true">
<order :query="{storeId: store.storeId}" :view="views.store"/>
</el-tab-pane>
<!-- <el-tab-pane label="店铺变更记录" :lazy="true">-->
<!-- <mch-store-apply :query="{storeId: store.storeId}" :view="views.store"/>-->
<!-- </el-tab-pane>-->
</el-tabs>
</el-card>
</div>
</template>
<script>
import PlaceSearchMap from '@/components/Map/PlaceSearch/PlaceSearchMap.vue'
import {getStore } from "@/api/bst/store";
import { views } from '@/utils/constants'
import Device from "@/views/bst/device/index.vue";
import Order from "@/views/bst/order/index.vue";
export default {
name: 'StoreView',
computed: {
views() {
return views
}
},
components: {Order, Device, PlaceSearchMap },
dicts: ['bst_store_type', 'bst_status'],
data() {
return {
loading: false,
store: {},
showMap: false,
}
},
created() {
this.getDetail();
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
getDetail() {
this.loading = true;
getStore(this.$route.params.storeId).then(res => {
this.store = res.data;
this.showMap = true;
}).finally(() => {
this.loading = false;
})
},
}
}
</script>
<style scoped>
.remark-text {
color: #ccc;
margin-left: 1em;
}
.app-container .box-card:nth-child(n + 1) {
margin-top: 1em;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<base-link :id="id" :text="text" :size="size" @click="handleClick" :permissions="['system:user:query']"/>
<base-link :id="id" :text="text" :size="size" @click="handleClick" :permissions="['bst:user:query']"/>
</template>
<script>