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

fix:渠道商品添加物流相关信息,处理订单自提方式无法显示自提地址,处理采购下单多商品下价格运算异常,处理列表高级筛选后重置异常

parent fb7f5abb
......@@ -51,7 +51,7 @@
"bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.0.0",
"god": "^0.2.1",
"god": "0.2.2",
"immutability-helper": "^3.1.1",
"lingxi-design": "^1.0.8",
"lingxi-design-ui": "^1.1.15",
......
......@@ -55,6 +55,7 @@ const Search = props => {
)}
<Button
onClick={() => {
sessionStorage.setItem('tableRest', 'true')
props.form.reset();
props.form.submit();
}}
......
......@@ -207,4 +207,8 @@
z-index: 1;
}
.ant-input-textarea {
width: 100%;
}
}
......@@ -122,7 +122,7 @@ const Organ: React.FC<{}> = () => {
</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={handleDeleteMenu}>
<Button style={{ marginTop: 32, marginBottom: 16}}>
删除菜单
删除
</Button>
</Popconfirm>
</>
......
import React, { useState, useEffect, useRef } from 'react'
import { history } from 'umi'
import { Form, Select, Radio, Checkbox, InputNumber } from 'antd'
import { PublicApi } from '@/services/api'
import {
GetLogisticsSelectListCompanyResponse,
GetLogisticsSelectListShipperAddressResponse,
GetLogisticsSelectListFreightTemplateResponse
} from '@/services/LogisticsApi'
import { store } from '@/store'
const { ChannelProudctStore } = store
const layout = {
labelCol: {
span: 2,
},
wrapperCol: {
span: 12,
},
}
export interface Iprops {
onRef: (refs: any) => void;
}
const { Option } = Select
const SetLogistics: React.FC<Iprops> = (props) => {
const { onRef } = props
const [logisticsForm] = Form.useForm()
const [logisticsCompanyLists, setLogisticsCompanyLists] = useState<GetLogisticsSelectListCompanyResponse>()
const [logisticsAddressList, setLogisticsAddressList] = useState<GetLogisticsSelectListShipperAddressResponse>()
const [logisticsTemplateList, setLogisticsTemplateList] = useState<GetLogisticsSelectListFreightTemplateResponse>()
const [isTemplate, setIsTemplate] = useState<boolean>(false)
const [deliveryType, setDeliveryType] = useState<number>(1)
const [carriageType, setCarriageType] = useState<number>()
const [banCarriageType, setBanCarriageType] = useState(false)
const [template, setTemplate] = useState(false) // 是否必填运费模板
const { priceType } = ChannelProudctStore
useEffect(()=>{
//传入ref给父级
onRef(logisticsForm)
logisticsForm.setFieldsValue({deliveryType:1, carriageType:1})
// 获取发货地址 物流公司 运费模板
PublicApi.getLogisticsSelectListShipperAddress().then(res=>{
setLogisticsAddressList(res.data)
})
PublicApi.getLogisticsSelectListCompany({cooperateType: '2'}).then(res=>{
setLogisticsCompanyLists(res.data)
})
PublicApi.getLogisticsSelectListFreightTemplate().then(res=>{
setLogisticsTemplateList(res.data)
})
}, [])
useEffect(() => {
if(priceType === 3){
logisticsForm.setFieldsValue({carriageType: 1})
setCarriageType(1)
setBanCarriageType(true)
}else{
setBanCarriageType(false)
}
}, [priceType])
const changeDeliveryType = (e) => {
setDeliveryType(e.target.value)
setCarriageType(1)
setIsTemplate(false)
logisticsForm.resetFields()
logisticsForm.setFieldsValue({deliveryType: e.target.value})
logisticsForm.setFieldsValue({carriageType: 1})
}
const onChangeTemplate = (e) => {
setIsTemplate(e.target.checked)
logisticsForm.setFieldsValue({weight: null})
}
const changeCarriageType = (e) => {
setCarriageType(e.target.value)
if(e.target.value === 2) {
setTemplate(true)
setIsTemplate(true)
logisticsForm.setFieldsValue({useTemplate: true})
} else {
setTemplate(false)
setIsTemplate(false)
logisticsForm.setFieldsValue({useTemplate: false})
}
}
return (<>
<Form
{...layout}
form={logisticsForm}
name="logistic-form"
labelAlign="left"
colon={false}
autoComplete="off"
>
<Form.Item
name="deliveryType"
label="配送方式"
rules={[
{
required: true,
message: '请选择配送方式'
},
]}
>
<Radio.Group onChange={changeDeliveryType}>
<Radio value={1}>物流(默认)</Radio>
<Radio value={2}>自提</Radio>
<Radio value={3}>无需配送</Radio>
</Radio.Group>
</Form.Item>
{
deliveryType === 1 && <><Form.Item
name="carriageType"
label="运费方式"
rules={[
{
required: true,
message: '请选择运费方式'
},
]}
>
<Radio.Group onChange={changeCarriageType} disabled={banCarriageType}>
<Radio value={1}>卖家承担运费(默认)</Radio>
<Radio value={2}>买家承担运费</Radio>
</Radio.Group>
</Form.Item>
<Form.Item
label={<>重量<i style={{color:'red'}}>&nbsp;*</i></>}
style={{position: 'relative'}}
>
<Form.Item
name="weight"
rules={[
{
required: true,
message: '请正确输入重量',
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '重量数值小数点后仅限三位',
}
]}
noStyle
>
<InputNumber min={0} style={{width:'100%'}} placeholder="请输入重量" />
</Form.Item>
<span style={{position:'absolute', right:5, top:5, opacity: 0.6}}>KG</span>
</Form.Item></>
}
{
carriageType === 2 && <Form.Item
name="useTemplate"
valuePropName="checked"
label=" "
>
<Checkbox disabled={template} onChange={onChangeTemplate}>使用运费模板(只有买家承担运费才能选择)</Checkbox>
</Form.Item>
}
{
isTemplate && <Form.Item
name="templateId"
label="运费模板"
rules={[
{
required: template,
message: '请正确输入重量',
}
]}
>
<Select
placeholder="请选择运费模板"
allowClear
>
{
logisticsTemplateList?.length>0 && logisticsTemplateList.map(_ => <Option key={_.id} value={_.id}>{_.name}</Option>)
}
</Select>
</Form.Item>
}
{
deliveryType !== 3 && <Form.Item
name="sendAddress"
label="发货地址"
>
<Select
placeholder="请选择发货地址"
allowClear
>
{
logisticsAddressList?.length > 0 && logisticsAddressList.map(_=><Option key={_.id} value={_.id}>{_.fullAddress}</Option>)
}
</Select>
</Form.Item>
}
{
deliveryType === 1 && <Form.Item
name="company"
label="物流公司"
>
<Select
placeholder="请选择物流公司"
allowClear
>
{
logisticsCompanyLists?.length > 0 && logisticsCompanyLists.map(_=><Option key={_.id} value={_.id}>{_.name}</Option>)
}
</Select>
</Form.Item>
}
</Form>
</>)
}
export default SetLogistics
......@@ -527,7 +527,7 @@ const SetPrice:React.FC<IProps> = (props) => {
type: 'checkbox',
...rowSelectionSetSpec,
}}
pagination={{ simple: true }}
pagination={{ simple: true, position: ['topRight'] }}
/>
</Modal>
</>)
......
......@@ -13,6 +13,7 @@ import styles from './index.less'
import SelectProduct from './addChannelItem/selectProduct'
import SelectChannel from './addChannelItem/selectChannel'
import SetPrice from './addChannelItem/setPrice'
import SetLogistics from './addChannelItem/setLogistics'
import { store } from '@/store'
import { inject, observer } from 'mobx-react'
......@@ -41,6 +42,7 @@ const AddDirectChannel:React.FC<{}> = (props) => {
const onSave = () => {
setIsDisabledSave(true)
try {
let data = formRefs.map(async __ => {
return (
await __.validateFields()
......@@ -48,8 +50,12 @@ const AddDirectChannel:React.FC<{}> = (props) => {
})
Promise.all(data).then((values) => {
let params: any = {}
values.map(item => {
console.log(values, 'vvv')
values.map((item, index) => {
if(index !== 2)
params = { ...params, ...item }
else
params.logistics = { ...item }
})
params.unitPriceAndPicList = tableDataInSetPrice
params.commodityId = productSelectRowInStore.id
......@@ -74,7 +80,17 @@ const AddDirectChannel:React.FC<{}> = (props) => {
message.error('暂无渠道角色数据!')
setIsDisabledSave(false)
}
}).catch(_e => {
setIsDisabledSave(false)
message.error(_e.errorFields[0].errors[0] || '请完善渠道商品必填信息!')
console.log(_e, _e.message, '_e')
})
} catch (e) {
setIsDisabledSave(false)
message.error(e.message || '请完善相关信息!')
console.log(e, 'error')
}
}
return (<PageHeaderWrapper
......@@ -99,6 +115,11 @@ const AddDirectChannel:React.FC<{}> = (props) => {
onRef={(refs)=>setFormRefs([...formRefs, refs])}
/>
</TabPane>
<TabPane tab="物流信息" key="4">
<SetLogistics
onRef={(refs)=>setFormRefs([...formRefs, refs])}
/>
</TabPane>
<TabPane tab="适用渠道" key="3">
<SelectChannel
onRef={(refs)=>setFormRefs([...formRefs, refs])}
......
import React, {useState, useRef, useEffect} from 'react'
import { history } from 'umi';
import { Button, Form, Card, Tabs, Modal, Checkbox, Table, InputNumber, Row, Col, Input } from 'antd'
import { Button, Form, Card, Tabs, Modal, Checkbox, Table, InputNumber, Row, Col, Input, Radio, Select } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {
PlusOutlined,
......@@ -12,6 +12,7 @@ import ReutrnEle from '@/components/ReturnEle';
import styles from './index.less'
import { PublicApi } from '@/services/api';
import { GetLogisticsSelectListCompanyResponse, GetLogisticsSelectListFreightTemplateResponse, GetLogisticsSelectListShipperAddressResponse } from '@/services/LogisticsApi';
const layout = {
labelCol: {
......@@ -28,11 +29,13 @@ const layoutSetPrice = {
}
const { TabPane } = Tabs
const {Item}:any = Form
const { Item }: any = Form
const { Option } = Select
const ModifyDirectChannel:React.FC<{}> = () => {
const [formPrice] = Form.useForm()
const [setPriceForm] = Form.useForm()
const [logisticsForm] = Form.useForm()
const [queryId, setQueryId] = useState<any>()
const [isDisabledSave, setIsDisabledSave] = useState<boolean>(false)
const [modifyModal, setModifyModal] = useState(false)
......@@ -57,6 +60,15 @@ const ModifyDirectChannel:React.FC<{}> = () => {
const [originHasIds, setOriginHasIds] = useState<number[]>([])
const [loading, setLoading] = useState<boolean>(false)
const [logisticsCompanyLists, setLogisticsCompanyLists] = useState<GetLogisticsSelectListCompanyResponse>()
const [logisticsAddressList, setLogisticsAddressList] = useState<GetLogisticsSelectListShipperAddressResponse>()
const [logisticsTemplateList, setLogisticsTemplateList] = useState<GetLogisticsSelectListFreightTemplateResponse>()
const [isTemplate, setIsTemplate] = useState<boolean>(false)
const [deliveryType, setDeliveryType] = useState<number>(1)
const [carriageType, setCarriageType] = useState<number>()
const [banCarriageType, setBanCarriageType] = useState(false)
const [template, setTemplate] = useState(false) // 是否必填运费模板
useEffect(() => {
const { id } = history.location.query
......@@ -68,11 +80,30 @@ const ModifyDirectChannel:React.FC<{}> = () => {
setChannelDetails(data)
priceTypeRef.current = data.channelCommodity.commodity.priceType
formPrice.setFieldsValue({isMemberPrice: data?.isMemberPrice})
const { deliveryType, carriageType, useTemplate } = data.logistics
setDeliveryType(deliveryType)
setCarriageType(carriageType)
setIsTemplate(useTemplate)
setTemplate(useTemplate)
logisticsForm.setFieldsValue(data.logistics)
structureTable(data.unitPriceAndPicList, data.channelCommodity.commodity, true) // 初始已有规格
let hasIds = data.unitPriceAndPicList.map(item => item.id)
setOriginHasIds(hasIds)
}
})
// 获取发货地址 物流公司 运费模板
PublicApi.getLogisticsSelectListShipperAddress().then(res=>{
setLogisticsAddressList(res.data)
})
PublicApi.getLogisticsSelectListCompany({cooperateType: '2'}).then(res=>{
setLogisticsCompanyLists(res.data)
})
PublicApi.getLogisticsSelectListFreightTemplate().then(res=>{
setLogisticsTemplateList(res.data)
})
}, [])
useEffect(() => {
......@@ -310,7 +341,7 @@ const ModifyDirectChannel:React.FC<{}> = () => {
})
setSubmitParams(_data)
console.log(priceTableData, _priceTableData, _data, 'params')
// console.log(priceTableData, _priceTableData, _data, 'params')
}
const clickDelete = (record: any) => {
......@@ -376,6 +407,33 @@ const ModifyDirectChannel:React.FC<{}> = () => {
})
}
const changeDeliveryType = (e) => {
setDeliveryType(e.target.value)
setCarriageType(1)
setIsTemplate(false)
logisticsForm.resetFields()
logisticsForm.setFieldsValue({deliveryType: e.target.value})
logisticsForm.setFieldsValue({carriageType: 1})
}
const onChangeTemplate = (e) => {
setIsTemplate(e.target.checked)
logisticsForm.setFieldsValue({weight: null})
}
const changeCarriageType = (e) => {
setCarriageType(e.target.value)
if(e.target.value === 2) {
setTemplate(true)
setIsTemplate(true)
logisticsForm.setFieldsValue({useTemplate: true})
} else {
setTemplate(false)
setIsTemplate(false)
logisticsForm.setFieldsValue({useTemplate: false})
}
}
return (<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
......@@ -388,7 +446,7 @@ const ModifyDirectChannel:React.FC<{}> = () => {
>
<Card>
<Tabs type="card">
<TabPane tab="渠道信息" key="1">
<TabPane tab="基本信息" key="1">
<Form
{...layout}
labelAlign="left"
......@@ -411,7 +469,7 @@ const ModifyDirectChannel:React.FC<{}> = () => {
</Form.Item>
</Form>
</TabPane>
<TabPane tab="修改商品价格" key="2">
<TabPane tab="商品规格" key="2">
<Form
{...layout}
form={formPrice}
......@@ -442,6 +500,132 @@ const ModifyDirectChannel:React.FC<{}> = () => {
}
<Table rowKey="id" dataSource={priceTableData} columns={priceColumn} style={{clear: 'both'}} />
</TabPane>
<TabPane tab="物流信息" key="3">
<Form
{...layout}
form={logisticsForm}
name="logistic-form"
labelAlign="left"
colon={false}
autoComplete="off"
>
<Form.Item
name="deliveryType"
label="配送方式"
rules={[
{
required: true,
message: '请选择配送方式'
},
]}
>
<Radio.Group onChange={changeDeliveryType}>
<Radio value={1}>物流(默认)</Radio>
<Radio value={2}>自提</Radio>
<Radio value={3}>无需配送</Radio>
</Radio.Group>
</Form.Item>
{
deliveryType === 1 && <><Form.Item
name="carriageType"
label="运费方式"
rules={[
{
required: true,
message: '请选择运费方式'
},
]}
>
<Radio.Group onChange={changeCarriageType} disabled={banCarriageType}>
<Radio value={1}>卖家承担运费(默认)</Radio>
<Radio value={2}>买家承担运费</Radio>
</Radio.Group>
</Form.Item>
<Form.Item
label={<>重量<i style={{color:'red'}}>&nbsp;*</i></>}
style={{position: 'relative'}}
>
<Form.Item
name="weight"
rules={[
{
required: true,
message: '请正确输入重量',
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '重量数值小数点后仅限三位',
}
]}
noStyle
>
<InputNumber min={0} style={{width:'100%'}} placeholder="请输入重量" />
</Form.Item>
<span style={{position:'absolute', right:5, top:5, opacity: 0.6}}>KG</span>
</Form.Item></>
}
{
carriageType === 2 && <Form.Item
name="useTemplate"
valuePropName="checked"
label=" "
>
<Checkbox disabled={template} onChange={onChangeTemplate}>使用运费模板(只有买家承担运费才能选择)</Checkbox>
</Form.Item>
}
{
isTemplate && <Form.Item
name="templateId"
label="运费模板"
rules={[
{
required: template,
message: '请正确输入重量',
}
]}
>
<Select
placeholder="请选择运费模板"
allowClear
>
{
logisticsTemplateList?.length>0 && logisticsTemplateList.map(_ => <Option key={_.id} value={_.id}>{_.name}</Option>)
}
</Select>
</Form.Item>
}
{
deliveryType !== 3 && <Form.Item
name="sendAddress"
label="发货地址"
>
<Select
placeholder="请选择发货地址"
allowClear
>
{
logisticsAddressList?.length > 0 && logisticsAddressList.map(_=><Option key={_.id} value={_.id}>{_.fullAddress}</Option>)
}
</Select>
</Form.Item>
}
{
deliveryType === 1 && <Form.Item
name="company"
label="物流公司"
>
<Select
placeholder="请选择物流公司"
allowClear
>
{
logisticsCompanyLists?.length > 0 && logisticsCompanyLists.map(_=><Option key={_.id} value={_.id}>{_.name}</Option>)
}
</Select>
</Form.Item>
}
</Form>
</TabPane>
</Tabs>
</Card>
......
......@@ -12,6 +12,9 @@ const ViewDriectChannel: React.FC<{}> = () => {
const [priceTableData, setPriceTableData] = useState<any[]>([])
const [priceTableDataColumn, setPrcieTableColumn] = useState<any[]>([])
const [shopList, setShopList] = useState<any[]>([])
const [logisticTemplateName, setLogisticTemplateName] = useState<string>()
const [logisticResourceCompanyName, setLogisticResourceCompanyName] = useState<string>()
const [logisticResourceSendAddress, setLogisticResourceSendAddress] = useState<string>()
useEffect(() => {
const { id } = history.location.query
......@@ -23,9 +26,24 @@ const ViewDriectChannel: React.FC<{}> = () => {
PublicApi.getProductChannelCommodityGetShop({ id: id }).then(res => {
setShopList(res.data)
})
}, [])
useEffect(() => {
if(channelDetails?.logistics?.templateId)
PublicApi.getLogisticsFreightTemplateGet({id: channelDetails?.logistics?.templateId + ''}).then(res => {
setLogisticTemplateName(res.data.name)
})
if(channelDetails?.logistics?.company)
PublicApi.getLogisticsCompanyGet({id: channelDetails?.logistics?.company + ''}).then(res => {
setLogisticResourceCompanyName(res.data.name)
})
if(channelDetails?.logistics?.sendAddress)
PublicApi.getLogisticsShipperAddressGet({id: channelDetails?.logistics?.sendAddress + ''}).then(res => {
const { provinceName, cityName, districtName, address } = res.data
setLogisticResourceSendAddress(provinceName + cityName + districtName + address)
})
}, [channelDetails])
const constructTable = (param: any) => {
const { unitPriceAndPicList, channelCommodity } = param
const { commodity } = channelCommodity
......@@ -138,6 +156,18 @@ const ViewDriectChannel: React.FC<{}> = () => {
</Descriptions>
</>
const renderDeliveryType = (type: number) => {
if(type === 1) return '物流(默认)'
else if(type === 2) return '自提'
else if(type === 3) return '无需配送'
else return null
}
const renderCarriageType = (type: number) => {
if(type === 1) return '卖家承担运费(默认)'
if(type === 2) return '买家承担运费'
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
......@@ -194,6 +224,80 @@ const ViewDriectChannel: React.FC<{}> = () => {
</Row>
</Card>
</Space>
<Space direction="vertical" style={{ width: '100%' }}>
<Card headStyle={{ borderBottom: 'none' }} title="物流信息">
<Row>
<Col span={24}>
{
renderDeliveryType(channelDetails?.logistics?.deliveryType) &&
<Row>
<Col span={4}>
<p>配送方式:</p>
</Col>
<Col span={20}>
<p>{renderDeliveryType(channelDetails?.logistics?.deliveryType)}</p>
</Col>
</Row>
}
{
renderCarriageType(channelDetails?.logistics?.carriageType) &&
<Row>
<Col span={4}>
<p>运送方式:</p>
</Col>
<Col span={20}>
<p>{renderCarriageType(channelDetails?.logistics?.carriageType)}</p>
</Col>
</Row>
}
{
channelDetails?.logistics?.weight &&
<Row>
<Col span={4}>
<p>重量:</p>
</Col>
<Col span={20}>
<p>{channelDetails.logistics.weight}KG(公斤)</p>
</Col>
</Row>
}
{
logisticTemplateName &&
<Row>
<Col span={4}>
<p>运费模版:</p>
</Col>
<Col span={20}>
<p>{logisticTemplateName}</p>
</Col>
</Row>
}
{
logisticResourceCompanyName &&
<Row>
<Col span={4}>
<p>物流公司:</p>
</Col>
<Col span={20}>
<p>{logisticResourceCompanyName}</p>
</Col>
</Row>
}
{
logisticResourceSendAddress &&
<Row>
<Col span={4}>
<p>发货地址:</p>
</Col>
<Col span={20}>
<p>{logisticResourceSendAddress}</p>
</Col>
</Row>
}
</Col>
</Row>
</Card>
</Space>
</PageHeaderWrapper>
)
}
......
......@@ -66,7 +66,8 @@ export const searchSchema: ISchema = {
style: {
width: 174
}
}
},
visible: false,
},
memberStatus: {
type: 'string',
......
......@@ -36,23 +36,63 @@ export enum SALE_ORDER_STATUS {
export const tableListSchema: ISchema = {
type: 'object',
properties: {
// orderNo: {
// type: 'string',
// "x-component": 'SearchFilter',
// 'x-component-props': {
// placeholder: '请输入订单编号',
// align: 'flex-end',
// },
// },
// [FORM_FILTER_PATH]: {
// type: 'object',
// 'x-component': 'flex-layout',
// 'x-component-props': {
// inline: true,
// colStyle: {
// marginLeft: 20
// }
// },
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-end',
},
}
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20
}
marginLeft: 20,
},
},
properties: {
orderThe: {
type: 'string',
......@@ -79,7 +119,7 @@ export const tableListSchema: ISchema = {
children: '查询',
},
},
},
},}}
},
}
}
......@@ -192,16 +192,16 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
// useAsyncSelect('contractTemplateId', async () => (await PublicApi.getOrderSelectListContractTemplate()).data, ['name', 'id']).then(()=>{
// actions.setFieldValue("contractTemplateId", data.contractTemplateId)
// })
const { data } = await PublicApi.getOrderSelectListContractTemplate()
let options = data.map(item => ({
const res = await PublicApi.getOrderSelectListContractTemplate()
let options = res.data.map(item => ({
label: item.name,
value: item.id,
}))
actions.setFieldState('contractTemplateId', state => {
state.props.enum = options
})
if(options?.length && options.filter(_i => _i.value === data.contractTemplateId).length) {
actions.setFieldValue("contractTemplateId", data.contractTemplateId)
if(options?.length && options.filter(_i => _i.value === data['contractTemplateId']).length) {
actions.setFieldValue("contractTemplateId", data['contractTemplateId'])
}
} else {
actions.setFieldState('usingElectronicContracts', state => {
......
......@@ -244,6 +244,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
id: Number(id),
paymentInformationId: PayInfoObj.id,
payTypeId: checked.id,
payType: checked.channel,
}
if(payStep === 2) {
......@@ -255,8 +256,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
params.payOrderUrls = payOrderUrls.join(',')
}
console.log(current, payStep,'666',mobilePayFlag)
const res = await run(params)
if (res.code === 1000) {
if(mobilePayFlag.current !== 4) {
......
......@@ -74,15 +74,17 @@ const orderProductShopTypeMaps = {
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
let receiveInfo = pickInfo?.render && JSON.parse(pickInfo.render).props.pickInfo
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
<EnvironmentOutlined/>
<div>
<h3>自提地址</h3>
<p>{pickInfo.receiverName} / {pickInfo.phone}</p>
<p>{pickInfo.fullAddress}</p>
<h3><EnvironmentOutlined/> 自提地址</h3>
{/* <p>{pickInfo.receiverName} / {pickInfo.phone}</p>
<p>{pickInfo.fullAddress}</p> */}
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
<p>{receiveInfo.provinceName + receiveInfo.cityName + receiveInfo.districtName + receiveInfo.address}</p>
</div>
</Row>
}>
......
......@@ -52,7 +52,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
const { form } = useFormSpy({ selector: [['onFieldValueChange', 'orderProductRequests']], reducer: v => v })
const data = form.getFieldValue('orderProductRequests')
const receiverAddressId = form.getFieldValue('deliveryAddresId')
const sum = data.reduce((prev, next) => prev + (next.money || 0), 0)
const sum = data.reduce((prev, next) => (prev*100 + (next.money || 0)*100)/100, 0)
const [freePrice, setFreePrice] = useState<number>(0)
useEffect(() => {
......@@ -60,6 +60,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
form.notify('sumPrice', sum + freePrice)
}
}, [sum, freePrice])
useEffect(() => {
// 存在商品 并且有选择收货地址,则开始计算运费
if (data && data.length > 0 && receiverAddressId) {
......
import React, { useState } from 'react'
import React, { useRef, useState } from 'react'
import { Card, Button, Modal } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -12,19 +12,24 @@ import { FORM_FILTER_PATH } from '@/formSchema/const'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import Submit from '@/components/NiceForm/components/Submit'
import moment from 'moment'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
// 销售订单查询
export interface SaleOrderProps { }
const fetchTableData = async (params) => {
console.log(params, 'ppp')
const { data } = await PublicApi.getOrderPurchaseOrderList(params)
return data
}
const formActions = createFormActions();
// 最后一步开始调试 TODO
const SaleOrder: React.FC<SaleOrderProps> = (props) => {
const ref = useRef<any>({})
const [saleVisible, setSaleVisible] = useState<any>(false)
// 售后唤起弹窗 @todo
......@@ -50,41 +55,38 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
}
])
const controllerBtns = <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
return <PageHeaderWrapper>
<Card>
<StandardTable
fetchTableData={params => fetchTableData(params)}
columns={secondColumns}
rowKey={'orderNo'}
formilyLayouts={{
justify: 'space-between'
}}
formilyChilds={{
layouts: {
order: 2
},
children: <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
currentRef={ref}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
formilyProps={{
layouts: {
order: 3
},
ctx: {
inline: false,
schema: tableListSchema,
effects: ($, actions) => {
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
FORM_FILTER_PATH,
);
},
components: {
)
}}
schema={tableListSchema}
components={{
DateRangePickerUnix,
Submit
}}
/>
}
}
tableProps={{
rowKey: 'orderNo',
}}
/>
</Card>
......
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