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

fix: 对接采购订单详情申请开票,销售订单详情修改商品单价和运费功能,原有待审核订单修改单价和运费添加修改原因,供应商收到的评价添加显示隐藏评价操作

parent cad03605
......@@ -11,7 +11,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit'
import ModalTable from '@/components/ModalTable';
import { getProductCustomerGetCustomerAttribute, postProductCustomerSaveOrUpdateCustomerAttribute } from '@/services/ProductV2Api';
import { getProductCustomerGetCustomerAttribute, getProductPlatformGetAttributeList, postProductCustomerSaveOrUpdateCustomerAttribute } from '@/services/ProductV2Api';
const { Option } = Select;
......@@ -82,14 +82,12 @@ const AddAtttribute: React.FC<{}> = () => {
const handleSelectOk = () => {
setRoleVisible(false)
if (selectRow.length) {
//@ts-ignore
menuForm.setFieldsValue({ attribute: selectRow[0], attributeShow: selectRow[0].name })
}
}
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
//@ts-ignore
getProductPlatformGetAttributeList({ ...params, name: params.name || '', groupName: params.groupName || '', isEnable: true }).then(res => {
resolve(res.data)
})
......
......@@ -23,7 +23,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import ModalTable from '@/components/ModalTable'
import { clearModalParams } from '@/utils'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { getProductCustomerGetCustomerAttributeList, getProductPlatformGetAttributeList, postProductCustomerDeleteCustomerAttribute, postProductCustomerUpdateCustomerAttributeStatus } from '@/services/ProductV2Api'
import { getProductCustomerGetCustomerAttributeList, getProductPlatformGetAttributeList, postProductCustomerDeleteCustomerAttribute, postProductCustomerSyncAttribute, postProductCustomerUpdateCustomerAttributeStatus } from '@/services/ProductV2Api'
// import styles from './index.less'
const formActions = createFormActions();
......@@ -213,7 +213,6 @@ const Attribute: React.FC<{}> = () => {
const handleAsyncOk = () => {
setSyncLoading(true)
if(rowSelectionCtl.selectedRowKeys.length) {
// @ts-ignore
postProductCustomerSyncAttribute({idList: rowSelectionCtl.selectedRowKeys}).then(res => {
if(res.code === 1000) {
ref.current.reload()
......
......@@ -21,12 +21,11 @@ import Submit from '@/components/NiceForm/components/Submit'
import { ISchema } from '@formily/antd';
import { clearModalParams } from '@/utils';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getProductCustomerGetCustomerAttributeValueList, getProductPlatformGetSyncAttributeValueList, postProductCustomerDeleteCustomerAttributeValue, postProductCustomerUpdateCustomerAttributeValueStatus } from '@/services/ProductV2Api';
import { getProductCustomerGetCustomerAttributeTree, getProductCustomerGetCustomerAttributeValueList, getProductPlatformGetSyncAttributeValueList, postProductCustomerDeleteCustomerAttributeValue, postProductCustomerSyncAttributeValue, postProductCustomerUpdateCustomerAttributeValueStatus } from '@/services/ProductV2Api';
const treeActions = createTreeActions()
const fetchAttributeTreeData = async (params?) => {
// @ts-ignore
const res = await getProductCustomerGetCustomerAttributeTree({filterInput: true})
return res
}
......@@ -296,7 +295,6 @@ const PropertyValue: React.FC<{}> = () => {
const handleAsyncOk = () => {
setSyncLoading(true)
if(rowSelectionCtl.selectedRowKeys.length) {
// @ts-ignore
postProductCustomerSyncAttributeValue({idList: rowSelectionCtl.selectedRowKeys}).then(res => {
if(res.code === 1000) {
if(ref?.current?.reload) {
......
......@@ -20,6 +20,7 @@ import { useLocalStore, observer } from 'mobx-react'
import { store } from '@/store'
import { CommodityType } from './constant';
import { getProductCommodityGetCommodity, getProductCustomerGetCustomerCategoryById, postProductCommodityApplyCheckCommodity, postProductCommoditySaveOrUpdateCommodity } from '@/services/ProductV2Api';
import { getTemplateWebPageTemplateWebFindGoodsDescribeTemplate } from '@/services/TemplateV2Api';
const { TabPane } = Tabs
......@@ -132,7 +133,6 @@ const AddProducts: React.FC<{}> = (props) => {
// 获取页面使用模板
const productDescriptionTemplate = async () => {
//@ts-ignore
getTemplateWebPageTemplateWebFindGoodsDescribeTemplate({ siteId }).then(res => {
if (res.code === 1000)
setCurrentTemplateName(res.data?.fileName)
......
......@@ -30,7 +30,7 @@ import { priceTypeLabel, productStatusColor, productStatusLabel } from './consta
import EyePreview from '@/components/EyePreview'
import UpperProductModalTable from './components/upperProductModalTable'
import { Item } from '@/components/ButtonTabs'
import { getProductCommodityGetCommodityList, getProductCommodityGetShop, GetProductCommodityGetShopResponse, postProductCommodityApplyCheckCommodity, postProductCommodityCopyCommodity, postProductCommodityGetShopBatch, postProductCommodityOffPublishCommodity, postProductCommodityOffPublishCommodityBatch, postProductCommodityPublishCommodity, postProductCommodityPublishCommodityBatch } from '@/services/ProductV2Api'
import { getProductCommodityGetCommodityList, getProductCommodityGetShop, GetProductCommodityGetShopResponse, postProductCommodityApplyCheckCommodity, postProductCommodityCopyCommodity, postProductCommodityDeleteBatchCommodity, postProductCommodityGetShopBatch, postProductCommodityOffPublishCommodity, postProductCommodityOffPublishCommodityBatch, postProductCommodityPublishCommodity, postProductCommodityPublishCommodityBatch } from '@/services/ProductV2Api'
import { getTemplateWebMemberShopWebFindCurrMemberShop } from '@/services/TemplateV2Api'
const { confirm } = Modal;
......@@ -528,7 +528,6 @@ const Products: React.FC<{}> = () => {
title: '确定要执行批量删除操作?',
icon: <ExclamationCircleOutlined />,
onOk() {
//@ts-ignore
postProductCommodityDeleteBatchCommodity({idList: ids}).then(res => {
if(res.code === 1000)
ref.current.reload()
......@@ -542,7 +541,6 @@ const Products: React.FC<{}> = () => {
cancelText: '取消'
})
}else{
//@ts-ignore
postProductCommodityDeleteBatchCommodity({idList: ids}).then(res => {
if(res.code === 1000)
ref.current.reload()
......
......@@ -39,19 +39,19 @@ const AnyQuestion: React.FC<Iprops> = () => {
<p className={styles.tips}>您的专属服务团队</p>
<p className={styles.tips}>客户经理、项目经理、技术专家为你解答平台使用过程中遇到任何问题</p>
</div>
<div className={styles.ask}>
{
_self === null ?
null
:
<div className={styles.ask}>
<a
target={"__blank"}
onClick={openIMServer}
>
我要提问
</a>
}
</div>
}
<div className={styles.ask_image}>
<img src={ask} />
</div>
......
......@@ -95,7 +95,7 @@ export const transformParamsForApi = (data: any, ctx: ISchemaFormActions | ISche
let _params: any = {}
_params["name"] = data.name
_params["priceType"] = data.priceType
let shopInfo = ctx.getFieldState("shopId")['values'][1]
let shopInfo = data?.shopId ? { id: data.shopId } : ctx.getFieldState("shopId")['values'][1]
_params["shopId"] = shopInfo["id"]
_params["type"] = shopInfo["type"]
......@@ -128,6 +128,7 @@ export const transformDataForNiceForm = (value: any, ctx: ISchemaFormActions | I
initValue["priceType"] = value.priceType
initValue["productId"] = value.commodity.id
initValue["productName"] = value.commodity.name
initValue["minOrder"] = value.commodity.minOrder
initValue["commodityMemberList"] = value.commodityMemberList.map(item => ({
memberId: item.memberId,
name: item.memberName,
......
......@@ -61,6 +61,7 @@ const PriceSetting:React.FC<PriceSettingProps> = (props) => {
addSchemaAction.setFieldState('commodityMemberList', state => {
state.dataSource = initValue.commodityMemberList
})
addSchemaAction.setFieldValue('minOrder', initValue.minOrder)
})
}
}, [])
......
......@@ -69,35 +69,119 @@
}
}
// :global {
// span.ant-radio + * {
// display: block;
// width: 100%;
// }
// .ant-radio-wrapper {
// display: flex;
// width: 100%;
// align-items: center;
// height: 72px;
// background-color: #fafafa;
// margin: 10px;
// padding-left: 16px;
// }
// .ant-radio-wrapper.ant-radio-wrapper-checked {
// border: 1px solid @main-color;
// &::after {
// content: '';
// position: absolute;
// width: 0;
// height: 0;
// border-bottom: 12px solid @main-color;
// border-left: 12px solid transparent;
// bottom: 0;
// right: 0;
// z-index: 5;
// }
// }
// }
// 发票抽屉
.raido_group {
position: relative;
display: block;
width: 100%;
.list_radio {
border: 1px solid #FFF;
}
.invoice_list {
position: relative;
// display: flex;
margin: 0 -10px;
// flex-wrap: wrap;
.invoice_list_item {
display: flex;
align-items: center;
&_content {
padding-left: 10px;
&_tag {
display: inline-block;
background-color: #909399;
padding: 0 6px;
height: 16px;
line-height: 16px;
color: #FFF;
font-size: 12px;
&.special {
background-color: #5377CE;
}
}
&_name {
display: flex;
align-items: center;
.default {
width: 64px;
height: 16px;
line-height: 16px;
text-align: center;
background: rgba(238, 238, 238, 1);
font-size: 12px;
color: #606266;
}
&>span {
margin-right: 20px;
}
}
}
&_btn_group {
display: flex;
margin-left: auto;
line-height: 14px;
// height: 14px;
.invoice_list_item_btn {
margin: 0 10px;
}
}
}
.select_style_border {
border: 1px solid #EEF0F3;
// display: flex;
// align-items: center;
// justify-content: space-between;
// padding: 8px 14px;
// flex: 1;
// cursor: pointer;
// line-height: 28px;
// position:relative;
}
:global {
span.ant-radio+* {
display: block;
width: 100%;
}
.ant-radio-wrapper {
display: flex;
width: 100%;
align-items: center;
height: 72px;
background-color: #FAFAFA;
// margin: 10px;
padding-left: 16px;
}
.ant-radio-wrapper.ant-radio-wrapper-checked {
border: 1px solid @main-color;
&::after {
content: '';
position: absolute;
width: 0;
height: 0;
border-bottom: 12px solid @main-color;
border-left: 12px solid transparent;
bottom: 0;
right: 0;
z-index: 5;
}
}
}
}
}
import React, { useContext, useState } from 'react'
import { Row, Col, Tag, Modal } from 'antd'
import React, { useContext, useRef, useState } from 'react'
import { Row, Col, Tag, Modal, Drawer, Button, Radio } from 'antd'
import MellowCard from '@/components/MellowCard'
import { OrderDetailContext } from '../../_public/order/context'
import { OrderKindType } from '@/constants/order'
import style from './index.less'
import ContractList from '../contractList'
import cx from 'classnames'
import { getSettleAccountsInvoiceMessageDetails, getSettleAccountsInvoiceMessageList, postSettleAccountsInvoiceMessageDelete, postSettleAccountsInvoiceMessageUpdate } from '@/services/SettleV2Api'
import InvoiceModal from '../../purchaseOrder/orderCollectCash/components/invoiceModal'
import { PlusOutlined } from '@ant-design/icons'
import { postOrderBuyerInvoice } from '@/services/OrderNewV2Api'
import { history } from 'umi'
export interface OrderMergeInfoProps { }
const payInfo = [
{ title: '交付日期:', name: 'deliverDate' },
{ title: '交付日期', name: 'deliverDate' },
{
title: '交付地址:', name: 'areaName', render: (_, record) =>
title: '交付地址', name: 'areaName', render: (_, record) =>
<div>
<Row>
<Col>{record.consignee}</Col>
......@@ -28,25 +33,46 @@ const electronInfo = [
{ title: '电子合同', name: 'none' },
]
const RenderCard = ({ infoList, dataSource }) => {
console.log(dataSource, 'ddd')
return infoList.map(v => dataSource[v.name] ? <Row key={v.name} className={style['card-list']}>
const RenderCard = ({ infoList, dataSource }) => <Row>{
infoList.map((v, i) => <Col span={12} key={`${v.name}_${i}`}>
<Row className={style['card-list']}>
<Col span={6} className={style['card-list_title']}>{v.title}</Col>
<Col flex={1} {...v.resetCol}>{v.render ? v.render(dataSource[v.name], dataSource) : dataSource[v.name]}</Col>
</Row> : null)
}
<Col span={12} {...v.resetCol}>{v.render ? v.render(dataSource[v.name], dataSource) : dataSource[v.name]}</Col>
</Row>
</Col>)
}</Row>
interface IState {
dataSource: any[],
useValue: any,
}
const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
const orderDetailCtx = useContext(OrderDetailContext)
const [isModalVisible, setIsModalVisible] = useState(false)
const { data, ctl } = orderDetailCtx
const [applyVisible, setApplyVisible] = useState(false)
const { data, ctl, reloadFormData } = orderDetailCtx
const { invoice, consignee } = data
const [mode, setMode] = useState<'add' | 'edit' | 'default' | 'preview' | 'delete'>('default')
const modalRef = useRef<any>({})
const [fieldState, setFieldState] = useState<IState>({
dataSource: [],
useValue: null,
})
const [formInitValue, setFormInitValue] = useState<any>(null)
const otherInfo = [
// 当前url下是采购订单详情 可显示申请开票
const applyable = history.location.pathname === '/memberCenter/tranactionAbility/purchaseOrder/orderList/preview'
const invoiceInfo = [
{
title: '需要发票',
name: 'invoice',
render: item => item?.invoiceId ? '是' : '否'
},
{
title: '发票:',
title: '发票信息',
name: 'invoice',
render: item => <div className={style.invoice_list_item}>
render: item => item && <div className={style.invoice_list_item}>
<div className={style.invoice_list_item_content}>
<div className={cx(style.invoice_list_item_content_tag, item.invoiceKind !== 1 ? style.special : '')}>{item.invoiceType === 1 ? '增值税普通发票:' : '增值税专用发票:'}</div>
<div className={style.invoice_list_item_content_name}>
......@@ -65,19 +91,120 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
flex: '1 1 100%'
}
},
{
title: '发票类型',
name: 'invoice',
render: item => item?.invoiceTypeName
}
]
const otherInfo = [
{ title: '包装要求', name: 'pack' },
{ title: '其他要求', name: 'remark' },
]
const applyInvoice = () => {
setApplyVisible(true)
reload()
}
const confirmApplySubmit = () => {
const formData = fieldState.dataSource.filter(item => item.id === fieldState.useValue)[0]
const params = {
orderId: data.orderId,
invoiceId: formData.id,
invoiceKind: formData.kind,
invoiceType: formData.type,
title: formData.invoiceTitle,
taxNo: formData.taxNo,
bank: formData.bankOfDeposit,
account: formData.account,
address: formData.address,
}
postOrderBuyerInvoice({...params}).then(res => {
if(res.code === 1000) {
setApplyVisible(false)
reloadFormData()
}
})
}
const reload = () => {
getSettleAccountsInvoiceMessageList().then(({data}) => {
let _data = data.sort((a, b) => a.id - b.id)
setFieldState({
dataSource: _data,
useValue: _data[0]['id'],
})
})
}
const handleAdd = () => {
setMode('add')
modalRef.current.setVisible(true)
}
const handleCheck = (e) => {
setFieldState(() => ({
dataSource: [...fieldState.dataSource],
useValue: e.target.value,
}))
}
const handleDelete = async (id, e) => { // 选中当前的删除
e.stopPropagation()
try {
const result = await postSettleAccountsInvoiceMessageDelete({id})
if(result.code === 1000) {
reload()
setMode('delete')
}
} catch (error) {
}
}
const handleEdit = async (item, e, mode?) => {
e.stopPropagation()
const { data } = await getSettleAccountsInvoiceMessageDetails({id: item.id})
setFormInitValue({...data, isDefault: item.isDefault})
setMode(mode || 'edit')
modalRef.current.setVisible(true)
}
const handleSetDefault = async (item, e) => {
e.stopPropagation()
await postSettleAccountsInvoiceMessageUpdate({...item, isDefault: item.isDefault ? 0 : 1})
reload()
}
const footer = (<div
style={{
textAlign: 'right',
}}
>
<Button onClick={()=>setApplyVisible(false)} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={confirmApplySubmit} type="primary">
确定
</Button>
</div>)
return (
<>
<Row style={{ marginTop: 24 }} gutter={24}>
<Col span={(data.externalStateName !== '不接受订单') || (data.orderKind === OrderKindType.SRM_ORDER) ? 15 : 12}>
<MellowCard title='交信息' fullHeight>
<Row gutter={24}>
<Col span={24}>
<MellowCard title='交信息' fullHeight>
<RenderCard infoList={payInfo} dataSource={consignee} />
</MellowCard>
</Col>
<Col span={(data.externalStateName !== '不接受订单') || (data.orderKind === OrderKindType.SRM_ORDER) ? 9: 6}>
<Col span={24} style={{ marginTop: 24 }}>
<MellowCard title='发票信息' fullHeight extra={data.showApplyInvoice && applyable && <a onClick={applyInvoice}>申请开票</a>}>
<RenderCard infoList={invoiceInfo} dataSource={{...data, ...data.requirement}} />
</MellowCard>
</Col>
<Col span={24} style={{ marginTop: 24 }}>
<MellowCard title='其他信息' fullHeight>
<RenderCard infoList={otherInfo} dataSource={{...data, ...data.requirement}} />
</MellowCard>
......@@ -86,7 +213,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
(data.orderKind === OrderKindType.SRM_ORDER) || !data.hasContract ?
null
:
<Col span={6}>
<Col span={24} style={{ marginTop: 24 }}>
<MellowCard title='电子合同' fullHeight>
<ContractList
dataSource={
......@@ -104,6 +231,7 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
</Col>
}
</Row>
{/* 查看发票 */}
<Modal title="发票信息" visible={isModalVisible} onOk={()=>setIsModalVisible(false)} onCancel={()=>setIsModalVisible(false)}>
<Row gutter={[0 ,10]} style={{fontSize: 14}}>
<Col span={4} style={{fontSize: 12, color: "#909399"}}>开具类型:</Col><Col span={20}>{invoice?.invoiceKind === 1 ? "企业" : "个人"}</Col>
......@@ -116,8 +244,57 @@ const OrderMergeInfo: React.FC<OrderMergeInfoProps> = (props) => {
<Col span={4} style={{fontSize: 12, color: "#909399"}}>电话:</Col><Col span={20}>{invoice?.phone}</Col>
</Row>
</Modal>
</>
)
{/* 选择开票 */}
<Drawer
title="申请开票"
visible={applyVisible}
footer={footer}
width={608}
>
<div>
<Radio.Group className={style.raido_group} value={fieldState.useValue} onChange={e => handleCheck(e)}>
<div className={style.invoice_list}>
{
fieldState.dataSource.map((item, index) => (<Row style={{marginBottom: 16}}><Col span={24}>
<Radio className={cx(style.list_radio)} value={item.id} key={`address_list_radio_${item?.id}`}>
<div className={style.invoice_list_item} key={`invoice_list_item_${index}`}>
<div className={style.invoice_list_item_content}>
<div className={cx(style.invoice_list_item_content_tag, item.kind !== 1 ? style.special : '')}>{item.kind === 1 ? '增值税普通发票' : '增值税专用发票'}</div>
<div className={style.invoice_list_item_content_name}>
<span>{item.invoiceTitle}</span>
<span>({item.type === 1 ? '企业' : '个人'})</span>
{
item.isDefault === 1 ? <div className={style.default}>默认</div> :
<div className={style.set_default} onClick={e => handleSetDefault(item, e)}>设为默认</div>
}
</div>
</div>
{
fieldState.useValue === item.id &&
<div className={style.invoice_list_item_btn_group}>
<div className={style.invoice_list_item_btn} onClick={(e) => handleEdit(item, e)}>编辑</div>
<div className={style.invoice_list_item_btn} onClick={(e) => handleDelete(item?.id, e)}>删除</div>
</div>
}
</div>
</Radio>
</Col></Row>))
}
<Row><Col span={24}>
<div
className={style.select_style_border}
style={{width: '100%', height: '100%', borderStyle: "dashed"}}
onClick={handleAdd}
>
<p style={{width: '100%', textAlign: 'center', fontSize: 12, marginTop: 14}}><PlusOutlined />&nbsp;新增发票</p>
</div>
</Col></Row>
</div>
</Radio.Group>
<InvoiceModal mode={mode} formInitValue={formInitValue} currentRef={modalRef} reload={reload}/>
</div>
</Drawer>
</>)
}
OrderMergeInfo.defaultProps = {}
......
......@@ -12,9 +12,11 @@ import {
OrderKindType,
} from '@/constants/order'
import { AddressPop } from '../addressPop'
import { postOrderVendorValidateSubmitFreightUpdate } from '@/services/OrderNewV2Api'
import { postOrderVendorPageFreightUpdate, postOrderVendorPageUnitPriceUpdate, postOrderVendorValidateSubmitFreightUpdate } from '@/services/OrderNewV2Api'
import { postLogisticsFreightTemplateCalFreightPrice } from '@/services/LogisticsV2Api'
import { getProductPositionDeductionRecordList } from '@/services/ProductV2Api'
import { usePageStatus } from '@/hooks/usePageStatus'
import { useHttpRequest } from '@/hooks/useHttpRequest'
export interface OrderProductTableProps {}
......@@ -164,19 +166,27 @@ const couponColumns: any[] = [
const modalPriceActions = createFormActions()
const modalModifyActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, isEditData }) => {
const { reloadFormData } = useContext(OrderDetailContext)
const { product, receiverAddressId, orderMode, orderKind } = dataSource || {}
const creditsCommodity = (orderMode === 10 || orderMode === 25) // @todo 积分或渠道积分下单模式
const contractOrder = (orderKind === OrderKindType.SRM_ORDER)
const { modifyPrice = false } = usePageStatus()
const { productAmount, freight, totalAmount, promotionAmount, couponAmount, products } = product
const modelRef = useRef<any>({})
// const modelRef = useRef<any>({})
const modifyRef = useRef<any>({})
const [freePrice, setFreePrice] = useState<number>(freight || 0)
const [sum, setSum] = useState<number>(0)
const handleSetting = () => {
modelRef.current.setVisible(true)
// const handleSetting = () => {
// modelRef.current.setVisible(true)
// }
const handleModify = () => {
modifyRef.current.setVisible(true)
}
const [amountMoney, setAmountMoney] = useState<number>((sum*1000 + freePrice*1000)/1000)
......@@ -186,16 +196,29 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
setAmountMoney(() => (sum*1000 + freePrice*1000)/1000)
}, [sum, freePrice])
const handleConfirm = () => {
let free = modalPriceActions.getFieldValue('freePrice')
setFreePrice(Number(free || 0))
// 执行修改订单运费
postOrderVendorValidateSubmitFreightUpdate({orderId: dataSource.orderId, freight: free}).then(res => {
// // 待审核详情设置运费
// const handleConfirm = () => {
// let free = modalPriceActions.getFieldValue('freePrice')
// setFreePrice(Number(free || 0))
// postOrderVendorValidateSubmitFreightUpdate({orderId: dataSource.orderId, freight: free}).then(res => {
// if(res.code === 1000) {
// modelRef.current.setVisible(false)
// reloadFormData()
// }
// })
// }
// 查询列表修改运费
const handleOK = () => {
modalModifyActions.submit().then(async ({values}: any) => {
setFreePrice(Number(values.price || 0))
postOrderVendorValidateSubmitFreightUpdate({orderId: dataSource.orderId, freight: values.price, reason: values.reason}).then(res => {
if(res.code === 1000) {
modelRef.current.setVisible(false)
modifyRef.current.setVisible(false)
reloadFormData()
}
})
})
}
useEffect(() => {
......@@ -242,7 +265,12 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
{
contractOrder ? null : <>
<Col span={2}>
<div>运费 { isEditData && !creditsCommodity && !contractOrder && <SettingOutlined style={{marginLeft: 8}} onClick={handleSetting}/>}</div>
<div>运费
{/* 待审核状态下的修改 */}
{ isEditData && !creditsCommodity && !contractOrder && <SettingOutlined style={{marginLeft: 8}} onClick={handleModify}/>}
{/* 查询列表跳转的修改 */}
{ modifyPrice && <SettingOutlined style={{marginLeft: 8}} onClick={handleModify}/>}
</div>
<div>{`¥${freight}`}</div>
</Col>
<Col span={2}>
......@@ -251,7 +279,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
</Col>
</>
}
<ModalForm
{/* <ModalForm
modalTitle='设置运费'
currentRef={modelRef}
initialValues={freePrice}
......@@ -291,7 +319,66 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
actions={modalPriceActions}
confirm={handleConfirm}
>
</ModalForm> */}
<ModalForm
modalTitle='修改运费'
currentRef={modifyRef}
initialValues={freePrice}
schema={{
type: 'object',
properties: {
NO_SUBMIT_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top'
},
properties: {
price: {
type: 'string',
title: '运费',
required: true,
"x-props": {
addonBefore: '¥'
},
"x-rules": [
{
validator: value => {
return isNaN(value)
},
message:'请正确输入数字金额',
},
{
pattern: /^\d+(\.\d{1,2})?$/,
message: '运费仅限两位小数',
},
]
},
reason: {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多50个汉字'
},
title: '取消原因',
"x-rules": [
{
required: true,
message: '请输入取消原因'
},
{
limitByte: true,
maxByte: 100
}
]
}
},
}
}
}}
actions={modalModifyActions}
confirm={handleOK}
>
</ModalForm>
</RowStyle>
}
......@@ -382,6 +469,17 @@ const EditableCell: React.FC<EditableCellProps> = ({
return <td {...restProps}>{childNode}</td>;
};
/**
* 销售订单详情相关商品table编辑 特说明
* 商品单价和订单运费可编辑情况:
* 1. 销售订单内部状态为待提交审核下 即data.innerStatusName === '待提交审核'
* 2. 销售订单查询列表操作 修改订单价格按钮跳转 即url的modifyPirce === true
* @param props
* @returns
*/
const modifyPriceActions = createFormActions();
const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const { ctl, data, reloadFormData } = useContext(OrderDetailContext)
const { product, orderMode, orderKind } = data || {}
......@@ -395,6 +493,9 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const warehouseRef = useRef<any>({})
const activityRef = useRef<any>({})
const couponRef = useRef<any>({})
const { modifyPrice = false } = usePageStatus()
const modifyPriceRef = useRef<any>({})
const { run: runPrice, loading } = useHttpRequest(postOrderVendorValidateSubmitFreightUpdate)
// 判断是否可操作当前表格
const isEditData = data.innerStatusName === '待提交审核'
......@@ -406,60 +507,27 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
}
}
// const asyncGetMemberPrice = async (asyncData: any[]) => {
// return await Promise.all(asyncData.filter(v => v.memberPrice === undefined).map(async v => {
// const {code, data} = await getMemberManageUpperCreditParamGet({
// parentMemberId: v.memberId,
// parentMemberRoleId: v.memberRoleId
// }, {ttl: 60 * 1000, useCache: true})
// return code === 1000 ? { value: (data.parameter * 100) + '%', id: v.id } : { value: '', id: 0 }
// }
// ))
// }
// useEffect(() => {
// // 过滤 会员折扣不存在的列表
// const hasPriceList = orderProductRequests.filter(v => !v.memberPrice)
// if (hasPriceList.length > 0) {
// asyncGetMemberPrice(hasPriceList).then((asyncData) => {
// if (asyncData.length > 0) {
// const newData = orderProductRequests.map((v, i) => {
// if (!v.memberPrice) {
// v.memberPrice = asyncData.find(j => j.id === v.id)?.value || 0
const handleSave = row => {
// const newData = [...product.products];
// const index = newData.findIndex(item => row.orderProductId === item.orderProductId);
// const item = newData[index];
// newData.splice(index, 1, {
// ...item,
// ...row,
// });
// // 执行修改订单价格
// postOrderVendorValidateSubmitFreightUpdate({orderId: data.orderId, prices: [{ orderProductId: row.orderProductId, price: row.price }]}).then(res=>{
// if(res.code === 1000) {
// reloadFormData()
// }
// return v
// })
// ctl.setData({
// ...data,
// orderProductRequests: newData
// })
// }
// product: {
// ...data.product,
// products: newData.sort((a, b) => a.orderProductId - b.orderProductId)
// },
// })
// }
// }, [orderProductRequests])
const handleSave = row => {
const newData = [...product.products];
const index = newData.findIndex(item => row.orderProductId === item.orderProductId);
const item = newData[index];
newData.splice(index, 1, {
...item,
...row,
});
// 执行修改订单价格
postOrderVendorValidateSubmitFreightUpdate({orderId: data.orderId, prices: [{ orderProductId: row.orderProductId, price: row.price }]}).then(res=>{
if(res.code === 1000) {
reloadFormData()
}
})
ctl.setData({
...data,
product: {
...data.product,
products: newData.sort((a, b) => a.orderProductId - b.orderProductId)
},
})
};
const handlePreviewWarehouse = (record) => {
......@@ -471,6 +539,27 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
}
const handleModifyPrice = (record) => {
modifyPriceRef.current.setVisible(true)
modifyPriceActions.setFieldValue('orderProductId', record.orderProductId)
}
// 提交修改价格
const handleSubmitModifyPrice = () => {
modifyPriceActions.submit().then(async ({values}: any) => {
values.orderId = data.orderId
console.log(values)
const result = await runPrice(values)
if (result.code === 1000) {
modifyPriceActions.reset()
modifyPriceRef.current.setVisible(false)
setTimeout(() => {
reloadFormData()
}, 800)
}
})
}
// 订单商品列
const productInfoColumns: any[] = [
{
......@@ -509,7 +598,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex: 'price',
align: 'left',
key: 'price',
editable: isEditData
// editable: isEditData
},
{
title: '会员折扣',
......@@ -517,7 +606,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
align: 'center',
key: 'discount',
// render: (text, record) => record.isMemberPrice ? (text * 10000 / 100 + '%') : null
render: (text, record) => (text + '%')
render: (text) => (text + '%')
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
......@@ -530,7 +619,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex: 'tax',
align: 'center',
key: 'tax',
render: (text, record) => text ? '是' : '否'
render: (text) => text ? '是' : '否'
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
......@@ -552,6 +641,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
align: 'center',
key: 'opeartion',
render: (_, record) => <>
{ (modifyPrice || isEditData) && <Button type='link' onClick={() => handleModifyPrice(record)}>修改单价</Button> }
<Button type='link' onClick={() => handlePreviewWarehouse(record)}>查看库存记录</Button>
<Button type='link' onClick={() => handlePreviewActivity(record)}>查看活动记录</Button>
</>
......@@ -680,7 +770,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
}),
};
});
return (
return (<>
<MellowCard title={contractOrder ? '订单物料' : '订单商品'} style={{marginTop: 24}} bordered={false}>
<Table
columns={ contractOrder ? materialInfo : columns}
......@@ -732,7 +822,69 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
</MellowCard>
)
{/* 修改单价 */}
<ModalForm
modalTitle='修改单价'
currentRef={modifyPriceRef}
confirm={handleSubmitModifyPrice}
actions={modifyPriceActions}
schema={{
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'top',
},
properties: {
orderProductId: {
type: 'number',
title: '当前订单商品id',
visible: false,
},
price:{
title: "单价",
type: 'string',
"x-props": {
addonBefore: '¥'
},
'x-rules': [
{
required: true,
message: '请填写单价'
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '单价仅限三位小数'
}
]
},
reason: {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多50个汉字'
},
title: '取消原因',
"x-rules": [
{
required: true,
message: '请输入取消原因'
},
{
limitByte: true,
maxByte: 100
}
]
}
}
}
}
}}
modalProps={{confirmLoading: loading}}
/>
</>)
}
SaleOrderProductTable.defaultProps = {}
......
......@@ -106,11 +106,19 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
})
}
export interface JumpFormValueType {
shopId: number;
vendorMemberId: number;
vendorRoleId: number;
}
// 异步处理发货 预约时间 时间段配置
export const useOrderDeliverTimeEffect = async (ctx: ISchemaFormActions | ISchemaFormAsyncActions, shopId) => {
export const useOrderDeliverTimeEffect = async (ctx: ISchemaFormActions | ISchemaFormAsyncActions, shopId, jumpFormValue?: JumpFormValueType) => {
if(shopId) {
const vendorMemberId = ctx.getFieldValue('vendorMemberId')
const vendorRoleId = ctx.getFieldValue('vendorRoleId')
// const vendorMemberId = ctx.getFieldValue('vendorMemberId')
// const vendorRoleId = ctx.getFieldValue('vendorRoleId')
const { vendorMemberId, vendorRoleId } = jumpFormValue
const { code, data } = await getOrderBuyerFindDeliveryDate({shopId, vendorMemberId, vendorRoleId})
if(code !== 1000) { return false; }
......
......@@ -6,7 +6,7 @@ import { createFormActions, registerVirtualBox, useFormSpy } from '@formily/antd
import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
import { mergeAllSchemas } from './schema'
import { useModelTypeChange, useEditHideField, useOrderFormInitEffect, useProductTableChangeForPay, useOrderDeliverTimeEffect } from './effects'
import { useModelTypeChange, useEditHideField, useOrderFormInitEffect, useProductTableChangeForPay, useOrderDeliverTimeEffect, JumpFormValueType } from './effects'
import { orderCombination, orderTypeLabelMap, procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import { OrderModalType } from '@/constants/order'
import ProductModalTable, { filterProductDataById } from './components/productModalTable'
......@@ -144,6 +144,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = () => {
}
return resultState
})
const jumpFormValueRef = useRef<JumpFormValueType | null>()
const { formContext } = useFormDetail()
......@@ -189,6 +190,11 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = () => {
const { code, data: quotationData } = await getTransactionNotarizeEnquiryProductQuotationDetails({ id: quotationId })
if(code === 1000) {
const { quotationNo, details, shopId, supplyMembersName, supplyMembersId, supplyMembersRoleId, inquiryListId } = quotationData
jumpFormValueRef.current = {
shopId,
vendorMemberId: supplyMembersId,
vendorRoleId: supplyMembersRoleId,
}
addSchemaAction.setFieldValue('quoteId', quotationId)
addSchemaAction.setFieldValue('quoteNo', quotationNo)
addSchemaAction.setFieldValue('shopId', shopId)
......@@ -517,7 +523,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = () => {
$('onFieldValueChange', 'shopId').subscribe(state => {
// 初始化 配送时间段处理
useOrderDeliverTimeEffect(ctx, state.value)
useOrderDeliverTimeEffect(ctx, state.value, jumpFormValueRef.current)
})
// // 新增下并且不是采购跳转 切换商城 清空受影响的字段
......
......@@ -103,7 +103,7 @@ export const procurementProcessField = (value) => {
weight: item.logistics.weight,
stock: item.stockCount,
discount: item.isMemberPrice ? item.memberPrice : 1, // 字段需求 无折扣为1
price: item.isMemberPrice ? Number((item.money / item.purchaseCount / item.memberPrice).toFixed(2)) : Number((item.money / item.purchaseCoun).toFixed(2)),
price: item.isMemberPrice ? Number((item.money / item.purchaseCount / item.memberPrice).toFixed(2)) : Number((item.money / item.purchaseCount).toFixed(2)),
tax: item.taxRate > 0,
vendorMemberId: item.memberId,
vendorRoleId: item.memberRoleId,
......
......@@ -87,7 +87,8 @@ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
const renderProcessType = (v: any) => {
return <Tag color={ProcessTagColor[v.processType - 1]}>
{ProcessTagType[v.processType - 1]}
{/* {ProcessTagType[v.processType - 1]} */}
{v.processTypeName}
</Tag>
}
......
......@@ -4,17 +4,19 @@
padding: 0;
margin: 0;
&-header {
background: #FAFBFC;
}
&-item {
padding: 14px 16px;
line-height: 14px;
display: flex;
align-items: center;
background: #FAFBFC;
// background: #FAFBFC;
color: #303133;
&-good {
width: 25%;
&-name {
line-height: 14px;
margin-bottom: 13px;
......@@ -35,8 +37,6 @@
}
&-extra {
width: 20%;
&-item {
display: flex;
align-items: center;
......@@ -60,8 +60,6 @@
}
&-comment {
width: 40%;
&-main {
margin-top: 6px;
line-height: 14px;
......@@ -71,13 +69,18 @@
}
}
&-header {
background: #FAFBFC;
}
&-actions {
flex: 1;
text-align: center;
}
&:not(:last-child) {
margin-bottom: 16px;
// margin-bottom: 16px;
border-bottom: 1px solid #EDEEEF;
}
}
}
import React, { useState, useEffect } from 'react';
import { Button, Rate, Spin, Pagination } from 'antd';
import { Button, Rate, Spin, Pagination, Switch, Tooltip } from 'antd';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import moment from 'moment';
import NiceForm from '@/components/NiceForm';
import { checkMore } from '@/utils';
import { searchSchema } from './schema';
import styles from './index.less';
import { QuestionCircleOutlined } from '@ant-design/icons';
import cx from 'classnames'
import { postMemberCommentSupplyReceiveShowEvaluationUpdate } from '@/services/MemberV2Api';
const formActions = createFormActions();
const {
......@@ -85,6 +88,11 @@ export interface RecordItem {
* 交易时间
*/
dealTime: string;
/**
* 状态 1显示 2隐藏
*/
status: number;
};
export interface RecordRes {
......@@ -113,6 +121,11 @@ interface RecordListProps {
*/
editable?: boolean;
/**
* 是否可切换状态
*/
statusable?: boolean;
fetchList: (params: ListParams) => Promise<RecordRes>;
onCheck: (record: RecordItem) => void;
......@@ -295,6 +308,16 @@ export default class RecordList extends React.Component<RecordListProps, RecordL
}
};
onChange = (e, i) => {
this.setState({ loading: true })
postMemberCommentSupplyReceiveShowEvaluationUpdate({ id: i.id, status: e ? 1 : 2 }).then(res => {
if(res.code === 1000) {
this.refresh()
}
this.setState({ loading: false })
})
}
render() {
const {
paginationType = 'pagination',
......@@ -303,6 +326,7 @@ export default class RecordList extends React.Component<RecordListProps, RecordL
editable = false,
searchTip = '评价方',
explicable = false,
statusable = false,
} = this.props;
const { page, size, loading, receivedList, hasMore } = this.state;
......@@ -331,43 +355,85 @@ export default class RecordList extends React.Component<RecordListProps, RecordL
minHeight: loading ? 69 : 'auto',
}}
>
<li className={cx(styles['record-item'], styles['record-header'])}>
<div className={styles['record-item-header']} style={{width: '14%'}}>
评价星级
</div>
<div className={styles['record-item-header']} style={{width: '14%'}}>
评价内容
</div>
<div className={styles['record-item-header']} style={{width: '20%'}}>
采购商品
</div>
<div className={styles['record-item-header']} style={{width: '10%'}}>
成交数量
</div>
<div className={styles['record-item-header']} style={{width: '10%'}}>
评价方
</div>
<div className={styles['record-item-header']} style={{width: '12%'}}>
交易时间
</div>
{
statusable && <div className={styles['record-item-header']} style={{width: '14%'}}>
是否显示商品评价
<Tooltip title="显示则表示商品评价在商品详情页对买家进行展示;隐藏则表示商品评价在商品详情页对买家进行隐藏,买家依然可对订单进行评价。">
<QuestionCircleOutlined />
</Tooltip>
</div>
}
<div className={styles['record-item-header']}>
操作
</div>
</li>
{receivedList.data.map((item, index) => (
<li className={styles['record-item']} key={index}>
<div className={styles['record-item-good']}>
<div className={styles['record-item-comment']} style={{width: '14%'}}>
<Rate value={item.star} disabled />
</div>
<div className={styles['record-item-comment']} style={{width: '14%'}}>
<div className={styles['record-item-comment-main']} title={item.comment}>
{item.comment}
</div>
</div>
<div className={styles['record-item-good']} style={{width: '20%'}}>
<div className={styles['record-item-good-name']}>
{item.productName}
</div>
</div>
<div className={styles['record-item-good']} style={{width: '10%'}}>
<div>
<span className={styles['record-item-good-price']}>¥{item.price}</span>
<span className={styles['record-item-good-desc']}>X{item.quantity}</span>
{/* <span className={styles['record-item-good-price']}>¥{item.price}</span> */}
<span className={styles['record-item-good-price']}>{item.quantity}</span>
</div>
</div>
<div className={styles['record-item-extra']}>
<div className={styles['record-item-extra']} style={{width: '10%'}}>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
交易时间:
</div>
<div className={styles['record-item-extra-item-control']}>
{item.dealTime ? moment(item.dealTime).format('YYYY-MM-DD HH:mm:ss') : ''}
{item.target}
</div>
</div>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
{opposite ? '评价方' : '被评价方'}
</div>
<div className={styles['record-item-extra']} style={{width: '12%'}}>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-control']}>
{item.target}
{item.dealTime ? moment(item.dealTime).format('YYYY-MM-DD HH:mm:ss') : ''}
</div>
</div>
</div>
<div className={styles['record-item-comment']}>
<Rate value={item.star} disabled />
<div className={styles['record-item-comment-main']} title={item.comment}>
{item.comment}
{
statusable && <div className={styles['record-item-extra']} style={{width: '14%'}}>
<div className={styles['record-item-extra-item']}>
<Switch checked={item.status === 1} onChange={(e) => this.onChange(e, item)} />
</div>
</div>
}
<div className={styles['record-item-actions']}>
{editable && (
......
import { getLogisticsReceiverAddressAgentPage } from "@/services/LogisticsV2Api"
import { getMemberManageAllPageByordertype, getMemberManageOrderAgentMembers } from "@/services/MemberV2Api"
import { getOrderVendorGetOrderMode, postOrderVendorCreateAgentPaymentFind } from "@/services/OrderNewV2Api"
import { getProductCommodityCommonGetCommodityListByBuyer } from "@/services/ProductV2Api"
import { getProductCommodityCommonGetCommodityListByGuest } from "@/services/ProductV2Api"
import { getSettleAccountsAgentInvoiceMessageList } from "@/services/SettleV2Api"
import { getTransactionEnquiryProductAll, getTransactionProductQuotationList } from "@/services/TransactionV2Api"
export const fetchOrderApi = {
/** 弹窗获取商品列表 */
async getProductList(params) {
const { data } = await getProductCommodityCommonGetCommodityListByBuyer(params)
const { data } = await getProductCommodityCommonGetCommodityListByGuest(params)
return data
},
......
......@@ -4,10 +4,9 @@ import { createFormActions } from '@formily/antd'
import addressSchema from './schema'
import './index.less'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { getManageCountryAreaGetTelCode } from '@/services/ManageV2Api'
import { postLogisticsReceiverAddressAgentAdd, postLogisticsReceiverAddressAgentUpdate } from '@/services/LogisticsV2Api'
import { getManageAreaByPcode, GetManageAreaByPcodeRequest } from '@/services/ManageV2Api/id8689'
import { getManageAreaByPcode, GetManageAreaByPcodeRequest, getManageCountryAreaGetTelCode } from '@/services/ManageV2Api'
import { message } from 'antd'
import { postLogisticsReceiverAddressAgentAdd, postLogisticsReceiverAddressAgentUpdate } from '@/services/LogisticsV2Api'
export interface AddressModalProps {
mode: 'add' | 'edit' | 'preview' | 'default',
......
......@@ -138,12 +138,13 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
const fetchProductList = (values) => {
const modelType = schemaAction.getFieldValue('orderMode')
const supplyMembersId = schemaAction.getFieldValue('vendorMemberId')
const buyerMembersId = schemaAction.getFieldValue('buyerMemberId')
const shopId = schemaAction.getFieldValue('shopId')
const params = {
...values,
shopType: orderProductShopTypeMaps[modelType],
environment: 1,
memberId: supplyMembersId,
memberId: buyerMembersId,
priceTypeList: [1],
shopId: schemaAction.getFieldValue('shopId')
}
......
......@@ -120,18 +120,18 @@ export const baseOrderListColumns: any = () => {
key: 'amount',
render: (t, r) => (r.orderType === ORDER_TYPE_POINTS || r.orderType === ORDER_TYPE_CHANNEL_POINTS) ? t : `¥${t}`
},
// {
// title: '订单类型',
// dataIndex: 'orderTypeName',
// key: 'orderTypeName',
// },
{
title: '送货地址',
dataIndex: 'deliverAddress',
key: 'deliverAddress',
width: 164,
ellipsis: true,
title: '订单类型',
dataIndex: 'orderTypeName',
key: 'orderTypeName',
},
// {
// title: '送货地址',
// dataIndex: 'deliverAddress',
// key: 'deliverAddress',
// width: 164,
// ellipsis: true,
// },
{
title: '转单订单号',
dataIndex: 'relationNo',
......
......@@ -82,6 +82,10 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated`)
}
const handleModifyPrice = (record) => {
history.push(`${history.location.pathname}/preview?id=${record.orderId}&modifyPrice=true`)
}
const handleCancel = (r) => {
destoryRef.current.setVisible(true)
destroyActions.setFieldValue('id', r.orderId)
......@@ -179,13 +183,20 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record) => {
const buttonGroup = { '取消订单': record.showCancel, '中止': record.showTerminate, '评价': record.showComment, '转单': record.showTransfer }
const buttonGroup = {
'取消订单': record.showCancel,
'中止': record.showTerminate,
'评价': record.showComment,
'转单': record.showTransfer,
'修改订单价格': record.showModifyPrice,
}
const operationHandler = {
'取消订单': () => handleCancel(record),
'中止': () => handleSuspend(record),
'评价': () => handleEvaluate(),
'转单': () => onlyTransform(record.orderId),
'修改订单价格': () => handleModifyPrice(record)
}
return (
......
......@@ -5,14 +5,26 @@ import OrderDetailWrapper from '@/pages/transaction/components/orderDetailWrappe
import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../_public/order/effects/useOrderDetail';
import OrderDetailSection from '../../components/orderDetailSection';
import { Button } from 'antd';
import { history } from 'umi'
import { usePageStatus } from '@/hooks/usePageStatus';
const OrderPreview: React.FC = () => {
const { formContext, detailList } = useOrderDetail({type: 'saleOrder'})
const { modifyPrice = false } = usePageStatus() // 修改单价页面
const handleClick = () => {
history.goBack()
}
return (
<div>
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data}/>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
modifyPrice && <Button type='primary' onClick={handleClick}>
提交
</Button>
} />
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
......
......@@ -229,6 +229,7 @@ const Analysis: React.FC<AnalysisProps> = ({
orderId: item.orderId,
replyStatus: item.replyStatus,
dealTime: item.dealTime as string,
status: item.status,
};
}),
totalCount,
......@@ -401,6 +402,7 @@ const Analysis: React.FC<AnalysisProps> = ({
onExplain={handleExplain}
explicable={true}
ref={recordListRef}
statusable={true}
/>
</TabPane>
......
......@@ -51,8 +51,9 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
console.log(shopIds, shopInfo)
const res = await getProductCommodityCommonGetCommodityListBySeller({
...params,
shopType: shopInfo[0].type,
environment: shopInfo[0].environment,
// shopType: shopInfo[0].type,
// environment: shopInfo[0].environment,
shopId: shopInfo['id'],
statusList: [4, 5, 6, 7],
// idNotInList: idNotInList,
})
......
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