Commit afeb683d authored by jingnan's avatar jingnan 👀

采购入库bug修改

parent c272fd63
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-remove="handleRemove" :on-remove="handleRemove"
> >
<el-button size="small" style="width: 400px; text-align: right"> <el-button type="primary" size="small" style="width: 400px; text-align: center">
<i class="fa fa-folder-open-o" /> <!-- <i class="fa fa-folder-open-o" /> -->
选择待上传文件
</el-button> </el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
*/ */
<template> <template>
<div class="storageDetails-create"> <div class="storageDetails-create">
<dee-dialog :dialog-visible="dialogVisibleDetails" title="采购入库申请创建" width="90%" @handleClose="handleClose"> <dee-dialog v-if="dialogVisibleDetails" :dialog-visible="dialogVisibleDetails" title="采购入库申请创建" width="90%" @handleClose="handleClose">
<dee-form <dee-form
ref="form" ref="form"
:form="form" :form="form"
...@@ -323,7 +323,7 @@ export default { ...@@ -323,7 +323,7 @@ export default {
delete row.id delete row.id
this.form = JSON.parse(JSON.stringify(row)) this.form = JSON.parse(JSON.stringify(row))
this.$set(this.form, 'supplier', row.extDxSipplierId) this.$set(this.form, 'supplier', row.extDxSipplierId)
this.$set(this.form, 'withProductMaterial', Array.isArray(row.withProductMaterial) ? row.withProductMaterial : row.withProductMaterial.split(';')) this.$set(this.form, 'withProductMaterial', Array.isArray(row.withProductMaterial) ? row.withProductMaterial : row.withProductMaterial && row.withProductMaterial.split(';') || [])
this.resetMaterial(row.extMaterial ? row.extMaterial.resCode : '') this.resetMaterial(row.extMaterial ? row.extMaterial.resCode : '')
this.changeMaterial(row.extMaterial ? row.extMaterial.resCode : '') this.changeMaterial(row.extMaterial ? row.extMaterial.resCode : '')
this.$set(this.form, 'resCode', '') this.$set(this.form, 'resCode', '')
...@@ -342,17 +342,17 @@ export default { ...@@ -342,17 +342,17 @@ export default {
row.billType === 'AirEquipment' && this.$set(this.form, 'reqAmount', 1) row.billType === 'AirEquipment' && this.$set(this.form, 'reqAmount', 1)
this.$set(this.form, 'resCode', row.extMaterial && row.extMaterial.resCode || row.resCode || '') this.$set(this.form, 'resCode', row.extMaterial && row.extMaterial.resCode || row.resCode || '')
this.$set(this.form, 'resName', row.extMaterial && row.extMaterial.resName || row.resName || '') this.$set(this.form, 'resName', row.extMaterial && row.extMaterial.resName || row.resName || '')
this.$set(this.form, 'reqUnit', row.extMaterial && row.extMaterial.extUnit.unitName || row.reqUnit || '') this.$set(this.form, 'reqUnit', row.extMaterial && row.extMaterial.extUnit && row.extMaterial.extUnit.unitName || row.reqUnit || '')
this.$set(this.form, 'modelNo', row.extMaterial && row.extMaterial.modelNo || row.modelNo || '') this.$set(this.form, 'modelNo', row.extMaterial && row.extMaterial.modelNo || row.modelNo || '')
this.$set(this.form, 'extMaterialId', row.extMaterialId || '') this.$set(this.form, 'extMaterialId', row.extMaterialId || '')
this.$set(this.form, 'supplier', row.extDxSipplier && row.extDxSipplier.supplierFullName || row.supplier || '') this.$set(this.form, 'supplier', row.extDxSipplier && row.extDxSipplier.supplierFullName || row.supplier || '')
this.$set(this.form, 'withProductMaterial', Array.isArray(row.withProductMaterial) ? row.withProductMaterial : row.withProductMaterial.split(';')) this.$set(this.form, 'withProductMaterial', Array.isArray(row.withProductMaterial) ? row.withProductMaterial : row.withProductMaterial && row.withProductMaterial.split(';') || [])
this.resetMaterial(row.extMaterial ? row.extMaterial.resCode : row.resCode || '') this.resetMaterial(row.extMaterial ? row.extMaterial.resCode : row.resCode || '')
this.changeMaterial(row.extMaterial ? row.extMaterial.resCode : row.resCode || '') this.changeMaterial(row.extMaterial ? row.extMaterial.resCode : row.resCode || '')
}, },
handleClose() { handleClose() {
this.dialogVisibleDetails = false this.dialogVisibleDetails = false
this.form = {} // this.form = {}
}, },
getBasicData() { getBasicData() {
const v = this.basicData const v = this.basicData
...@@ -1854,14 +1854,14 @@ export default { ...@@ -1854,14 +1854,14 @@ export default {
// 带出物料相关默认值 // 带出物料相关默认值
const SELECT_MATERIAL = this.material.find((item) => item.resCode === v) const SELECT_MATERIAL = this.material.find((item) => item.resCode === v)
if (SELECT_MATERIAL) { if (SELECT_MATERIAL) {
this.form.modelNo = SELECT_MATERIAL.modelNo || '' this.$set(this.form, 'modelNo', SELECT_MATERIAL.modelNo || '')
this.form.techSpec = SELECT_MATERIAL.techSpec || '' this.$set(this.form, 'techSpec', SELECT_MATERIAL.techSpec || '')
this.form.spec = SELECT_MATERIAL.spec || '' this.$set(this.form, 'spec', SELECT_MATERIAL.spec || '')
this.form.supplyStatus = SELECT_MATERIAL.supplyStatus || '' this.$set(this.form, 'supplyStatus', SELECT_MATERIAL.supplyStatus || '')
this.form.reqUnit = SELECT_MATERIAL.extUnit.unitName || '' this.$set(this.form, 'reqUnit', SELECT_MATERIAL.extUnit && SELECT_MATERIAL.extUnit.unitName || '')
this.form.resName = SELECT_MATERIAL.resName || '' this.$set(this.form, 'resName', SELECT_MATERIAL.resName)
this.form.extMaterial = SELECT_MATERIAL this.$set(this.form, 'extMaterial', SELECT_MATERIAL)
this.extMaterialId = SELECT_MATERIAL.id || '' // this.extMaterialId = SELECT_MATERIAL.id || ''
this.extUnitId = SELECT_MATERIAL.extUnitId || '' this.extUnitId = SELECT_MATERIAL.extUnitId || ''
} }
}, },
...@@ -1987,9 +1987,9 @@ export default { ...@@ -1987,9 +1987,9 @@ export default {
'operator': this.form.operator, 'operator': this.form.operator,
'subTypeName': 'InStoragePurchaseItem', 'subTypeName': 'InStoragePurchaseItem',
'rowId': this.form.id || this.generateUUID(), 'rowId': this.form.id || this.generateUUID(),
'parentId': this.form.parentId ? this.form.parentId : this.parentId, 'parentId': this.isChild ? this.parentId || this.form.parentId : null,
'parentRowId': this.parentRowId, 'parentRowId': this.parentRowId,
'extMaterialId': this.extMaterialId ? this.extMaterialId : this.form.extMaterialId, 'extMaterialId': this.form.extMaterial ? this.form.extMaterial.id : this.form.extMaterialId,
'extMaterialIdType': 'ExtDxProcessMaterial', 'extMaterialIdType': 'ExtDxProcessMaterial',
'materialTypeName': this.basicData.materialTypeName.label, 'materialTypeName': this.basicData.materialTypeName.label,
'purchaseUnitId': this.extUnitId, 'purchaseUnitId': this.extUnitId,
......
...@@ -322,6 +322,8 @@ export default { ...@@ -322,6 +322,8 @@ export default {
{ {
operation: '编辑', operation: '编辑',
handleClick: (row, index) => { handleClick: (row, index) => {
this.$set(this.form, 'operator', 'MODIFY')
this.$set(this.detailsPropData, 'operator', 'MODIFY')
this.$refs.storageDetailsCreatOrEdit.handleOpen('MODIFY', this.detailsPropData, row) this.$refs.storageDetailsCreatOrEdit.handleOpen('MODIFY', this.detailsPropData, row)
}, },
icon: '/icons/components/new/edit.png', icon: '/icons/components/new/edit.png',
...@@ -834,7 +836,7 @@ export default { ...@@ -834,7 +836,7 @@ 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.operator !== 'REMOVE' && (!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 paramOperator = this.newDataImportResId ? 'MODIFY' : this.operator
const param = { const param = {
...@@ -855,11 +857,11 @@ export default { ...@@ -855,11 +857,11 @@ export default {
param.id = this.newDataImportResId || 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('保存成功')
if (saveAndImport === 'saveAndImport') { if (saveAndImport === 'saveAndImport') {
this.$refs.importFile.upLoadExcel(res.items.id, newData) this.$refs.importFile.upLoadExcel(res.items.id, newData)
} else { } else {
this.cancel() this.cancel()
this.$utils.showMessageSuccess('保存成功')
} }
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
......
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