Commit dd88e42e by zhouzy

2

1 parent 35bd332e
...@@ -25,18 +25,17 @@ ...@@ -25,18 +25,17 @@
<div class="equity-wrap contain"> <div class="equity-wrap contain">
<div class="row-btns"> <div class="row-btns">
<el-button size="small" @click="toggleAll">全选</el-button> <el-button size="small" @click="toggleAll">全选</el-button>
<div style="float:right"> <div style="float: right">
<el-button size="small" @click="batchOperation(1)">批量开通</el-button> <el-button size="small" @click="batchOperation(1)">批量开通</el-button>
<el-button size="small" @click="batchOperation(2)">批量关闭</el-button> <el-button size="small" @click="batchOperation(2)">批量关闭</el-button>
</div> </div>
</div> </div>
<GLTable v-if="flag" ref="table" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf"> <GLTable v-if="flag" ref="table" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> <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="jump(scope.scope)">修改配置</el-button>
<el-button type="text" @click="copy(scope.scope)">复制</el-button>
</span> </span>
<span slot="switch" slot-scope="scope"> <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> </span>
</GLTable> </GLTable>
</div> </div>
...@@ -57,12 +56,16 @@ export default { ...@@ -57,12 +56,16 @@ export default {
supplierList: [ supplierList: [
{ {
label: '开通', label: '全部',
value: 'open' value: '0'
},
{
label: '未开通',
value: '1'
}, },
{ {
label: '关闭', label: '已开通',
value: 'close' value: '2'
} }
], ],
statusList: [ statusList: [
...@@ -129,28 +132,6 @@ export default { ...@@ -129,28 +132,6 @@ export default {
this.$router.push({ path: '/goods/addGoods', query }) 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() { toggleAll() {
let { configIndexMutiTable } = this.$refs.table.$refs let { configIndexMutiTable } = this.$refs.table.$refs
let { data } = configIndexMutiTable let { data } = configIndexMutiTable
...@@ -231,6 +212,19 @@ export default { ...@@ -231,6 +212,19 @@ export default {
// console.log('导出失败') // 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!