Commit 860f2042 by 无尘

add: 增加会员分组编辑回显

parent 8fe6193b
......@@ -517,7 +517,7 @@
selTagData: function(newData,oldData){
const that = this
console.log("selTagData:",newData)
that.checkSelectTag();
that.checkSelectTag(); // 检查已选标志的时候可能暂存架里无数据
// that.getTempList();
},
delTagId: function(newData,oldData){
......@@ -534,7 +534,7 @@
}
}
},
mounted() {
beforeMount() {
const that = this;
that.getTagList();
that.getTempList();
......
......@@ -522,7 +522,7 @@
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancelDialog">取 消</el-button>
<el-button type="text" @click="cancelDialog" class="el-button--default">取 消</el-button>
<!-- <el-button plain @click="toTagDetail">标签详情</el-button> -->
<router-link v-if="fromFlag !=='memberGroup'" :to="{path:'/myTagDetail',query:{tagId: tagShortId}}" class="el-button el-button--default el-button--large is-plain">详情</router-link>
<el-button type="primary" @click="confirmDialog">确 定</el-button>
......@@ -2303,6 +2303,11 @@
background: #F3F6F9;
}
.el-button--default.el-button--text {
color: #606266;
padding: 8px 15px;
}
.checkboxOption-wrap__body .el-checkbox-group {
height: 330px;
overflow-y: auto;
......
......@@ -14,11 +14,12 @@
<div class="common-wrap__fix__title">已选标签</div>
<div class="common-wrap__fix__table">
<el-table
ref="multipleTable"
ref="tempTableMult"
:data="tagListData"
tooltip-effect="dark"
height="333"
style="width: 100%"
@select-all="handleSelectAll"
@selection-change="handleSelectChange">
<el-table-column
type="selection"
......@@ -112,6 +113,15 @@
that.selectTag = val;
},
/**
* 表格---全选
*/
handleSelectAll(val) {
const that = this
console.log(val);
that.selectTag = val;
},
/**
* 表格---删除
*/
......@@ -206,6 +216,16 @@
})
// console.log(dataVal)
that.tagListData = dataVal
setTimeout(function(){
if (!!that.tagListData) {
that.tagListData.forEach(row => {
console.log(row)
that.$refs.tempTableMult.toggleRowSelection(row,true);
});
}
},500)
return;
}
......
......@@ -29,7 +29,7 @@
<div class="memberGroupEdit-wrap__item__title">分组有效期</div>
<el-date-picker
v-model="ruleForm.effectiveDateTmp"
type="date"
type="datetime"
:editable="false"
format="yyyyMMdd"
value-format="yyyy-MM-dd HH:mm:ss"
......@@ -139,6 +139,10 @@
{
name: '会员标签',
path: ''
},
{
name: '会员分组编辑',
path: ''
}
],
......@@ -146,6 +150,7 @@
ruleForm: {
memberTagGroupId: '',
selectedTag: [],
newTagVal: '',
groupName: '',
effectiveDateTmp: '',
describle: '',
......@@ -224,6 +229,13 @@
},
methods: {
/**
* 路由跳转
*/
changeRoute(route) {
this.$router.push(route);
},
/**
* 点击显示添加标签层
*/
showAddTag() {
......@@ -344,7 +356,7 @@
*/
cancelSave() {
const that = this;
that.changeRoute('/memberGroupList')
},
/**
......@@ -385,13 +397,18 @@
effectiveDateTmp: obj.effectiveDateTmp
}
postRequest('/member-tag-group/add.json',para)
let postUrl = '/member-tag-group/add.json';
if (!!that.ruleForm.memberTagGroupId) {
postUrl = '/member-tag-group/update.json';
}
postRequest(postUrl,para)
.then((res) => {
// console.log(res,res.data,res.data.errorCode)
const resData = res.data
if (resData.errorCode == 1) {
showMsg.showmsg('成功','success')
showMsg.showmsg('编辑成功','success')
that.changeRoute('/memberGroupList')
return;
}
......@@ -408,6 +425,8 @@
});
},
/**
* 子组件 我的标签库/暂存架 -点击名字显示标签详情缩略版
*/
......@@ -593,6 +612,58 @@
showTabActive(name){
const that = this;
that.tabActiveName = name;
},
/**
* 编辑时候---获取分组数据
*/
getGroupData(){
const that = this;
const para = {
memberTagGroupId: that.ruleForm.memberTagGroupId,
}
postRequest('/member-tag-group/findOneDetial.json',para)
.then((res) => {
// console.log(res,res.data,res.data.errorCode)
const resData = res.data
if (resData.errorCode == 1) {
let tagGroupDto = resData.result.tagGroupDto;
that.ruleForm.groupName = tagGroupDto.groupName;
that.ruleForm.isRealTime = tagGroupDto.isRealTime;
that.ruleForm.effectiveStatus = tagGroupDto.effectiveStatus;
that.ruleForm.describle = tagGroupDto.describle;
that.ruleForm.effectiveDateTmp = tagGroupDto.effectiveDate;
that.ruleForm.updateType = tagGroupDto.updateType;
that.ruleForm.updateDay = tagGroupDto.updateDay;
let tagValueDtoList = resData.result.tagValueDtoList;
tagValueDtoList.forEach(function(ele,index){
let newTagVal = JSON.parse(ele.tagParams)
if (newTagVal.selectedVal != '') {
ele.newTagVal = newTagVal.selectedVal
}else{
ele.newTagVal = ''
}
})
that.ruleForm.selectedTag = tagValueDtoList;
that.selectedTagData = tagValueDtoList;
return;
}
errMsg.errorMsg(resData)
})
.catch(function (error) {
console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
}
},
......@@ -600,13 +671,17 @@
const that = this
let localData = sessionStorage.getItem('selectTempTag')
if (!!localData) {
that.selectedTagData = JSON.parse(localData);
that.ruleForm.selectedTag = that.selectedTagData;
// that.selectedTagData = JSON.parse(localData);
that.ruleForm.selectedTag = JSON.parse(localData);
setTimeout(function(){
that.selectedTagData = JSON.parse(localData);
},500)
sessionStorage.removeItem('selectTempTag')
}
if (!!that.$route.query.memberTagGroupId) {
that.ruleForm.memberTagGroupId = that.$route.query.memberTagGroupId
that.ruleForm.memberTagGroupId = that.$route.query.memberTagGroupId;
that.getGroupData();
}
},
components: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment