提交 9d3e01bd 作者: 郁骅焌

审核

上级 e6b93222
......@@ -16,3 +16,12 @@ export function auditDetail(id) {
method: 'get'
})
}
// 审核
export function auditCoupon(data) {
return request({
url: '/coupon/coupon/examine',
method: 'post',
data: data
})
}
......@@ -88,11 +88,23 @@
</div>
</el-card>
<el-card class="card-layout" style="margin-top: 20px;">
<el-form ref="formRef" label-width="auto" :model="form">
<el-form-item prop="examineReason" label="审核意见">
<el-input type="textarea" v-model="form.examineReason" />
</el-form-item>
</el-form>
</el-card>
<div class="form-bottom-btn">
<el-button type="primary" @click="handlePass">审核通过</el-button>
<el-button type="danger" @click="handleUnPass">审核不通过</el-button>
</div>
</div>
</template>
<script>
import { auditDetail } from '@/api/coupon/audit.js'
import { auditDetail, auditCoupon } from '@/api/coupon/audit.js'
export default {
name: 'CouponAuditAudit',
......@@ -100,7 +112,9 @@ export default {
data() {
return {
detail: {},
form: {}
form: {
examineReason: undefined
}
}
},
mounted() {
......@@ -111,6 +125,46 @@ export default {
auditDetail(this.$route.query.id).then(res => {
this.detail = res.data
})
},
handlePass() {
auditCoupon(
{
id: this.detail.id,
examineStatus: '1'
}
).then(res => {
this.$message.success("审核完成");
this.$tab.closeOpenPage();
this.$router.push({
name: "CouponAudit",
params: {
refreshTable: true,
},
});
})
},
handleUnPass() {
if (!this.form.examineReason) {
this.$modal.msgError('审核不通过需输入原因')
return
}
auditCoupon(
{
id: this.detail.id,
examineStatus: '2',
examineReason: this.form.examineReason
}
).then(res => {
this.$message.success("审核完成");
this.$tab.closeOpenPage();
this.$router.push({
name: "CouponAudit",
params: {
refreshTable: true,
},
});
})
}
}
}
......@@ -131,4 +185,9 @@ export default {
display: flex;
}
}
.form-bottom-btn {
margin-top: 20px;
text-align: right;
}
</style>
......@@ -5,6 +5,7 @@
<div>状态: <dict-tag style="display: inline-block;" :options="dict.type.examine_status" :value="detail.examineStatus" /></div>
<div style="margin-left: 120px;">审核时间: {{ detail.examineTime }}</div>
</div>
<div style="margin-top: 10px;" v-if="detail.examineStatus === 2">{{ detail.examineReason }}</div>
</el-card>
<el-card class="card-layout" style="margin-top: 20px;">
......
......@@ -139,6 +139,12 @@ export default {
mounted() {
this.initOptions()
},
// 页面被触发
activated() {
if (this.$route.params && this.$route.params.refreshTable) {
this.getList()
}
},
methods: {
initOptions() {
this.table.searchForm.listOptions.examineStatusOptions = this.dict.type.examine_status
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论