charles
2024-07-11 5e9b4920000a4d02eef3b207218e3ce8d68935be
src/views/reportManage/payableSalaryReport/index.vue
@@ -11,13 +11,16 @@
          @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-button size="small" type="primary" @click="exportBtnClick">导出</el-button>
            </div>
          </template>
        </CommonSearch>
@@ -36,16 +39,16 @@
          >
          </TableCommonView>
        </div>
        <!-- <div class="btn-pager">
        <div class="btn-pager">
          <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        </div> -->
        </div>
      </div>
    </div> 
  </div>
</template>
<script>
import { getAttendanceStatistic } from  "@/api/employeeSalary/attendanceManage.js"
import { salaryReportForms } from  "@/api/reportManage/report.js"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import NewDate from "@/api/date";
const { getCurrentMonth } = NewDate;
@@ -73,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: [
        "手机号",
        "工种",
        "应发工资",
        "备注",
      ]
    }
@@ -123,15 +128,15 @@
    // 请求数据
    async getData() {
      this.loading = true
      await getAttendanceStatistic({
      await salaryReportForms({
        keyword: this.keyword,
        month:this.object.date,
        // page: this.pagerOptions.currPage,
        // pageSize: this.pagerOptions.pageSize
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .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'}, 
@@ -142,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,
@@ -158,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,
@@ -170,7 +175,7 @@
                }
              })
              this.tableList.tableInfomation = list || []
              this.pagerOptions.totalCount = res.total
              this.pagerOptions.totalCount = res.total||0
            } else {
              this.tableList.tableInfomation = []
            }
@@ -186,14 +191,18 @@
        })
    },
    // 搜索
    onFilterSearch(searchText) {
      this.keyword = searchText ?? ""
    onFilterSearch(searchText,val) {
      if(val!='date'){
        this.keyword = searchText ?? ""
      }
      this.pagerOptions.currPage = 1
      this.getData()
    },
    inputContent( prop, row, scope){
      console.log(prop,'---',row,'---',scope)
    },
     // 导出
     exportBtnClick() {}
  }
}
</script>
@@ -223,15 +232,16 @@
    box-sizing: border-box;
    padding: 10px 20px;
    border-radius: 12px;
    height: calc(100% - 92px);
    height: calc(100% - 102px);
    .body-card {
      background-color: #fff;
      border-radius: 12px;
      height: 100%;
      box-sizing: border-box;
      overflow: hidden;
    }
    .list-view {
      height: calc(100% - 10px);
      height: calc(100% - 60px);
      overflow: hidden;
    }
    .btn-pager {