Commit d6444999 authored by jingnan's avatar jingnan 👀

返厂入库修改

parent 30f0c3c5
...@@ -84,13 +84,14 @@ export default { ...@@ -84,13 +84,14 @@ export default {
}, },
submitEvent() { submitEvent() {
this.selection = this.$refs['materielTable'].$refs['asCom'].selectedData this.selection = this.$refs['materielTable'].$refs['asCom'].selectedData
if (this.selection.length) { if (this.selection.length === 1) {
const showData = this.findByNameVnode(this, 'DeeAsTable').showData const showData = this.findByNameVnode(this, 'DeeAsTable').showData
if (showData.length) { if (showData.length) {
this.selection = this.selection.filter(item => !showData.some(x => x.inventoryId === item.inventoryId)) this.selection = this.selection.filter(item => !showData.some(x => x.inventoryId === item.inventoryId))
} }
const data = this.selection.map(r => { const data = this.selection.map(r => {
return { return {
...this.basicData,
'allocatedAmount': r.allocatedAmount, 'allocatedAmount': r.allocatedAmount,
'subTypeName': 'InStorageRecallItem', 'subTypeName': 'InStorageRecallItem',
'reqStatus': 'Apply', 'reqStatus': 'Apply',
...@@ -121,12 +122,14 @@ export default { ...@@ -121,12 +122,14 @@ export default {
'taxPrice': r.inventory.jobResponse.jobOrder.taxPrice, 'taxPrice': r.inventory.jobResponse.jobOrder.taxPrice,
'stockUnitPrice': r.inventory.jobResponse.jobOrder.stockUnitPrice, 'stockUnitPrice': r.inventory.jobResponse.jobOrder.stockUnitPrice,
'purchaseOrderNo': r.inventory.jobResponse.jobOrder.purchaseOrderNo, 'purchaseOrderNo': r.inventory.jobResponse.jobOrder.purchaseOrderNo,
'operator': 'ADD', 'operator': 'MODIFY',
'remark': r.inventory.jobResponse.jobOrder.remark, 'remark': r.inventory.jobResponse.jobOrder.remark,
'isRoot': r.inventory.jobResponse.jobOrder.isRoot 'isRoot': r.inventory.jobResponse.jobOrder.isRoot
} }
}) })
this.$emit('submitEvent', { formData: data }) // this.$emit('submitEvent', { formData: data })
this.$bus.$emit('refrshRecallItems', { formData: data })
this.cancelEvent()
} }
}, },
cancelEvent() { cancelEvent() {
......
<!--
* @Author: gjn
* @Date: 2023-10-14 20:27:44
* @Description:返厂入库明细
-->
<template>
<div :style="layoutStyle" class="EditInStorageRecallApplyDetails">
<dee-as-com
ref="table"
:basic-data="basicData"
:lay-config="cmpOptions"
table-height="auto"
:dis-business="true"
:result-data="tableData"
/>
</div>
</template>
<script>
export default {
componentName: '返厂入库明细',
name: 'EditInStorageRecallApplyDetails',
components: { },
props: {
basicData: {
type: Object,
default: () => {}
},
itemId: {
type: String,
default: () => ''
},
form: {
type: Object,
default: () => {
return {}
}
},
imShowTableData: {
type: Array,
default: () => {
return []
}
},
buttonFilter: {
type: String,
default: () => ''
},
layoutStyle: {
type: Object,
default: () => {
return {}
}
},
showBtn: {
type: Boolean,
default: true
}
},
data() {
return {
dialogShow: false,
selectionRows: [],
tableData: [],
dialogTitle: '',
cmpOptions: {
typeName: 'InStorageRecallItem',
layKey: 'add'
}
}
},
computed: {
},
watch: {
tableData: {
immediate: true,
deep: true,
handler(data) {
this.$emit('input', data)
}
}
},
mounted() {
if (this.basicData && this.basicData.id) {
this.getDetailsData(this.basicData.id)
}
},
created() {
this.$bus.$on('refrshRecallItems', (data) => {
this.submitEvent(data)
})
},
methods: {
getDetailsData(id) {
const params = {
'pageFrom': 1,
'pageSize': 999,
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'inventoryReqId',
'operator': 'EQ',
'value': id || ''
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extMaterial',
'openProps': [{
'name': 'resType2'
}, {
'name': 'extUnit'
}]
}, {
'name': 'extDxSipplier'
},
{
'name': 'extSupportingItemVO',
'openProps': [{
'name': 'extMaterial',
'openProps': [{
'name': 'resType2'
}]
}]
}, {
'name': 'inventoryJobResponses'
}, {
'name': 'storageZone'
},
{ 'name': 'outStorageRequest',
'openProps': [
{ 'name': 'extWorkCenter' }]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
this.$api.searchApi(`InStorageRequestItem`, params).then(res => {
this.tableData = res.items.content || []
}).catch((err) => {
console.log(err)
})
},
submitEvent({ formData }) {
this.tableData.forEach((item, index) => {
if (item.id === formData[0].id) {
this.$set(this.tableData, index, formData[0])
}
})
}
}
}
</script>
<style>
</style>
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