临时提交

This commit is contained in:
墨大叔 2024-08-03 18:04:37 +08:00
parent 087b2c860c
commit 5c827408bc
7 changed files with 707 additions and 2 deletions

44
src/api/ss/storeApply.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询店铺审核列表
export function listStoreApply(query) {
return request({
url: '/ss/storeApply/list',
method: 'get',
params: query
})
}
// 查询店铺审核详细
export function getStoreApply(id) {
return request({
url: '/ss/storeApply/' + id,
method: 'get'
})
}
// 新增店铺审核
export function addStoreApply(data) {
return request({
url: '/ss/storeApply',
method: 'post',
data: data
})
}
// 修改店铺审核
export function updateStoreApply(data) {
return request({
url: '/ss/storeApply',
method: 'put',
data: data
})
}
// 删除店铺审核
export function delStoreApply(id) {
return request({
url: '/ss/storeApply/' + id,
method: 'delete'
})
}

View File

@ -177,13 +177,18 @@
list-style: none;
}
.list-group-item:nth-child(n + 2) {
border-top: 1px solid #e7eaec;
}
.list-group-item {
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0px;
font-size: 13px;
}
.list-group-item:hover {
background-color: rgba(136, 131, 240, 0.06);
}
.pull-right {
float: right !important;

View File

@ -24,3 +24,12 @@ export const WithdrawType = {
ONLINE: "1", // 线上
OFFLINE: "2" // 线下
}
/**
* 店铺审核状态
*/
export const StoreApplyStatus = {
WAIT_AUDIT: "1", // 等待审核
AUDIT_PASS: "2", // 审核通过
AUDIT_FAIL: "3" // 审核不通过
}

View File

@ -17,6 +17,22 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="店铺状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择店铺状态" clearable @change="handleQuery">
<el-option
v-for="dict in dict.type.store_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否生效" prop="enabled">
<el-select v-model="queryParams.enabled" placeholder="请选择审核状态" clearable @change="handleQuery">
<el-option label="已生效" :value="true"/>
<el-option label="未生效" :value="false"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -98,6 +114,16 @@
{{d.row.province}}{{d.row.city}}{{d.row.county}}{{d.row.address}}
</template>
</el-table-column>
<el-table-column label="店铺状态" align="center">
<template slot-scope="d">
<dict-tag :value="d.row.status" :options="dict.type.store_status"/>
</template>
</el-table-column>
<el-table-column label="是否生效" align="center">
<template slot-scope="d">
<el-tag :type="d.row.enabled ? 'success' : 'danger'">{{d.row.enabled ? '已生效' : '未生效'}}</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -224,7 +250,7 @@ import StoreLink from '@/components/Business/Store/StoreLink.vue'
export default {
name: "Store",
mixins: [$view],
dicts: ['ss_store_type'],
dicts: ['ss_store_type', 'store_status'],
components: { StoreLink, UserLink, AreaTextSelect, PlaceSearchDialog, UserInput, SmUserSelect },
props: {
query: {

View File

@ -0,0 +1,91 @@
<template>
<li class="change-field" :class="newValue !== oldValue ? 'no-same' : ''">
<div class="label">
{{label}}
</div>
<div class="right-box" >
<slot name="old" :value="oldValue">
<span class="old">{{ oldValue | defaultValue }}</span>
</slot>
<i class="el-icon-right"/>
<slot name="new" :value="newValue">
<span class="new">{{ newValue | defaultValue }}</span>
</slot>
</div>
</li>
</template>
<script>
export default {
name: 'ChangeField',
props: {
label: {
type: String,
default: null
},
prop: {
type: String,
default: null
},
newData: {
type: Object,
default: () => {
return {}
}
},
oldData: {
type: Object,
default: () => {
return {}
}
}
},
computed: {
oldValue() {
return this.oldData == null ? null : this.oldData[this.prop]
},
newValue() {
return this.newData == null ? null : this.newData[this.prop]
}
}
}
</script>
<style scoped lang="scss">
.change-field {
width: 100%;
padding: 0.5em 1em;
font-size: 14px;
display: flex;
height: fit-content;
line-height: 1.5em;
justify-content: space-between;
.label {
width: fit-content;
}
.right-box {
flex: 1;
text-align: right;
display: flex;
flex-direction: row;
justify-content: flex-end;
vertical-align: center;
}
i {
line-height: 1.5em;
margin: 0 0.5em;
}
}
.change-field:nth-child(n +2) {
border-top: 1px solid #ededed;
}
.change-field:hover {
background-color: rgba(136, 131, 240, 0.08);
}
.no-same {
color: red;
}
</style>

View File

@ -0,0 +1,125 @@
<template>
<div v-loading="loading" style="padding: 1em">
<el-row :gutter="12">
<el-col :span="span">
<el-card class="box-card" header="申请信息">
<el-descriptions :column="2">
<el-descriptions-item label="店铺">{{detail.storeName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="申请人">{{detail.userName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="提交时间">{{detail.createTime | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="申请类型">
<dict-tag :options="dict.type.store_apply_type" :value="detail.applyType" size="small"/>
</el-descriptions-item>
<el-descriptions-item label="申请状态">
<dict-tag :options="dict.type.store_apply_status" :value="detail.status" size="small"/>
</el-descriptions-item>
<el-descriptions-item label="审核时间">{{detail.verifyTime | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="审核人">{{detail.verifyName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="审核意见">{{detail.verifyRemark | defaultValue}}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card" header="变更字段">
<ul class="list-group list-group-striped" style="margin-top: 0">
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="店铺名称" prop="name" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="店铺图片" prop="picture" >
<template #old="{value}">
<image-preview :width="24" :height="24" :src="value"/>
</template>
<template #new="{value}">
<image-preview :width="24" :height="24" :src="value"/>
</template>
</change-field>
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="地址" prop="address" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="经度" prop="lng" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="纬度" prop="lat" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="营业时间(起始)" prop="businessTimeStart" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="营业时间(结束)" prop="businessTimeEnd" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="省" prop="province" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="市" prop="city" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="区" prop="county" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="店铺类型" prop="type" >
<template #old="{value}">
<dict-tag :value="value" :options="dict.type.ss_store_type" size="small"/>
</template>
<template #new="{value}">
<dict-tag :value="value" :options="dict.type.ss_store_type" size="small"/>
</template>
</change-field>
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="联系人" prop="contactName" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="联系电话" prop="contactMobile" />
<change-field :new-data="detail.newData" :old-data="detail.oldData" label="是否展示" prop="show">
<template #old="{value}">
{{value ? '是' : '否'}}
</template>
<template #new="{value}">
{{value ? '是' : '否'}}
</template>
</change-field>
</ul>
</el-card>
</el-col>
<el-col v-if="24 - span > 0" :span="24 - span">
<el-card header="审核操作">
<el-form :model="form">
</el-form>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { getStoreApply } from '@/api/ss/storeApply'
import { StoreApplyStatus } from '@/utils/constants'
import ChangeField from '@/views/ss/storeApply/component/ChangeField.vue'
export default {
name: "StoreApplyDetail",
components: { ChangeField },
dicts: ['store_apply_type', 'store_apply_status', 'ss_store_type'],
props: {
id: {
type: String,
default: null,
}
},
data() {
return {
loading: false,
detail: {
oldData: {},
newData: {}
},
form: {}
}
},
computed: {
span() {
if (this.detail.status === StoreApplyStatus.WAIT_AUDIT) {
return 14;
}
return 24;
}
},
watch: {
id(nv, ov) {
this.getDetail(nv)
}
},
created() {
this.getDetail(this.id);
},
methods: {
getDetail(id) {
this.loading = true;
getStoreApply(id).then(res => {
this.detail = res.data;
}).finally(() => {
this.loading = false;
})
}
}
}
</script>

View File

@ -0,0 +1,405 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="审核类型" prop="applyType">
<el-select v-model="queryParams.applyType" placeholder="请选择审核类型" clearable @change="handleQuery">
<el-option
v-for="dict in dict.type.store_apply_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="审核状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable @change="handleQuery">
<el-option
v-for="dict in dict.type.store_apply_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="店铺名称" prop="storeName">
<el-input
v-model="queryParams.storeName"
placeholder="请输入店铺名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="提交人" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入提交人名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核人" prop="verifyName">
<el-input
v-model="queryParams.verifyName"
placeholder="请输入审核人名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核意见" prop="verifyRemark">
<el-input
v-model="queryParams.verifyRemark"
placeholder="请输入审核意见"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['ss:storeApply:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['ss:storeApply:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['ss:storeApply:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['ss:storeApply:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="storeApplyList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
<el-table-column type="selection" width="55" align="center" />
<template v-for="column of showColumns">
<el-table-column
:key="column.key"
:label="column.label"
:prop="column.key"
:align="column.align"
:min-width="column.minWidth"
:sort-orders="orderSorts"
:sortable="column.sortable"
:show-overflow-tooltip="column.overflow"
:width="column.width"
>
<template slot-scope="d">
<template v-if="column.key === 'id'">
{{d.row[column.key]}}
</template>
<template v-else-if="column.key === 'applyType'">
<dict-tag :options="dict.type.store_apply_type" :value="d.row[column.key]"/>
</template>
<template v-else-if="column.key === 'status'">
<dict-tag :options="dict.type.store_apply_status" :value="d.row[column.key]"/>
</template>
<template v-else-if="column.key === 'storeName'">
<store-link :id="d.row.storeId" :name="d.row.storeName"/>
</template>
<template v-else-if="column.key === 'userName'">
<user-link :id="d.row.userId" :name="d.row.userName"/>
</template>
<template v-else>
{{d.row[column.key]}}
</template>
</template>
</el-table-column>
</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-view"
@click="handleView(scope.row)"
v-hasPermi="['ss:storeApply:query']"
>详情</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['ss:storeApply:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['ss:storeApply:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!--详情-->
<el-drawer
:with-header="false"
:visible.sync="showDetail"
direction="rtl"
size="1280px"
destroy-on-close
>
<store-apply-detail :id="row.id"/>
</el-drawer>
</div>
</template>
<script>
import { listStoreApply, getStoreApply, delStoreApply, addStoreApply, updateStoreApply } from "@/api/ss/storeApply";
import { $showColumns } from '@/utils/mixins';
import StoreLink from '@/components/Business/Store/StoreLink.vue'
import UserLink from '@/components/Business/SmUser/UserLink.vue'
import StoreApplyDetail from '@/views/ss/storeApply/detail.vue'
//
const defaultSort = {
prop: "createTime",
order: "descending"
}
export default {
name: "StoreApply",
components: { StoreApplyDetail, UserLink, StoreLink },
mixins: [$showColumns],
dicts: ['store_apply_type', 'store_apply_status'],
data() {
return {
showDetail: false,
row: {},
//
columns: [
{key: 'id', visible: true, label: '申请ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "120"},
{key: 'storeName', visible: true, label: '店铺', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'applyType', visible: true, label: '申请类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
{key: 'status', visible: true, label: '申请状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
{key: 'userName', visible: true, label: '提交人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'createTime', visible: true, label: '提交时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
{key: 'verifyName', visible: true, label: '审核人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'verifyTime', visible: true, label: '审核时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
{key: 'verifyRemark', visible: true, label: '审核意见', minWidth: null, sortable: true, overflow: true, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
storeApplyList: [],
//
title: "",
//
open: false,
defaultSort,
//
queryParams: {
pageNum: 1,
pageSize: 10,
orderByColumn: defaultSort.prop,
isAsc: defaultSort.order,
id: null,
applyType: null,
status: null,
storeId: null,
userId: null,
verifyId: null,
verifyRemark: null,
},
//
form: {},
//
rules: {
applyType: [
{ required: true, message: "审核类型不能为空", trigger: "change" }
],
storeId: [
{ required: true, message: "店铺id不能为空", trigger: "blur" }
],
createTime: [
{ required: true, message: "提交审核的时间不能为空", trigger: "blur" }
],
userId: [
{ required: true, message: "提交人id不能为空", trigger: "blur" }
],
newData: [
{ required: true, message: "新数据json不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 当排序按钮被点击时触发 **/
onSortChange(column) {
if (column.order == null) {
this.queryParams.orderByColumn = defaultSort.prop;
this.queryParams.isAsc = defaultSort.order;
} else {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
}
this.getList();
},
/** 查询店铺审核列表 */
getList() {
this.loading = true;
listStoreApply(this.queryParams).then(response => {
this.storeApplyList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
applyType: null,
status: null,
storeId: null,
createTime: null,
userId: null,
verifyId: null,
verifyTime: null,
verifyRemark: null,
oldData: null,
newData: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加店铺审核";
},
handleView(row) {
this.row = row;
this.showDetail = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStoreApply(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) {
updateStoreApply(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStoreApply(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除店铺审核编号为"' + ids + '"的数据项?').then(function() {
return delStoreApply(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ss/storeApply/export', {
...this.queryParams
}, `storeApply_${new Date().getTime()}.xlsx`)
}
}
};
</script>