<template>
|
<scroll-view class="full-page" scroll-y using-sticky>
|
<up-sticky bgColor="#fff">
|
<view class="coreshop-ff content c-p-10">
|
<up-search placeholder="请点击选择日期" @clear='clear' @click='clickTime' disabled @custom='PostMyListPage'
|
v-model="workTime" search-icon="calendar" @search='PostMyListPage' :show-action="false"></up-search>
|
</view>
|
<view class="coreshop-ff content c-p-10">
|
<up-search placeholder="请输入工人名字" v-model="workerUserName" @custom='PostMyListPage'
|
@clear='PostMyListPage' @search='PostMyListPage'></up-search>
|
<!-- <up-search placeholder="请点击选择打卡日期" @click='clickIcon' @clear='PostMyComDakaListPage' disabled
|
v-model="wordDate" search-icon="calendar" @search='PostMyComDakaListPage'
|
@custom='PostMyComDakaListPage'></up-search> -->
|
</view>
|
<!-- <up-subsection :list="list" :current="current4" activeColor="#f9ae3d"
|
@change="sectionChange"></up-subsection> -->
|
<!-- <up-subsection :list="list" current='1' activeColor="#f9ae3d" @change="sectionChange"></up-subsection> -->
|
</up-sticky>
|
<view class="full-page-content c-p-b-100">
|
<view class="c-p-l-20 c-p-r-20" v-if="listO.orderList&&listO.orderList.length>0">
|
<view class="listrecord c-p-t-20" v-for="(item,index) in listO.orderList" :key="item.id"
|
@click="pageToDetail(item)">
|
<view class="coreshop-ff chuany-bradius20">
|
<view class="c-p-24 chuany-font32">
|
<view class="chuany-flex chuany-justify-between">
|
<text class="chuany-width28">
|
{{item.workerUserName}}
|
</text>
|
<view class="chuany-width68">
|
工资:{{item.todaySalary}} 元
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<up-loadmore :status="loadStatus" />
|
</view>
|
<view v-else>
|
<up-empty text='暂无' icon="/static/order.png">
|
</up-empty>
|
</view>
|
</view>
|
<fui-date-picker range :show="datePickerShow" :value="$util.formatDate(new Date())" type="3"
|
@change="changePicker" @cancel="cancel"></fui-date-picker>
|
</scroll-view>
|
<view class="tabbtns">
|
合计:{{heji}} 元
|
</view>
|
</template>
|
|
<script setup>
|
import {
|
onLoad,
|
onShow,
|
onReachBottom,
|
onPullDownRefresh
|
} from "@dcloudio/uni-app";
|
import {
|
reactive,
|
ref,
|
getCurrentInstance
|
} from 'vue';
|
const {
|
$upload,
|
$api,
|
$util,
|
$db
|
} = getCurrentInstance().appContext.config.globalProperties
|
let state = reactive({
|
pageIndex: 1,
|
pageSize: 20,
|
})
|
let workTime = ref('')
|
let datePickerShow = ref(false)
|
let loadStatus = ref('loadmore')
|
let workerUserName = ref('')
|
let totalPages = ref(0)
|
let listO = reactive({
|
orderList: []
|
})
|
let heji = ref(0)
|
onReachBottom(() => {
|
if (loadStatus.value != 'nomore') {
|
PostMyListPage();
|
}
|
})
|
onPullDownRefresh(() => {
|
state.pageIndex = 1
|
state.pageSize = 20
|
loadStatus.value = 'loadmore'
|
PostMyListPage()
|
uni.stopPullDownRefresh();
|
})
|
onLoad(() => {
|
PostMyListPage()
|
})
|
const current4 = ref(0);
|
// const list = ref(['全部', '审核中', '已录用', '未录用']);
|
const changePicker = (val) => {
|
console.log(val);
|
workTime.value = val.startDate.result + '至' + val.endDate.result
|
state.wordDateStart = new Date(val.startDate.result) //工作开始时间
|
state.wordDateEnd = new Date(val.endDate.result)
|
datePickerShow.value = !datePickerShow.value
|
PostMyListPage()
|
}
|
|
// const search = (index) => {
|
// console.log(index, '------’');
|
// if (index == 0) {
|
// PostMyListPage()
|
// } else {
|
// PostMyListPage(index - 1)
|
// }
|
|
// }
|
const clear = () => {
|
state.wordDateStart = ""
|
state.wordDateEnd = ""
|
PostMyListPage()
|
}
|
const clickTime = () => {
|
datePickerShow.value = !datePickerShow.value
|
}
|
|
const cancel = () => {
|
datePickerShow.value = !datePickerShow.value
|
}
|
const PostMyListPage = () => {
|
let data = {
|
pageIndex: state.pageIndex,
|
pageSize: state.pageSize,
|
workerUserName: workerUserName.value
|
}
|
if (state.wordDateStart) {
|
data.wordDateStart = state.wordDateStart
|
}
|
if (state.wordDateEnd) {
|
data.wordDateEnd = state.wordDateEnd
|
}
|
loadStatus.value = 'loading';
|
$api.PostMyComGongZiListPage(data).then(res => {
|
console.log(res, res.code, '-----------123’');
|
if (res.code == 1) {
|
heji.value = res.data.heji
|
if (state.pageIndex == 1) {
|
listO.orderList = res.data.items
|
} else {
|
listO.orderList = listO.orderList.concat(...res.data.items)
|
}
|
console.log(listO.orderList, 'listO.orderList’');
|
// totalPages.value = res.data.totalCount
|
// 根据count数量判断是否还有数据
|
if (res.data.totalCount > listO.orderList.length) {
|
loadStatus.value = 'loadmore'
|
state.pageIndex++
|
} else {
|
// 数据已加载完毕
|
loadStatus.value = 'nomore'
|
}
|
} else {
|
// _that.$refs.uToast.show({ message: res.msg, type: 'error' });
|
}
|
})
|
}
|
const pageToDetail = (item) => {
|
// if (state.wordDateStart) {
|
// data.wordDateStart = state.wordDateStart
|
// }
|
// if (state.wordDateEnd) {
|
// data.wordDateEnd = state.wordDateEnd
|
// }
|
uni.navigateTo({
|
url: `/pages/worker/salaryDetail?workerUserId=${item.workerUserId}&wordDateStart=${state.wordDateStart?state.wordDateStart:''}&wordDateEnd=${state.wordDateEnd?state.wordDateEnd:''}`
|
});
|
// $db.set('detailItem',JSON.stringify(item))
|
}
|
</script>
|
|
<style>
|
.content {
|
/* width: 100%; */
|
box-sizing: border-box;
|
}
|
|
.bgblue {
|
background-color: #4e96f5;
|
border-radius: 20rpx 20rpx 0 0;
|
color: #fff;
|
}
|
|
.listrecord {
|
width: 100%;
|
box-sizing: border-box;
|
}
|
</style>
|