Browse Source

HL-5906采购退货申请可以不选择收货单明细,直接选择采购订单号和采购订单行,详见原型方案

hella_online_20240913
yufei_wang 2 months ago
parent
commit
2bb358ba9c
  1. 83
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue
  2. 9
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts

83
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

@ -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)
}
}
//

9
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts

@ -148,7 +148,7 @@ export const PurchasereturnRequestMainNew = useCrudSchemas(
},
},
{
label: '',
label: ' ',
field: 'hehehe',
table: {
width: 180
@ -330,8 +330,11 @@ export const PurchasereturnRequestMainRulesNew = reactive({
supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' }
],
hahaha: [
required
poNumber: [
{ required: true, message: '请选择采购订单号', trigger: 'blur' }
],
poLine: [
{ required: true, message: '请选择订单行', trigger: 'blur' }
],
locationCode: [
{ required: true, message: '请选择收货单明细', trigger: 'blur' }

Loading…
Cancel
Save