更新工序工价、库存查询、库位、领料、出库明细、入库等仓储模块,新增采购合同入库单移动端设计及SQL脚本

This commit is contained in:
Developer
2026-07-23 08:45:50 +08:00
parent 2b9058c69c
commit 33549c3787
17 changed files with 1124 additions and 46 deletions

View File

@@ -450,24 +450,53 @@ export default {
'id'
])
},
watch: {
// 修改人:Ld 修改时间:2026-07-17 16:30:55; 同一路由再次跳转时组件会复用,监听 query 变化后重新赋值并查询
'$route.query': function(query) {
this.applyJumpQuery(query)
}
},
created() {
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 支持从工时统计跳转后按携带值直接查询工价
if (this.$route.query.订单号) {
this.jumpQuery订单号 = this.$route.query.订单号
}
if (this.$route.query.零件名称 || this.$route.query.图号 || this.$route.query.工序名称) {
this.queryForm.零件名称 = this.$route.query.零件名称 || ''
this.queryForm.图号 = this.$route.query.图号 || ''
this.queryForm.工序名称 = this.$route.query.工序名称 || ''
this.jumpDirectQuery = true
}
this.applyJumpQuery(this.$route.query, true)
this.getOrderNumberType()
if (this.jumpDirectQuery) {
this.pageCurrent = 1
}
this.searchTable()
},
methods: {
// 修改人:Ld 修改时间:2026-07-17 16:30:55; 统一处理工时统计跳转参数,避免再次跳转时保留上一次查询条件
applyJumpQuery(query) {
if (!query || (!query.订单号 && !query.零件名称 && !query.图号 && !query.工序名称)) {
return
}
this.jumpQuery订单号 = query.订单号 || ''
this.jumpDirectQuery = !!(query.零件名称 || query.图号 || query.工序名称)
this.jumpAutoCascade = false
if (this.jumpDirectQuery) {
this.queryForm.组件流水号 = ''
this.queryForm.工艺计划流水号 = ''
this.queryForm.零件名称 = query.零件名称 || ''
this.queryForm.图号 = query.图号 || ''
this.queryForm.工序名称 = query.工序名称 || ''
this.productName = []
this.partName = []
}
this.setJumpOrderValue()
this.pageCurrent = 1
this.searchTable()
},
// 修改人:Ld 修改时间:2026-07-17 16:30:55; 已加载订单下拉时,按跳转订单号补充订单流水号
setJumpOrderValue() {
if (!this.jumpQuery订单号 || !this.orderNumberType || this.orderNumberType.length === 0) {
return false
}
for (var i = 0; i < this.orderNumberType.length; i++) {
if (this.orderNumberType[i].label === this.jumpQuery订单号) {
this.queryForm.订单流水号 = this.orderNumberType[i].value
this.jumpQuery订单号 = ''
return true
}
}
return false
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 获取制定工艺组件同源订单下拉
getOrderNumberType() {
@@ -481,21 +510,14 @@ export default {
value: response.data[i].订单流水号
})
}
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 跳转携带明细条件时仅补充订单赋值并按当前条件查询,避免自动选中第一个零件覆盖查询条件
if (this.jumpQuery订单号) {
for (var j = 0; j < this.orderNumberType.length; j++) {
if (this.orderNumberType[j].label === this.jumpQuery订单号) {
this.queryForm.订单流水号 = this.orderNumberType[j].value
if (this.jumpDirectQuery) {
this.pageCurrent = 1
this.searchTable()
} else {
this.jumpAutoCascade = true
this.getproductName()
}
this.jumpQuery订单号 = ''
break
}
// 修改人:Ld 修改时间:2026-07-17 16:30:55; 订单下拉异步加载完成后补充订单流水号,再按跳转条件查询
if (this.setJumpOrderValue()) {
if (this.jumpDirectQuery) {
this.pageCurrent = 1
this.searchTable()
} else {
this.jumpAutoCascade = true
this.getproductName()
}
}
})

View File

@@ -478,22 +478,36 @@ export default {
},
getInventoryLocationRows(row) {
var param = []
var materialName_check = row.物料名称 ? 1 : 0
var specificationsModel_check = row.图号或型号 ? 1 : 0
param[0] = ['物料名称_check', materialName_check]
param[1] = ['物料名称', row.物料名称]
param[2] = ['图号或型号_check', specificationsModel_check]
param[3] = ['图号或型号', row.图号或型号]
var materialCode_check = row.物料编码 ? 1 : 0
param[0] = ['物料名称_check', 0]
param[1] = ['物料名称', '']
param[2] = ['图号或型号_check', 0]
param[3] = ['图号或型号', '']
param[4] = ['库位_check', 0]
param[5] = ['库位', '']
param[6] = ['排序名称', '']
param[7] = ['排序方式', '']
param[8] = ['物料编码_check', materialCode_check]
param[9] = ['物料编码', row.物料编码 || '']
var Data = this.CreateData('11', '仓储管理_库存盘点_查询', param)
return this.ExecDatabase(Data).then(response => {
var rows = response.data.rows || response.data || []
// 备注:修改人:Ld 修改时间:2026-07-15 17:14:07; 库存小窗只显示有库存的库位和对应数量。
return rows.filter(function(item) {
return Number(item.货位存量 || item.库存 || 0) > 0
var locationMap = {}
// 备注:修改人:Ld 修改时间:2026-07-17 17:23:23; 库存小窗按物料编码精确过滤并按库位汇总,避免同名称或相似图号物料混入。
rows.filter(function(item) {
return (!row.物料编码 || item.物料编码 === row.物料编码) && Number(item.货位存量 || item.库存 || 0) > 0
}).forEach(function(item) {
var locationName = item.货位名称 || ''
if (!locationMap[locationName]) {
locationMap[locationName] = {
货位名称: locationName,
货位存量: 0
}
}
locationMap[locationName].货位存量 = Number(locationMap[locationName].货位存量) + Number(item.货位存量 || item.库存 || 0)
})
return Object.keys(locationMap).map(function(key) {
return locationMap[key]
})
})
},

View File

@@ -7,11 +7,24 @@
<el-input v-model="DrawingNo" style="width: 200px " size="small" clearable placeholder="图号/型号"/>
<el-input v-model="locationWarehouseValue" style="width:200px" placeholder="库位" size="small" clearable/>
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="searchTable()">查询</el-button>
<!-- 修改人:Ld 修改时间:2026-07-22 10:17:30; 新增按Excel批量修改物料库位入口。 -->
<el-button type="primary" icon="el-icon-upload2" style="margin-left: 7px" plain size="small" @click="openImportLocationDialog">导入修改库位</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 7px" plain size="small" @click="printReceiptDoc1()">打印</el-button>
</div>
<div>
<el-table ref="table" v-loading="loading" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 731px" height="740px"
@selection-change="handleSelectionChange">
<!-- 修改人:Ld 修改时间:2026-07-22 09:59:17; 扩展表格宽度容纳修改库位操作列。 -->
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 880px"
height="740px"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="50px"/>
<el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/>
<el-table-column label="物料编码" align="center" show-overflow-tooltip><!-- 备注:修改人:Ld 修改时间:2026-06-29 14:24:00 -->
@@ -31,7 +44,31 @@
</el-table-column>
<el-table-column label="库位" width="160px" align="center">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
<!-- 修改人:Ld 修改时间:2026-07-22 09:59:17; 物料库位维护支持行内选择新库位。 -->
<el-select
v-if="scope.row.edit"
v-model="scope.row.货位流水号"
size="mini"
style="width: 100%"
clearable
filterable
placeholder="请选择库位"
@change="handleLocationChange(scope.row)">
<el-option
v-for="item in storageLocation"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span v-else>{{ scope.row.货位名称 }}</span>
</template>
</el-table-column>
<!-- 修改人:Ld 修改时间:2026-07-22 09:59:17; 物料库位维护新增修改库位操作按钮。 -->
<el-table-column label="操作" width="130px" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" type="text" size="mini" @click="cancelEdit(scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" @click="openEdit(scope.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
@@ -47,6 +84,43 @@
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<!-- 修改人:Ld 修改时间:2026-07-22 10:17:30; 导入物料库位修改预校验与提交弹窗。 -->
<el-dialog
v-el-drag-dialog
:visible.sync="dialogFormVisibleImportLocation"
title="导入修改库位"
center
width="1050px">
<upload-excel-component @on-selected-file="selectedImportLocation"/>
<div style="margin: 10px 0 0 45px">
<span v-show="importWorksheet.length > 1" style="cursor: pointer;width: 50px;" @click="removeAllImportLocation"><i class="el-icon-close"/></span>
<el-upload :on-remove="handleRemoveImportLocation" :file-list="importItemFile" style="width: 260px" action=""/>
</div>
<div style="margin: 12px 0">
<el-button type="primary" size="small" icon="el-icon-search" @click="previewImportLocation">预校验</el-button>
<el-button
:loading="importLocationSubmitting"
:disabled="importLocationData.length === 0"
type="success"
size="small"
icon="el-icon-check"
@click="submitImportLocation">确认修改</el-button>
<span style="margin-left: 12px;font-size: 13px;color: #606266">{{ importLocationSummary }}</span>
</div>
<el-table :data="importLocationData" border stripe size="mini" height="430px">
<el-table-column prop="导入序号" label="行号" width="70px" align="center"/>
<el-table-column prop="物料编码" label="物料编号" width="130px" align="center" show-overflow-tooltip/>
<el-table-column prop="物料名称" label="物料名称" width="160px" align="center" show-overflow-tooltip/>
<el-table-column prop="图号或型号" label="图号或型号" width="150px" align="center" show-overflow-tooltip/>
<el-table-column prop="原货位名称" label="原库位" width="100px" align="center" show-overflow-tooltip/>
<el-table-column prop="调整后库位" label="调整后库位" width="120px" align="center" show-overflow-tooltip/>
<el-table-column prop="处理状态" label="状态" width="100px" align="center"/>
<el-table-column prop="说明" label="说明" align="center" show-overflow-tooltip/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisibleImportLocation=false">关闭</el-button>
</div>
</el-dialog>
<el-card v-show="false">
<div style="width:900px;margin-left: 350px">
<el-card>
@@ -92,7 +166,9 @@ import { ExecDatabase } from '@/main'
import { mapGetters } from 'vuex'
import $ from 'jquery'
import { getNowDAY } from '@/utils'
import UploadExcelComponent from '@/views/TechnologyCenter/ImportBOM/UploadExcel/index.vue'
export default {
components: { UploadExcelComponent },
data() {
return {
NowTime: getNowDAY(),
@@ -102,6 +178,13 @@ export default {
MaterialCode: '',
MaterialName: '',
DrawingNo: '',
dialogFormVisibleImportLocation: false, // 修改人:Ld 修改时间:2026-07-22 10:17:30; 导入修改库位弹窗。
importItemFile: [],
importWorksheet: [],
importLocationData: [],
importLocationDetailText: '',
importLocationDetailChunks: [],
importLocationSubmitting: false,
LocationName: '',
materialName1: '',
productName: [],
@@ -110,6 +193,7 @@ export default {
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData10: [], // 合同信息表
storageLocation: [], // 修改人:Ld 修改时间:2026-07-22 09:59:17; 库位下拉数据用于修改物料库位。
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
@@ -120,12 +204,320 @@ export default {
...mapGetters([
'id',
'token'
])
]),
importLocationSummary() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 汇总导入修改库位预校验和执行结果。
if (this.importLocationData.length === 0) {
return ''
}
var map = {}
for (let i = 0; i < this.importLocationData.length; i++) {
var status = this.importLocationData[i].处理状态 || '未知'
map[status] = (map[status] || 0) + 1
}
var text = []
for (var key in map) {
text.push(key + ':' + map[key])
}
return '共' + this.importLocationData.length + '行,' + text.join(',')
}
},
created() {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 页面初始化时加载库位列表,供修改按钮使用。
this.getLocateName()
this.searchTable()
},
methods: {
openImportLocationDialog() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 打开导入修改库位弹窗并清空上次预览。
this.dialogFormVisibleImportLocation = true
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
},
selectedImportLocation(data) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 接收Excel上传组件解析出的工作表。
this.importWorksheet = data.worksheet
this.importItemFile = data.itemFile
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
},
handleRemoveImportLocation(file) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 移除导入文件时同步移除工作表数据。
for (let i = 0; i < this.importItemFile.length; i++) {
if (this.importItemFile[i].name === file.name) {
this.importWorksheet.splice(i, 1)
this.importItemFile.splice(i, 1)
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
}
}
},
removeAllImportLocation() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 清空所有待导入文件。
this.importWorksheet = []
this.importItemFile = []
this.importLocationData = []
this.importLocationDetailText = ''
this.importLocationDetailChunks = []
},
getExcelCellValue(sheet, col, row) {
var cell = sheet[col + row]
if (!cell || cell.v === undefined || cell.v === null) {
return ''
}
return String(cell.v).trim()
},
getImportLocationColumns(sheet) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 自动识别物料编号、物料名称、图号型号、调整后库位和库存列。
var cols = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
var result = {
headerRow: 1,
materialCodeCol: 'A',
materialNameCol: 'B',
drawingCol: 'C',
locationCol: 'E',
inventoryCol: 'F'
}
for (let row = 1; row <= 10; row++) {
let materialCodeCol = ''
let materialNameCol = ''
let drawingCol = ''
let locationCol = ''
let inventoryCol = ''
for (let i = 0; i < cols.length; i++) {
var title = this.getExcelCellValue(sheet, cols[i], row).replace(/\s/g, '')
if (title === '物料编号' || title === '物料编码') {
materialCodeCol = cols[i]
}
if (title === '物料名称' || title === '名称' || title === '零件名称') {
materialNameCol = cols[i]
}
if (title === '图号型号' || title === '图号' || title === '图号或型号' || title === '图号/型号' || title === '规格型号') {
drawingCol = cols[i]
}
if (title === '调整后库位' || title === '库位') {
locationCol = cols[i]
}
if (title === '库存' || title === '库存数') {
inventoryCol = cols[i]
}
}
if (materialCodeCol || materialNameCol || drawingCol || locationCol || inventoryCol) {
result.headerRow = row
result.materialCodeCol = materialCodeCol || result.materialCodeCol
result.materialNameCol = materialNameCol || result.materialNameCol
result.drawingCol = drawingCol || result.drawingCol
result.locationCol = locationCol || result.locationCol
result.inventoryCol = inventoryCol || result.inventoryCol
return result
}
}
return result
},
getImportLocationDetail() {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 提取Excel中的物料编号、物料名称、图号型号、调整后库位和库存。
var detail = []
for (let j = 0; j < this.importWorksheet.length; j++) {
var sheet = this.importWorksheet[j]
var columns = this.getImportLocationColumns(sheet)
var emptyCount = 0
for (let row = columns.headerRow + 1; row <= 6000; row++) {
var materialCode = this.getExcelCellValue(sheet, columns.materialCodeCol, row)
var materialName = this.getExcelCellValue(sheet, columns.materialNameCol, row)
var drawing = this.getExcelCellValue(sheet, columns.drawingCol, row)
var locationName = this.getExcelCellValue(sheet, columns.locationCol, row)
var inventory = this.getExcelCellValue(sheet, columns.inventoryCol, row)
if (!materialCode && !materialName && !drawing && !locationName && !inventory) {
emptyCount++
if (emptyCount >= 20) {
break
}
continue
}
emptyCount = 0
detail.push({
行号: row,
物料编码: materialCode,
物料名称: materialName,
图号或型号: drawing,
调整后库位: locationName,
库存: inventory
})
}
}
return detail
},
getImportLocationInventoryValue(value) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 多库位时按Excel库存数比较大小。
var num = Number(value)
if (isNaN(num)) {
return 0
}
return num
},
getImportLocationBestDetail(detail) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 同一物料多库位时保留库存数最大的库位行。
var map = {}
var list = []
for (let i = 0; i < detail.length; i++) {
var materialCode = String(detail[i].物料编码 || '').trim()
var materialName = String(detail[i].物料名称 || '').trim()
var drawing = String(detail[i].图号或型号 || '').trim()
var key = materialCode || (materialName + '^' + drawing)
if (!key) {
key = 'ROW-' + detail[i].行号
}
if (!map[key]) {
map[key] = detail[i]
list.push(detail[i])
} else if (this.getImportLocationInventoryValue(detail[i].库存) > this.getImportLocationInventoryValue(map[key].库存)) {
var index = list.indexOf(map[key])
map[key] = detail[i]
if (index >= 0) {
list.splice(index, 1, detail[i])
}
}
}
return list
},
buildImportLocationDetailText(detail) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 将导入明细转为后端批量过程可解析的字符串。
var list = []
var usedMap = {}
for (let i = 0; i < detail.length; i++) {
var materialCode = String(detail[i].物料编码 || '').replace(/\^|\|\|/g, '').trim()
var materialName = String(detail[i].物料名称 || '').replace(/\^|\|\|/g, '').trim()
var drawing = String(detail[i].图号或型号 || '').replace(/\^|\|\|/g, '').trim()
var locationName = String(detail[i].调整后库位 || '').replace(/\^|\|\|/g, '').trim()
var inventory = String(detail[i].库存 || '').replace(/\^|\|\|/g, '').trim()
var key = materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory
if (!usedMap[key]) {
usedMap[key] = true
list.push(detail[i].行号 + '^' + materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory)
}
}
return list.join('||')
},
buildImportLocationDetailChunks(detail) {
// 修改人:Ld 修改时间:2026-07-23 08:24:55; 大表分批提交,避免单次参数过长。
var chunks = []
var chunk = []
var usedMap = {}
for (let i = 0; i < detail.length; i++) {
var materialCode = String(detail[i].物料编码 || '').replace(/\^|\|\|/g, '').trim()
var materialName = String(detail[i].物料名称 || '').replace(/\^|\|\|/g, '').trim()
var drawing = String(detail[i].图号或型号 || '').replace(/\^|\|\|/g, '').trim()
var locationName = String(detail[i].调整后库位 || '').replace(/\^|\|\|/g, '').trim()
var inventory = String(detail[i].库存 || '').replace(/\^|\|\|/g, '').trim()
var key = materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory
if (!usedMap[key]) {
usedMap[key] = true
chunk.push(detail[i].行号 + '^' + materialCode + '^' + materialName + '^' + drawing + '^' + locationName + '^' + inventory)
if (chunk.length >= 500) {
chunks.push(chunk.join('||'))
chunk = []
}
}
}
if (chunk.length > 0) {
chunks.push(chunk.join('||'))
}
return chunks
},
requestImportLocationPreview(index, rows) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 分批调用预校验过程并合并展示。
if (index >= this.importLocationDetailChunks.length) {
this.importLocationData = rows
this.loading = false
this.$message.success('预校验完成')
return
}
var param = []
param[0] = ['导入明细', this.importLocationDetailChunks[index]]
var Data = this.CreateData('11', '仓储管理_物料库位_导入修改库位_预校验', param)
ExecDatabase(Data).then(response => {
var data = response.data.rows || response.data || []
this.requestImportLocationPreview(index + 1, rows.concat(data))
}).catch(() => {
this.loading = false
})
},
previewImportLocation() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 上传后先预校验物料和库位变化。
var detail = this.getImportLocationDetail()
if (detail.length === 0) {
this.$message.warning('请导入包含物料编号和调整后库位的表格')
return
}
var validDetail = this.getImportLocationBestDetail(detail)
this.importLocationDetailText = this.buildImportLocationDetailText(validDetail)
this.importLocationDetailChunks = this.buildImportLocationDetailChunks(validDetail)
this.loading = true
if (this.importLocationDetailChunks.length === 0) {
this.importLocationData = []
this.loading = false
this.$message.warning('导入表中没有可提交的数据')
return
}
this.requestImportLocationPreview(0, [])
},
requestImportLocationSubmit(index, rows) {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 分批执行物料库位修改并合并返回结果。
if (index >= this.importLocationDetailChunks.length) {
this.importLocationData = rows
this.importLocationSubmitting = false
this.$message.success('导入修改完成')
this.getLocateName()
this.searchTable()
return
}
var param = []
param[0] = ['导入明细', this.importLocationDetailChunks[index]]
param[1] = ['修改人', this.id]
var Data = this.CreateData('12', '仓储管理_物料库位_导入修改库位_批量执行', param)
ExecDatabase(Data).then(response => {
var data = response.data.rows || response.data || []
this.requestImportLocationSubmit(index + 1, rows.concat(data))
}).catch(() => {
this.importLocationSubmitting = false
})
},
submitImportLocation() {
// 修改人:Ld 修改时间:2026-07-22 10:17:30; 确认后批量新建缺失库位并修改物料库位。
if (this.importLocationDetailChunks.length === 0) {
this.$message.warning('请先预校验')
return
}
this.$confirm('确认按导入表修改物料库位吗?缺失库位将自动新建。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.importLocationSubmitting = true
this.requestImportLocationSubmit(0, [])
}).catch(() => {})
},
getLocateName() {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 复用库位管理查询接口加载可选库位。
this.storageLocation = []
var param = []
var Data = this.CreateData('11', '仓储管理_库位_查询', param)
ExecDatabase(Data).then(response => {
var rows = response.data.rows || response.data || []
for (let i = 0; i < rows.length; i++) {
this.storageLocation.push({
label: rows[i].货位名称,
value: Number(rows[i].货位流水号)
})
}
})
},
searchTable() {
this.loading = true
this.tableData10 = []
@@ -156,6 +548,7 @@ export default {
物料名称: response.data.rows[i].名称,
图号或型号: response.data.rows[i].代号,
物料编号: response.data.rows[i].物料编码,
货位流水号_before: Number(response.data.rows[i].货位流水号), // 修改人:Ld 修改时间:2026-07-22 09:59:17; 保存修改前库位流水号用于取消和日志。
货位名称_before: response.data.rows[i].货位名称,
edit: false
})
@@ -179,6 +572,57 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val
},
openEdit(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 进入行内库位修改状态并备份原值。
row.货位流水号_before = row.货位流水号
row.货位名称_before = row.货位名称
row.edit = true
if (this.storageLocation.length === 0) {
this.getLocateName()
}
},
handleLocationChange(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 下拉切换时同步展示库位名称。
row.货位名称 = ''
for (let i = 0; i < this.storageLocation.length; i++) {
if (Number(this.storageLocation[i].value) === Number(row.货位流水号)) {
row.货位名称 = this.storageLocation[i].label
return
}
}
},
confirmEdit(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 保存物料库位修改并同步后端物料库位关系。
if (!row.货位流水号) {
this.$message.warning('请选择库位')
return
}
if (Number(row.货位流水号) === Number(row.货位流水号_before)) {
this.$message.warning('库位未变化')
row.edit = false
return
}
var param = []
param[0] = ['物料流水号', row.物料流水号]
param[1] = ['货位流水号', row.货位流水号]
param[2] = ['原货位流水号', row.货位流水号_before]
param[3] = ['修改人', this.id]
var Data = this.CreateData('12', '仓储管理_物料库位_编辑数据', param)
ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchTable()
} else {
this.$message.error(response.data[0].msg || '修改失败')
}
})
},
cancelEdit(row) {
// 修改人:Ld 修改时间:2026-07-22 09:59:17; 取消修改时恢复原库位。
row.货位流水号 = row.货位流水号_before
row.货位名称 = row.货位名称_before
row.edit = false
},
async printReceiptDoc1() {
const aa = this.printReceiptDoc()
if (aa === 2) {

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-card style="height: 1850px;padding: 0">
<el-card style="height: 850px;padding: 0">
<el-tabs v-model="PartType" type="border-card">
<el-tab-pane label="生产领料" name="生产领料">
<el-row>
@@ -127,7 +127,7 @@
</el-table-column>
<el-table-column width="136px" label="操作" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-popover placement="right" width="535" trigger="click">
<el-popover placement="right" width="650" trigger="click">
<el-table :data="gridData" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号">
@@ -135,6 +135,12 @@
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<!-- 备注:修改人:Ld 修改时间:2026-07-20 16:23:04; 出库批次小窗库位列按货位流水号对应的库位号显示。 -->
<el-table-column width="110px" align="center" label="库位" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.库位号 || scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存" prop="货位存量">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
@@ -264,7 +270,7 @@
</el-table-column>
<el-table-column width="171px" label="操作" align="center">
<template slot-scope="scope">
<el-popover placement="right" width="880px" trigger="click">
<el-popover placement="right" width="990px" trigger="click">
<el-table :data="gridData1" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号">
@@ -272,6 +278,12 @@
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<!-- 备注:修改人:Ld 修改时间:2026-07-20 16:23:04; 耗材出库批次小窗库位列按货位流水号对应的库位号显示。 -->
<el-table-column width="110px" align="center" label="库位" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.库位号 || scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存" prop="货位存量">
<template slot-scope="scope">
{{ scope.row.货位存量 }}

View File

@@ -164,7 +164,7 @@
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
<el-dialog :visible.sync="batchDialogVisible" title="批次选择" width="600px" @close="closeBatchDialog">
<el-dialog :visible.sync="batchDialogVisible" title="批次选择" width="720px" @close="closeBatchDialog">
<el-table :data="batchData" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号">
@@ -172,6 +172,12 @@
{{ batchScope.row.批次编号 }}
</template>
</el-table-column>
<!-- 备注:修改人:Ld 修改时间:2026-07-20 16:23:04; 批次选择小窗库位列按货位流水号对应的库位号显示。 -->
<el-table-column width="110px" align="center" label="库位" show-overflow-tooltip>
<template slot-scope="batchScope">
{{ batchScope.row.库位号 || batchScope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存">
<template slot-scope="batchScope">
{{ batchScope.row.货位存量 }}

View File

@@ -850,6 +850,8 @@ export default {
return
}
this.supplierSelectionValue = row.供应商流水号
// 修改人:Ld 修改时间:2026-07-22 09:05:29; 入库单查看后保留采购单号,供入库打印模板展示。
this.contractNumber = row.采购合同号 || row.采购合同编号 || ''
this.getContractState()
this.$nextTick(() => {
this.contractStateValue = row.采购合同流水号
@@ -1313,6 +1315,8 @@ export default {
this.$message.warning('只能选择一个合同的物料')
return
}
// 修改人:Ld 修改时间:2026-07-22 09:05:29; 入库按钮打印前从勾选明细兜底同步采购单号。
this.contractNumber = this.multipleSelection[0].采购合同编号 || this.multipleSelection[0].采购合同号 || this.contractNumber
console.log(this.multipleSelection)
// if (this.contractStateValue) {
if (this.multipleSelection.length !== 0) {

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-card style="height: 870px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input
v-model="入库单号Value"