466 lines
20 KiB
Vue
466 lines
20 KiB
Vue
<template>
|
|
<div class="app-container">
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
<el-form-item label="分组选项">
|
|
<el-checkbox-group v-model="queryParams.groupFields" @change="handleQuery">
|
|
<el-checkbox label="orderId">订单号</el-checkbox>
|
|
<el-checkbox label="productId">品号</el-checkbox>
|
|
<el-checkbox label="productName">品名</el-checkbox>
|
|
<!-- <el-checkbox label="lotNo">批号</el-checkbox>-->
|
|
<!-- <el-checkbox label="unit">单位</el-checkbox> -->
|
|
<!-- <el-checkbox label="warehouseId">仓库</el-checkbox> -->
|
|
<!-- <el-checkbox label="roadwayId">巷道</el-checkbox>-->
|
|
<!-- <el-checkbox label="cargoSpaceId">货位</el-checkbox>-->
|
|
<!-- <el-checkbox label="price">品号描述</el-checkbox>-->
|
|
<el-checkbox label="spec">规格</el-checkbox>
|
|
<!-- <el-checkbox label="parentId">产品分类</el-checkbox> -->
|
|
<!-- <el-checkbox label="cargoNo">英文描述</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare1">型号</el-checkbox> -->
|
|
<!-- <el-checkbox label="spare2">单件净重</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare3">颜色</el-checkbox> -->
|
|
<!-- <el-checkbox label="spare4">序列号</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare5">电压</el-checkbox> -->
|
|
<!-- <el-checkbox label="spare6">功率</el-checkbox> -->
|
|
<!-- <el-checkbox label="spare7">相位</el-checkbox> -->
|
|
<!-- <el-checkbox label="spare8">毛重</el-checkbox> -->
|
|
<!-- <el-checkbox label="spare9">NC号</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare10">电源线</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare11">插头</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare12">接嘴</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare13">快捷码</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare14">库存单位编号</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare15">库存单位名称</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare16">品号群组</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare17">归类品</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare18">计量体系</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare19">群组名称</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare20">批号管理</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare21">状态</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare22">产品大类</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare23">产品二类</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare24">产品线/产品系列</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare25">BOM状态</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare26">产品定位</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare27">电脑板型号</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare28">非标要求</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare29">品牌</el-checkbox>-->
|
|
<el-checkbox label="spare30">非标颜色</el-checkbox>
|
|
<el-checkbox label="spare31">主颜色</el-checkbox>
|
|
<el-checkbox label="spare32">辅助颜色</el-checkbox>
|
|
<!-- <el-checkbox label="spare33">是否标准款</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare34">包装方式</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare35">主要包装方式</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare36">长</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare37">宽</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare38">高</el-checkbox>-->
|
|
<!-- <el-checkbox label="spare39">包装材积</el-checkbox>-->
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
<br>
|
|
|
|
<el-form-item label="订单号" prop="orderId">
|
|
<el-input
|
|
v-model="queryParams.orderId"
|
|
placeholder="请输入订单号"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="品号" prop="productId">
|
|
<el-input
|
|
v-model="queryParams.productId"
|
|
placeholder="请输入品号"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item label="品名" prop="productName">
|
|
<el-input
|
|
v-model="queryParams.productName"
|
|
placeholder="请输入品名"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="序列号" prop="spare4">-->
|
|
<!-- <el-input-->
|
|
<!-- v-model="queryParams.spare4"-->
|
|
<!-- placeholder="请输入序列号"-->
|
|
<!-- clearable-->
|
|
<!-- @keyup.enter.native="handleQuery"-->
|
|
<!-- />-->
|
|
<!-- </el-form-item>-->
|
|
<el-form-item label="规格" prop="spec">
|
|
<el-input
|
|
v-model="queryParams.spec"
|
|
placeholder="请输入规格"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="NC号" prop="spare9">-->
|
|
<!-- <el-input-->
|
|
<!-- v-model="queryParams.spare9"-->
|
|
<!-- placeholder="请输入NC号"-->
|
|
<!-- clearable-->
|
|
<!-- @keyup.enter.native="handleQuery"-->
|
|
<!-- />-->
|
|
<!-- </el-form-item>-->
|
|
<!-- <el-form-item label="货位" prop="cargoSpaceId">-->
|
|
<!-- <el-input-->
|
|
<!-- v-model="queryParams.cargoSpaceId"-->
|
|
<!-- placeholder="请输入货位"-->
|
|
<!-- clearable-->
|
|
<!-- @keyup.enter.native="handleQuery"-->
|
|
<!-- />-->
|
|
<!-- </el-form-item>-->
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
v-hasPermi="['search:StockSummary:export']"
|
|
>导出</el-button>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
|
|
<el-table
|
|
v-loading="loading"
|
|
:data="stockSummaryList"
|
|
@selection-change="handleSelectionChange"
|
|
max-height="650"
|
|
>
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column label="订单号" align="center" prop="orderId" width="160" v-if="queryParams.groupFields.includes('orderId')" />
|
|
<el-table-column label="品号" align="left" prop="productId" width="160" v-if="queryParams.groupFields.includes('productId')" />
|
|
<el-table-column label="品名" align="center" prop="productName" width="160" v-if="queryParams.groupFields.includes('productName')" />
|
|
<!-- <el-table-column label="批号" align="center" prop="lotNo" width="160" v-if="queryParams.groupFields.includes('lotNo')" />-->
|
|
<!-- <el-table-column label="单位" align="center" prop="unit" width="120" v-if="queryParams.groupFields.includes('unit')" /> -->
|
|
<!-- <el-table-column label="仓库" align="left" prop="warehouseName" width="120" v-if="queryParams.groupFields.includes('warehouseId')" />-->
|
|
<!-- <el-table-column label="巷道" align="left" prop="roadwayId" width="160" />-->
|
|
<!-- <el-table-column label="货位" align="left" prop="cargoSpaceName" width="160" v-if="queryParams.groupFields.includes('cargoSpaceId')" />-->
|
|
<el-table-column label="库存数量" align="right" prop="quantity" width="120" />
|
|
<!-- <el-table-column label="型号" align="center" prop="spare1" width="120" v-if="queryParams.groupFields.includes('spare1')" /> -->
|
|
<el-table-column label="单件净重" align="center" prop="spare2" width="120" v-if="queryParams.groupFields.includes('spare2')" />
|
|
<!-- <el-table-column label="序列号" align="center" prop="spare4" width="120" v-if="queryParams.groupFields.includes('spare4')" />-->
|
|
<el-table-column label="电压" align="center" prop="spare5" width="120" v-if="queryParams.groupFields.includes('spare5')" />
|
|
<el-table-column label="功率" align="center" prop="spare6" width="120" v-if="queryParams.groupFields.includes('spare6')" />
|
|
<el-table-column label="相位" align="center" prop="spare7" width="120" v-if="queryParams.groupFields.includes('spare7')" />
|
|
<!-- <el-table-column label="毛重" align="center" prop="spare8" width="120" v-if="queryParams.groupFields.includes('spare8')" /> -->
|
|
<el-table-column label="规格" align="left" prop="spec" width="160" v-if="queryParams.groupFields.includes('spec')" />
|
|
<!-- <el-table-column label="品号描述" align="left" prop="price" width="160" v-if="queryParams.groupFields.includes('price')" />-->
|
|
<!-- <el-table-column label="产品分类" align="left" prop="parentId" width="160" v-if="queryParams.groupFields.includes('parentId')" />-->
|
|
<!-- <el-table-column label="英文描述" align="left" prop="cargoNo" width="160" v-if="queryParams.groupFields.includes('cargoNo')" />-->
|
|
<el-table-column label="NC号" align="left" prop="spare9" width="160" v-if="queryParams.groupFields.includes('spare9')" />
|
|
<!-- <el-table-column label="电源线" align="left" prop="spare10" width="160" v-if="queryParams.groupFields.includes('spare10')" />-->
|
|
<!-- <el-table-column label="插头" align="left" prop="spare11" width="160" v-if="queryParams.groupFields.includes('spare11')" />-->
|
|
<!-- <el-table-column label="接嘴" align="left" prop="spare12" width="160" v-if="queryParams.groupFields.includes('spare12')" />-->
|
|
<!-- <el-table-column label="快捷码" align="left" prop="spare13" width="160" v-if="queryParams.groupFields.includes('spare13')" />-->
|
|
<!-- <el-table-column label="库存单位编号" align="left" prop="spare14" width="160" v-if="queryParams.groupFields.includes('spare14')" />-->
|
|
<!-- <el-table-column label="库存单位名称" align="left" prop="spare15" width="160" v-if="queryParams.groupFields.includes('spare15')" />-->
|
|
<!-- <el-table-column label="品号群组" align="left" prop="spare16" width="160" v-if="queryParams.groupFields.includes('spare16')" />-->
|
|
<!-- <el-table-column label="归类品" align="left" prop="spare17" width="160" v-if="queryParams.groupFields.includes('spare17')" />-->
|
|
<!-- <el-table-column label="计量体系" align="left" prop="spare18" width="160" v-if="queryParams.groupFields.includes('spare18')" />-->
|
|
<!-- <el-table-column label="群组名称" align="left" prop="spare19" width="160" v-if="queryParams.groupFields.includes('spare19')" />-->
|
|
<!-- <el-table-column label="批号管理" align="left" prop="spare20" width="160" v-if="queryParams.groupFields.includes('spare20')" />-->
|
|
<!-- <el-table-column label="状态" align="left" prop="spare21" width="160" v-if="queryParams.groupFields.includes('spare21')" />-->
|
|
<!-- <el-table-column label="产品大类" align="left" prop="spare22" width="160" v-if="queryParams.groupFields.includes('spare22')" />-->
|
|
<!-- <el-table-column label="产品二类" align="left" prop="spare23" width="160" v-if="queryParams.groupFields.includes('spare23')" />-->
|
|
<!-- <el-table-column label="产品线/产品系列" align="left" prop="spare24" width="160" v-if="queryParams.groupFields.includes('spare24')" />-->
|
|
<!-- <el-table-column label="BOM状态" align="left" prop="spare25" width="160" v-if="queryParams.groupFields.includes('spare25')" />-->
|
|
<!-- <el-table-column label="产品定位" align="left" prop="spare26" width="160" v-if="queryParams.groupFields.includes('spare26')" />-->
|
|
<!-- <el-table-column label="电脑板型号" align="left" prop="spare27" width="160" v-if="queryParams.groupFields.includes('spare27')" />-->
|
|
<!-- <el-table-column label="非标要求" align="left" prop="spare28" width="160" v-if="queryParams.groupFields.includes('spare28')" />-->
|
|
<!-- <el-table-column label="品牌" align="left" prop="spare29" width="160" v-if="queryParams.groupFields.includes('spare29')" />-->
|
|
<el-table-column label="非标颜色" align="left" prop="spare30" width="160" v-if="queryParams.groupFields.includes('spare30')" />
|
|
<el-table-column label="主颜色" align="left" prop="spare31" width="160" v-if="queryParams.groupFields.includes('spare31')" />
|
|
<el-table-column label="辅助颜色" align="left" prop="spare32" width="160" v-if="queryParams.groupFields.includes('spare32')" />
|
|
<!-- <el-table-column label="是否标准款" align="left" prop="spare33" width="160" v-if="queryParams.groupFields.includes('spare33')" />-->
|
|
<!-- <el-table-column label="包装方式" align="left" prop="spare34" width="160" v-if="queryParams.groupFields.includes('spare34')" />-->
|
|
<!-- <el-table-column label="主要包装方式" align="left" prop="spare35" width="160" v-if="queryParams.groupFields.includes('spare35')" />-->
|
|
<!-- <el-table-column label="长" align="right" prop="spare36" width="160" v-if="queryParams.groupFields.includes('spare36')" />-->
|
|
<!-- <el-table-column label="宽" align="right" prop="spare37" width="160" v-if="queryParams.groupFields.includes('spare37')" />-->
|
|
<!-- <el-table-column label="高" align="right" prop="spare38" width="160" v-if="queryParams.groupFields.includes('spare38')" />-->
|
|
<!-- <el-table-column label="包装材积" align="center" prop="spare39" width="160" v-if="queryParams.groupFields.includes('spare39')" />-->
|
|
<!-- <el-table-column label="备注" align="left" prop="remark" width="160" />-->
|
|
</el-table>
|
|
|
|
<pagination
|
|
v-show="total>0"
|
|
:total="total"
|
|
:page.sync="queryParams.pageNum"
|
|
:limit.sync="queryParams.pageSize"
|
|
@pagination="getList"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listStockSummary, getStockSummary } from "@/api/search/StockSummary";
|
|
import { listWarehouse } from "@/api/bas/warehouse"
|
|
|
|
export default {
|
|
name: "StockSummary",
|
|
data() {
|
|
return {
|
|
// 遮罩层
|
|
loading: false,
|
|
// 仓库选项列表
|
|
warehouseOptions: [],
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 总条数
|
|
total: 0,
|
|
// 库存汇总表格数据
|
|
stockSummaryList: [],
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
productId: null,
|
|
productName: null,
|
|
spec: null,
|
|
unit: null,
|
|
lotNo: null,
|
|
warehouseId: null,
|
|
orderId:null,
|
|
roadwayId: null,
|
|
quantity: null,
|
|
parentId: null,
|
|
cargoNo: null,
|
|
spare3: null,
|
|
spare4: null,
|
|
spare5: null,
|
|
spare6: null,
|
|
spare7: null,
|
|
spare8: null,
|
|
spare9: null,
|
|
spare10: null,
|
|
spare11: null,
|
|
spare12: null,
|
|
spare13: null,
|
|
spare14: null,
|
|
spare15: null,
|
|
spare16: null,
|
|
spare17: null,
|
|
spare18: null,
|
|
spare19: null,
|
|
spare20: null,
|
|
spare21: null,
|
|
spare22: null,
|
|
spare23: null,
|
|
spare24: null,
|
|
spare25: null,
|
|
spare26: null,
|
|
spare27: null,
|
|
spare28: null,
|
|
spare29: null,
|
|
spare30: null,
|
|
spare31: null,
|
|
spare32: null,
|
|
spare33: null,
|
|
spare34: null,
|
|
spare35: null,
|
|
spare36: null,
|
|
spare37: null,
|
|
spare38: null,
|
|
spare39: null,
|
|
//分组字段
|
|
groupFields: []
|
|
}
|
|
};
|
|
},
|
|
created() {
|
|
// 初始化时全选分组选项
|
|
this.queryParams.groupFields = [
|
|
// 'parentId',
|
|
// 'cargoNo',
|
|
// 'roadwayId',
|
|
'orderId',
|
|
// 'spare3',
|
|
// 'spare4',
|
|
// 'spare5',
|
|
// 'spare6',
|
|
// 'spare7',
|
|
// 'spare8',
|
|
// 'spare9',
|
|
// 'spare10',
|
|
// 'spare11',
|
|
// 'spare12',
|
|
// 'spare13',
|
|
// 'spare14',
|
|
// 'spare15',
|
|
// 'spare16',
|
|
// 'spare17',
|
|
// 'spare18',
|
|
// 'spare19',
|
|
// 'spare20',
|
|
// 'spare21',
|
|
// 'spare22',
|
|
// 'spare23',
|
|
// 'spare24',
|
|
// 'spare25',
|
|
// 'spare26',
|
|
// 'spare27',
|
|
// 'spare28',
|
|
// 'spare29',
|
|
'spare30',
|
|
'spare31',
|
|
'spare32',
|
|
// 'spare33',
|
|
// 'spare34',
|
|
// 'spare35',
|
|
// 'spare36',
|
|
// 'spare37',
|
|
// 'spare38',
|
|
// 'spare39',
|
|
'productId', 'productName', 'spec'
|
|
// 'unit', 'lotNo', 'warehouseId', 'cargoSpaceId',
|
|
// 'price', 'spare1', 'spare2', 'spare5', 'spare6', 'spare7', 'spare8'
|
|
];
|
|
this.getList();
|
|
this.getWarehouseList()
|
|
},
|
|
methods: {
|
|
/** 查询仓库列表 */
|
|
getWarehouseList() {
|
|
var quaryParam = {
|
|
pageNum:1,
|
|
pageSize:99
|
|
}
|
|
listWarehouse(quaryParam).then(response => {
|
|
this.warehouseOptions = response.rows;
|
|
});
|
|
},
|
|
/** 查询库存汇总列表 */
|
|
getList() {
|
|
this.loading = true;
|
|
// 将选中的分组字段转换为后端需要的格式
|
|
const params = {};
|
|
// 先设置查询条件
|
|
Object.keys(this.queryParams).forEach(key => {
|
|
if (key !== 'groupFields' && this.queryParams[key] !== null) {
|
|
params[key] = this.queryParams[key];
|
|
}
|
|
});
|
|
// 再设置分组字段
|
|
this.queryParams.groupFields.forEach(field => {
|
|
params[`groupBy${field.charAt(0).toUpperCase() + field.slice(1)}`] = true;
|
|
});
|
|
|
|
listStockSummary(params).then(response => {
|
|
this.stockSummaryList = response.rows;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
});
|
|
},
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
this.queryParams.pageNum = 1;
|
|
this.getList();
|
|
},
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
this.resetForm("queryForm");
|
|
// 重置时恢复全选状态
|
|
this.queryParams.groupFields = [
|
|
// 'parentId',
|
|
// 'cargoNo',
|
|
'orderId',
|
|
// 'roadwayId',
|
|
// 'spare3',
|
|
// 'spare4',
|
|
// 'spare5',
|
|
// 'spare6',
|
|
// 'spare7',
|
|
// 'spare8',
|
|
// 'spare9',
|
|
// 'spare10',
|
|
// 'spare11',
|
|
// 'spare12',
|
|
// 'spare13',
|
|
// 'spare14',
|
|
// 'spare15',
|
|
// 'spare16',
|
|
// 'spare17',
|
|
// 'spare18',
|
|
// 'spare19',
|
|
// 'spare20',
|
|
// 'spare21',
|
|
// 'spare22',
|
|
// 'spare23',
|
|
// 'spare24',
|
|
// 'spare25',
|
|
// 'spare26',
|
|
// 'spare27',
|
|
// 'spare28',
|
|
// 'spare29',
|
|
'spare30',
|
|
'spare31',
|
|
'spare32',
|
|
// 'spare33',
|
|
// 'spare34',
|
|
// 'spare35',
|
|
// 'spare36',
|
|
// 'spare37',
|
|
// 'spare38',
|
|
// 'spare39',
|
|
'productId', 'productName', 'spec'
|
|
// , 'unit', 'lotNo', 'warehouseId', 'cargoSpaceId',
|
|
// 'price', 'spare1', 'spare2', 'spare5', 'spare6', 'spare7', 'spare8'
|
|
];
|
|
this.handleQuery();
|
|
},
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
// 将选中的分组字段转换为后端需要的格式
|
|
const params = {};
|
|
// 先设置查询条件
|
|
Object.keys(this.queryParams).forEach(key => {
|
|
if (key !== 'groupFields' && this.queryParams[key] !== null) {
|
|
params[key] = this.queryParams[key];
|
|
}
|
|
});
|
|
// 再设置分组字段
|
|
this.queryParams.groupFields.forEach(field => {
|
|
params[`groupBy${field.charAt(0).toUpperCase() + field.slice(1)}`] = true;
|
|
});
|
|
|
|
this.download('search/StockSummary/export', params, `库存汇总_${new Date().getTime()}.xlsx`)
|
|
},
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map(item => item.onlyIdentity)
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
.el-table >>> .current-row {
|
|
background-color: #f0f9eb;
|
|
}
|
|
.el-form-item >>> .el-form-item__label {
|
|
white-space: nowrap;
|
|
width: auto;
|
|
min-width: fit-content;
|
|
}
|
|
</style>
|