| | |
| | | <script setup> |
| | | import {reactive, ref} from 'vue' |
| | | |
| | | 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/BOM/StandardBOMDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | const form = reactive({ |
| | | xsdh:'NG23010101', |
| | | 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 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: 60, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'checkbox',fixed:"left", title: '基准BOM', width: 110 }, |
| | | { type: 'checkbox',fixed:"left", title: '标准BOM', width:110 }, |
| | | { type: 'checkbox',fixed:"left", title: '审核', width: 80 }, |
| | | {field: 'customerNumber', width: 120, title: '客户编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'customerName',width: 120, title: '客户名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productNumber', width: 130,title: '产品编号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName',width: 120, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'glassLength', width: 100,title: '玻璃长', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'glassWidth', width: 100,title: '玻璃宽', sortable: true}, |
| | | {field: 'thickness',width: 100, title: '厚度', sortable: true}, |
| | | {field: 'shape',width: 120, title: '形状', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'notes', width: 120,title: '备注', sortable: true}, |
| | | {field: 'productCreator',width: 120, title: '产品创建人', sortable: true}, |
| | | {field: 'BOMCreator',width: 120, title: 'BOM创建人', sortable: true}, |
| | | {field: 'auditor',width: 120, title: '审核员', sortable: true} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'print_lck', name: '转采购单' ,status:'primary'}, |
| | | {code: 'print_lck', name: '审核', status:'primary'}, |
| | | {code: 'print_lck', name: '删除', status:'primary'}, |
| | | {code: 'print_lck', name: '修改超领数量', status:'primary'}, |
| | | {code: 'print_lck', name: '生成订单BOM',status:'primary' ,icon:'vxe-icon-save'}, |
| | | ], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | customerNumber: 'D123123', |
| | | customerName: 'XXXX公司', |
| | | productNumber: '06040000022', |
| | | productName:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢(内)', |
| | | glassLength:'1440', |
| | | glassWidth:'3660', |
| | | thickness:'30', |
| | | shape:'普形', |
| | | notes:'111', |
| | | productCreator:'张三', |
| | | BOMCreator:'李四', |
| | | auditor:'王五', |
| | | |
| | | |
| | | }, |
| | | { |
| | | customerNumber: 'D123123', |
| | | customerName: 'XXXX公司', |
| | | productNumber: '06040000022', |
| | | productName:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢(内)', |
| | | glassLength:'1440', |
| | | glassWidth:'3660', |
| | | thickness:'30', |
| | | shape:'普形', |
| | | notes:'111', |
| | | productCreator:'张三', |
| | | BOMCreator:'李四', |
| | | auditor:'王五', |
| | | |
| | | |
| | | }, |
| | | { |
| | | customerNumber: 'D123123', |
| | | customerName: 'XXXX公司', |
| | | productNumber: '06040000022', |
| | | productName:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢(内)', |
| | | glassLength:'1440', |
| | | glassWidth:'3660', |
| | | thickness:'30', |
| | | shape:'普形', |
| | | notes:'111', |
| | | productCreator:'张三', |
| | | BOMCreator:'李四', |
| | | auditor:'王五', |
| | | |
| | | |
| | | }, |
| | | ],//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 value = ref('') |
| | |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | }) |
| | | const tableData = [ |
| | | { |
| | | 1: 'NG23121201', |
| | | 2: '12300001110', |
| | | 3: '10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢(内)', |
| | | 4: '111', |
| | | 5:'钢化', |
| | | 6:'5001011100000110', |
| | | 7:'无尘纸', |
| | | 8:'113', |
| | | 9:'1144', |
| | | 10:'张', |
| | | 11:'11', |
| | | 12:'22', |
| | | 13:'33', |
| | | 14:'44', |
| | | 15:'东莞', |
| | | 16:'2023-12-01', |
| | | 17:'', |
| | | |
| | | }, |
| | | ] |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <div class="main-div-customer"> |
| | | <div> |
| | | <div> |
| | | <el-input placeholder="销售单号" style="width: 120px" v-model="form.name"></el-input> |
| | | <el-button type="primary">生成订单BOM</el-button> |
| | | <el-button type="primary">转采购单</el-button> |
| | | <el-button type="primary">审核</el-button> |
| | | <el-button type="primary">反审</el-button> |
| | | <el-button type="primary">删除</el-button> |
| | | <el-button type="primary">修改超领数量</el-button> |
| | | <el-input placeholder="销售单号" style="width: 115px" v-model="form.xsdh"></el-input> |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="产品种类"> |
| | | <el-select v-model="value" class="m-2" placeholder="001123311" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="value" class="m-2" placeholder="领料工序"> |
| | | <el-select v-model="value" class="m-2" placeholder="钢化" style="width: 80px"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | |
| | | <br> |
| | | <el-input placeholder="物料编码" style="width: 200px"></el-input> |
| | | <el-input placeholder="物料名称" style="width: 200px"></el-input> |
| | | <el-input placeholder="需求数量" style="width: 200px"></el-input> |
| | | <el-button type="primary">添加</el-button> |
| | | </div> |
| | | <div> |
| | | <el-table :data="tableData" border style="width: 100%" height="100%"> |
| | | <el-table-column prop="1" label="销售单号" :show-overflow-tooltip='true' width="120" /> |
| | | <el-table-column prop="2" label="产品编号" :show-overflow-tooltip='true' width="130" /> |
| | | <el-table-column prop="3" label="产品名称" :show-overflow-tooltip='true' width="155" /> |
| | | <el-table-column prop="4" label="工单数量" width="85" /> |
| | | <el-table-column prop="5" label="领料工序" width="85" /> |
| | | <el-table-column prop="6" label="物料编码" :show-overflow-tooltip='true' width="125" /> |
| | | <el-table-column prop="7" label="物料名称" :show-overflow-tooltip='true' width="135" /> |
| | | <el-table-column prop="8" label="宽" width="60" /> |
| | | <el-table-column prop="9" label="高" width="60" /> |
| | | <el-table-column prop="10" label="单位" width="70" /> |
| | | <el-table-column prop="11" label="物料数量" width="85" /> |
| | | <el-table-column prop="12" label="库存数量" width="85" /> |
| | | <el-table-column prop="13" label="库存数-需求数" width="120" /> |
| | | <el-table-column prop="14" label="采购数量" width="85" /> |
| | | <el-table-column prop="15" label="产地" width="70" /> |
| | | <el-table-column prop="16" label="计划到货时间" width="120" /> |
| | | <el-table-column prop="17" label="备注" :show-overflow-tooltip='true' width="120" /> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | |
| | | </el-table> |
| | | </div> |
| | | > |
| | | <!-- @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> |
| | | </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> |