| | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | | return regex.test(value) //返回true/false |
| | | } |
| | | |
| | | const hasDecimalhtml=(item,row)=>{ |
| | | let aa=item.split('.').length |
| | | if (aa===2){ |
| | | return row[item.split('.')[0]][item.split('.')[1]] |
| | | }else if(aa===3){ |
| | | return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]] |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //第一次调用 |
| | | /*request.post("/FinishedGoodsInventory/getseletwarehousing/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | })*/ |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | let pageState = null |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | function filterChanged(column){ |
| | | gridOptions.loading=true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.')>-1){ |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]:value |
| | | } |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | request.post("/FinishedGoodsInventory/getselet/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | orderDetail:{ |
| | | orderNumber:'', |
| | | productName:'', |
| | | productId:'', |
| | | width:'', |
| | | height:'' |
| | | }, |
| | | order:{ |
| | | orderId:'', |
| | | orderType:'', |
| | | project:'' |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '50'}, |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '60'}, |
| | | { type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | // {title: '操作', width: '220', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'SalesOrderNumber', width: '150',title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'floorNumber', width: '120',title: '楼层编号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedProductNumber',width: '100', title: '产品编号', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'productName',width: '100', title: '产品名称', sortable: true}, |
| | | {field: 'length', width: '100',title: '长度', sortable: true}, |
| | | {field: 'width',width: '100', title: '宽度', sortable: true}, |
| | | {field: 'salesperson', width: '100',title: '业务员', sortable: true}, |
| | | {field: 'projectName', width: '100',title: '项目名称', sortable: true}, |
| | | {field: 'orderNumber',width: '140', title: '订序', sortable: true}, |
| | | {field: 'totalOrders',width: '140', title: '订单总数', sortable: true}, |
| | | {field: 'quantity',width: '100', title: '数量', sortable: true}, |
| | | {field: 'completion',width: '140', title: '完工', sortable: true}, |
| | | {field: 'area',width: '140', title: '面积', sortable: true}, |
| | | {field: 'processCardNumber',width: '100', title: '流程卡号', sortable: true}, |
| | | {field: 'quantityEntered',width: '100', title: '已入数量', sortable: true}, |
| | | {field: 'nextProcess',width: '100', title: ' 下工序', sortable: true}, |
| | | {field: 'Batch',width: '100', title: '批次', sortable: true}, |
| | | {field: 'SalesOrderNumber', width: '150',title: '销售单号', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'floorNumber', width: '120',title: '楼层编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedProductNumber',width: '100', title: '产品编号', filters:[{ data: '' }],showOverflow:"ellipsis",slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName',width: '100', title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'length', width: '100',title: '长度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width',width: '100', title: '宽度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'salesperson', width: '100',title: '业务员', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'projectName', width: '100',title: '项目名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderNumber',width: '140', title: '订序', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'totalOrders',width: '140', title: '订单总数', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity',width: '100', title: '数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'completion',width: '140', title: '完工', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'area',width: '140', title: '面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'processCardNumber',width: '100', title: '流程卡号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantityEntered',width: '100', title: '已入数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'nextProcess',width: '100', title: ' 下工序', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'Batch',width: '100', title: '批次', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [{ |
| | |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "floorNumber": "10059419", |
| | | "finishedProductNumber": "0604000027", |
| | | "finishedProductName": "NG23072003A01", |
| | | "productName": '钢化玻璃', |
| | | "length": "1075.00", |
| | | "width": "440.00", |
| | | "salesperson": "小岳", |
| | | "customerName": "大头", |
| | | "projectName": "Tempered Glass", |
| | | "orderNumber": "1", |
| | | "totalOrders": "3800", |
| | | "quantity": "1140", |
| | | "completion":'1140', |
| | | "area": "505.270000", |
| | | "processCardNumber": "NG23112311A01", |
| | | "quantityEntered": "0", |
| | | "nextProcess": "Finished Product", |
| | | "Batch": "一", |
| | | }, |
| | | |
| | | ],//table body实际数据 |
| | | } |
| | | ,//table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | <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> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |