Files
scrq-hd/.svn/pristine/e6/e6a80da94297cbe9672efdff4a25cc28e9028814.svn-base
2025-07-03 10:34:04 +08:00

209 lines
4.7 KiB
Plaintext

<template>
<!-- 选择产品信息 -->
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
label-width="100px"
>
<el-form-item label="物料类型编码">
<el-input
v-model="queryParams.materialTypeCode"
placeholder="物料类型编码"
clearable
size="small"
style="width: 230px"
/>
</el-form-item>
<el-form-item label="物料类型名称">
<el-input
v-model="queryParams.materialTypeName"
placeholder="物料类型名称"
clearable
size="small"
style="width: 230px"
/>
</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-table
v-loading="loading"
lazy
border
:data="tableData"
@row-dblclick="handleDbClick"
ref="list"
height="400px"
>
<el-table-column
label="物料类型编码"
align="center"
width="180"
prop="materialTypeCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="物料类型名称"
align="center"
width="180"
prop="materialTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="上级代码"
align="center"
width="100"
prop="parentCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="ERP存货类型代码"
align="center"
width="250"
prop="erpMaterialTypeCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="ERP存货类型名称"
align="center"
width="250"
prop="erpMaterialTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="AQL"
align="center"
prop="aql"
width="100"
:show-overflow-tooltip="true"
/>
<el-table-column
label="是否隐藏"
align="center"
prop="materialTypeEnabledShow"
width="100"
:show-overflow-tooltip="true"
/>
</el-table>
<el-pagination
style="margin-top: 10px; height: 20px"
@size-change="handleSizeChange"
@current-change="handleCurrentChange2"
:current-page="currentPage"
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</template>
<script>
export default {
name: "orderProd",
props: {
layerid: {
type: String,
default: "",
},
lydata: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
currentRow: null,
total: null,
pageSize: 50,
currentPage: 1,
tableData: [],
loading: false,
queryParams: {},
};
},
watch: {},
mounted() {
this.getMaterialType();
},
methods: {
getMaterialType() {
this.loading = true;
const params = {
pageSize: this.pageSize,
pageNo: this.currentPage,
materialTypeCode: this.queryParams.materialTypeCode,
materialTypeName:this.queryParams.materialTypeName
};
this.$MaterialType.getMaterialType(params).then((data) => {
if (data.data.code == 200) {
this.tableData = data.data.data.data;
this.tableData.forEach((data) => {
data.materialTypeEnabled === 1
? (data.materialTypeEnabledShow = "否")
: (data.materialTypeEnabledShow = "是");
});
this.total = data.data.data.recordsTotal;
} else {
this.$message.error(data.msg);
}
this.loading = false;
});
},
handleSizeChange(val) {
this.pageSize = val;
this.getMaterialType();
},
handleCurrentChange2(val) {
this.currentPage = val;
this.getMaterialType();
},
handleDbClick(row, event, column) {
this.$parent.getSelectMType(row);
this.$layer.close(this.layerid);
},
/** 搜索按钮操作 */
handleQuery() {
this.currentPage = 1;
this.getMaterialType();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {};
this.currentPage = 1;
this.pageSize = 10;
this.handleQuery();
},
},
};
</script>
<style scoped lang="scss">
>>> .el-table {
width: 1050px;
}
</style>