Commit 858fe182 authored by XieZhiXiong's avatar XieZhiXiong
parents bc901a26 957577a3
...@@ -143,8 +143,8 @@ export const upperCommodityColumns: ColumnType<any>[] = [ ...@@ -143,8 +143,8 @@ export const upperCommodityColumns: ColumnType<any>[] = [
title: '商品名称', title: '商品名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
// width: 240, width: 240,
// ellipsis: true, ellipsis: true,
}, },
{ {
title: '商品品类', title: '商品品类',
......
...@@ -99,7 +99,7 @@ export const GivenBidItem:React.FC<GivenBidItemProps> = ({ ...@@ -99,7 +99,7 @@ export const GivenBidItem:React.FC<GivenBidItemProps> = ({
defaultValue={currentData[currentColumn.dataIndex]['awardRate']} defaultValue={currentData[currentColumn.dataIndex]['awardRate']}
min={0} min={0}
max={100} max={100}
formatter={value => `${value}%`} formatter={value => `${Math.floor(Number(value) * 100) / 100}%`}
parser={value => value.replace('%', '')} parser={value => value.replace('%', '')}
onChange={onChangeInput} onChange={onChangeInput}
style={{display: 'none'}} style={{display: 'none'}}
......
...@@ -37,7 +37,7 @@ export const fetchOrderApi = { ...@@ -37,7 +37,7 @@ export const fetchOrderApi = {
}, },
/** 获取支付信息列表 */ /** 获取支付信息列表 */
async getPayInfoList(params) { async getPayInfoList(params) {
const { data } = await PublicApi.getOrderInitializationPaymentInformation(params) const { data } = await PublicApi.postOrderBuyerCreateB2bPaymentFind(params)
return data return data
}, },
......
...@@ -32,7 +32,7 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => { ...@@ -32,7 +32,7 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
const handleConfirm = async () => { const handleConfirm = async () => {
const item = rowSelectionCtl.selectRow[0] const item = rowSelectionCtl.selectRow[0]
if (item) { if (item) {
schemaAction.setFieldValue('quotationNo', item.quotationNo) schemaAction.setFieldValue('quoteNo', item.quotationNo)
const data = await fetchOrderApi.getProductListByQuotationOrderId({ const data = await fetchOrderApi.getProductListByQuotationOrderId({
id: item.inquiryListId id: item.inquiryListId
}) })
...@@ -50,11 +50,11 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => { ...@@ -50,11 +50,11 @@ const InquiryModalTable:React.FC<InquiryModalTableProps> = (props) => {
}) })
// 把地址信息冗余给商品字段render // 把地址信息冗余给商品字段render
schemaAction.setFieldValue('products', await filterProductDataById([], newData)) schemaAction.setFieldValue('products', await filterProductDataById([], newData))
schemaAction.setFieldValue('supplyMembersName', item.offerMemberName) schemaAction.setFieldValue('vendorMemberName', item.offerMemberName)
schemaAction.setFieldValue('supplyMembersId', item.offerMemberId) schemaAction.setFieldValue('vendorMemberId', item.offerMemberId)
schemaAction.setFieldValue('supplyMembersRoleId', item.offerMemberRoleId) schemaAction.setFieldValue('vendorRoleId', item.offerMemberRoleId)
// 询价单回显订单明细 // 询价单回显订单明细
schemaAction.setFieldValue('orderThe', item.details) schemaAction.setFieldValue('digest', item.details)
} }
confirmModal && confirmModal() confirmModal && confirmModal()
setVisible(false) setVisible(false)
......
import React, { useEffect } from 'react'
import ModalTable, { ModalTableProps } from '@/components/ModalTable'
import { fetchOrderApi } from '../../apis'
import { useModalTable } from '../../model/useModalTable'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { memberColumns } from '../../constant'
export interface MemberModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
schemaAction: ISchemaFormActions | ISchemaFormAsyncActions,
currentRef?: any,
confirmModal?(),
productRef?: any,
}
const MemberModalTable:React.FC<MemberModalTableProps> = (props) => {
const { type = 'radio', schemaAction, confirmModal, currentRef, ...restProps } = props
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type, customKey: 'id'})
useEffect(() => {
if (currentRef) {
currentRef.current = {
setVisible,
visible,
rowSelectionCtl
}
}
}, [])
const handleConfirm = () => {
const rowItem = rowSelectionCtl.selectRow[0]
if (rowItem) {
schemaAction.setFieldValue('supplyMembersName', rowItem.name)
schemaAction.setFieldValue('supplyMembersId', rowItem.memberId)
schemaAction.setFieldValue('supplyMembersRoleId', rowItem.roleId)
}
confirmModal && confirmModal()
setVisible(false)
// 清空之前可能存在的商品支付信息数据
schemaAction.setFieldValue('orderProductRequests', [])
schemaAction.setFieldValue('paymentInformationResponses', [])
if(props?.productRef) {
props.productRef.current.rowSelectionCtl.setSelectRow([])
props.productRef.current.rowSelectionCtl.setSelectedRowKeys([])
}
}
return (
<ModalTable
modalTitle='选择供应会员'
columns={memberColumns}
visible={visible}
confirm={handleConfirm}
cancel={() => setVisible(false)}
fetchTableData={(params) => fetchOrderApi.getMemberListByModelType({...params, orderType: schemaAction.getFieldValue('orderMode')})}
rowSelection={rowSelection}
modalType='memberByDefault'
tableProps={{
rowKey: 'id'
}}
{...restProps}
/>
)
}
MemberModalTable.defaultProps = {}
export default MemberModalTable
...@@ -21,7 +21,6 @@ const EditableContext = React.createContext<any>({}); ...@@ -21,7 +21,6 @@ const EditableContext = React.createContext<any>({});
export const EditableRow: React.FC<any> = (props) => { export const EditableRow: React.FC<any> = (props) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
// form.setFieldsValue()
const { options = [] } = props?.children[5]?.props.additionalProps.formItemProps || {} const { options = [] } = props?.children[5]?.props.additionalProps.formItemProps || {}
const [childOptions, setChildOptions] = useState<any[]>(() => { const [childOptions, setChildOptions] = useState<any[]>(() => {
const { payType } = props?.children[5]?.props.record || {} const { payType } = props?.children[5]?.props.record || {}
...@@ -66,7 +65,6 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({ ...@@ -66,7 +65,6 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
const formItemRef = useRef<any>(); const formItemRef = useRef<any>();
const { form, childOptions, setChildOptions, originOptions } = useContext(EditableContext); const { form, childOptions, setChildOptions, originOptions } = useContext(EditableContext);
// fix: 没有childOptions 导致第一次进入编辑页面无法显示支付渠道
let _childOptions = null; let _childOptions = null;
if(history.location.query?.id && title === "支付渠道") { if(history.location.query?.id && title === "支付渠道") {
let payList = originOptions.filter(item => item.payType === record.payType) || [] let payList = originOptions.filter(item => item.payType === record.payType) || []
...@@ -113,14 +111,14 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({ ...@@ -113,14 +111,14 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
const formId = dataIndex + colIndex const formId = dataIndex + colIndex
switch(type) { switch(type) {
case 'input': { case 'input': {
return <Input className="payRatio" ref={formItemRef} onPressEnter={save} onBlur={save} onChange={handleInputChange} {...formItemProps} id={formId}/> return <Input className="payRate" ref={formItemRef} onPressEnter={save} onBlur={save} onChange={handleInputChange} {...formItemProps} id={formId}/>
} }
case 'select': { case 'select': {
const { options, ...rest } = formItemProps const { options, ...rest } = formItemProps
// 支付方式 // 支付方式
if (dataIndex === 'payType') { if (dataIndex === 'payType') {
return <Select ref={formItemRef} return <Select ref={formItemRef}
options={originOptions.map(v => ({label: v.payTypeName, value: v.payType, disabled: v?.disabled}))} // ?? 仅限线下支付下面只有一种方式 options={originOptions.map(v => ({label: v.payTypeName, value: v.payType, disabled: v?.disabled}))}
onChange={e => { onChange={e => {
const result = originOptions.find(v => e === v.payType) const result = originOptions.find(v => e === v.payType)
setChildOptions(result.payChannels.map(v => ({label: v.payChannelName, value: v.payChannel}))) setChildOptions(result.payChannels.map(v => ({label: v.payChannelName, value: v.payChannel})))
......
...@@ -23,6 +23,71 @@ export const PriceComp = (props) => { ...@@ -23,6 +23,71 @@ export const PriceComp = (props) => {
</div> </div>
} }
/** 修改合同下单 初始值转换 */
export const procurmentRenderInit = (initValue: any) => {
return {
...initValue.requirement.detail,
vendorMemberId: initValue.vendorMemberId,
vendorMemberName: initValue.vendorMemberName,
vendorRoleId: initValue.vendorRoleId,
product: initValue.product,
deliveryAddresId: initValue.consignee.consigneeId,
hasInvoice: initValue.hasInvoice,
orderId: initValue.orderId,
orderKind: initValue.orderKind,
orderMode: initValue.orderMode,
orderModeName: initValue.orderModeName,
type: initValue.orderTypeName,
digest: initValue.digest,
deliverDate: initValue.consignee.deliverDate,
theInvoiceId: initValue.invoice?.invoiceId || null,
hasContract: initValue.hasContract,
contractNo: initValue.contract.contractNo,
contract: {...initValue.contract},
}
}
/** 修改采购合同下单 回显商品字段转换 */
export const procurementRenderField = (data) => {
const _orderProductRequests = data.product.products
return _orderProductRequests.map(item => {
return {
...item,
// 此id为sukId
relevanceProductId: item.quotedSkuId,
// relevanceSkuId: item.quotedSkuId,
relevanceProductName: item.quotedName,
relevanceProductBrand: item.quotedBrand,
relevanceProductCategory: item.quotedCategory,
relevanceProductSpec: item.quotedSpec,
logistics: item.deliverType,
id: item.productId,
code: item.productNo,
type: item.spec,
// 冗余memberId memberRoleId查询自提地址使用
memberId: data.vendorMemberId,
memberRoleId: data.vendorRoleId,
}
})
}
/** B2B询价报价下单 字段转换 */
export const procurementProcessField = (value) => {
value.products = value.products.map(item => {
return {
...item,
productId: item.commodityId,
skuId: item.productId,
name: item.productName,
logo: item.imgUrl,
deliveryType: item.deliveryType.deliveryType,
quantity: item.purchaseCount,
}
})
return value
}
/***********控制订单模式联动其他字段的数组集合 *******/ /***********控制订单模式联动其他字段的数组集合 *******/
export const orderCombination = { export const orderCombination = {
...@@ -157,8 +222,8 @@ export const inquiryColumns: any[] = [ ...@@ -157,8 +222,8 @@ export const inquiryColumns: any[] = [
export const paymentInformationColumns: any[] = [ export const paymentInformationColumns: any[] = [
{ {
title: '支付次数', title: '支付次数',
dataIndex: 'payCount', dataIndex: 'batchNo',
key: 'payCount' key: 'batchNo'
}, },
{ {
title: '支付环节', title: '支付环节',
...@@ -167,18 +232,19 @@ export const paymentInformationColumns: any[] = [ ...@@ -167,18 +232,19 @@ export const paymentInformationColumns: any[] = [
}, },
{ {
title: '外部状态', title: '外部状态',
dataIndex: 'externalState', dataIndex: 'outerStatusName',
key: 'externalState', key: 'outerStatusName',
}, },
{ {
title: '支付比例', title: '支付比例',
dataIndex: 'payRatio', dataIndex: 'payRate',
key: 'payRatio', key: 'payRate',
editable: true, editable: true,
forceEdit: true, forceEdit: true,
formItem: 'input', formItem: 'input',
formItemProps: { formItemProps: {
addonAfter: '%' addonAfter: '%',
disabled: true
}, },
width: 200, width: 200,
render: text => text + '%' render: text => text + '%'
......
...@@ -68,6 +68,11 @@ export const useEditHideField = () => { ...@@ -68,6 +68,11 @@ export const useEditHideField = () => {
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => { export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
const { pageStatus } = usePageStatus() const { pageStatus } = usePageStatus()
let sumPrice = 0;
FormEffectHooks.onFieldValueChange$('sumPrice').subscribe(state => {
sumPrice = state.value
})
FormEffectHooks.onFieldValueChange$('products').subscribe(state => { FormEffectHooks.onFieldValueChange$('products').subscribe(state => {
const { value } = state const { value } = state
// 强制渲染一次, 用于触发金额总数 // 强制渲染一次, 用于触发金额总数
...@@ -79,14 +84,20 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor ...@@ -79,14 +84,20 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
if(pageStatus === PageStatus.EDIT) { // 编辑下 支付信息联动实现 if(pageStatus === PageStatus.EDIT) { // 编辑下 支付信息联动实现
} else if(pageStatus === PageStatus.ADD) { // 新增下 需要支付信息生成支付次数 } else if(pageStatus === PageStatus.ADD) { // 新增下 需要支付信息生成支付次数
const shopId = ctx.getFieldValue('shopId')
const products = value.map(item => ({ productId: item.commodityId, skuId: item.productId }))
if(shopId && products?.length)
fetchOrderApi.getPayInfoList({ fetchOrderApi.getPayInfoList({
productId: productItem.productId, products: products,
memberId: productItem?.memberId || ctx.getFieldValue('supplyMembersId'), memberId: productItem?.memberId,
memberRoleId: productItem?.memberRoleId || ctx.getFieldValue('supplyMembersRoleId'), roleId: productItem?.memberRoleId,
orderMode: orderMode, orderMode: orderMode,
shopId: ctx.getFieldValue('shopId') shopId: shopId
}).then(data => { }).then(data => {
ctx.setFieldValue('paymentInformationResponses', data) ctx.setFieldValue('payments', data.map(item => ({
...item,
payPrice: (sumPrice * Number(item.payRate) / 100).toFixed(2)
})))
}).catch(err => { }).catch(err => {
}) })
...@@ -113,7 +124,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -113,7 +124,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
useProductAddress(ctx) useProductAddress(ctx)
}) })
FormEffectHooks.onFieldValueChange$('needTheInvoice').subscribe(state => { FormEffectHooks.onFieldValueChange$('hasInvoice').subscribe(state => {
if (state.value) { if (state.value) {
useInvoiceList(ctx) useInvoiceList(ctx)
} }
...@@ -163,7 +174,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -163,7 +174,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
...values, ...values,
deliveryTime: moment(values.deliveryTime).valueOf(), deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: value?.id || null, theInvoiceId: value?.id || null,
needTheInvoice: Number(values.needTheInvoice), hasInvoice: values.hasInvoice,
deliveryAddresId: values.deliveryAddresId, deliveryAddresId: values.deliveryAddresId,
id, id,
}, { ctlType: "none" }) }, { ctlType: "none" })
...@@ -188,7 +199,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -188,7 +199,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
...values, ...values,
deliveryTime: moment(values.deliveryTime).valueOf(), deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: values.theInvoiceId, theInvoiceId: values.theInvoiceId,
needTheInvoice: Number(values.needTheInvoice), hasInvoice: values.hasInvoice,
deliveryAddresId: value?.id ? value.id : value, deliveryAddresId: value?.id ? value.id : value,
id, id,
}, { ctlType: "none" }) }, { ctlType: "none" })
...@@ -213,8 +224,8 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -213,8 +224,8 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
*/ */
export const searchCustomerCategoryOptionEffect = (ctx: any, mctx: any, fieldName: string) => { export const searchCustomerCategoryOptionEffect = (ctx: any, mctx: any, fieldName: string) => {
const params: any = {} const params: any = {}
params['memberId'] = ctx.getFieldValue('supplyMembersId') params['memberId'] = ctx.getFieldValue('vendorMemberId')
params['memberRoleId'] = ctx.getFieldValue('supplyMembersRoleId') params['memberRoleId'] = ctx.getFieldValue('vendorRoleId')
mctx.getFieldState(fieldName, state => { mctx.getFieldState(fieldName, state => {
PublicApi.getProductCustomerGetMemberCustomerCategoryTree(params).then(res => { PublicApi.getProductCustomerGetMemberCustomerCategoryTree(params).then(res => {
mctx.setFieldState(fieldName, state => { mctx.setFieldState(fieldName, state => {
......
...@@ -22,66 +22,52 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions ...@@ -22,66 +22,52 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
} }
}, [memberId]) }, [memberId])
useEffect(() => { const initPayWayList = (memberId, memberRoleId) => {
if(orderProducts?.length) { let result = []
restrictArrivalPay(columns, orderProducts) PublicApi.getOrderBuyerCreateB2bPayTypes({vendorMemberId: memberId, vendorRoleId: memberRoleId}).then(res => {
} const { data = [], code } = res
}, [orderProducts]) for (let item of data) {
result.push({
payTypeName: item.payTypeName,
payType: item.payType,
payChannels: [...item.payChannels]
})
}
})
return result
}
const getPayLists = (memberId, memberRoleId) => { const getPayLists = (memberId, memberRoleId) => {
// PublicApi.getPayPayWayList({memberId, memberRoleId}).then(res => { const shopId = ctx.getFieldValue('shopId')
PublicApi.postOrderCreatePaymentFind({ const products = ctx.getFieldValue('products').map(item => ({ productId: item.commodityId, skuId: item.productId }))
if(shopId && products?.lenght)
PublicApi.postOrderBuyerCreateB2bPaymentFind({
memberId, memberId,
roleId: memberRoleId, roleId: memberRoleId,
shopId: ctx.getFieldValue('shopId'), shopId: shopId,
orderMode: ctx.getFieldValue('orderMode'), orderMode: ctx.getFieldValue('orderMode'),
products: ctx.getFieldValue('products').map(item => ({ productId: item.commodityId, skuId: item.productId })) products: products
}, { ctlType: 'none' }).then(res => { }, { ctlType: 'none' }).then(res => {
const { code, data } = res const { code, data } = res
if (code === 1000) { if (code === 1000) {
const newColumns = [...columns] const newColumns = [...columns]
newColumns[5].formItemProps.options = data.payTypes newColumns[5].formItemProps.options = initPayWayList(memberId, memberRoleId)
// newColumns[5].formItemProps.options = initPayWayList(data)
paywayData.current = data paywayData.current = data
// restrictArrivalPay(newColumns, orderProducts)
setColumns(newColumns) setColumns(newColumns)
} }
}) })
} }
// 限制使用到付(多次支付和商品仅有物流)
const restrictArrivalPay = (cols, pros) => {
if(pros?.length) {
const newColumns = [...cols]
let options = newColumns[5].formItemProps.options
setTimeout(() => {
let paymentDOM = document.getElementsByClassName("payRatio")
// 多次支付也要禁用到付
if((paymentDOM?.length > 1) || (pros.filter(item => item.deliveryType === 1).length !== pros.length)) {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = true
}
else {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
}, 800)
setColumns(newColumns)
}
}
const handleSave = row => { const handleSave = row => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('paymentInformationResponses')]; const newData = [...ctx.getFieldValue('payments')];
const index = newData.findIndex(item => row.payCount === item.payCount); const index = newData.findIndex(item => row.payCount === item.payCount);
const item = newData[index]; const item = newData[index];
newData.splice(index, 1, { newData.splice(index, 1, {
...item, ...item,
...row, ...row,
}); });
ctx.setFieldValue('paymentInformationResponses', newData) ctx.setFieldValue('payments', newData)
resolve({item, newData}) resolve({item, newData})
}) })
......
...@@ -155,7 +155,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -155,7 +155,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
row['money'] = getUnitPriceTotal(row) row['money'] = getUnitPriceTotal(row)
// 通过下单模式判断 是否是手工或者渠道手工下单 // 通过下单模式判断 是否是手工或者渠道手工下单
let addModel = ctx.getFieldValue("orderMode") let addModel = ctx.getFieldValue("orderMode")
row['productId'] = (pageStatus === PageStatus.ADD) ? row.id : row.productId row['productId'] = row.productId
newData.splice(index, 1, { newData.splice(index, 1, {
...item, ...item,
...row, ...row,
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { GlobalConfig } from '@/global/config'; import { GlobalConfig } from '@/global/config';
import moment from 'moment' import moment from 'moment'
...@@ -42,13 +41,13 @@ const basicInfo: ISchema = { ...@@ -42,13 +41,13 @@ const basicInfo: ISchema = {
// 联动显示单据字段 // 联动显示单据字段
{ {
type: 'value:visible', type: 'value:visible',
"target": "quotationNo", "target": "quoteNo",
"condition": `{{orderCombination.showQuotationField.includes($value)}}` "condition": `{{orderCombination.showQuotationField.includes($value)}}`
}, },
// 联动显示单据按钮 // 联动显示单据按钮
{ {
type: "value:schema", type: "value:schema",
"target": "quotationNo", "target": "quoteNo",
condition: `{{!!$value && orderCombination.showQuotationSelectBtn.includes($value)}}`, condition: `{{!!$value && orderCombination.showQuotationSelectBtn.includes($value)}}`,
schema: { schema: {
"x-component-props": { "x-component-props": {
...@@ -73,7 +72,7 @@ const basicInfo: ISchema = { ...@@ -73,7 +72,7 @@ const basicInfo: ISchema = {
required: true, required: true,
// visible: false, // visible: false,
}, },
orderThe: { digest: {
type: 'string', type: 'string',
title: '订单摘要', title: '订单摘要',
"x-rules": [ "x-rules": [
...@@ -87,7 +86,7 @@ const basicInfo: ISchema = { ...@@ -87,7 +86,7 @@ const basicInfo: ISchema = {
} }
] ]
}, },
quotationNo: { quoteNo: {
type: 'string', type: 'string',
title: '对应报价单号', title: '对应报价单号',
visible: false, visible: false,
...@@ -108,7 +107,7 @@ const basicInfo: ISchema = { ...@@ -108,7 +107,7 @@ const basicInfo: ISchema = {
} }
], ],
}, },
supplyMembersName: { vendorMemberName: {
type: 'string', type: 'string',
title: '供应会员', title: '供应会员',
"x-component-props": { "x-component-props": {
...@@ -116,11 +115,11 @@ const basicInfo: ISchema = { ...@@ -116,11 +115,11 @@ const basicInfo: ISchema = {
}, },
required: true, required: true,
}, },
supplyMembersId: { vendorMemberId: {
type: 'string', type: 'string',
display: false display: false
}, },
supplyMembersRoleId: { vendorRoleId: {
type: 'string', type: 'string',
display: false display: false
}, },
...@@ -159,26 +158,16 @@ const basicInfo: ISchema = { ...@@ -159,26 +158,16 @@ const basicInfo: ISchema = {
title: '外部状态', title: '外部状态',
visible: false visible: false
}, },
contractId: { sumPrice: {
type: 'number', type: 'number',
title: '采购合同ID', title: '总价',
visible: false visible: false,
},
contractNo: {
type: 'string',
title: '合同下单的合同编号',
visible: false
},
sourceType: {
type: 'number',
title: '合同下单的寻源类型',
visible: false
}, },
purchaseType: { freight: {
type: 'number', type: 'number',
title: '合同下单的是否有限制下单金额', title: '运费',
visible: false visible: false,
}, }
} }
}, },
...@@ -218,7 +207,7 @@ export const payInfo: ISchema = { ...@@ -218,7 +207,7 @@ export const payInfo: ISchema = {
tab: '支付信息', tab: '支付信息',
}, },
properties: { properties: {
paymentInformationResponses: { payments: {
type: 'array', type: 'array',
"x-component": 'MultTable', "x-component": 'MultTable',
"x-component-props": { "x-component-props": {
...@@ -262,7 +251,7 @@ const submitInfo: ISchema = { ...@@ -262,7 +251,7 @@ const submitInfo: ISchema = {
type: 'object', type: 'object',
"x-component": 'mega-layout', "x-component": 'mega-layout',
properties: { properties: {
deliveryTime: { deliverDate: {
type: 'string', type: 'string',
"x-component": 'date', "x-component": 'date',
title: '交付日期', title: '交付日期',
...@@ -318,8 +307,8 @@ const ortherInfo: ISchema = { ...@@ -318,8 +307,8 @@ const ortherInfo: ISchema = {
wrapperCol: 10 wrapperCol: 10
}, },
properties: { properties: {
needTheInvoice: { hasInvoice: {
type: 'number', type: 'boolean',
"x-component": 'CheckboxSingle', "x-component": 'CheckboxSingle',
"x-component-props": { "x-component-props": {
children: '需要发票', children: '需要发票',
...@@ -328,7 +317,7 @@ const ortherInfo: ISchema = { ...@@ -328,7 +317,7 @@ const ortherInfo: ISchema = {
} }
}, },
title: '发票', title: '发票',
default: 0, default: false,
"x-linkages": [ "x-linkages": [
{ {
type: 'value:visible', type: 'value:visible',
......
...@@ -300,7 +300,7 @@ export const materialInfoColumns: any[] = [ ...@@ -300,7 +300,7 @@ export const materialInfoColumns: any[] = [
dataIndex: 'name', dataIndex: 'name',
align: 'center', align: 'center',
key: 'name', key: 'name',
render: (t, r) => `${t}/${r.spec}` render: (t, r) => `${t}/${r.type}`
}, },
{ {
title: '品类', title: '品类',
...@@ -325,7 +325,7 @@ export const materialInfoColumns: any[] = [ ...@@ -325,7 +325,7 @@ export const materialInfoColumns: any[] = [
dataIndex: 'relevanceProductId', dataIndex: 'relevanceProductId',
align: 'center', align: 'center',
key: 'relevanceProductId', key: 'relevanceProductId',
render: (t, r) => t ? `${t}/${r.relevanceProductName || ''}/${r.relevanceProductSpec || ''}/${r.relevanceProductCategory || ''}/${r.relevanceProductBrand || ''}` : '' render: (t, r) => t ? `${t}/${r.relevanceProductName || ''}/${r.relevanceProductType || ''}/${r.relevanceProductCategory || ''}/${r.relevanceProductBrand || ''}` : ''
}, },
{ {
title: '单价', title: '单价',
......
...@@ -197,22 +197,26 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -197,22 +197,26 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
} }
// 交付地址数据字段转换拼接 查询省市区冗余 // 交付地址数据字段转换拼接 查询省市区冗余
const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({ const { data: addressDetail, code} = await PublicApi.getLogisticsReceiverAddressGet({
id: params.deliveryAddresId?.id || params.deliveryAddresId id: params.deliveryAddresId?.id || params.deliveryAddresId
}) })
params.consignee = { if(code === 1000) {
deliverDate: params.deliverDate, params.consignee = {
consigneeId: addressDetail.id, deliverDate: params.deliverDate,
consignee: addressDetail.receiverName, consigneeId: addressDetail.id,
provinceCode: addressDetail.provinceCode, consignee: addressDetail.receiverName,
cityCode: addressDetail.cityCode, provinceCode: addressDetail.provinceCode,
districtCode: addressDetail.districtCode, cityCode: addressDetail.cityCode,
address: addressDetail.address, districtCode: addressDetail.districtCode,
postalCode: addressDetail.postalCode, address: addressDetail.address,
countryCode: addressDetail.areaCode, postalCode: addressDetail.postalCode,
phone: addressDetail.phone, countryCode: addressDetail.areaCode,
telephone: addressDetail.tel, phone: addressDetail.phone,
defaultConsignee: addressDetail.isDefault, telephone: addressDetail.tel,
defaultConsignee: addressDetail.isDefault,
}
} else {
throw new Error('交付地址异常')
} }
// 其他需求 // 其他需求
......
...@@ -249,7 +249,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -249,7 +249,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
if(data.allProducts === false) { if(data.allProducts === false) {
const res = await getBindingProducts({id: id.toString(), current: '1', pageSize: '1000'}) const res = await getBindingProducts({id: id.toString(), current: '1', pageSize: '1000'})
addSchemaAction.setFieldState('products', state => { addSchemaAction.setFieldState('products', state => {
state.value = res.data state.value = res.data.map(item => ({
...item,
id: item.skuId,
commodityId: item.productId,
customerCategoryName: item.category,
brandName: item.brand,
}))
}) })
setProductsLength(res.totalCount) setProductsLength(res.totalCount)
} }
...@@ -287,7 +293,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -287,7 +293,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const paginationChange = async (page: number, size: number) => { const paginationChange = async (page: number, size: number) => {
if(id !== '') { if(id !== '') {
const result = await getBindingProducts({id, current: page.toString(), pageSize: size.toString()}) const result = await getBindingProducts({id, current: page.toString(), pageSize: size.toString()})
addSchemaAction.setFieldValue('products', result.data) addSchemaAction.setFieldValue('products', result.data.map(item => ({
...item,
id: item.skuId,
commodityId: item.productId,
customerCategoryName: item.category,
brandName: item.brand,
})))
} }
} }
......
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