Commit fd322d84 authored by jingnan's avatar jingnan 👀

采购入库新建时导入不显示及保存不生效,台账验收单号点击弹框报错修改

parent 78b7ffe8
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
}, },
methods: { methods: {
getInventoryRequest(id) { getInventoryRequest(id) {
if (!id) return
get(`InventoryRequest/${id}`).then(res => { get(`InventoryRequest/${id}`).then(res => {
const type = res.items.billType const type = res.items.billType
// switch (type) { // switch (type) {
...@@ -80,6 +81,7 @@ export default { ...@@ -80,6 +81,7 @@ export default {
// this.initData('OutSource') // this.initData('OutSource')
// break // break
// } // }
if (!type) return this.$utils.showMessageWarning('未查询到验收单信息!')
this.initData(type) this.initData(type)
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
} else { } else {
post('/InventoryRequest/batch/recursionAdd', this.param).then(res => { post('/InventoryRequest/batch/recursionAdd', this.param).then(res => {
if (res.items.id) { if (res.items.id) {
this.upLoadExcel(res.items.id) this.upLoadExcel(res.items.id, 'newData')
} }
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
...@@ -118,13 +118,14 @@ export default { ...@@ -118,13 +118,14 @@ export default {
} }
}, },
// 上传excel // 上传excel
upLoadExcel(id) { upLoadExcel(id, isNew) {
const formData = new FormData() const formData = new FormData()
formData.append('file', this.file.raw) formData.append('file', this.file.raw)
this.$api.apiUploadFile(`/InStorageRequestItem/importByExcel?id=${id}`, formData).then(res => { // 调用接口 this.$api.apiUploadFile(`/InStorageRequestItem/importByExcel?id=${id}`, formData).then(res => { // 调用接口
this.uploading = false this.uploading = false
this.$utils.showMessageSuccess(res.data.message) this.$utils.showMessageSuccess(res.data.message)
this.$emit('refreshTable') const reqId = isNew ? id : null
this.$emit('refreshTable', reqId)
this.close() this.close()
}).catch(err => { }).catch(err => {
this.uploading = false this.uploading = false
......
...@@ -470,7 +470,8 @@ export default { ...@@ -470,7 +470,8 @@ export default {
tableParam: [], tableParam: [],
operator: null, operator: null,
addData: {}, addData: {},
emptyContent: { 'icon': '/icons/dee-doc/noData.png', 'text': '暂无数据' } emptyContent: { 'icon': '/icons/dee-doc/noData.png', 'text': '暂无数据' },
newDataImportResId: '' // 初次创建申请单导入时返回的id
} }
}, },
computed: { computed: {
...@@ -645,7 +646,8 @@ export default { ...@@ -645,7 +646,8 @@ export default {
}) })
}, },
// 编辑采购入库明细查询InStorageRequestItem/search // 编辑采购入库明细查询InStorageRequestItem/search
searchInStorageRequestItem() { searchInStorageRequestItem(id) {
this.newDataImportResId = id
const param = { const param = {
'rootCondition': { 'rootCondition': {
'pageFrom': this.pagination.currentPage, 'pageFrom': this.pagination.currentPage,
...@@ -657,7 +659,7 @@ export default { ...@@ -657,7 +659,7 @@ export default {
{ {
'fieldName': 'inventoryReq.id', 'fieldName': 'inventoryReq.id',
'operator': 'EQ', 'operator': 'EQ',
'value': this.currBasicData.id 'value': id || this.currBasicData.id
}, },
{ {
'fieldName': 'isRoot', 'fieldName': 'isRoot',
...@@ -828,8 +830,9 @@ export default { ...@@ -828,8 +830,9 @@ export default {
}) })
const isVirtualHasChild = tableData.find(item => item.isVirtual && (!item.children || !item.children.length || item.children && !(item.children.find(child => child.operator !== 'REMOVE')))) const isVirtualHasChild = tableData.find(item => item.isVirtual && (!item.children || !item.children.length || item.children && !(item.children.find(child => child.operator !== 'REMOVE'))))
if (isVirtualHasChild) return this.$utils.showMessageWarning('父件为虚拟件时,必须添加子件!') if (isVirtualHasChild) return this.$utils.showMessageWarning('父件为虚拟件时,必须添加子件!')
const paramOperator = this.newDataImportResId ? 'MODIFY' : this.operator
const param = { const param = {
'operator': this.operator, 'operator': paramOperator,
'billType': this.form.billType, 'billType': this.form.billType,
'arrivalDate': this.form.arrivalDate, 'arrivalDate': this.form.arrivalDate,
'materialTypeIdType': 'ExtDxProcessResourceType', 'materialTypeIdType': 'ExtDxProcessResourceType',
...@@ -842,8 +845,8 @@ export default { ...@@ -842,8 +845,8 @@ export default {
'materialTypeId': this.form.materialTypeId, 'materialTypeId': this.form.materialTypeId,
'inStorageRequestItems': tableData 'inStorageRequestItems': tableData
} }
if (this.operator === 'MODIFY') { if (paramOperator === 'MODIFY') {
param.id = this.form.id param.id = this.newDataImportResId || this.form.id
} }
post('/InventoryRequest/batch/recursionAdd', param).then(res => { post('/InventoryRequest/batch/recursionAdd', param).then(res => {
this.$utils.showMessageSuccess('保存成功') this.$utils.showMessageSuccess('保存成功')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment