Commit 7dc42c14 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 询价下单/现货下单接口共用替换

parent 38534b91
......@@ -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": {
......
......@@ -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