Commit 0eb4ad01 authored by 邓春圆's avatar 邓春圆

渠道列表添加状态

parent cabbc1d8
......@@ -42,7 +42,13 @@ export function getChannelPage(query) {
params: query
})
}
//启用-禁用渠道
export function channelSwitch(id){
return request({
url:`/ecw/channel/switch/${id}`,
method:'put'
})
}
// 获得渠道列表 TODO
export function getChannelList(query) {
return request({
......
......@@ -119,6 +119,12 @@
</el-table-column>
<el-table-column :label="$t('更新人')" prop="updaterName">
</el-table-column>
<el-table-column :label="$t('状态')" prop="updaterName">
<template v-slot="{row}">
<el-switch @change="(e)=>{changeSwitch(e,row)}" :validate-event="false" :active-value="true"
v-model="row.status"></el-switch>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
......@@ -144,7 +150,7 @@ import {
deleteChannel,
getChannel,
getChannelPage,
exportChannelExcel
exportChannelExcel, channelSwitch
} from "@/api/ecw/channel";
import {getCountryListAll} from "@/api/ecw/country";
import {getTradeCountryList} from "@/api/ecw/region";
......@@ -192,7 +198,22 @@ export default {
this.getList();
},
methods: {
changeSwitch(val, row) {
let title = '是否要' + (val ? '打开' : '关闭') + "" + this.$l(row, 'name') + ''
this.$confirm(title, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
channelSwitch(row.channelId).then(r => {
this.$message.success('修改成功')
console.log(r)
})
}).catch(() => {
row.status = !val
});
},
/** 查询列表 */
getList() {
this.loading = true;
......
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