永康嘉持电器有限公司前端
小小儁爺
2025-03-05 c34f771c22b4650c858b7d468ab00541a693bb4f
src/views/statistic/workOrderProcess.vue
@@ -1,473 +1,479 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button v-waves type="primary" icon="el-icon-download" @click="download">导出</el-button>
        <!--        <el-button v-waves icon="el-icon-download" @click="upload">导入</el-button>-->
      </div>
      <div class="bodyTopFormGroup">
        <el-form
          ref="form"
          :model="form"
          label-width="100px"
          inline
          style="display: flex;"
        >
          <div class="elForm">
            <el-form-item label="销售单号" style=" display: flex;">
              <el-input v-model="form.socode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="车间名称" style=" display: flex;">
              <el-select
                v-model="form.wkshopcode"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in wkshopcodeArr"
                  :key="item.torg_code"
                  :label="item.torg_name"
                  :value="item.torg_code"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="工单状态" style=" display: flex;">
              <el-select v-model="form.status" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in statusArr"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="工单编号" style=" display: flex;">
              <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.wkshopname" placeholder="请输入" style="width: 200px" />-->
            <!--            </el-form-item>-->
            <el-form-item v-show="isExpandForm" label="产品编码" style=" display: flex;">
              <el-input v-model="form.partcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="产品名称" style=" display: flex;">
              <el-input v-model="form.partname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="规格型号" style=" display: flex;">
              <el-input v-model="form.partspec" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="单据日期" style="display: flex;align-items: center">
              <el-date-picker
                v-model="form.lm_date"
                type="daterange"
                range-separator="~"
                class="timeMini"
                size="mini"
                style="width: 200px;display: flex;line-height: 34px;height: 34px;"
                :clearable="false"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </el-form-item>
          </div>
          <div
            class="bodySearchReset"
            :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
          >
            <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
        <div
          class="bodyTopFormExpand"
        >
          <svg-icon
            v-show="mouseHoverType==='mouseout'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
            @mouseenter="mouseHoverType=$event.type"
          />
          <svg-icon
            v-show="mouseHoverType==='mouseenter'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
            @click="isExpandForm=!isExpandForm"
            @mouseout="mouseHoverType=$event.type"
          />
        </div>
      </div>
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef"
          class="tableFixed  custom-table-class"
          :data="tableData"
          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
          border
          :row-class-name="tableRowClassName"
          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <el-table-column
            prop="rowNum"
            width="50"
            fixed
            label="序号"
          />
          <el-table-column
            prop="lm_date"
            label="单据日期"
            width="105"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="status"
            label="工单状态"
            width="105"
            sortable="custom"
          />
          <el-table-column
            prop="wo_code"
            label="工单编号"
            width="155"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="saleOrderCode"
            label="销售单号"
            width="135"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partcode"
            label="产品编码"
            width="105"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partname"
            label="产品名称"
            width="155"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partpesc"
            label="产品规格"
            width="105"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.partpesc">{{ row.partpesc }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <!--          <el-table-column-->
          <!--            prop="wkshp_code"-->
          <!--            label="车间编码"-->
          <!--            width="130"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            prop="wkshp_name"
            label="车间名称"
            width="130"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="plan_qty"
            label="任务数量"
            width="105"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="concat_name"
            label="生产进度"
            min-width="521"
            sortable="custom"
          >
            <!--            show-tooltip-when-overflow-->
            <template slot-scope="{row}">
              <div style="min-width:500px;display: flex;overflow-x: auto;overflow-y: hidden;height: 65px;">
                <div
                  v-for="item in row.concat_name.split(',')"
                  :key="item+row.wo_code"
                  style="display: flex;align-items: center;"
                >
                  <!--                  padding:0px 0px 10px 0px;-->
                  <div
                    style="position: relative;display: flex;flex-direction: column;width: 120px;text-align: center;align-items: center;margin-left:10px"
                  >
                    <div style="width: 120px;" class="ellipsis">{{ item.split('/')[0] }}</div>
                    <el-progress
                      :text-inside="true"
                      :stroke-width="18"
                      color="#2FD04F"
                      define-back-color="rgba(144,147,153,0.5)"
                      :percentage="parseFloat((parseFloat(item.split('/')[1])*100/parseFloat(row.plan_qty)).toFixed(2))"
                      style="width: 120px;margin: 0 2px;"
                    />
                    <div style="position: absolute;top:22px;">{{ parseFloat(item.split('/')[1]) }}/{{
                      row.plan_qty
                    }}
                    </div>
                  </div>
                </div>
              </div>
            </template>
          </el-table-column>
          <!--          <el-table-column-->
          <!--            label="操作"-->
          <!--            width="120"-->
          <!--            fixed="right"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div class="operationClass">-->
          <!--                <el-tooltip class="item" effect="dark" content="编辑" placement="top">-->
          <!--                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />-->
          <!--                </el-tooltip>-->
          <!--                <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">-->
          <!--                  <i class="el-icon-delete" @click="del(row)" />-->
          <!--                </el-tooltip>-->
          <!--              </div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
        </el-table>
      </div>
      <!--分页-->
      <pagination
        :total="total"
        :page.sync="form.page"
        :limit.sync="form.rows"
        align="right"
        layout="total,prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getProductionScheduleReportSearch"
      />
    </div>
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { handleDatetime } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import {
  ProductionScheduleReportExcelSearch,
  ProductionScheduleReportSearch
} from '@/api/ReportManager'
import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
export default {
  name: 'WorkOrderProcess',
  components: {
    Pagination
  },
  directives: { elDragDialog, waves },
  data() {
    return {
      mouseHoverType: 'mouseout',
      isExpandForm: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
        socode: '', // 销售单号
        status: '', // 工单状态
        wocode: '', // 工单编号
        wkshopcode: '', // 工艺路线编码
        wkshopname: '', // 工艺路线名称
        partcode: '', // 产品编码
        partname: '', // 产品名称
        partspec: '', // 规格型号
        lm_date: '', // 单据日期
        prop: 'lm_date', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
      statusArr: [
        { label: '未开始', value: 'NOSTART' },
        { label: '执行中', value: 'START' },
        { label: '已完成', value: 'CLOSED' }
      ],
      wkshopcodeArr: [],
      total: 10,
      tableData: []
    }
  },
  activated() {   window.addEventListener('resize', this.getHeight)   this.getHeight() }, created() {
    this.getProductionScheduleReportSearch()
    this.getPrentOrganizationNoCompany()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    async getPrentOrganizationNoCompany() {
      const { data: res } = await PrentOrganizationNoCompany()
      this.wkshopcodeArr = res
    },
    async getProductionScheduleReportSearch() {
      let tempDate = this.form.lm_date
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        socode: this.form.socode,
        status: this.form.status,
        wocode: this.form.wocode,
        wkshopcode: this.form.wkshopcode,
        wkshopname: this.form.wkshopname,
        partcode: this.form.partcode,
        partname: this.form.partname,
        partspec: this.form.partspec,
        lm_date: tempDate,
        prop: this.form.prop,
        order: this.form.order,
        page: this.form.page,
        rows: this.form.rows
      }
      const res = await ProductionScheduleReportSearch(data)
      this.tableData = res.data
      this.total = res.count
    },
    // 导出
    async download() {
      let tempDate = this.form.lm_date
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        socode: this.form.socode,
        status: this.form.status,
        wocode: this.form.wocode,
        wkshopcode: this.form.wkshopcode,
        wkshopname: this.form.wkshopname,
        partcode: this.form.partcode,
        partname: this.form.partname,
        partspec: this.form.partspec,
        lm_date: tempDate
      }
      const res = await ProductionScheduleReportExcelSearch(data)
      // console.log(res)
      window.location.href = res.data
    },
    // 排序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {
        order = 'desc'
      } else if (order === 'ascending') {
        order = 'asc'
      } else {
        order = 'desc'
      }
      this.form.order = order
      this.form.prop = prop
      this.getProductionScheduleReportSearch()
    },
    // 查询
    search() {
      this.getProductionScheduleReportSearch()
    },
    // 重置
    reset() {
      this.form.socode = ''
      this.form.status = ''
      this.form.wocode = ''
      this.form.wkshopcode = ''
      this.form.wkshopname = ''
      this.form.partcode = ''
      this.form.partname = ''
      this.form.partspec = ''
      this.form.lm_date = ''
      this.getProductionScheduleReportSearch()
    },
    // 获取页面高度
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 255
        this.$refs.tableDataRef.doLayout()
      })
    },
    tableRowClassName({ row, rowIndex }) {
      return 'custom-row'
    }
  }
}
</script>
<style scoped lang="scss">
::v-deep .el-select__caret {
  display: flex;
  align-items: center;
  justify-content: center;
}
::v-deep .el-range__icon {
  line-height: 28px !important;
}
::v-deep .el-range-separator {
  line-height: 28px !important;
}
::v-deep .el-range-input {
  font-size: 14px;
}
::v-deep .el-range-separator {
  display: flex;
  justify-content: center;
  align-items: center;
}
::v-deep .el-progress-bar__innerText {
  display: none !important;
}
//.custom-table-class {
//  ::v-deep .el-table__row {
//    height: 80px;
//    line-height:80px;
//  }
//}
</style>
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button v-waves type="primary" icon="el-icon-download" @click="download">导出</el-button>
        <!--        <el-button v-waves icon="el-icon-download" @click="upload">导入</el-button>-->
      </div>
      <div class="bodyTopFormGroup">
        <el-form
          ref="form"
          :model="form"
          label-width="100px"
          inline
          style="display: flex;"
        >
          <div class="elForm">
            <el-form-item label="销售单号" style=" display: flex;">
              <el-input v-model="form.socode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="车间名称" style=" display: flex;">
              <el-select
                v-model="form.wkshopcode"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in wkshopcodeArr"
                  :key="item.torg_code"
                  :label="item.torg_name"
                  :value="item.torg_code"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="工单状态" style=" display: flex;">
              <el-select v-model="form.status" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in statusArr"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="工单编号" style=" display: flex;">
              <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.wkshopname" placeholder="请输入" style="width: 200px" />-->
            <!--            </el-form-item>-->
            <el-form-item v-show="isExpandForm" label="产品编码" style=" display: flex;">
              <el-input v-model="form.partcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="产品名称" style=" display: flex;">
              <el-input v-model="form.partname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="规格型号" style=" display: flex;">
              <el-input v-model="form.partspec" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="单据日期" style="display: flex;align-items: center">
              <el-date-picker
                v-model="form.lm_date"
                type="daterange"
                range-separator="~"
                class="timeMini"
                size="mini"
                style="width: 200px;display: flex;line-height: 34px;height: 34px;"
                :clearable="false"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </el-form-item>
          </div>
          <div
            class="bodySearchReset"
            :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
          >
            <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
        <div
          class="bodyTopFormExpand"
        >
          <svg-icon
            v-show="mouseHoverType==='mouseout'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
            @mouseenter="mouseHoverType=$event.type"
          />
          <svg-icon
            v-show="mouseHoverType==='mouseenter'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
            @click="isExpandForm=!isExpandForm"
            @mouseout="mouseHoverType=$event.type"
          />
        </div>
      </div>
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef"
          class="tableFixed  custom-table-class"
          :data="tableData"
          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
          border
          :row-class-name="tableRowClassName"
          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <el-table-column
            prop="rowNum"
            width="50"
            fixed
            label="序号"
          />
          <el-table-column
            prop="lm_date"
            label="单据日期"
            width="105"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="status"
            label="工单状态"
            width="105"
            sortable="custom"
          />
          <el-table-column
            prop="wo_code"
            label="工单编号"
            width="155"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="saleOrderCode"
            label="销售单号"
            width="135"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partcode"
            label="产品编码"
            width="105"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partname"
            label="产品名称"
            width="155"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partpesc"
            label="产品规格"
            width="105"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.partpesc">{{ row.partpesc }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <!--          <el-table-column-->
          <!--            prop="wkshp_code"-->
          <!--            label="车间编码"-->
          <!--            width="130"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            prop="wkshp_name"
            label="车间名称"
            width="130"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="plan_qty"
            label="任务数量"
            width="105"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="concat_name"
            label="生产进度"
            min-width="521"
            sortable="custom"
          >
            <!--            show-tooltip-when-overflow-->
            <template slot-scope="{row}">
              <div style="min-width:500px;display: flex;overflow-x: auto;overflow-y: hidden;height: 65px;">
                <div
                  v-for="item in row.concat_name.split(',')"
                  :key="item+row.wo_code"
                  style="display: flex;align-items: center;"
                >
                  <!--                  padding:0px 0px 10px 0px;-->
                  <div
                    style="position: relative;display: flex;flex-direction: column;width: 120px;text-align: center;align-items: center;margin-left:10px"
                  >
                    <div style="width: 120px;" class="ellipsis">{{ item.split('/')[0] }}</div>
                    <el-progress
                      :text-inside="true"
                      :stroke-width="18"
                      color="#2FD04F"
                      define-back-color="rgba(144,147,153,0.5)"
                      :percentage="parseFloat((parseFloat(item.split('/')[1])*100/parseFloat(row.plan_qty)).toFixed(2))"
                      style="width: 120px;margin: 0 2px;"
                    />
                    <div style="position: absolute;top:22px;">{{ parseFloat(item.split('/')[1]) }}/{{
                      row.plan_qty
                    }}
                    </div>
                  </div>
                </div>
              </div>
            </template>
          </el-table-column>
          <!--          <el-table-column-->
          <!--            label="操作"-->
          <!--            width="120"-->
          <!--            fixed="right"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div class="operationClass">-->
          <!--                <el-tooltip class="item" effect="dark" content="编辑" placement="top">-->
          <!--                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />-->
          <!--                </el-tooltip>-->
          <!--                <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">-->
          <!--                  <i class="el-icon-delete" @click="del(row)" />-->
          <!--                </el-tooltip>-->
          <!--              </div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
        </el-table>
      </div>
      <!--分页-->
      <pagination
        :total="total"
        :page.sync="form.page"
        :limit.sync="form.rows"
        align="right"
        layout="total,prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getProductionScheduleReportSearch"
      />
    </div>
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { handleDatetime } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import {
  ProductionScheduleReportExcelSearch,
  ProductionScheduleReportSearch
} from '@/api/ReportManager'
import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
export default {
  name: 'WorkOrderProcess',
  components: {
    Pagination
  },
  directives: { elDragDialog, waves },
  data() {
    return {
      mouseHoverType: 'mouseout',
      isExpandForm: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
        socode: '', // 销售单号
        status: '', // 工单状态
        wocode: '', // 工单编号
        wkshopcode: '', // 工艺路线编码
        wkshopname: '', // 工艺路线名称
        partcode: '', // 产品编码
        partname: '', // 产品名称
        partspec: '', // 规格型号
        lm_date: '', // 单据日期
        prop: 'lm_date', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
      statusArr: [
        { label: '未开始', value: 'NOSTART' },
        { label: '执行中', value: 'START' },
        { label: '已完成', value: 'CLOSED' }
      ],
      wkshopcodeArr: [],
      total: 10,
      tableData: []
    }
  },
  activated() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
    this.getProductionScheduleReportSearch()
    this.getPrentOrganizationNoCompany()
  },
  created() {
    this.getProductionScheduleReportSearch()
    this.getPrentOrganizationNoCompany()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    async getPrentOrganizationNoCompany() {
      const { data: res } = await PrentOrganizationNoCompany()
      this.wkshopcodeArr = res
    },
    async getProductionScheduleReportSearch() {
      let tempDate = this.form.lm_date
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        socode: this.form.socode,
        status: this.form.status,
        wocode: this.form.wocode,
        wkshopcode: this.form.wkshopcode,
        wkshopname: this.form.wkshopname,
        partcode: this.form.partcode,
        partname: this.form.partname,
        partspec: this.form.partspec,
        lm_date: tempDate,
        prop: this.form.prop,
        order: this.form.order,
        page: this.form.page,
        rows: this.form.rows
      }
      const res = await ProductionScheduleReportSearch(data)
      this.tableData = res.data
      this.total = res.count
    },
    // 导出
    async download() {
      let tempDate = this.form.lm_date
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        socode: this.form.socode,
        status: this.form.status,
        wocode: this.form.wocode,
        wkshopcode: this.form.wkshopcode,
        wkshopname: this.form.wkshopname,
        partcode: this.form.partcode,
        partname: this.form.partname,
        partspec: this.form.partspec,
        lm_date: tempDate
      }
      const res = await ProductionScheduleReportExcelSearch(data)
      // console.log(res)
      window.location.href = res.data
    },
    // 排序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {
        order = 'desc'
      } else if (order === 'ascending') {
        order = 'asc'
      } else {
        order = 'desc'
      }
      this.form.order = order
      this.form.prop = prop
      this.getProductionScheduleReportSearch()
    },
    // 查询
    search() {
      this.getProductionScheduleReportSearch()
    },
    // 重置
    reset() {
      this.form.socode = ''
      this.form.status = ''
      this.form.wocode = ''
      this.form.wkshopcode = ''
      this.form.wkshopname = ''
      this.form.partcode = ''
      this.form.partname = ''
      this.form.partspec = ''
      this.form.lm_date = ''
      this.getProductionScheduleReportSearch()
    },
    // 获取页面高度
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 255
        this.$refs.tableDataRef.doLayout()
      })
    },
    tableRowClassName({ row, rowIndex }) {
      return 'custom-row'
    }
  }
}
</script>
<style scoped lang="scss">
::v-deep .el-select__caret {
  display: flex;
  align-items: center;
  justify-content: center;
}
::v-deep .el-range__icon {
  line-height: 28px !important;
}
::v-deep .el-range-separator {
  line-height: 28px !important;
}
::v-deep .el-range-input {
  font-size: 14px;
}
::v-deep .el-range-separator {
  display: flex;
  justify-content: center;
  align-items: center;
}
::v-deep .el-progress-bar__innerText {
  display: none !important;
}
//.custom-table-class {
//  ::v-deep .el-table__row {
//    height: 80px;
//    line-height:80px;
//  }
//}
</style>