Commit 161bb470 authored by jingnan's avatar jingnan 👀

领用出库申请修改

parent 123f282c
......@@ -8,7 +8,7 @@
<div class="sub-title">领用类型</div>
<div class="useType">
<span class="typeName">领用类型:</span>
<el-select v-model="typeName" placeholder="请选择" size="mini">
<el-select v-model="typeName" :disabled="!!basicData.id" placeholder="请选择" size="mini">
<el-option
v-for="item in options"
:key="item.value"
......@@ -22,7 +22,7 @@
style="border:none;"
model-name="OutStorageUse"
:lay-config="cmpOptions"
:basic-data="{useRequestType:typeName}"
:basic-data="{...basicData,useRequestType:basicData.typeName||typeName}"
:on-form-event-hander="formEventHander"
@on-cancel="cancelHandler"
/>
......@@ -36,6 +36,10 @@ export default {
name: 'AddOutStorageUseCom',
components: {},
props: {
basicData: {
type: Object,
default: () => null
},
defaultData: {
type: Object,
default: () => null
......@@ -46,14 +50,15 @@ export default {
}
},
data() {
const that = this
return {
typeName: 'swapUse',
typeName: that.basicData.typeName || 'useAO',
options: [
],
showCmp: true,
cmpOptions: {
typeName: 'OutStorageUse',
layKey: 'outStorageUseApply_add_useAO'
layKey: 'outStorageUseApplyAdd_useAO'
},
formEventHander: {
'on-submit': () => {
......@@ -74,7 +79,11 @@ export default {
typeName: {
immediate: true,
handler(val) {
this.$set(this.cmpOptions, 'layKey', `outStorageUseApply_add_${val}`)
if (!this.basicData.id) {
this.$set(this.cmpOptions, 'layKey', `outStorageUseApplyAdd_${val}`)
} else {
this.$set(this.cmpOptions, 'layKey', `outStorageUseApplyEdit_${val}`)
}
}
}
},
......
......@@ -8,7 +8,7 @@
<dee-as-com
ref="OfferTable"
class="list-table"
:lay-config="{ typeName: 'OutStorageMatchItem', layKey: 'outStorageUseMaterial_Add'}"
:lay-config="cmpOptions"
:basic-data="basicData"
@row-click="handleRowClick"
/>
......@@ -54,7 +54,8 @@ export default {
reqAmount: [
{ required: true, message: '该项必填', trigger: 'blur' }
]
}
},
cmpOptions: { typeName: 'OutStorageMatchItem', layKey: 'outStorageUseMaterial_Add' }
}
},
computed: {},
......@@ -68,6 +69,7 @@ export default {
'basicData.useRequestType': {
immediate: true,
handler(val) {
this.$set(this.cmpOptions, 'layKey', `outStorageUseMaterial_Add_${val}`)
switch (val) {
case 'useAO':
this.amountItemLabel = '申领数量'
......@@ -75,7 +77,9 @@ export default {
case 'swapUse':
this.amountItemLabel = '换件数量'
break
case 'scrapUse':
this.amountItemLabel = '报废数量'
break
default:
break
}
......@@ -104,14 +108,22 @@ export default {
}]
if (this.basicData.useRequestType === 'swapUse') {
data[0].extSupportingItemVO = this.selectDatas[0].extSupportingItemVO
} else if (this.basicData.useRequestType === 'scrapUse') {
data[0].extSupportingItemVO = this.selection.extSupportingItemVO
data[0].extSupportingItemId = this.selection.extSupportingItemVO.id
}
this.$emit('submitEvent', { formData: data, addContinue })
this.cleanAddForm()
} else {
this.$utils.showMessageWarning(`至少选择一条物料并且${this.amountItemLabel}必填!`)
return false
}
})
},
cleanAddForm() {
this.$refs.OfferTable.$refs.asCom.getData()
this.applyForm = {}
},
cancelEvent() {
this.$emit('cancel')
}
......
......@@ -89,19 +89,21 @@ export default {
}
},
data() {
const that = this
return {
componentProp: {
showSubType: true
},
dialogShow: false,
selectionRows: [],
tableData: [],
tableData: that.basicData.inStorageRequestItems || [],
dialogTitle: '',
componentName: '',
cmpOptions: {
typeName: 'OutStorageUseItem',
layKey: 'add_outStorageUseItem_useAO'
}
},
editMaterialItem: null
}
},
computed: {
......@@ -161,14 +163,14 @@ export default {
},
addHandle() {
const useRequestType = this.basicData.useRequestType
if (useRequestType === 'useAO') {
this.openDialog('添加出库物料', 'AddOutStorageUseDetailDialog')
} else if (useRequestType === 'swapUse') {
if (useRequestType === 'swapUse') {
if (this.selectionRows && this.selectionRows.length === 1) {
this.openDialog('添加出库物料', 'AddOutStorageUseDetailDialog')
} else {
this.$utils.showMessageWarning('请勾选一条数据进行操作!')
}
} else {
this.openDialog('添加出库物料', 'AddOutStorageUseDetailDialog')
}
},
occupy() {
......@@ -190,7 +192,13 @@ export default {
const tableData = [...this.tableData]
data.forEach(item => {
tableData.forEach(v => {
if (v.extMaterialId === item.extMaterialId) {
let flag = v.extMaterialId === item.extMaterialId
if (this.basicData.useRequestType === 'scrapUse') {
flag = v.extSupportingItemId === item.extSupportingItemId && v.extMaterialId === item.extMaterialId
} else {
flag = v.extMaterialId === item.extMaterialId
}
if (flag) {
v.id = item.id
v.operator = 'MODIFY'
v.outStorageOutId = res.items.id
......
......@@ -32,6 +32,10 @@ export default {
type: [String, Number],
default: ''
},
basicData: {
type: Object,
default: () => ({})
},
form: {
type: Object,
default: () => ({ sorties: '' })
......@@ -52,14 +56,23 @@ export default {
watch: {
'form.sorties': {
handler(val) {
this.$set(this.form, 'aoNo', '')
if (!this.basicData.id) {
this.$set(this.form, 'aoNo', '')
}
} },
value: {
handler(val) {
if (this.basicData.id && val && Number(val)) {
this.remoteMethod('', Number(val))
}
}
}
},
immediate: true
},
methods: {
remoteMethod(query) {
remoteMethod(query, id) {
if (!this.form || !this.form.sorties) return this.$utils.showMessageWarning('请选择架次后查询!')
if (!query || query.length < 1) return
if ((!query || query.length < 1) && !id) return
if (this.remoteFlag) {
this.remoteFlag = false
this.tableColumnSelect = true
......@@ -71,17 +84,24 @@ export default {
{
'fieldName': 'serialNumber',
'operator': 'LIKE',
'value': query
'value': query || ''
},
{
'fieldName': 'sorties',
'operator': 'LIKE',
'value': this.form.sorties.split('+')[1]
'value': this.form.sorties.split('+')[1] || ''
}
]
},
'openProps': []
}
if (id) {
params.searchItems.items.push({
'fieldName': 'id',
'operator': 'EQ',
'value': id
})
}
this.loading = true
this.options = []
this.$api.searchApi('ExtProcessPlan', params).then(res => {
......
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