Commit e71ac74f by 胡悦
2 parents a4c4e6c1 7253dfcc
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div> <div>
<el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :modal-append-to-body="false" :width="width"> <el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :modal-append-to-body="false" :width="width">
<div style="height:60vh;overflow:auto"> <div :style="{height:height,overflow:'auto'}">
<el-scrollbar v-if="hasScroll"> <el-scrollbar v-if="hasScroll">
<span slot="title"> <span slot="title">
<span class="main-title">{{ title }}</span> <span class="main-title">{{ title }}</span>
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<slot></slot> <slot></slot>
</template> </template>
</div> </div>
<div slot="footer"> <div slot="footer">
<slot name="btn-start"></slot> <slot name="btn-start"></slot>
...@@ -86,6 +85,10 @@ export default { ...@@ -86,6 +85,10 @@ export default {
type:String, type:String,
default:'' default:''
}, },
// modalAppendToBody:{
// type: Boolean,
// default: false
// },
width: { width: {
type: String, type: String,
default: '580px' default: '580px'
...@@ -94,6 +97,10 @@ export default { ...@@ -94,6 +97,10 @@ export default {
type: String, type: String,
default: 'mini' default: 'mini'
}, },
height: {
type: String,
default: ''
},
}, },
methods: { methods: {
...@@ -116,8 +123,9 @@ export default { ...@@ -116,8 +123,9 @@ export default {
// border-bottom: 1px solid #e6e6e6; // border-bottom: 1px solid #e6e6e6;
// padding: 20px 25px; // padding: 20px 25px;
// } // }
.el-dialog-div {
height: 60vh; // .el-dialog-div {
overflow: auto; // height: 60vh;
} // overflow: auto;
// }
</style> </style>
<!-- 选择商品弹窗 --> <!-- 选择商品弹窗 -->
<template> <template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose"> <glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" :height="height" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<el-form :inline="true" :model="searchProForm"> <el-form :inline="true" :model="searchProForm">
<el-form-item label="商品名称:"> <el-form-item label="商品名称:">
<el-input :size="size" v-model="searchProForm.name" placeholder="请输入商品名称" maxlength="20" clearable></el-input> <el-input :size="size" v-model="searchProForm.name" placeholder="请输入商品名称" maxlength="20" clearable></el-input>
...@@ -70,7 +70,11 @@ export default { ...@@ -70,7 +70,11 @@ export default {
selectedProList: { selectedProList: {
type: Array, type: Array,
default: () => [] default: () => []
} },
height: {
type: String,
default: ''
},
}, },
components: { components: {
......
...@@ -65,13 +65,15 @@ ...@@ -65,13 +65,15 @@
</el-input> </el-input>
<span style="color:red;margin-left:15px" v-if="priceFlag">存在零售价低于代金券的商品</span> <span style="color:red;margin-left:15px" v-if="priceFlag">存在零售价低于代金券的商品</span>
</template> </template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
<template slot="goodsHtml"> <template slot="goodsHtml">
<el-radio v-model="editForm.goods" label="1" v-if="apear=='couponAdd'">全部商品可用</el-radio> <el-radio v-model="editForm.goods" label="1" v-if="apear=='couponAdd'">全部商品可用</el-radio>
<el-radio v-model="editForm.goods" label="2" v-if="apear=='couponAdd'">指定商品可用 <el-radio v-model="editForm.goods" label="2" v-if="apear=='couponAdd'">指定商品可用
<el-button type="primary" v-if="editForm.goods == 2" @click="chooseGoods">选择商品</el-button> <el-button type="primary" v-if="editForm.goods == 2" @click="chooseGoods">选择商品</el-button>
</el-radio> </el-radio>
</template> </template>
<div slot="proTable" class="select-pro" v-if="editForm.useChannel == 1"> <!-- 新增时并且为指定商品时显示,编辑或者查看时也显示 -->
<div slot="proTable" class="select-pro" v-if="apear!='couponAdd' || (editForm.useChannel == 1 && editForm.goods == 2)">
<div style="height:110px" v-if="editForm.goodsRefList.length"></div> <div style="height:110px" v-if="editForm.goodsRefList.length"></div>
<GLTable v-show="editForm.goodsRefList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.goodsRefList"> <GLTable v-show="editForm.goodsRefList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.goodsRefList">
<template slot="goodsImage" slot-scope="scope"> <template slot="goodsImage" slot-scope="scope">
...@@ -92,7 +94,7 @@ ...@@ -92,7 +94,7 @@
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button> <el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
<select-muti-pro-forcoupon-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"> <select-muti-pro-forcoupon-dialog v-if="isMutiSelectVisible" :height="dialogHeight" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose">
</select-muti-pro-forcoupon-dialog> </select-muti-pro-forcoupon-dialog>
</div> </div>
</template> </template>
...@@ -119,6 +121,10 @@ export default { ...@@ -119,6 +121,10 @@ export default {
}, },
apear: '', apear: '',
minPirce: '', minPirce: '',
//全部商品时最低价
minPirceForAll: '',
//指定商品时最低价
minPirceForPart: '',
couponTime: '', couponTime: '',
remarksView: [], remarksView: [],
//存在零售价低于代金券的商品 //存在零售价低于代金券的商品
...@@ -236,7 +242,8 @@ export default { ...@@ -236,7 +242,8 @@ export default {
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
} }
] ],
dialogHeight: '60vh'
} }
}, },
...@@ -291,7 +298,6 @@ export default { ...@@ -291,7 +298,6 @@ export default {
} }
}, },
'editForm.useChannel'(newValue, oldValue){ 'editForm.useChannel'(newValue, oldValue){
console.log(newValue);
if(newValue == 1){ if(newValue == 1){
this.editFormData[6].isHide = false this.editFormData[6].isHide = false
}else{ }else{
...@@ -300,6 +306,39 @@ export default { ...@@ -300,6 +306,39 @@ export default {
this.editFormData[6].isHide = true this.editFormData[6].isHide = true
} }
}, },
'editForm.goods'(newValue, oldValue){
if(newValue == 1){//全部商品
// var goods = this.selectedAllProList
// if(goods && goods.length > 0){
// this.minPirce = goods[0].retailPrice
// goods.forEach((item, index) => {
// if(item.retailPrice < this.minPirce){
// this.minPirce = item.retailPrice
// }
// })
// }else{
// this.priceFlag = true
// }
this.minPirce = this.minPirceForAll
}else{//指定商品
// var goods2 = this.editForm.goodsRefList
// if(goods2 && goods2.length > 0){
// this.minPirce = goods2[0].retailPrice*100
// goods2.forEach((item, index) => {
// var retailPrice = item.retailPrice*100
// if(retailPrice < this.minPirce){
// this.minPirce = retailPrice
// }
// })
// }
this.minPirce = this.minPirceForPart
}
if(this.editForm.denomination && this.minPirce && this.editForm.denomination*100 > this.minPirce){
this.priceFlag = true
}else{
this.priceFlag = false
}
},
}, },
methods: { methods: {
...@@ -325,10 +364,16 @@ export default { ...@@ -325,10 +364,16 @@ export default {
const goods = this.$common.utils.deepClone(res.list) const goods = this.$common.utils.deepClone(res.list)
this.selectedAllProList = goods this.selectedAllProList = goods
if(goods && goods.length > 0){ if(goods && goods.length > 0){
this.minPirce = goods[0].retailPrice // this.minPirce = goods[0].retailPrice
// goods.forEach((item, index) => {
// if(item.retailPrice < this.minPirce){
// this.minPirce = item.retailPrice
// }
// })
this.minPirceForAll = goods[0].retailPrice
goods.forEach((item, index) => { goods.forEach((item, index) => {
if(item.retailPrice < this.minPirce){ if(item.retailPrice < this.minPirceForAll){
this.minPirce = item.retailPrice this.minPirceForAll = item.retailPrice
} }
}) })
}else{ }else{
...@@ -354,6 +399,35 @@ export default { ...@@ -354,6 +399,35 @@ export default {
handleMutiSelectConfirm(selectedData) { handleMutiSelectConfirm(selectedData) {
this.editForm.goodsRefList = selectedData this.editForm.goodsRefList = selectedData
/** 选择指定商品时,面值最小值的判断区域应该在已选商品内 start*/
var goods = this.editForm.goodsRefList
// this.minPirce = goods[0].retailPrice*100
// goods.forEach((item, index) => {
// var retailPrice = item.retailPrice*100
// if(retailPrice < this.minPirce){
// this.minPirce = retailPrice
// }
// })
// if(this.editForm.denomination && this.editForm.denomination*100 > this.minPirce){
// this.priceFlag = true
// }else{
// this.priceFlag = false
// }
this.minPirceForPart = goods[0].retailPrice*100
goods.forEach((item, index) => {
var retailPrice = item.retailPrice*100
if(retailPrice < this.minPirceForPart){
this.minPirceForPart = retailPrice
}
})
if(this.editForm.denomination && this.editForm.denomination*100 > this.minPirceForPart){
this.priceFlag = true
}else{
this.priceFlag = false
}
/** 选择指定商品时,面值最小值的判断区域应该在已选商品内 end*/
this.handleMutiSelectClose() this.handleMutiSelectClose()
}, },
...@@ -376,7 +450,11 @@ export default { ...@@ -376,7 +450,11 @@ export default {
}, },
denominationBlur(event){ denominationBlur(event){
console.log('111'); if(this.editForm.goods == 1){//全部商品
this.minPirce = this.minPirceForAll
}else{//指定商品
this.minPirce = this.minPirceForPart
}
if(event.target.value*100 > this.minPirce){ if(event.target.value*100 > this.minPirce){
this.priceFlag = true this.priceFlag = true
}else{ }else{
...@@ -409,12 +487,6 @@ export default { ...@@ -409,12 +487,6 @@ export default {
}) })
}, },
//选择到店核销使用限制默认无使用门槛
clickUseChannel(){
this.editForm.useBarriers = '1'
this.editFormData[6].isHide = true
},
validateRules(){ validateRules(){
var form = this.editForm var form = this.editForm
if(form.effectiveType == '2'){//判断 有效期-日期选择是否验证 if(form.effectiveType == '2'){//判断 有效期-日期选择是否验证
......
...@@ -422,7 +422,7 @@ export default { ...@@ -422,7 +422,7 @@ export default {
.seeEquity { .seeEquity {
position: absolute; position: absolute;
right: 0; right: 0;
bottom: 10px; bottom: 14px;
} }
.cancelBtn { .cancelBtn {
position: absolute; position: absolute;
...@@ -460,7 +460,8 @@ export default { ...@@ -460,7 +460,8 @@ export default {
} }
.address { .address {
display: inline-block; display: inline-block;
max-width: 600px; vertical-align: bottom;
max-width: calc(100% - 220px);
color: #989898; color: #989898;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!