新购入库,编码入库页面增加分页

This commit is contained in:
hayu 2026-01-20 17:02:19 +08:00
parent aca34018b7
commit 97b720e154
1 changed files with 126 additions and 53 deletions

View File

@ -201,36 +201,59 @@
<!-- 编码入库 -->
<el-dialog title="编码入库" :visible.sync="openCode" width="1000px" append-to-body>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" size="mini" @click="codeWarehouse">入库</el-button>
</el-col>
</el-row>
<el-table :data="codeTableData" width="100%" height="450px" row-key="id" @selection-change="codeSelection">
<el-table-column type="selection" width="55" align="center" v-if="!isView"/>
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="类型名称" prop="typeName" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ codeRowData.maTypeName }}</span>
</template>
</el-table-column>
<el-table-column label="规格型号" prop="type" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ codeRowData.typeName }}</span>
</template>
</el-table-column>
<el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true"></el-table-column>
<!-- <el-table-column label="操作" align="center" width="300px">
<template slot-scope="scope">
<el-button size="mini" type="warning" @click="openInnerDialog(scope.row)">内部维修</el-button>
<el-button size="mini" type="danger" @click="openScrapDialog(scope.row)">待报废</el-button>
</template>
</el-table-column> -->
</el-table>
<!-- <div style="width: 100%;height: 50px;display: flex;justify-content: flex-end;align-items: center;">
<el-button type="primary" size="mini" >保存</el-button>
<el-button type="normal" size="mini" @click="openCode=false">取消</el-button>
</div> -->
<!-- <el-form :model="codeQueryParams" ref="codeQueryForm" size="small" :inline="true" label-width="90px">-->
<!-- <el-form-item label="设备编码:" prop="maCode">-->
<!-- <el-input-->
<!-- v-model="codeQueryParams.maCode"-->
<!-- placeholder="请输入设备编码"-->
<!-- clearable-->
<!-- style="width: 200px"-->
<!-- @keyup.enter.native="handleCodeQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item>-->
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleCodeQuery">搜索</el-button>-->
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetCodeQuery">重置</el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" size="mini" @click="codeWarehouse">入库</el-button>
</el-col>
</el-row>
<el-table
:data="codeTableData"
width="100%"
height="350px"
row-key="id"
@selection-change="codeSelection"
v-loading="codeLoading"
>
<el-table-column type="selection" width="55" align="center" v-if="!isView"/>
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="类型名称" prop="typeName" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ codeRowData.maTypeName }}</span>
</template>
</el-table-column>
<el-table-column label="规格型号" prop="type" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ codeRowData.typeName }}</span>
</template>
</el-table-column>
<el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true"></el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="codeTotal > 0"
:total="codeTotal"
:page.sync="codeQueryParams.pageNum"
:limit.sync="codeQueryParams.pageSize"
@pagination="getCodeList"
/>
</el-dialog>
@ -308,7 +331,13 @@ export default {
codeRowData:{},
codeTableData:[],
inPutList:[],
purchaseCheckInfo: null
purchaseCheckInfo: null,
//
codeQueryParams: {
pageNum: 1,
pageSize: 10
},
codeTotal: 0,
};
},
mounted() {
@ -396,15 +425,24 @@ export default {
pass(row) {
if(row.manageType==0){//
this.codeRowData=row
let param={
taskId:this.taskId,
typeId:this.codeRowData.typeId
// let param={
// taskId:this.taskId,
// typeId:this.codeRowData.typeId
// }
// getMachineById(param).then((res)=>{
// console.log("11111",res.data)
// this.codeTableData=res.data
// this.inPutList=[]
// this.openCode=true
// })
//
this.codeQueryParams = {
pageNum: 1,
pageSize: 10,
maCode: undefined
}
getMachineById(param).then((res)=>{
this.codeTableData=res.data
this.inPutList=[]
this.openCode=true
})
this.getCodeList()
this.openCode = true
}else{
const inputNum = Number(row.checkNum) - Number(row.inputNum)
let obj = {
@ -432,6 +470,48 @@ export default {
}).catch(() => {});
}
},
//
getCodeList() {
this.codeLoading = true
let param = {
taskId: this.taskId,
typeId: this.codeRowData.typeId,
pageNum: this.codeQueryParams.pageNum,
pageSize: this.codeQueryParams.pageSize,
maCode: this.codeQueryParams.maCode
}
getMachineById(param).then((res) => {
if (res.data.code === 200) {
this.codeTableData = res.data.rows || []
this.codeTotal = res.data.total || 0
} else {
this.codeTableData = []
this.codeTotal = 0
}
this.codeLoading = false
}).catch(() => {
this.codeLoading = false
this.codeTableData = []
this.codeTotal = 0
})
},
//
handleCodeQuery() {
this.codeQueryParams.pageNum = 1
this.getCodeList()
},
//
resetCodeQuery() {
this.resetForm("codeQueryForm")
this.codeQueryParams = {
pageNum: 1,
pageSize: 10,
maCode: undefined
}
this.getCodeList()
},
//
codeSelection(selection){
console.log(selection)
@ -456,21 +536,14 @@ export default {
};
console.log(obj)
this.$modal.confirm('是否确认新购入库勾选的编码?')
.then(function() {
return purchaseWarehouse(obj)
}).then(() => {
// let param={
// taskId:this.taskId,
// typeId:this.codeRowData.typeId
// }
// getMachineById(param).then((res)=>{
// this.codeTableData=res.data
// })
this.openCode=false
this.getList()
this.$modal.msgSuccess('入库成功')
.then(() => {
return purchaseWarehouse(obj)
}).then(() => {
this.openCode = false
this.getList()
this.$modal.msgSuccess('入库成功')
}).catch(() => {});
}else{
} else {
this.$modal.msgError('请先勾选入库编码!')
}