前后台 明细合计栏

dev
ZR20090193-陈敬勇 1 year ago
parent 311043aa97
commit e4e7ab5f73

@ -15,6 +15,7 @@
<vxe-table
border
show-footer
show-overflow
keep-source
ref="xTable"
@ -25,6 +26,7 @@
:loading="doGoods.loading"
:mouse-config="{ selected: true }"
:checkbox-config="{ range: true }"
:footer-method="footerMethod"
:data="props.dataList"
:keyboard-config="doGoods.tableKeyboardConfig"
:edit-config="{ trigger: 'dblclick', mode: 'cell' }"
@ -84,7 +86,7 @@
<a-tag color="lightgreen">可用件数:{{ item.pkgs }}</a-tag>
<a-tag color="red">占用件数:{{ item.lockpkgs }}</a-tag>
<a-tag color="lightblue">可用计费数量:{{ item.storageunitcount }}</a-tag>
<!-- <a-tag color="red">占用数量:{{ item.lockstorageunitcount }}</a-tag>-->
<!-- <a-tag color="red">占用数量:{{ item.lockstorageunitcount }}</a-tag>-->
</a-select-option>
</template>
</a-select>
@ -291,6 +293,31 @@
}
}
}
const sumNum = (list: any[], field: string) => {
let count = 0
list.forEach((item) => {
count += Number(item[field])
})
return count
}
function footerMethod({ columns, data }) {
const footerData = [
columns.map((column, _columnIndex) => {
if (_columnIndex === 0) {
return '合计'
}
// if (['pkgs'].includes(column.field)) {
// return sumNum(data, 'pkgs')
// }
if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) {
return sumNum(data, column.field)
}
return null
}),
]
return footerData
}
const pkgsChangeEvent = ({ row }: any) => {
console.log(row)
row.minpkgs = row.pkgs * row.coefficient
@ -344,15 +371,15 @@
row.goodsId = obj.goodsId
row.goodsname = obj.goodsname
row.goodscode = obj.goodscode
row.goodshscode = obj.goodshscode===null?'':obj.goodshscode
row.goodsmodel = obj.goodsmodel===null?'':obj.goodsmodel
row.goodshscode = obj.goodshscode === null ? '' : obj.goodshscode
row.goodsmodel = obj.goodsmodel === null ? '' : obj.goodsmodel
row.areacode = obj.areacode
row.areaname = obj.areaname
row.storehouse = obj.storehouse
row.wmsid = obj.wmsid
row.wmsphysicsid = obj.wmsphysicsid
row.storageunit = obj.storageunit
row.storageunitcount = obj.storageUnitType == '体积'? 0 : obj.storageunitcount
row.storageunitcount = obj.storageUnitType == '体积' ? 0 : obj.storageunitcount
row.kgs = obj.kgs
row.cbm = obj.cbm
row.netweight = obj.netweight

@ -15,6 +15,7 @@
<vxe-table
border
show-footer
show-overflow
keep-source
ref="xTable"
@ -25,6 +26,7 @@
:loading="doGoods.loading"
:mouse-config="{ selected: true }"
:checkbox-config="{ range: true }"
:footer-method="footerMethod"
:data="props.dataList"
:keyboard-config="doGoods.tableKeyboardConfig"
:edit-config="{ trigger: 'dblclick', mode: 'cell' }"
@ -87,7 +89,7 @@
<a-tag color="lightgreen">可用件数:{{ item.pkgs }}</a-tag>
<a-tag color="red">占用件数:{{ item.lockpkgs }}</a-tag>
<a-tag color="lightblue">可用计费数量:{{ item.storageunitcount }}</a-tag>
<!-- <a-tag color="red">占用数量:{{ item.lockstorageunitcount }}</a-tag>-->
<!-- <a-tag color="red">占用数量:{{ item.lockstorageunitcount }}</a-tag>-->
</a-select-option>
</template>
</a-select>
@ -285,7 +287,30 @@
},
} as VxeTablePropTypes.KeyboardConfig,
})
const sumNum = (list: any[], field: string) => {
let count = 0
list.forEach((item) => {
count += Number(item[field])
})
return count
}
function footerMethod({ columns, data }) {
const footerData = [
columns.map((column, _columnIndex) => {
if (_columnIndex === 0) {
return '合计'
}
// if (['pkgs'].includes(column.field)) {
// return sumNum(data, 'pkgs')
// }
if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) {
return sumNum(data, column.field)
}
return null
}),
]
return footerData
}
const pkgsChangeEvent = ({ row }: any) => {
console.log(row)
// if (row.storageUnitType == '') {
@ -403,7 +428,7 @@
row.wmsid = obj.wmsid
row.wmsphysicsid = obj.wmsphysicsid
row.storageunit = obj.storageunit
row.storageunitcount = obj.storageUnitType == '体积'? 0 : obj.storageunitcount
row.storageunitcount = obj.storageUnitType == '体积' ? 0 : obj.storageunitcount
row.kgs = obj.kgs
row.cbm = obj.cbm
row.netweight = obj.netweight

@ -15,7 +15,7 @@
<CollapseContainer title="其他信息">
<Tabs v-model:activeKey="activeKey">
<TabPane key="detailTab" tab="预约清关明细">
<vxe-grid ref="xGrid" v-bind="gridOptions" />
<vxe-grid ref="gridRef" v-bind="gridOptions" />
</TabPane>
<TabPane key="recordTab" tab="车辆进出记录">
<!-- <WmsTruckRecord ref="recordRef" :headId="rowId" />-->
@ -74,7 +74,7 @@
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
import { VxeGridProps } from 'vxe-table'
import { VxeGridInstance, VxeGridProps, VxeGridPropTypes } from 'vxe-table'
const { notification, createConfirm, createMessage } = useMessage()
import { editInfo, getInfo, getDetailList, auditInfo } from '/@/api/wms/wmsclearance'
import { Divider, TabPane, Tabs } from 'ant-design-vue'
@ -94,6 +94,13 @@
const recordSource = ref<any[]>([])
const areaList = ref<any[]>([])
const activeKey = ref('detailTab')
interface RowVO {
[key: string]: any
}
const gridRef = ref<VxeGridInstance<RowVO>>()
const footerData = ref<string[][]>([])
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
useForm({
labelWidth: 180,
@ -137,13 +144,104 @@
})
const [registerRecordModal, { openModal: openRecordModal }] = useModal()
const [registerSelectModal, { openModal }] = useModal()
const gridOptions = reactive<VxeGridProps>({
let detailColumns: VxeGridPropTypes.Columns = [
{
title: '序号',
type: 'seq',
fixed: 'left',
width: 50,
align: 'center',
},
{
title: '商品名称',
field: 'goodsname',
width: 200,
fixed: 'left',
},
{
title: '规格型号',
field: 'goodsmodel',
width: 100,
},
{
title: '库位',
field: 'areaname',
width: 100,
},
{
title: '批次号',
field: 'goodsmodeL2',
width: 100,
},
{
title: '库位',
field: 'areaname',
width: 100,
},
{
title: '件数',
field: 'pkgs',
width: 100,
},
{
title: '小件数',
field: 'minpkgs',
width: 100,
},
// {
// title: '',
// field: 'pallets',
// width: 100,
// },
{
title: '毛重(千克)',
field: 'kgs',
width: 100,
},
{
title: '净重(千克)',
field: 'netweight',
width: 100,
},
// {
// title: '',
// field: 'cbm',
// width: 100,
// },
{
title: '承运车号',
field: 'truckno',
width: 200,
},
{
title: '车辆自重',
field: 'truckWeight',
width: 100,
},
{
title: '备注',
field: 'remark',
width: 200,
},
{
title: '计费单位',
field: 'storageunit',
width: 100,
},
{
title: '计费数量',
field: 'storageunitcount',
width: 100,
},
]
const gridOptions = reactive<VxeGridProps<RowVO>>({
border: true,
height: 500,
align: null,
columnConfig: {
resizable: true,
},
showFooter: true,
columns: [
{
title: '序号',
@ -236,6 +334,9 @@
],
toolbarConfig: {},
data: dataSource,
footerMethod() {
return footerData.value
},
})
const recordOptions = reactive<VxeGridProps>({
@ -310,6 +411,7 @@
} else {
recordSource.value = []
}
init()
}
const LoadRecord = () => {
openRecordModal(true, {
@ -406,4 +508,34 @@
loading.value = false
}
}
const sumNum = (list: any[], field: string) => {
let count = 0
list.forEach((item) => {
count += Number(item[field])
})
return count
}
const init = async () => {
const $grid = gridRef.value
gridOptions.loading = false
console.log(dataSource.value)
//
const footList: string[][] = [[]]
for (let i = 0; i < detailColumns.length; i++) {
if (i === 0) {
footList[0].push('合计')
} else if (
['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(detailColumns[i].field)
) {
// return sumNum(data, column.field)
footList[0].push(sumNum(dataSource.value, detailColumns[i].field))
} else {
footList[0].push('')
}
}
footerData.value = footList
if ($grid) {
$grid.updateFooter()
}
}
</script>

@ -15,6 +15,7 @@
<vxe-table
border
show-footer
show-overflow
keep-source
ref="xTable"
@ -25,6 +26,7 @@
:loading="doGoods.loading"
:mouse-config="{ selected: true }"
:checkbox-config="{ range: true }"
:footer-method="footerMethod"
:data="doGoods.tableData"
:keyboard-config="doGoods.tableKeyboardConfig"
:edit-config="{ trigger: 'dblclick', mode: 'cell' }"
@ -414,6 +416,31 @@
// }
// }
// }
const sumNum = (list: any[], field: string) => {
let count = 0
list.forEach((item) => {
count += Number(item[field])
})
return count
}
function footerMethod({ columns, data }) {
const footerData = [
columns.map((column, _columnIndex) => {
if (_columnIndex === 0) {
return '合计'
}
// if (['pkgs'].includes(column.field)) {
// return sumNum(data, 'pkgs')
// }
if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) {
return sumNum(data, column.field)
}
return null
}),
]
return footerData
}
const selectChange = (e, opt, row) => {
// console.log(`selected ${e}`)
// console.log(opt)

@ -34,7 +34,7 @@
<CollapseContainer title="其他信息">
<Tabs v-model:activeKey="activeKey">
<TabPane key="detailTab" tab="预约入库明细">
<vxe-grid ref="xGrid" v-bind="gridOptions" />
<vxe-grid ref="gridRef" v-bind="gridOptions" />
</TabPane>
<TabPane key="feeTab" tab="费率信息">
<vxe-toolbar>
@ -111,7 +111,7 @@
getFeeRateList,
} from '/@/api/wms/wmsinplan'
import { Divider } from 'ant-design-vue'
import { VxeGridProps } from 'vxe-table'
import { VxeGridInstance, VxeGridProps, VxeGridPropTypes } from 'vxe-table'
import { get } from 'lodash-es'
import WmsFeeRateModal from './WmsFeeRateModal.vue'
import WmsTruckRecord from '/@/views/wms/common/WmsTruckRecord.vue'
@ -128,6 +128,13 @@
const feeSource = ref<any[]>([])
const activeKey = ref('detailTab')
const activeMainKey = ref('mainTab')
interface RowVO {
[key: string]: any
}
const gridRef = ref<VxeGridInstance<RowVO>>()
const footerData = ref<string[][]>([])
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
useForm({
labelWidth: 180,
@ -220,7 +227,93 @@
} else {
recordSource.value = []
}
init()
}
let detailColumns: VxeGridPropTypes.Columns = [
{
title: '序号',
type: 'seq',
fixed: 'left',
width: 50,
align: 'center',
},
{
title: '商品名称',
field: 'goodsname',
width: 200,
fixed: 'left',
},
{
title: '规格型号',
field: 'goodsmodel',
width: 100,
},
{
title: '件数',
field: 'pkgs',
width: 100,
},
{
title: '小件数',
field: 'minpkgs',
width: 100,
},
{
title: '托盘数',
field: 'pallets',
width: 100,
},
{
title: '毛重(千克)',
field: 'kgs',
width: 100,
},
{
title: '净重(千克)',
field: 'netweight',
width: 100,
},
// {
// title: '',
// field: 'cbm',
// width: 100,
// },
{
title: '承运车号',
field: 'truckno',
width: 200,
},
{
title: '车辆自重',
field: 'truckWeight',
width: 100,
},
{
title: '司机电话',
field: 'drivername',
width: 200,
},
{
title: '批次号',
field: 'goodsmodeL2',
width: 100,
},
{
title: '备注',
field: 'remark',
width: 200,
},
{
title: '计费单位',
field: 'storageunit',
width: 100,
},
{
title: '计费数量',
field: 'storageunitcount',
width: 100,
},
]
const recordOptions = reactive<VxeGridProps>({
border: true,
height: 500,
@ -275,13 +368,14 @@
toolbarConfig: {},
data: recordSource,
})
const gridOptions = reactive<VxeGridProps>({
const gridOptions = reactive<VxeGridProps<RowVO>>({
border: true,
height: 500,
align: null,
columnConfig: {
resizable: true,
},
showFooter: true,
columns: [
{
title: '序号',
@ -369,6 +463,13 @@
],
toolbarConfig: {},
data: dataSource,
footerMethod() {
return footerData.value
// return getfooterMethod(detailColumns.values, dataSource)
// console.log(detailColumns)
// console.log(dataSource)
// return ''
},
// proxyConfig: {
// ajax: {
// // Promise
@ -383,6 +484,7 @@
// },
// },
})
const feeOptions = reactive<VxeGridProps>({
border: true,
height: 500,
@ -556,4 +658,35 @@
loading.value = false
}
}
const sumNum = (list: any[], field: string) => {
let count = 0
list.forEach((item) => {
count += Number(item[field])
})
return count
}
const init = async () => {
const $grid = gridRef.value
gridOptions.loading = false
console.log(dataSource.value)
//
const footList: string[][] = [[]]
for (let i = 0; i < detailColumns.length; i++) {
if (i === 0) {
footList[0].push('合计')
} else if (
['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(detailColumns[i].field)
) {
// return sumNum(data, column.field)
footList[0].push(sumNum(dataSource.value, detailColumns[i].field))
} else {
footList[0].push('')
}
}
footerData.value = footList
if ($grid) {
$grid.updateFooter()
}
}
</script>

@ -15,6 +15,7 @@
<vxe-table
border
show-footer
show-overflow
keep-source
ref="xTable"
@ -25,6 +26,7 @@
:loading="doGoods.loading"
:mouse-config="{ selected: true }"
:checkbox-config="{ range: true }"
:footer-method="footerMethod"
:data="doGoods.tableData"
:keyboard-config="doGoods.tableKeyboardConfig"
:edit-config="{ trigger: 'dblclick', mode: 'cell' }"
@ -113,43 +115,43 @@
</template>
</vxe-column>
<vxe-column field="areaname" title="库位" width="100" />
<!-- <vxe-column-->
<!-- field="areaname"-->
<!-- title="库位"-->
<!-- width="120"-->
<!-- :edit-render="{ autofocus: '.vxe-input&#45;&#45;inner' }"-->
<!-- >-->
<!-- <template #edit="{ row }">-->
<!-- <vxe-select v-model="row.areaname" clearable @change="areaChange(row)">-->
<!-- <vxe-option-->
<!-- v-for="item in props.areaList"-->
<!-- :key="item.id"-->
<!-- :value="item.areaname"-->
<!-- :label="item.areaname"-->
<!-- />-->
<!-- </vxe-select>-->
<!-- &lt;!&ndash; <a-select&ndash;&gt;-->
<!-- &lt;!&ndash; ref="select"&ndash;&gt;-->
<!-- &lt;!&ndash; showSearch&ndash;&gt;-->
<!-- &lt;!&ndash; v-model:value="row.areaname"&ndash;&gt;-->
<!-- &lt;!&ndash; style="width: 100px"&ndash;&gt;-->
<!-- &lt;!&ndash; :dropdownMatchSelectWidth="false"&ndash;&gt;-->
<!-- &lt;!&ndash; :filterOption="false"&ndash;&gt;-->
<!-- &lt;!&ndash; @change="&ndash;&gt;-->
<!-- &lt;!&ndash; (e, opt) => {&ndash;&gt;-->
<!-- &lt;!&ndash; areaHandle(e, opt, row)&ndash;&gt;-->
<!-- &lt;!&ndash; }&ndash;&gt;-->
<!-- &lt;!&ndash; "&ndash;&gt;-->
<!-- &lt;!&ndash; >&ndash;&gt;-->
<!-- &lt;!&ndash; <a-select-option&ndash;&gt;-->
<!-- &lt;!&ndash; v-for="item in props.areaList"&ndash;&gt;-->
<!-- &lt;!&ndash; :key="`${item.id}`"&ndash;&gt;-->
<!-- &lt;!&ndash; :value="item.areaname"&ndash;&gt;-->
<!-- &lt;!&ndash; >{{ item.areaname }}</a-select-option&ndash;&gt;-->
<!-- &lt;!&ndash; >&ndash;&gt;-->
<!-- &lt;!&ndash; </a-select>&ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<!-- <vxe-column-->
<!-- field="areaname"-->
<!-- title="库位"-->
<!-- width="120"-->
<!-- :edit-render="{ autofocus: '.vxe-input&#45;&#45;inner' }"-->
<!-- >-->
<!-- <template #edit="{ row }">-->
<!-- <vxe-select v-model="row.areaname" clearable @change="areaChange(row)">-->
<!-- <vxe-option-->
<!-- v-for="item in props.areaList"-->
<!-- :key="item.id"-->
<!-- :value="item.areaname"-->
<!-- :label="item.areaname"-->
<!-- />-->
<!-- </vxe-select>-->
<!-- &lt;!&ndash; <a-select&ndash;&gt;-->
<!-- &lt;!&ndash; ref="select"&ndash;&gt;-->
<!-- &lt;!&ndash; showSearch&ndash;&gt;-->
<!-- &lt;!&ndash; v-model:value="row.areaname"&ndash;&gt;-->
<!-- &lt;!&ndash; style="width: 100px"&ndash;&gt;-->
<!-- &lt;!&ndash; :dropdownMatchSelectWidth="false"&ndash;&gt;-->
<!-- &lt;!&ndash; :filterOption="false"&ndash;&gt;-->
<!-- &lt;!&ndash; @change="&ndash;&gt;-->
<!-- &lt;!&ndash; (e, opt) => {&ndash;&gt;-->
<!-- &lt;!&ndash; areaHandle(e, opt, row)&ndash;&gt;-->
<!-- &lt;!&ndash; }&ndash;&gt;-->
<!-- &lt;!&ndash; "&ndash;&gt;-->
<!-- &lt;!&ndash; >&ndash;&gt;-->
<!-- &lt;!&ndash; <a-select-option&ndash;&gt;-->
<!-- &lt;!&ndash; v-for="item in props.areaList"&ndash;&gt;-->
<!-- &lt;!&ndash; :key="`${item.id}`"&ndash;&gt;-->
<!-- &lt;!&ndash; :value="item.areaname"&ndash;&gt;-->
<!-- &lt;!&ndash; >{{ item.areaname }}</a-select-option&ndash;&gt;-->
<!-- &lt;!&ndash; >&ndash;&gt;-->
<!-- &lt;!&ndash; </a-select>&ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<vxe-column
field="pkgs"
title="件数"
@ -295,7 +297,7 @@
import { propTypes } from '/@/utils/propTypes'
import { useMessage } from '/@/hooks/web/useMessage'
import { getWmsFeeList } from '/@/views/wms/common/api'
import { getWmsOutDoGoodslist, delWmsOutDoGoods} from "/@/api/wms/wmsoutdo";
import { getWmsOutDoGoodslist, delWmsOutDoGoods } from '/@/api/wms/wmsoutdo'
const { notification, createConfirm, createMessage } = useMessage()
const goodsFilterData = ref([])
const areaList = ref([])
@ -374,6 +376,7 @@
return `${rowIndex + 1}`
},
} as VxeTablePropTypes.SeqConfig)
async function selectSearch(value: string) {
if (stringIsNull(value)) {
} else {
@ -389,6 +392,7 @@
}
}
}
// async function querySelect(query: string) {
// console.log(query)
// if (stringIsNull(query.value)) {
@ -560,6 +564,30 @@
}
doGoods.loading = false
}
const sumNum = (list: any[], field: string) => {
let count = 0
list.forEach((item) => {
count += Number(item[field])
})
return count
}
function footerMethod({ columns, data }) {
const footerData = [
columns.map((column, _columnIndex) => {
if (_columnIndex === 0) {
return '合计'
}
// if (['pkgs'].includes(column.field)) {
// return sumNum(data, 'pkgs')
// }
if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) {
return sumNum(data, column.field)
}
return null
}),
]
return footerData
}
// await initData()
</script>

@ -15,7 +15,7 @@
<CollapseContainer title="其他信息">
<Tabs v-model:activeKey="activeKey">
<TabPane key="detailTab" tab="预约出库明细">
<vxe-grid ref="xGrid" v-bind="gridOptions" />
<vxe-grid ref="gridRef" v-bind="gridOptions" />
</TabPane>
<TabPane key="recordTab" tab="车辆进出记录">
<!-- <WmsTruckRecord ref="recordRef" :headId="rowId" />-->
@ -65,7 +65,7 @@
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
import { VxeGridProps } from 'vxe-table'
import { VxeGridInstance, VxeGridProps, VxeGridPropTypes } from 'vxe-table'
const { notification, createConfirm, createMessage } = useMessage()
import { editInfo, getInfo, getWmsOutPlanGoodslist, auditInfo } from '/@/api/wms/wmsoutplan'
@ -86,6 +86,13 @@
const recordSource = ref<any[]>([])
const areaList = ref<any[]>([])
const activeKey = ref('detailTab')
interface RowVO {
[key: string]: any
}
const gridRef = ref<VxeGridInstance<RowVO>>()
const footerData = ref<string[][]>([])
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
useForm({
labelWidth: 180,
@ -130,13 +137,99 @@
setModalProps({ loading: false })
})
const [registerSelectModal, { openModal }] = useModal()
const gridOptions = reactive<VxeGridProps>({
let detailColumns: VxeGridPropTypes.Columns = [
{
title: '序号',
type: 'seq',
fixed: 'left',
width: 50,
align: 'center',
},
{
title: '商品名称',
field: 'goodsname',
width: 200,
fixed: 'left',
},
{
title: '规格型号',
field: 'goodsmodel',
width: 100,
},
{
title: '库位',
field: 'areaname',
width: 100,
},
{
title: '批次号',
field: 'goodsmodeL2',
width: 100,
},
{
title: '件数',
field: 'pkgs',
width: 100,
},
{
title: '小件数',
field: 'minpkgs',
width: 100,
},
{
title: '托盘数',
field: 'pallets',
width: 100,
},
{
title: '毛重(千克)',
field: 'kgs',
width: 100,
},
{
title: '净重(千克)',
field: 'netweight',
width: 100,
},
// {
// title: '',
// field: 'cbm',
// width: 100,
// },
{
title: '承运车号',
field: 'truckno',
width: 200,
},
{
title: '车辆自重',
field: 'truckWeight',
width: 100,
},
{
title: '备注',
field: 'remark',
width: 200,
},
{
title: '计费单位',
field: 'storageunit',
width: 100,
},
{
title: '计费数量',
field: 'storageunitcount',
width: 100,
},
]
const gridOptions = reactive<VxeGridProps<RowVO>>({
border: true,
height: 500,
align: null,
columnConfig: {
resizable: true,
},
showFooter: true,
columns: [
{
title: '序号',
@ -224,6 +317,9 @@
],
toolbarConfig: {},
data: dataSource,
footerMethod() {
return footerData.value
},
})
const recordOptions = reactive<VxeGridProps>({
border: true,
@ -297,6 +393,7 @@
} else {
recordSource.value = []
}
init()
}
const LoadRecord = () => {
openRecordModal(true, {
@ -341,4 +438,34 @@
loading.value = false
}
}
const sumNum = (list: any[], field: string) => {
let count = 0
list.forEach((item) => {
count += Number(item[field])
})
return count
}
const init = async () => {
const $grid = gridRef.value
gridOptions.loading = false
console.log(dataSource.value)
//
const footList: string[][] = [[]]
for (let i = 0; i < detailColumns.length; i++) {
if (i === 0) {
footList[0].push('合计')
} else if (
['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(detailColumns[i].field)
) {
// return sumNum(data, column.field)
footList[0].push(sumNum(dataSource.value, detailColumns[i].field))
} else {
footList[0].push('')
}
}
footerData.value = footList
if ($grid) {
$grid.updateFooter()
}
}
</script>

@ -5725,3 +5725,10 @@
2023-08-22 17:53:05.7979 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-22 17:53:05.8548 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-22 17:53:05.8699 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2023-08-23 11:06:36.7370 Info Message Template Auto Format enabled
2023-08-23 11:06:36.7694 Info Loading assembly: NLog.Web.AspNetCore
2023-08-23 11:06:37.0100 Info Adding target FileTarget(Name=allfile)
2023-08-23 11:06:37.0233 Info Adding target FileTarget(Name=ownFile-web)
2023-08-23 11:06:37.0612 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-23 11:06:37.1844 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-23 11:06:37.2142 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile

@ -9016,3 +9016,10 @@
2023-08-22 16:20:17.8619 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-22 16:20:17.9722 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-22 16:20:17.9857 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2023-08-23 11:50:28.6481 Info Message Template Auto Format enabled
2023-08-23 11:50:28.6747 Info Loading assembly: NLog.Web.AspNetCore
2023-08-23 11:50:28.8959 Info Adding target FileTarget(Name=allfile)
2023-08-23 11:50:28.9106 Info Adding target FileTarget(Name=ownFile-web)
2023-08-23 11:50:28.9483 Info Adding target ColoredConsoleTarget(Name=console)
2023-08-23 11:50:29.0974 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config
2023-08-23 11:50:29.1235 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile

Loading…
Cancel
Save