Commit 5375a79c by caoyanzhi

优化代码的一些实现方式

parent 92b503af
......@@ -446,41 +446,34 @@ export default {
*/
confirmUserDefined(data) {
console.log(data);
const that = this;
if (data.length < 1) {
that.$message.error({
this.$message.error({
duration: 1000,
message: '请选择自定义字段'
});
return false;
}
that.loading = true;
this.loading = true;
let fields = data.join(',');
that.selectedUserDefined = data;
that.showUserDefined = false;
this.selectedUserDefined = data;
this.showUserDefined = false;
// 修改已选字段对象
that.selectedFields = [];
that.memberFields.forEach(function(ele, index) {
if (that.selectedUserDefined.indexOf(ele.code) != -1) {
that.selectedFields.push(ele);
}
this.selectedFields = [];
this.selectedFields = this.memberFields.filter(item => this.selectedUserDefined.includes(item.code));
this.saveFieldsList(fields).then(() => {
this.loading = false;
});
that.saveFieldsList(fields);
that.getGroupDetail();
},
/**
* 列表自定义字段选择保存
*/
saveFieldsList(fields) {
const that = this;
const para = {
pageName: 'memberSign',
fields
};
that.axios.post(`${that.baseUrl}/api-member/update-fields?requestProject=memberTag`, para).then(res => {
console.log(res);
});
return this.axios.post(`${this.baseUrl}/api-member/update-fields?requestProject=memberTag`, para);
},
/**
......
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