| | |
| | | <script lang="ts" setup> |
| | | import {reactive, ref} from 'vue' |
| | | import SelectWorkOrder from "@/views/pp/workOrder/SelectWorkOrder.vue"; |
| | | import SelectAddWorkOrder from "@/views/pp/workOrder/SelectAddWorkOrder.vue"; |
| | | import {ArrowLeftBold} from "@element-plus/icons-vue"; |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {useRouter} from "vue-router"; |
| | | <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/workOrder/addWorkOrder', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | count += Number(item[field]) |
| | | }) |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | 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 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: 110, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'salesOrderNo', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'productionOrderNo', title: '生产订单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'batch', title: '批次', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'monolithicTotalArea', title: '单片总面积', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'total', title: '总数量', sortable: true}, |
| | | {field: 'productTotalArea', title: '成品总面积', sortable: true}, |
| | | {field: 'perimeter', title: '周长', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'radius', title: '半径', sortable: true}, |
| | | {field: 'createTime', title: '加工要求', sortable: true} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | salesOrderNo: 'NG231201', |
| | | productionOrderNo: 'NG231201A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231201', |
| | | productionOrderNo: 'NG231201B', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231202', |
| | | productionOrderNo: 'NG231202A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231203', |
| | | productionOrderNo: 'NG231203A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231204', |
| | | productionOrderNo: 'NG231204A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231205', |
| | | productionOrderNo: 'NG231205A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231206', |
| | | productionOrderNo: 'NG231206A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['total','monolithicTotalArea','productTotalArea'] |
| | | 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: '', |
| | |
| | | resource: '', |
| | | desc: '', |
| | | }) |
| | | const router = useRouter() |
| | | function goToPage() { |
| | | router.push('/main/workOrder/addWorkOrder') |
| | | } |
| | | |
| | | const tableData = [ |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | salesOrderNo: 'NG231201', |
| | | productionOrderNo: 'NG231201A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231201', |
| | | productionOrderNo: 'NG231201B', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231202', |
| | | productionOrderNo: 'NG231202A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231203', |
| | | productionOrderNo: 'NG231203A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231204', |
| | | productionOrderNo: 'NG231204A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231205', |
| | | productionOrderNo: 'NG231205A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | salesOrderNo: 'NG231206', |
| | | productionOrderNo: 'NG231206A', |
| | | entryName: '信合春天里', |
| | | batch: '23批', |
| | | productName: '5mm白玻平钢(外)+0.76PVB透明+5mm白玻平钢(内)', |
| | | monolithicTotalArea: '509.78', |
| | | total: '169', |
| | | productTotalArea: '175.31', |
| | | perimeter: '99.84', |
| | | radius: '0', |
| | | createTime: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | </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: 200px"/> |
| | | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | |
| | | :default-time="defaultTime" |
| | | /> |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="是否转工单"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </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 fixed label="操作" width="120" > |
| | | <el-button link type="primary" size="small" @click="goToPage">转工单</el-button> |
| | | <el-button link type="primary" size="small">删除</el-button> |
| | | </el-table-column> |
| | | <el-table-column sortable prop="salesOrderNo" label="销售单号" width="110" /> |
| | | <el-table-column prop="entryName" label="项目名称" width="155" /> |
| | | <el-table-column prop="batch" label="批次" width="80" /> |
| | | <el-table-column prop="productName" label="产品名称" :show-overflow-tooltip='true' width="180" /> |
| | | <el-table-column prop="monolithicTotalArea" label="单片总面积" width="100" /> |
| | | <el-table-column prop="total" label="总数量" width="75" /> |
| | | <el-table-column prop="productTotalArea" label="成品总面积" width="100" /> |
| | | <el-table-column prop="perimeter" label="周长" width="100" /> |
| | | <el-table-column prop="radius" label="半径" width="70" /> |
| | | <el-table-column prop="createTime" 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,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,'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 { |