Commit d581f6a9 authored by shenshaokai's avatar shenshaokai

Merge branch 'jinfa-20221102' into 'jinfa-20221102'

fix: bugID=35880 请购单变更编辑新增参数给后端 See merge request project/jinfa-platform!474
parents ee7bec1c 45153df3
......@@ -107,7 +107,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
const [formLoading, setFormLoading] = useState(false)
const [btnLoading, setBtnLoading] = useState(false)
const update = useUpdate()
const { id } = usePageStatus()
const { id, changeFlag } = usePageStatus()
const [initFormValue, setInitFormValue] = useState<any>({})
const { formContext } = useFormDetail()
const rowvendorMemberInfoRef = useRef<any>({});
......@@ -138,7 +138,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>()
// 请购单物料
const { materialAddButton, materialRef, materialColumns, salemanRef, _record, materialComponents, materialChildren, inventoryRef, ...surplusProps } = useMaterialTable(addSchemaAction,{ enclosureRef })
const { materialAddButton, materialRef, materialColumns, salemanRef, _record, materialComponents, materialChildren, inventoryRef, ...surplusProps } = useMaterialTable(addSchemaAction, { enclosureRef })
/** 获取付款计划 */
const getPaymentPlan = () => {
......@@ -250,7 +250,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
// addSchemaAction.setFieldValue('vendorMemberName', userInfo.orgName || '')
// addSchemaAction.setFieldValue('deliveryType', userInfo.orgId || '')
addSchemaAction.setFieldValue('departmentId', userInfo.orgId||'')
addSchemaAction.setFieldValue('departmentId', userInfo.orgId || '')
addSchemaAction.setFieldValue('department', userInfo.orgName || '')
}
}
......@@ -321,6 +321,9 @@ const IncreaseRequisition: React.FC<{}> = () => {
}
if (id) {
if (changeFlag) {
Object.assign(_params, { changeFlag })
}
fnResult = await postPurchaseRequisitionUpdate({ ..._params, id })
} else {
fnResult = await postPurchaseRequisitionCreate(_params)
......@@ -449,7 +452,7 @@ const IncreaseRequisition: React.FC<{}> = () => {
deliveryTypeListRef.current.deliveryTypeList = deliveryTypeList;
let deliveryMethods: any[] = res.data.deliveryMethods.map((item) => { return { label: item.deliveryMethodName, value: item.deliveryMethod } })
addSchemaAction.setFieldValue('deliveryMethod', 1)
setTimeout(()=>{
setTimeout(() => {
onChangeAddress(
{
values: [
......@@ -625,12 +628,12 @@ const IncreaseRequisition: React.FC<{}> = () => {
const currencyMap = fnMap(res.data?.currencyMap)
linkage.enum('business', businessTypeMap)
// 默认小料
if(res.data?.businessTypeMap?.['1'] ==='小料') addSchemaAction.setFieldValue('business', '1')
if (res.data?.businessTypeMap?.['1'] === '小料') addSchemaAction.setFieldValue('business', '1')
linkage.enum('currency', currencyMap)
})
getMemberParameterManageGetArrivalArea().then((res: any) => {
// const arrivalAreaMap = fnMap(res.data)
linkage.enum('arrivalArea', res.data.map(el=>({label:el.name,value:el.key})));
linkage.enum('arrivalArea', res.data.map(el => ({ label: el.name, value: el.key })));
})
})
}
......
......@@ -114,13 +114,13 @@ const RequestBill: React.FC<RequestBillProps> = () => {
setCurrentId(record.id);
break;
case 2:
history.push(`/memberCenter/procurementAbility/purchaseRequisition/readyAddBill/edit?id=${record.id}`)
history.push(`/memberCenter/procurementAbility/purchaseRequisition/readyAddBill/edit?id=${record.id}&changeFlag=1`)
break;
case 3:
postPurchaseRequisitionToVoid({id:record.id}).then(res=>{
if(res.code===1000) ref.current.reloadCurrent()
})
break
}
}
......@@ -146,7 +146,7 @@ const RequestBill: React.FC<RequestBillProps> = () => {
[intl.formatMessage({
id: 'purchaseRequisition.cehui',
defaultMessage: '撤回审核',
})]: record.revokeProcessFlag===1,
})]: record.revokeProcessFlag===1,
[intl.formatMessage({
id: 'purchaseRequisition.biangeng',
defaultMessage: '变更',
......
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