Commit dd88e42e by zhouzy

2

1 parent 35bd332e
......@@ -25,18 +25,17 @@
<div class="equity-wrap contain">
<div class="row-btns">
<el-button size="small" @click="toggleAll">全选</el-button>
<div style="float:right">
<el-button size="small" @click="batchOperation(1)">批量开通</el-button>
<el-button size="small" @click="batchOperation(2)">批量关闭</el-button>
<div style="float: right">
<el-button size="small" @click="batchOperation(1)">批量开通</el-button>
<el-button size="small" @click="batchOperation(2)">批量关闭</el-button>
</div>
</div>
<GLTable v-if="flag" ref="table" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope)">编辑</el-button>
<el-button type="text" @click="copy(scope.scope)">复制</el-button>
<el-button type="text" @click="jump(scope.scope)">修改配置</el-button>
</span>
<span slot="switch" slot-scope="scope">
<el-switch v-model="scope.scope.value" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
<el-switch v-model="scope.scope.value" active-color="#13ce66" inactive-color="#ff4949" @change="changStatus(scope.scope.value)"></el-switch>
</span>
</GLTable>
</div>
......@@ -56,13 +55,17 @@ export default {
searchForm: {},
supplierList: [
{
label: '全部',
value: '0'
},
{
label: '开通',
value: 'open'
label: '未开通',
value: '1'
},
{
label: '关闭',
value: 'close'
label: '已开通',
value: '2'
}
],
statusList: [
......@@ -129,28 +132,6 @@ export default {
this.$router.push({ path: '/goods/addGoods', query })
}
},
copy({ id }) {
this.$apis.orderApi.getEquityGoodsById({ id }).then(({ code, data, message }) => {
if (code == 0) {
this.$apis.orderApi.createGoods(data).then(res => {
if (res.code == 0) {
this.$message({
message: '复制成功!',
type: 'success'
})
this.search(() => {
let [target] = this.$refs.table.data
this.jump(target)
})
} else {
this.$message.error(res.message)
}
})
} else {
this.$message.error(message)
}
})
},
toggleAll() {
let { configIndexMutiTable } = this.$refs.table.$refs
let { data } = configIndexMutiTable
......@@ -231,6 +212,19 @@ export default {
// console.log('导出失败')
// }
// })
},
changStatus(val) {
this.$apis.orderApi.target({status:val}).then(({ code, message }) => {
if (code == 0) {
this.$message({
message: '操作成功!',
type: 'success'
})
this.$refs.table.refreshTable()
} else {
this.$message.error(message)
}
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!