08 debug and beautiful

master
markma 4 years ago
parent c44f837fbe
commit 5f22ad31f9

@ -80,9 +80,9 @@ export default {
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
let school_id = $_GET('school_id', window.location.href); let school_id = $_GET('school_id', window.location.href);
console.log(school_id); console.log(school_id);
axios.get('http://localhost:8181/leaveDetail/findFromSIDTimeLimit/' + school_id + "/" + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findFromSIDTimeLimit/' + school_id + "/" + (currentPage) + '/20').then(function (resp) {
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
_this.total = resp.data.length _this.total = resp.data.length
}) })
}, },
@ -110,7 +110,7 @@ export default {
}, },
data() { data() {
return { return {
pageSize: 6, pageSize: 20,
total: 11, total: 11,
tableData: [{}] tableData: [{}]
} }
@ -120,9 +120,9 @@ export default {
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
let school_id = $_GET('school_id', window.location.href); let school_id = $_GET('school_id', window.location.href);
console.log(school_id); console.log(school_id);
axios.get('http://localhost:8181/leaveDetail/findFromSIDTimeLimit/' + school_id + '/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findFromSIDTimeLimit/' + school_id + '/1/20').then(function (resp) {
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
_this.total = resp.data.length _this.total = resp.data.length
}) })
} }

@ -73,18 +73,18 @@ export default {
page(currentPage) { page(currentPage) {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/outDetail/findAndReturnOLDs/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/outDetail/findAndReturnOLDs/' + (currentPage) + '/20').then(function (resp) {
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/outDetail/findAndReturnOLDsNum/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/outDetail/findAndReturnOLDsNum/' + (currentPage) + '/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
} }
}, },
data() { data() {
return { return {
pageSize: 6, pageSize: 20,
total: 1, total: 1,
tableData: [{ tableData: [{
id: 1, id: 1,
@ -102,11 +102,11 @@ export default {
created() { created() {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/outDetail/findAndReturnOLDs/1/6').then(function (resp) { axios.get('http://localhost:8181/outDetail/findAndReturnOLDs/1/20').then(function (resp) {
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/outDetail/findAndReturnOLDsNum/1/6').then(function (resp) { axios.get('http://localhost:8181/outDetail/findAndReturnOLDsNum/1/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
} }

@ -3,8 +3,7 @@
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<h4>默认您已经遵守防疫规定</h4> <h4>默认您已经遵守防疫规定</h4>
<div class="block"> <el-form-item label="离开时间" prop="leave_time">
<span class="demonstration">离开时间</span>
<el-date-picker <el-date-picker
v-model="ruleForm.leave_time" v-model="ruleForm.leave_time"
type="datetime" type="datetime"
@ -12,9 +11,8 @@
:picker-options="pickerOptions" :picker-options="pickerOptions"
placeholder="选择日期时间"> placeholder="选择日期时间">
</el-date-picker> </el-date-picker>
</div> </el-form-item>
<div class="block"> <el-form-item label="返回时间" prop="back_time">
<span class="demonstration">返回时间</span>
<el-date-picker <el-date-picker
v-model="ruleForm.back_time" v-model="ruleForm.back_time"
type="datetime" type="datetime"
@ -22,10 +20,16 @@
:picker-options="pickerOptions" :picker-options="pickerOptions"
placeholder="选择日期时间"> placeholder="选择日期时间">
</el-date-picker> </el-date-picker>
</div> </el-form-item>
<el-form-item label="外出地点" prop="place"> <el-form-item label="外出地点" prop="place">
<el-input v-model="ruleForm.place"></el-input> <el-autocomplete
v-model="ruleForm.place"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item> </el-form-item>
<p></p>
<el-form-item label="外出理由" prop="reason"> <el-form-item label="外出理由" prop="reason">
<el-input v-model="ruleForm.reason"></el-input> <el-input v-model="ruleForm.reason"></el-input>
</el-form-item> </el-form-item>
@ -49,6 +53,7 @@ export default {
reason: '', reason: '',
type: '审核中' type: '审核中'
}, },
places: [],
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
text: '今早八点', text: '今早八点',
@ -116,22 +121,43 @@ export default {
_this.$router.push('/user/student/' + id + '/history') _this.$router.push('/user/student/' + id + '/history')
} }
}) })
} } else if (resp.data == 'time failed') {
else if(resp.data == 'time failed'){
_this.$alert('时间错误', '消息', { _this.$alert('时间错误', '消息', {
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} }
}) })
} } else {
else {
return false; return false;
} }
}); });
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
},
querySearch(queryString, cb) {
var places = this.places;
var results = queryString ? places.filter(this.createFilter(queryString)) : places;
// callback
cb(results);
},
createFilter(queryString) {
return (places) => {
return (places.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
loadAll() {
return [
{"value": "一号院"},
{"value": "万家丽"}
]
},
handleSelect(item) {
console.log(item);
} }
},
mounted() {
this.places = this.loadAll();
} }
} }
</script> </script>

@ -1,11 +1,15 @@
<template> <template>
<div> <div>
<el-table <el-table
ref="multipleTable"
:data="tableData" :data="tableData"
border border
:default-sort="{prop: 'date', order: 'descending'}" :default-sort="{prop: 'date', order: 'descending'}"
stripe stripe
style="width: 90%"> style="width: 90%">
<el-table-column
type="selection">
</el-table-column>
<el-table-column <el-table-column
fixed fixed
prop="id" prop="id"
@ -35,15 +39,24 @@
prop="reason" prop="reason"
label="外出原因" label="外出原因"
sortable sortable
width="300"> width="150">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="type" prop="type"
label="状态" label="状态"
sortable> sortable>
</el-table-column> </el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button size="small" type="danger" @click="deleteLD(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div style="margin-top: 20px">
<el-button type="danger" @click="allDeleteLD()"></el-button>
<el-button @click="toggleSelection()"></el-button>
</div>
<el-pagination <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
@ -60,38 +73,57 @@ export default {
page(currentPage) { page(currentPage) {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByNotType/已过期/' + id + '/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotType/已过期/' + id + '/' + (currentPage) + '/20').then(function (resp) {
console.log(resp) console.log(resp)
_this.tableData = resp.data _this.tableData = resp.data
}) })
axios.get('http://localhost:8181/leaveDetail/findByNotTypeNum/已过期/' + id + '/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotTypeNum/已过期/' + id + '/1/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
},
deleteLD(id) {
const _this = this
axios.get('http://localhost:8181/leaveDetail/delete/' + id).then(function (resp) {
location.reload();
})
},
allDeleteLD() {
let arrLength = this.$refs.multipleTable.selection.length;
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/leaveDetail/delete/' + this.$refs.multipleTable.selection[i].id)
}
location.reload();
},
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
} }
}, },
handleSelectionChange(val) {
this.multipleSelection = val;
},
},
data() { data() {
return { return {
pageSize: 6, pageSize: 20,
total: 11, total: 11,
tableData: [{ tableData: [],
id: 1, multipleSelection: []
leave_time: '2021-12-20 16:59:15',
back_time: '2222-12-21 17:28:59',
place: '万家丽',
reason: '见导师',
type: '已过期'
}]
} }
}, },
created() { created() {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByNotType/已过期/' + id + '/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotType/已过期/' + id + '/1/20').then(function (resp) {
console.log(axios.get('http://localhost:8181/leaveDetail/findByNotTypeNum/已过期/' + id + '/1/6')) console.log(axios.get('http://localhost:8181/leaveDetail/findByNotTypeNum/已过期/' + id + '/1/20'))
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/leaveDetail/findByNotTypeNum/已过期/' + id + '/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotTypeNum/已过期/' + id + '/1/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
} }

@ -1,11 +1,15 @@
<template> <template>
<div> <div>
<el-table <el-table
ref="multipleTable"
:data="tableData" :data="tableData"
border border
:default-sort="{prop: 'date', order: 'descending'}" :default-sort="{prop: 'date', order: 'descending'}"
stripe stripe
style="width: 90%"> style="width: 90%">
<el-table-column
type="selection">
</el-table-column>
<el-table-column <el-table-column
fixed fixed
prop="id" prop="id"
@ -35,15 +39,23 @@
prop="reason" prop="reason"
label="外出原因" label="外出原因"
sortable sortable
width="300"> width="150">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="type" prop="type"
label="状态" label="状态"
sortable> sortable>
</el-table-column> </el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button size="small" type="danger" @click="deleteLD(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div style="margin-top: 20px">
<el-button type="danger" @click="allDeleteLD()"></el-button>
<el-button @click="toggleSelection()"></el-button>
</div>
<el-pagination <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
@ -61,23 +73,48 @@ export default {
page(currentPage){ page(currentPage){
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/' + (currentPage) + '/20').then(function (resp) {
console.log(resp) console.log(resp)
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/' + (currentPage) + '/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
},
deleteLD(id) {
const _this = this
axios.get('http://localhost:8181/leaveDetail/delete/' + id).then(function (resp) {
location.reload();
})
},
allDeleteLD() {
let arrLength = this.$refs.multipleTable.selection.length;
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/leaveDetail/delete/' + this.$refs.multipleTable.selection[i].id)
} }
location.reload();
},
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
}, },
data() { data() {
return { return {
pageSize: 6, pageSize: 20,
total: 11, total: 11,
tableData: [{ tableData: [{
id: 1, id: 1,
leave_time: '2021-12-20 16:59:15', leave_time: '2021-12-20 15:59:15',
back_time: '2222-12-21 17:28:59', back_time: '2222-12-21 17:28:59',
place: '万家丽', place: '万家丽',
reason: '见导师', reason: '见导师',
@ -88,12 +125,12 @@ export default {
created() { created() {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/1/20').then(function (resp) {
console.log(resp.data) console.log(resp.data)
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/1/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
} }

@ -8,8 +8,7 @@
stripe stripe
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
type="selection" type="selection">
width="55">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed fixed
@ -50,14 +49,14 @@
</el-table-column> </el-table-column>
<el-table-column> <el-table-column>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="success" @click="agree(scope.row.id)"></el-button> <el-button size="small" type="success" @click="agree(scope.row.id)"></el-button>
<el-button type="danger" @click="disagree(scope.row.id)"></el-button> <el-button size="small" type="danger" @click="disagree(scope.row.id)"></el-button>
</template> </template>
</el-table-column> </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="success" @click="allAgree()"></el-button>
<el-button type="danger" @click="allDisagree()"></el-button> <el-button type="danger" @click="allDisagree()"></el-button>
<el-button @click="toggleSelection()"></el-button> <el-button @click="toggleSelection()"></el-button>
</div> </div>
@ -77,12 +76,12 @@ export default {
page(currentPage) { page(currentPage) {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByTypeNoID/审核中/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByTypeNoID/审核中/' + (currentPage) + '/20').then(function (resp) {
console.log(resp) console.log(resp)
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/leaveDetail/findByTypeNoIDNum/审核中/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByTypeNoIDNum/审核中/' + (currentPage) + '/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
}, },
@ -128,11 +127,11 @@ export default {
}, },
data() { data() {
return { return {
pageSize: 6, pageSize: 20,
total: 11, total: 11,
tableData: [{ tableData: [{
id: 1, id: 1,
leave_time: '2021-12-20 16:59:15', leave_time: '2021-12-20 15:59:15',
back_time: '2222-12-21 17:28:59', back_time: '2222-12-21 17:28:59',
place: '万家丽', place: '万家丽',
reason: '见导师', reason: '见导师',
@ -144,11 +143,11 @@ export default {
created() { created() {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByTypeNoID/审核中/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByTypeNoID/审核中/1/20').then(function (resp) {
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/leaveDetail/findByTypeNoIDNum/审核中/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByTypeNoIDNum/审核中/1/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
} }

@ -61,23 +61,23 @@ export default {
page(currentPage) { page(currentPage) {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoID/审核中/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoID/审核中/' + (currentPage) + '/20').then(function (resp) {
console.log(resp) console.log(resp)
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoIDNum/审核中/' + (currentPage) + '/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoIDNum/审核中/' + (currentPage) + '/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
} }
}, },
data() { data() {
return { return {
pageSize: 6, pageSize: 20,
total: 11, total: 11,
tableData: [{ tableData: [{
id: 1, id: 1,
leave_time: '2021-12-20 16:59:15', leave_time: '2021-12-20 15:59:15',
back_time: '2222-12-21 17:28:59', back_time: '2222-12-21 17:28:59',
place: '万家丽', place: '万家丽',
reason: '见导师', reason: '见导师',
@ -88,11 +88,11 @@ export default {
created() { created() {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoID/审核中/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoID/审核中/1/20').then(function (resp) {
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 20
}) })
axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoIDNum/审核中/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByNotTypeNoIDNum/审核中/1/20').then(function (resp) {
_this.total = resp.data _this.total = resp.data
}) })
} }

Loading…
Cancel
Save