Commit 0bb7d51c authored by jingnan's avatar jingnan 👀

验收入库批量编辑是数量bug修改

parent 6b99aef1
......@@ -237,7 +237,8 @@ export default {
parentId: null,
operateType: null,
parentRowId: '',
currStorageList: []
currStorageList: [],
rowData: {}
}
},
computed: {
......@@ -305,6 +306,20 @@ export default {
const targetArr = this.formFileds[0].data.filter(item => item.title === '税率' || item.title === '含税单价')
targetArr.forEach(item => (item.component.disabled = isVirtualFlag))
}
},
currStorageList: {
immediate: true,
deep: true,
handler(val) {
this.setStorageZoneName()
}
},
rowData: {
immediate: true,
deep: true,
handler(val) {
this.setStorageZoneName()
}
}
},
created() {
......@@ -315,38 +330,29 @@ export default {
// this.form.arrivalDate = this.basicData.arrivalDate || ''
},
methods: {
setStorageZoneName() {
if (!this.form.storageZoneName) {
if (this.currStorageList && this.currStorageList.find(el => Number(el.value) === Number(this.rowData.storageZoneId))) {
this.$set(this.form, 'storageZoneName', this.rowData.storageZone && this.rowData.storageZone.extname || '')
this.$set(this.form, 'storageZone', this.rowData.storageZoneId)
}
}
},
handleOpen(type, row) {
this.rowData = row
this.defaultStorage()
// this.basicData = basicData
this.form = { 'reqAmount': 1 }
// this.dialogVisibleDetails = true
if (!this.form.reqAmount) {
this.form = { 'reqAmount': 0 }
}
this.operateType = type
// if (type === 'NEW') {
// this.$set(this.form, 'operator', 'ADD')
// } else if (type === 'ADD') {
// this.parentId = row.id || null
// this.parentRowId = row.rowId ? row.rowId : row.id
// this.$set(this.form, 'operator', 'ADD')
// delete row.id
// this.form = JSON.parse(JSON.stringify(row))
// this.$set(this.form, 'supplier', row.extDxSipplierId)
// this.$set(this.form, 'withProductMaterial', Array.isArray(row.withProductMaterial) ? row.withProductMaterial : row.withProductMaterial && row.withProductMaterial.split(';') || [])
// this.resetMaterial(row.extMaterial ? row.extMaterial.resCode : '')
// this.changeMaterial(row.extMaterial ? row.extMaterial.resCode : '')
// this.$set(this.form, 'resCode', '')
// this.$set(this.form, 'resName', '')
// this.$set(this.form, 'reqUnit', '')
// this.$set(this.form, 'modelNo', '')
// } else if (type === 'MODIFY') {
this.dispalyData(row)
// }
this.resetForm()
},
// 回显数据
dispalyData(row) {
this.form = this.$utils.deepClone(row)
this.$set(this.form, 'operator', 'MODIFY')
row.billType === 'AirEquipment' && this.$set(this.form, 'reqAmount', 1)
row.billType === 'AirEquipment' && !this.form.reqAmount && this.$set(this.form, 'reqAmount', 1)
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, 'reqUnit', row.extMaterial && row.extMaterial.extUnit && row.extMaterial.extUnit.unitName || row.reqUnit || '')
......@@ -355,12 +361,12 @@ export default {
this.$set(this.form, 'supplier', row.extDxSipplier && row.extDxSipplier.supplierFullName || row.supplier || '')
this.$set(this.form, 'storageZoneName', '')
this.$set(this.form, 'storageZone', '')
setTimeout(() => {
if (this.currStorageList && this.currStorageList.find(el => Number(el.value) === Number(row.storageZoneId))) {
this.$set(this.form, 'storageZoneName', row.storageZone && row.storageZone.extname || '')
this.$set(this.form, 'storageZone', row.storageZoneId)
}
}, 500)
// setTimeout(() => {
// if (this.currStorageList && this.currStorageList.find(el => Number(el.value) === Number(row.storageZoneId))) {
// this.$set(this.form, 'storageZoneName', row.storageZone && row.storageZone.extname || '')
// this.$set(this.form, 'storageZone', row.storageZoneId)
// }
// }, 500)
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.changeMaterial(row.extMaterial ? row.extMaterial.resCode : row.resCode || '')
......
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