<template>
|
<div class="page_status">
|
<v-header
|
title="订单管理"
|
:bar="bar"
|
search
|
@on-search="onSearch"
|
></v-header>
|
<div class="tab">
|
<v-tool-table :trs="trs" :tds="tds">
|
<template v-slot:btn="item">
|
<div class="table_flex">
|
<!-- {{item.scope.id}} -->
|
|
<span
|
v-if="item.scope.cancelType == 0"
|
class="col_primary"
|
@click="onCheck(item.scope.id)"
|
>核销</span
|
>
|
<span class="col_primary" @click="onDel(item.scope.id)">删除</span>
|
</div>
|
</template>
|
<template v-slot:cancelType="item">
|
<b>{{ ["未核销", "已核销"][item.scope.cancelType] || "无" }}</b>
|
</template>
|
<template v-slot:coverImgUrl="item">
|
<el-image
|
:src="item.scope.coverImgUrl"
|
style="width: 100px;"
|
:fit="fill"
|
:preview-src-list="[item.scope.coverImgUrl]"
|
></el-image>
|
</template>
|
</v-tool-table>
|
</div>
|
<v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
|
</div>
|
</template>
|
|
<script>
|
import { mapState } from "vuex";
|
import MapBox from "../../../components/map/map.vue";
|
|
export default {
|
props: {},
|
components: { MapBox },
|
data() {
|
return {
|
// communityId:"1552661944182378497"
|
// cancelType: "0"
|
// creationTime: "2023-08-29T01:21:24.000+00:00"
|
// cancelTime: null
|
// good_num: null
|
// goodsId: "1"
|
// goodName: "燃面"
|
// coverImgUrl: "https://www.psciio.com/idcard/433f43eb39724fa99336e815404789c4.jpg"
|
// id: "3"
|
// goodPrice: "100"
|
// orderNumber: "1696332022248771584"
|
// updateTime: null
|
// userId: "1552661597934194690"
|
// name: "赵东明"
|
// phone: "15208114722"
|
bar: [
|
{ title: "商品ID", name: "id" },
|
{ title: "订单号", name: "orderNumber" },
|
{ title: "商品名称", name: "goodName" },
|
{ title: "姓名", name: "name" },
|
{
|
title: "核销状态",
|
name: "cancelType",
|
type: "select",
|
list: [
|
{ label: "已核销", value: "1" },
|
{ label: "未核销", value: "0" }
|
]
|
}
|
],
|
trs: [
|
{ text: "序号", val: "index", width: "50px" },
|
{ text: "订单号", val: "orderNumber", width: "50px" },
|
{ text: "商品ID", val: "id", width: "50px" },
|
{ text: "商品名称", val: "goodName" },
|
{ text: "商品图片", val: "btn", slot: "coverImgUrl" },
|
{ text: "商品价格(金汇币)", val: "goodPrice", width: "100px" },
|
{ text: "姓名", val: "name" },
|
{ text: "手机号", val: "phone" },
|
{ text: "兑换时间", val: "creationTime" },
|
{ text: "核销状态", val: "btn", slot: "cancelType" },
|
{ text: "核销时间", val: "cancelTime" },
|
{ text: "操作", val: "btn" }
|
],
|
tds: [],
|
paged: { page: 0, total: 0, r: 0, limit: 10 },
|
os: {},
|
search: {},
|
dialogVisibleMap: false,
|
positionData: {},
|
radioList: [
|
{ label: "每天", value: "每天" },
|
{ label: "周一~周五", value: "周一~周五" },
|
{ label: "周六周日", value: "周六周日" }
|
],
|
exchangeDay: "",
|
address: "",
|
lat: "",
|
lng: "",
|
beginTime: "",
|
endTime: ""
|
};
|
},
|
computed: {
|
...mapState({ vuex_page: "pageReset" })
|
},
|
watch: {
|
vuex_page: {
|
handler(n) {
|
if (n.page === this.$route.path) {
|
this.paged.page = 1;
|
this.init();
|
}
|
},
|
deep: true
|
}
|
},
|
methods: {
|
onSearch(v) {
|
this.search = demo.copy(v);
|
delete this.search.time;
|
this.paged.page = 1;
|
this.init();
|
},
|
// 分页点击
|
onPage(v) {
|
if (v.page === this.paged.page && v.page && !v.reset) {
|
return 0;
|
}
|
this.paged.page = v.page;
|
this.paged.limit = v.limit;
|
this.init();
|
},
|
// 获取数据
|
init() {
|
let v = demo.copy(
|
Object.assign(this.os, this.search, {
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit
|
})
|
);
|
this.$api.get("Jinhui/orderGetList", v, e => {
|
this.paged.total = e.total;
|
this.paged.r++;
|
this.tds = e.records || [];
|
e.records.map((item, index) => {
|
item.index = (this.paged.page - 1) * this.paged.limit + index + 1;
|
item.creationTime = this.$$moment(item.creationTime).format(
|
"YYYY-MM-DD HH:mm:ss"
|
);
|
});
|
});
|
},
|
onDel(id) {
|
this.$js.model("", "是否删除", res => {
|
if (res) {
|
this.$api.del("Jinhui/orderExpurgateData?id=" + id, {}, () => {
|
demo.toast("删除成功");
|
this.init();
|
});
|
}
|
});
|
},
|
onCheck(id) {
|
this.$js.model("", "是否核销", res => {
|
if (res) {
|
this.$api.get("Jinhui/orderCheck", { id }, () => {
|
demo.toast("核销成功");
|
this.init();
|
});
|
}
|
});
|
},
|
|
handleCloseMap() {
|
this.dialogVisibleMap = false;
|
this.positionData = {};
|
},
|
setLocation(data) {
|
this.positionData = data;
|
},
|
setTime() {
|
this.dialogVisibleMap = true;
|
this.$nextTick(() => {
|
this.$refs.mapContent.getLocation({
|
val: this.address,
|
l: this.lat,
|
r: this.lng
|
});
|
});
|
},
|
mapComfirm() {}
|
},
|
mounted() {
|
//查询动态分类列表
|
}
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.page_status {
|
overflow-y: auto;
|
.add,
|
.tab {
|
margin-bottom: 10px;
|
}
|
}
|
.radioBox {
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
.radioBox_title {
|
margin-right: 20px;
|
}
|
}
|
</style>
|