Commit bc924129 by crushh

udpate: dist

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