Merge branch 'master' of https://e.coding.net/g-cphe0354/cashier/cashier-web into ymf
This commit is contained in:
commit
8026fcb98c
|
|
@ -1,147 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<!-- XXX模块 -->
|
||||||
<div class="head-container">
|
<div style="padding: 15px;">
|
||||||
<el-button type="primary" icon="plus" @click="$refs.addActive.show()">添加活动</el-button>
|
<!-- 表格 -->
|
||||||
<el-button type="primary" icon="download" @click="$refs.downloadQR.show()">
|
<Content></Content>
|
||||||
下载会员充值二维码
|
|
||||||
</el-button>
|
|
||||||
<div style="margin-top: 35px; font-size: 16px; color: #333">
|
|
||||||
允许充值自定义金额:
|
|
||||||
<el-switch
|
|
||||||
v-model="shopInfo.isCustom"
|
|
||||||
active-value="1"
|
|
||||||
inactive-value="0"
|
|
||||||
size="large"
|
|
||||||
@change="customStatusChange"
|
|
||||||
></el-switch>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
|
||||||
<el-table-column label="店铺ID" prop="shopId"></el-table-column>
|
|
||||||
<el-table-column label="充值金额" prop="amount"></el-table-column>
|
|
||||||
<el-table-column label="赠送金额" prop="giftAmount"></el-table-column>
|
|
||||||
<el-table-column label="赠送积分" prop="giftPoints"></el-table-column>
|
|
||||||
<el-table-column label="是否使用优惠券" prop="isUseCoupon">
|
|
||||||
<template v-slot="scope">
|
|
||||||
{{ scope.row.isUseCoupon == 1 ? "是" : "否" }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="120">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button type="text" icon="edit" @click="$refs.addActive.show(scope.row)">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-pagination
|
|
||||||
:total="tableData.total"
|
|
||||||
:current-page="tableData.page + 1"
|
|
||||||
:page-size="tableData.size"
|
|
||||||
@current-change="paginationChange"
|
|
||||||
layout="total"
|
|
||||||
></el-pagination>
|
|
||||||
</div>
|
|
||||||
<addActive ref="addActive" @success="getTableData" />
|
|
||||||
<QR ref="downloadQR"></QR>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup>
|
||||||
<script>
|
import Content from './indexconfig/Content.vue'
|
||||||
import handselTypes from "./handselTypes";
|
|
||||||
import addActive from "./components/addActive.vue";
|
|
||||||
import QR from "./components/downloadQR.vue";
|
|
||||||
import activeApi from "@/api/account/activate";
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
addActive,
|
|
||||||
QR,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
query: {
|
|
||||||
shopId: "",
|
|
||||||
},
|
|
||||||
tableData: {
|
|
||||||
data: [],
|
|
||||||
page: 0,
|
|
||||||
size: 10,
|
|
||||||
loading: false,
|
|
||||||
total: 0,
|
|
||||||
},
|
|
||||||
shopInfo: {
|
|
||||||
isCustom: "0",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
handselTypeFilter(value) {
|
|
||||||
return handselTypes.find((item) => item.value == value).label;
|
|
||||||
},
|
|
||||||
timeFilter(s) {
|
|
||||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getTableData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 切换状态
|
|
||||||
async statusChange(e, row) {
|
|
||||||
if (row.couponName) {
|
|
||||||
try {
|
|
||||||
this.tableData.loading = true;
|
|
||||||
const data = { ...row };
|
|
||||||
data.isUseCoupon = e;
|
|
||||||
console.log(data.isUseCoupon);
|
|
||||||
await storageupActivate(data);
|
|
||||||
this.getTableData();
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
this.tableData.loading = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log(22);
|
|
||||||
this.$message({
|
|
||||||
message: "请选择优惠劵",
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 重置查询
|
|
||||||
resetHandle() {
|
|
||||||
this.query.name = "";
|
|
||||||
this.query.type = "";
|
|
||||||
this.getTableData();
|
|
||||||
},
|
|
||||||
// 分页回调
|
|
||||||
paginationChange(e) {
|
|
||||||
this.tableData.page = e - 1;
|
|
||||||
this.getTableData();
|
|
||||||
},
|
|
||||||
// 获取商品列表
|
|
||||||
async getTableData() {
|
|
||||||
this.tableData.loading = true;
|
|
||||||
try {
|
|
||||||
const res = await activeApi.getList({});
|
|
||||||
this.tableData.loading = false;
|
|
||||||
this.tableData.data = res;
|
|
||||||
this.tableData.total = res.length;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
customStatusChange() {
|
|
||||||
this.updateShopInfo();
|
|
||||||
},
|
|
||||||
async updateShopInfo() {
|
|
||||||
await tbShopInfoPut(this.shopInfo);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -0,0 +1,241 @@
|
||||||
|
<template>
|
||||||
|
<div class="Table">
|
||||||
|
<!-- 按钮 -->
|
||||||
|
<AddButton @add="add"></AddButton>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<Table :list="datas.tableData" @handleDelete="handleDelete" @handleEdit="handleEdit"></Table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Paging :pagingConfig="datas.pagingConfig" @sizeChange="sizeChange" @currentChange="currentChange"></Paging>
|
||||||
|
<!-- 其他模板 -->
|
||||||
|
<!-- 新增/编辑 -->
|
||||||
|
<myDialog ref="myDialogRef" :title="datas.title" @confirm="confirm" width="40%">
|
||||||
|
<el-form ref="ruleFormRef" :rules="datas.rules" :model="datas.DialogForm" label-width="120px">
|
||||||
|
<el-form-item label="充值">
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-input v-model="datas.DialogForm.amount" :min="0" type="number" placeholder="请输入金额">
|
||||||
|
<template #prepend>满</template>
|
||||||
|
<template #append>元</template>
|
||||||
|
</el-input>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-input v-model="datas.DialogForm.giftAmount" :min="0" type="number" placeholder="请输入金额">
|
||||||
|
<template #prepend>赠</template>
|
||||||
|
<template #append>元</template>
|
||||||
|
</el-input>
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="积分">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-input v-model="datas.DialogForm.giftPoints" :min="0" type="number" placeholder="请输入积分">
|
||||||
|
<template #prepend>赠送</template>
|
||||||
|
<template #append>积分</template>
|
||||||
|
</el-input>
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是否使用优惠券">
|
||||||
|
<el-switch v-model="datas.DialogForm.isGiftCoupon" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<template v-if="datas.DialogForm.isGiftCoupon == 1">
|
||||||
|
<el-form-item label="选择优惠卷">
|
||||||
|
<el-button type="primary" @click="addgoods();">添加优惠券</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-for="(item, index) in datas.DialogForm.coupons" :label="item.title">
|
||||||
|
<el-input-number v-model="item.number" controls-position="right" placeholder="请输入数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
|
</myDialog>
|
||||||
|
<shopList ref="shopListRef" @success="selectShopRes" />
|
||||||
|
<!-- 选择图片 -->
|
||||||
|
<AddImg ref="addImg" @successEvent="successEvent"></AddImg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import AddButton from './component/AddButton.vue'
|
||||||
|
import Table from './component/Table.vue'
|
||||||
|
import Paging from './component/Paging.vue'
|
||||||
|
import myDialog from '@/components/mycomponents/myDialog.vue'
|
||||||
|
import eventBus from '@/utils/eventBus'
|
||||||
|
import API from './api'
|
||||||
|
import ShopList from './component/shopList.vue'
|
||||||
|
|
||||||
|
const datas = reactive({
|
||||||
|
tableData: [], // 表格数据
|
||||||
|
title: '新增数据',
|
||||||
|
pagingConfig: {
|
||||||
|
total: 0, // 总数
|
||||||
|
pageSize: 10, // 每页数据数量
|
||||||
|
pageNumber: 1, // 当前页码
|
||||||
|
},
|
||||||
|
DialogForm: { // 弹窗表单数据
|
||||||
|
name: "",
|
||||||
|
telephone: "",
|
||||||
|
address: "",
|
||||||
|
remark: "",
|
||||||
|
coupons: [],
|
||||||
|
},
|
||||||
|
// 优惠券
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '请输入供应商名称', trigger: 'blur' },
|
||||||
|
{ min: 3, max: 5, message: 'Length should be 3 to 5', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const myDialogRef = ref(null)
|
||||||
|
const ruleFormRef = ref(null)
|
||||||
|
const shopListRef = ref(null)
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
eventBus.on('search', (res) => {
|
||||||
|
getList(res)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
function selectShopRes(item) {
|
||||||
|
datas.DialogForm.coupons = item
|
||||||
|
}
|
||||||
|
function addgoods() {
|
||||||
|
shopListRef.value.opens()
|
||||||
|
}
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
eventBus.off('search')
|
||||||
|
})
|
||||||
|
async function getList(data = {}) {
|
||||||
|
const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data })
|
||||||
|
datas.tableData = res
|
||||||
|
datas.pagingConfig.total = res.totalRow
|
||||||
|
datas.pagingConfig.pageSize = res.pageSize
|
||||||
|
datas.pagingConfig.pageNumber = res.pageNumber
|
||||||
|
}
|
||||||
|
function add() {
|
||||||
|
if (datas.DialogForm.id) {
|
||||||
|
rest()
|
||||||
|
}
|
||||||
|
datas.title = '新增数据'
|
||||||
|
myDialogRef.value.open()
|
||||||
|
}
|
||||||
|
async function handleEdit(row) {
|
||||||
|
datas.title = '编辑数据'
|
||||||
|
datas.DialogForm = row
|
||||||
|
datas.DialogForm.coupons = row.couponList
|
||||||
|
// 有图片
|
||||||
|
// datas.DialogForm.goodsImageUrl = res.goodsImageUrl.split(',')
|
||||||
|
myDialogRef.value.open()
|
||||||
|
}
|
||||||
|
async function confirm() {
|
||||||
|
ruleFormRef.value.validate(async valid => {
|
||||||
|
if (valid) {
|
||||||
|
let res = null
|
||||||
|
let obj = {}
|
||||||
|
datas.DialogForm.coupons.forEach(element => {
|
||||||
|
obj[element.id] = element.number
|
||||||
|
});
|
||||||
|
datas.DialogForm.coupons = JSON.stringify(obj)
|
||||||
|
if (datas.title == '新增数据') {
|
||||||
|
// 图片处理
|
||||||
|
// datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||||
|
res = await API.add(datas.DialogForm)
|
||||||
|
} else {
|
||||||
|
// datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||||
|
res = await API.update(datas.DialogForm)
|
||||||
|
}
|
||||||
|
if (res) {
|
||||||
|
ElMessage({
|
||||||
|
message: '成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
rest()
|
||||||
|
getList()
|
||||||
|
myDialogRef.value.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 重置
|
||||||
|
function rest() {
|
||||||
|
datas.DialogForm = { sort: 1, images: [] }
|
||||||
|
}
|
||||||
|
async function handleDelete(id) {
|
||||||
|
ElMessageBox.confirm("是否删除数据项?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(
|
||||||
|
async () => {
|
||||||
|
let res = await API.deleteByIds(id)
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 图片
|
||||||
|
const addImg = ref(null)
|
||||||
|
function addimgEvent() {
|
||||||
|
(addImg.value)?.show()
|
||||||
|
}
|
||||||
|
function successEvent(d) {
|
||||||
|
datas.DialogForm['images'].push(d[0].url);
|
||||||
|
}
|
||||||
|
function deleteEvent(d) {
|
||||||
|
let index = datas.DialogForm.images.findIndex((ele) => ele == d);
|
||||||
|
datas.DialogForm.images.splice(index, 1);
|
||||||
|
}
|
||||||
|
// 分页
|
||||||
|
function sizeChange(val) {
|
||||||
|
datas.pagingConfig.pageSize = val
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
function currentChange(val) {
|
||||||
|
datas.pagingConfig.pageNumber = val
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.Table {
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #e4e7ed;
|
||||||
|
margin-top: 20px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 图片库样式
|
||||||
|
.showStyle:hover>.buttonstyle {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upImgStyle {
|
||||||
|
cursor: pointer;
|
||||||
|
width: 148px;
|
||||||
|
height: 148px;
|
||||||
|
line-height: 148px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px dashed #ccc;
|
||||||
|
border-radius: 1%;
|
||||||
|
font-size: 30px;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonstyle {
|
||||||
|
border-radius: 50%;
|
||||||
|
color: #db1616;
|
||||||
|
background-color: #fff;
|
||||||
|
font-size: 20px;
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
top: -10px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
const baseURL = "/account/admin/activate";
|
||||||
|
// XXX-配置
|
||||||
|
const AuthAPI = {
|
||||||
|
// 列表
|
||||||
|
getList(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/list`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 分页*/
|
||||||
|
getPage(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 新增
|
||||||
|
add(data: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "post",
|
||||||
|
data: { ...data },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 详情
|
||||||
|
getinfo(id: number) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/${id}`,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 编辑
|
||||||
|
update(data: Object) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "put",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteByIds(id: number | String) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/${id}`,
|
||||||
|
method: "delete",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
export interface Responseres {
|
||||||
|
code?: number | null;
|
||||||
|
data?: any;
|
||||||
|
msg?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AuthAPI;
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
<template>
|
||||||
|
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
|
||||||
|
<el-button type="primary" icon="Plus" @click="addEvent">下载会员充值二维码</el-button>
|
||||||
|
<br />
|
||||||
|
<div style="margin-top: 10px;">
|
||||||
|
允许充值自定义金额: <el-switch v-model="value2" class="ml-2" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
const router = useRouter();
|
||||||
|
const emit = defineEmits(['add']);
|
||||||
|
function toUrl(name) {
|
||||||
|
router.push({ name });
|
||||||
|
}
|
||||||
|
function addEvent() {
|
||||||
|
emit('add');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-top: 10px;">
|
||||||
|
<el-pagination background :page-size="props.pagingConfig.pageSize" :page-sizes="[10, 20, 30, 40]"
|
||||||
|
layout="prev,pager,next,jumper,total,sizes" v-model:current-page="props.pagingConfig.pageNumber"
|
||||||
|
:total="props.pagingConfig.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
pagingConfig: {
|
||||||
|
type: Object,
|
||||||
|
default: () => { }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['sizeChange', 'currentChange'])
|
||||||
|
// 当前条改变
|
||||||
|
function handleSizeChange(val) {
|
||||||
|
emit('sizeChange', val)
|
||||||
|
}
|
||||||
|
// 当前页改变
|
||||||
|
function handleCurrentChange(val) {
|
||||||
|
emit('currentChange', val)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-top: 10px;">
|
||||||
|
<el-table :data="props.list" border style="width: 100%">
|
||||||
|
<el-table-column prop="id" align="center" label="店铺ID" />
|
||||||
|
<el-table-column prop="amount" align="center" label="充值金额" />
|
||||||
|
<el-table-column prop="giftAmount" align="center" label="赠送金额" />
|
||||||
|
<el-table-column prop="giftPoints" align="center" label="赠送积分" />
|
||||||
|
<el-table-column prop="isGiftCoupon" align="center" label="是否使用优惠卷">
|
||||||
|
<template v-slot="scope">
|
||||||
|
{{ scope.row.isGiftCoupon == 0 ? '否' : '是' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button size="small" type="primary" link icon="Edit" @click="handleEdit(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const emit = defineEmits(['handleDelete', 'handleEdit'])
|
||||||
|
const props = defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function handleEdit(row) {
|
||||||
|
emit('handleEdit', row)
|
||||||
|
}
|
||||||
|
function handleDelete(index, row) {
|
||||||
|
emit('handleDelete', row.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
<template>
|
||||||
|
<myDialog title="选择优惠卷" width="50%" ref="myDialogRef" @Confirm="subitgood">
|
||||||
|
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
||||||
|
@reset-click="handleResetClick" />
|
||||||
|
<page-content ref="contentRef" :content-config="contentConfig" @filter-change="handleFilterChange">
|
||||||
|
<template #status="scope">
|
||||||
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
<template #gender="scope">
|
||||||
|
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
||||||
|
</template>
|
||||||
|
<template #timemanagement="scope">
|
||||||
|
{{ scope.row.startTime }}-{{ scope.row.endTime }}
|
||||||
|
</template>
|
||||||
|
<template #mobile="scope">
|
||||||
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
|
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||||
|
</template>
|
||||||
|
</page-content>
|
||||||
|
</myDialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import myDialog from '@/components/mycomponents/myDialog.vue'
|
||||||
|
import usePage from "@/components/CURD/usePage";
|
||||||
|
import searchConfig from "./shopListconfig/search"
|
||||||
|
import contentConfig from "./shopListconfig/content2";
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchRef,
|
||||||
|
contentRef,
|
||||||
|
addModalRef,
|
||||||
|
editModalRef,
|
||||||
|
handleQueryClick,
|
||||||
|
handleResetClick,
|
||||||
|
// handleAddClick,
|
||||||
|
// handleEditClick,
|
||||||
|
handleSubmitClick,
|
||||||
|
handleExportClick,
|
||||||
|
handleSearchClick,
|
||||||
|
handleFilterChange,
|
||||||
|
} = usePage();
|
||||||
|
let myDialogRef: any = ref(null)
|
||||||
|
function opens() {
|
||||||
|
myDialogRef.value.open()
|
||||||
|
}
|
||||||
|
const emit = defineEmits(['success'])
|
||||||
|
// 添加商品的回调
|
||||||
|
function subitgood() {
|
||||||
|
emit('success', contentRef.value?.getselectTable())
|
||||||
|
myDialogRef.value.close()
|
||||||
|
}
|
||||||
|
defineExpose({ opens })
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
import type { IContentConfig } from "@/components/CURD/types";
|
||||||
|
import UserAPI from "@/api/account/coupon";
|
||||||
|
|
||||||
|
const contentConfig: IContentConfig = {
|
||||||
|
pageName: "sys:user",
|
||||||
|
table: {
|
||||||
|
showOverflowTooltip: true,
|
||||||
|
},
|
||||||
|
toolbar: [],
|
||||||
|
pagination: {
|
||||||
|
background: true,
|
||||||
|
layout: "prev,pager,next,jumper,total,sizes",
|
||||||
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 30, 50],
|
||||||
|
},
|
||||||
|
indexAction: function (params) {
|
||||||
|
return UserAPI.getList(params);
|
||||||
|
},
|
||||||
|
modifyAction(data) {
|
||||||
|
// 模拟发起网络请求修改字段
|
||||||
|
// console.log("modifyAction:", data);
|
||||||
|
ElMessage.success(JSON.stringify(data));
|
||||||
|
return Promise.resolve(null);
|
||||||
|
},
|
||||||
|
|
||||||
|
cols: [
|
||||||
|
{ type: "selection", width: 50, align: "center" },
|
||||||
|
// { label: "封面图", align: "center", prop: "coverImg", templet: "image" },
|
||||||
|
{ label: "名称", align: "center", prop: "title" },
|
||||||
|
{ label: "已使用数量", align: "center", prop: "useNumber", },
|
||||||
|
{ label: "剩余数量", align: "center", prop: "leftNumber", },
|
||||||
|
{ label: "有效天数", align: "center", prop: "validDays", },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default contentConfig;
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
import DeptAPI from "@/api/product/specificationsconfig";
|
||||||
|
|
||||||
|
import type { ISearchConfig } from "@/components/CURD/types";
|
||||||
|
|
||||||
|
const searchConfig: ISearchConfig = {
|
||||||
|
pageName: "sys:user",
|
||||||
|
formItems: [
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "优惠卷类型",
|
||||||
|
prop: "categoryId",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择商品分类",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: [{ label: "满减", value: "1" }, { label: "商品", value: "2" },],
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default searchConfig;
|
||||||
Loading…
Reference in New Issue