loulijun2021
2023-05-23 ff0604306c9cf18a05e5d8a3a136432284c290bb
src/views/bbgl/rygz.vue
@@ -1,8 +1,35 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button v-waves type="primary" icon="el-icon-download" @click="download">导出</el-button>
        <div class="topRight" style="display: flex;align-items: center">
          <div
            style="color: red;margin: 0px 10px 0 0;"
          >当前报表只统计自制件工序
          </div>
          <!--          <div style="font-size: 14px;margin-right: 15px;color: #a7a7a7">剔除工序</div>-->
          <el-select
            v-model="form.rejectstepcode"
            style="width: 220px;"
            multiple
            placeholder="请选择剔除车间"
            collapse-tags
            filterable
            clearable
            @change="getPeopleSalaryReportSearch"
          >
            <el-option
              v-for="item in WorkShopArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </div>
      </div>
      <div class="bodyTopFormGroup">
@@ -15,19 +42,19 @@
        >
          <div class="elForm">
            <el-form-item label="工单编号" style="display: flex;">
              <el-input v-model="form.wocode" placeholder="请输入" style="width: 200px" />
              <el-input v-model="form.wocode" placeholder="请输入" style="width: 200px"/>
            </el-form-item>
            <el-form-item label="产品编码" style=" display: flex;">
              <el-input v-model="form.partcode" placeholder="请输入" style="width: 200px" />
              <el-input v-model="form.partcode" placeholder="请输入" style="width: 200px"/>
            </el-form-item>
            <el-form-item label="产品名称" style=" display: flex;">
              <el-input v-model="form.partname" style="width: 200px" placeholder="请输入" />
              <el-input v-model="form.partname" style="width: 200px" placeholder="请输入"/>
            </el-form-item>
            <el-form-item label="规格型号" style=" display: flex;">
              <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入" />
              <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入"/>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="工序名称" style=" display: flex;">
              <el-input v-model="form.stepname" style="width: 200px" placeholder="请输入" />
              <el-input v-model="form.stepname" style="width: 200px" placeholder="请输入"/>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="生产班组" style=" display: flex;">
              <el-select v-model="form.groupcode" style="width: 200px" placeholder="请选择">
@@ -40,7 +67,7 @@
              </el-select>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="报工人员" style=" display: flex;">
              <el-input v-model="form.reportname" style="width: 200px" placeholder="请输入" />
              <el-input v-model="form.reportname" style="width: 200px" placeholder="请输入"/>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="报工时间" style="display: flex;align-items: center">
              <el-date-picker
@@ -95,8 +122,7 @@
              :data="tableData"
              :height="isExpandForm?(tableHeight-80):(tableHeight-40)+'px'"
              border
              :summary-method="getSummaries"
              show-summary
              :row-class-name="tableRowClassName"
              :style="{width: 100+'%',height:isExpandForm?(tableHeight-80):(tableHeight-40)+'px',}"
              highlight-current-row
@@ -104,6 +130,8 @@
              :cell-style="this.$cellStyle"
              @sort-change="sortChange"
            >
<!--              :summary-method="getSummaries"-->
<!--              show-summary-->
              <el-table-column
                prop="RowNum"
                width="50"
@@ -199,7 +227,7 @@
              </el-table-column>
              <el-table-column
                prop="ratio"
                label="工序单价"
                label="分配比例"
                width="110"
                sortable="custom"
              >
@@ -210,7 +238,7 @@
              </el-table-column>
              <el-table-column
                prop="usermoney"
                label="个人记件工资"
                label="个人计件工资"
                width="130"
                sortable="custom"
              >
@@ -253,8 +281,7 @@
              :data="tableData2"
              :height="isExpandForm?(tableHeight-80):(tableHeight-40)+'px'"
              border
              :summary-method="getSummaries"
              show-summary
              :row-class-name="tableRowClassName"
              :style="{width: 100+'%',height:isExpandForm?(tableHeight-80):(tableHeight-40)+'px',}"
              highlight-current-row
@@ -262,6 +289,8 @@
              :cell-style="this.$cellStyle"
              @sort-change="sortChange"
            >
<!--              :summary-method="getSummaries"-->
<!--              show-summary-->
              <el-table-column
                prop="RowNum"
                width="50"
@@ -357,7 +386,7 @@
              </el-table-column>
              <el-table-column
                prop="usermoney"
                label="个人记件工资"
                label="个人计件工资"
                width="130"
                sortable="custom"
              >
@@ -448,6 +477,8 @@
import { MesOrderStepReportSelectUserGroup } from '@/api/scgl'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { StepSelect } from '@/api/zzmx'
import { WorkShopSelect } from '@/api/sbgl'
export default {
  name: 'Zzjg',
@@ -461,6 +492,8 @@
      isExpandForm: false,
      mainHeight: 0,
      tableHeight: 0,
      // StepSelectArr: [], // 剔除工序数组
      WorkShopArr: [],//剔除车间数组
      form: {
        wocode: '', // 工单编号
        partcode: '', // 产品编码
@@ -470,6 +503,7 @@
        groupcode: '', // 生产班组
        reportname: '', // 操作人员
        reportdate: '', // 操作时间
        rejectstepcode: [], // 剔除工序(固定薪资工序不参与计算
        compute: 'last', // 计件方式
        prop: 'partcode', // 排序字段
        order: 'desc', // 排序字段
@@ -533,15 +567,28 @@
      this.getPeopleSalaryReportSearch().then(res => {
        if (res.code === '200') {
          this.getMesOrderStepReportSelectUserGroup()
          this.getWorkShopSelect()
        }
      })
    },
    // 获取工序下拉接口
    // async  getStepSelect() {
    //   const { data: res } = await StepSelect()
    //   this.StepSelectArr = res
    // },
    // 获取所属车间下拉
    async getWorkShopSelect() {
      const { data: res } = await WorkShopSelect()
      this.WorkShopArr = res
    },
    getSummaries(param) {
      const { columns, data } = param
      const sums = []
      const i = this.form.compute === 'last' ? 11 : 10
      columns.forEach((column, index) => {
        if (index === 10) {
        if (index === i) {
          sums[index] = '总价'
          return
        }
@@ -550,9 +597,10 @@
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr)
            if (!isNaN(value)) {
              return prev + curr
              // return prev + curr
              return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100
            } else {
              return prev
              return Math.round(prev * 100) / 100
            }
          }, 0)
@@ -567,7 +615,10 @@
        this.$refs.tableDataRef.doLayout()
        this.$refs.tableDataRef2.doLayout()
      })
      // (Math.round(sums * 100) / 100).toS
      // console.log(typeof sums)
      // console.log(sums[11].split(' '))
      return sums
    },
    async getPeopleSalaryReportSearch() {
@@ -584,6 +635,7 @@
        groupcode: this.form.groupcode,
        compute: this.form.compute,
        reportname: this.form.reportname,
        rejectstepcode: this.form.rejectstepcode.join(','),
        reportdate: tempDate,
        prop: this.form.prop,
        order: this.form.order,
@@ -890,6 +942,20 @@
    height: 100% !important;
  }
}
.topRight ::v-deep {
  input::-webkit-input-placeholder {
    color: $main_color;
  }
  //input::-moz-input-placeholder {
  //  color: rgba(0, 204, 254, 1);
  //}
  input::-ms-input-placeholder {
    color: $main_color;
  }
}
</style>
<style>