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

Merge branch 'dev' into test

parents a6034f2c 5a3d043c
...@@ -4,19 +4,19 @@ import { history } from 'umi' ...@@ -4,19 +4,19 @@ import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import TemplateItem from '../components/templateItem' import TemplateItem from '../components/templateItem'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { GetTemplateShopFindAllShelfShopTemplateResponse } from '@/services' import { GetTemplateWebPageTemplateWebFindAllShelfChannelTemplateResponse } from '@/services/TemplateApi'
import styles from './index.less' import styles from './index.less'
const ShopTemplate: React.FC = () => { const ShopTemplate: React.FC = () => {
const [templateList, setTemplateList] = useState<GetTemplateShopFindAllShelfShopTemplateResponse>([]) const [templateList, setTemplateList] = useState<GetTemplateWebPageTemplateWebFindAllShelfChannelTemplateResponse>([])
useEffect(() => { useEffect(() => {
fetchAllShelfShopTemplate() fetchAllShelfShopTemplate()
}, []) }, [])
const fetchAllShelfShopTemplate = () => { const fetchAllShelfShopTemplate = () => {
PublicApi.getTemplateChannelFindAllShelfChannelTemplate().then(res => { PublicApi.getTemplateWebPageTemplateWebFindAllShelfChannelTemplate().then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setTemplateList(res.data) setTemplateList(res.data)
} else if (res.code === 47001) { } else if (res.code === 47001) {
......
...@@ -6,7 +6,7 @@ import DetailPage from '@/components/DetailPage' ...@@ -6,7 +6,7 @@ import DetailPage from '@/components/DetailPage'
import UseModal from '../components/useModal' import UseModal from '../components/useModal'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { Environment_Status } from '@/constants' import { Environment_Status } from '@/constants'
import { GetTemplateShopFindShopTemplateDetailsResponse } from '@/services' import { GetTemplateWebPageTemplateWebFindChannelTemplateDetailsResponse } from '@/services/TemplateApi'
import default_img from '@/assets/imgs/template_default_img.png' import default_img from '@/assets/imgs/template_default_img.png'
import styles from './index.less' import styles from './index.less'
...@@ -21,7 +21,7 @@ interface TemplateDetailPropsType { ...@@ -21,7 +21,7 @@ interface TemplateDetailPropsType {
const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const { query: { type, id } } = props.location const { query: { type, id } } = props.location
const [detailInfo, setDetailInfo] = useState<GetTemplateShopFindShopTemplateDetailsResponse>() const [detailInfo, setDetailInfo] = useState<GetTemplateWebPageTemplateWebFindChannelTemplateDetailsResponse>()
const [useModalVisible, setUseModalVisible] = useState<boolean>(false) const [useModalVisible, setUseModalVisible] = useState<boolean>(false)
const [confirmLoading, setConfirmLoading] = useState(false) const [confirmLoading, setConfirmLoading] = useState(false)
...@@ -30,8 +30,10 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { ...@@ -30,8 +30,10 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}, []) }, [])
const fetchDetail = () => { const fetchDetail = () => {
//@ts-ignore const param: any = {
PublicApi.getTemplateChannelFindChannelTemplateDetails({ id }).then(res => { id
}
PublicApi.getTemplateWebPageTemplateWebFindChannelTemplateDetails(param).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setDetailInfo(res.data) setDetailInfo(res.data)
} }
...@@ -43,8 +45,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { ...@@ -43,8 +45,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
*/ */
const handleConfirmUse = () => { const handleConfirmUse = () => {
setConfirmLoading(true) setConfirmLoading(true)
//@ts-ignore PublicApi.postTemplateWebPageTemplateWebUseChannelTemplate({ id }).then(res => {
PublicApi.postTemplateChannelUseChannelTemplate({ id }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setUseModalVisible(false) setUseModalVisible(false)
fetchDetail() fetchDetail()
......
...@@ -486,7 +486,7 @@ const Order: React.FC<OrderPropsType> = (props) => { ...@@ -486,7 +486,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
}} /> }} />
) )
} }
<PayWay supplyMembersId={orderInfo.supplyMembersId} supplyMembersRoleId={orderInfo.supplyMembersRoleId} selectItem={selectPayWay} payWayList={orderInfo.payWayList} onChange={(val) => setSelectPayWay(val)} /> <PayWay supplyMembersId={orderInfo.supplyMembersId} deliveryType={orderInfo.logistics.deliveryType} supplyMembersRoleId={orderInfo.supplyMembersRoleId} selectItem={selectPayWay} payWayList={orderInfo.payWayList} onChange={(val) => setSelectPayWay(val)} />
{/* <Delivery /> */} {/* <Delivery /> */}
{ {
orderInfo.isInvoice && <Invoice state={needTheInvoice} onChange={(val) => setNeedTheInvoice(val)} onSelect={(val) => setSelectInvoiceInfo(val)} /> orderInfo.isInvoice && <Invoice state={needTheInvoice} onChange={(val) => setNeedTheInvoice(val)} onSelect={(val) => setSelectInvoiceInfo(val)} />
......
...@@ -14,15 +14,16 @@ interface PayWayProps { ...@@ -14,15 +14,16 @@ interface PayWayProps {
selectItem: any; selectItem: any;
supplyMembersId: number; supplyMembersId: number;
supplyMembersRoleId: number; supplyMembersRoleId: number;
deliveryType?: number;
} }
const PayWay: React.FC<PayWayProps> = (props) => { const PayWay: React.FC<PayWayProps> = (props) => {
const { payWayList = [], onChange, selectItem = {}, supplyMembersId, supplyMembersRoleId } = props const { payWayList = [], onChange, selectItem = {}, supplyMembersId, deliveryType = 1, supplyMembersRoleId } = props
const [expand, setExpand] = useState<boolean>(false) const [expand, setExpand] = useState<boolean>(false)
const [creditInfo, setCreditInfo] = useState<GetPayCreditGetCreditResponse>() const [creditInfo, setCreditInfo] = useState<GetPayCreditGetCreditResponse>()
const handleSelectWay = (item) => { const handleSelectWay = (item) => {
if (item.payType === 3) { if (item.payType === 3 || item.payType === 4) {
if (!getCreditState(item)) { if (!getCreditState(item)) {
return return
} }
...@@ -41,11 +42,11 @@ const PayWay: React.FC<PayWayProps> = (props) => { ...@@ -41,11 +42,11 @@ const PayWay: React.FC<PayWayProps> = (props) => {
}, [payWayList]) }, [payWayList])
const fetchCreditInfo = () => { const fetchCreditInfo = () => {
let param = { const param: any = {
parentMemberId: supplyMembersId, parentMemberId: supplyMembersId,
parentMemberRoleId: supplyMembersRoleId parentMemberRoleId: supplyMembersRoleId
} }
//@ts-ignore
PublicApi.getPayCreditGetCredit(param).then(res => { PublicApi.getPayCreditGetCredit(param).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
setCreditInfo(res.data) setCreditInfo(res.data)
...@@ -62,6 +63,12 @@ const PayWay: React.FC<PayWayProps> = (props) => { ...@@ -62,6 +63,12 @@ const PayWay: React.FC<PayWayProps> = (props) => {
} else if (creditInfo.isUsable === 0) { } else if (creditInfo.isUsable === 0) {
result = false result = false
} }
} else if(info.payType === 4) {
if(deliveryType !== 1) {
result = false
} else {
result = true
}
} }
return result return result
} }
......
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { Row, Col, message } from 'antd' import { Row, Col, message } from 'antd'
import { history } from 'umi' import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import TemplateItem from '../components/templateItem' import TemplateItem from '../components/templateItem'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { GetTemplateShopFindAllShelfShopTemplateResponse } from '@/services' import { GetTemplateWebPageTemplateWebFindAllShelfShopTemplateResponse } from '@/services/TemplateApi'
import styles from './index.less' import styles from './index.less'
const ShopTemplate: React.FC = () => { const ShopTemplate: React.FC = () => {
const [templateList, setTemplateList] = useState<GetTemplateShopFindAllShelfShopTemplateResponse>([]) const [templateList, setTemplateList] = useState<GetTemplateWebPageTemplateWebFindAllShelfShopTemplateResponse>([])
useEffect(() => { useEffect(() => {
fetchAllShelfShopTemplate() fetchAllShelfShopTemplate()
}, []) }, [])
const fetchAllShelfShopTemplate = () => { const fetchAllShelfShopTemplate = () => {
PublicApi.getTemplateShopFindAllShelfShopTemplate().then(res => { PublicApi.getTemplateWebPageTemplateWebFindAllShelfShopTemplate().then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setTemplateList(res.data) setTemplateList(res.data)
} else if (res.code === 47001) { } else if (res.code === 47001) {
message.destroy() message.destroy()
message.info("您还未创建店铺,请先创建店铺") message.info("您还未创建店铺,请先创建店铺")
setTimeout(() => { setTimeout(() => {
history.push('/memberCenter/shopAbility/infoManage') history.push('/memberCenter/shopAbility/infoManage')
}, 2000); }, 2000);
} }
}) })
} }
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<div className={styles.shop_center_template}> <div className={styles.shop_center_template}>
<Row gutter={24} className={styles.template_list}> <Row gutter={24} className={styles.template_list}>
{ {
templateList.map(item => ( templateList.map(item => (
<Col xxl={6} xl={8} lg={12} key={item.id}> <Col xxl={6} xl={8} lg={12} key={item.id}>
<TemplateItem templateInfo={item} type="shop" /> <TemplateItem templateInfo={item} type="shop" />
</Col> </Col>
)) ))
} }
</Row> </Row>
</div> </div>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
export default ShopTemplate export default ShopTemplate
import React, { useState, useEffect } from 'react' import React, { useState, useEffect } from 'react'
import { LayoutOutlined, EyeOutlined, PushpinOutlined } from '@ant-design/icons' import { LayoutOutlined, EyeOutlined, PushpinOutlined } from '@ant-design/icons'
import cx from 'classnames' import cx from 'classnames'
import DetailPage from '@/components/DetailPage' import DetailPage from '@/components/DetailPage'
import UseModal from '../components/useModal' import UseModal from '../components/useModal'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { Environment_Status } from '@/constants' import { Environment_Status } from '@/constants'
import { GetTemplateShopFindShopTemplateDetailsResponse } from '@/services' import { GetTemplateWebPageTemplateWebFindShopTemplateDetailsResponse } from '@/services/TemplateApi'
import default_img from '@/assets/imgs/template_default_img.png' import default_img from '@/assets/imgs/template_default_img.png'
import styles from './index.less' import styles from './index.less'
interface TemplateDetailPropsType { interface TemplateDetailPropsType {
location: { location: {
query: { query: {
id: number; id: number;
type: string; // 商城模板:shopCenter ;店铺模板:shop; 商品描述模板: goods type: string; // 商城模板:shopCenter ;店铺模板:shop; 商品描述模板: goods
} }
} }
} }
const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const { query: { type, id } } = props.location const { query: { type, id } } = props.location
const [detailInfo, setDetailInfo] = useState<GetTemplateShopFindShopTemplateDetailsResponse>() const [detailInfo, setDetailInfo] = useState<GetTemplateWebPageTemplateWebFindShopTemplateDetailsResponse>()
const [useModalVisible, setUseModalVisible] = useState<boolean>(false) const [useModalVisible, setUseModalVisible] = useState<boolean>(false)
const [confirmLoading, setConfirmLoading] = useState(false) const [confirmLoading, setConfirmLoading] = useState(false)
useEffect(() => { useEffect(() => {
fetchDetail() fetchDetail()
}, []) }, [])
const fetchDetail = () => { const fetchDetail = () => {
//@ts-ignore const param: any = {
PublicApi.getTemplateShopFindShopTemplateDetails({ id }).then(res => { id
if (res.code === 1000) { }
setDetailInfo(res.data) PublicApi.getTemplateWebPageTemplateWebFindShopTemplateDetails(param).then(res => {
} if (res.code === 1000) {
}) setDetailInfo(res.data)
} }
})
/** }
* 使用模板
*/ /**
const handleConfirmUse = () => { * 使用模板
setConfirmLoading(true) */
//@ts-ignore const handleConfirmUse = () => {
PublicApi.postTemplateShopUseShopTemplate({ id }).then(res => { setConfirmLoading(true)
if (res.code === 1000) {
setUseModalVisible(false) PublicApi.postTemplateWebPageTemplateWebUseShopTemplate({ id }).then(res => {
fetchDetail() if (res.code === 1000) {
} setUseModalVisible(false)
setConfirmLoading(false) fetchDetail()
}).catch(() => { }
setConfirmLoading(false) setConfirmLoading(false)
}) }).catch(() => {
} setConfirmLoading(false)
})
const handleLinkEdit = () => { }
window.location.href = `/shop/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`
// history.push(`/shop/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`) const handleLinkEdit = () => {
} window.location.href = `/shop/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`
// history.push(`/shop/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}`)
const handleLinkPreview = () => { }
window.location.href = `/shop/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
} const handleLinkPreview = () => {
window.location.href = `/shop/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}`
return ( }
<DetailPage
title="查看模板" return (
> <DetailPage
<div className={styles.template_detail}> title="查看模板"
<div className={styles.template_info_wrap}> >
<div className={styles.template_img_box}> <div className={styles.template_detail}>
<div className={cx(styles.type_tag)}>{Environment_Status[detailInfo?.environment]}</div> <div className={styles.template_info_wrap}>
<img src={default_img} /> <div className={styles.template_img_box}>
</div> <div className={cx(styles.type_tag)}>{Environment_Status[detailInfo?.environment]}</div>
<div className={styles.template_info}> <img src={default_img} />
<div className={styles.template_info_line}> </div>
<label>模板名称:</label> <div className={styles.template_info}>
<span>{detailInfo?.templateName}</span> <div className={styles.template_info_line}>
</div> <label>模板名称:</label>
<div className={styles.template_info_line}> <span>{detailInfo?.templateName}</span>
<label>适用环境:</label> </div>
<span>{Environment_Status[detailInfo?.environment]}</span> <div className={styles.template_info_line}>
</div> <label>适用环境:</label>
<div className={styles.template_info_line}> <span>{Environment_Status[detailInfo?.environment]}</span>
<label>模板描述:</label> </div>
<span>{detailInfo?.templateDescribe}</span> <div className={styles.template_info_line}>
</div> <label>模板描述:</label>
<div className={styles.template_info_line}> <span>{detailInfo?.templateDescribe}</span>
<label>使用站点:</label> </div>
<span>{detailInfo?.siteName}</span> <div className={styles.template_info_line}>
</div> <label>使用站点:</label>
<div className={styles.template_info_line}> <span>{detailInfo?.siteName}</span>
<label>使用商城:</label> </div>
<span>{detailInfo?.shopName}</span> <div className={styles.template_info_line}>
</div> <label>使用商城:</label>
</div> <span>{detailInfo?.shopName}</span>
</div> </div>
<div className={styles.btn} onClick={() => handleLinkPreview()}> </div>
<EyeOutlined /> </div>
<label>预览</label> <div className={styles.btn} onClick={() => handleLinkPreview()}>
</div> <EyeOutlined />
<div className={cx(styles.btn, styles.fit)} onClick={() => handleLinkEdit()}> <label>预览</label>
<LayoutOutlined /> </div>
<label>店铺装修</label> <div className={cx(styles.btn, styles.fit)} onClick={() => handleLinkEdit()}>
</div> <LayoutOutlined />
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => detailInfo?.use !== 1 ? setUseModalVisible(true) : {}}> <label>店铺装修</label>
<PushpinOutlined /> </div>
<label>{detailInfo?.use === 1 ? '使用中' : '使用'}</label> <div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => detailInfo?.use !== 1 ? setUseModalVisible(true) : {}}>
</div> <PushpinOutlined />
<label>{detailInfo?.use === 1 ? '使用中' : '使用'}</label>
<UseModal </div>
title="使用店铺模板"
visible={useModalVisible} <UseModal
dataInfo={detailInfo} title="使用店铺模板"
confirmLoading={confirmLoading} visible={useModalVisible}
onOk={() => handleConfirmUse()} dataInfo={detailInfo}
onCancel={() => setUseModalVisible(false)} confirmLoading={confirmLoading}
/> onOk={() => handleConfirmUse()}
</div> onCancel={() => setUseModalVisible(false)}
</DetailPage> />
) </div>
} </DetailPage>
)
export default TemplateDetail }
export default TemplateDetail
import { ISchema } from '@formily/antd' import { ISchema } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import moment from 'moment' import moment from 'moment'
export const orderTypeLabel = ['', export const orderTypeLabel = ['',
'询价采购', '询价采购',
'需求采购', '需求采购',
'现货采购', '现货采购',
'集采', '集采',
'积分兑换', '渠道直采',
'渠道直采', '渠道现货',
'渠道现货', '积分兑换',
'渠道积分兑换', '渠道积分兑换',
] ]
/** /**
* 销售订单状态枚举 * 销售订单状态枚举
*/ */
export enum SALE_ORDER_STATUS { export enum SALE_ORDER_STATUS {
PREVIEW_ORDER = -1, PREVIEW_ORDER = -1,
READY_APPROVED_ORDER, READY_APPROVED_ORDER,
ONE_LEVEL_APPROVED_ORDER, ONE_LEVEL_APPROVED_ORDER,
TWO_LEVEL_APPROVED_ORDER, TWO_LEVEL_APPROVED_ORDER,
CONFIRM_ORDER, CONFIRM_ORDER,
CONFIRM_PAY_RESULT_ORDER, CONFIRM_PAY_RESULT_ORDER,
ADD_SALE_ORDER, ADD_SALE_ORDER,
ADD_LOG_ORDER, ADD_LOG_ORDER,
CONFIRM_DELIVE_GOODS_ORDER, CONFIRM_DELIVE_GOODS_ORDER,
CONFIRM_RETURN_ORDER, CONFIRM_RETURN_ORDER,
RETURN_DOCUMENT_ORDER RETURN_DOCUMENT_ORDER
} }
/** /**
* 除了订单必填字段, 默认 * 除了订单必填字段, 默认
*/ */
export const tableListSchema: ISchema = { export const tableListSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
// orderNo: { // orderNo: {
// type: 'string', // type: 'string',
// "x-component": 'SearchFilter', // "x-component": 'SearchFilter',
// 'x-component-props': { // 'x-component-props': {
// placeholder: '请输入订单编号', // placeholder: '请输入订单编号',
// align: 'flex-end', // align: 'flex-end',
// }, // },
// }, // },
// [FORM_FILTER_PATH]: { // [FORM_FILTER_PATH]: {
// type: 'object', // type: 'object',
// 'x-component': 'flex-layout', // 'x-component': 'flex-layout',
// 'x-component-props': { // 'x-component-props': {
// inline: true, // inline: true,
// colStyle: { // colStyle: {
// marginLeft: 20 // marginLeft: 20
// } // }
// }, // },
mageLayout: { mageLayout: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
properties: { properties: {
topLayout: { topLayout: {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
grid: true, grid: true,
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: 'object',
'x-component': 'Children', 'x-component': 'Children',
'x-component-props': { 'x-component-props': {
children: '{{controllerBtns}}', children: '{{controllerBtns}}',
}, },
}, },
orderNo: { orderNo: {
type: 'string', type: 'string',
"x-component": 'Search', "x-component": 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '请输入订单编号', placeholder: '请输入订单编号',
align: 'flex-end', align: 'flex-end',
}, },
} }
}, },
}, },
[FORM_FILTER_PATH]: { [FORM_FILTER_PATH]: {
type: 'object', type: 'object',
'x-component': 'flex-layout', 'x-component': 'flex-layout',
'x-component-props': { 'x-component-props': {
rowStyle: { rowStyle: {
flexWrap: 'nowrap', flexWrap: 'nowrap',
}, },
colStyle: { colStyle: {
marginLeft: 20, marginLeft: 20,
}, },
}, },
properties: { properties: {
orderThe: { orderThe: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '请输入订单摘要', placeholder: '请输入订单摘要',
} }
}, },
"memberName": { "memberName": {
type: 'string', type: 'string',
"x-component-props": { "x-component-props": {
placeholder: '请输入采购会员名称' placeholder: '请输入采购会员名称'
} }
}, },
"[startCreateTime,endCreateTime]": { "[startCreateTime,endCreateTime]": {
type: 'array', type: 'array',
"x-component": 'DateRangePickerUnix', "x-component": 'DateRangePickerUnix',
'x-component-props': { 'x-component-props': {
placeholder: ['开始时间','结束时间'], placeholder: ['开始时间','结束时间'],
}, },
}, },
submit: { submit: {
'x-component': 'Submit', 'x-component': 'Submit',
'x-component-props': { 'x-component-props': {
children: '查询', children: '查询',
}, },
}, },
},}} },}}
}, },
} }
} }
...@@ -14,7 +14,7 @@ const TabHeader = ({dataSource}) => { ...@@ -14,7 +14,7 @@ const TabHeader = ({dataSource}) => {
<Col> <Col>
<div className={style.fontGray}>支付比例</div> <div className={style.fontGray}>支付比例</div>
<div className={style.bignumber}>{dataSource.payRatio}%</div> <div className={style.bignumber}>{dataSource.payRatio}%</div>
<div className={style.smallnumber}>{dataSource.payPrice || 0}</div> <div className={style.smallnumber}>{dataSource.channel !== 0 && '¥'}{dataSource.payPrice || 0}</div>
</Col> </Col>
<Col> <Col>
<StatusColors status={dataSource.externalState} type='payOut'/> <StatusColors status={dataSource.externalState} type='payOut'/>
...@@ -24,7 +24,7 @@ const TabHeader = ({dataSource}) => { ...@@ -24,7 +24,7 @@ const TabHeader = ({dataSource}) => {
// 支付信息 // 支付信息
const payTextList = ["", const payTextList = ["积分支付",
'线上支付', '线上支付',
'线下支付', '线下支付',
'授信支付', '授信支付',
...@@ -63,7 +63,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => { ...@@ -63,7 +63,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
</Row> </Row>
<Row> <Row>
<Col className={style.fontGray} span={4}>支付渠道: </Col> <Col className={style.fontGray} span={4}>支付渠道: </Col>
<Col>{payList.find(j => j.id === v.channel)?.way}</Col> <Col>{payList.find(j => j.id === v.channel)?.way || (v.channel === 0 && '积分支付')}</Col>
</Row> </Row>
</TabPane>) } </TabPane>) }
</Tabs> </Tabs>
......
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history, Link } from 'umi' import { history, Link } from 'umi'
import { Button, Row, Col, Modal } from 'antd' import { Button, Row, Col, Modal } 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, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState, DOC_TYPE_SALES_INVOICE } from '@/constants' import { ORDER_TYPE, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState, DOC_TYPE_SALES_INVOICE } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors' import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons' import { FieldTimeOutlined } from '@ant-design/icons'
import { import {
Chart, Chart,
Interval, Interval,
Axis, Axis,
Tooltip, Tooltip,
Coordinate, Coordinate,
Legend, Legend,
View, View,
Annotation, Annotation,
} from 'bizcharts'; } from 'bizcharts';
import DataSet from "@antv/data-set"; import DataSet from "@antv/data-set";
// 业务hooks, 待支付订单 // 业务hooks, 待支付订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const customOrderColumns: any[] = [ const customOrderColumns: any[] = [
{ {
title: '订单号', title: '订单号',
align: 'center', align: 'center',
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo', key: 'orderNo',
render: (text, record) => { render: (text, record) => {
// 查看订单, 需根据状态显示不同schema // 查看订单, 需根据状态显示不同schema
return ( return (
<EyePreview url={`/memberCenter/tranactionAbility/saleOrder/addSaleDelevedOrder/preview?id=${record.id}`}> <EyePreview url={`/memberCenter/tranactionAbility/saleOrder/addSaleDelevedOrder/preview?id=${record.id}`}>
{text} {text}
</EyePreview> </EyePreview>
) )
} }
}, },
{ {
title: '订单摘要/下单时间', title: '订单摘要/下单时间',
align: 'center', align: 'center',
dataIndex: 'orderThe', dataIndex: 'orderThe',
key: 'orderThe', key: 'orderThe',
render: (text, record) => <> render: (text, record) => <>
<div>{text}</div> <div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div> <div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>, </>,
width: 200 width: 200
}, },
{ {
title: '采购会员', title: '采购会员',
align: 'left', align: 'left',
dataIndex: 'memberName', dataIndex: 'memberName',
key: 'memberName', key: 'memberName',
}, },
{ {
title: '总金额/已支付(元)', title: '总金额/已支付(元)',
align: 'center', align: 'center',
dataIndex: 'sumPrice', dataIndex: 'sumPrice',
key: 'sumPrice', key: 'sumPrice',
render: text => '¥' + text render: text => '¥' + text
}, },
{ 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: '发货单号', title: '发货单号',
align: 'center', align: 'center',
dataIndex: 'invoiceNumber', dataIndex: 'deliverNo',
key: 'invoiceNumber', key: 'deliverNo',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link> render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link>
}, },
// { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text}, // { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text},
{ {
title: '订单类型', title: '订单类型',
align: 'center', align: 'center',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
render: (text) => ORDER_TYPE[text] render: (text) => ORDER_TYPE[text]
}, },
{ {
title: '外部状态', title: '外部状态',
align: 'center', align: 'center',
dataIndex: 'externalState', dataIndex: 'externalState',
key: 'externalState', key: 'externalState',
render: text => <StatusColors status={text} type='out'/> render: text => <StatusColors status={text} type='out'/>
}, },
{ {
title: '内部状态', title: '内部状态',
align: 'center', align: 'center',
dataIndex: 'purchaseOrderInteriorState', dataIndex: 'purchaseOrderInteriorState',
key: 'purchaseOrderInteriorState', key: 'purchaseOrderInteriorState',
render: (text) => <StatusColors status={text} type='saleInside'/> render: (text) => <StatusColors status={text} type='saleInside'/>
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
dataIndex: 'ctl', dataIndex: 'ctl',
key: 'ctl', key: 'ctl',
render: (text, record) => <> render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */} {/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED && { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED &&
<Button type='link' onClick={() => handleConfirm(record)}>审核</Button> <Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
} }
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER && { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER &&
<Button type='link' onClick={() => handleAdd(record)}>新增发货单</Button> <Button type='link' onClick={() => handleAdd(record)}>新增发货单</Button>
} }
</> </>
} }
] ]
const handleConfirm = async (record) => { const handleConfirm = async (record) => {
const modal = Modal.confirm({ const modal = Modal.confirm({
title: '确认审核操作', title: '确认审核操作',
content: `是否确认审核发货单号为${record.invoiceNumber}的销售发货单?`, content: `是否确认审核发货单号为${record.invoiceNumber}的销售发货单?`,
onOk: async () => { onOk: async () => {
const { code } = await PublicApi.postOrderAuditSalesInvoiceOrder({ const { code } = await PublicApi.postOrderAuditSalesInvoiceOrder({
id: record.orderDeliveryDetailsId, id: record.orderDeliveryDetailsId,
orderId: record.id orderId: record.id
}) })
if (code === 1000) { if (code === 1000) {
modal.destroy() modal.destroy()
ref.current.reload() ref.current.reload()
} }
} }
}) })
} }
const handleAdd = async (record) => { const handleAdd = async (record) => {
history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_SALES_INVOICE}&relevanceInvoices=1`) history.push(`/memberCenter/tranactionAbility/stockSellStorage/bills/add?relevanceInvoicesId=${record.id}&invoicesTypeId=${DOC_TYPE_SALES_INVOICE}&relevanceInvoices=1`)
} }
return { return {
columns: customOrderColumns, columns: customOrderColumns,
ref ref
} }
} }
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history, Link } from 'umi' import { history, Link } from 'umi'
import { Button, Row, Col } from 'antd' import { Button, Row, Col } 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, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants' import { ORDER_TYPE, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors' import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons' import { FieldTimeOutlined } from '@ant-design/icons'
import qs from 'querystring' import qs from 'querystring'
// 业务hooks, 待支付订单 // 业务hooks, 待支付订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const customOrderColumns: any[] = [ const customOrderColumns: any[] = [
{ {
title: '订单号', title: '订单号',
align: 'center', align: 'center',
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo', key: 'orderNo',
render: (text, record) => { render: (text, record) => {
// 查看订单, 需根据状态显示不同schema // 查看订单, 需根据状态显示不同schema
return ( return (
<EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyAddLogisticsOrder/preview?id=${record.id}`}> <EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyAddLogisticsOrder/preview?id=${record.id}`}>
{text} {text}
</EyePreview> </EyePreview>
) )
} }
}, },
{ {
title: '订单摘要/下单时间', title: '订单摘要/下单时间',
align: 'center', align: 'center',
dataIndex: 'orderThe', dataIndex: 'orderThe',
key: 'orderThe', key: 'orderThe',
render: (text, record) => <> render: (text, record) => <>
<div>{text}</div> <div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div> <div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>, </>,
width: 200 width: 200
}, },
{ {
title: '采购会员', title: '采购会员',
align: 'left', align: 'left',
dataIndex: 'memberName', dataIndex: 'memberName',
key: 'memberName', key: 'memberName',
}, },
{ {
title: '总金额', title: '总金额',
align: 'center', align: 'center',
dataIndex: 'sumPrice', dataIndex: 'sumPrice',
key: 'sumPrice', key: 'sumPrice',
render: text => '¥' + text render: text => '¥' + text
}, },
{ 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: '发货单号', title: '发货单号',
align: 'center', align: 'center',
dataIndex: 'invoiceNumber', dataIndex: 'deliverNo',
key: 'invoiceNumber', key: 'deliverNo',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link> render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link>
}, },
// { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text}, // { title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text},
{ {
title: '订单类型', title: '订单类型',
align: 'center', align: 'center',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
render: (text) => ORDER_TYPE[text] render: (text) => ORDER_TYPE[text]
}, },
{ {
title: '外部状态', title: '外部状态',
align: 'center', align: 'center',
dataIndex: 'externalState', dataIndex: 'externalState',
key: 'externalState', key: 'externalState',
render: text => <StatusColors status={text} type='out'/> render: text => <StatusColors status={text} type='out'/>
}, },
{ {
title: '内部状态', title: '内部状态',
align: 'center', align: 'center',
dataIndex: 'purchaseOrderInteriorState', dataIndex: 'purchaseOrderInteriorState',
key: 'purchaseOrderInteriorState', key: 'purchaseOrderInteriorState',
render: (text) => <StatusColors status={text} type='saleInside'/> render: (text) => <StatusColors status={text} type='saleInside'/>
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
dataIndex: 'ctl', dataIndex: 'ctl',
key: 'ctl', key: 'ctl',
render: (text, record) => <> render: (text, record) => <>
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ADD_LOGISTICS_ORDER && { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ADD_LOGISTICS_ORDER &&
<Button type='link' onClick={() => handleConfirm(record)}>新增物流单</Button> <Button type='link' onClick={() => handleConfirm(record)}>新增物流单</Button>
} }
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.DELIVERY_APPROVED_SUCCESS && { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.DELIVERY_APPROVED_SUCCESS &&
<Button type='link' onClick={() => handlePreview(record)}>查看物流单</Button> <Button type='link' onClick={() => handlePreview(record)}>查看物流单</Button>
} }
</> </>
} }
] ]
const handleConfirm = async (record) => { const handleConfirm = async (record) => {
const params = { const params = {
id: record.orderDeliveryDetailsId, id: record.orderDeliveryDetailsId,
createType: 2,// 创建方式 createType: 2,// 创建方式
shipmentOrderCode: record.invoiceNumber,// 发货单号 shipmentOrderCode: record.invoiceNumber,// 发货单号
invoicesNo: record.orderNo, // 对应订单号/售后单 invoicesNo: record.orderNo, // 对应订单号/售后单
relevanceType: 1 relevanceType: 1
} }
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?${qs.stringify(params)}`) history.push(`/memberCenter/logisticsAbility/logisticsSubmit/toOrderSumitList/add?${qs.stringify(params)}`)
} }
const handlePreview = async (record) => { const handlePreview = async (record) => {
const logisticsId = record.logisticsId const logisticsId = record.logisticsId
history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?id=${logisticsId}&invoicesTypeId=2`) history.push(`/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail?id=${logisticsId}&invoicesTypeId=2`)
} }
return { return {
columns: customOrderColumns columns: customOrderColumns
} }
} }
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history, Link } from 'umi' import { history, Link } from 'umi'
import { Button, Row, Col } from 'antd' import { Button, Row, Col } 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, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants' import { ORDER_TYPE, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors' import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons' import { FieldTimeOutlined } from '@ant-design/icons'
import { import {
Chart, Chart,
Interval, Interval,
Axis, Axis,
Tooltip, Tooltip,
Coordinate, Coordinate,
Legend, Legend,
View, View,
Annotation, Annotation,
} from 'bizcharts'; } from 'bizcharts';
import DataSet from "@antv/data-set"; import DataSet from "@antv/data-set";
// 业务hooks, 待支付订单 // 业务hooks, 待支付订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const customOrderColumns: any[] = [ const customOrderColumns: any[] = [
{ {
title: '订单号', title: '订单号',
align: 'center', align: 'center',
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo', key: 'orderNo',
render: (text, record) => { render: (text, record) => {
// 查看订单, 需根据状态显示不同schema // 查看订单, 需根据状态显示不同schema
return ( return (
<EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.id}`}> <EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.id}`}>
{text} {text}
</EyePreview> </EyePreview>
) )
} }
}, },
{ {
title: '订单摘要/下单时间', title: '订单摘要/下单时间',
align: 'center', align: 'center',
dataIndex: 'orderThe', dataIndex: 'orderThe',
key: 'orderThe', key: 'orderThe',
render: (text, record) => <> render: (text, record) => <>
<div>{text}</div> <div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div> <div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>, </>,
width: 200 width: 200
}, },
{ {
title: '采购会员', title: '采购会员',
align: 'left', align: 'left',
dataIndex: 'memberName', dataIndex: 'memberName',
key: 'memberName', key: 'memberName',
}, },
{ {
title: '总金额', title: '总金额',
align: 'center', align: 'center',
dataIndex: 'sumPrice', dataIndex: 'sumPrice',
key: 'sumPrice', key: 'sumPrice',
render: (t, r) => (r.type === 7 || r.type === 8) ? t : '¥' + t 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 发货单号跳转
{ {
title: '发货单号', title: '发货单号',
align: 'center', align: 'center',
dataIndex: 'invoiceNumber', dataIndex: 'deliverNo',
key: 'invoiceNumber', key: 'deliverNo',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link> render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link>
}, },
{ {
title: '订单类型', title: '订单类型',
align: 'center', align: 'center',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
render: (text) => ORDER_TYPE[text] render: (text) => ORDER_TYPE[text]
}, },
{ {
title: '外部状态', title: '外部状态',
align: 'center', align: 'center',
dataIndex: 'externalState', dataIndex: 'externalState',
key: 'externalState', key: 'externalState',
render: text => <StatusColors status={text} type='out'/> render: text => <StatusColors status={text} type='out'/>
}, },
{ {
title: '内部状态', title: '内部状态',
align: 'center', align: 'center',
dataIndex: 'purchaseOrderInteriorState', dataIndex: 'purchaseOrderInteriorState',
key: 'purchaseOrderInteriorState', key: 'purchaseOrderInteriorState',
render: (text) => <StatusColors status={text} type='saleInside'/> render: (text) => <StatusColors status={text} type='saleInside'/>
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
dataIndex: 'ctl', dataIndex: 'ctl',
key: 'ctl', key: 'ctl',
render: (text, record) => <> render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */} {/* 支付结果确认到账= 待审核状态 */}
{ (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) && { (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) &&
<Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button> <Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button>
} }
</> </>
} }
] ]
const handleConfirm = async (record) => { const handleConfirm = async (record) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/detail?id=${record.id}&orderDeliveryDetailsId=${record.orderDeliveryDetailsId}`) history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/detail?id=${record.id}&orderDeliveryDetailsId=${record.orderDeliveryDetailsId}`)
} }
return { return {
columns: customOrderColumns columns: customOrderColumns
} }
} }
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history, Link } from 'umi' import { history, Link } from 'umi'
import { Button, Row, Col } from 'antd' import { Button, Row, Col } 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, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants' import { ORDER_TYPE, PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import StatusColors from '@/pages/transaction/components/StatusColors' import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons' import { FieldTimeOutlined } from '@ant-design/icons'
import { import {
Chart, Chart,
Interval, Interval,
Axis, Axis,
Tooltip, Tooltip,
Coordinate, Coordinate,
Legend, Legend,
View, View,
Annotation, Annotation,
} from 'bizcharts'; } from 'bizcharts';
import DataSet from "@antv/data-set"; import DataSet from "@antv/data-set";
// 业务hooks // 业务hooks
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const customOrderColumns: any[] = [ const customOrderColumns: any[] = [
{ {
title: '订单号', title: '订单号',
align: 'center', align: 'center',
dataIndex: 'orderNo', dataIndex: 'orderNo',
key: 'orderNo', key: 'orderNo',
render: (text, record) => { render: (text, record) => {
// 查看订单, 需根据状态显示不同schema // 查看订单, 需根据状态显示不同schema
return ( return (
<EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyConfirmReturnOrder/preview?id=${record.id}`}> <EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyConfirmReturnOrder/preview?id=${record.id}`}>
{text} {text}
</EyePreview> </EyePreview>
) )
} }
}, },
{ {
title: '订单摘要/下单时间', title: '订单摘要/下单时间',
align: 'center', align: 'center',
dataIndex: 'orderThe', dataIndex: 'orderThe',
key: 'orderThe', key: 'orderThe',
render: (text, record) => <> render: (text, record) => <>
<div>{text}</div> <div>{text}</div>
<div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div> <div><FieldTimeOutlined />{formatTimeString(record.createTime)}</div>
</>, </>,
width: 200 width: 200
}, },
{ {
title: '采购会员', title: '采购会员',
align: 'left', align: 'left',
dataIndex: 'memberName', dataIndex: 'memberName',
key: 'memberName', key: 'memberName',
}, },
{ {
title: '总金额', title: '总金额',
align: 'center', align: 'center',
dataIndex: 'sumPrice', dataIndex: 'sumPrice',
key: 'sumPrice', key: 'sumPrice',
render: text => '¥' + text render: text => '¥' + text
}, },
{ 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: '发货单号', title: '发货单号',
align: 'center', align: 'center',
dataIndex: 'invoiceNumber', dataIndex: 'deliverNo',
key: 'invoiceNumber', key: 'deliverNo',
render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link> render: (text, record) => <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${record.orderDeliveryDetailsId}&preview=1`}>{text}</Link>
}, },
{ {
title: '订单类型', title: '订单类型',
align: 'center', align: 'center',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
render: (text) => ORDER_TYPE[text] render: (text) => ORDER_TYPE[text]
}, },
{ {
title: '外部状态', title: '外部状态',
align: 'center', align: 'center',
dataIndex: 'externalState', dataIndex: 'externalState',
key: 'externalState', key: 'externalState',
render: text => <StatusColors status={text} type='out'/> render: text => <StatusColors status={text} type='out'/>
}, },
{ {
title: '内部状态', title: '内部状态',
align: 'center', align: 'center',
dataIndex: 'purchaseOrderInteriorState', dataIndex: 'purchaseOrderInteriorState',
key: 'purchaseOrderInteriorState', key: 'purchaseOrderInteriorState',
render: (text) => <StatusColors status={text} type='saleInside'/> render: (text) => <StatusColors status={text} type='saleInside'/>
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
dataIndex: 'ctl', dataIndex: 'ctl',
key: 'ctl', key: 'ctl',
render: (text, record) => <> render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */} {/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_RECEIPT && { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_RECEIPT &&
<Button type='link' onClick={() => handleConfirm(record)}>确认回单</Button> <Button type='link' onClick={() => handleConfirm(record)}>确认回单</Button>
} }
</> </>
} }
] ]
const handleConfirm = async (record) => { const handleConfirm = async (record) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmReturnOrder/detail?id=${record.id}&orderDeliveryDetailsId=${record.orderDeliveryDetailsId}`) history.push(`/memberCenter/tranactionAbility/saleOrder/readyConfirmReturnOrder/detail?id=${record.id}&orderDeliveryDetailsId=${record.orderDeliveryDetailsId}`)
} }
return { return {
columns: customOrderColumns columns: customOrderColumns
} }
} }
import { action, computed, observable, runInAction } from 'mobx' import { action, computed, observable, runInAction } from 'mobx'
import { ISiteModule } from '@/module/siteModule' import { ISiteModule } from '@/module/siteModule'
import { GlobalConfig } from '@/global/config' import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
class SiteStore implements ISiteModule { class SiteStore implements ISiteModule {
// 可在根目录下的demo.js修改数据 // 可在根目录下的demo.js修改数据
@observable public siteId: number = GlobalConfig.global.siteInfo.id; // 站点id @observable public siteId: number = GlobalConfig.global.siteInfo.id; // 站点id
@observable public siteUrl: string = GlobalConfig.global.siteInfo.siteUrl; // 站点域名 @observable public siteUrl: string = GlobalConfig.global.siteInfo.siteUrl; // 站点域名
@observable public mallTemplateId: number = null; // 企业商城模板id @observable public mallTemplateId: number = null; // 企业商城模板id
@observable public mallTemplateInfo: any = {}; // 企业商城模板id @observable public mallTemplateInfo: any = {}; // 企业商城模板id
@observable public shopTemplateId: number = null; // 店铺模板id @observable public shopTemplateId: number = null; // 店铺模板id
@observable public channelTemplateId: number = null; // 渠道模板id @observable public channelTemplateId: number = null; // 渠道模板id
@observable public commodityTemplateInfo: any = {} @observable public commodityTemplateInfo: any = {}
/** /**
* 根据站点查询正在使用的商城模板 * 根据站点查询正在使用的商城模板
*/ */
@action.bound @action.bound
public findUseMallTemplate = async () => { public findUseMallTemplate = async () => {
const tempMallTemplateInfo = sessionStorage.getItem("mallTemplateInfo") const tempMallTemplateInfo = sessionStorage.getItem("mallTemplateInfo")
if (tempMallTemplateInfo) { if (tempMallTemplateInfo) {
this.mallTemplateInfo = JSON.parse(tempMallTemplateInfo) this.mallTemplateInfo = JSON.parse(tempMallTemplateInfo)
this.mallTemplateId = this.mallTemplateInfo.id this.mallTemplateId = this.mallTemplateInfo.id
return return
} }
const param: any = { const param: any = {
siteId: this.siteId siteId: this.siteId
} }
const res = await PublicApi.getTemplatePlatformFindUseTemplateBySite(param) const res = await PublicApi.getTemplatePlatformFindUseTemplateBySite(param)
runInAction(() => { runInAction(() => {
this.mallTemplateInfo = res.data || {} this.mallTemplateInfo = res.data || {}
this.mallTemplateId = this.mallTemplateInfo.id this.mallTemplateId = this.mallTemplateInfo.id
sessionStorage.setItem("mallTemplateInfo", JSON.stringify(this.mallTemplateInfo)) sessionStorage.setItem("mallTemplateInfo", JSON.stringify(this.mallTemplateInfo))
}) })
} }
/** /**
* 根据站点查询正在使用的商品描述模板 * 根据站点查询正在使用的商品描述模板
*/ */
@action.bound @action.bound
public findUseGoodsTemplate = async () => { public findUseGoodsTemplate = async () => {
const tempCommodityTemplateInfo = sessionStorage.getItem("commodityTemplateInfo") const tempCommodityTemplateInfo = sessionStorage.getItem("commodityTemplateInfo")
if (tempCommodityTemplateInfo) { if (tempCommodityTemplateInfo) {
this.commodityTemplateInfo = JSON.parse(tempCommodityTemplateInfo) this.commodityTemplateInfo = JSON.parse(tempCommodityTemplateInfo)
return return
} }
const param: any = { const param: any = {
siteId: this.siteId siteId: this.siteId
} }
const res = await PublicApi.getTemplateGoodsFindUseGoodsTemplate(param) const res = await PublicApi.getTemplateWebPageTemplateWebFindGoodsDescribeTemplate(param)
runInAction(() => { runInAction(() => {
if(res.code === 1000) { if(res.code === 1000) {
this.commodityTemplateInfo = res.data this.commodityTemplateInfo = res.data
sessionStorage.setItem("commodityTemplateInfo", JSON.stringify(this.commodityTemplateInfo)) sessionStorage.setItem("commodityTemplateInfo", JSON.stringify(this.commodityTemplateInfo))
} }
}) })
} }
} }
export default SiteStore export default SiteStore
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