|
|
|
|
@ -1,7 +1,40 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- 编辑-->
|
|
|
|
|
<xy-dialog :is-show.sync="isShow" title="活动配置" ref="addActivityConfig">
|
|
|
|
|
<xy-dialog :is-show.sync="isShow" title="活动配置" type="normal" ref="addActivityConfig" @on-ok="editor">
|
|
|
|
|
<div class="table-tree">
|
|
|
|
|
<div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;">
|
|
|
|
|
<Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增参数</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table :data="list" height="400" class="v-table" style="width: 100%;margin-bottom: 20px;">
|
|
|
|
|
<el-table-column type="index" align="center">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="name" label="名称">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.name">
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="key" label="标识" width="240">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.key">
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="value" label="数据值" width="120">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.value">
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" width="100" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<Button type="error" @click="delRow(scope.row,scope.$index)" size="small" style="margin-left: 10px;"
|
|
|
|
|
ghost>删除</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
@ -9,8 +42,157 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
save,
|
|
|
|
|
show,
|
|
|
|
|
index,
|
|
|
|
|
destroy
|
|
|
|
|
} from "@/api/activity/components/addActivityConfig";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
show as activityInfo
|
|
|
|
|
} from "@/api/activity/index";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
isShow: false,
|
|
|
|
|
list: [{
|
|
|
|
|
name: "",
|
|
|
|
|
key: "",
|
|
|
|
|
value: ""
|
|
|
|
|
}],
|
|
|
|
|
detail: {},
|
|
|
|
|
id: ""
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
isShow(newVal) {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
this.load();
|
|
|
|
|
this.activityInfo();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async activityInfo() {
|
|
|
|
|
let res = await activityInfo({
|
|
|
|
|
id: this.id
|
|
|
|
|
})
|
|
|
|
|
Object.assign(this.detail, res);
|
|
|
|
|
},
|
|
|
|
|
async load() {
|
|
|
|
|
let res = await index({
|
|
|
|
|
activity_list_id: this.id
|
|
|
|
|
})
|
|
|
|
|
this.list = res.data;
|
|
|
|
|
},
|
|
|
|
|
editor() {
|
|
|
|
|
|
|
|
|
|
this.list.map(item => {
|
|
|
|
|
item.activity_list_id = this.id
|
|
|
|
|
if (item.name != "" && item.key != "" && item.value != "") {
|
|
|
|
|
save(item).then(res => {
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.isShow = false
|
|
|
|
|
this.$Message.success("操作成功");
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
},
|
|
|
|
|
addRow() {
|
|
|
|
|
this.list.push({
|
|
|
|
|
name: "",
|
|
|
|
|
key: "",
|
|
|
|
|
value: ""
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
delRow(obj, index) {
|
|
|
|
|
if (obj.id) {
|
|
|
|
|
destroy({
|
|
|
|
|
id: obj.id
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.$message.success("操作成功");
|
|
|
|
|
this.list.splice(index, 1);
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
this.$message.error("操作失败");
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.list.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
let that = this;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.contract-add-plan {
|
|
|
|
|
min-height: 30px;
|
|
|
|
|
border: 1px solid #dcdee2;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
align-items: center;
|
|
|
|
|
align-content: center;
|
|
|
|
|
|
|
|
|
|
padding: 0 8px;
|
|
|
|
|
|
|
|
|
|
&-no-plan {
|
|
|
|
|
height: 30px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
color: #CDD0D5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.xy-table-item-label {
|
|
|
|
|
width: 140px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.xy-table-item-price {
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
|
z-index: 1;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
content: '(元)'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .el-input__clear {
|
|
|
|
|
position: relative;
|
|
|
|
|
right: 30px;
|
|
|
|
|
z-index: 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.xy-table-item-price-wan {
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
content: '(万元)'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .el-input__clear {
|
|
|
|
|
position: relative;
|
|
|
|
|
right: 46px;
|
|
|
|
|
z-index: 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|