Commit 3bc7c24a authored by xioln's avatar xioln

入库申请明细提交

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