Commit f52b6d98 authored by GuanHua's avatar GuanHua
parents acc79611 3229623c
...@@ -25,11 +25,12 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -25,11 +25,12 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
const isDeleved = pathname.indexOf('readyConfirmDelevedOrder') !== -1 const isDeleved = pathname.indexOf('readyConfirmDelevedOrder') !== -1
// 是否是确认回单页 // 是否是确认回单页
const isReturn = pathname.indexOf('readyConfirmReturnOrder') !== -1 const isReturn = pathname.indexOf('readyConfirmReturnOrder') !== -1
console.log(isPreview, isDeleved, isReturn)
// 用于储存已经修改过的订单id // 用于储存已经修改过的订单id
const dataRef = useRef<any>([]) const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext) const { data, reloadFormData } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel } = data const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel, externalState } = data
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式 const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const outOrderCols: any[] = [ const outOrderCols: any[] = [
...@@ -341,10 +342,13 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -341,10 +342,13 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
childrenDataKey='orderDeliveryProducts' childrenDataKey='orderDeliveryProducts'
dataSource={orderDeliveryDetailsResponses} dataSource={orderDeliveryDetailsResponses}
/> />
{
externalState === 11 && !isPreview && isReturn &&
<Space style={{marginTop: 18, display: "flex", justifyContent: "flex-end"}}> <Space style={{marginTop: 18, display: "flex", justifyContent: "flex-end"}}>
<Button type="primary" onClick={handelReciveReturnOrder}>确认本单全部发货单已收到回单</Button> <Button type="primary" onClick={handelReciveReturnOrder}>确认本单全部发货单已收到回单</Button>
<Button type="primary" onClick={handleContinueDeliver}>继续发货</Button> <Button type="primary" onClick={handleContinueDeliver}>继续发货</Button>
</Space> </Space>
}
</Tabs.TabPane> </Tabs.TabPane>
} }
</Tabs> </Tabs>
......
...@@ -363,7 +363,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => { ...@@ -363,7 +363,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
}) })
ctl.setData({ ctl.setData({
...data, ...data,
orderProductRequests: newData orderProductRequests: newData.sort((a, b) => a.id - b.id)
}) })
}; };
...@@ -479,7 +479,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => { ...@@ -479,7 +479,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
<MellowCard title='订单商品' style={{marginTop: 24}} bordered={false}> <MellowCard title='订单商品' style={{marginTop: 24}} bordered={false}>
<Table <Table
columns={columns} columns={columns}
dataSource={orderProductRequests} dataSource={orderProductRequests.sort((a, b) => a.id - b.id)}
components={productComponents} components={productComponents}
rowKey='id' rowKey='id'
pagination={false} pagination={false}
......
...@@ -4,7 +4,6 @@ import { Row, Space, Popover } from 'antd' ...@@ -4,7 +4,6 @@ import { Row, Space, Popover } from 'antd'
import { DELIVERY_TYPE, OrderModalType, PurchaseOrderOutWorkStateTexts } from '@/constants' import { DELIVERY_TYPE, OrderModalType, PurchaseOrderOutWorkStateTexts } from '@/constants'
import { EnvironmentOutlined } from '@ant-design/icons' import { EnvironmentOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { toPercent } from '@/utils/type'
// 简单控制价格区间的组件 // 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。 // @todo 后续需要优化, 样式,目录文件等。
...@@ -278,15 +277,11 @@ export const productInfoColumns: any[] = [ ...@@ -278,15 +277,11 @@ export const productInfoColumns: any[] = [
align: 'left', align: 'left',
key: 'unitPrice', key: 'unitPrice',
render: (t, r) => { render: (t, r) => {
// if(r?.commodityId) { // todo 还差需求报价的商品数据字段对比
// return <PriceComp priceSection={r.unitPrice}/> if(r?.commodityId) {
// } else {
// return r.price
// }
if(JSON.stringify(r.unitPrice) === '{}') {
return r.price
} else {
return <PriceComp priceSection={r.unitPrice}/> return <PriceComp priceSection={r.unitPrice}/>
} else {
return <span style={{color: 'red'}}>{r.price}</span>
} }
} }
}, },
...@@ -295,7 +290,7 @@ export const productInfoColumns: any[] = [ ...@@ -295,7 +290,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'memberPrice', dataIndex: 'memberPrice',
align: 'center', align: 'center',
key: 'memberPrice', key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? toPercent(text) : null render: (text, record) => record.isMemberPrice && text ? text * 100 + '%' : null
}, },
{ {
title: '采购数量', title: '采购数量',
......
...@@ -89,7 +89,6 @@ export const useEditHideField = () => { ...@@ -89,7 +89,6 @@ export const useEditHideField = () => {
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => { export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => { FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => {
const { value } = state const { value } = state
console.log(value, 'vlaue')
const payInfoData = ctx.getFieldValue('paymentInformationResponses') const payInfoData = ctx.getFieldValue('paymentInformationResponses')
// 强制渲染一次, 用于触发金额总数 // 强制渲染一次, 用于触发金额总数
update() update()
...@@ -175,15 +174,16 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn ...@@ -175,15 +174,16 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
prev[next.range] = next.price prev[next.range] = next.price
return prev return prev
}, {}), }, {}),
isMemberPrice: !!v.memberDiscount, isMemberPrice: v.isMemberPrice,
purchaseCount: v.count, purchaseCount: v.count,
money: v.count * v.unitPrice, money: v.count * v.unitPrice,
productId: v.id, productId: v.id,
memberId: initValue.supplyMembersId, // 添加 memberId 字段 memberId: initValue.supplyMembersId, // 添加 memberId 字段
commodityId: v.id, // 添加commodityId用于判断是商品价格是使用price字段还是unitPrice字段(也可判断是报价订单还是其他) commodityId: v.id, // 添加commodityId用于判断是商品价格是使用price字段还是unitPrice字段(也可判断是报价订单还是其他)
memberPrice: v.memberDiscount !== 1 ? toPercent(v.memberDiscount) : 1, // 添加会员折扣 memberPrice: v.memberDiscount !== 1 ? v.memberDiscount : 1, // 添加会员折扣
} }
}))) })
))
} }
// 回显的数据保存在表单中, 当切换下单模式时,可以再次回显 // 回显的数据保存在表单中, 当切换下单模式时,可以再次回显
......
...@@ -72,7 +72,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => { ...@@ -72,7 +72,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
orderProductList: logsiticsDataMaps.map(v => ({ orderProductList: logsiticsDataMaps.map(v => ({
templateId: v.logistics.templateId, templateId: v.logistics.templateId,
weight: v.logistics.weight, weight: v.logistics.weight,
count: v?.purchaseCount || 0 count: v?.purchaseCount || null
})), })),
receiverAddressId: typeof receiverAddressId === 'object' ? receiverAddressId.id : receiverAddressId receiverAddressId: typeof receiverAddressId === 'object' ? receiverAddressId.id : receiverAddressId
}, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => { }, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
......
...@@ -48,9 +48,9 @@ export const getUnitPriceTotal = (record) => { ...@@ -48,9 +48,9 @@ export const getUnitPriceTotal = (record) => {
// let memberPrice = record.memberPrice !== 1 ? toPoint(record.memberPrice) : 1 // let memberPrice = record.memberPrice !== 1 ? toPoint(record.memberPrice) : 1
let memberPrice = record.memberPrice let memberPrice = record.memberPrice
if(record.isMemberPrice) { if(record.isMemberPrice) {
return unitPrice * purchaseCount * memberPrice return Number((unitPrice * purchaseCount * memberPrice).toFixed(2))
} else { } else {
return unitPrice * purchaseCount return Number((unitPrice * purchaseCount).toFixed(2))
} }
} }
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => { export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
...@@ -105,7 +105,6 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -105,7 +105,6 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const newData = [...ctx.getFieldValue('orderProductRequests')]; const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id); const index = newData.findIndex(item => row.id === item.id);
const item = newData[index]; const item = newData[index];
console.log(getUnitPriceTotal(row), 'row')
row['money'] = getUnitPriceTotal(row) row['money'] = getUnitPriceTotal(row)
// 新增的时候接口字段id,commodityId 编辑的时候id,productId // 新增的时候接口字段id,commodityId 编辑的时候id,productId
row['productId'] = row?.commodityId ? row.id : row.productId row['productId'] = row?.commodityId ? row.id : row.productId
......
...@@ -4,7 +4,7 @@ import { Button, Row, Col, Progress, Popconfirm } from 'antd' ...@@ -4,7 +4,7 @@ import { Button, Row, Col, Progress, Popconfirm } from 'antd'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview' import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
import { ORDER_TYPE, PurchaseOrderOutWorkState } from '@/constants' import { ORDER_TYPE, PurchaseOrderInsideWorkState, PurchaseOrderOutWorkState } from '@/constants'
import StatusColors from '../../components/StatusColors' import StatusColors from '../../components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons' import { FieldTimeOutlined } from '@ant-design/icons'
import { import {
...@@ -162,7 +162,12 @@ export const useSelfTable = (props) => { ...@@ -162,7 +162,12 @@ export const useSelfTable = (props) => {
<Link to={`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`}>去支付</Link> <Link to={`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`}>去支付</Link>
} }
{ {
(record.externalState === PurchaseOrderOutWorkState.PAY_ORDER && !record.signatureLogId || record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT) && (
record.externalState === PurchaseOrderOutWorkState.PAY_ORDER &&
!record.signatureLogId ||
record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT &&
record.interiorState !== PurchaseOrderInsideWorkState.PAY_SUCCESS
) &&
<Popconfirm <Popconfirm
title="是否要取消该订单?" title="是否要取消该订单?"
onConfirm={() => handleCancel(record.id)} onConfirm={() => handleCancel(record.id)}
......
...@@ -64,7 +64,7 @@ export const useSelfTable = () => { ...@@ -64,7 +64,7 @@ export const useSelfTable = () => {
}, },
{ title: '收货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' }, { title: '收货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 收货单号跳转 // @todo 收货单号跳转
{ title: '入库单号', align: 'center', dataIndex: 'invoiceNumber', key: 'invoiceNumber', render: text => <Link to={'/'}>{text}</Link> }, { title: '收货单号', align: 'center', dataIndex: 'invoiceNumber', key: 'invoiceNumber', render: text => <Link to={'/'}>{text}</Link> },
{ {
title: '订单类型', title: '订单类型',
align: 'center', align: 'center',
......
...@@ -12,7 +12,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -12,7 +12,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix' import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
// 待确认支付结果订单 // 待确认支付结果订单
export interface FirstApprovedOrderProps {} export interface FirstApprovedOrderProps {}
......
...@@ -64,7 +64,13 @@ export const useSelfTable = () => { ...@@ -64,7 +64,13 @@ export const useSelfTable = () => {
}, },
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' }, { title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 发货单号跳转 // @todo 发货单号跳转
{ title: '发货单号', align: 'center', dataIndex: 'invoiceNumber', key: 'invoiceNumber', render: text => <Link to={'/'}>{text}</Link> }, {
title: '发货单号',
align: 'center',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.invoiceId}&preview=1`}>{text}</Link>
},
// { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text}, // { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text},
{ {
title: '订单类型', title: '订单类型',
......
...@@ -60,7 +60,7 @@ export const useSelfTable = () => { ...@@ -60,7 +60,7 @@ export const useSelfTable = () => {
align: 'center', align: 'center',
dataIndex: 'sumPrice', dataIndex: 'sumPrice',
key: 'sumPrice', key: 'sumPrice',
render: text => '¥' + text render: (t, r) => (r.type === 7 || r.type === 8) ? t : '¥' + t
}, },
{ title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' }, { title: '发货批次', align: 'center', dataIndex: 'shipmentBatch', key: 'shipmentBatch', render: text => text ? `第${text}次` : '' },
// @todo 发货单号跳转 // @todo 发货单号跳转
......
...@@ -239,7 +239,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -239,7 +239,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
async function getInitValue() { async function getInitValue() {
const { data } = await PublicApi.getOrderTradingRulesDetails({id: id}) const { data } = await PublicApi.getOrderTradingRulesDetails({id: id})
if(data.isTacitlyApprove === 2) { if(data.isTacitlyApprove === 2) {
const res = await getBindingProducts({id: id.toString(), current: '1', pageSize: '10'}) 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
}) })
......
...@@ -176,7 +176,6 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({ ...@@ -176,7 +176,6 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
rowKey: 'id', rowKey: 'id',
columns: "{{tableColumns}}", columns: "{{tableColumns}}",
prefix: "{{tableAddButton}}", prefix: "{{tableAddButton}}",
idNotList: []
} }
} }
} }
......
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