|
|
@ -76,13 +76,13 @@ |
|
|
|
> |
|
|
|
<template #hahaha> |
|
|
|
<el-button style="width:100%" type="primary" @click="chooseReceiptList">选择收货单明细</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
<template #hehehe> |
|
|
|
<div></div> |
|
|
|
<el-button style="width:100%" type="info" @click="choosePurchanseList">直接选择采购订单</el-button> |
|
|
|
</template> |
|
|
|
</BasicForm> |
|
|
|
<!-- 添加明细:采购收货记录单号 --> |
|
|
|
<!-- 直接选择采购订单 --> |
|
|
|
<SearchTable ref="searchTableRef" :hiddenFilterBtnFields="['hahaha']" @searchTableSuccess="searchTableSuccess1" > |
|
|
|
<template #searchQueryhahaha> |
|
|
|
<el-form :inline="true"> |
|
|
@ -94,6 +94,16 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</template> |
|
|
|
<template #searchQueryhehehe> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-form-item label="供应商"> |
|
|
|
<el-input v-model="formRef.formRef.formModel.supplierName" placeholder="请输入供应商" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="物料号"> |
|
|
|
<el-input v-model="formRef.formRef.formModel.itemCode" placeholder="请输入物料号" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</template> |
|
|
|
</SearchTable> |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
@ -161,6 +171,9 @@ import { |
|
|
|
import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain' |
|
|
|
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' |
|
|
|
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' |
|
|
|
import { PurchaseMain, PurchaseMainRules, PurchaseDetail, PurchaseDetailRules } from '@/views/wms/purchasereceiptManage/supplierdeliver/purchaseMainWms/purchaseMain.data' |
|
|
|
|
|
|
|
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { SupplierdeliverRequestPackage } from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
@ -805,6 +818,7 @@ const handleAddTable = () => { |
|
|
|
// }) |
|
|
|
} |
|
|
|
const onChangeForm = async (field, cur, formRef)=>{ |
|
|
|
console.log('onChangeForm',field, cur, formRef) |
|
|
|
if(field=='supplierCode'){ |
|
|
|
//供应商 |
|
|
|
PurchasereturnRequestMainNew.allSchemas.formSchema.forEach(item=>{ |
|
|
@ -815,6 +829,7 @@ const onChangeForm = async (field, cur, formRef)=>{ |
|
|
|
formRef.value.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
getPurchanseList() |
|
|
|
}else if(field == 'locationCode' || field == 'itemCode'){ |
|
|
|
// 退货库位 获取明细列表 |
|
|
|
let itemCode = formRef.formModel?formRef.formModel.itemCode:formRef.value.formModel.itemCode |
|
|
@ -842,6 +857,57 @@ const onChangeForm = async (field, cur, formRef)=>{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const getPurchanseList = async ()=>{ |
|
|
|
let res = await PurchaseDetailApi.getPurchaseDetailPageWMS({ |
|
|
|
supplierCode: formRef.value.formRef.formModel.supplierCode, |
|
|
|
itemCode: formRef.value.formRef.formModel.itemCode, |
|
|
|
pageSize: 20, |
|
|
|
pageNo: 1, |
|
|
|
sort: '', |
|
|
|
by: 'ASC' |
|
|
|
}) |
|
|
|
if(res&&res.list&&res.list.length==1){ |
|
|
|
const setV = {} |
|
|
|
setV['hahaha'] = '' |
|
|
|
setV['hehehe'] = res.list[0]['number'] |
|
|
|
setV['poNumber'] = res.list[0]['number'] |
|
|
|
setV['poLine'] = res.list[0]['lineNumber'] |
|
|
|
setV['receiptNumber'] = '' |
|
|
|
setV['asnNumber'] = '' |
|
|
|
formRef.value.formRef.setValues(setV) |
|
|
|
} |
|
|
|
console.log('采购订单',res) |
|
|
|
} |
|
|
|
// 直接选择采购订单 |
|
|
|
const choosePurchanseList = ()=>{ |
|
|
|
|
|
|
|
if(!formRef.value.formRef.formModel.itemCode){ |
|
|
|
message.error('请选择物料代码') |
|
|
|
return |
|
|
|
} |
|
|
|
if(!formRef.value.formRef.formModel.supplierCode){ |
|
|
|
message.error('请选择供应商') |
|
|
|
return |
|
|
|
} |
|
|
|
searchTableRef.value.open( |
|
|
|
"直接选择采购订单", |
|
|
|
PurchaseMain.allSchemas, |
|
|
|
PurchaseDetailApi.getPurchaseDetailPageWMS, |
|
|
|
"hehehe", |
|
|
|
"hehehe", |
|
|
|
false, |
|
|
|
'tableForm', |
|
|
|
null, |
|
|
|
{ |
|
|
|
supplierCode:formRef.value.formRef.formModel.supplierCode, |
|
|
|
itemCode:formRef.value.formRef.formModel.itemCode |
|
|
|
}, |
|
|
|
undefined, |
|
|
|
true, |
|
|
|
PurchaseDetail.allSchemas |
|
|
|
) |
|
|
|
} |
|
|
|
// 选择收货单明细 |
|
|
|
const chooseReceiptList = ()=>{ |
|
|
|
if(!formRef.value.formRef.formModel.itemCode){ |
|
|
@ -871,19 +937,30 @@ const chooseReceiptList = ()=>{ |
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
// 选择收货单明细 |
|
|
|
// 选择收货单明细、直接选择采购订单 |
|
|
|
const searchTableSuccess1 = (formField, searchField, val, type, row) => { |
|
|
|
console.log('searchTableSuccess1',formField, searchField, val, type, row) |
|
|
|
|
|
|
|
if(formField=='hahaha'){ |
|
|
|
// 选择收货单明细 |
|
|
|
const setV = {} |
|
|
|
setV['hehehe'] = '' |
|
|
|
setV['hahaha'] = val[0]['receiptNumber'] |
|
|
|
setV['poNumber'] = val[0]['poNumber'] |
|
|
|
setV['poLine'] = val[0]['poLine'] |
|
|
|
setV['receiptNumber'] = val[0]['receiptNumber'] |
|
|
|
setV['asnNumber'] = val[0]['asnNumber'] |
|
|
|
formRef.value.formRef.setValues(setV) |
|
|
|
}else if(formField=='hehehe'){ |
|
|
|
// 直接选择采购订单 |
|
|
|
const setV = {} |
|
|
|
setV['hahaha'] = '' |
|
|
|
setV['hehehe'] = val[0]['number'] |
|
|
|
setV['poNumber'] = val[0]['number'] |
|
|
|
setV['poLine'] = val[0]['lineNumber'] |
|
|
|
setV['receiptNumber'] = '' |
|
|
|
setV['asnNumber'] = '' |
|
|
|
formRef.value.formRef.setValues(setV) |
|
|
|
} |
|
|
|
} |
|
|
|
// 删除明细 |
|
|
|