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,43 +177,85 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
})
}
/**编辑是调用选择对应发货单 */
const getShipmentOrder = () => {
const params = {
invoicesNo: set.shipmentOrderCode,
invoicesType: '',
invoicesAbstract: '',
memberName: '',
inventoryId: '',
startTransactionTime: '',
endTransactionTime: '',
orderNo: '',
state: '',
current: '1',
pageSize: '1'
}
new Promise(resolve => {
PublicApi.getWarehouseInvoicesList({ ...params }).then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
}).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
shipmentOrderCode: set.shipmentOrderCode,
invoicesNo: set.invoicesNo,
})
if (set.shipmentOrderCode) {
const params = {
invoicesNo: set.shipmentOrderCode,
invoicesType: '',
invoicesAbstract: '',
memberName: '',
inventoryId: '',
startTransactionTime: '',
endTransactionTime: '',
orderNo: '',
state: '',
current: '1',
pageSize: '1'
}
new Promise(resolve => {
PublicApi.getWarehouseInvoicesList({ ...params }).then((res: any) => {
if (res.code === 1000) {
resolve(res.data)
}
})
}).then((res:any) => {
shippingRowCtl.setSelectRow(res.data);
shippingRowCtl.setSelectedRowKeys(res.data.map(v => v.id));
onGet(res.data[0], 2);
})
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}
......
This diff is collapsed.
......@@ -6,8 +6,8 @@ import { PublicApi } from '@/services/api'
/**
* @description: 公用
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const commonEnquieryOfferSchema: ISchema = {
type:'object',
......@@ -33,7 +33,7 @@ export const commonEnquieryOfferSchema: ISchema = {
},
"x-component-props":{
placeholder:'报价单搜索'
placeholder:'报价单'
}
}
}
......@@ -63,7 +63,7 @@ export const commonEnquieryOfferSchema: ISchema = {
inquiryListNo:{//需求单号
type:'string',
"x-mega-props":{
},
"x-component-props":{
placeholder:'询价单号'
......@@ -95,7 +95,7 @@ export const commonEnquieryOfferSchema: ISchema = {
sumbit:{
"x-component":'Submit',
"x-mega-props":{
span:1
span:1
},
"x-component-props":{
children:'查询'
......@@ -108,8 +108,8 @@ export const commonEnquieryOfferSchema: ISchema = {
/**
* @description: 需求报价-需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const enquierySearchSchema: ISchema = {
type:'object',
......@@ -207,8 +207,8 @@ export const enquierySearchSchema: ISchema = {
/**
* @description: 需求报价-报价查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const enquieryOfferSearchSchema: ISchema = {
type:'object',
......@@ -293,8 +293,8 @@ export const enquieryOfferSearchSchema: ISchema = {
/**
* @description: 报价单新增编辑-需求单查询
* @param {type}
* @return {type}
* @param {type}
* @return {type}
*/
export const dialogEqformSearch: ISchema = {
type:'object',
......@@ -376,7 +376,7 @@ export const dialogEqformSearch: ISchema = {
}
/**
* @description: 报价单查询-搜索
* @param {type}
* @param {type}
* @return {type}
*/
export const quoteFormSearch: ISchema = {
......@@ -485,4 +485,4 @@ export const quoteFormSearch: ISchema = {
}
}
}
}
\ No newline at end of file
}
......@@ -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