更新采购订单、发货、合同查询、盘点、入库和配置文件,新增零改单和文档
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user