Commit 07eccc7c authored by xioln's avatar xioln

入库明细新增编辑

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