Commit fd322d84 authored by jingnan's avatar jingnan 👀

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

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