| | |
| | | <script lang="ts" setup> |
| | | import {reactive, ref} from 'vue' |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | const defaultTime = ref<[Date, Date]>([ |
| | | new Date(2000, 1, 1, 0, 0, 0), |
| | | new Date(2000, 2, 1, 23, 59, 59), |
| | | ]) |
| | | // do not use same name with ref |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | count += Number(item[field]) |
| | | }) |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | //子组件接收参数 |
| | | |
| | | 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 |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | ] |
| | | const tableData = [ |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', width: 120, title: '报工时间',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 120, title: '工序', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 130,title: '班组名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 100,title: '流程卡号', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 100,title: '产品大类', sortable: true}, |
| | | {field: '7',width: 100, title: '产品小类', sortable: true}, |
| | | {field: '8',width: 120, title: '在制品名称', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 110,title: '磨边类型', sortable: true}, |
| | | {field: '10', width: 100,title: '形状', sortable: true}, |
| | | {field: '11',width: 100, title: '厚度', sortable: true}, |
| | | {field: '12',width: 110, title: '完工数量', sortable: true}, |
| | | {field: '13',width: 110, title: '完工面积', sortable: true}, |
| | | {field: '14',width: 110, title: '平方毫米(天)', sortable: true}, |
| | | {field: '15',width: 110, title: '包装方式', sortable: true}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | |
| | | 15:'', |
| | | |
| | | }, |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | | 3:'钢化一班', |
| | | 4:'银川大楼', |
| | | 5:'NG23010121A01', |
| | | 6:'中空玻璃', |
| | | 7:'平中空夹胶', |
| | | 8:'5mmLYE-70平钢(外)+20mmA(密)+5mm超白平钢(内)', |
| | | 9:'精磨', |
| | | 10:'普型', |
| | | 11:'5', |
| | | 12:'11', |
| | | 13:'41.14', |
| | | 14:'123.33', |
| | | 15:'', |
| | | |
| | | }, |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | | 3:'钢化一班', |
| | | 4:'银川大楼', |
| | | 5:'NG23010121A01', |
| | | 6:'中空玻璃', |
| | | 7:'平中空夹胶', |
| | | 8:'5mmLYE-70平钢(外)+20mmA(密)+5mm超白平钢(内)', |
| | | 9:'精磨', |
| | | 10:'普型', |
| | | 11:'5', |
| | | 12:'11', |
| | | 13:'41.14', |
| | | 14:'123.33', |
| | | 15:'', |
| | | |
| | | }, |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | | 3:'钢化一班', |
| | | 4:'银川大楼', |
| | | 5:'NG23010121A01', |
| | | 6:'中空玻璃', |
| | | 7:'平中空夹胶', |
| | | 8:'5mmLYE-70平钢(外)+20mmA(密)+5mm超白平钢(内)', |
| | | 9:'精磨', |
| | | 10:'普型', |
| | | 11:'5', |
| | | 12:'11', |
| | | 13:'41.14', |
| | | 14:'123.33', |
| | | 15:'', |
| | | |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['12','13','14'] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | <!--班组产量--> |
| | | |
| | | <template> |
| | | <div class="div-main"> |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="班组名称" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="厚度" v-model="form.name" style="width: 50px"/>--> |
| | | <!-- <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="项目名称" v-model="form.name" style="width: 150px"/>--> |
| | | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | style="width: 100px" |
| | | /> |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="查询类型"> |
| | |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | style="width: 100px" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary">查询</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <div> |
| | | <el-table :data="tableData" border style="width: 100%" height="100%"> |
| | | <el-table-column prop="1" label="报工时间" width="100px" /> |
| | | <el-table-column prop="2" label="工序"/> |
| | | <el-table-column prop="3" label="班组名称" width="100px" :show-overflow-tooltip='true' /> |
| | | <el-table-column prop="4" label="项目名称" width="100px" :show-overflow-tooltip='true'/> |
| | | <el-table-column prop="5" label="流程卡号" width="130px"/> |
| | | <el-table-column prop="6" label="产品大类" width="100px"/> |
| | | <el-table-column prop="7" label="产品小类" width="100px"/> |
| | | <el-table-column prop="8" label="在制品名称" width="120px" :show-overflow-tooltip='true'/> |
| | | <el-table-column prop="9" label="磨边类型" width="90px" :show-overflow-tooltip='true' /> |
| | | <el-table-column prop="10" label="形状" /> |
| | | <el-table-column prop="11" label="厚度" /> |
| | | <el-table-column prop="12" label="完工数量" :show-overflow-tooltip='true' width="100px" /> |
| | | <el-table-column prop="13" label="完工面积" width="100px"/> |
| | | <el-table-column prop="14" label="平方毫米" width="100px"/> |
| | | <el-table-column prop="15" label="包装方式" width="100px"/> |
| | | </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> |
| | | <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> |
| | | .div-main{ |
| | | width: 100%; |
| | | .main-div-customer{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | #selectForm { |
| | | width: 70%; |
| | | width: 60%; |
| | | text-align: center; |
| | | } |
| | | </style> |