Commit bc924129 by crushh

udpate: dist

parent 20a6844a
......@@ -24,6 +24,7 @@
:model="ruleForm"
label-width="160px"
size="small"
v-loading="loading"
>
<el-form-item label="上架规则名称" prop="ruleTitle">
<el-input
......@@ -79,7 +80,12 @@
</el-form-item>
<div>
<el-form-item style="margin-top:50px">
<el-button type="primary" size="small" @click="submit()">
<el-button
type="primary"
size="small"
@click="submit()"
:loading="btnLoading"
>
确认
</el-button>
</el-form-item>
......@@ -119,6 +125,8 @@ export default {
isEdit: this.$route.meta.type === 'edit',
isAdd: this.$route.meta.type === 'add',
isCopy: this.$route.meta.type === 'copy',
loading: false,
btnLoading: false,
};
},
computed: {
......@@ -127,7 +135,6 @@ export default {
},
},
mounted () {
console.log(this.$route.params.id);
if (!this.isAdd) {
this.integralMallProRuleId = this.$route.params.id;
this.getDatail(this.$route.params.id);
......@@ -149,50 +156,49 @@ export default {
},
// 获取需要回显的数据, 供保存时候使用
getBackData (val) {
console.log(val);
this.ruleForm.searchJson = val;
},
// 显示编辑,保存按钮隐藏,确认按钮显示 (子组件会调用)
editShow () {
console.log('hideBtn');
this.toggleTag = true;
},
// 显示保存按钮,隐藏确认按钮显示 (子组件会调用)
editHide () {
console.log('hideBtn');
console.log(this.useId);
this.toggleTag = false;
},
// 子组件触发父组件事件,返回过滤条件数据
findFilter (value) {
console.log(value);
this.ruleForm.filterJson = value;
},
// 隐藏保存按钮和确认按钮 (子组件会调用)
// 传个参数给父组件 来查数据
hideBtn () {
console.log('hideBtn');
this.toggleTag = false;
},
getDatail (integralMallProRuleId) {
this.loading = true;
request.get('/api-integral-mall/get-rule', { params: { integralMallProRuleId } }).then(res => {
if (res.data.result) {
this.ruleForm = res.data.result;
if (this.ruleForm.memberType == 3) {
this.hasSearchData = this.ruleForm.filterJson;
this.useId = this.ruleForm.searchId;
if (this.isCopy) {
const form = new FormData();
form.append('requestProject', 'integral-mall');
form.append('id', this.ruleForm.searchId);
request.post('/api-plug/get-screening-detail', form).then(res => {
this.ruleForm.searchJson = res.data.result && res.data.result.detail;
});
}
}
}
}).finally(() => {
this.loading = false;
});
},
submit () {
if (this.ruleForm.memberType === 3) {
if (this.toggleTag && !this.ruleForm.filterJson) {
this.$message.error('请选中人群筛选器的数据');
return false;
}
}
submitRequest () {
this.$refs.ruleForm.validate(val => {
if (val) {
let data = {};
......@@ -206,12 +212,24 @@ export default {
delete data.filterJson;
delete data.searchJson;
}
this.btnLoading = true;
request.post('/api-integral-mall/add-update-rule', data).then(res => {
this.$router.go(-1);
}).finally(() => {
this.btnLoading = false;
});
}
});
},
submit () {
if (this.toggleTag) {
this.$refs.peopleFilter.confirmSet().then(() => {
this.submitRequest();
});
} else {
this.submitRequest();
}
},
},
};
......
......@@ -273,7 +273,6 @@ import getInputVal from '@/utils/common.js';
export default {
filters: {
filterProType (val) {
console.log(val);
let str = '';
switch (val) {
case 1:
......@@ -317,15 +316,12 @@ export default {
};
},
mounted () {
console.log(this.$buttonCode);
this.getList();
},
methods: {
getList () {
this.loading = true;
request.get('/api-integral-mall/list-rule', { params: { ruleTitle: this.ruleTitle } }).then(res => {
console.log(res.data.result);
this.tableDate = res.data.result || [];
}).finally(_ => {
this.loading = false;
......
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