Commit d55f1bb5 by zhouzy

修改剩下的bug

1 parent 13c0649a
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
> >
<el-input <el-input
v-model="ruleForm.cardClassName" v-model="ruleForm.cardClassName"
maxlength="10" maxlength="15"
type="text" type="text"
size="mini" size="mini"
></el-input> ></el-input>
...@@ -108,9 +108,9 @@ ...@@ -108,9 +108,9 @@
<div <div
v-for="(item,index) in product" v-for="(item,index) in product"
:key="index" :key="index"
:id=item.id :id="item.id"
@click="changeStyle(item.id,item.src)" @click="changeStyle(item.id,item.src)"
class="imgCtn" :class="{'imgCtn': true, 'imgBg': item.src === ruleForm.backgroundImage }"
> >
<img <img
:src="item.imgSrc" :src="item.imgSrc"
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="渠道门店" label="渠道门店"
prop="merchantId" prop="merchantName"
> >
<el-select <el-select
v-model="ruleForm.merchantName" v-model="ruleForm.merchantName"
...@@ -141,21 +141,6 @@ ...@@ -141,21 +141,6 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<!-- <el-select
v-model="ruleForm.merchantName"
filterable
placeholder="请选择门店"
size="mini"
@change="changeStore"
>
<el-option
v-for="(item,index) in storeOptions"
:key="index"
:label="item.name"
:value="item.name"
>
</el-option>
</el-select> -->
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="有效期:" label="有效期:"
...@@ -337,18 +322,18 @@ export default { ...@@ -337,18 +322,18 @@ export default {
}, },
{ {
id: "secondImg", id: "secondImg",
imgSrc: require("./images/yiquan.jpg"), imgSrc: require("./images/card1.jpg"),
src: "./images/yiquan.jpg" src: "./images/card1.jpg"
}, },
{ {
id: "thirdImg", id: "thirdImg",
imgSrc: require("./images/yiquan.jpg"), imgSrc: require("./images/card2.jpg"),
src: "./images/yiquan.jpg" src: "./images/card2.jpg"
}, },
{ {
id: "forthImg", id: "forthImg",
imgSrc: require("./images/yiquan.jpg"), imgSrc: require("./images/card3.jpg"),
src: "./images/yiquan.jpg" src: "./images/card3.jpg"
}, },
], ],
rules: { rules: {
...@@ -363,7 +348,7 @@ export default { ...@@ -363,7 +348,7 @@ export default {
{ required: true, message: '请选择卡片', trigger: 'change' } { required: true, message: '请选择卡片', trigger: 'change' }
], ],
usageNotes: [ usageNotes: [
{ min: 0, max: 10, message: '请输入500字以内的名称', trigger: 'blur' } { min: 0, max: 500, message: '请输入500字以内的名称', trigger: 'blur' }
], ],
merchantName: [ merchantName: [
{ required: true, message: '请选择门店', trigger: 'change' } { required: true, message: '请选择门店', trigger: 'change' }
...@@ -405,7 +390,7 @@ export default { ...@@ -405,7 +390,7 @@ export default {
if (cellValue.effectiveType == 1) { if (cellValue.effectiveType == 1) {
return '长期有效' return '长期有效'
} else if (cellValue.effectiveType == 2) { } else if (cellValue.effectiveType == 2) {
return '领取后' + cellValue.effectiveNum + '天永久有效' return '领取后' + cellValue.effectiveNum + '天内有效'
} }
} }
}, },
...@@ -475,22 +460,33 @@ export default { ...@@ -475,22 +460,33 @@ export default {
this.generateOptions = []; this.generateOptions = [];
} }
}, },
//改变门店 //获取src改变卡片样式
changeStore(value) { changeStore() {
this.ruleForm.merchantId = this.storeOptions.filter(item => item.name == value)[0].id // this.clearStyle()
console.log(this.ruleForm.merchantId); var imageId = this.product.filter(item => item.src == this.ruleForm.backgroundImage).id
console.log(imageId);
}, },
//编辑 //编辑
edit(row) { edit(row) {
// console.log(this.isAdd) // console.log(this.isAdd)
// console.log(row) // console.log(row)
this.ruleForm = row this.ruleForm = row
// this.changeStore()
this.dialogVisible = true this.dialogVisible = true
console.log(this.ruleForm.effectiveType) console.log(this.ruleForm.effectiveType)
this.ruleForm.effectiveType = row.effectiveType + '' this.ruleForm.effectiveType = row.effectiveType + ''
//赋值时间框
if (this.ruleForm.effectiveType == 2) { if (this.ruleForm.effectiveType == 2) {
this.effectiveNum = row.effectiveNum this.effectiveNum = row.effectiveNum
} }
// 改变高亮
// var imageSrc = row.backgroundImage
// console.log(imageSrc)
// var imageId = this.product.filter(item => item.src == ruleForm.backgroundImage)[0].id
// console.log(imageId)
// var imgItem = document.getElementById(imageId)
// console.log(imgItem)
// imgItem.style.background = "rgb(255, 173, 134)"
}, },
//复制 //复制
copy(row) { copy(row) {
...@@ -562,9 +558,10 @@ export default { ...@@ -562,9 +558,10 @@ export default {
this.dialogVisible = false this.dialogVisible = false
this.isAdd = false this.isAdd = false
this.$message({ this.$message({
message: "添加成功", message: "操作成功",
type: "success", type: "success",
}); });
this.$refs.recordTable.refreshTable()
} else if (res.code == -1) { } else if (res.code == -1) {
this.$message({ this.$message({
message: "当前门店已绑定其他权益卡", message: "当前门店已绑定其他权益卡",
...@@ -677,6 +674,9 @@ export default { ...@@ -677,6 +674,9 @@ export default {
height: 80px; height: 80px;
margin-right: 20px; margin-right: 20px;
} }
.imgBg {
background: rgb(255, 173, 134);
}
.topline { .topline {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!