| | |
| | | @searchClick="onFilterSearch" |
| | | > |
| | | <template slot="leftButton"> |
| | | <div class="margin_right_20px" style="width:200px;"> |
| | | <!-- <el-date-picker v-model="object.date" style="width:100%" |
| | | @change="onFilterSearch" |
| | | <div class="margin_right_20px" > |
| | | <el-date-picker v-model="object.date" |
| | | style="width:200px;" |
| | | class="margin_right_20px" |
| | | @change="onFilterSearch(object.date,'date')" |
| | | :clearable="false" type="month" placeholder="选择日期" |
| | | :picker-options="pickerOptions" |
| | | value-format="yyyy-MM"> |
| | | </el-date-picker> --> |
| | | </el-date-picker> |
| | | <el-button size="small" type="primary" @click="exportBtnClick">导出</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAttendanceStatistic } from "@/api/reportManage/report.js" |
| | | import { salaryReportForms } from "@/api/reportManage/report.js" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import NewDate from "@/api/date"; |
| | | const { getCurrentMonth } = NewDate; |
| | |
| | | tableColumn: [ |
| | | { label: "姓名", prop: "workerName", min: 120, default: true }, |
| | | { label: "人员id", prop: "workerId", min: 190,default: true}, |
| | | { label: "手机号", prop: "client_level" }, |
| | | { label: "手机号", prop: "phone" }, |
| | | { label: "工种", prop: "workType", min: 100, }, |
| | | { label: "备注", prop: "actualAttendanceDays", min: 110 }, |
| | | { label: "应发工资", prop: "issueSalary", min: 110 }, |
| | | { label: "备注", prop: "remark", min: 110 }, |
| | | ], |
| | | showCol: [ |
| | | "手机号", |
| | | "工种", |
| | | "应发工资", |
| | | "备注", |
| | | ] |
| | | } |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true |
| | | await getAttendanceStatistic({ |
| | | await salaryReportForms({ |
| | | keyword: this.keyword, |
| | | month:this.object.date, |
| | | page: this.pagerOptions.currPage, |
| | |
| | | }) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | if (res.data && res.data.length > 0) { |
| | | let tableColumn1= [ |
| | | { label: "姓名", prop: "workerName", min: 120,default: true,fixed:'left' }, |
| | | { label: "人员ID", prop: "workerId", min: 120,default: true,fixed:'left'}, |
| | |
| | | { label: "备注", prop: "actualAttendanceDays", min: 110 }, |
| | | ] |
| | | let tableColumn2=[] |
| | | let headerList=res.data.list.length>0?res.data.list[0]:[] |
| | | if(headerList.details&&headerList.details.length>0){ |
| | | for(let i in headerList.details){ |
| | | let headerList=res.data.details?res.data.details:[] |
| | | if(headerList&&headerList.length>0){ |
| | | for(let i in headerList){ |
| | | tableColumn2.push({ |
| | | label:headerList.details[i].date+'', |
| | | prop:'headerDate'+headerList.details[i].date, |
| | | label:headerList[i].salaryType+'', |
| | | prop:'header&'+headerList[i].salaryType+'&'+headerList[i].salaryTypeId, |
| | | min:150, |
| | | default:true, |
| | | isEditTd:true, |
| | |
| | | let tableColumn=tableColumn1.concat(tableColumn2).concat(tableColumn3) |
| | | this.tableColumn=tableColumn; |
| | | this.setTable() |
| | | const list = res.data.list.map((item) => { |
| | | const list = res.data.map((item) => { |
| | | let headerItem={} |
| | | let details=item.details?item.details:[] |
| | | for(let i in details){ |
| | | headerItem['headerDate'+details[i].date]=details[i].status |
| | | headerItem['header&'+details[i].salaryType+'&'+details[i].salaryTypeId]=details[i].amount |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | | this.keyword = searchText ?? "" |
| | | onFilterSearch(searchText,val) { |
| | | if(val!='date'){ |
| | | this.keyword = searchText ?? "" |
| | | } |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |