|
|
@@ -0,0 +1,274 @@
|
|
|
+<!-- @desc:优惠卷查看 @auth:常皓宁 @time:2024/7/29 9:15 -->
|
|
|
+<template>
|
|
|
+ <div class="main-div">
|
|
|
+ <Card class="card" style="width: 100%">
|
|
|
+ <p slot="title">
|
|
|
+ {{ $t('couponInfo') }}
|
|
|
+ </p>
|
|
|
+ <DkRow>
|
|
|
+ <Col span="8">
|
|
|
+ {{ $t('couponName') + ':' }}
|
|
|
+ <b>{{ formData.couponName }}</b>
|
|
|
+ </Col>
|
|
|
+ </DkRow>
|
|
|
+ <DkRow>
|
|
|
+ <Col span="8">
|
|
|
+ {{ $t('couponDesc') + ':' + formData.couponDesc }}
|
|
|
+ </Col>
|
|
|
+ <Col span="8">
|
|
|
+ {{ $t('discount') + ':' + formData.discount + '折' }}
|
|
|
+ </Col>
|
|
|
+ </DkRow>
|
|
|
+ <DkRow>
|
|
|
+ <Col span="8">
|
|
|
+ {{ $t('useValidDays') + ':' + formData.useValidDays + '天' }}
|
|
|
+ </Col>
|
|
|
+ <Col span="8">
|
|
|
+ {{ $t('linkValidTimes') + ':' + formData.linkValidTimes + '小时' }}
|
|
|
+ </Col>
|
|
|
+ </DkRow>
|
|
|
+ </Card>
|
|
|
+ <Card>
|
|
|
+ <DkForm ref="formInline" :col-count="4" :width="50">
|
|
|
+ <!--企业-->
|
|
|
+ <DkFormItem prop="cpId" :label="this.$t('cpName')" :span="6" :data-type="$config.dataType.number">
|
|
|
+ <SelectMagnifier v-model="cpId" :display-text="cpName"
|
|
|
+ :type="this.$config.MagnifierType.company"
|
|
|
+ :multiple="false"
|
|
|
+ @ok="clickOk"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <Button type="primary" @click="detail">查询</Button>
|
|
|
+ </DkForm>
|
|
|
+ <DkTabs ref="tab" v-model="tabsModel" :options="tabsOptions">
|
|
|
+ <!--优惠券发出-->
|
|
|
+ <div slot="22">
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ <Card>
|
|
|
+ <DkTable :pageFlag="true" primaryKey="sendId" :id="'table-'+$options.name" name="table"
|
|
|
+ @pageChange="sendPageSizeChange" :refreshSelect="false" :show-footer="true"
|
|
|
+ ref="couponSendTable" :data="CouponSendList" :height="tableHeight - 140" :choose-flag="false">
|
|
|
+ <DkTableColumn field="cpName" width="200px"></DkTableColumn>
|
|
|
+ <DkTableColumn field="sendDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
|
|
|
+ <DkTableColumn field="endDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
|
|
|
+ <DkTableColumn field="userNum" width="200px"></DkTableColumn>
|
|
|
+ </DkTable>
|
|
|
+ </Card>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--优惠券使用-->
|
|
|
+ <div slot="21">
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ <Card>
|
|
|
+ <DkTable :pageFlag="true" primaryKey="useId" :id="'table-'+$options.name" name="table"
|
|
|
+ @pageChange="usePageSizeChange" :refreshSelect="false" :show-footer="true"
|
|
|
+ ref="couponUseTable" :data="CouponUseList" :height="tableHeight - 140" :choose-flag="false">
|
|
|
+ <DkTableColumn field="cpName" width="200px"></DkTableColumn>
|
|
|
+ <DkTableColumn field="useValidDays" width="200px"></DkTableColumn>
|
|
|
+ <DkTableColumn field="couponStatusName" width="200px"></DkTableColumn>
|
|
|
+ <DkTableColumn field="receiveDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
|
|
|
+ <DkTableColumn field="useDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
|
|
|
+ </DkTable>
|
|
|
+ </Card>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--优惠券获取-->
|
|
|
+ <div slot="23">
|
|
|
+ <div style="margin-top: 5px">
|
|
|
+ <Card>
|
|
|
+ <DkTable :pageFlag="true" primaryKey="receiveId" :id="'table-'+$options.name" name="table"
|
|
|
+ @pageChange="receivePageSizeChange" :refreshSelect="false" :show-footer="true"
|
|
|
+ ref="couponReceiveTable" :data="CouponReceiveList" :height="tableHeight - 140" :choose-flag="false">
|
|
|
+ <DkTableColumn field="assistDate" :dataType="$config.columnType.date"></DkTableColumn>
|
|
|
+ </DkTable>
|
|
|
+ </Card>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </DkTabs>
|
|
|
+ </Card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import {indexMixin} from '@/mixins'
|
|
|
+import XEUtils from "xe-utils";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'coupon-view',
|
|
|
+ mixins: [indexMixin],
|
|
|
+ data() {
|
|
|
+ let self = this
|
|
|
+ return {
|
|
|
+ cpId:null,
|
|
|
+ cpName:null,
|
|
|
+ XEUtils: XEUtils,
|
|
|
+ formData: {},
|
|
|
+ loading: false,
|
|
|
+ sendPageInfo: {
|
|
|
+ pageSize: this.$config.pageSize,
|
|
|
+ currentPage: 1
|
|
|
+ },
|
|
|
+ CouponUseList: [],
|
|
|
+ usePageInfo: {
|
|
|
+ pageSize: this.$config.pageSize,
|
|
|
+ currentPage: 1
|
|
|
+ },
|
|
|
+ CouponSendList: [],
|
|
|
+ receivePageInfo: {
|
|
|
+ pageSize: this.$config.pageSize,
|
|
|
+ currentPage: 1
|
|
|
+ },
|
|
|
+ CouponReceiveList: [],
|
|
|
+ tabsModel: '22',
|
|
|
+ tabsOptions: [
|
|
|
+ {label: self.$t('couponSend'), name: '22'},
|
|
|
+ {label: self.$t('couponUse'), name: '21'},
|
|
|
+ {label: self.$t('couponReceive'), name: '23'},
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * @desc : 选择后事件
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/6/5 9:18
|
|
|
+ */
|
|
|
+ clickOk(val) {
|
|
|
+ this.cpId = val[0]['cpId']
|
|
|
+ this.cpName = val[0]['cpName']
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 通过id查询
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/7/29 9:50
|
|
|
+ */
|
|
|
+ detail() {
|
|
|
+ //编辑将只读属性改为true
|
|
|
+ this.loading = true
|
|
|
+ //优惠卷信息
|
|
|
+ this.excuteNoParam(this.$service.couponService, this.$service.couponService.selectById, [this.$route.params.id],false).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.formData = res.data
|
|
|
+ this.loading = false
|
|
|
+
|
|
|
+ //查询优惠券发出
|
|
|
+ this.getCouponSend()
|
|
|
+ //查询优惠券使用
|
|
|
+ this.getCouponUse()
|
|
|
+ //查询优惠券获取
|
|
|
+ this.getCouponReceive()
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询优惠券发出
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/7/15 14:05
|
|
|
+ */
|
|
|
+ getCouponSend() {
|
|
|
+ let param = {
|
|
|
+ couponId:this.$route.params.id,
|
|
|
+ cpId: this.cpId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.couponSendService, this.$service.couponSendService.selectByCond, param).then(res=>{
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.CouponSendList = res.data.list
|
|
|
+ this.$refs['couponSendTable'].pageInfo.total = res.data.total
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 查询优惠券使用
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/7/15 14:40
|
|
|
+ */
|
|
|
+ getCouponUse() {
|
|
|
+ let param = {
|
|
|
+ couponId:this.$route.params.id,
|
|
|
+ cpId: this.cpId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.couponUseService, this.$service.couponUseService.selectByCond, param).then(res=>{
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.CouponUseList = res.data.list
|
|
|
+ this.$refs['couponUseTable'].pageInfo.total = res.data.total
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 查询优惠券获取
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/7/15 14:49
|
|
|
+ */
|
|
|
+ getCouponReceive() {
|
|
|
+ let param = {
|
|
|
+ couponId:this.$route.params.id,
|
|
|
+ cpId: this.cpId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.couponReceiveService, this.$service.couponReceiveService.selectByCond, param).then(res=>{
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.CouponReceiveList = res.data.list
|
|
|
+ this.$refs['couponReceiveTable'].pageInfo.total = res.data.total
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 分页
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-01 14:29
|
|
|
+ */
|
|
|
+ sendPageSizeChange(pageInfo) {
|
|
|
+ this.sendPageInfo = pageInfo
|
|
|
+ this.getCouponSend() // 查询数据
|
|
|
+ },
|
|
|
+ usePageSizeChange(pageInfo) {
|
|
|
+ this.usePageInfo = pageInfo
|
|
|
+ this.getCouponUse() // 查询数据
|
|
|
+ },
|
|
|
+ receivePageSizeChange(pageInfo) {
|
|
|
+ this.receivePageInfo = pageInfo
|
|
|
+ this.getCouponReceive() // 查询数据
|
|
|
+ },
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ //通过id查询
|
|
|
+ this.detail()
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.card{
|
|
|
+ width: 99%;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+.col{
|
|
|
+ padding-bottom: 10px;
|
|
|
+}
|
|
|
+.order-info{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+
|
|
|
+.order-info>div:nth-child(n){
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.yuan-fh{
|
|
|
+ font-size: 8px
|
|
|
+}
|
|
|
+</style>
|