Commit a616819c authored by GuanHua's avatar GuanHua
parents a13b185e a265f520
......@@ -34,16 +34,16 @@ export const productModalByMemberSchema: ISchema = {
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: () => {
let merber = sessionStorage.getItem('memberInfo');
let meberInfo = JSON.parse(merber)
return new Promise(resolve => {
PublicApi.getProductSelectGetMemberCategory({ name: '', ...meberInfo}).then(res => {
console.log(res.data, 10086)
resolve(res)
})
})
},
// fetchSearch: () => {
// let merber = sessionStorage.getItem('memberInfo');
// let meberInfo = JSON.parse(merber)
// return new Promise(resolve => {
// PublicApi.getProductSelectGetMemberCategory({ name: '', ...meberInfo}).then(res => {
// console.log(res.data, 10086)
// resolve(res)
// })
// })
// },
style: {
width: 160
}
......@@ -54,16 +54,16 @@ export const productModalByMemberSchema: ISchema = {
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: () => {
let merber = sessionStorage.getItem('memberInfo');
let meberInfo = JSON.parse(merber)
return new Promise(resolve => {
PublicApi.getProductSelectGetMemberBrand({ name: '', ...meberInfo}).then(res => {
console.log(res.data, 10086)
resolve(res)
})
})
},
// fetchSearch: () => {
// let merber = sessionStorage.getItem('memberInfo');
// let meberInfo = JSON.parse(merber)
// return new Promise(resolve => {
// PublicApi.getProductSelectGetMemberBrand({ name: '', ...meberInfo}).then(res => {
// console.log(res.data, 10086)
// resolve(res)
// })
// })
// },
style: {
width: 160
}
......@@ -176,19 +176,6 @@ export const addOrderModalSchema: ISchema = {
},
},
properties: {
// customerCategoryId: {
// type: 'string',
// "x-component": 'SearchSelect',
// "x-component-props": {
// placeholder: '请选择品类',
// className: 'fixed-ant-selected-down',
// fetchSearch: PublicApi.getProductSelectGetMemberCategory,
// style: {
// width: 160
// },
// queryParams: {},
// }
// },
customerCategoryId: {
type: 'string',
'x-component': 'CustomCategorySearch',
......@@ -203,16 +190,31 @@ export const addOrderModalSchema: ISchema = {
},
brandId: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetMemberBrand,
style: {
width: 160
},
queryParams: {},
}
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品牌',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px' },
searchValue: null,
dataoption: [],
},
},
// brandId: {
// type: 'string',
// "x-component": 'SearchSelect',
// "x-component-props": {
// placeholder: '请选择品牌',
// fetchSearch: PublicApi.getProductSelectGetMemberBrand,
// style: {
// width: 160
// },
// queryParams: {},
// }
// },
submit: {
"x-component": 'Submit',
"x-mega-props": {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-23 09:59:10
* @LastEditTime: 2021-10-26 10:32:48
* @Description: 维修商品抽屉组件
*/
import React from 'react';
......@@ -180,7 +180,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
const newData: { [key: string]: any }[] = data.map((item) => ({
...item,
id: item.orderId,
products: item.products.map(({ productId, ...rest }) => ({
products: item.products.map(({ productId, logo, ...rest }) => ({
id: productId,
...rest,
quantity: +rest.quantity,
......@@ -193,6 +193,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
orderType: item.orderType,
contractId: item.contractId,
contractNo: item.contractNo,
skuPic: logo,
shopId: item.shopId,
shopLogo: item.logo,
shopName: item.vendorMemberName,
})),
}));
newData.forEach((item) => {
......
......@@ -360,6 +360,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
replaceId,
manualReplaceGoodsAddress,
returnBatch,
shopName,
shopId,
shopLogo,
...rest
} = res.data;
......@@ -414,6 +417,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
orderId: item.orderId,
},
associated: !item.associatedProductId ? '' : `${item.associatedProductId}/${item.associatedProductName}/${item.associatedType || ' '}/${item.associatedCategory}/${item.associatedBrand}`,
shopName,
shopId,
shopLogo,
})),
...rest,
});
......@@ -585,7 +591,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
unit,
extraData,
associated,
materielNameAndType,
shopId,
shopLogo,
shopName,
...rest
}) => ({
...rest,
......@@ -594,7 +602,10 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
orderRecordId: extraData.id,
replaceCount: +replaceCount,
})),
taskTypeKey: replaceGoodsList[0].extraData.taskTypeKey,
taskTypeKey: replaceGoodsList[0].extraData.taskTypeKey,
shopId: replaceGoodsList[0].shopId,
shopLogo: replaceGoodsList[0].shopLogo,
shopName: replaceGoodsList[0].shopName,
};
PublicApi.postAsReplaceGoodsSave(payload)
......@@ -681,6 +692,10 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
associatedBrand: item.quotedBrand || '',
associatedUnit: item.unit || '',
skuId: item.skuId,
skuPic: item.skuPic,
shopId: item.shopId,
shopLogo: item.shopLogo,
shopName: item.shopName,
};
value.push(atom);
});
......
......@@ -90,6 +90,21 @@ const OrderNo = (props: OrderNoProps) => {
};
OrderNo.isFieldComponent = true;
type ExtraType = {
/**
* 商城名称
*/
shopName: string,
/**
* 商城id
*/
shopId: number,
/**
* 商城logo
*/
shopLogo: string,
}
const RepairForm: React.FC<BillsFormProps> = ({
id,
isEdit = false,
......@@ -201,7 +216,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
];
// 获取维修明细列表
const getRepairGoods = () => {
const getRepairGoods = (extra: ExtraType) => {
if (!id) {
return;
}
......@@ -220,6 +235,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
remaining: item.purchaseCount || 0, // 已维修数量,这里取 采购数量判断即可
},
associated: !item.associatedProductId ? '' : `${item.associatedProductId}/${item.associatedProductName}/${item.associatedType || ' '}/${item.associatedCategory}/${item.associatedBrand}`,
...extra,
})));
setGoodsValue(res.data && res.data.data ? res.data.data.map(item => item.orderRecordId) : []);
}
......@@ -254,6 +270,9 @@ const RepairForm: React.FC<BillsFormProps> = ({
outerRecordList,
outerStatus,
outerTaskList,
shopName,
shopId,
shopLogo,
...rest
} = res.data;
......@@ -264,6 +283,12 @@ const RepairForm: React.FC<BillsFormProps> = ({
}
);
getRepairGoods({
shopName,
shopId,
shopLogo,
});
setOrderTypeValue(rest.orderType);
setDetailInfo({
...detailInfo,
......@@ -377,7 +402,6 @@ const RepairForm: React.FC<BillsFormProps> = ({
useEffect(() => {
getDetailInfo();
getOrderDetailInfo();
getRepairGoods();
}, []);
const handleAddGoods = () => {
......@@ -438,7 +462,9 @@ const RepairForm: React.FC<BillsFormProps> = ({
unit,
extraData,
associated,
materielNameAndType,
shopId,
shopLogo,
shopName,
...rest
}) => ({
orderId: extraData.orderId,
......@@ -448,7 +474,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
unit: unit || '',
...rest,
})),
...rest,
...rest,
shopId: repairGoodsList[0].shopId,
shopLogo: repairGoodsList[0].shopLogo,
shopName: repairGoodsList[0].shopName,
};
PublicApi.postAsRepairGoodsSave(payload)
......@@ -528,6 +557,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
associatedBrand: item.quotedBrand || '',
associatedUnit: item.unit || '',
skuId: item.skuId,
skuPic: item.skuPic,
shopId: item.shopId,
shopLogo: item.shopLogo,
shopName: item.shopName,
};
value.push(atom);
});
......
......@@ -368,6 +368,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
returnId,
roleId,
refundList,
shopName,
shopId,
shopLogo,
...rest
} = res.data;
......@@ -417,6 +420,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
remaining: item.purchaseCount || 0, // 可退货数量,这里取 采购数量判断即可
},
associated: !item.associatedProductId ? '' : `${item.associatedProductId}/${item.associatedProductName}/${item.associatedType || ' '}/${item.associatedCategory}/${item.associatedBrand}`,
shopId,
shopLogo,
shopName,
})),
...rest,
});
......@@ -587,6 +593,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
associated,
returnCount,
refundAmount,
shopId,
shopLogo,
shopName,
...rest
}) => ({
...rest,
......@@ -608,7 +617,10 @@ const ReturnForm: React.FC<BillsFormProps> = ({
};
}),
})),
taskTypeKey: returnGoodsList[0].extraData.taskTypeKey,
taskTypeKey: returnGoodsList[0].extraData.taskTypeKey,
shopId: returnGoodsList[0].shopId,
shopLogo: returnGoodsList[0].shopLogo,
shopName: returnGoodsList[0].shopName,
};
PublicApi.postAsReturnGoodsSave(payload)
......@@ -707,6 +719,10 @@ const ReturnForm: React.FC<BillsFormProps> = ({
associatedBrand: item.quotedBrand || '',
associatedUnit: item.unit || '',
skuId: item.skuId,
skuPic: item.skuPic,
shopId: item.shopId,
shopLogo: item.shopLogo,
shopName: item.shopName,
};
value.push(atom);
});
......
......@@ -55,8 +55,8 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
</div>
}
</div>, resetCol: {flex: '1 1 100%'} },
{ title: '包装要求', name: 'requirement.pageRequire', render: (t, d) => d.requirement.detail?.pageRequire || '' },
{ title: '其他要求', name: 'requirement.restsRequire', render: (t, d) => d.requirement.detail?.restsRequire || '' },
{ title: '包装要求', name: 'requirement', render: (t, d) => d.requirement.detail?.pageRequire || '' },
{ title: '其他要求', name: 'requirement', render: (t, d) => d.requirement.detail?.restsRequire || '' },
]
return (
......
......@@ -37,7 +37,7 @@ export const fetchOrderApi = {
},
/** 获取支付信息列表 */
async getPayInfoList(params) {
const { data } = await PublicApi.postOrderBuyerCreateB2bPaymentFind(params, { ctlType: 'none' })
const { data } = await PublicApi.postOrderBuyerCreatePaymentFind(params, { ctlType: 'none' })
return data
},
......
......@@ -26,7 +26,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
const initPayWayList = (memberId, memberRoleId) => {
let result = []
PublicApi.getOrderBuyerCreateB2bPayTypes({vendorMemberId: memberId, vendorRoleId: memberRoleId}).then(res => {
PublicApi.getOrderBuyerCreatePayTypes({vendorMemberId: memberId, vendorRoleId: memberRoleId}).then(res => {
const { data = [], code } = res
for (let item of data) {
result.push({
......@@ -40,7 +40,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
const getPayLists = (memberId, memberRoleId) => {
PublicApi.postOrderBuyerCreateB2bPaymentFind({
PublicApi.postOrderBuyerCreatePaymentFind({
memberId,
roleId: memberRoleId,
shopId: products[0]['shopId'],
......
......@@ -37,7 +37,7 @@ export const fetchOrderApi = {
},
/** 获取支付信息列表 */
async getPayInfoList(params) {
const { data } = await PublicApi.postOrderBuyerCreateB2bPaymentFind(params, { ctlType: 'none' })
const { data } = await PublicApi.postOrderBuyerCreatePaymentFind(params, { ctlType: 'none' })
return data
},
......
......@@ -296,7 +296,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
params.shopName = shop['label']
if(id) {
fnResult = await PublicApi.postOrderBuyerCreateUpdate({..._params, orderId: id})
fnResult = await PublicApi.postOrderBuyerCreatePurchaseUpdate({..._params, orderId: id})
} else {
fnResult = await PublicApi.postOrderBuyerCreatePurchase(_params)
}
......
......@@ -26,7 +26,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
const initPayWayList = (memberId, memberRoleId) => {
let result = []
PublicApi.getOrderBuyerCreateB2bPayTypes({vendorMemberId: memberId, vendorRoleId: memberRoleId}).then(res => {
PublicApi.getOrderBuyerCreatePayTypes({vendorMemberId: memberId, vendorRoleId: memberRoleId}).then(res => {
const { data = [], code } = res
for (let item of data) {
result.push({
......@@ -40,7 +40,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
const getPayLists = (memberId, memberRoleId) => {
PublicApi.postOrderBuyerCreateB2bPaymentFind({
PublicApi.postOrderBuyerCreatePaymentFind({
memberId,
roleId: memberRoleId,
shopId: products[0]['shopId'],
......
......@@ -11,8 +11,9 @@ import Search from '@/components/NiceForm/components/Search'
import SearchSelect from '@/components/NiceForm/components/SearchSelect';
import Submit from '@/components/NiceForm/components/Submit';
import DateSelect from '@/components/NiceForm/components/DateSelect';
import { searchCustomerCategoryOptionEffect } from '../../effects'
import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from '../../effects'
import CustomCategorySearch from '@/components/NiceForm/components/CustomCategorySearch'
import CustomInputSearch from '@/components/NiceForm/components/CustomInputSearch'
export interface ProductModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
......@@ -130,7 +131,6 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
v.shopId = schemaAction.getFieldValue('shopId')
return v
})
console.log(newData, 'nnn')
schemaAction.setFieldValue('products', await filterProductDataById([], newData))
confirmModal && confirmModal()
setVisible(false)
......@@ -175,7 +175,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
formilyProps={{
ctx: {
schema: addOrderModalSchema,
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect, CustomCategorySearch },
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect, CustomCategorySearch, CustomInputSearch },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
......@@ -183,20 +183,11 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
'name',
FORM_FILTER_PATH,
);
// actions.setFieldState('customerCategoryId', state => {
// state.props['x-component-props'].queryParams = {
// memberId: schemaAction.getFieldValue('supplyMembersId'),
// memberRoleId: schemaAction.getFieldValue('supplyMembersRoleId')
// }
// })
FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(schemaAction, actions, 'customerCategoryId')
})
actions.setFieldState('brandId', state => {
state.props['x-component-props'].queryParams = {
memberId: schemaAction.getFieldValue('supplyMembersId'),
memberRoleId: schemaAction.getFieldValue('supplyMembersRoleId')
}
FormEffectHooks.onFieldChange$('brandId').subscribe(state => {
searchBrandOptionEffect(schemaAction, actions, 'brandId')
})
}
}
......
......@@ -192,8 +192,8 @@ export const useInvoiceList = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
}
}
// 高级筛选schema中用于输入搜索商品品类的Effect
/**
* 高级筛选schema中用于获取供应商 商品品类Effect
* @param ctx 外部表单action
* @param mctx 模态框表单action
* @param fieldName 字段名称
......@@ -203,6 +203,7 @@ export const searchCustomerCategoryOptionEffect = (ctx: any, mctx: any, fieldNam
params['memberId'] = ctx.getFieldValue('vendorMemberId')
params['memberRoleId'] = ctx.getFieldValue('vendorRoleId')
mctx.getFieldState(fieldName, state => {
// params['name'] = state.props['x-component-props'].searchValue
PublicApi.getProductCustomerGetMemberCustomerCategoryTree(params).then(res => {
mctx.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
......@@ -210,3 +211,23 @@ export const searchCustomerCategoryOptionEffect = (ctx: any, mctx: any, fieldNam
})
})
}
/**
* 高级筛选schema中用于获取供应商 商品品牌Effect
* @param ctx 外部表单action
* @param mctx 模态框表单action
* @param fieldName 字段名称
*/
export const searchBrandOptionEffect = (ctx: any, mctx: any, fieldName: string) => {
const params: any = {}
params['memberId'] = ctx.getFieldValue('vendorMemberId')
params['memberRoleId'] = ctx.getFieldValue('vendorRoleId')
mctx.getFieldState(fieldName, state => {
params['name'] = state.props['x-component-props'].searchValue
PublicApi.getProductSelectGetMemberBrand(params).then(res => {
mctx.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
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