Commit 3bc7c24a authored by xioln's avatar xioln

入库申请明细提交

parent 93098491
...@@ -207,33 +207,6 @@ export default { ...@@ -207,33 +207,6 @@ export default {
}, },
computed: {}, computed: {},
watch: { watch: {
basicData: {
handler: function(v) {
console.log('basicData', v)
this.header = v
if (
v.billType === 'AirEquipment' &&
(['标准件', '金属材料', '非金属材料'].includes(v.materialTypeName.label))) {
this.formFileds[0].data.unshift({
title: '所属设备',
key: 'subEquipment',
component: {
clearable: true,
name: 'el-input',
placeholder: '请输入所属设备'
}
})
this.$set(this.rules, 'subEquipment', [
{
required: true,
message: '请输入所属设备',
trigger: ['blur', 'change']
}
])
}
},
immediate: true
}
// 'form.resCode': { // 'form.resCode': {
// handler: function(v) { // handler: function(v) {
// this.resetMaterial(v) // this.resetMaterial(v)
...@@ -252,14 +225,18 @@ export default { ...@@ -252,14 +225,18 @@ export default {
this.form = {} this.form = {}
this.dialogVisible = true this.dialogVisible = true
this.operateType = type this.operateType = type
this.getBasicData()
this.resetForm() this.resetForm()
if (type === 'NEW') {
if (type === 'ADD') { this.$set(this.form, 'operator', 'ADD')
} else if (type === 'ADD') {
this.parentId = row.rowId this.parentId = row.rowId
} else if (type === 'UPDATE') { } else if (type === 'MODITY') {
console.log('row', row) console.log('row', row)
console.log('this.basicData', this.basicData.operator)
this.form = row this.form = row
this.$set(this.form, 'operator', row.operator || '') this.$set(this.form, 'operator', row.id && this.basicData.operator !== 'ADD' ? 'MODITY' : 'ADD')
row.billType === 'AirEquipment' && this.$set(this.form, 'reqAmount', 1)
this.$set(this.form, 'resCode', row.extMaterial.resCode || '') this.$set(this.form, 'resCode', row.extMaterial.resCode || '')
this.$set(this.form, 'resName', row.extMaterial.resName || '') this.$set(this.form, 'resName', row.extMaterial.resName || '')
this.$set(this.form, 'reqUnit', row.extMaterial.extUnit.unitName || '') this.$set(this.form, 'reqUnit', row.extMaterial.extUnit.unitName || '')
...@@ -274,6 +251,30 @@ export default { ...@@ -274,6 +251,30 @@ export default {
handleClose() { handleClose() {
this.dialogVisible = false this.dialogVisible = false
}, },
getBasicData() {
const v = this.basicData
this.header = v
if (
v.billType === 'AirEquipment' &&
(['标准件', '金属材料', '非金属材料'].includes(v.materialTypeName.label))) {
this.formFileds[0].data.unshift({
title: '所属设备',
key: 'subEquipment',
component: {
clearable: true,
name: 'el-input',
placeholder: '请输入所属设备'
}
})
this.$set(this.rules, 'subEquipment', [
{
required: true,
message: '请输入所属设备',
trigger: ['blur', 'change']
}
])
}
},
// 重设表单 // 重设表单
resetForm() { resetForm() {
if (!this.header) return if (!this.header) return
...@@ -293,7 +294,7 @@ export default { ...@@ -293,7 +294,7 @@ export default {
placeholder: '请输入物料关键词', placeholder: '请输入物料关键词',
remote: true, remote: true,
filterable: true, filterable: true,
'remote-method': 'remoteMethod', 'remote-method': this.resetMaterial,
options: [] options: []
}, },
handler: { handler: {
...@@ -390,12 +391,20 @@ export default { ...@@ -390,12 +391,20 @@ export default {
name: 'el-select', name: 'el-select',
placeholder: '请输入机型', placeholder: '请输入机型',
options: [] options: []
},
handler: {
change: (v) => this.changeSorties()
} }
}, },
{ {
title: '架次', title: '架次',
key: 'sorties', key: 'sorties',
component: { name: 'el-input', placeholder: '请输入架次' } component: {
clearable: true,
name: 'el-select',
placeholder: '请输入架次',
options: []
}
}, },
// { title: '采购数量/重量', key: 'purchaseAmount', component: { name: 'el-input-number', placeholder: '请输入采购数量/重量' }}, // { title: '采购数量/重量', key: 'purchaseAmount', component: { name: 'el-input-number', placeholder: '请输入采购数量/重量' }},
// { title: '采购单位', key: 'purchaseUnit', component: { name: 'el-select', placeholder: '请输入采购单位' }}, // { title: '采购单位', key: 'purchaseUnit', component: { name: 'el-select', placeholder: '请输入采购单位' }},
...@@ -689,12 +698,20 @@ export default { ...@@ -689,12 +698,20 @@ export default {
name: 'el-select', name: 'el-select',
placeholder: '请输入机型', placeholder: '请输入机型',
options: [] options: []
},
handler: {
change: (v) => this.changeSorties()
} }
}, },
{ {
title: '架次', title: '架次',
key: 'sorties', key: 'sorties',
component: { name: 'el-input', placeholder: '请输入架次' } component: {
clearable: true,
name: 'el-select',
placeholder: '请输入架次',
options: []
}
}, },
{ {
title: '入库数量', title: '入库数量',
...@@ -1031,12 +1048,20 @@ export default { ...@@ -1031,12 +1048,20 @@ export default {
name: 'el-select', name: 'el-select',
placeholder: '请输入机型', placeholder: '请输入机型',
options: [] options: []
},
handler: {
change: (v) => this.changeSorties()
} }
}, },
{ {
title: '架次', title: '架次',
key: 'sorties', key: 'sorties',
component: { name: 'el-input', placeholder: '请输入架次' } component: {
clearable: true,
name: 'el-select',
placeholder: '请输入架次',
options: []
}
}, },
{ {
title: '入库数量', title: '入库数量',
...@@ -1674,7 +1699,7 @@ export default { ...@@ -1674,7 +1699,7 @@ export default {
'arrivalDate': this.form.arrivalDate ? this.form.arrivalDate : null, 'arrivalDate': this.form.arrivalDate ? this.form.arrivalDate : null,
'producedTime': this.form.producedTime, 'producedTime': this.form.producedTime,
'storageCondition': this.form.storageCondition, 'storageCondition': this.form.storageCondition,
'withProductMaterial': this.form.withProductMaterial ? this.form.withProductMaterial.join(';') : '', 'withProductMaterial': Array.isArray(this.form.withProductMaterial) ? this.form.withProductMaterial.join(';') : this.form.withProductMaterial,
'urgency': this.form.urgency, 'urgency': this.form.urgency,
'arrivedDrawNo': this.form.arrivedDrawNo, 'arrivedDrawNo': this.form.arrivedDrawNo,
'arrivalVer': this.form.arrivalVer, 'arrivalVer': this.form.arrivalVer,
......
...@@ -46,6 +46,7 @@ export default { ...@@ -46,6 +46,7 @@ export default {
} }
}, },
data() { data() {
const that = this
return { return {
form: {}, form: {},
formData: [{ formData: [{
...@@ -70,6 +71,12 @@ export default { ...@@ -70,6 +71,12 @@ export default {
name: 'el-select', name: 'el-select',
placeholder: '请选择', placeholder: '请选择',
options: [] options: []
},
handler: {
change: function(val) {
console.log('val', that)
that.getExtDxProcessResourceType(val)
}
} }
}, },
{ {
...@@ -188,7 +195,6 @@ export default { ...@@ -188,7 +195,6 @@ export default {
handler: { handler: {
click: () => { click: () => {
this.$refs.form.validate((isok) => { this.$refs.form.validate((isok) => {
console.log('isok', isok)
if (isok) { if (isok) {
// 校验通过 // 校验通过
this.$refs.storageDetailsCreatOrEdit.handleOpen('NEW') this.$refs.storageDetailsCreatOrEdit.handleOpen('NEW')
...@@ -227,8 +233,7 @@ export default { ...@@ -227,8 +233,7 @@ export default {
{ {
operation: '编辑', operation: '编辑',
handleClick: (row, index) => { handleClick: (row, index) => {
row.operator = 'MODITY' this.$refs.storageDetailsCreatOrEdit.handleOpen('MODITY', row)
this.$refs.storageDetailsCreatOrEdit.handleOpen('UPDATE', row)
}, },
icon: '/icons/components/new/edit.png', icon: '/icons/components/new/edit.png',
showFun: (row) => { showFun: (row) => {
...@@ -334,6 +339,7 @@ export default { ...@@ -334,6 +339,7 @@ export default {
return { return {
materialTypeName: this.formData[0].data.find(item => item.key === 'materialTypeId').component.options.find(item => item.value === this.form.materialTypeId), materialTypeName: this.formData[0].data.find(item => item.key === 'materialTypeId').component.options.find(item => item.value === this.form.materialTypeId),
supplierFullName: this.formData[0].data.find(item => item.key === 'extDxSipplierId').component.options.find(item => item.value === this.form.extDxSipplierId), supplierFullName: this.formData[0].data.find(item => item.key === 'extDxSipplierId').component.options.find(item => item.value === this.form.extDxSipplierId),
operator: this.operator,
...this.form ...this.form
} }
} }
...@@ -352,7 +358,6 @@ export default { ...@@ -352,7 +358,6 @@ export default {
methods: { methods: {
initData() { initData() {
this.getDictData() this.getDictData()
this.getExtDxProcessResourceType()
this.getExtDxProductArea() this.getExtDxProductArea()
this.getExtDxSipplier() this.getExtDxSipplier()
}, },
...@@ -368,8 +373,8 @@ export default { ...@@ -368,8 +373,8 @@ export default {
}) })
}, },
// 器材类型/ExtDxProcessResourceType/search // 器材类型/ExtDxProcessResourceType/search
getExtDxProcessResourceType() { getExtDxProcessResourceType(val) {
const param = { 'indices': ['DxProcessResourceMaterialType'], 'pageFrom': 1, 'pageSize': 100, 'searchItems': { 'operator': 'AND', 'items': [{ 'fieldName': 'parentId', 'operator': 'ISNULL' }] }} const param = { 'indices': ['DxProcessResourceMaterialType'], 'pageFrom': 1, 'pageSize': 100, 'searchItems': { 'operator': 'AND', 'items': [{ 'fieldName': 'billType', 'operator': 'ISNULL', 'value': val }] }}
post('ExtDxProcessResourceType/search', param).then(res => { post('ExtDxProcessResourceType/search', param).then(res => {
const targetItem = this.formData[0].data.find(item => item.key === 'materialTypeId') const targetItem = this.formData[0].data.find(item => item.key === 'materialTypeId')
if (targetItem) { if (targetItem) {
...@@ -477,7 +482,6 @@ export default { ...@@ -477,7 +482,6 @@ export default {
if (tableDataItem.operateType === 'ADD') { if (tableDataItem.operateType === 'ADD') {
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
const item = this.tableData[i] const item = this.tableData[i]
if (tableDataItem.hasParent && !item.children) { if (tableDataItem.hasParent && !item.children) {
item.children = [] item.children = []
} }
...@@ -488,7 +492,7 @@ export default { ...@@ -488,7 +492,7 @@ export default {
} }
} }
} }
if (tableDataItem.operateType === 'UPDATE') { if (tableDataItem.operateType === 'MODITY') {
for (const item of this.tableData) { for (const item of this.tableData) {
// 父类修改 // 父类修改
if (item.id === tableDataItem.id) { if (item.id === tableDataItem.id) {
...@@ -518,9 +522,6 @@ export default { ...@@ -518,9 +522,6 @@ export default {
if (key === 'storageZone') { if (key === 'storageZone') {
delete tableData[i][key] delete tableData[i][key]
} }
// if (tableData[i].id) {
// tableData[i].operator = 'MODITY'
// }
} }
}) })
console.log('tableData', tableData) console.log('tableData', tableData)
......
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