Commit 07eccc7c authored by xioln's avatar xioln

入库明细新增编辑

parent a231675a
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
disabled: false, disabled: false,
header: {}, header: {},
billType: '', billType: '',
form: {}, form: { },
formFileds: [ formFileds: [
{ {
split: 3, split: 3,
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
methods: { methods: {
handleOpen(type, basicData, row) { handleOpen(type, basicData, row) {
this.basicData = basicData this.basicData = basicData
this.form = {} this.form = { 'reqAmount': 1 }
this.dialogVisible = true this.dialogVisible = true
this.operateType = type this.operateType = type
this.getBasicData() this.getBasicData()
...@@ -470,7 +470,7 @@ export default { ...@@ -470,7 +470,7 @@ export default {
name: 'el-date-picker', name: 'el-date-picker',
disabled: true, disabled: true,
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd hh:mm:ss',
placeholder: '请选择到货日期' placeholder: '请选择到货日期'
} }
}, },
...@@ -481,7 +481,7 @@ export default { ...@@ -481,7 +481,7 @@ export default {
clearable: true, clearable: true,
name: 'el-date-picker', name: 'el-date-picker',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd hh:mm:ss',
placeholder: '请选择生产日期' placeholder: '请选择生产日期'
} }
}, },
...@@ -796,7 +796,7 @@ export default { ...@@ -796,7 +796,7 @@ export default {
clearable: true, clearable: true,
name: 'el-date-picker', name: 'el-date-picker',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd hh:mm:ss',
placeholder: '请选择生产日期' placeholder: '请选择生产日期'
} }
}, },
...@@ -1717,7 +1717,7 @@ export default { ...@@ -1717,7 +1717,7 @@ export default {
'hasParent': this.form.hasParent ? this.form.hasParent : !!this.parentId, 'hasParent': this.form.hasParent ? this.form.hasParent : !!this.parentId,
'extMaterialId': this.extMaterialId ? this.extMaterialId : this.form.extMaterialId, 'extMaterialId': this.extMaterialId ? this.extMaterialId : this.form.extMaterialId,
'extMaterialIdType': 'ExtDxProcessMaterial', 'extMaterialIdType': 'ExtDxProcessMaterial',
'materialTypeName': this.basicData.materialType.typeName || '', 'materialTypeName': this.basicData.materialType.typeName || (this.basicData.materialTypeName || {}).label,
'purchaseUnitId': this.extUnitId, 'purchaseUnitId': this.extUnitId,
'purchaseUnitIdType': 'ExtUnit', 'purchaseUnitIdType': 'ExtUnit',
'lotNo': this.form.lotNo, 'lotNo': this.form.lotNo,
...@@ -1727,7 +1727,7 @@ export default { ...@@ -1727,7 +1727,7 @@ export default {
'extDxSipplierId': this.basicData.extDxSipplierId || '', 'extDxSipplierId': this.basicData.extDxSipplierId || '',
'extDxSipplierIdType': 'ExtDxSipplier', 'extDxSipplierIdType': 'ExtDxSipplier',
'manufacturer': this.form.manufacturer, 'manufacturer': this.form.manufacturer,
'arrivalDate': this.form.arrivalDate ? this.form.arrivalDate : null, 'arrivalDate': this.form.arrivalDate,
'producedTime': this.form.producedTime, 'producedTime': this.form.producedTime,
'storageCondition': this.form.storageCondition, 'storageCondition': this.form.storageCondition,
'withProductMaterial': Array.isArray(this.form.withProductMaterial) ? this.form.withProductMaterial.join(';') : this.form.withProductMaterial, 'withProductMaterial': Array.isArray(this.form.withProductMaterial) ? this.form.withProductMaterial.join(';') : this.form.withProductMaterial,
......
...@@ -33,21 +33,22 @@ ...@@ -33,21 +33,22 @@
</div> </div>
</template> </template>
<script> <script>
import { post, del } from '@/utils/http' import { post, del, get } from '@/utils/http'
import StorageDetails from './component/storageDetailsCreateCom' import StorageDetails from './component/storageDetailsCreateCom'
export default { export default {
componentName: '采购入库申请创建编辑', componentName: '采购入库申请创建编辑',
name: 'PurchasingWarehousingNewOrEdit', // name写在组件的最前方,自定义组件为必填 name: 'PurchasingWarehousingNewOrEdit', // name写在组件的最前方,自定义组件为必填
components: { StorageDetails }, components: { StorageDetails },
props: { props: {
basicData: { // basicData: {
type: Object, // type: Object,
default: () => null // default: () => null
} // }
}, },
data() { data() {
const that = this const that = this
return { return {
basicData: null,
form: {}, form: {},
formData: [{ formData: [{
title: '基本信息', title: '基本信息',
...@@ -74,7 +75,6 @@ export default { ...@@ -74,7 +75,6 @@ export default {
}, },
handler: { handler: {
change: function(val) { change: function(val) {
console.log('val', that)
that.getExtDxProcessResourceType(val) that.getExtDxProcessResourceType(val)
} }
} }
...@@ -114,6 +114,7 @@ export default { ...@@ -114,6 +114,7 @@ export default {
key: 'arrivalDate', key: 'arrivalDate',
component: { component: {
name: 'el-date-picker', name: 'el-date-picker',
disabled: false,
// type: 'daterange', // type: 'daterange',
clearable: true, clearable: true,
valueFormat: 'yyyy-MM-dd HH:mm:ss' valueFormat: 'yyyy-MM-dd HH:mm:ss'
...@@ -224,7 +225,7 @@ export default { ...@@ -224,7 +225,7 @@ export default {
}, },
icon: '/icons/components/new/add.png', icon: '/icons/components/new/add.png',
showFun: (row) => { showFun: (row) => {
if (row.parentId) { if (row.parentId || this.detailsPropData.materialTypeName.label === '外购成品') {
return false return false
} }
return true return true
...@@ -346,20 +347,87 @@ export default { ...@@ -346,20 +347,87 @@ export default {
this.initData() this.initData()
this.operator = 'ADD' this.operator = 'ADD'
this.form.operator = 'ADD' this.form.operator = 'ADD'
if (Object.keys(this.basicData).length !== 0) {
this.form = this.basicData
this.searchInStorageRequestItem()
this.operator = 'MODIFY'
this.form.operator = 'MODIFY'
}
console.log('this.basicData', this.basicData)
}, },
methods: { methods: {
initData() { initData() {
this.getInventoryRequest()
this.getDictData() this.getDictData()
this.getExtDxProductArea() this.getExtDxProductArea()
this.getExtDxSipplier() this.getExtDxSipplier()
}, },
editInit(basicData) {
this.basicData = basicData
this.form = basicData
this.searchInStorageRequestItem()
this.operator = 'MODIFY'
this.form.operator = 'MODIFY'
this.getExtDxProcessResourceType(basicData.billType)
},
// 获取验收单数据InventoryRequest/search
getInventoryRequest() {
if (!this.$route.query.hasOwnProperty('id')) return
const param = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [{
'fieldName': 'reqStatus',
'operator': 'IN',
'value': [
'Apply',
'PartAudit'
]
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'InStoragePurchase'
},
{
'fieldName': 'id',
'operator': 'EQ',
'value': this.$route.query.id
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'materialType',
'pageFrom': 1,
'pageSize': 9999
},
{
'name': 'extDxProductArea',
'pageFrom': 1,
'pageSize': 9999
},
{
'name': 'extDxSipplier',
'pageFrom': 1,
'pageSize': 9999
},
{
'name': 'creator',
'pageFrom': 1,
'pageSize': 9999
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('InventoryRequest/search', param).then(res => {
this.basicData = res.items.content[0]
this.editInit(res.items.content[0])
}).catch((err) => {
console.log(err)
})
},
// 验收单类型 DictData/search // 验收单类型 DictData/search
getDictData() { getDictData() {
const param = { 'pageFrom': 1, 'pageSize': 9999, 'searchItems': { 'items': [{ 'fieldName': 'dictState', 'operator': 'EQ', 'value': 'ENABLE' }, { 'fieldName': 'dictCode', 'operator': 'EQ', 'value': 'BillType' }] }, 'sortItem': [{ 'fieldName': 'dictSeq', 'sortOrder': 'asc' }] } const param = { 'pageFrom': 1, 'pageSize': 9999, 'searchItems': { 'items': [{ 'fieldName': 'dictState', 'operator': 'EQ', 'value': 'ENABLE' }, { 'fieldName': 'dictCode', 'operator': 'EQ', 'value': 'BillType' }] }, 'sortItem': [{ 'fieldName': 'dictSeq', 'sortOrder': 'asc' }] }
...@@ -373,8 +441,7 @@ export default { ...@@ -373,8 +441,7 @@ export default {
}, },
// 器材类型/ExtDxProcessResourceType/search // 器材类型/ExtDxProcessResourceType/search
getExtDxProcessResourceType(val) { getExtDxProcessResourceType(val) {
const param = { 'indices': ['DxProcessResourceMaterialType'], 'pageFrom': 1, 'pageSize': 100, 'searchItems': { 'operator': 'AND', 'items': [{ 'fieldName': 'billType', 'operator': 'ISNULL', 'value': val }] }} get(`/ExtDxProcessResourceType/findByBillTypeCode?billTypeCode=${val}`).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) {
targetItem.component.options = res.items.content.map(row => ({ value: row.id, label: row.typeName })) targetItem.component.options = res.items.content.map(row => ({ value: row.id, label: row.typeName }))
...@@ -447,7 +514,11 @@ export default { ...@@ -447,7 +514,11 @@ export default {
operator: 'NO_CHANGE' operator: 'NO_CHANGE'
} }
}) })
if (data.length > 0) {
this.formData[0].data.forEach(item => {
item.component.disabled = true
})
}
this.tableData = data this.tableData = data
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
...@@ -455,7 +526,6 @@ export default { ...@@ -455,7 +526,6 @@ export default {
}, },
// 组装表格数据 // 组装表格数据
addTableData(formData) { addTableData(formData) {
console.log('addTableData', formData)
const tableDataItem = { const tableDataItem = {
...formData, ...formData,
subEquipment: formData.materialTypeName, subEquipment: formData.materialTypeName,
......
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