Commit e4a0e3d7 by zhangquan

Merge branch 'v3.7.1' of http://192.168.3.233:8090/glsx-web/sso-equity into v3.7.1

2 parents 8120aba9 5a0c682d
......@@ -154,6 +154,16 @@ const delCouponById = params => {
})
}
const delTemplateById = params => {
params.method = `${defaultPath}template.delete`
return other_http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCouponsList,
createCoupons,
......@@ -168,5 +178,6 @@ export default {
saveTemplate,
saveCouponInfo,
getCouponById,
delCouponById
delCouponById,
delTemplateById
}
......@@ -33,9 +33,9 @@
</div>
<div class="error_coupon">
<div class="coupon_item" v-for="(item, index) in errorCouponList" :key="index">
<img v-if="item.appearance == 1" src="@/assets/coupon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" />
<span class="info">【{{ item.brandName }}{{ item.productName }}{{ item.appearance == 2 ? item.denomination : '' }}】{{ item.newCost }}元</span>
<img class="r-margin" v-if="item.appearance == 1" src="@/assets/coupon.png" alt="" />
<img class="r-margin" v-else src="@/assets/directCharge.png" alt="" />
<span class="info">{{ item.newCost }}元【{{ item.brandName }}{{ item.productName }}{{ item.appearance == 2 ? item.denomination : '' }}】{{couponFormObj.effectiveDays}}天</span>
</div>
</div>
</div>
......@@ -194,7 +194,15 @@ export default {
effectiveDays,
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 => {
loading.close()
if (res && res.length === 0) {
this.$message.success('创建成功')
this.$router.push({ path: '/goodsCoupon/index' })
......@@ -212,8 +220,11 @@ export default {
.container {
background-color: #fff;
padding: 32px 30px;
min-height: calc(100vh - 150px);
min-height: calc(100vh - 190px);
position: relative;
.r-margin{
margin-right: 5px;
}
/deep/ .glsx-combi-form {
padding-bottom: 30px;
}
......
......@@ -307,7 +307,7 @@ export default {
.container {
background-color: #fff;
padding: 20px;
height: calc(100vh - 120px);
height: calc(100vh - 170px);
.good_name {
.coupon_type {
width: 40px;
......
......@@ -25,8 +25,8 @@
<div class="gift_item" v-for="(item, index) in val" :key="index">
<img class="muti_icon" src="@/assets/muti-selected.png" @click="handleGiftDelete(key, item, index)" />
<!-- <img class="muti_icon" src="@/assets/muti-no-select.png" @click="handleGiftDelete(item, index)" /> -->
<el-tooltip effect="dark" placement="top" :disabled="item.goodsName.length <= 8">
<p :class="['gift_coupon_name', 'ellipsis-1', item.status == '3' ? 'txt-grey' : '']">{{ item.goodsName.length > 8 ? item.goodsName.slice(0, 8) + '...' : item.goodsName }}</p>
<el-tooltip effect="dark" placement="top" :disabled="item.goodsName.length <= 7">
<p :class="['gift_coupon_name', 'ellipsis-1', item.status == '3' ? 'txt-grey' : '']">{{ item.goodsName.length > 7 ? item.goodsName.slice(0, 7) + '...' : item.goodsName }}</p>
<div slot="content">{{ item.goodsName }}</div>
</el-tooltip>
<div class="gift_sum">
......
......@@ -2,14 +2,14 @@
<div class="container">
<div class="nav">
<div style="display: inline-block;">
<div class="configItem" :ref="'tempRef'+index" v-for="(item,index) in rowList" :key="item.id" @click="selectedTemp(item)" :class="{curConfigItem:curConfigId==item.id}">{{ item.name }}</div>
<div class="configItem" :ref="'tempRef'+index" v-for="(item,index) in rowList" :key="item.id" @click="selectedTemp(item)" :class="{curConfigItem:curConfigId==item.id}">{{ item.name }}<i class="el-icon-close delIcon" @click.stop="delTemplate(item)"></i></div>
</div>
<div v-if="showInput" class="inputArea"><el-input maxLength="15" ref="addInput" @blur="inputBlur" v-model="configName" class="input"></el-input></div>
<div v-else class="configItem addBtn" style="cursor: pointer;" @click="addTemplate"><i class="el-icon-plus"></i></div>
<div v-if="curIdx > -1" class="configItem pullBtn" style="cursor: pointer;">
<i class="el-icon-arrow-down"></i>
<div v-else class="configItem addBtn" style="cursor: pointer;" @click="addTemplate"><i class="el-icon-plus border"></i></div>
<div v-if="colList && colList.length" class="configItem pullBtn" style="cursor: pointer;">
<i class="el-icon-arrow-down border"></i>
<div class="pullDownArea">
<div class="pullDownItem" @click="selectedTemp(item, 'sort')" :class="{curConfigItem:curConfigId==item.id}" v-for="item in colList" :key="item.id">{{ item.name }}</div>
<div class="pullDownItem" @click="selectedTemp(item, 'sort')" :class="{curConfigItem:curConfigId==item.id}" v-for="item in colList" :key="item.id">{{ item.name }}<i class="el-icon-close delIcon" @click.stop="delTemplate(item)"></i></div>
</div>
</div>
</div>
......@@ -121,7 +121,18 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
},
mounted(){
this.getTemplateList()
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass:'loadingClass'
})
this.getTemplateList().then(res=>{
loading.close()
}).catch(err=>{
loading.close()
})
window.addEventListener('resize', this.resizeDom);
},
beforeDestroy(){
......@@ -131,6 +142,24 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
resizeDom(){
this.calcWidth(true)
},
delTemplate(row){
this.$confirm(`确认删除${row.name}吗?`, '提示', {
type: 'warning',
callback: action => {
if(action=='confirm'){
let params = {
id: row.id
}
this.$apis.goodsCouponApi.delTemplateById(params).then(res => {
if(res){
this.$message.success('删除成功')
this.getTemplateList()
}
})
}
}
})
},
delCoupon(row){
this.$confirm('确认删除吗?', '提示', {
type: 'warning',
......@@ -151,14 +180,19 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
})
},
getTemplateList(){
this.$apis.goodsCouponApi.getTemplateList({pageSize: 10000, pageNum: 1}).then(res => {
if(res?.list?.length){
this.curConfigId = res.list[0]?.id
this.handleOk()
this.templateList = res.list
this.rowList = res.list
this.calcWidth()
}
return new Promise((resolve, reject) => {
this.$apis.goodsCouponApi.getTemplateList({pageSize: 10000, pageNum: 1}).then(res => {
resolve(res)
if(res?.list?.length){
this.curConfigId = res.list[0]?.id
this.handleOk()
this.templateList = res.list
this.rowList = res.list
this.calcWidth()
}
}).catch(err=>{
reject(err)
})
})
},
addTemplate(){
......@@ -273,6 +307,11 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
letter-spacing: 0;
text-align: center;
cursor: pointer;
.delIcon{
font-size: 12px;
color: #666;
margin-left: 12px;
}
}
.curConfigItem{
background-color: #fff;
......@@ -284,7 +323,7 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
box-sizing: border-box;
padding: 0;
position: relative;
i{
.border{
border: 1px dashed #999;
color: #999;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!