更新采购订单、发货、合同查询、盘点、入库和配置文件,新增零改单和文档

This commit is contained in:
Developer
2026-06-26 08:13:30 +08:00
parent 0c8c6587bd
commit bb30ba76d0
21 changed files with 3290 additions and 50 deletions

View File

@@ -7,6 +7,7 @@
<el-input v-model="specificationsModel" style="width: 150px " size="small" clearable placeholder="图号或型号"/>
<el-input v-model="LocationName" style="width: 100px " size="small" clearable placeholder="库位"/>
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="pageCurrent=1;searchTable()">查询</el-button>
<el-button v-if="Number(token) === 2" type="success" plain icon="el-icon-download" size="small" style="margin-left: 7px" @click="exportExcel()">导出</el-button>
<el-button type="distribution" size="small" @click="addMaterial()">增加物料存货</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 20px" plain size="small" @click="Pronters()">批量打印</el-button>
<!--<el-button type="distribution" size="small" @click="addProduct()">增加通用存货</el-button>-->
@@ -56,7 +57,22 @@
</el-table-column>
<el-table-column width="90" label="库位" align="center" sortable="货位名称" prop="货位名称">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
<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>
<el-table-column label="批次编号" align="center" sortable="批次" prop="批次">
@@ -346,6 +362,27 @@ export default {
}
})
},
exportExcel() {
if (this.tableData.length === 0) {
this.$message.warning('暂无数据')
return
}
let materialName_check, specificationsModel_check, LocationName_check
this.materialName ? materialName_check = 1 : materialName_check = 0
this.specificationsModel ? specificationsModel_check = 1 : specificationsModel_check = 0
this.LocationName ? LocationName_check = 1 : LocationName_check = 0
var param = []
param[0] = ['物料名称_check', materialName_check]
param[1] = ['物料名称', this.materialName]
param[2] = ['图号或型号_check', specificationsModel_check]
param[3] = ['图号或型号', this.specificationsModel]
param[4] = ['库位_check', LocationName_check]
param[5] = ['库位', this.LocationName]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', this.order]
var Data = this.CreateData('2001', '仓储管理_库存盘点_查询', param)
this.exportExcel_NPOI(Data)
},
searchTable() {
this.loading = true
this.tableData = []
@@ -376,11 +413,14 @@ export default {
类型: response.data.rows[i].类型,
单位: response.data.rows[i].单位,
库存: response.data.rows[i].库存,
货位流水号: response.data.rows[i].货位流水号,
货位名称: response.data.rows[i].货位名称,
批次编号: response.data.rows[i].批次编号,
编辑人: response.data.rows[i].编辑人,
编辑时间: response.data.rows[i].编辑时间,
库存_before: response.data.rows[i].库存,
货位流水号_before: response.data.rows[i].货位流水号,
货位名称_before: response.data.rows[i].货位名称,
打印条码数: 1,
edit: false
})
@@ -502,12 +542,17 @@ export default {
})
},
confirmEdit(row) {
if (!row.货位流水号) {
this.$message.warning('请选择库位')
return
}
var param = []
param[0] = ['物料与货位流水号', row.物料与货位流水号]
param[1] = ['原数量', row.库存_before]
param[2] = ['更改后数量', row.库存]
param[3] = ['操作者', this.id]
param[4] = ['类型', row.类型]
param[5] = ['货位流水号', row.货位流水号]
var Data = this.CreateData('12', '仓储管理_库存盘点_货位数量_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
@@ -518,10 +563,21 @@ export default {
}
})
},
handleLocationChange(row) {
for (let i = 0; i < this.storageLocation.length; i++) {
if (this.storageLocation[i].value === row.货位流水号) {
row.货位名称 = this.storageLocation[i].label
return
}
}
row.货位名称 = ''
},
// 取消编辑
cancelEdit(index, row) {
row.edit = false
row.库存 = row.库存_before
row.货位流水号 = row.货位流水号_before
row.货位名称 = row.货位名称_before
this.$message('取消修改')
},
handleSizeChanges(val) {
@@ -545,4 +601,3 @@ export default {
}
}
</script>

View File

@@ -123,7 +123,7 @@
<template slot-scope="scope">
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
<el-option
v-for="item in locateName"
v-for="item in scope.row.locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
@@ -161,9 +161,9 @@
<el-input-number v-model="scope.row.打印条码数" :min="1" size="mini" style="margin: 0;width: 100%"/>
</template>
</el-table-column>
<el-table-column width="80px" label="操作" align="center" show-overflow-tooltip>
<el-table-column width="140px" label="操作" align="center" show-overflow-tooltip fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '编辑' }}</el-button>
<el-button type="text" size="small" @click="toggleRowEdit(scope.row)">{{ scope.row._editing ? '完成' : '库位' }}</el-button>
<el-button type="text" icon="el-icon-printer" size="small" @click="Pronter(scope.row)"/>
</template>
</el-table-column>
@@ -329,7 +329,7 @@
<template slot-scope="scope">
<el-select v-if="scope.row._editing" v-model="scope.row.货位流水号" style="width:100%" placeholder="选择库位" size="mini" filterable clearable @change="onLocateChange(scope.row)">
<el-option
v-for="item in locateName"
v-for="item in scope.row.locateName"
:key="item.value"
:label="item.label"
:value="item.value"/>
@@ -751,7 +751,6 @@ export default {
}
},
created() {
this.getLocateName()
this.getSupplierSelection()
this.getPeople()
this.getSelectTheOutsourcingManufacturers()
@@ -1058,10 +1057,90 @@ export default {
})
},
onLocateChange(row) {
var obj = this.locateName.find(function(item) {
var locateName = row.locateName || []
var obj = locateName.find(function(item) {
return item.value === row.货位流水号
})
row.货位名称 = obj ? obj.label : ''
this.$set(row, 'selectedLocate', obj || null)
},
confirmLocateChange(row) {
var locate = row.selectedLocate
if (!locate && row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
locate = this.getLocateItemByValue(row.locateName, row.货位流水号)
}
this.$set(row, '货位名称', locate ? locate.name : '')
this.$set(row, '货位流水号', locate ? String(locate.value) : '')
this.updateSelectedLocate(row)
},
getLocateItemByValue(locateName, value) {
var list = locateName || []
for (let i = 0; i < list.length; i++) {
if (String(list[i].value) === String(value)) {
return list[i]
}
}
return null
},
syncLocateValueByName(row) {
var locateName = row.locateName || []
for (let i = 0; i < locateName.length; i++) {
if (locateName[i].name === row.货位名称) {
this.$set(row, '货位流水号', String(locateName[i].value))
return
}
}
},
updateSelectedLocate(row) {
for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i] === row) {
this.multipleSelection[i].货位流水号 = row.货位流水号
this.multipleSelection[i].货位名称 = row.货位名称
}
}
for (let i = 0; i < this.multipleSelection2.length; i++) {
if (this.multipleSelection2[i] === row) {
this.multipleSelection2[i].货位流水号 = row.货位流水号
this.multipleSelection2[i].货位名称 = row.货位名称
}
}
this.refreshReturnsLocate(row)
},
refreshReturnsLocate(row) {
for (let i = 0; i < this.returns.length; i++) {
if (this.returns[i].物料编码 === row.物料编码 && this.returns[i].物料名称 === row.物料名称 && this.returns[i].规格型号 === row.图号或型号) {
this.returns[i].库位 = row.货位名称
}
}
},
getInventoryLocateName(row) {
var materialName = row.物料名称 || row.零件名称 || ''
var specificationsModel = row.图号或型号 || row.零件图号 || ''
let materialName_check, specificationsModel_check
materialName ? materialName_check = 1 : materialName_check = 0
specificationsModel ? specificationsModel_check = 1 : specificationsModel_check = 0
var param = []
param[0] = ['物料名称_check', materialName_check]
param[1] = ['物料名称', materialName]
param[2] = ['图号或型号_check', specificationsModel_check]
param[3] = ['图号或型号', specificationsModel]
param[4] = ['库位_check', 0]
param[5] = ['库位', '']
param[6] = ['排序名称', '']
param[7] = ['排序方式', '']
var Data = this.CreateData('11', '仓储管理_库存盘点_查询', param)
this.ExecDatabase(Data).then(response => {
var locateName = []
var data = response.data.rows || response.data
for (let i = 0; i < data.length; i++) {
var inventory = data[i].库存 || data[i].货位存量 || 0
locateName.push({
label: data[i].货位名称 + '(库存:' + inventory + ')',
name: data[i].货位名称,
value: String(data[i].货位流水号)
})
}
this.$set(row, 'locateName', locateName)
})
},
getData() {
if (this.PartType === '采购入库') {
@@ -1119,6 +1198,8 @@ export default {
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
row.货位流水号 = String(row.货位流水号)
}
this.$set(row, 'locateName', [])
this.$set(row, 'selectedLocate', null)
this.$set(row, '_editing', false)
}
if (this.tableData1.length === 0) {
@@ -1141,7 +1222,13 @@ export default {
}.bind(this))
},
toggleRowEdit(row) {
this.$set(row, '_editing', !row._editing)
if (row._editing) {
this.confirmLocateChange(row)
this.$set(row, '_editing', false)
} else {
this.$set(row, '_editing', true)
this.getInventoryLocateName(row)
}
},
submitInStorage() {
// this.exportTable()
@@ -1171,6 +1258,7 @@ export default {
this.multipleSelection_variable = this.multipleSelection
this.multipleSelection = []
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
this.syncLocateValueByName(this.multipleSelection_variable[i])
if (!this.multipleSelection_variable[i].货位流水号 && this.multipleSelection_variable[i].货位流水号 !== 0) {
this.$message.warning('存在未绑定货位的物料')
return
@@ -1285,6 +1373,8 @@ export default {
if (row.货位流水号 !== null && row.货位流水号 !== undefined && row.货位流水号 !== '') {
row.货位流水号 = String(row.货位流水号)
}
this.$set(row, 'locateName', [])
this.$set(row, 'selectedLocate', null)
this.$set(row, '_editing', false)
}
})
@@ -1307,6 +1397,7 @@ export default {
this.multipleSelection_variable2 = this.multipleSelection2
this.multipleSelection2 = []
for (let i = 0; i < this.multipleSelection_variable2.length; i++) {
this.syncLocateValueByName(this.multipleSelection_variable2[i])
if (!this.multipleSelection_variable2[i].货位流水号 && this.multipleSelection_variable2[i].货位流水号 !== 0) {
this.$message.warning('存在未绑定货位的物料')
return