Commit 1a516320 by 前端

Merge branch 'v3.7.1' into 'master'

V3.7.1

See merge request !15
2 parents 5f24d8bf e4a0e3d7
...@@ -101,6 +101,14 @@ const exportcardRecordList = params => { ...@@ -101,6 +101,14 @@ const exportcardRecordList = params => {
}) })
} }
const exportExchangCodeApi = params => {
params.method = `scrm.api.equity.card.class.exchange.code.export`
return http({
data: params,
sign: true
})
}
export default { export default {
getEquityCardList, getEquityCardList,
newEquityCard, newEquityCard,
...@@ -114,5 +122,6 @@ export default { ...@@ -114,5 +122,6 @@ export default {
getCollectionMerchantList, getCollectionMerchantList,
getQrUrl, getQrUrl,
getcardRecordList, getcardRecordList,
exportcardRecordList exportcardRecordList,
exportExchangCodeApi
} }
...@@ -95,6 +95,75 @@ const effectiveCouponApi = params => { ...@@ -95,6 +95,75 @@ const effectiveCouponApi = params => {
}) })
} }
// 获取模板配置
const getTemplateList = params => {
params.method = `${defaultPath}template.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板配置
const saveTemplate = params => {
params.method = `${defaultPath}template.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 保存模板下的优惠券
const saveCouponInfo = params => {
params.method = `${defaultPath}template.details.save`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取模板下的优惠券列表
const getCouponById = params => {
if(!params.templateId) {
return new Promise((resolve, reject)=>{
reject()
})
};
params.method = `${defaultPath}template.details.page`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delCouponById = params => {
params.method = `${defaultPath}template.details.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
const delTemplateById = params => {
params.method = `${defaultPath}template.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
getCouponsList, getCouponsList,
createCoupons, createCoupons,
...@@ -104,5 +173,11 @@ export default { ...@@ -104,5 +173,11 @@ export default {
deleteCouponApi, deleteCouponApi,
couponUserCancelApi, couponUserCancelApi,
detailExportApi, detailExportApi,
effectiveCouponApi effectiveCouponApi,
getTemplateList,
saveTemplate,
saveCouponInfo,
getCouponById,
delCouponById,
delTemplateById
} }
...@@ -195,6 +195,13 @@ const getShortLinkUUID = params => { ...@@ -195,6 +195,13 @@ const getShortLinkUUID = params => {
returnAll: true returnAll: true
}) })
} }
const openSaleApi = params => {
params.method = 'scrm.api.equity.goods.update.allow.sale'
return http({
data: params
})
}
export default { export default {
getBalanceList, getBalanceList,
getOrderList, getOrderList,
...@@ -221,4 +228,5 @@ export default { ...@@ -221,4 +228,5 @@ export default {
exportGasList, exportGasList,
createShortLink, createShortLink,
getShortLinkUUID, getShortLinkUUID,
openSaleApi
} }
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
<div class="table_point" :style="{ background: colors[scope.scope.status] }"></div> <div class="table_point" :style="{ background: colors[scope.scope.status] }"></div>
<span>{{ ['待上架', '上架', '下架'][scope.scope.status] }}</span> <span>{{ ['待上架', '上架', '下架'][scope.scope.status] }}</span>
</div> </div>
<div slot="openSaleSlot" slot-scope="scope">
<el-switch
:value="scope.scope.allowSaleFlag==1" :active-text="scope.scope.allowSaleFlag==1 ? '开放': '关闭'" @change="openSaleFn(scope.scope)">
</el-switch>
</div>
<div slot="table-btns" slot-scope="scope"> <div slot="table-btns" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div> </div>
...@@ -168,10 +173,26 @@ export default { ...@@ -168,10 +173,26 @@ export default {
type: 'text', type: 'text',
fn: '编辑商品' fn: '编辑商品'
}, },
// condition: row => {
// return true
// },
listeners: { listeners: {
click: row => this.jump(row.scope) click: row => this.jump(row.scope)
} }
}, },
// {
// type: 'el-button',
// name: row => {
// return '开放出售'
// },
// attrs: {
// type: 'text',
// fn: '开放出售'
// },
// listeners: {
// click: row => this.jump(row.scope)
// }
// },
{ {
type: 'GLButton', type: 'GLButton',
name: row => { name: row => {
...@@ -282,6 +303,11 @@ export default { ...@@ -282,6 +303,11 @@ export default {
// } // }
}, },
{ {
label: '销售状态',
width: 140,
addHtml: 'openSaleSlot'
},
{
label: '操作', label: '操作',
width: 170, width: 170,
fixed: 'right', fixed: 'right',
...@@ -371,6 +397,19 @@ export default { ...@@ -371,6 +397,19 @@ export default {
item.optionList = res.data item.optionList = res.data
}) })
}, },
openSaleFn(row){
const params = {
id: row.id,
allowSaleFlag: row.allowSaleFlag == 1 ? 2: 1
}
this.$apis.orderApi.openSaleApi(params).then(res => {
console.log(res)
if(res) {
this.$message.success('操作成功')
this.handleSearch()
}
})
},
jump({ id, status }, copy) { jump({ id, status }, copy) {
// let params = {} // let params = {}
// if (id) params.id = id // if (id) params.id = id
...@@ -536,6 +575,9 @@ export default { ...@@ -536,6 +575,9 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 16px 20px; padding: 16px 20px;
border-radius: 0 4px 4px 4px; border-radius: 0 4px 4px 4px;
/deep/ .el-switch__label{
color: #666;
}
} }
.con-wrap { .con-wrap {
......
...@@ -29,13 +29,13 @@ ...@@ -29,13 +29,13 @@
<div> <div>
<div class="title"> <div class="title">
<i class="el-icon-warning icon"></i> <i class="el-icon-warning icon"></i>
<div class="tip">以下品牌商品优惠券面额已存在,请修改面额或删除</div> <div class="tip">以下面额的品牌商品优惠券,已存在相同有效期,请修改有效期或删除</div>
</div> </div>
<div class="error_coupon"> <div class="error_coupon">
<div class="coupon_item" v-for="(item, index) in errorCouponList" :key="index"> <div class="coupon_item" v-for="(item, index) in errorCouponList" :key="index">
<img v-if="item.appearance == 1" src="@/assets/coupon.png" alt="" /> <img class="r-margin" v-if="item.appearance == 1" src="@/assets/coupon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" /> <img class="r-margin" v-else src="@/assets/directCharge.png" alt="" />
<span class="info">【{{ item.brandName }}{{ item.productName }}{{ item.appearance == 2 ? item.denomination : '' }}】{{ item.newCost }}元</span> <span class="info">{{ item.newCost }}元【{{ item.brandName }}{{ item.productName }}{{ item.appearance == 2 ? item.denomination : '' }}】{{couponFormObj.effectiveDays}}天</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -194,7 +194,15 @@ export default { ...@@ -194,7 +194,15 @@ export default {
effectiveDays, effectiveDays,
equityCouponRequestList equityCouponRequestList
} }
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass:'loadingClass'
})
this.$apis.goodsCouponApi.createCoupons(params).then(res => { this.$apis.goodsCouponApi.createCoupons(params).then(res => {
loading.close()
if (res && res.length === 0) { if (res && res.length === 0) {
this.$message.success('创建成功') this.$message.success('创建成功')
this.$router.push({ path: '/goodsCoupon/index' }) this.$router.push({ path: '/goodsCoupon/index' })
...@@ -212,8 +220,11 @@ export default { ...@@ -212,8 +220,11 @@ export default {
.container { .container {
background-color: #fff; background-color: #fff;
padding: 32px 30px; padding: 32px 30px;
min-height: calc(100vh - 150px); min-height: calc(100vh - 190px);
position: relative; position: relative;
.r-margin{
margin-right: 5px;
}
/deep/ .glsx-combi-form { /deep/ .glsx-combi-form {
padding-bottom: 30px; padding-bottom: 30px;
} }
......
...@@ -307,7 +307,7 @@ export default { ...@@ -307,7 +307,7 @@ export default {
.container { .container {
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
height: calc(100vh - 120px); height: calc(100vh - 170px);
.good_name { .good_name {
.coupon_type { .coupon_type {
width: 40px; width: 40px;
......
...@@ -81,6 +81,10 @@ const activeTypeList = [ ...@@ -81,6 +81,10 @@ const activeTypeList = [
{ {
confId: 12, confId: 12,
confName: '无忧服务' confName: '无忧服务'
},
{
confId: 14,
confName: '兑换码兑换'
} }
] ]
export default { export default {
......
...@@ -201,6 +201,26 @@ ...@@ -201,6 +201,26 @@
<el-button @click="submitForm('ruleForm')" size="small" type="primary">确定</el-button> <el-button @click="submitForm('ruleForm')" size="small" type="primary">确定</el-button>
</div> </div>
</el-drawer> </el-drawer>
<GLDialog
class="codeDialog"
mode="small"
title="会员兑换码"
@onOk="downLoadExchangeCode"
okText="确认并生成excel文件"
cancelText="取消"
:before-close="closeCodeDialog"
@onCancel="closeCodeDialog"
:visible.sync="dialogShow">
<div class="codeNumArea">
<el-form ref="codeRef" label-width="154px" :rules="codeRules" :model="codeForm">
<el-form-item label="生成数量:" prop="amount" class="m-t-20">
<el-input type="text" maxLength="5" v-model="codeForm.amount" oninput="value=value.replace(/^0/g,'').replace(/[^\d]/g,'')" placeholder="请输入生成数量"></el-input>
</el-form-item>
</el-form>
<!-- <label for="">生成数量:</label>
<el-input type="text" maxLength="5" oninput="value=value.replace(/^0/g,'').replace(/[^\d]/g,'')" placeholder="请输入生成数量"></el-input> -->
</div>
</GLDialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -229,6 +249,27 @@ export default { ...@@ -229,6 +249,27 @@ export default {
data() { data() {
return { return {
url: url, url: url,
dialogShow: false,
codeForm: {
id: '',
amount: ''
},
codeRules: {
amount: [
{
required: true,
// validator: (rule, value, callback) => {
// if (!value || (value && !value.trim())) {
// return callback(new Error('请输入作废原因'))
// } else {
// return callback()
// }
// },
message: '请输入生成数量',
trigger: 'change'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
hasTryNum: '', hasTryNum: '',
value: false, value: false,
...@@ -313,6 +354,18 @@ export default { ...@@ -313,6 +354,18 @@ export default {
listeners: { listeners: {
click: row => this.copy(row.scope) click: row => this.copy(row.scope)
} }
},
{
type: 'el-button',
name: row => {
return '生成兑换码'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.openDialog(row.scope)
}
} }
], ],
product: [ product: [
...@@ -454,6 +507,52 @@ export default { ...@@ -454,6 +507,52 @@ export default {
} }
}, },
methods: { methods: {
downLoadExchangeCode(){
this.$refs.codeRef.validate(valid => {
if (valid) {
var params = {
amount: this.codeForm.amount,
cardClassId: this.codeForm.id,
}
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass:'loadingClass'
})
this.$apis.equityApi.exportExchangCodeApi(params).then(res => {
loading.close()
// window.open(res)
this.closeCodeDialog()
this.$message.success('生成兑换码成功!')
let tempaa = this.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
}).catch(err=> {
loading.close()
})
}
})
},
closeCodeDialog(){
this.dialogShow = !this.dialogShow
this.codeForm.id = ''
this.codeForm.amount = ''
},
openDialog(row){
this.codeForm.id = row.id
this.dialogShow = true
this.$nextTick(()=>{
this.$refs?.codeRef?.clearValidate()
})
},
handleDetail(row) { handleDetail(row) {
this.$refs.detailDetailRef.show(row) this.$refs.detailDetailRef.show(row)
// this.getcardRecordList() // this.getcardRecordList()
...@@ -962,4 +1061,21 @@ export default { ...@@ -962,4 +1061,21 @@ export default {
margin-right: 12px; margin-right: 12px;
} }
} }
.codeDialog{
.el-dialog__body{
display: flex;
align-items: center;
justify-content: center;
.codeNumArea{
display: flex;
align-items: center;
label{
white-space: nowrap;
}
/deep/ .el-input{
width: 284px;
}
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!