|
|
|
|
@ -49,6 +49,17 @@
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="日期">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="dateRange"
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
type="daterange"
|
|
|
|
|
range-separator="-"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@ -120,6 +131,8 @@
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="sparepartsInOutStorageList"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
:summary-method="getSummaries"
|
|
|
|
|
show-summary
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<!-- 序号 -->
|
|
|
|
|
@ -175,7 +188,7 @@
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="出入库人员"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="createBy"
|
|
|
|
|
prop="nickName"
|
|
|
|
|
width="180"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
@ -221,10 +234,11 @@
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
:pageSizes="[50,100,200,500]"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
@ -363,6 +377,8 @@ export default {
|
|
|
|
|
delFlag: null,
|
|
|
|
|
factoryCode: null,
|
|
|
|
|
},
|
|
|
|
|
// 日期范围
|
|
|
|
|
dateRange: [],
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
@ -401,12 +417,32 @@ export default {
|
|
|
|
|
/** 查询备品备件出入库列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listSparepartsInOutStorage(this.queryParams).then((response) => {
|
|
|
|
|
listSparepartsInOutStorage(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
|
|
|
|
|
this.sparepartsInOutStorageList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getSummaries(param) {
|
|
|
|
|
const { columns, data } = param;
|
|
|
|
|
const sums = [];
|
|
|
|
|
|
|
|
|
|
// 初始化所有列
|
|
|
|
|
columns.forEach((column, index) => {
|
|
|
|
|
if (index === 1) {
|
|
|
|
|
sums[index] = '总数'; // 第一列显示固定文本
|
|
|
|
|
} else if (column.property === 'amount') {
|
|
|
|
|
// 计算amount列合计
|
|
|
|
|
const total = data.reduce((sum, item) => {
|
|
|
|
|
const val = Number(item.amount);
|
|
|
|
|
return sum + (isNaN(val) ? 0 : val);
|
|
|
|
|
}, 0);
|
|
|
|
|
sums[index] = total + ' 个';
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return sums;
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
@ -441,6 +477,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.dateRange = [];
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
|