Commit 03f8e2e5 by zhangquan

优惠券开发

1 parent 41316fd6
...@@ -74,6 +74,15 @@ const couponUserCancelApi = params => { ...@@ -74,6 +74,15 @@ const couponUserCancelApi = params => {
}) })
} }
const detailExportApi = params => {
params.method = `${defaultPath}equity.exportReceiveRecord`
return other_http({
url,
data: params,
sign: true
})
}
export default { export default {
getCouponsList, getCouponsList,
createCoupons, createCoupons,
...@@ -81,5 +90,6 @@ export default { ...@@ -81,5 +90,6 @@ export default {
getListReceiveRecordApi, getListReceiveRecordApi,
getCouponDetailApi, getCouponDetailApi,
deleteCouponApi, deleteCouponApi,
couponUserCancelApi couponUserCancelApi,
detailExportApi
} }
.equity-wrap .contain { .equity-wrap .contain {
background: #FFFFFF; background: #ffffff;
// margin: 0 0 20px 0; // margin: 0 0 20px 0;
padding: 20px 15px; padding: 20px 15px;
// box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10); // box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
} }
.equity-wrap .contain .el-table__empty-text{ .equity-wrap .contain .el-table__empty-text {
display: inline-block; display: inline-block;
width: 64px; width: 64px;
height: 41px; height: 41px;
} }
.fr-mr0 { .fr-mr0 {
float: right; float: right;
margin-right: 0px!important; margin-right: 0px !important;
} }
// 单行省略 // 单行省略
.ellipsis-1 { .ellipsis-1 {
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
-o-text-overflow: ellipsis; -o-text-overflow: ellipsis;
/* for Opera */ /* for Opera */
} }
.mb10{ .mb10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
// 我这里以两行为例,该方法基本兼容市场上面所有主流浏览器。 // 我这里以两行为例,该方法基本兼容市场上面所有主流浏览器。
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
} }
.ellipsis-2-text:after { .ellipsis-2-text:after {
content: "..."; content: '...';
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 15px; right: 15px;
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
background: -moz-linear-gradient(left, transparent, #fff 55%); background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%); background: linear-gradient(to right, transparent, #fff 55%);
} }
.el-scrollbar__bar.is-horizontal{ .el-scrollbar__bar.is-horizontal {
height: 10px !important; height: 10px !important;
left: 10px; left: 10px;
} }
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
.equity-wrap .table-btns .el-button { .equity-wrap .table-btns .el-button {
padding: 0 0 0 5px; padding: 0 0 0 5px;
margin-left: 5px; margin-left: 5px;
border-left: 1px solid #DCDFE6; border-left: 1px solid #dcdfe6;
border-radius: 0; border-radius: 0;
} }
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
height: 64px; height: 64px;
text-align: center; text-align: center;
line-height: 64px; line-height: 64px;
background: #FFFFFF; background: #ffffff;
z-index: 999; z-index: 999;
} }
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
height: 48px; height: 48px;
line-height: 48px; line-height: 48px;
// color: #0947C6; // color: #0947C6;
border-bottom: 1px solid #E7EAEC; border-bottom: 1px solid #e7eaec;
// padding-left: 20px; // padding-left: 20px;
margin: 0 0; margin: 0 0;
} }
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
width: 4px; width: 4px;
top: 2px; top: 2px;
left: 0; left: 0;
background-color: #0947C6; background-color: #0947c6;
} }
.equity-wrap .edit-sub-title { .equity-wrap .edit-sub-title {
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
margin: 0 0 30px 0; margin: 0 0 30px 0;
padding-left: 8px; padding-left: 8px;
} }
.find_wrap{ .find_wrap {
background: #ffffff; background: #ffffff;
padding: 20px 15px; padding: 20px 15px;
// padding: 20px 20px 0px 20px; // padding: 20px 20px 0px 20px;
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
margin-bottom: 10px; margin-bottom: 10px;
margin-right: 2px; margin-right: 2px;
} }
.pannel{ .pannel {
padding: 0 15px; padding: 0 15px;
} }
.table_wrap { .table_wrap {
...@@ -153,33 +153,33 @@ ...@@ -153,33 +153,33 @@
width: 100%; width: 100%;
} }
} }
.flex_sc{ .flex_sc {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.flex_cc{ .flex_cc {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.flex_scb{ .flex_scb {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.table_point{ .table_point {
width: 6px; width: 6px;
height: 6px; height: 6px;
border-radius: 50%; border-radius: 50%;
margin-right: 8px; margin-right: 8px;
} }
.loadingClass{ .loadingClass {
.el-icon-loading{ .el-icon-loading {
font-size: 22px; font-size: 22px;
} }
.el-icon-loading, .el-icon-loading,
.el-loading-text{ .el-loading-text {
color: #fff!important; color: #fff !important;
} }
} }
// .equity-wrap table { // .equity-wrap table {
...@@ -209,3 +209,23 @@ ...@@ -209,3 +209,23 @@
// .equity-wrap table td { // .equity-wrap table td {
// min-width: 50px; // min-width: 50px;
// } // }
.operate_wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table_title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate_btn {
.export_btn {
margin-left: 8px;
}
}
}
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" /> <img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" /> <img v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }} {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }}
<!-- {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.rechargeDenomination ? Number((Number(scope.scope.rechargeDenomination) / 100).toFixed(2)) + '元' : '') : scope.scope.productName }} -->
</div> </div>
<div class="conpon_cost" slot="conponCost" slot-scope="scope"> <div class="conpon_cost" slot="conponCost" slot-scope="scope">
<el-input :class="{ lowerZero: Number(scope.scope.newCost) <= 0 || Number(scope.scope.newCost) >= Number(scope.scope.salesPrice) }" v-model="scope.scope.newCost" @input="formatNum(scope.scope.id, scope.scope.newCost)" /> <el-input :class="{ lowerZero: Number(scope.scope.newCost) <= 0 || Number(scope.scope.newCost) >= Number(scope.scope.salesPrice) }" v-model="scope.scope.newCost" @input="formatNum(scope.scope.id, scope.scope.newCost)" />
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
<div class="btn"> <div class="btn">
<el-button type="primary" @click="commit()">创建优惠券</el-button> <el-button type="primary" @click="commit()">创建优惠券</el-button>
</div> </div>
<GLDialog class="error_ctnr" title="提示" mode="small" :hasFooter="false" :visible.sync="errorVisible" :show-close="true" :before-close="closeErrorDialog" :close-on-click-modal="false"> <GLDialog class="error_ctnr" title="提示" mode="small" :hasFooter="false" :visible.sync="errorVisible" :show-close="true" :before-close="closeErrorDialog" :close-on-click-modal="true">
<div> <div>
<div class="title"> <div class="title">
<i class="el-icon-warning icon"></i> <i class="el-icon-warning icon"></i>
...@@ -187,8 +188,8 @@ export default { ...@@ -187,8 +188,8 @@ export default {
console.log(target) console.log(target)
if (target) return this.$message.error('请填写大于0,小于会员价的券面额') if (target) return this.$message.error('请填写大于0,小于会员价的券面额')
let equityCouponRequestList = selectedGoodsList.map(item => { let equityCouponRequestList = selectedGoodsList.map(item => {
let { brandName, id: goodId, productName: goodsName, appearance, newCost } = item let { brandName, id: goodId, productName: goodsName, appearance, denomination: rechargeDenomination, newCost } = item
return { brandName, goodId, goodsName, appearance, denomination: parseInt(Number(newCost) * 100) } return { brandName, goodId, goodsName, appearance, denomination: parseInt(Number(newCost) * 100), rechargeDenomination }
}) })
const params = { const params = {
effectiveDays, effectiveDays,
......
...@@ -8,14 +8,15 @@ ...@@ -8,14 +8,15 @@
<span :class="['type', { active_type: curType == '2' }]" @click="changeConponType(2)">直充</span> <span :class="['type', { active_type: curType == '2' }]" @click="changeConponType(2)">直充</span>
</div> </div>
<div class="dialog_table"> <div class="dialog_table">
<GLTable :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi"> <GLTable v-if="showTable" :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div class="good_name" slot="goodName" slot-scope="scope"> <div class="good_name" slot="goodName" slot-scope="scope">
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" /> <img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" /> <img v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }} <!-- {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }} -->
{{ scope.scope.productName }}
</div> </div>
<div slot="spreadPrice" slot-scope="scope"> <div slot="spreadPrice" slot-scope="scope">
<span>{{ Number((scope.scope.lineationPrice - scope.scope.costPrice).toFixed(2)) }}</span> <span :style="{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice) <= 0 ? '#eb4e4e' : '#666666' }">{{ Number(Number(scope.scope.lineationPrice - scope.scope.costPrice).toFixed(2)) }}</span>
</div> </div>
</GLTable> </GLTable>
</div> </div>
...@@ -124,6 +125,7 @@ export default { ...@@ -124,6 +125,7 @@ export default {
data() { data() {
return { return {
curType: 1, curType: 1,
showTable: true,
copyList: [], copyList: [],
pageSizes: [5, 10, 20, 30, 40], pageSizes: [5, 10, 20, 30, 40],
dialogSearchForm: { dialogSearchForm: {
...@@ -183,9 +185,18 @@ export default { ...@@ -183,9 +185,18 @@ export default {
}, },
changeConponType(type) { changeConponType(type) {
if (this.curType == type) return if (this.curType == type) return
this.showTable = false
this.curType = type this.curType = type
this.$set(this.tableParams, 'tableColumns', type == 2 ? [...dialogColumns1] : [...dialogColumns]) this.$nextTick()
.then(() => {
this.tableParams['tableColumns'] = type == 2 ? [...dialogColumns1] : [...dialogColumns]
})
.then(() => {
this.showTable = true
this.handleRest(type) this.handleRest(type)
})
// this.$set(this.tableParams, 'tableColumns', type == 2 ? [...dialogColumns1] : [...dialogColumns])
}, },
onOk() { onOk() {
let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || [] let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || []
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="good_name" slot="goodsName" slot-scope="scope"> <div class="good_name" slot="goodsName" slot-scope="scope">
<img class="conpon_type" v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" /> <img class="conpon_type" v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img class="conpon_type" v-else src="@/assets/directCharge.png" alt="" /> <img class="conpon_type" v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.goodsName + (scope.scope.denomination ? (Number(scope.scope.denomination) / 100).toFixed(2) + '元' : '0元') : scope.scope.goodsName }} {{ scope.scope.appearance == 2 ? scope.scope.goodsName + (scope.scope.rechargeDenomination || '') : scope.scope.goodsName }}
</div> </div>
<div class="good_status" slot="goodStatus" slot-scope="scope"> <div class="good_status" slot="goodStatus" slot-scope="scope">
<span class="circle" :style="{ 'background-color': scope.scope.status == 2 ? '#5850FF' : '#999999' }"></span> <span class="circle" :style="{ 'background-color': scope.scope.status == 2 ? '#5850FF' : '#999999' }"></span>
...@@ -314,24 +314,5 @@ export default { ...@@ -314,24 +314,5 @@ export default {
margin-right: 4px; margin-right: 4px;
} }
} }
.operate_wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table_title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate_btn {
.export_btn {
margin-left: 8px;
}
}
}
} }
</style> </style>
...@@ -2,20 +2,29 @@ ...@@ -2,20 +2,29 @@
<div class="container"> <div class="container">
<div class="info_ctnr"> <div class="info_ctnr">
<glsx-combi-form :isInline="true" ref="couponInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="conponInfoFormObj" :formData="conponInfoFormData" :formRules="conponInfoRule"> <glsx-combi-form :isInline="true" ref="couponInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="conponInfoFormObj" :formData="conponInfoFormData" :formRules="conponInfoRule">
<div slot="appearance" slot-scope="scope"> <div slot="goodsName" class="txt">
{{ scope.scope.appearance == 1 ? '卡券' : '直充' }} {{ conponInfoFormObj.appearance == 2 ? conponInfoFormObj.goodsName + (conponInfoFormObj.goodsName || '') : conponInfoFormObj.goodsName }}
</div>
<div slot="appearance" class="txt">
{{ conponInfoFormObj.appearance == 1 ? '卡券' : '直充' }}
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="table_ctnr"> <div class="table_ctnr">
<GLCombiForm ref="searchRef" :formObj="searchForm" :formData="searchFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm> <GLCombiForm ref="searchRef" :formObj="searchForm" :formData="searchFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<el-button plain size="small" style="float:right;margin-bottom:10px;" @click="handleExport">导出</el-button> <div class="operate_wrap">
<span class="table_title">领取详情列表</span>
<div class="operate_btn">
<el-button plain size="small" @click="handleExport">导出</el-button>
</div>
</div>
<GLTable :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="userStatus" slot-scope="scope"> <div slot="userStatus" slot-scope="scope">
<span class="circle" :style="{ 'background-color': scope.scope.userStatus == 1 ? '#2cca74' : scope.scope.userStatus == 2 ? '#eb4e4e' : '#999999' }"></span> <span class="circle" :style="{ 'background-color': scope.scope.userStatus == 1 ? '#2cca74' : scope.scope.userStatus == 2 ? '#eb4e4e' : '#999999' }"></span>
<span> <span>
{{ statusList.find(item => item.id == scope.scope.userStatus).label }} {{ statusList.find(item => item.id == scope.scope.userStatus).label }}
</span> </span>
<p v-if="scope.scope.userStatus == 4">{{ scope.scope.cancelReason || '' }}</p>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
...@@ -108,7 +117,7 @@ export default { ...@@ -108,7 +117,7 @@ export default {
{ {
label: '商品名称', label: '商品名称',
name: 'goodsName', name: 'goodsName',
type: 'showTxt' addHtml: 'goodsName'
}, },
{ {
label: '商品形态', label: '商品形态',
...@@ -262,7 +271,7 @@ export default { ...@@ -262,7 +271,7 @@ export default {
// 导出 // 导出
handleExport() { handleExport() {
let params = this.getParams() let params = this.getParams()
this.$apis.beforeSale.getExportApi(params).then(res => { this.$apis.goodsConponApi.detailExportApi(params).then(res => {
let tempaa = this.getExplorer() let tempaa = this.getExplorer()
if (tempaa == 'QQ') { if (tempaa == 'QQ') {
window.open(res) window.open(res)
...@@ -322,7 +331,8 @@ export default { ...@@ -322,7 +331,8 @@ export default {
padding: 20px; padding: 20px;
background-color: #fff; background-color: #fff;
} }
/deep/ .showTxt { /deep/ .showTxt,
.txt {
width: 200px; width: 200px;
} }
.circle { .circle {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!