03 批量批假

master
markma 4 years ago
parent d530be1dc8
commit fd827f6563

@ -88,7 +88,6 @@ export default {
_this.type = resp.data.type _this.type = resp.data.type
console.log(resp) console.log(resp)
*/ */
console.log(resp.data)
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 6
_this.total = resp.data.length _this.total = resp.data.length

@ -4,7 +4,7 @@
ref="multipleTable" ref="multipleTable"
:data="tableData" :data="tableData"
border border
style="width: 90%"> style="width: 100%">
<el-table-column <el-table-column
type="selection" type="selection"
width="55"> width="55">
@ -40,8 +40,17 @@
label="状态" label="状态"
width="120"> width="120">
</el-table-column> </el-table-column>
<el-table-column
width="200">
<template slot-scope="scope">
<el-button type="success" @click="agree(scope.row.id)"></el-button>
<el-button type="danger" @click="disagree(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<el-button type="success" @click="allAgree()"></el-button>
<el-button type="danger" @click="allDisagree()"></el-button>
<el-button @click="toggleSelection()"></el-button> <el-button @click="toggleSelection()"></el-button>
</div> </div>
@ -80,6 +89,32 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
agree(id) {
const _this = this
axios.get('http://localhost:8181/leaveDetail/agreeUpdate/' + id).then(function (resp) {
location.reload();
})
},
disagree(row) {
const _this = this
axios.get('http://localhost:8181/leaveDetail/disagreeUpdate/' + id).then(function (resp) {
location.reload();
})
},
allAgree() {
let arrLength = this.$refs.multipleTable.selection.length;
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/leaveDetail/agreeUpdate/' + this.$refs.multipleTable.selection[i].id)
}
location.reload();
},
allDisagree() {
let arrLength = this.$refs.multipleTable.selection.length;
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/leaveDetail/disagreeUpdate/' + this.$refs.multipleTable.selection[i].id)
}
location.reload();
},
//this.$refs.multipleTable.selection //this.$refs.multipleTable.selection
}, },
data() { data() {
@ -110,7 +145,6 @@ export default {
_this.type = resp.data.type _this.type = resp.data.type
console.log(resp) console.log(resp)
*/ */
console.log(resp.data)
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 6
_this.total = resp.data.length _this.total = resp.data.length

@ -89,7 +89,6 @@ export default {
_this.type = resp.data.type _this.type = resp.data.type
console.log(resp) console.log(resp)
*/ */
console.log(resp.data)
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 6
_this.total = resp.data.length _this.total = resp.data.length

Loading…
Cancel
Save