New file |
| | |
| | | export default function footSum(list, field) { |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | count += Number(item[field]) |
| | | }) |
| | | return count.toFixed(2) |
| | | } |
| | |
| | | import {changeFilterEvent,filterChanged} from "@/hook" |
| | | import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove" |
| | | import downLoadFile from "@/hook/downLoadFile" |
| | | import footSum from "@/hook/footSum" |
| | | import {useI18n} from "vue-i18n" |
| | | const { t } = useI18n() |
| | | |
| | |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total')+':' |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | const List = ["quantity",'grossAmount','grossArea','computeGrossArea'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | |
| | | footList:['quantity','grossArea','computeGrossArea','perimeter','price','grossAmount'] |
| | | }) |
| | | |
| | | request.post('/order/exportOrderReport',null,{responseType :'blob'}).then(res => { |
| | | const blob = new Blob([res]) |
| | | // console.log(blob) |
| | | // if ('download' in document.createElement('a')) { // 非IE下载 |
| | | // const elink = document.createElement('a') |
| | | // elink.download = 'a.xlsx' |
| | | // elink.style.display = 'none' |
| | | // elink.href = URL.createObjectURL(blob) |
| | | // document.body.appendChild(elink) |
| | | // elink.click() |
| | | // URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | // document.body.removeChild(elink) |
| | | // } else { // IE10+下载 |
| | | // navigator.msSaveBlob(blob, fileName) |
| | | // } |
| | | |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | import {ElMessage} from "element-plus" |
| | | import {VXETable} from "vxe-table" |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import footSum from "@/hook/footSum" |
| | | import {useI18n} from "vue-i18n" |
| | | import {columnDrop2, sortable2} from "@/hook/columnMove"; |
| | | const { t } = useI18n() |
| | |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | const List = ["quantity",'goodsQuantity','area','perimeter'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | |
| | | stripe:true,//斑马纹楼号 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | |
| | | }) |
| | | |
| | |
| | | let trademarkVisible = ref(false) |
| | | const updateTrademark = (row) => { |
| | | trademarkVisible.value= true |
| | | Object.keys(trademarkAttr.value).forEach((key) => { |
| | | /*Object.keys(trademarkAttr.value).forEach((key) => { |
| | | if(key==='location'){ |
| | | trademarkAttr.value[key] = [] |
| | | }else if(key==='xMargin' || key==='yMargin'){ |
| | |
| | | }else{ |
| | | trademarkAttr.value[key] = '' |
| | | } |
| | | }) |
| | | })*/ |
| | | trademarkAttr.value = { |
| | | trademark:"3C", |
| | | xImage:false, |
| | | yImage:false, |
| | | tag:true, |
| | | tag2:true , |
| | | tag3:true, |
| | | xMargin:30, |
| | | yMargin:30, |
| | | location:'左下' |
| | | } |
| | | if(row.icon!=null){ |
| | | trademarkAttr.value = JSON.parse(row.icon) |
| | | } |