zouyu
15 小时以前 8fc1138d2f2115121fd15b679ca1a20fc2ba838a
src/views/performance/manHour/workTimeStatistics.vue
@@ -30,27 +30,59 @@
            <el-form-item>
              <el-button type="primary" size="mini" @click="refreshTable">查询</el-button>
              <el-button size="mini" @click="refresh">重置</el-button>
              <el-button :loading="downloadLoading" type="success" size="mini" @click="exportWorkHoursTotal">导出</el-button>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <limsTable
        :column="tableColumn"
        :table-data="tableData"
        :table-loading="tableLoading"
        :page="page"
<!--      <limsTable-->
<!--        :column="tableColumn"-->
<!--        :table-data="tableData"-->
<!--        :table-loading="tableLoading"-->
<!--        :page="page"-->
<!--        :height="'calc(100vh - 290px)'"-->
<!--        @pagination="pagination"-->
<!--      >-->
<!--      </limsTable>-->
      <el-table
        :data="tableData"
        v-loading="tableLoading"
        :height="'calc(100vh - 290px)'"
        @pagination="pagination"
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{ background: '#f8f8f9', color: '#515a6e', textAlign: 'center' }"
        border
      >
      </limsTable>
        <el-table-column type="index" label="序号"></el-table-column>
        <el-table-column prop="userName" label="姓名" min-width="120"></el-table-column>
        <el-table-column prop="month" label="月份" min-width="120"></el-table-column>
        <el-table-column label="LIMS">
          <el-table-column prop="yieldHour" label="产量工时" min-width="120"></el-table-column>
          <el-table-column prop="subsidiaryHour" label="辅助工时" min-width="120"></el-table-column>
          <el-table-column prop="totalHour" label="总工时" min-width="120"></el-table-column>
        </el-table-column>
        <el-table-column label="耐丝域MES">
          <el-table-column prop="operationPerformanceByNS" label="工序绩效" min-width="120"></el-table-column>
          <el-table-column prop="productPerformanceByNS" label="成品绩效" min-width="120"></el-table-column>
          <el-table-column prop="onsiteInspWageByNS" label="巡检绩效" min-width="120"></el-table-column>
          <el-table-column prop="handymanWageByNS" label="杂工工资" min-width="120"></el-table-column>
        </el-table-column>
        <el-table-column label="科技域MES">
          <el-table-column prop="operationPerformanceByKJ" label="工序绩效" min-width="120"></el-table-column>
          <el-table-column prop="productPerformanceByKJ" label="成品绩效" min-width="120"></el-table-column>
          <el-table-column prop="onsiteInspWageByKJ" label="巡检绩效" min-width="120"></el-table-column>
          <el-table-column prop="handymanWageByKJ" label="杂工工资" min-width="120"></el-table-column>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
import { getYearAndMonthAndDays, getYearAndMonthAndDaysZTZB } from "@/utils/date";
import {transformExcel} from '@/utils/file'
import { getYearAndMonthAndDays, getWorkMonth } from "@/utils/date";
import limsTable from "@/components/Table/lims-table.vue";
import { selectAuxiliaryAllByMonth } from "@/api/performance/manHour";
import { selectAuxiliaryAllByMonth,exportWorkHoursTotal } from "@/api/performance/manHour";
export default {
  components: {
    limsTable
@@ -58,7 +90,7 @@
  data() {
    return {
      queryParams: {
        month: getYearAndMonthAndDaysZTZB().slice(0, 7),
        month: getWorkMonth().format('YYYY-MM'),
        name: "",
        departLims: "",
      },
@@ -96,12 +128,25 @@
        size: 20,
        current: 0,
      },
      downloadLoading: false,
    };
  },
  mounted() {
    this.refreshTable();
  },
  methods: {
    exportWorkHoursTotal(){
      this.downloadLoading = true
      exportWorkHoursTotal(this.queryParams).then(res=>{
        transformExcel(res, "中天耐丝质量部工时汇总.xlsx")
        this.$message.success("导出成功")
        this.$nextTick(()=>{
          this.downloadLoading = false
        })
      }).catch((error)=>{
        console.error(error)
      })
    },
    refreshTable() {
      this.tableLoading = true;
      selectAuxiliaryAllByMonth(this.queryParams)
@@ -115,7 +160,7 @@
    },
    refresh() {
      this.queryParams = {
        month: getYearAndMonthAndDaysZTZB().slice(0, 7),
        month: getWorkMonth().format('YYYY-MM'),
        name: "",
        departLims: "",
      };