2024-12-04 11:08:06 +00:00
|
|
|
<template>
|
2024-12-06 11:14:50 +00:00
|
|
|
<div style="height: calc(100vh - 200px)">
|
|
|
|
<obj-table-plus
|
|
|
|
ref="oTable"
|
|
|
|
style="height: 100%"
|
|
|
|
:tableCols="tableCols"
|
|
|
|
:tableProp="tableProp"
|
|
|
|
@query="queryList"
|
|
|
|
v-model="dataList"
|
|
|
|
:tableEvent="tableEvent"
|
|
|
|
:enableAutoQuery="false"
|
|
|
|
>
|
|
|
|
<template slot="tableTop">
|
|
|
|
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
2024-12-15 09:35:41 +00:00
|
|
|
<el-form-item v-if="storeList.length > 1" label="商铺">
|
|
|
|
<el-select v-model="formInline.shopId" placeholder="请选择">
|
|
|
|
<el-option
|
|
|
|
v-for="item in storeList"
|
|
|
|
:key="item.shopId"
|
|
|
|
:label="item.shopName"
|
|
|
|
:value="item.shopId"
|
|
|
|
>
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
2024-12-06 11:14:50 +00:00
|
|
|
<el-form-item label="商品ID">
|
|
|
|
<el-input
|
|
|
|
placeholder="请输入商品ID"
|
2024-12-15 09:35:41 +00:00
|
|
|
v-model="formInline.productId"
|
2024-12-06 11:14:50 +00:00
|
|
|
></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="商品名称">
|
|
|
|
<el-input
|
|
|
|
placeholder="请输入商品名称"
|
2024-12-15 09:35:41 +00:00
|
|
|
v-model="formInline.productName"
|
2024-12-06 11:14:50 +00:00
|
|
|
></el-input>
|
|
|
|
</el-form-item>
|
2024-12-15 09:35:41 +00:00
|
|
|
<el-form-item label="兑换状态">
|
|
|
|
<el-select v-model="formInline.redeemEnable" placeholder="请选择">
|
2024-12-06 11:14:50 +00:00
|
|
|
<el-option
|
2024-12-15 09:35:41 +00:00
|
|
|
v-for="item in [
|
|
|
|
{ value: true, label: '启用' },
|
|
|
|
{ value: false, label: '禁用' },
|
|
|
|
]"
|
2024-12-06 11:14:50 +00:00
|
|
|
:key="item.marketId"
|
|
|
|
:label="item.marketName"
|
|
|
|
:value="item.marketId"
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
2024-12-15 09:35:41 +00:00
|
|
|
<!-- <el-form-item label="积分数量">
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-input-number
|
|
|
|
style="width: 150px"
|
|
|
|
controls-position="right"
|
|
|
|
:precision="0"
|
|
|
|
v-model="formInline.oneGoodsViewPoints"
|
|
|
|
:min="0"
|
|
|
|
label="请输入"
|
|
|
|
></el-input-number>
|
|
|
|
</el-col>
|
|
|
|
<el-col class="line" :span="2">-</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-input-number
|
|
|
|
style="width: 150px"
|
|
|
|
controls-position="right"
|
|
|
|
:precision="0"
|
|
|
|
v-model="formInline.oneGoodsViewPoints"
|
|
|
|
:min="0"
|
|
|
|
label="请输入"
|
|
|
|
></el-input-number>
|
|
|
|
</el-col>
|
|
|
|
</el-form-item> -->
|
2024-12-06 11:14:50 +00:00
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" @click="$refs.oTable.reload()"
|
|
|
|
>查询</el-button
|
|
|
|
>
|
|
|
|
<el-button type="primary" @click="$refs.oTable.reload()"
|
|
|
|
>重置</el-button
|
|
|
|
>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
<div class="mb-2">
|
2024-12-16 13:00:34 +00:00
|
|
|
<el-button @click="add" type="primary" size="small">+添加</el-button>
|
2024-12-06 11:14:50 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</obj-table-plus>
|
|
|
|
<!-- 添加或编辑 -->
|
2024-12-16 13:00:34 +00:00
|
|
|
<add-or-update
|
2024-12-06 11:14:50 +00:00
|
|
|
@queryList="$refs.oTable.reload()"
|
|
|
|
ref="addOrUpdate"
|
2024-12-16 13:00:34 +00:00
|
|
|
></add-or-update>
|
2024-12-06 11:14:50 +00:00
|
|
|
<!-- 查看详情 -->
|
|
|
|
<!-- <viewDetails ref="viewDetails"></viewDetails> -->
|
2024-12-04 11:08:06 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-12-16 13:00:34 +00:00
|
|
|
import AddOrUpdate from "./popup/add-or-update.vue";
|
2024-12-06 11:14:50 +00:00
|
|
|
// import viewDetails from "./popup/view-details.vue";
|
|
|
|
import { mapState } from "vuex";
|
2024-12-04 11:08:06 +00:00
|
|
|
export default {
|
2024-12-16 13:00:34 +00:00
|
|
|
components: { AddOrUpdate },
|
2024-12-06 11:14:50 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
dataList: [],
|
|
|
|
formInline: {
|
|
|
|
marketId: "",
|
|
|
|
shopId: "",
|
|
|
|
unitType: "",
|
|
|
|
},
|
|
|
|
tableProp: {
|
|
|
|
"auto-resize": true,
|
|
|
|
border: true,
|
|
|
|
height: "auto",
|
|
|
|
"row-id": "id",
|
|
|
|
"show-overflow": false,
|
|
|
|
},
|
|
|
|
productFilterType: "SALE",
|
|
|
|
selectList: [],
|
|
|
|
value1: [],
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.formInline = {
|
|
|
|
unitType: JSON.parse(sessionStorage.getItem("userInfo")).unitType,
|
|
|
|
marketId: this.marketId,
|
2024-12-15 09:35:41 +00:00
|
|
|
shopId: this.shopId,
|
2024-12-06 11:14:50 +00:00
|
|
|
};
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.oTable.reload();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getData() {
|
2024-12-15 09:35:41 +00:00
|
|
|
this.$api.marketing.PointsProductPage(this.formInline).then((res) => {
|
|
|
|
this.storeList = res.data.data;
|
|
|
|
// this.formInline.shopId = res.data.data[0].shopId;
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.oTable.reload();
|
2024-12-06 11:14:50 +00:00
|
|
|
});
|
2024-12-15 09:35:41 +00:00
|
|
|
});
|
2024-12-06 11:14:50 +00:00
|
|
|
},
|
|
|
|
queryList(pageNo, pageSize) {
|
|
|
|
this.$api.marketing
|
2024-12-15 09:35:41 +00:00
|
|
|
.PointsProductPage({
|
2024-12-06 11:14:50 +00:00
|
|
|
pageNumber: pageNo,
|
|
|
|
pageSize: pageSize,
|
|
|
|
...this.formInline,
|
|
|
|
})
|
|
|
|
.then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
this.$refs.oTable.complete(
|
|
|
|
res.data.data.data,
|
|
|
|
Number(res.data.data.total)
|
|
|
|
);
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
this.$refs.oTable.complete(false);
|
|
|
|
});
|
|
|
|
},
|
2024-12-16 13:00:34 +00:00
|
|
|
add() {
|
|
|
|
this.$refs.addOrUpdate.toggle().add();
|
|
|
|
},
|
2024-12-06 11:14:50 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
tableCols() {
|
|
|
|
return [
|
|
|
|
{ type: "checkbox", width: "60px", fixed: "left" },
|
|
|
|
// { type: "seq", width: "60px", align: "center", title: "序号" },
|
|
|
|
{
|
|
|
|
title: "商品ID",
|
|
|
|
align: "center",
|
2024-12-15 09:35:41 +00:00
|
|
|
field: "productId",
|
2024-12-06 11:14:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "商品名称",
|
|
|
|
align: "center",
|
|
|
|
field: "publisher",
|
|
|
|
type: "jsx",
|
|
|
|
render: ({ row }) => {
|
|
|
|
if (row.publisher === "MERCHANT") {
|
|
|
|
return <span>店铺</span>;
|
|
|
|
} else if (row.publisher == "PLATFORM") {
|
|
|
|
return <span>平台</span>;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "兑换积分",
|
|
|
|
align: "center",
|
|
|
|
field: "name",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "剩余兑换库存",
|
|
|
|
align: "center",
|
|
|
|
field: "name",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "兑换状态",
|
|
|
|
align: "center",
|
|
|
|
field: "name",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "已兑换数",
|
|
|
|
align: "center",
|
|
|
|
field: "name",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "操作",
|
|
|
|
fixed: "right",
|
|
|
|
type: "jsx",
|
|
|
|
align: "center",
|
|
|
|
width: "140px",
|
|
|
|
render: (row) => {
|
|
|
|
let edit = () => {
|
|
|
|
// this.$refs.viewDetails.toggle(row).update();
|
|
|
|
};
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<el-button size="mini" type="primary" onClick={edit}>
|
|
|
|
编辑
|
|
|
|
</el-button>
|
|
|
|
<el-button size="mini" type="danger" onClick={edit}>
|
|
|
|
删除
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
},
|
|
|
|
tableEvent() {
|
|
|
|
return {
|
|
|
|
"checkbox-all": ({ records, reserves }) => {
|
|
|
|
this.selectList = [...records, ...reserves];
|
|
|
|
},
|
|
|
|
"checkbox-change": ({ records, reserves }) => {
|
|
|
|
this.selectList = [...records, ...reserves];
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
...mapState("userData", [
|
|
|
|
"isMerchant",
|
|
|
|
"marketList",
|
|
|
|
"storeList",
|
|
|
|
"marketId",
|
|
|
|
"shopId",
|
|
|
|
]),
|
|
|
|
},
|
|
|
|
};
|
2024-12-04 11:08:06 +00:00
|
|
|
</script>
|
|
|
|
|
2024-12-06 11:14:50 +00:00
|
|
|
<style lang="scss" scoped></style>
|