|
|
@@ -63,9 +63,11 @@
|
|
|
align="center"></el-table-column>
|
|
|
<el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="unitPrice" label="标准单价(元)"
|
|
|
align="center"></el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="totalStuffQty" label="库存数量"
|
|
|
align="center"></el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="数据状态" align="center">
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
|
|
|
+ align="center"></el-table-column>
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="数据状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.validFlag == 1">已启用</span>
|
|
|
<span v-else-if="scope.row.validFlag == 0">已停用</span>
|
|
|
@@ -122,10 +124,11 @@
|
|
|
<el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" highlight-current-row
|
|
|
@selection-change="handleSelectionChange2" :data="table.list2" :icore-filter-flag="icoreFilterFlag"
|
|
|
:header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2" @row-click="getRowCheck"
|
|
|
- :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' }, }">
|
|
|
+ :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' },'state':{'0':'未验收','1':'已验收'} }"
|
|
|
+ :summary-method="getSummaries3" show-summary>
|
|
|
<el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
|
|
|
<el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="数据状态" align="center">
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="数据状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.validFlag == 1">已启用</span>
|
|
|
<span v-else-if="scope.row.validFlag == 0">已停用</span>
|
|
|
@@ -213,19 +216,19 @@
|
|
|
<el-table v-loading="dataLoading3" ref="dataTable3" border :height="height_bot" highlight-current-row
|
|
|
@selection-change="handleSelectionChange3" :data="table.list3" :icore-filter-flag="icoreFilterFlag"
|
|
|
:header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName3" @row-click="getRowCheck2"
|
|
|
- :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' }, }" show-summary :summary-method="getSummaries1">
|
|
|
+ :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' },'state':{'0':'未验收','1':'已验收'} }" show-summary :summary-method="getSummaries1">
|
|
|
<el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
|
|
|
<el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" label="数据状态" align="center">
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlag" label="数据状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.validFlag == 1">已启用</span>
|
|
|
<span v-else-if="scope.row.validFlag == 0">已停用</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" label="" align="center">
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="state" label="验收状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.state == 1">已验收</span>
|
|
|
- <span v-else-if="scope.row.state == 0">未验收</span>
|
|
|
+ <span v-if="scope.row.state == '1'">已验收</span>
|
|
|
+ <span v-else-if="scope.row.state == '0'">未验收</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="inId" label="入库记录号"
|
|
|
@@ -318,11 +321,11 @@
|
|
|
<div class="common-table-div" style="margin-bottom:0;margin-top:0">
|
|
|
<el-table v-loading="dataLoading4" ref="dataTable4" border :height="height_bot" highlight-current-row
|
|
|
@selection-change="handleSelectionChange4" :data="table.list4" :icore-filter-flag="icoreFilterFlag"
|
|
|
- :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName4" @row-click="getRowCheck3"
|
|
|
- :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' }, }">
|
|
|
+ :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName4" @row-click="getRowCheck3" show-summary :summary-method="getSummaries2"
|
|
|
+ :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' },'state':{'0':'未验收','1':'已验收'} }">
|
|
|
<el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
|
|
|
<el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" label="数据状态" align="center">
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlag" label="数据状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.validFlag == 0">无效</span>
|
|
|
<span v-else-if="scope.row.state == 1">已审批</span>
|
|
|
@@ -359,10 +362,10 @@
|
|
|
align="center"></el-table-column>
|
|
|
<el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stkId" label="库存记录号"
|
|
|
align="center"></el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="是否有效" align="center">
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="是否有效" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.validFlag == 1">已启用</span>
|
|
|
- <span v-else-if="scope.row.validFlag == 0">已停用</span>
|
|
|
+ <span v-if="scope.row.validFlag == '1'">已启用</span>
|
|
|
+ <span v-else-if="scope.row.validFlag == '0'">已停用</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="createMan" label="创建人"
|
|
|
@@ -609,7 +612,7 @@
|
|
|
<span v-else>未确认</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="数据状态" align="center">
|
|
|
+ <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="数据状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.validFlag == 1">已启用</span>
|
|
|
<span v-else-if="scope.row.validFlag == 0">已停用</span>
|
|
|
@@ -829,6 +832,86 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // qtyOutstk
|
|
|
+ getSummaries3(param) {
|
|
|
+ let unit=null;
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '合计';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(column.property==='stuffUnit') {
|
|
|
+ console.log('unit column ',column)
|
|
|
+ console.log('unit data ',data)
|
|
|
+ unit=data[0].stuffUnit;
|
|
|
+ }
|
|
|
+ if (column.property && column.property === 'stuffQty') {
|
|
|
+ console.log('getSummaries stuffQty column:', column)
|
|
|
+ const values = data.map(item => {
|
|
|
+ const num = Number(item[column.property]);
|
|
|
+ return isNaN(num) ? NaN : num;
|
|
|
+ });
|
|
|
+ console.log('getSummaries values:', values)
|
|
|
+ if (!values.every(value => {
|
|
|
+ console.log('getSummaries value:',value)
|
|
|
+ isNaN(value)
|
|
|
+ })) {
|
|
|
+ const total = values.reduce((prev, curr) => {
|
|
|
+ return isNaN(curr) ? prev : prev + curr;
|
|
|
+ }, 0);
|
|
|
+ sums[index] = total + unit;
|
|
|
+ } else {
|
|
|
+ sums[index] = 'N/A';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ sums[index] = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
+ // qtyOutstk
|
|
|
+ getSummaries2(param) {
|
|
|
+ let unit=null;
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '合计';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(column.property==='stuffUnit') {
|
|
|
+ console.log('unit column ',column)
|
|
|
+ console.log('unit data ',data)
|
|
|
+ unit=data[0].stuffUnit;
|
|
|
+ }
|
|
|
+ if (column.property && column.property === 'qtyOutstk') {
|
|
|
+ console.log('getSummaries qtyOutstk column:', column)
|
|
|
+ const values = data.map(item => {
|
|
|
+ const num = Number(item[column.property]);
|
|
|
+ return isNaN(num) ? NaN : num;
|
|
|
+ });
|
|
|
+ console.log('getSummaries values:', values)
|
|
|
+ if (!values.every(value => {
|
|
|
+ console.log('getSummaries value:',value)
|
|
|
+ isNaN(value)
|
|
|
+ })) {
|
|
|
+ const total = values.reduce((prev, curr) => {
|
|
|
+ return isNaN(curr) ? prev : prev + curr;
|
|
|
+ }, 0);
|
|
|
+ sums[index] = total + unit;
|
|
|
+ } else {
|
|
|
+ sums[index] = 'N/A';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ sums[index] = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
getSummaries1(param) {
|
|
|
let unit=null;
|
|
|
const { columns, data } = param;
|
|
|
@@ -869,8 +952,21 @@ export default {
|
|
|
return sums;
|
|
|
},
|
|
|
getSummaries(param) {
|
|
|
+ // totalStuffQty
|
|
|
const { columns, data } = param;
|
|
|
const sums = [];
|
|
|
+ const unitGroups = {};
|
|
|
+ data.forEach(item => {
|
|
|
+ const unit = item.stuffUnit;
|
|
|
+ const qty = Number(item.totalStuffQty);
|
|
|
+ if (!isNaN(qty) && unit) {
|
|
|
+ if (unitGroups[unit]) {
|
|
|
+ unitGroups[unit] += qty;
|
|
|
+ } else {
|
|
|
+ unitGroups[unit] = qty;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
columns.forEach((column, index) => {
|
|
|
if (index === 0) {
|
|
|
sums[index] = '合计';
|
|
|
@@ -879,6 +975,12 @@ export default {
|
|
|
if (index === 1) {
|
|
|
sums[index] = data.length;
|
|
|
}
|
|
|
+ if (column.property === 'totalStuffQty') {
|
|
|
+ const unitSummary = Object.entries(unitGroups).map(([unit, total]) => {
|
|
|
+ return `${total} ${unit}`; // 拼接单位和总和
|
|
|
+ }).join(', '); // 用逗号分隔多个单位
|
|
|
+ sums[index] = unitSummary || 'N/A'; // 无数据时显示 N/A
|
|
|
+ }
|
|
|
});
|
|
|
return sums;
|
|
|
},
|
|
|
@@ -986,6 +1088,7 @@ export default {
|
|
|
'&pageSize=' + this.page.pageSize + '&stuffTypeName=' + this.search.stuffTypeName + '&stuffName=' + this.search.stuffName +
|
|
|
'&startTime=' + startTime + '&endTime=' + endTime + '&searchData=' + '1')
|
|
|
.then(res => {
|
|
|
+ console.log('searchData res:',res)
|
|
|
this.dataLoading = false;
|
|
|
this.table.list = res.data.list;
|
|
|
this.page.totalPage = res.data.total;
|