Commit 45302d65 authored by 黄奎's avatar 黄奎

新增权限验证方法

parent 8929ed0a
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
*/ */
var AuthCode = { var AuthCode = {
EidtCoupon:"IsEidtCoupon",//优惠券修改权限
}; };
export default AuthCode; export default AuthCode;
\ No newline at end of file
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
</el-select> </el-select>
</span> </span>
</li> </li>
<li>
<span>
<em>团状态</em>
<el-select v-model="msg.IsSetOut">
<el-option label="正常发团" :value="0"></el-option>
<el-option label="取消发团" :value="1"></el-option>
</el-select>
</span>
</li>
<li> <li>
<input type="button" class="hollowFixedBtn" value="查询" @click="getSearch()"> &nbsp; <input type="button" class="hollowFixedBtn" value="查询" @click="getSearch()"> &nbsp;
<input type="button" class="normalBtn" value="下载" @click="DownLoadFile()"> <input type="button" class="normalBtn" value="下载" @click="DownLoadFile()">
...@@ -111,6 +120,7 @@ ...@@ -111,6 +120,7 @@
Supplier: 0, Supplier: 0,
PageIndex: 1, PageIndex: 1,
PageSize: 15, PageSize: 15,
IsSetOut:0,//0-正常发团,1-取消发团
}, },
loading: false, loading: false,
currentPage: 1, currentPage: 1,
...@@ -165,6 +175,7 @@ ...@@ -165,6 +175,7 @@
TCID: item.TCIDS, TCID: item.TCIDS,
Supplier: that.msg.Supplier, Supplier: that.msg.Supplier,
QMonthStr: that.msg.QMonthStr, QMonthStr: that.msg.QMonthStr,
IsSetOut:that.msg.IsSetOut,
}, },
res => { res => {
that.loading = false; that.loading = false;
......
<style> <style>
.user_time_picker .el-date-editor--date > .el-input__inner { .user_time_picker .el-date-editor--date>.el-input__inner {
padding: 0 10px; padding: 0 10px;
font-size: 13px; font-size: 13px;
} }
.user_time_picker .el-date-editor--date > span.el-input__prefix {
display: none; .user_time_picker .el-date-editor--date>span.el-input__prefix {
} display: none;
.user_time_picker .el-date-editor--date > span.el-input__suffix { }
top: -4px;
right: 2px; .user_time_picker .el-date-editor--date>span.el-input__suffix {
} top: -4px;
.zidingyiFz i { right: 2px;
font-size: 14px !important; }
}
._couponReceiveCount{ .zidingyiFz i {
text-decoration: underline; font-size: 14px !important;
cursor: pointer; }
}
/* .page_CouponList .el-button.is-circle{ ._couponReceiveCount {
text-decoration: underline;
cursor: pointer;
}
/* .page_CouponList .el-button.is-circle{
border-radius: 4px border-radius: 4px
} */ } */
.text_al_left{ .text_al_left {
text-align: left; text-align: left;
padding: 0 10px; padding: 0 10px;
} }
</style> </style>
<template> <template>
<div class="flexOne page_CouponList"> <div class="flexOne page_CouponList">
...@@ -32,18 +38,9 @@ ...@@ -32,18 +38,9 @@
<li> <li>
<span> <span>
<em>{{$t('system.table_company')}}</em> <em>{{$t('system.table_company')}}</em>
<el-select <el-select filterable :disabled="msg.IsParentCompany==2" v-model="msg.branchId">
filterable
:disabled="msg.IsParentCompany==2"
v-model="msg.branchId"
>
<el-option :label="$t('system.ph_buxian')" value="-1"></el-option> <el-option :label="$t('system.ph_buxian')" value="-1"></el-option>
<el-option <el-option v-for="item in companyList" :label="item.BName" :value="item.Id" :key="item.Id"></el-option>
v-for="item in companyList"
:label="item.BName"
:value="item.Id"
:key="item.Id"
></el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
...@@ -52,7 +49,8 @@ ...@@ -52,7 +49,8 @@
<em>{{$t('system.table_ssLine')}}</em> <em>{{$t('system.table_ssLine')}}</em>
<el-select filterable v-model="msg.lineId" @change="getLineTeamList(msg.lineId, 2)"> <el-select filterable v-model="msg.lineId" @change="getLineTeamList(msg.lineId, 2)">
<el-option :label="$t('system.ph_buxian')" :value="0"></el-option> <el-option :label="$t('system.ph_buxian')" :value="0"></el-option>
<el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID"></el-option> <el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID">
</el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
...@@ -61,7 +59,8 @@ ...@@ -61,7 +59,8 @@
<em>{{$t('active.ad_ssxl')}}</em> <em>{{$t('active.ad_ssxl')}}</em>
<el-select filterable v-model="msg.lineteamId"> <el-select filterable v-model="msg.lineteamId">
<el-option :label="$t('system.ph_buxian')" :value="0"></el-option> <el-option :label="$t('system.ph_buxian')" :value="0"></el-option>
<el-option v-for="item in QLineTeamList" :label="item.LtName" :value="item.LtID" :key="item.LtID"></el-option> <el-option v-for="item in QLineTeamList" :label="item.LtName" :value="item.LtID" :key="item.LtID">
</el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
...@@ -86,31 +85,24 @@ ...@@ -86,31 +85,24 @@
<span> <span>
<em>{{$t('MarketingActi.usingRange')}}</em> <em>{{$t('MarketingActi.usingRange')}}</em>
<el-select filterable v-model="msg.couponsUseScope"> <el-select filterable v-model="msg.couponsUseScope">
<el-option :label="$t('active.cl_tongyong')" :value="1"></el-option> <el-option :label="$t('active.cl_tongyong')" :value="1"></el-option>
<el-option :label="$t('active.cl_team')" :value="2"></el-option> <el-option :label="$t('active.cl_team')" :value="2"></el-option>
<el-option :label="$t('active.cl_qianzheng')" :value="3"></el-option> <el-option :label="$t('active.cl_qianzheng')" :value="3"></el-option>
<el-option :label="$t('active.cl_jipiao')" :value="4"></el-option> <el-option :label="$t('active.cl_jipiao')" :value="4"></el-option>
<el-option :label="$t('scen.sc_piao')" :value="5"></el-option> <el-option :label="$t('scen.sc_piao')" :value="5"></el-option>
<el-option :label="$t('MarketingActi.car')" :value="6"></el-option> <el-option :label="$t('MarketingActi.car')" :value="6"></el-option>
<el-option :label="$t('MarketingActi.free')" :value="7"></el-option> <el-option :label="$t('MarketingActi.free')" :value="7"></el-option>
<el-option :label="$t('MarketingActi.local')" :value="8"></el-option> <el-option :label="$t('MarketingActi.local')" :value="8"></el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
<li> <li>
<input <input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="resetPageIndex(),getList()">
type="button" &nbsp;
class="hollowFixedBtn" <input type="button"
:value="$t('pub.searchBtn')"
@click="resetPageIndex(),getList()"
> &nbsp;
<input
type="button"
@click="outerVisible = true,isleaveBtn=false,dialogTitle=$t('active.cl_addCoupon'),getCompany()" @click="outerVisible = true,isleaveBtn=false,dialogTitle=$t('active.cl_addCoupon'),getCompany()"
class="normalBtn" class="normalBtn" :value="$t('pub.addBtn')">
:value="$t('pub.addBtn')"
>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -143,9 +135,11 @@ ...@@ -143,9 +135,11 @@
<td>{{item.couponsName}}</td> <td>{{item.couponsName}}</td>
<td>{{item.couponCount}}</td> <td>{{item.couponCount}}</td>
<td> <td>
<span class="_couponReceiveCount" @click="item.couponReceiveCount === 0 ? '' : goDetail('CouponDetail', item)">{{item.couponReceiveCount}}</span> <span class="_couponReceiveCount"
@click="item.couponReceiveCount === 0 ? '' : goDetail('CouponDetail', item)">{{item.couponReceiveCount}}</span>
</td>
<td>{{(item.couponCount - item.couponReceiveCount) > 0 ? (item.couponCount - item.couponReceiveCount) : 0 }}
</td> </td>
<td>{{(item.couponCount - item.couponReceiveCount) > 0 ? (item.couponCount - item.couponReceiveCount) : 0 }}</td>
<td>{{item.branchName}}</td> <td>{{item.branchName}}</td>
<td>{{item.lineId <= 0 ? $t('pub.unlimitedSel') : item.lineName}}</td> <td>{{item.lineId <= 0 ? $t('pub.unlimitedSel') : item.lineName}}</td>
<td>{{item.lineteamId <= 0 ? $t('pub.unlimitedSel') : item.lineTeamName}}</td> <td>{{item.lineteamId <= 0 ? $t('pub.unlimitedSel') : item.lineTeamName}}</td>
...@@ -160,9 +154,9 @@ ...@@ -160,9 +154,9 @@
<span v-if="item.couponEffectStatus === 2" style="color: gray">{{$t('active.cl_wsxiao')}}</span> <span v-if="item.couponEffectStatus === 2" style="color: gray">{{$t('active.cl_wsxiao')}}</span>
<span v-if="item.couponEffectStatus === 3" style="color: red">{{$t('active.cl_ygqi')}}</span> <span v-if="item.couponEffectStatus === 3" style="color: red">{{$t('active.cl_ygqi')}}</span>
</td> </td>
<td>{{item.expirationDate}}</td> <td>{{item.expirationDate}}</td>
<td> <td>
<span v-if="item.couponsUseScope == 1">{{$t('MarketingActi.alltongyong')}}</span> <span v-if="item.couponsUseScope == 1">{{$t('MarketingActi.alltongyong')}}</span>
<span v-if="item.couponsUseScope == 2">{{$t('active.cl_team')}}</span> <span v-if="item.couponsUseScope == 2">{{$t('active.cl_team')}}</span>
<span v-if="item.couponsUseScope == 3">{{$t('active.cl_qianzheng')}}</span> <span v-if="item.couponsUseScope == 3">{{$t('active.cl_qianzheng')}}</span>
...@@ -181,62 +175,38 @@ ...@@ -181,62 +175,38 @@
</td> </td>
<td>{{item.redemptionPrice}}</td> <td>{{item.redemptionPrice}}</td>
<td> <td>
<p>{{$t('system.table_begTime')}}{{item.activityStartDate}}</p> <p>{{$t('system.table_begTime')}}{{item.activityStartDate}}</p>
<p>{{$t('MarketingActi.endTime')}}{{item.activityEndDate}}</p> <p>{{$t('MarketingActi.endTime')}}{{item.activityEndDate}}</p>
</td> </td>
<td>{{item.remark}}</td> <td>{{item.remark}}</td>
<td class="text_al_left"> <td class="text_al_left">
<!-- <el-button-group> --> <el-tooltip class="item" effect="dark" :content="$t('pub.updateMsg')" placement="top">
<el-tooltip class="item" effect="dark" :content="$t('pub.updateMsg')" placement="top"> <el-button v-if="item.couponEffectStatus === 2 && item.couponStatus === 1" type="primary"
<el-button icon="el-icon-edit" circle
v-if="item.couponEffectStatus === 2 && item.couponStatus === 1" @click="outerVisible=true,dialogTitle=$t('pub.updateMsg'),updateData(item),getCompany()"></el-button>
type="primary" </el-tooltip>
icon="el-icon-edit" <el-tooltip class="item" effect="dark" :content="$t('active.cl_jyCoupon')" placement="top">
circle <el-button v-if="item.couponStatus !== 2" type="danger" icon="iconfont icon-jinyong" circle
@click="outerVisible=true,dialogTitle=$t('pub.updateMsg'),updateData(item),getCompany()" @click="deleteItem(item, 2)"></el-button>
></el-button> </el-tooltip>
</el-tooltip> <el-tooltip class="item" effect="dark" :content="$t('active.cl_hfCoupon')" placement="top">
<el-tooltip class="item" effect="dark" :content="$t('active.cl_jyCoupon')" placement="top"> <el-button v-if="item.couponStatus === 2" type="success" icon="iconfont icon-huifu" circle
<el-button @click="deleteItem(item, 3)"></el-button>
v-if="item.couponStatus !== 2" </el-tooltip>
type="danger" <el-tooltip class="item" effect="dark" :content="$t('active.cl_deleteCoupon')" placement="top">
icon="iconfont icon-jinyong" <el-button v-if="item.couponStatus === 2" type="danger" icon="iconfont icon-img_delete_small" circle
circle @click="deleteItem(item)"></el-button>
@click="deleteItem(item, 2)" </el-tooltip>
></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('active.cl_hfCoupon')" placement="top">
<el-button
v-if="item.couponStatus === 2"
type="success"
icon="iconfont icon-huifu"
circle
@click="deleteItem(item, 3)"
></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('active.cl_deleteCoupon')" placement="top">
<el-button
v-if="item.couponStatus === 2"
type="danger"
icon="iconfont icon-img_delete_small"
circle
@click="deleteItem(item)"
></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="修改当日活动库存" placement="top">
<el-button type="primary" icon="el-icon-edit" circle style="padding:6px;"
@click="updateKucundialog=true"
></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<el-button v-if="EditBtn" type="danger" icon="iconfont icon-xiugai" circle style="padding:4px;"
@click="outerVisible=true,EditItem(item)"
></el-button>
</el-tooltip>
<!-- </el-button-group> --> <el-tooltip class="item" effect="dark" content="修改当日活动库存" placement="top">
<el-button type="primary" icon="el-icon-edit" circle style="padding:6px;" @click="updateKucundialog=true">
</el-button>
</el-tooltip>
{{EditBtn}}
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<el-button v-if="EditBtn" type="danger" icon="iconfont icon-xiugai" circle style="padding:4px;"
@click="outerVisible=true,EditItem(item)"></el-button>
</el-tooltip>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -244,60 +214,37 @@ ...@@ -244,60 +214,37 @@
<i class="iconfont icon-kong"></i> <i class="iconfont icon-kong"></i>
<p>{{$t('active.ld_noData')}}</p> <p>{{$t('active.ld_noData')}}</p>
</div> </div>
<el-pagination <el-pagination background @current-change="handleCurrentChange" v-if="DataList.length>0"
background :current-page.sync="currentPage" layout="total,prev, pager, next, jumper" :page-size="msg.pageSize"
@current-change="handleCurrentChange" :total="total"></el-pagination>
v-if="DataList.length>0" <el-dialog custom-class="w800" :title="dialogTitle" :visible.sync="outerVisible" center
:current-page.sync="currentPage" :before-close="closeChangeMachie">
layout="total,prev, pager, next, jumper"
:page-size="msg.pageSize"
:total="total"
></el-pagination>
<el-dialog
custom-class="w800"
:title="dialogTitle"
:visible.sync="outerVisible"
center
:before-close="closeChangeMachie"
>
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px"> <el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<table class="layerTable layerNoIcon"> <table class="layerTable layerNoIcon">
<tr> <tr>
<td> <td>
<el-form-item :label="$t('system.table_company')" prop="branchId"> <el-form-item :label="$t('system.table_company')" prop="branchId">
<el-select <el-select filterable class="w217" v-model="addMsg.branchId" :placeholder="$t('system.ph_choice')">
filterable
class="w217"
v-model="addMsg.branchId"
:placeholder="$t('system.ph_choice')"
>
<el-option :label="$t('system.ph_buxian')" :value="-1" :key="-1"></el-option> <el-option :label="$t('system.ph_buxian')" :value="-1" :key="-1"></el-option>
<el-option <el-option v-for="item in layerCompanyList" :label="item.BName" :value="item.Id" :key="item.Id">
v-for="item in layerCompanyList" </el-option>
:label="item.BName"
:value="item.Id"
:key="item.Id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</td> </td>
<td> <td>
<el-form-item :label="$t('active.cl_couponName')" prop="couponsName"> <el-form-item :label="$t('active.cl_couponName')" prop="couponsName">
<el-input <el-input maxlength="20" class="w217" type="text" v-model="addMsg.couponsName"
maxlength="20" :placeholder="$t('pub.pleaseImport')"></el-input>
class="w217"
type="text"
v-model="addMsg.couponsName"
:placeholder="$t('pub.pleaseImport')"
></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
<tr>
<td> <td>
<el-form-item :label="$t('advmanager.v_line')" prop="lineId"> <el-form-item :label="$t('advmanager.v_line')" prop="lineId">
<el-select filterable v-model="addMsg.lineId" @change="getLineTeamList(addMsg.lineId)"> <el-select filterable v-model="addMsg.lineId" @change="getLineTeamList(addMsg.lineId)">
<el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option> <el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option>
<el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID"></el-option> <el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</td> </td>
...@@ -305,14 +252,15 @@ ...@@ -305,14 +252,15 @@
<el-form-item :label="$t('advmanager.v_xilie')" prop="lineteamId"> <el-form-item :label="$t('advmanager.v_xilie')" prop="lineteamId">
<el-select filterable v-model="addMsg.lineteamId"> <el-select filterable v-model="addMsg.lineteamId">
<el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option> <el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option>
<el-option v-for="item in LineTeamList" :label="item.LtName" :value="item.LtID" :key="item.LtID"></el-option> <el-option v-for="item in LineTeamList" :label="item.LtName" :value="item.LtID" :key="item.LtID">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<el-form-item :label="$t('active.cl_couponType')" prop="couponsType" > <el-form-item :label="$t('active.cl_couponType')" prop="couponsType">
<el-select filterable v-model="addMsg.couponsType" @change="addMsg.denomination = ''"> <el-select filterable v-model="addMsg.couponsType" @change="addMsg.denomination = ''">
<el-option :label="$t('active.cl_dyquan')" :value="1"></el-option> <el-option :label="$t('active.cl_dyquan')" :value="1"></el-option>
<el-option :label="$t('active.cl_zkquan')" :value="2"></el-option> <el-option :label="$t('active.cl_zkquan')" :value="2"></el-option>
...@@ -321,48 +269,34 @@ ...@@ -321,48 +269,34 @@
</td> </td>
<td> <td>
<el-form-item :label="$t('active.cl_yhqmiane')" prop="denomination"> <el-form-item :label="$t('active.cl_yhqmiane')" prop="denomination">
<el-input <el-input @input="maxValue" maxlength="20" class="w217" type="number" v-model="addMsg.denomination"
@input="maxValue" :placeholder="$t('active.cl_dkjezk')"></el-input>
maxlength="20"
class="w217"
type="number"
v-model="addMsg.denomination"
:placeholder="$t('active.cl_dkjezk')"
></el-input>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<el-form-item :label="$t('active.cl_couponNum')" prop="couponCount"> <el-form-item :label="$t('active.cl_couponNum')" prop="couponCount">
<el-input v-model="addMsg.couponCount" class="w217" type="number"/> <el-input v-model="addMsg.couponCount" class="w217" type="number" />
</el-form-item> </el-form-item>
</td> </td>
<td> <td>
<el-form-item :label="$t('active.cl_sytiaojian')" prop="useCondition"> <el-form-item :label="$t('active.cl_sytiaojian')" prop="useCondition">
<el-input v-model="addMsg.useCondition" class="w217" :placeholder="$t('active.cl_mdskeyong')"/> <el-input v-model="addMsg.useCondition" class="w217" :placeholder="$t('active.cl_mdskeyong')" />
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<el-form-item :label="$t('active.cl_sxriqi')" prop="effectDate"> <el-form-item :label="$t('active.cl_sxriqi')" prop="effectDate">
<el-date-picker <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" class="w217" v-model="addMsg.effectDate"
value-format="yyyy-MM-dd HH:mm:ss" type="datetime"></el-date-picker>
class="w217"
v-model="addMsg.effectDate"
type="datetime"
></el-date-picker>
</el-form-item> </el-form-item>
</td> </td>
<td> <td>
<el-form-item :label="$t('active.cl_yxjzhiri')" prop="expirationDate"> <el-form-item :label="$t('active.cl_yxjzhiri')" prop="expirationDate">
<el-date-picker <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" class="w217" v-model="addMsg.expirationDate"
value-format="yyyy-MM-dd HH:mm:ss" type="datetime"></el-date-picker>
class="w217"
v-model="addMsg.expirationDate"
type="datetime"
></el-date-picker>
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
...@@ -400,352 +334,396 @@ ...@@ -400,352 +334,396 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</td> </td>
<td> <td>
<el-form-item :label="$t('MarketingActi.huangoujia')"> <el-form-item :label="$t('MarketingActi.huangoujia')">
<el-input v-model="addMsg.redemptionPrice" class="w217" :placeholder="$t('pub.pleaseImport')"/> <el-input v-model="addMsg.redemptionPrice" class="w217" :placeholder="$t('pub.pleaseImport')" />
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<el-form-item :label="$t('hotel.hotel_remark')"> <el-form-item :label="$t('hotel.hotel_remark')">
<el-input v-model="addMsg.remark" class="w217" :placeholder="$t('pub.pleaseImport')"/> <el-input v-model="addMsg.remark" class="w217" :placeholder="$t('pub.pleaseImport')" />
</el-form-item> </el-form-item>
</td> </td>
</tr> </tr>
</table> </table>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="outerVisible = false,resetForm('addMsg')">{{$t('pub.cancelBtn')}}</button> &nbsp; <button class="hollowFixedBtn"
@click="outerVisible = false,resetForm('addMsg')">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button> <button class="normalBtn" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog custom-class='w400' title="修改当日活动库存" :visible.sync="updateKucundialog" center> <el-dialog custom-class='w400' title="修改当日活动库存" :visible.sync="updateKucundialog" center>
<el-form label-width="150px"> <el-form label-width="150px">
<el-form-item label="修改当日活动库存"> <el-form-item label="修改当日活动库存">
<el-input class="w180" v-model="upDateKcMsg.number" @keyup.native="checkInteger(upDateKcMsg,'number',true)"></el-input> <el-input class="w180" v-model="upDateKcMsg.number" @keyup.native="checkInteger(upDateKcMsg,'number',true)">
</el-form-item> </el-input>
</el-form> </el-form-item>
<span slot="footer" class="dialog-footer"> </el-form>
<el-button size="small" @click="updateKucundialog = false">取 消</el-button> <span slot="footer" class="dialog-footer">
<el-button size="small" type="danger" @click="sureUpdatekucun()">确 定</el-button> <el-button size="small" @click="updateKucundialog = false">取 消</el-button>
</span> <el-button size="small" type="danger" @click="sureUpdatekucun()">确 定</el-button>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
leaveBtn: "", leaveBtn: "",
leaveId: "", leaveId: "",
loading: true, loading: true,
isleaveBtn: false, isleaveBtn: false,
total: 0, total: 0,
pageSize: "", pageSize: "",
currentPage: 1, currentPage: 1,
outerVisible: false, outerVisible: false,
innerVisible: false, innerVisible: false,
updateKucundialog:false, updateKucundialog: false,
isRight: true, isRight: true,
dialogTitle: "", dialogTitle: "",
insideDialogTxt: "", insideDialogTxt: "",
LineList: [], LineList: [],
//请求 //请求
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
lineId: 0, lineId: 0,
lineteamId: 0, lineteamId: 0,
couponsName: '', couponsName: '',
couponsType: -1, couponsType: -1,
couponStatus: -1, couponStatus: -1,
groupId: '',
branchId: '',
couponsUseScope: "",
},
rules: {
branchId: [{
required: true,
message: this.$t('rule.company'),
trigger: "change"
}],
lineId: [{
required: true,
message: this.$t('rule.qxzxuanlu'),
trigger: "change"
}],
couponsName: [{
required: true,
message: this.$t('rule.qsryhqmingcheng'),
trigger: "blur"
}],
useCondition: [{
required: true,
message: this.$t('rule.qsrsytiaojian'),
trigger: "blur"
}],
effectDate: [{
required: true,
message: this.$t('rule.qxzsxriqi'),
trigger: "change"
}],
expirationDate: [{
required: true,
message: this.$t('rule.qxzjzriqi'),
trigger: "change"
}],
couponCount: [{
required: true,
message: this.$t('rule.qsryhqshuliang'),
trigger: "blur"
}],
},
addMsg: {
couponsName: "",
effectDate: "",
expirationDate: "",
couponsType: 1,
groupId: "",
branchId: "",
lineId: 0,
denomination: "",
overlapUse: 0,
useCondition: "",
id: 0,
couponCount: '',
lineteamId: 0,
couponsUseScope: 1,
couponStatus: 1,
redemptionPrice: '',
remark: "",
},
pwdMsg: {
Id: "",
Pwd: "",
pwd1: ""
},
getCompanyMsg: {
RB_Group_Id: "0",
Status: "0"
},
//返回值的接收变量
DataList: [],
groupList: [],
layerCompanyList: [],
companyList: [],
layerDepartMentList: [],
departMentList: [],
PostList: [],
groupId: '', groupId: '',
branchId: '', LineTeamList: [],
couponsUseScope:"", QLineTeamList: [],
}, upDateKcMsg: {
rules: { number: ''
branchId: [{ required: true, message: this.$t('rule.company'), trigger: "change" }], },
lineId: [{ required: true, message: this.$t('rule.qxzxuanlu'), trigger: "change" }], EditBtn: false,
couponsName: [{ required: true, message: this.$t('rule.qsryhqmingcheng'), trigger: "blur" }], };
useCondition: [{ required: true, message: this.$t('rule.qsrsytiaojian'), trigger: "blur" }], },
effectDate: [{ required: true, message: this.$t('rule.qxzsxriqi'), trigger: "change" }], mounted() {
expirationDate: [{ required: true, message: this.$t('rule.qxzjzriqi'), trigger: "change" }], let userInfo = this.getLocalStorage();
couponCount: [{ required: true, message: this.$t('rule.qsryhqshuliang'), trigger: "blur" }], this.groupId = this.msg.groupId = this.getCompanyMsg.RB_Group_Id = this.addMsg.groupId = userInfo
}, .RB_Group_id; //集团
addMsg: { this.msg.branchId = userInfo.RB_Branch_id; //公司
couponsName: "", this.GetAuth();
effectDate: "", this.getList();
expirationDate: "", this.getCompany();
couponsType: 1, this.getLineList();
groupId: "", },
branchId: "", filters: {},
lineId: 0,
denomination: "", methods: {
overlapUse: 0, GetAuth() {
useCondition: "", var actionCode = this.$AuthCode.EidtCoupon;
id: 0, this.CheckUserAuth(actionCode, res => {
couponCount: '', if (res.data.resultCode == 1 && res.data.data == 1) {
lineteamId: 0, this.EditBtn = true;
couponsUseScope: 1, }
couponStatus: 1, });
redemptionPrice:'',
remark:"",
},
pwdMsg: {
Id: "",
Pwd: "",
pwd1: ""
},
getCompanyMsg: {
RB_Group_Id: "0",
Status: "0"
}, },
//返回值的接收变量 EditItem(item) {
DataList: [], this.addMsg = Object.assign({}, item);
groupList: [],
layerCompanyList: [],
companyList: [],
layerDepartMentList: [],
departMentList: [],
PostList: [],
groupId: '',
LineTeamList: [],
QLineTeamList: [],
upDateKcMsg:{
number:''
}, },
EditBtn:false, //点击确定修改库存
}; sureUpdatekucun() {
}, this.apiJavaPost("/api/appActivity/updateCouponStock", this.upDateKcMsg, res => {
mounted() { if (res.data.resultCode === 1) {
let userInfo = this.getLocalStorage();
this.groupId = this.msg.groupId = this.getCompanyMsg.RB_Group_Id = this.addMsg.groupId = userInfo.RB_Group_id; //集团
this.msg.branchId = userInfo.RB_Branch_id; //公司
if(userInfo.EmployeeId==615){
this.EditBtn=true;
}
this.getList();
this.getCompany();
this.getLineList();
},
filters: {
},
methods: {
EditItem(item){
this.addMsg=Object.assign({},item);
},
//点击确定修改库存
sureUpdatekucun(){
this.apiJavaPost("/api/appActivity/updateCouponStock", this.upDateKcMsg, res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message); this.Success(res.data.message);
this.updateKucundialog=false; this.updateKucundialog = false;
this.getList(); this.getList();
this.upDateKcMsg.number=''; this.upDateKcMsg.number = '';
} else { } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
}, null); }, null);
}, },
getCompany() { getCompany() {
this.apipost( this.apipost(
"admin_get_BranchGetList", "admin_get_BranchGetList",
this.getCompanyMsg, this.getCompanyMsg,
res => { res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.layerCompanyList = res.data.data; this.layerCompanyList = res.data.data;
} else {}
},
err => {}
);
},
getList() {
//获取数据
this.loading = true
this.apiJavaPost("/api/sell/coupon/getCouponsList", this.msg, res => {
if (res.data.resultCode === 1) {
this.total = res.data.data.count
this.DataList = res.data.data.pageData;
} else { } else {
this.$message.error(res.data.message)
} }
}, this.loading = false
err => {} }, null);
); },
}, // 跳转优惠券发放详情
getList() { goDetail: function (path, item) {
//获取数据 this.$router.push({
this.loading = true name: path,
this.apiJavaPost("/api/sell/coupon/getCouponsList", this.msg, res => { query: {
if (res.data.resultCode === 1) {
this.total = res.data.data.count
this.DataList = res.data.data.pageData;
} else {
this.$message.error(res.data.message)
}
this.loading = false
}, null);
},
// 跳转优惠券发放详情
goDetail: function (path, item) {
this.$router.push({
name: path,
query: {
couponId: item.id, couponId: item.id,
useState: item.couponStatus, useState: item.couponStatus,
blank: "y", blank: "y",
}
});
},
maxValue: function (val) {
if (this.addMsg.couponsType === 2 && val >= 9.99) {
this.addMsg.denomination = 9.99
this.$message.error(this.$t('rule.zkqzdzkwzhe'))
} }
}); },
}, addData() {
maxValue: function (val) { let sDate = new Date(this.addMsg.effectDate)
if (this.addMsg.couponsType === 2 && val >= 9.99) { let eDate = new Date(this.addMsg.expirationDate)
this.addMsg.denomination = 9.99 if (sDate > eDate) {
this.$message.error(this.$t('rule.zkqzdzkwzhe')) return this.$message.error(this.$t('rule.yxjzrbxdyksshijian'))
} }
}, this.isleaveBtn = false;
addData() { this.apiJavaPost(
let sDate = new Date(this.addMsg.effectDate) "/api/sell/coupon/setCoupon",
let eDate = new Date(this.addMsg.expirationDate) this.addMsg,
if (sDate > eDate) { res => {
return this.$message.error(this.$t('rule.yxjzrbxdyksshijian')) if (res.data.resultCode == 1) {
} this.$message.success(res.data.message);
this.isleaveBtn = false; this.outerVisible = false;
this.apiJavaPost( this.getList();
"/api/sell/coupon/setCoupon", this.resetForm("addMsg");
this.addMsg, } else {
res => { this.$message.error(res.data.message);
}
},
err => {}
);
},
//获取线路列表
getLineList() {
this.apipost('line_post_GetList', {}, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.$message.success(res.data.message); this.LineList = res.data.data
this.outerVisible = false;
this.getList();
this.resetForm("addMsg");
} else {
this.$message.error(res.data.message);
} }
}, })
err => {} },
); //获取系列列表
}, getLineTeamList(LineID, type) {
//获取线路列表 let msg = {
getLineList() { lineID: LineID,
this.apipost('line_post_GetList', {}, res => { isTOOP: 1
if (res.data.resultCode == 1) {
this.LineList = res.data.data
} }
}) this.apipost('team_post_GetList', msg, res => {
}, if (res.data.resultCode == 1) {
//获取系列列表 if (type) {
getLineTeamList (LineID, type) { this.QLineTeamList = res.data.data
let msg = { } else {
lineID: LineID, this.LineTeamList = res.data.data
isTOOP: 1 }
}
this.apipost('team_post_GetList', msg, res => {
if (res.data.resultCode == 1) {
if (type) {
this.QLineTeamList = res.data.data
} else {
this.LineTeamList = res.data.data
} }
})
},
// 修改
updateData(item) {
this.getLineTeamList(item.lineId)
this.addMsg.couponsName = item.couponsName
this.addMsg.effectDate = item.effectDate
this.addMsg.expirationDate = item.expirationDate
this.addMsg.couponsType = item.couponsType
this.addMsg.groupId = item.groupId
this.addMsg.branchId = item.branchId
this.addMsg.lineId = item.lineId
this.addMsg.denomination = item.denomination
this.addMsg.overlapUse = item.overlapUse
this.addMsg.useCondition = item.useCondition
this.addMsg.id = item.id
this.addMsg.couponCount = item.couponCount
this.addMsg.lineteamId = item.lineteamId
this.addMsg.couponsUseScope = item.couponsUseScope
this.addMsg.couponStatus = item.couponStatus
this.addMsg.redemptionPrice = item.redemptionPrice
this.addMsg.remark = item.remark
this.isleaveBtn = true;
},
// 删除
deleteItem: function (item, type) {
let text = this.$t('tips.qrsc');
let status = 3;
if (type == 2) {
text = this.$t('tips.qrjinyong');
status = 2
} else if (type == 3) {
text = this.$t('tips.qrhuifu');
status = 1
} }
}) this.$confirm(text + '“' + item.couponsName + '”' + this.$t('active.ad_yhq'), this.$t('tips.tips'), {
}, confirmButtonText: this.$t('pub.sureBtn'),
// 修改
updateData(item) {
this.getLineTeamList(item.lineId)
this.addMsg.couponsName= item.couponsName
this.addMsg.effectDate= item.effectDate
this.addMsg.expirationDate= item.expirationDate
this.addMsg.couponsType= item.couponsType
this.addMsg.groupId= item.groupId
this.addMsg.branchId= item.branchId
this.addMsg.lineId= item.lineId
this.addMsg.denomination= item.denomination
this.addMsg.overlapUse= item.overlapUse
this.addMsg.useCondition= item.useCondition
this.addMsg.id= item.id
this.addMsg.couponCount = item.couponCount
this.addMsg.lineteamId = item.lineteamId
this.addMsg.couponsUseScope = item.couponsUseScope
this.addMsg.couponStatus = item.couponStatus
this.addMsg.redemptionPrice = item.redemptionPrice
this.addMsg.remark = item.remark
this.isleaveBtn = true;
},
// 删除
deleteItem: function (item, type) {
let text = this.$t('tips.qrsc');
let status = 3;
if (type == 2) {
text = this.$t('tips.qrjinyong');
status = 2
} else if (type == 3) {
text = this.$t('tips.qrhuifu');
status = 1
}
this.$confirm(text+'“'+ item.couponsName +'”'+this.$t('active.ad_yhq'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'), cancelButtonText: this.$t('pub.cancelBtn'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.apiJavaPost("/api/sell/coupon/updateCouponStatus", {couponId: item.id, status: status,}, res => { this.apiJavaPost("/api/sell/coupon/updateCouponStatus", {
couponId: item.id,
status: status,
}, res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
this.Success(res.data.message); this.Success(res.data.message);
this.getList(); this.getList();
} else { } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
}, null); }, null);
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: this.$t('hotel.hotel_HasBeenCancelled') message: this.$t('hotel.hotel_HasBeenCancelled')
}); });
}); });
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getList(); this.getList();
}, },
resetPageIndex() { resetPageIndex() {
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.currentPage = 1; this.currentPage = 1;
}, },
submitForm(addMsg) { submitForm(addMsg) {
//提交创建、修改表单 //提交创建、修改表单
this.$refs[addMsg].validate(valid => { this.$refs[addMsg].validate(valid => {
if (valid) { if (valid) {
this.addData(); this.addData();
} else { } else {
return false; return false;
}
});
},
goUrl(name, id) {
this.$router.push({
name: name,
query: {
id: id,
type: 9,
blank: "y",
tab: "绑定账户信息"
}
});
},
closeChangeMachie(done) {
//弹出框关闭初始化弹框内表单
done();
this.resetForm("addMsg");
},
resetForm(formName) {
//弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields();
this.addMsg = {
couponsName: "",
effectDate: "",
expirationDate: "",
couponsType: 1,
groupId: this.groupId,
branchId: "",
lineId: 0,
denomination: "",
overlapUse: 0,
useCondition: "",
id: 0,
couponCount: '',
lineteamId: 0,
couponsUseScope: 1,
couponStatus: 1,
redemptionPrice: '',
} }
});
},
goUrl(name, id) {
this.$router.push({
name: name,
query: { id: id, type: 9, blank: "y", tab: "绑定账户信息" }
});
},
closeChangeMachie(done) {
//弹出框关闭初始化弹框内表单
done();
this.resetForm("addMsg");
},
resetForm(formName) {
//弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields();
this.addMsg = {
couponsName: "",
effectDate: "",
expirationDate: "",
couponsType: 1,
groupId: this.groupId,
branchId: "",
lineId: 0,
denomination: "",
overlapUse: 0,
useCondition: "",
id: 0,
couponCount: '',
lineteamId: 0,
couponsUseScope: 1,
couponStatus: 1,
redemptionPrice:'',
} }
} }
} };
};
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment