chenlu
2025-11-27 b70ea28f51757ed39992d5a71b2e15b1d4cc7c7d
north-glass-erp/northglass-erp/src/views/pp/report/QualityReport.vue
@@ -59,7 +59,7 @@
      .toISOString()
      .replace('T', ' ')
      .slice(0, 10) //默认开始时间7天前
  const end = new Date(new Date().getTime() + 3600 * 1000 * 24)
  const end = new Date(new Date().getTime())
      .toISOString()
      .replace('T', ' ')
      .slice(0, 10)//默认结束时间当前时间
@@ -92,6 +92,7 @@
    gridOptions.loading = false
  } else {
    ElMessage.warning(res.msg)
    gridOptions.loading = false
  }
})
@@ -99,14 +100,16 @@
const selectPageList = () => {
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  gridOptions.loading = true
  request.post(`/report/qualityReport/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      produceList = deepClone(res.data.data)
      xGrid.value.reloadData(produceList)
      gridOptions.loading = false
    } else {
      gridOptions.loading = false
      ElMessage.warning(res.msg)
    }
  })
@@ -114,7 +117,7 @@
//点击查询
const getWorkOrder = () => {
  gridOptions.loading = true
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/report/qualityReport/${startTime}/${endTime}`, filterData.value).then((res) => {
@@ -125,8 +128,10 @@
      // pageTotal.value = res.data.total
      produceList = deepClone(res.data.data)
      xGrid.value.reloadData(produceList)
      gridOptions.loading = false
    } else {
      ElMessage.warning(res.msg)
      gridOptions.loading = false
    }
  })
}
@@ -173,6 +178,7 @@
//子组件接收参数
const xGrid = ref()
const gridOptions = reactive({
  loading: true,
  border: "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
@@ -250,8 +256,8 @@
    },
    {field: 'quantityMax', width: 120, title: t('report.quantityMax'), showOverflow: "ellipsis"},
    {field: 'breakage_quantity', width: 100, title: t('reportingWorks.quantityBroken')},
    {field: 'patch_num', width: 120, title:  t('reportingWorks.quantityBroken')},
    {field: 'received_quantity', width: 120, title: t('report.patchNum')},
    {field: 'patch_num', width: 120, title:  t('report.patchNum')},
    {field: 'received_quantity', width: 120, title: t('report.inventoryNum')},
    {field: 'finished', width: 120, title: t('report.finished')},
  ],//表头按钮
@@ -288,70 +294,71 @@
</script>
<template>
  <div class="main-div-customer">
    <div id="selectForm">
      <el-row :gutter="0">
  <div  style="width: 100%;height: 100%">
    <div class="head">
        <el-date-picker
            v-model="form.date1"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            format="YYYY/MM/DD"
            style="width: 100px"
            type="daterange"
            value-format="YYYY-MM-DD"
        />
        &nbsp;&nbsp;
        <el-button type="primary" @click="getWorkOrder">{{$t('basicData.search')}}</el-button>
      </el-row>
    </div>
    <vxe-grid
        ref="xGrid"
        class="mytable-scrollbar"
        max-height="100%"
        v-bind="gridOptions"
    <div class="main-table">
      <vxe-grid
          ref="xGrid"
          class="mytable-scrollbar"
          height="100%"
          v-bind="gridOptions"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
            <span>{{ row[item.field] }}</span>
          </li>
        </ul>
      </template>
      >
        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
        <!--      下拉显示所有信息插槽-->
        <template #content="{ row }">
          <ul class="expand-wrapper">
            <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
              <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
              <span>{{ row[item.field] }}</span>
            </li>
          </ul>
        </template>
      <template #toolbar_buttons>
        <vxe-button style="margin-right: 0.5rem"
                    @click="exportExcel('/report/exportQualityReport',
        <template #toolbar_buttons>
          <vxe-button style="margin-right: 0.5rem"
                      @click="exportExcel('/report/exportQualityReport',
                                          t('report.qualityReport'),
                                          form.date1)">
          {{t('basicData.export')}}</vxe-button>
      </template>
            {{t('basicData.export')}}</vxe-button>
        </template>
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input v-model="option.data" type="text" @input="changeFilterEvent($event, option, $panel)"/>
        <template #num1_filter="{ column, $panel }">
          <div>
            <div v-for="(option, index) in column.filters" :key="index">
              <input v-model="option.data" type="text"
                     @keyup.enter.native="$panel.confirmFilter()"
                     @input="changeFilterEvent($event, option, $panel)"/>
            </div>
          </div>
        </div>
      </template>
        </template>
    </vxe-grid>
      </vxe-grid>
    </div>
  </div>
</template>
<style scoped>
.main-div-customer {
  width: 99%;
  height: 100%;
.head{
  width: 100%;
  height: 35px;
}
#selectForm {
  width: 60%;
  text-align: center;
.main-table{
  width: 100%;
  height: calc(100% - 35px);
}
</style>