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 => { ...@@ -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 { export default {
getCouponsList, getCouponsList,
createCoupons, createCoupons,
...@@ -168,5 +178,6 @@ export default { ...@@ -168,5 +178,6 @@ export default {
saveTemplate, saveTemplate,
saveCouponInfo, saveCouponInfo,
getCouponById, getCouponById,
delCouponById delCouponById,
delTemplateById
} }
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
</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;
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<div class="gift_item" v-for="(item, index) in val" :key="index"> <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-selected.png" @click="handleGiftDelete(key, item, index)" />
<!-- <img class="muti_icon" src="@/assets/muti-no-select.png" @click="handleGiftDelete(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"> <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 > 8 ? item.goodsName.slice(0, 8) + '...' : item.goodsName }}</p> <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> <div slot="content">{{ item.goodsName }}</div>
</el-tooltip> </el-tooltip>
<div class="gift_sum"> <div class="gift_sum">
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<div class="container"> <div class="container">
<div class="nav"> <div class="nav">
<div style="display: inline-block;"> <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>
<div v-if="showInput" class="inputArea"><el-input maxLength="15" ref="addInput" @blur="inputBlur" v-model="configName" class="input"></el-input></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-else class="configItem addBtn" style="cursor: pointer;" @click="addTemplate"><i class="el-icon-plus border"></i></div>
<div v-if="curIdx > -1" class="configItem pullBtn" style="cursor: pointer;"> <div v-if="colList && colList.length" class="configItem pullBtn" style="cursor: pointer;">
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down border"></i>
<div class="pullDownArea"> <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> </div>
</div> </div>
...@@ -121,7 +121,18 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -121,7 +121,18 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
}, },
mounted(){ 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); window.addEventListener('resize', this.resizeDom);
}, },
beforeDestroy(){ beforeDestroy(){
...@@ -131,6 +142,24 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -131,6 +142,24 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
resizeDom(){ resizeDom(){
this.calcWidth(true) 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){ delCoupon(row){
this.$confirm('确认删除吗?', '提示', { this.$confirm('确认删除吗?', '提示', {
type: 'warning', type: 'warning',
...@@ -151,7 +180,9 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -151,7 +180,9 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
}) })
}, },
getTemplateList(){ getTemplateList(){
return new Promise((resolve, reject) => {
this.$apis.goodsCouponApi.getTemplateList({pageSize: 10000, pageNum: 1}).then(res => { this.$apis.goodsCouponApi.getTemplateList({pageSize: 10000, pageNum: 1}).then(res => {
resolve(res)
if(res?.list?.length){ if(res?.list?.length){
this.curConfigId = res.list[0]?.id this.curConfigId = res.list[0]?.id
this.handleOk() this.handleOk()
...@@ -159,6 +190,9 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -159,6 +190,9 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
this.rowList = res.list this.rowList = res.list
this.calcWidth() this.calcWidth()
} }
}).catch(err=>{
reject(err)
})
}) })
}, },
addTemplate(){ addTemplate(){
...@@ -273,6 +307,11 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -273,6 +307,11 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
letter-spacing: 0; letter-spacing: 0;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
.delIcon{
font-size: 12px;
color: #666;
margin-left: 12px;
}
} }
.curConfigItem{ .curConfigItem{
background-color: #fff; background-color: #fff;
...@@ -284,7 +323,7 @@ import selectCouponDialog from './components/selectCouponDialog.vue' ...@@ -284,7 +323,7 @@ import selectCouponDialog from './components/selectCouponDialog.vue'
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
position: relative; position: relative;
i{ .border{
border: 1px dashed #999; border: 1px dashed #999;
color: #999; color: #999;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!