| New file |
| | |
| | | <script setup> |
| | | |
| | | 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/AddReportingWork', 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]) |
| | | }) |
| | | 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}, |
| | | {title: '操作', width: 140, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {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: 'processCard', width: 130,title: '流程卡号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'entryName',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'batch', width: 100,title: '批次', filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'device', width: 100,title: '设备', sortable: true}, |
| | | {field: 'thisProcess',width: 100, title: '本工序', sortable: true}, |
| | | {field: 'finishedNumber',width: 120, title: '本工序完工', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'finishedArea', width: 120,title: '完工面积', sortable: true}, |
| | | {field: 'wornNumber',width: 120, title: '本工序次破', sortable: true}, |
| | | {field: 'wornArea',width: 120, title: '次破面积', sortable: true}, |
| | | {field: 'teamName',width: 120, title: '班组名称', sortable: true} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | reportingWorkNo: 'BG2312080011', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '四批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312080013', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2311080025', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2303080025', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312080001', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312080015', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['finishedNumber','finishedArea','wornNumber','wornArea'] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | /> |
| | | |
| | | <el-button type="primary">查询</el-button> |
| | | </el-row> |
| | | |
| | | </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,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 #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> |
| | | <el-button @click="getTableRow(row,'delete')" 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> |
| | | .main-div-customer{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | #selectForm { |
| | | width: 40%; |
| | | text-align: center; |
| | | } |
| | | </style> |