Commit 00b0a217 authored by XieZhiXiong's avatar XieZhiXiong
parents 3d601534 a21333c1
......@@ -64,8 +64,6 @@ export const useOrderDetail = (options: OrderDetailHookProps) => {
const { code, data } = res
if (code === 1000) {
setPaylist(data)
} else {
message.error(res.message)
}
})
}
......
......@@ -186,8 +186,8 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
expressionScope={{
electronBtn
}}
effects={async ($, actions) => {
// $('onFormInit').subscribe(() => {
effects={($, actions) => {
$('onFormInit').subscribe(async () => {
if (data.isElectronicContract === 1) {
// useAsyncSelect('contractTemplateId', async () => (await PublicApi.getOrderSelectListContractTemplate()).data, ['name', 'id']).then(()=>{
// actions.setFieldValue("contractTemplateId", data.contractTemplateId)
......@@ -205,7 +205,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
}
} else {
actions.setFieldState('usingElectronicContracts', state => {
// state.value = 0
state.value = 0
state.props["x-component-props"] = {
disabled: true
}
......@@ -215,7 +215,7 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
$('onFieldValueChange', 'contractTemplateId').subscribe(state => {
// console.log(state.props)
})
// })
})
}}
/>
)
......
......@@ -287,6 +287,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
setOpenTimer(0)
}
setCode('')
mobilePayFlag.current = 0
}
const handleSubmitPay = async () => {
......
......@@ -101,7 +101,6 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
// 总计金额
useEffect(() => {
console.log((sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000, 'iiiiii')
setAmountMoney(() => (sumPrice*1000)/1000 || (sum*1000 + freePrice*1000)/1000)
}, [sum, freePrice, sumPrice])
......
......@@ -184,7 +184,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
}, {}),
isMemberPrice: v.isMemberPrice,
purchaseCount: v.count,
money: v.count * v.unitPrice,
money: v.memberDiscount ? (v.count*1000 * v.unitPrice*100 * v.memberDiscount*100)/10000000 : (v.count*1000 * v.unitPrice*100)/100000,
productId: v.id,
memberId: initValue.supplyMembersId, // 添加 memberId 字段
commodityId: v.id, // 添加commodityId用于判断是商品价格是使用price字段还是unitPrice字段(也可判断是报价订单还是其他)
......
......@@ -212,35 +212,35 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// theInvoiceInfo: value.theInvoiceInfo
}
// 校验是否选择支付渠道/支付比例
let judgementByPay = params.paymentInformationResponses.map(item => {
let judgementByPay = params.paymentInformationResponses?.length && params.paymentInformationResponses.map(item => {
if(item.channel && item.payWay){
return true
} else {
return false
}
})
if(judgementByPay.includes(false)){
if(!judgementByPay || judgementByPay.includes(false)){
throw new Error('请选择支付方式或支付渠道')
}
let judgementByRatio = params.paymentInformationResponses.map(item => {
let judgementByRatio = params.paymentInformationResponses?.length && params.paymentInformationResponses.map(item => {
if(Number(item.payRatio) > 0 && Number(item.payRatio) <= 100){
return true
} else {
return false
}
})
if(judgementByRatio.includes(false)){
throw new Error('请正确填写支付比例(0-100范围内)')
if(!judgementByRatio || judgementByRatio.includes(false)){
throw new Error('请正确填写支付比例')
}
// 校验采购数量
let judgementByCount = params.orderProductRequests.map(item => {
let judgementByCount = params.orderProductRequests?.length && params.orderProductRequests.map(item => {
if(item.purchaseCount){
return true
} else {
return false
}
})
if(judgementByCount.includes(false)){
if(!judgementByCount || judgementByCount.includes(false)){
throw new Error('请填写商品采购数量')
}
// logistics render字段字符串化
......
......@@ -116,8 +116,6 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
paywayData.current = data
restrictArrivalPay(newColumns, orderProducts)
setColumns(newColumns)
} else {
message.error(res.message)
}
})
}
......
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