haoxuan
2024-05-07 54fc73f46ae0949af4e75d78048e813461d6af85
分页问题修改
1个文件已修改
42 ■■■■■ 已修改文件
src/views/reportManage/payableSalaryReport/index.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportManage/payableSalaryReport/index.vue
@@ -11,13 +11,15 @@
          @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>
@@ -46,7 +48,7 @@
</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;
@@ -74,13 +76,15 @@
      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: [
        "手机号",
        "工种",
        "应发工资",
        "备注",
      ]
    }
@@ -124,7 +128,7 @@
    // 请求数据
    async getData() {
      this.loading = true
      await getAttendanceStatistic({
      await salaryReportForms({
        keyword: this.keyword,
        month:this.object.date,
        page: this.pagerOptions.currPage,
@@ -132,7 +136,7 @@
      })
        .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'}, 
@@ -143,12 +147,12 @@
               { 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,
@@ -159,11 +163,11 @@
              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,
@@ -187,8 +191,10 @@
        })
    },
    // 搜索
    onFilterSearch(searchText) {
      this.keyword = searchText ?? ""
    onFilterSearch(searchText,val) {
      if(val!='date'){
        this.keyword = searchText ?? ""
      }
      this.pagerOptions.currPage = 1
      this.getData()
    },