This commit is contained in:
2026-01-30 16:04:25 +08:00
parent 8ab9e91dac
commit ba71d089ba
3 changed files with 46 additions and 6 deletions

View File

@@ -12,8 +12,9 @@ export function listStock(data) {
// 查询统计
export function getTotal(data) {
return request({
url: "/wisdom/record/statistic",
url: "/wisdom/record/statistics",
method: "post",
data: data,
});
}

View File

@@ -1215,7 +1215,7 @@ function handleAdd() {
/** 提交按钮 */
function submitForm() {
if (outBoundData.value.length !== checkOutList.value) {
if (outBoundData.value.length !== checkOutList.value.length) {
proxy.$modal.msgError("请查看勾选数据");
return;
}

View File

@@ -105,6 +105,8 @@
:row-class-name="tableBillRowClassName"
ref="infoTableRef"
highlight-current-row
show-summary
:summary-method="getSummaries"
@row-click="(row) => tableInfoRowClick(row, infoTableRef)">
<el-table-column label="序号" align="center" type="index" width="70" />
<el-table-column label="操作类型" align="center" prop="bizType" width="100">
@@ -140,7 +142,7 @@
</template>
<script setup name="Record">
import { listStock } from "@/api/wisdom/record";
import { listStock, getTotal } from "@/api/wisdom/record";
import { listOuttype } from "@/api/information/outtype"; //出库类型
import { warehouseAll } from "@/api/information/warehouseinfo"; //所属仓库
import { materialtypeDict } from "@/api/information/materialtype"; //物资类型
@@ -277,7 +279,7 @@ function handleQuery() {
queryParams.value.cangku = warehouseCode.value[1]
}
//详细类型
if (operationTypeCK.value || operationTypeRK.value) {
if (operationTypeCK.value.length > 0 || operationTypeRK.value.length > 0) {
queryParams.value.operationType = operationTypeRK.value || operationTypeCK.value
}
//操作时间
@@ -290,6 +292,7 @@ function handleQuery() {
}
queryParams.value.pageNum = 1;
getList();
getSumInfo()
}
// 重置按钮操作
@@ -317,8 +320,6 @@ const infoTableRef = ref(null);
// 显示预出库的状态
const tableBillRowClassName = ({ row, rowIndex }) => {
console.log('row===>',row);
if (row.execStatus == 0) {
return 'success-row'
}
@@ -331,6 +332,44 @@ const dictTagData = () => {
value: String(item.value)
}));
}
function getSummaries(param) {
const { columns, data } = param;
// console.log(columns)
const sums = [];
columns.forEach((column, index) => {
if (index === 1) { // 第一列不进行合计操作,通常是序列号或选择框等非数值列。
sums[index] = '总计'; // 这里可以设置为其他文字或空字符串。
return;
} else if (index === 2) { // 第二列是金额列,进行求和操作。
sums[index] = '总金额:' + totalMoney.value;
// }else if(index === 2){
// sums[index] = totalMoney.value
} else if (index === 3) {
sums[index] = '共存于:' + pcodeCount.value + '个库位'
} else if (index === 4) {
sums[index] = '总数:' + sumQty.value
}
})
return sums
}
// 获取总计
const totalMoney = ref(null)
const pcodeCount = ref(null)
const sumQty = ref(null)
function getSumInfo() {
//统计信息
let rkInfo = JSON.parse(JSON.stringify(queryParams.value))
delete rkInfo.pageNum
delete rkInfo.pageSize
getTotal(rkInfo).then(response => {
totalMoney.value = response.data.totalAmount
pcodeCount.value = response.data.locationCount
sumQty.value = response.data.totalQuantity
});
}
getSumInfo()
</script>
<style scoped>