NNowhZzU
2023-12-25 fcd7ece15a86fc0cb526ee801ff8262b0db22dee
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInspectionReview.vue
@@ -1,24 +1,96 @@
<script lang="ts" setup>
import { reactive } from 'vue'
import { ref } from 'vue'
const value = ref('')
const defaultTime = ref<[Date, Date]>([
  new Date(2000, 1, 1, 0, 0, 0),
  new Date(2000, 2, 1, 23, 59, 59),
])
<script setup>
// do not use same name with ref
const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
import {reactive} from "vue";
import {useRouter} from  'vue-router'
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
    case 'edit' :{
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/reportingWorks/QualityInReviewDetail', query: { id: row.id }})
      break
    }
    case 'delete':{
      alert('我接收到子组件传送的删除信息')
      break
    }
    case  'setType':{
      alert('我接收到子组件传送的审核状态')
      break
    }
  }
}
//表尾求和
const sumNum = (list, field) => {
  let count = 0
  list.forEach(item => {
    count += Number(item[field])
})
const tableData = [
  return count.toFixed(2)
}
//子组件接收参数
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
  exportConfig: {},
  scrollY:{ enabled: true },//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
  filterConfig: {   //筛选配置项
    remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {title: '操作', width: 120, slots: { default: 'button_slot' },fixed:"left"},
    {field: 'reportingWorkNo',width: 120,  title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
    {field: 'reportingWorkTime',width: 120, title: '报工时间', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'entryName',width: 120, title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'customerName',width: 120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'thisProcess',width: 100, title: '本工序', sortable: true,showOverflow:"ellipsis"},
    {field: 'teamName',width: 110, title: '报工班组', sortable: true},
    {field: 'finishedNumber',width: 100, title: '完工数量', sortable: true},
    {field: 'wornNumber', width: 100,title: '次破数量', sortable: true},
    {field: 'responsibilityProcess',width: 100, title: '责任工序', sortable: true},
    {field: 'previousProcess', width: 100,title: '上工序', sortable: true},
    {field: 'nextProcess',width: 100, title: '下工序', sortable: true},
    {field: 'qualityInspector',width: 120, title: '质检员', sortable: true},
    {field: 'qualityState',width: 120, title: '质检状态', sortable: true},
    {field: 'notes',width: 120, title: '备注', sortable: true}
  ],//表头按钮
  toolbarConfig: {
    // buttons: [{
    //
    // }],
    import: false,
    export: true,
    print: true,
    zoom: true,
    custom: true
  },
  data:  [
  {
    reportingWorkNo: 'BG2312070001',
    reportingWorkTime: '2023-12-01 08:01:22',
@@ -88,20 +160,40 @@
    notes: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。',
  },
  ],//table body实际数据
  //脚部求和
  footerMethod ({ columns, data }) {//页脚函数
    let footList=['finishedNumber','wornNumber']
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
        }
        return ''
      })
]
  }
})
</script>
<template>
  <div>
  <div class="main-div-customer">
    <div style="width: 600px">
      <el-row :gutter="0">
<!--        <el-input placeholder="流程卡号" v-model="form.name" style="width: 200px"/>-->
<!--        &nbsp;&nbsp;-->
        <select class="processesSt">
          <option value="未审核">未审核</option>
          <option value="已审核">已审核</option>
        </select>
        &nbsp;&nbsp;
<!--        <select class="processesSt">-->
<!--          <option value="未审核">未审核</option>-->
<!--          <option value="已审核">已审核</option>-->
<!--        </select>-->
        <el-date-picker
            v-model="value"
            type="daterange"
@@ -114,44 +206,47 @@
        <el-button type="primary">查询</el-button>
      </el-row>
    </div>
    <div>
      <el-table :data="tableData" border style="width: 100%" height="100%">
        <el-table-column fixed label="操作" width="60"  >
          <el-button link type="primary" size="small">通过</el-button>
        </el-table-column>
        <el-table-column sortable prop="reportingWorkNo" label="报工编号" width="120" >
          <template v-slot="scope">
            <router-link :to="{path:'QualityInReviewDetail'}" >{{scope.row.reportingWorkNo}}</router-link>
          </template>
        </el-table-column>
        <el-table-column prop="reportingWorkTime" label="报工时间" width="155" />
        <el-table-column prop="processCard" label="流程卡号" width="125" />
        <el-table-column prop="entryName" label="项目名称"  :show-overflow-tooltip='true' width="155" />
        <el-table-column prop="customerName" label="客户名称"  :show-overflow-tooltip='true' width="155" />
        <el-table-column prop="thisProcess" label="本工序" width="70" />
        <el-table-column prop="teamName" label="报工班组" width="95" />
        <el-table-column prop="finishedNumber" label="完工数量" width="85" />
        <el-table-column prop="wornNumber" label="次破数量" width="85" />
        <el-table-column prop="responsibilityProcess" label="责任工序" width="85" />
        <el-table-column prop="previousProcess" label="上工序" width="70" />
        <el-table-column prop="nextProcess" label="下工序" width="70" />
        <el-table-column prop="qualityInspector" label="质检员" width="80" />
        <el-table-column prop="qualityState" label="质检状态" width="90" />
        <el-table-column prop="notes" label="备注" :show-overflow-tooltip='true' width="350" />
      </el-table><!-- <h1>{{msg}}</h1> -->
    </div>
    <vxe-grid
        max-height="100%"
        @filter-change="filterChanged"
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row}">
        <ul class="expand-wrapper">
          <li  v-for="(item,key,index) in row">
            <span style="font-weight: bold">{{key+':  '}}</span>
            <span>{{ item }}</span>
          </li>
        </ul>
      </template>
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
        <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button>
      </template>
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
          </div>
        </div>
      </template>
    </vxe-grid>
  </div>
</template>
<style scoped>
.processesSt{
  height: 33px;
  width: 80px;
  background-color: #409eff;
  color: white;
  border: none;
  border-radius: 5px;
.main-div-customer{
  width: 99%;
  height: 100%;
}
</style>