Commit ae6e3738 authored by XieZhiXiong's avatar XieZhiXiong
parents 13156315 fb311c84
......@@ -24,7 +24,9 @@ export interface ModalTableProps extends IStandardTableProps<any> {
nestTableProps?: any,
// fix: 新增参数, 为true时每次开启弹窗都会重新reload接口
forceRender?: boolean,
searchName?: string
searchName?: string,
invoicesNo?: string, // 对应订单号/售后单号
relevanceType?: number, //对应单据类型
}
export const logisticsDeliverySearchSchema: ISchema = {
......@@ -93,7 +95,7 @@ export const logisticsDeliverySearchSchema: ISchema = {
}
const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
const { width = 704, confirm, cancel, visible, currentRef, resetModal, modalType = 'none', forceRender, useNestTable = false, nestColumns, nestTableProps, searchName, ...resetTable } = props
const { width = 704, confirm, cancel, visible, currentRef, resetModal, modalType = 'none', forceRender, useNestTable = false, nestColumns, nestTableProps, searchName, invoicesNo, relevanceType, ...resetTable } = props
const selfRef = currentRef || useRef<any>({})
useEffect(() => {
if (visible && forceRender) {
......@@ -121,9 +123,15 @@ const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
}
useEffect(() => {
console.log(relevanceType)
setType(relevanceType)
}, [relevanceType])
useEffect(() => {
form.setFieldsValue({
radio: type
})
console.log('执行')
fetchData()
}, [type])
......@@ -138,6 +146,7 @@ const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
})
break;
case 2:
break;
case 3:
break;
......
......@@ -25,10 +25,11 @@ export interface interfaceinfo {
currentRef?: any,
onGet?: Function,
onBadge?: Function,
addId?: Number,
}
const BasicInfo: React.FC<interfaceinfo> = (props) => {
const { set, currentRef, onGet, onBadge } = props;
const { set, currentRef, onGet, onBadge, addId } = props;
const [listcompany, setlistcompany] = useState<any>([]);//物流服务商
const [shipperaddress, setshipperaddress] = useState<any>([]);//发货地址
const [shippingvisible, setshippingvisible] = useState<boolean>(false);
......@@ -176,15 +177,8 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
})
}
useEffect(() => {
/**编辑回显数据 */
if (set.id) {
form.setFieldsValue({
digest: set.digest,
companyId: set.companyId,
shipmentOrderCode: set.shipmentOrderCode
})
if (set.shipmentOrderCode) {
/**编辑是调用选择对应发货单 */
const getShipmentOrder = () => {
const params = {
invoicesNo: set.shipmentOrderCode,
invoicesType: '',
......@@ -204,15 +198,64 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
resolve(res.data)
}
})
}).then((res:any) => {
}).then((res: any) => {
shippingRowCtl.setSelectRow(res.data);
shippingRowCtl.setSelectedRowKeys(res.data.map(v => v.id));
onGet(res.data[0], 2);
})
}
/** 编辑是调用对应订单号/售后单 */
const getInvoicesOrder = (type: number) => {
switch (type) {
case 1:
PublicApi.getOrderLogisticsOrderList({orderNo: set.invoicesNo}).then((res:any) => {
if (res.code === 1000) {
const {data} = res.data;
invoicesRowCtl.setSelectRow(data);
invoicesRowCtl.setSelectedRowKeys(data.map(v => v.id));
onGet(data[0], 3);
}
})
break;
case 2:
break;
case 3:
break;
case 4:
break;
}
}
useEffect(() => {
/**编辑回显数据 */
if (set.id) {
form.setFieldsValue({
digest: set.digest,
companyId: set.companyId,
shipmentOrderCode: set.shipmentOrderCode,
invoicesNo: set.invoicesNo,
})
if (set.shipmentOrderCode) {
getShipmentOrder()
}
}
}, [set.id])
/**从别处来新增的 */
useEffect(() => {
if (addId) {
form.setFieldsValue({
shipmentOrderCode: set.shipmentOrderCode,
invoicesNo: set.invoicesNo,
})
if (set.shipmentOrderCode) {
getShipmentOrder()
getInvoicesOrder(Number(set.relevanceType))
}
}
}, [addId])
return (
<>
<Form
......@@ -277,6 +320,8 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
width={900}
visible={invoicesvisible}
columns={invoicesColumns}
invoicesNo={set.invoicesNo}
relevanceType={set.relevanceType}
resetModal={{ destroyOnClose: true }}
tableProps={{ rowKey: 'id' }}
modalType='none'
......
......@@ -50,15 +50,16 @@ const AddEditLogistics: React.FC<{}> = () => {
})
const [settlementMethod, setSettlementMethod] = useState<any>();
const [memberInfo, setmemberInfo] = useState<any>({});
const [badge, setbadge] = useState<any>([0,0,0]);
const [badge, setbadge] = useState<any>([0, 0, 0]);
const { pathname, query } = history.location;
const type = pathname.split('/')[pathname.split('/').length - 1];
const [addId, setAddId] = useState<number>(0);
// 提交数据
const handleSubmit = async () => {
const basicRef = await basic.current.get();
const goodsRef = await goods.current.get();
if (basicRef.state && goodsRef.state) {
if( parmas.detailList.length > 0 ) {
if (parmas.detailList.length > 0) {
const data = { ...basicRef.data };
data.invoicesNo = parmas.invoicesNo;
data.receiverMemberId = parmas.receiverMemberId;
......@@ -67,9 +68,9 @@ const AddEditLogistics: React.FC<{}> = () => {
data.detailList = parmas.detailList;
data.createType = parmas.createType;
console.log(data)
if(type === 'add') {
PublicApi.postLogisticsOrderWaitSubmitAdd({...data}).then(res => {
if(res.code === 1000) {
if (type === 'add') {
PublicApi.postLogisticsOrderWaitSubmitAdd({ ...data }).then(res => {
if (res.code === 1000) {
history.goBack()
}
})
......@@ -78,7 +79,7 @@ const AddEditLogistics: React.FC<{}> = () => {
console.log(data)
}
}
} else if(!goodsRef.state) {
} else if (!goodsRef.state) {
setbadge(badge[1] = 1)
message.error('请先添加商品')
}
......@@ -89,7 +90,7 @@ const AddEditLogistics: React.FC<{}> = () => {
const data = { ...parmas };
if (index === 1) {
data.companyName = value.children
setmemberInfo({memberId: value.memberid,roleId: value.roleid})
setmemberInfo({ memberId: value.memberid, roleId: value.roleid })
} else if (index === 2) {
data.shipmentOrderCode = value.invoicesNo;//发货单号
data.receiverPhone = value.phone;
......@@ -111,22 +112,22 @@ const AddEditLogistics: React.FC<{}> = () => {
}
/**必填没填写出现角标 */
const getError = (num:number, idx:number) => {
const getError = (num: number, idx: number) => {
const data = [...badge];
data[idx] = num;
setbadge(data);
}
const getGoodsList = (list:any) => {
const data = {...parmas}
const getGoodsList = (list: any) => {
const data = { ...parmas }
data.detailList = list;
setParmas(data);
}
useEffect(() => {
if(Object.keys(memberInfo).length > 0) {
PublicApi.getSettleAccountsPlatformConfigGetSettlementWay({...memberInfo}).then(res => {
if(res.code === 1000) {
if (Object.keys(memberInfo).length > 0) {
PublicApi.getSettleAccountsPlatformConfigGetSettlementWay({ ...memberInfo }).then(res => {
if (res.code === 1000) {
console.log(res.data)
}
}).catch(error => {
......@@ -136,15 +137,25 @@ const AddEditLogistics: React.FC<{}> = () => {
}, [memberInfo])
useEffect(() => {
const id = query.id
if(id && type === 'edit') {
PublicApi.getLogisticsOrderWaitSubmitGet({id}).then(res => {
if(res.code === 1000) {
const { id, createType, shipmentOrderCode, invoicesNo, relevanceType } = query;
if (id && type === 'edit') {
PublicApi.getLogisticsOrderWaitSubmitGet({ id }).then(res => {
if (res.code === 1000) {
setParmas(res.data)
}
})
} else if(id && type === 'add') {
const data = { ...parmas };
if (createType && shipmentOrderCode && invoicesNo && relevanceType) {
data.createType = Number(createType);
data.shipmentOrderCode = shipmentOrderCode;
data.invoicesNo = invoicesNo;
data.relevanceType = Number(relevanceType);
setParmas(data);
setAddId(Number(id));
}
}
},[])
}, [])
return (
<PageHeaderWrapper
......@@ -156,6 +167,7 @@ const AddEditLogistics: React.FC<{}> = () => {
<Tabs type="card">
<TabPane key='tab-1' tab={<TabFormErrors dot={badge[0]}>基本信息</TabFormErrors>} forceRender>
<BasicInfo
addId={addId}
currentRef={basic}
set={parmas}
onBadge={getError}
......
......@@ -244,11 +244,16 @@ const PaySetting: React.FC<{}> = () => {
// }
console.log('list', list)
PublicApi.postPayMemberQueryPlatformUpdate({
platformPayWays:[
{
id: tabid,
isPitchOn: isPitchOn,
way: way.toString(),
payType: Number(payType),
payParametersAddListRequests: list
}
]
}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
......
......@@ -33,7 +33,7 @@ export const commonEnquieryOfferSchema: ISchema = {
},
"x-component-props":{
placeholder:'报价单搜索'
placeholder:'报价单'
}
}
}
......
......@@ -101,12 +101,11 @@ export const useSelfTable = () => {
const handleConfirm = async (record) => {
const params = {
orderId: record.id,
invoicesTypeId: 2,
shipmentOrderCode: record.invoiceNumber,
orderDeliveryDetailsId: record.orderDeliveryDetailsId,
invoicesNo: record.orderNo,
invoicesId: record.id
id: record.id,
createType: 2,// 创建方式
shipmentOrderCode: record.invoiceNumber,// 发货单号
invoicesNo: record.orderNo, // 对应订单号/售后单
relevanceType: 1
}
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?${qs.stringify(params)}`)
}
......
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