Commit 161bb470 authored by jingnan's avatar jingnan 👀

领用出库申请修改

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