| New file |
| | |
| | | <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 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}, |
| | | {field: '1', width: 100, 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: 100,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: 90,title: '宽', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 90,title: '高', sortable: true}, |
| | | {field: '7',width: 90, title: '数量', sortable: true}, |
| | | {field: '8',width: 90, title: '片标记', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 80,title: '标记', sortable: true}, |
| | | {field: '10', width: 120,title: '单片名称', sortable: true}, |
| | | {field: '11',width: 120, title: '切割', sortable: true}, |
| | | {field: '12',width: 120, title: '磨边', sortable: true}, |
| | | {field: '13',width: 120, title: '钢化', sortable: true}, |
| | | {field: '14',width: 120, title: '入库数量', sortable: true}, |
| | | {field: '15',width: 120, title: '入库面积', sortable: true}, |
| | | {field: '16',width: 120, title: '发货数量', sortable: true}, |
| | | {field: '17',width: 120, title: '发货面积', sortable: true}, |
| | | {field: '17',width: 120, title: '结算总面积', sortable: true}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'1', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(外)', |
| | | 9:'1', |
| | | 10:'10mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'1', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(中)', |
| | | 9:'2', |
| | | 10:'10mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'1', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(内)', |
| | | 9:'3', |
| | | 10:'10mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'2', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'6mm超白UD60平钢(外)+12Ar(结)+6mm超白平钢+12Ar(结)+6mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(外)', |
| | | 9:'1', |
| | | 10:'6mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'2', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'6mm超白UD60平钢(外)+12Ar(结)+6mm超白平钢+12Ar(结)+6mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(中)', |
| | | 9:'2', |
| | | 10:'6mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'2', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'6mm超白UD60平钢(外)+12Ar(结)+6mm超白平钢+12Ar(结)+6mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(内)', |
| | | 9:'3', |
| | | 10:'6mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['11','12','13','14','15','16','17','18'] |
| | | 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: '', |
| | | |
| | | }) |
| | | |
| | | const mergeCells = ref([ |
| | | { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 1, rowspan: 3, colspan: 0}, |
| | | |
| | | { row: 0, col: 2, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 2, rowspan: 3, colspan: 0}, |
| | | |
| | | { row: 0, col: 3, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 3, rowspan: 3, colspan: 0}, |
| | | |
| | | { row: 0, col: 4, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 4, rowspan: 3, colspan: 0}, |
| | | |
| | | |
| | | |
| | | ]) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/> |
| | | |
| | | <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" |
| | | :merge-cells="mergeCells" |
| | | |
| | | > |
| | | <!-- @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: 60%; |
| | | text-align: center; |
| | | } |
| | | </style> |