Browse Source

2025-10-27

仓库盘点管理
master
fengyuan_yang 3 months ago
parent
commit
f5f196a49c
  1. 1
      src/api/warehouse/countingReport.js
  2. 218
      src/views/modules/warehouse/countingReport.vue

1
src/api/warehouse/countingReport.js

@ -101,3 +101,4 @@ export function countingReportDetailList(data) {

218
src/views/modules/warehouse/countingReport.vue

@ -55,8 +55,8 @@
<el-table-column prop="buNo" label="BU" header-align="center" align="center" min-width="80"></el-table-column> <el-table-column prop="buNo" label="BU" header-align="center" align="center" min-width="80"></el-table-column>
<el-table-column prop="reportId" label="盘点任务单号" header-align="center" align="left" min-width="150"></el-table-column> <el-table-column prop="reportId" label="盘点任务单号" header-align="center" align="left" min-width="150"></el-table-column>
<el-table-column prop="checkDimension" label="盘点维度" header-align="center" align="center" min-width="100"></el-table-column> <el-table-column prop="checkDimension" label="盘点维度" header-align="center" align="center" min-width="100"></el-table-column>
<el-table-column prop="warehouseDesc" label="盘点仓库" header-align="center" align="left" min-width="120"></el-table-column>
<el-table-column prop="locationDesc" label="盘点货位" header-align="center" align="left" min-width="120"></el-table-column>
<el-table-column prop="warehouseName" label="盘点仓库" header-align="center" align="left" min-width="120"></el-table-column>
<el-table-column prop="locationName" label="盘点货位" header-align="center" align="left" min-width="120"></el-table-column>
<el-table-column prop="partDesc" label="盘点物料" header-align="center" align="left" min-width="200"></el-table-column> <el-table-column prop="partDesc" label="盘点物料" header-align="center" align="left" min-width="200"></el-table-column>
<el-table-column prop="statusDesc" label="状态" header-align="center" align="center" min-width="80"></el-table-column> <el-table-column prop="statusDesc" label="状态" header-align="center" align="center" min-width="80"></el-table-column>
<el-table-column prop="createBy" label="创建人" header-align="center" align="center" min-width="100"></el-table-column> <el-table-column prop="createBy" label="创建人" header-align="center" align="center" min-width="100"></el-table-column>
@ -93,7 +93,7 @@
<el-dialog :title="modalTitle" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px"> <el-dialog :title="modalTitle" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px">
<el-form ref="modalForm" :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> <el-form ref="modalForm" :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="BU" prop="bu"> <el-form-item label="BU" prop="bu">
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 120px">
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 135px">
<el-option <el-option
v-for="i in userBuList" v-for="i in userBuList"
:key="i.buNo" :key="i.buNo"
@ -115,22 +115,29 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px"> <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px">
<el-form-item>
<span style="cursor: pointer" slot="label" @click="getBaseList(506)"><a href="#">盘点仓库</a></span>
<el-input v-model="modalData.warehouseId" @change="supplierBlur(506)" style="width: 100px"></el-input>
<el-input v-model="modalData.warehouseName" disabled style="width: 300px"></el-input>
<el-form-item prop="warehouseId">
<span style="cursor: pointer" slot="label" @click="getBaseList(20)"><a href="#">盘点仓库</a></span>
<el-input v-model="modalData.warehouseId" @change="warehouseBlur(20)" style="width: 135px"></el-input>
<el-input v-model="modalData.warehouseName" disabled style="width: 320px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px"> <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px">
<el-form-item label="盘点货位" prop="locationId" style="width: 100%">
<el-input v-model="modalData.locationId" placeholder="请选择盘点货位(盘点维度:按仓库、按货位)" style="width: 100%"></el-input>
<el-form-item>
<span style="cursor: pointer" slot="label" @click="getBaseList(22)"><a href="#">盘点货位</a></span>
<el-input v-model="modalData.locationId" @change="locationBlur(22)" style="width: 135px"></el-input>
<el-input v-model="modalData.locationName" disabled style="width: 320px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="盘点物料" prop="partNo" style="width: 100%">
<el-input v-model="modalData.partNo" placeholder="请选择盘点物料(盘点维度:按仓库、按货位、按物料)" style="width: 100%"></el-input>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px">
<el-form-item prop="partNo">
<span style="cursor: pointer" slot="label" @click="getBaseList(509)"><a href="#">盘点物料</a></span>
<el-input v-model="modalData.partNo" @change="partBlur(509)" style="width: 135px"></el-input>
<el-input v-model="modalData.partDesc" disabled style="width: 320px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" style="width: 100%">
<el-input type="textarea" v-model="modalData.remark" :rows="3" style="width: 100%"></el-input>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px">
<el-form-item label="备注">
<el-input type="textarea" v-model="modalData.remark" :rows="3" style="width: 460px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-footer style="height:35px;margin-top: 55px;text-align:center"> <el-footer style="height:35px;margin-top: 55px;text-align:center">
@ -141,6 +148,59 @@
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 盘点清单对话框 -->
<el-dialog title="盘点清单" :close-on-click-modal="false" v-drag :visible.sync="detailFlag" width="90%">
<!-- 查询条件 -->
<el-form :inline="true" label-position="top" :model="detailSearchData" style="margin-bottom: 10px;">
<el-form-item label="标签条码">
<el-input v-model="detailSearchData.rollNo" clearable style="width: 150px" placeholder="请输入查询信息"></el-input>
</el-form-item>
<el-form-item label="物料编码">
<el-input v-model="detailSearchData.partNo" clearable style="width: 150px" placeholder="请输入查询信息"></el-input>
</el-form-item>
<el-form-item label="是否盘点">
<el-select v-model="detailSearchData.checkedFlag" placeholder="请选择" clearable style="width: 100px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getDetailList()">查询</el-button>
</el-form-item>
</el-form>
<!-- 统计信息 -->
<div style="margin-bottom: 15px; padding: 10px; background-color: #f5f7fa; border-radius: 4px;">
<span style="margin-right: 30px;"><strong>标签总数</strong><span style="color: #409EFF; font-size: 18px;">{{ detailStatistics.totalCount }}</span></span>
<span style="margin-right: 30px;"><strong>物料总数</strong><span style="color: #67C23A; font-size: 18px;">{{ detailStatistics.totalQty }}</span></span>
<span><strong>已盘点数</strong><span style="color: #E6A23C; font-size: 18px;">{{ detailStatistics.checkedQty }}</span></span>
</div>
<!-- 明细列表 -->
<el-table
:height="500"
:data="detailList"
border
v-loading="detailLoading"
style="width: 100%;">
<el-table-column type="index" label="NO." header-align="center" align="center" width="60"></el-table-column>
<el-table-column prop="rollNo" label="标签条码" header-align="center" align="left" min-width="150"></el-table-column>
<el-table-column prop="rollQty" label="标签数量" header-align="center" align="right" min-width="100"></el-table-column>
<el-table-column prop="labelType" label="标签类型" header-align="center" align="center" min-width="100"></el-table-column>
<el-table-column prop="partNo" label="物料编码" header-align="center" align="left" min-width="150"></el-table-column>
<el-table-column prop="partDesc" label="物料名称" header-align="center" align="left" min-width="200"></el-table-column>
<el-table-column prop="checkedFlag" label="是否盘点" header-align="center" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.checkedFlag === 'Y' ? '是' : '否' }}
</template>
</el-table-column>
</el-table>
<el-footer style="height:35px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="detailFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div> </div>
</template> </template>
@ -151,7 +211,8 @@ import {
countingReportUpdate, countingReportUpdate,
countingReportBatchDelete, countingReportBatchDelete,
countingReportUpdateStatus, countingReportUpdateStatus,
countingReportBatchUpdateStatus
countingReportBatchUpdateStatus,
countingReportDetailList
} from '@/api/warehouse/countingReport.js' } from '@/api/warehouse/countingReport.js'
import {getSiteAndBuByUserName} from "@/api/qc/qc.js" import {getSiteAndBuByUserName} from "@/api/qc/qc.js"
import Chooselist from '@/views/modules/common/Chooselist_eam' import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -219,6 +280,23 @@ export default {
message: ' ', message: ' ',
trigger: ['blur','change'] trigger: ['blur','change']
}] }]
},
//
detailFlag: false,
detailLoading: false,
detailList: [],
detailSearchData: {
site: '',
buNo: '',
reportId: '',
rollNo: '',
partNo: '',
checkedFlag: ''
},
detailStatistics: {
totalCount: 0, //
totalQty: 0, //
checkedQty: 0 //
} }
} }
}, },
@ -442,23 +520,92 @@ export default {
// //
viewDetail(row) { viewDetail(row) {
this.$message.info('盘点清单功能待开发')
// TODO:
this.detailFlag = true
this.detailSearchData = {
site: row.site,
buNo: row.buNo,
reportId: row.reportId,
rollNo: '',
partNo: '',
checkedFlag: ''
}
this.getDetailList()
},
//
getDetailList() {
this.detailLoading = true
countingReportDetailList(this.detailSearchData).then(({data}) => {
if (data && data.code === 0) {
this.detailList = data.detailList || []
//
this.calculateStatistics()
} else {
this.detailList = []
this.$message.error(data.msg || '查询失败')
}
this.detailLoading = false
}).catch(() => {
this.detailLoading = false
})
},
//
calculateStatistics() {
this.detailStatistics.totalCount = this.detailList.length
this.detailStatistics.totalQty = this.detailList.reduce((sum, item) => sum + (item.rollQty || 0), 0)
this.detailStatistics.checkedQty = this.detailList
.filter(item => item.checkedFlag === 'Y')
.reduce((sum, item) => sum + (item.rollQty || 0), 0)
}, },
// //
supplierBlur (tagNo) {
warehouseBlur (tagNo) {
let tempData = {
tagno: tagNo,
conditionSql: " and WareHouseID = '" + this.modalData.warehouseId + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
}
verifyData(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.warehouseId = data.baseListData[0].WareHouseID
this.modalData.warehouseName = data.baseListData[0].WareHouseName
} else {
this.modalData.warehouseName = ''
}
}
})
},
locationBlur (tagNo) {
let tempData = { let tempData = {
tagno: tagNo, tagno: tagNo,
conditionSql: " and SupplierID = '" + this.modalData.supplierId + "'" + " and site = '" + this.modalData.site + "'"
conditionSql: " and LocationID = '" + this.modalData.locationId + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
} }
verifyData(tempData).then(({data}) => { verifyData(tempData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
if (data.baseListData.length > 0) { if (data.baseListData.length > 0) {
this.modalData.supplierId = data.baseListData[0].SupplierID
this.modalData.supplierName = data.baseListData[0].SupplierName
this.modalData.locationId = data.baseListData[0].LocationID
this.modalData.locationName = data.baseListData[0].LocationName
} else { } else {
this.modalData.supplierName = ''
this.modalData.locationName = ''
}
}
})
},
partBlur (tagNo) {
let tempData = {
tagno: tagNo,
conditionSql: " and PartNo = '" + this.modalData.partNo + "'" + " and site = '" + this.modalData.bu.split('_')[0] + "'"
}
verifyData(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.partNo = data.baseListData[0].PartNo
this.modalData.partDesc = data.baseListData[0].PartDescription
} else {
this.modalData.partDesc = ''
} }
} }
}) })
@ -470,8 +617,16 @@ export default {
this.tagType = type this.tagType = type
this.$nextTick(() => { this.$nextTick(() => {
let strVal = '' let strVal = ''
if (val === 506) {
strVal = this.modalData.supplierId
if (val === 20) {
strVal = this.modalData.warehouseId
this.$refs.baseList.init(val, strVal)
}
if (val === 22) {
strVal = this.modalData.locationId
this.$refs.baseList.init(val, strVal)
}
if (val === 509) {
strVal = this.modalData.partNo
this.$refs.baseList.init(val, strVal) this.$refs.baseList.init(val, strVal)
} }
}) })
@ -479,9 +634,17 @@ export default {
// //
getBaseData (val) { getBaseData (val) {
if (this.tagNo === 506) {
this.modalData.supplierId = val.SupplierID
this.modalData.supplierName = val.SupplierName
if (this.tagNo === 20) {
this.modalData.warehouseId = val.WareHouseID
this.modalData.warehouseName = val.WareHouseName
}
if (this.tagNo === 22) {
this.modalData.locationId = val.LocationID
this.modalData.locationName = val.LocationName
}
if (this.tagNo === 509) {
this.modalData.partNo = val.PartNo
this.modalData.partDesc = val.PartDescription
} }
}, },
@ -495,3 +658,4 @@ export default {
Loading…
Cancel
Save