You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
2.6 KiB

3 years ago
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="护工工资">
<div slot="content"></div>
<slot>
<div>
<Input v-model="select.keyword" placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>
3 years ago
<Button style="margin-left: 10px" type="primary" @click="select.page = 1,getList">查询</Button>
3 years ago
</div>
</slot>
</lx-header>
</div>
<xy-table
3 years ago
:default-expand-all="false"
3 years ago
row-key="name"
3 years ago
:total="total"
:list="list"
3 years ago
:table-item="table">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
3 years ago
</div>
</template>
<script>
import {salaryList as getList} from '@/api/worker'
import {parseTime} from "@/utils"
export default {
data() {
return {
select:{
page:1,
page_size:10,
keyword:''
},
types:[],
total:0,
list:[],
3 years ago
tableArr:[],
dataTable:[
3 years ago
{
3 years ago
prop:'date',
label:'日期'
3 years ago
},
{
3 years ago
prop:'money',
label:'金额(元)',
align:'right'
}
],
table:[
{
type:'expand',
label:'详情',
width: 80,
expandFn:(props)=>{
3 years ago
return (
3 years ago
<div style={{'width':'400px','margin-left':'40px'}}>
<xy-table
defaultExpandAll={false}
table-item={this.dataTable}
list={props.row.data}
is-page={false}
height={260}
scopedSlots={{
btns:()=>{
return ''
}
}}>
</xy-table>
3 years ago
</div>
)
}
},
{
3 years ago
label:'姓名',
width:260,
prop:'name'
},
{
label:'小计',
minWidth: 160,
3 years ago
align:'right',
customFn:(row)=>{
let total = 0;
row.data.map(item => {
total += item.money
})
return (
<div>
{total}
</div>
)
}
}
]
3 years ago
}
},
methods: {
async getList(){
const res = await getList(this.select)
3 years ago
this.tableArr = res.map((item,index) => {
return item.name
})
3 years ago
this.total = res.length ?? 0
this.list = res
3 years ago
},
},
mounted() {
this.getList()
}
}
</script>
<style scoped lang="scss">
</style>