|
@@ -59,11 +59,11 @@
|
|
|
<el-table-column label="立减金名称" align="center" prop="couponTitle" />
|
|
<el-table-column label="立减金名称" align="center" prop="couponTitle" />
|
|
|
<el-table-column label="立减金面值" align="center" prop="couponPrice" />
|
|
<el-table-column label="立减金面值" align="center" prop="couponPrice" />
|
|
|
<el-table-column label="最低消费" align="center" prop="useMinPrice" />
|
|
<el-table-column label="最低消费" align="center" prop="useMinPrice" />
|
|
|
- <el-table-column label="立减金结束时间" align="center" prop="limitTime" width="180">
|
|
|
|
|
|
|
+ <!-- <el-table-column label="立减金结束时间" align="center" prop="limitTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.limitTime, '{y}-{m}-{d}') }}</span>
|
|
<span>{{ parseTime(scope.row.limitTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="领取时间" align="center" prop="createTime" width="180">
|
|
<el-table-column label="领取时间" align="center" prop="createTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
@@ -82,6 +82,32 @@
|
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
|
|
|
+ <!-- 如果字典中没有定义,则显示默认文本 -->
|
|
|
|
|
+ <span v-if="!getStatusLabel(scope.row.status)">
|
|
|
|
|
+ {{ getDefaultStatusText(scope.row.status) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <!-- 状态为0(未使用)和1(已使用)时显示退款按钮 -->
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="scope.row.status == 0 || scope.row.status == 1"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-refresh-left"
|
|
|
|
|
+ @click="handleRefund(scope.row)"
|
|
|
|
|
+ v-hasPermi="['store:storeInstantDiscountUser:refund']"
|
|
|
|
|
+ >退款</el-button>
|
|
|
|
|
+ <!-- 所有状态都显示审核按钮 -->
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-check"
|
|
|
|
|
+ @click="handleApprove(scope.row)"
|
|
|
|
|
+ v-hasPermi="['store:storeInstantDiscountUser:approve']"
|
|
|
|
|
+ style="color: #67C23A;"
|
|
|
|
|
+ >审核</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -93,18 +119,51 @@
|
|
|
:limit.sync="queryParams.pageSize"
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
|
/>
|
|
/>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 审核对话框 -->
|
|
|
|
|
+ <el-dialog title="审核立减金退款" :visible.sync="approveDialogVisible" width="500px" append-to-body>
|
|
|
|
|
+ <el-form ref="approveForm" :model="approveForm" :rules="approveRules" label-width="100px">
|
|
|
|
|
+ <el-form-item label="审核结果" prop="approvalStatus">
|
|
|
|
|
+ <el-radio-group v-model="approveForm.approvalStatus">
|
|
|
|
|
+ <el-radio :label="1">通过</el-radio>
|
|
|
|
|
+ <el-radio :label="2">拒绝</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="审核备注" prop="approvalRemark">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="approveForm.approvalRemark"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :rows="4"
|
|
|
|
|
+ placeholder="请输入审核意见"
|
|
|
|
|
+ maxlength="500"
|
|
|
|
|
+ show-word-limit
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="审核人" prop="approver">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="approveForm.approver"
|
|
|
|
|
+ placeholder="请输入审核人"
|
|
|
|
|
+ :disabled="true"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="cancelApprove">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="confirmApprove">确定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { listStoreCouponUser, getStoreCouponUser, delStoreCouponUser, addStoreCouponUser, updateStoreCouponUser, exportStoreCouponUser } from "@/api/hisStore/storeCouponUser";
|
|
|
|
|
|
|
+import { listStoreCouponUser, getStoreCouponUser, delStoreCouponUser, addStoreCouponUser, updateStoreCouponUser, exportStoreCouponUser, refundCashCoupon, approveCashCouponRefund } from "@/api/hisStore/storeCouponUser";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "HisStoreInstantDiscountUser",
|
|
name: "HisStoreInstantDiscountUser",
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
statusOptions: [],
|
|
statusOptions: [],
|
|
|
- // 遮罩层
|
|
|
|
|
|
|
+ // 遇罩层
|
|
|
loading: true,
|
|
loading: true,
|
|
|
// 选中数组
|
|
// 选中数组
|
|
|
ids: [],
|
|
ids: [],
|
|
@@ -123,6 +182,30 @@ export default {
|
|
|
title: "",
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
|
|
+ // 审核对话框显示状态
|
|
|
|
|
+ approveDialogVisible: false,
|
|
|
|
|
+ // 审核表单数据
|
|
|
|
|
+ approveForm: {
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ couponId: null,
|
|
|
|
|
+ userId: null,
|
|
|
|
|
+ couponType: 3,
|
|
|
|
|
+ approvalStatus: 1,
|
|
|
|
|
+ approvalRemark: '',
|
|
|
|
|
+ approver: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ // 审核表单校验
|
|
|
|
|
+ approveRules: {
|
|
|
|
|
+ approvalStatus: [
|
|
|
|
|
+ { required: true, message: "请选择审核结果", trigger: "change" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ approvalRemark: [
|
|
|
|
|
+ { required: true, message: "请输入审核备注", trigger: "blur" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ approver: [
|
|
|
|
|
+ { required: true, message: "审核人不能为空", trigger: "blur" }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
// 查询参数
|
|
// 查询参数
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -182,6 +265,8 @@ export default {
|
|
|
this.getDicts("store_coupon_user_status").then((response) => {
|
|
this.getDicts("store_coupon_user_status").then((response) => {
|
|
|
this.statusOptions = response.data;
|
|
this.statusOptions = response.data;
|
|
|
});
|
|
});
|
|
|
|
|
+ // 初始化审核人信息(可以从用户信息中获取)
|
|
|
|
|
+ this.approveForm.approver = this.$store.getters.name || '';
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -304,6 +389,85 @@ export default {
|
|
|
}).then(response => {
|
|
}).then(response => {
|
|
|
this.download(response.msg);
|
|
this.download(response.msg);
|
|
|
}).catch(function() {});
|
|
}).catch(function() {});
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 退款按钮操作 */
|
|
|
|
|
+ handleRefund(row) {
|
|
|
|
|
+ const refundData = {
|
|
|
|
|
+ id: row.id,
|
|
|
|
|
+ couponId: row.couponId,
|
|
|
|
|
+ userId: row.userId,
|
|
|
|
|
+ couponType: 3
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.$confirm('是否确认退款该立减金?', "警告", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ return refundCashCoupon(refundData);
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ this.msgSuccess("退款成功");
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError(response.msg || "退款失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.msgInfo("已取消退款操作");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 审核退款按钮操作 */
|
|
|
|
|
+ handleApprove(row) {
|
|
|
|
|
+ // 重置审核表单
|
|
|
|
|
+ this.approveForm = {
|
|
|
|
|
+ id: row.id,
|
|
|
|
|
+ couponId: row.couponId,
|
|
|
|
|
+ userId: row.userId,
|
|
|
|
|
+ couponType: 3,
|
|
|
|
|
+ approvalStatus: 1,
|
|
|
|
|
+ approvalRemark: '',
|
|
|
|
|
+ approver: this.$store.getters.name || ''
|
|
|
|
|
+ };
|
|
|
|
|
+ this.approveDialogVisible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 取消审核 */
|
|
|
|
|
+ cancelApprove() {
|
|
|
|
|
+ this.approveDialogVisible = false;
|
|
|
|
|
+ this.$refs.approveForm.resetFields();
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 确认审核 */
|
|
|
|
|
+ confirmApprove() {
|
|
|
|
|
+ this.$refs.approveForm.validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ approveCashCouponRefund(this.approveForm).then(response => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ this.msgSuccess("审核成功");
|
|
|
|
|
+ this.approveDialogVisible = false;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError(response.msg || "审核失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.msgError("审核操作失败");
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 获取字典中的状态标签 */
|
|
|
|
|
+ getStatusLabel(status) {
|
|
|
|
|
+ const option = this.statusOptions.find(item => item.dictValue == status);
|
|
|
|
|
+ return option ? option.dictLabel : null;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 获取默认状态文本 */
|
|
|
|
|
+ getDefaultStatusText(status) {
|
|
|
|
|
+ const statusMap = {
|
|
|
|
|
+ 0: '未使用',
|
|
|
|
|
+ 1: '已使用',
|
|
|
|
|
+ 2: '已过期',
|
|
|
|
|
+ 3: '已退款',
|
|
|
|
|
+ 4: '退款中'
|
|
|
|
|
+ };
|
|
|
|
|
+ return statusMap[status] || '未知状态';
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|