Commit 3bbab550 by chenwq

优惠券-领取详情-作废

1 parent 27d079a6
......@@ -183,4 +183,16 @@ const getAllGoodsApi = params => {
})
}
export default { getCouponListApi, couponExportApi, couponGroupExportApi, couponStoreExportApi, getPackageListApi, getVerificationListApi, verificationExportApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi, getListReceiveRecordApi, exportReceiveRecordApi }
// 优惠券-作废
const couponUserCancelApi = params => {
params.method = `scrm.api.coupon.user.cancel`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getCouponListApi, couponExportApi, couponGroupExportApi, couponStoreExportApi, getPackageListApi, getVerificationListApi, verificationExportApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi, getListReceiveRecordApi, exportReceiveRecordApi, couponUserCancelApi }
......@@ -17,15 +17,7 @@
</div>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"></glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormDataTwo">
<span slot="footer" class="footer-btns">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
</div>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title">领取详情列表</span>
......@@ -37,6 +29,9 @@
<span :class="['table-circle', 'm-r-8', scope.scope.userStatus == 1 ? 'back-green' : scope.scope.userStatus == 2 ? 'back-red' : 'back-grey']"></span>
<span>{{ baseData.userStatusList.find(item => item.confId == scope.scope.userStatus).confName }}</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
......@@ -44,6 +39,15 @@
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" :size="size" @click="goback">返回</el-button>
</div>
<!-- 作废 -->
<glsx-dialog title="作废确认" :isVisible.sync="isCancelVisible" @confirmDialog="handleCancelConfirm" @closeDialog="handleCancelClose">
<p>请先和客户沟通在确认,避免引起客诉,作废后客户将不可使用该礼包下所有优惠卷</p>
<el-form ref="cancelRef" label-width="100px" :rules="cancelRules" :model="cancelForm">
<el-form-item label="作废原因" prop="cancelReason">
<el-input :size="size" v-model="cancelForm.cancelReason" placeholder="请输入作废原因" maxlength="50"></el-input>
</el-form-item>
</el-form>
</glsx-dialog>
</div>
</template>
......@@ -58,6 +62,15 @@ export default {
footerLeft: '0',
footerWidth: '0',
url: url,
// 作废
isCancelVisible: false,
cancelForm: {
userCouponId: '',
cancelReason: ''
},
cancelRules: {
cancelReason: [{ required: true, message: '请输入作废原因', trigger: 'change' }]
},
coupon: {
couponName: '',
stock: '',
......@@ -113,6 +126,26 @@ export default {
name: 'usedAmount'
}
],
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '作废',
attrs: {
type: 'text'
// disabled: (row, condition) => {
// return +row.userStatus != 1
// }
},
condition: row => {
return +row.userStatus == 1
// return true
},
listeners: {
click: this.handleCancel
}
}
],
// 表格
searchForm: {
userInfo: '',
......@@ -146,9 +179,7 @@ export default {
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'userStatusList'
}
],
searchFormDataTwo: [
},
{
label: '领取日期',
name: 'daterange',
......@@ -161,7 +192,7 @@ export default {
getListApi: this.$apis.couponManage.getListReceiveRecordApi,
tableParams: {
listName: 'list',
tableOption: false,
tableOption: true,
tableColumns: [
{
label: '领取用户',
......@@ -197,10 +228,6 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
userStatusList: [
// {
// confId: '0',
// confName: '未领取'
// },
{
confId: '1',
confName: '未使用'
......@@ -326,8 +353,39 @@ export default {
})
},
writeOff() {
this.writeOffVisible = !this.writeOffVisible
handleCancel(row) {
this.cancelForm.userCouponId = row.id
this.cancelVisibleChange()
},
cancelVisibleChange() {
this.$refs.cancelRef && this.$refs.cancelRef.clearValidate()
this.isCancelVisible = !this.isCancelVisible
},
handleCancelClose() {
this.cancelVisibleChange()
this.cancelForm = {
userCouponId: '',
cancelReason: ''
}
},
handleCancelConfirm() {
this.$refs.cancelRef.validate(valid => {
if (valid) {
this.$apis.couponManage.couponUserCancelApi(this.cancelForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancelClose()
this.handleSearch()
}
})
}
})
},
/**导出excel */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!