Commit bf756820 authored by XieZhiXiong's avatar XieZhiXiong
parents 931b7a51 27eac8db
...@@ -34,6 +34,7 @@ const config: any = { ...@@ -34,6 +34,7 @@ const config: any = {
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'], ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'],
['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god'], ['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god'],
['import', { libraryName: '@umijs/hooks', libraryDirectory: 'lib', camel2DashComponentName: false }, '@umijs/hooks'],// 将下划线转化关闭 ['import', { libraryName: '@umijs/hooks', libraryDirectory: 'lib', camel2DashComponentName: false }, '@umijs/hooks'],// 将下划线转化关闭
isProduction && ['transform-remove-console', { "exclude": [ "error", "warn"] }], // 移除 console
], ],
history: { history: {
type: 'browser', // 'brower' | 'hash' type: 'browser', // 'brower' | 'hash'
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
"@umijs/preset-react": "1.x", "@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.0", "@umijs/test": "^3.2.0",
"antd-img-crop": "^3.12.0", "antd-img-crop": "^3.12.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"bizcharts": "^4.0.14", "bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1", "copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
......
...@@ -927,6 +927,11 @@ export enum SaleOrderInsideWorkState { ...@@ -927,6 +927,11 @@ export enum SaleOrderInsideWorkState {
* 手工发货 * 手工发货
*/ */
HAND_DELEVED_ORDER, HAND_DELEVED_ORDER,
/**
* 不接受物流单
*/
NOT_ACCEPTED_DELIVERY,
} }
// 支付外部状态 // 支付外部状态
...@@ -1039,7 +1044,8 @@ export const SaleOrderInsideWorkStateTexts = { ...@@ -1039,7 +1044,8 @@ export const SaleOrderInsideWorkStateTexts = {
24: '订单归档', 24: '订单归档',
25: '待审核发货单', 25: '待审核发货单',
26: '待确认物流单', 26: '待确认物流单',
27: '待手工发货' 27: '待手工发货',
28: '不接受物流单',
} }
// 订单流转记录外部状态 // 订单流转记录外部状态
......
...@@ -33,7 +33,7 @@ interface AccountDetal { ...@@ -33,7 +33,7 @@ interface AccountDetal {
const ItemRender: React.FC<Config> = (props) => { const ItemRender: React.FC<Config> = (props) => {
const { isEdit, name, canEdit, value, image, changeEdit, pattern, message } = props; const { isEdit, name, canEdit, value, image, changeEdit, pattern, message } = props;
const [validError, setValidError] = useState(false); const [validError, setValidError] = useState(false);
// const [inputValue, setInputValue] = useState(value); // const [inputValue, setInputValue] = useState(value);
const handleClick = (name:string) => { const handleClick = (name:string) => {
changeEdit(name, { isEdit: true }, 'change') changeEdit(name, { isEdit: true }, 'change')
...@@ -55,7 +55,7 @@ const ItemRender: React.FC<Config> = (props) => { ...@@ -55,7 +55,7 @@ const ItemRender: React.FC<Config> = (props) => {
// 确定提交 // 确定提交
const handleConfirm = (name: string) => { const handleConfirm = (name: string) => {
if(validError) { if(validError) {
return return
} }
changeEdit(name, { isEdit: false }, 'confirm'); changeEdit(name, { isEdit: false }, 'confirm');
} }
...@@ -71,7 +71,7 @@ const ItemRender: React.FC<Config> = (props) => { ...@@ -71,7 +71,7 @@ const ItemRender: React.FC<Config> = (props) => {
{isEdit ? <Input value={value} style={{width: '300px'}} onChange={(e) => handleChange(e.target.value, name)}/> : value} {isEdit ? <Input value={value} style={{width: '300px'}} onChange={(e) => handleChange(e.target.value, name)}/> : value}
</div> </div>
{ {
canEdit canEdit
? !isEdit ? !isEdit
? <div className={styles.edit} style={{width: '300px'}} onClick={() => handleClick(name)} > ? <div className={styles.edit} style={{width: '300px'}} onClick={() => handleClick(name)} >
<FormOutlined /> <FormOutlined />
...@@ -91,6 +91,12 @@ const ItemRender: React.FC<Config> = (props) => { ...@@ -91,6 +91,12 @@ const ItemRender: React.FC<Config> = (props) => {
) )
} }
const PARAM_TO_TYPE = {
name: 1,
bankAccount: 2,
bankDeposit: 3,
}
const CorporateAccount = () => { const CorporateAccount = () => {
const [configs, setConfigs] = useState<Config[]>([]); const [configs, setConfigs] = useState<Config[]>([]);
const [unsaved, setUnsaved] = useState<boolean>(false) const [unsaved, setUnsaved] = useState<boolean>(false)
...@@ -115,17 +121,11 @@ const CorporateAccount = () => { ...@@ -115,17 +121,11 @@ const CorporateAccount = () => {
} }
setConfigs(temp); setConfigs(temp);
} else if(type == 'confirm') { } else if(type == 'confirm') {
const postData = { PublicApi.postSettleAccountsCorporateAccountUpdateDetail({itemValue: target.value, itemType: PARAM_TO_TYPE[target.dataIndex]})
...datas,
[target.dataIndex]: target.value
}
console.log(postData);
///settle/accounts/corporate/account/update
PublicApi.postSettleAccountsCorporateAccountUpdate(postData)
.then((data) => { .then((data) => {
if(data.code == 1000) { if(data.code == 1000) {
setUnsaved(false); setUnsaved(false);
setDatas(postData); // setDatas(postData);
temp[index] = { temp[index] = {
...target, ...target,
...res, ...res,
...@@ -135,7 +135,7 @@ const CorporateAccount = () => { ...@@ -135,7 +135,7 @@ const CorporateAccount = () => {
} }
}) })
} }
} }
useEffect(() => { useEffect(() => {
...@@ -193,11 +193,11 @@ const CorporateAccount = () => { ...@@ -193,11 +193,11 @@ const CorporateAccount = () => {
return ( return (
<ItemRender key={item.name} {...item} changeEdit={changeEdit} /> <ItemRender key={item.name} {...item} changeEdit={changeEdit} />
) )
}) })
} }
<Prompt when={unsaved} message="信息还未保存,确定离开吗?"></Prompt> <Prompt when={unsaved} message="信息还未保存,确定离开吗?"></Prompt>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
} }
export default CorporateAccount export default CorporateAccount
\ No newline at end of file
...@@ -22,3 +22,37 @@ export const SelectGoodsColumns: ColumnType<any>[] = [ ...@@ -22,3 +22,37 @@ export const SelectGoodsColumns: ColumnType<any>[] = [
dataIndex: 'brand', dataIndex: 'brand',
} }
] ]
export const ExternalListColumns: ColumnType<any>[] = [
{
title: '流转顺序号',
key: 'number',
dataIndex: 'number',
render:(text:any, record:any, index:number) => {return index + 1;}
},
{
title: '操作角色',
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '状态',
key: 'status',
dataIndex: 'status',
},
{
title: '操作',
key: 'operationalProcess',
dataIndex: 'operationalProcess',
},
{
title: '操作时间',
key: 'brand',
dataIndex: 'brand',
},
{
title: '审核意见',
key: 'brand',
dataIndex: 'brand',
}
]
...@@ -8,7 +8,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'; ...@@ -8,7 +8,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { LinkOutlined, PlusOutlined } from '@ant-design/icons'; import { LinkOutlined, PlusOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import ModalTable from '@/components/ModalTable'; import ModalTable from '@/components/ModalTable';
import { SelectGoodsColumns } from './components/columns'; import { SelectGoodsColumns, ExternalListColumns } from './components/columns';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import moment from 'moment'; import moment from 'moment';
import ModalTableOrder from './components/ModalTableOrder'; import ModalTableOrder from './components/ModalTableOrder';
...@@ -201,12 +201,14 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -201,12 +201,14 @@ const AddLogistics: React.FC<{}> = () => {
receiverName: res.data.receiveUserName, receiverName: res.data.receiveUserName,
receiverPhone: res.data.receiveUserTel, receiverPhone: res.data.receiveUserTel,
receiverFullAddress: res.data.receiveAddress, receiverFullAddress: res.data.receiveAddress,
shipperAddressId: res.data.deliveryAddressId,
shipperFullAddress: res.data.deliveryAddress,
shipmentOrderCode: res.data.deliveryNo, shipmentOrderCode: res.data.deliveryNo,
relevanceOrderCode: res.data.orderNo, relevanceOrderCode: res.data.noticeNo,
voucherTime: res.data.transactionTime,
externalState: res.data.state,
shipmentOrderId: res.data.deliveryId, shipmentOrderId: res.data.deliveryId,
relevanceOrderId: res.data.id, relevanceOrderId: res.data.id,
voucherTime: res.data.createTime,
externalState: res.data.outerStatus,
} }
form.setFieldsValue(obj); form.setFieldsValue(obj);
setQuery({ ...obj }) setQuery({ ...obj })
...@@ -224,7 +226,7 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -224,7 +226,7 @@ const AddLogistics: React.FC<{}> = () => {
voucherTime: res.data.applyTime, voucherTime: res.data.applyTime,
relevanceOrderId: res.data.applyId, relevanceOrderId: res.data.applyId,
externalState: res.data.state, externalState: res.data.state,
digest: res.data.applyAbstract digest: res.data.applyAbstract,
} }
form.setFieldsValue(obj); form.setFieldsValue(obj);
setQuery({ ...obj }) setQuery({ ...obj })
...@@ -294,7 +296,9 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -294,7 +296,9 @@ const AddLogistics: React.FC<{}> = () => {
externalState: res.data.status, externalState: res.data.status,
shipperAddressId: res.data.shipperAddressId, shipperAddressId: res.data.shipperAddressId,
shipperFullAddress: res.data.shipperFullAddress, shipperFullAddress: res.data.shipperFullAddress,
externalList: res.data.externalList
} }
form.setFieldsValue(obj)
setQuery(obj) setQuery(obj)
setId(query.id) setId(query.id)
setCreateType(res.data.createType) setCreateType(res.data.createType)
...@@ -328,11 +332,12 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -328,11 +332,12 @@ const AddLogistics: React.FC<{}> = () => {
case 1: case 1:
case 2: case 2:
case 3: case 3:
PublicApi.getWarehouseInvoicesProductList({ ...params, invoicesId: id }).then((res:any) => { PublicApi.getWarehouseInvoicesProductList({ ...params, invoicesId: id }).then((res: any) => {
if (res.code === 1000) { if (res.code === 1000) {
res.data.data.forEach(item => { res.data.data.forEach(item => {
item.category = item.categoryName item.category = item.categoryName
item.brand = item.brandName item.brand = item.brandName
item.unit = item.unitName
}) })
resolve(res.data) resolve(res.data)
} }
...@@ -375,7 +380,7 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -375,7 +380,7 @@ const AddLogistics: React.FC<{}> = () => {
productName: item.productName, productName: item.productName,
categoryName: item.category, categoryName: item.category,
brandName: item.brand, brandName: item.brand,
unitName: item.unitName, unitName: item.unit,
amount: item.amount, amount: item.amount,
carton: item.carton, carton: item.carton,
weight: item.weight, weight: item.weight,
...@@ -532,7 +537,10 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -532,7 +537,10 @@ const AddLogistics: React.FC<{}> = () => {
/**打开选择商品 */ /**打开选择商品 */
const handleVisible = () => { const handleVisible = () => {
console.log(query) console.log(query)
if(query.shipmentOrderId || query.relevanceOrderId) { if (query.shipmentOrderCode || query.relevanceOrderCode) {
const list = [...detailList];
goodsRowCtl.setSelectRow(list)
goodsRowCtl.setSelectedRowKeys(list.map(v => v.productId));
setvisible(true) setvisible(true)
} else { } else {
message.error('请先选择要操作的对应发货单号或对应订单号/售后单') message.error('请先选择要操作的对应发货单号或对应订单号/售后单')
...@@ -541,9 +549,11 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -541,9 +549,11 @@ const AddLogistics: React.FC<{}> = () => {
/** 提交数据 */ /** 提交数据 */
const handleSubmit = async () => { const handleSubmit = async () => {
const basicRef = await form.validateFields().then(res => { return true }).catch(error => { return error });
const goodsRef = await goodsForm.validateFields().then(res => { return true }).catch(error => { return error });
const data = [...badge] const data = [...badge]
const params = { ...query };
const basicRef = await form.validateFields().then(res => { console.log(res); params.digest = res.digest; return true }).catch(error => { return error });
const goodsRef = await goodsForm.validateFields().then(res => { return true }).catch(error => { return error });
params.createType = createType;
if (basicRef.errorFields) { if (basicRef.errorFields) {
data[0] = basicRef.errorFields.length; data[0] = basicRef.errorFields.length;
setbadge(data); setbadge(data);
...@@ -559,10 +569,9 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -559,10 +569,9 @@ const AddLogistics: React.FC<{}> = () => {
setbadge(data) setbadge(data)
const { pathname } = history.location; const { pathname } = history.location;
const path = pathname.split('/')[pathname.split('/').length - 1]; const path = pathname.split('/')[pathname.split('/').length - 1];
const params = {...query};
params.detailList = detailList params.detailList = detailList
if(path === 'edit') { if (path === 'edit') {
PublicApi.postLogisticsOrderWaitSubmitUpdate({...params }).then(res => { PublicApi.postLogisticsOrderWaitSubmitUpdate({ ...params }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
history.goBack() history.goBack()
} }
...@@ -588,7 +597,7 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -588,7 +597,7 @@ const AddLogistics: React.FC<{}> = () => {
if (Object.keys(memberInfo).length > 0) { if (Object.keys(memberInfo).length > 0) {
PublicApi.getSettleAccountsPlatformConfigGetSettlementWay({ ...memberInfo }).then(res => { PublicApi.getSettleAccountsPlatformConfigGetSettlementWay({ ...memberInfo }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
const data = {...query} const data = { ...query }
data.settlementWay = res.data; data.settlementWay = res.data;
setQuery(data) setQuery(data)
} }
...@@ -597,6 +606,44 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -597,6 +606,44 @@ const AddLogistics: React.FC<{}> = () => {
}) })
} }
}, [memberInfo]) }, [memberInfo])
/**跳转到售后/订单的详情 */
const jumpOrderDetail = (id: any) => {
switch (Number(createType)) {
case 1:
switch (Number(relevanceType)) {
case 1:
window.open(`/memberCenter/tranactionAbility/saleOrder/readyAddLogisticsOrder/preview?id=${id}`)
break;
case 2:
window.open(`/memberCenter/afterService/exchangeApplication/exchangePrAddLogistics/detail?id=${id}`)
break;
case 3:
window.open(`/memberCenter/afterService/exchangeManage/exchangePrAddLogistics/detail?id=${id}`)
break;
case 4:
window.open(`/memberCenter/afterService/returnApplication/returnPrAddLogistics/detail?id=${id}`)
break;
}
break;
case 2:
window.open(`/memberCenter/tranactionAbility/saleOrder/readyAddLogisticsOrder/preview?id=${id}`)
break;
case 3:
window.open(`/memberCenter/handling/confirm/pendingDelivered/detail?id=${id}`)
break;
case 4:
window.open(`/memberCenter/afterService/exchangeApplication/exchangePrAddLogistics/detail?id=${id}`)
break;
case 5:
window.open(`/memberCenter/afterService/exchangeManage/exchangePrAddLogistics/detail?id=${id}`)
break;
case 6:
window.open(`/memberCenter/afterService/returnApplication/returnPrAddLogistics/detail?id=${id}`)
break;
}
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
...@@ -627,11 +674,13 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -627,11 +674,13 @@ const AddLogistics: React.FC<{}> = () => {
<Form.Item label="物流单号" name='receiverName1'><span></span></Form.Item> <Form.Item label="物流单号" name='receiverName1'><span></span></Form.Item>
<Form.Item label='对应发货单号' name='shipmentOrderCode'> <Form.Item label='对应发货单号' name='shipmentOrderCode'>
<Search disabled={!!history.location.query.createType} readOnly value={Object.keys(query).length > 0 ? query.shipmentOrderCode : undefined} enterButton={<><LinkOutlined /> 选择</>} onSearch={() => setshippingvisible(true)} /> <Search disabled={!!history.location.query.createType} readOnly value={Object.keys(query).length > 0 ? query.shipmentOrderCode : undefined} enterButton={<><LinkOutlined /> 选择</>} onSearch={() => setshippingvisible(true)} />
{query.shipmentOrderCode && <Button type='link'>查看单号详情</Button>} {query.shipmentOrderCode && <Button type='link'
onClick={() => window.open(`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${query.shipmentOrderId}&preview=1`)}
>查看单号详情</Button>}
</Form.Item> </Form.Item>
<Form.Item label='对应订单号/售后单' name='relevanceOrderCode'> <Form.Item label='对应订单号/售后单' name='relevanceOrderCode'>
<Search disabled={!!history.location.query.createType} readOnly value={Object.keys(query).length > 0 ? query.relevanceOrderCode : undefined} enterButton={<><LinkOutlined /> 选择</>} onSearch={() => setinvoicesvisible(true)} /> <Search disabled={!!history.location.query.createType} readOnly value={Object.keys(query).length > 0 ? query.relevanceOrderCode : undefined} enterButton={<><LinkOutlined /> 选择</>} onSearch={() => setinvoicesvisible(true)} />
{query.relevanceOrderCode && <Button type='link'>查看单号详情</Button>} {query.relevanceOrderCode && <Button type='link' onClick={() => jumpOrderDetail(query.relevanceOrderId)}>查看单号详情</Button>}
</Form.Item> </Form.Item>
<Form.Item label="收货方" name='receiverName'><span>{query.receiverName}/{query.receiverPhone}</span></Form.Item> <Form.Item label="收货方" name='receiverName'><span>{query.receiverName}/{query.receiverPhone}</span></Form.Item>
<Form.Item label="收货地址" name='receiverFullAddress'> <Form.Item label="收货地址" name='receiverFullAddress'>
...@@ -674,7 +723,12 @@ const AddLogistics: React.FC<{}> = () => { ...@@ -674,7 +723,12 @@ const AddLogistics: React.FC<{}> = () => {
</Form> </Form>
</TabPane> </TabPane>
{/** 流转记录 */} {/** 流转记录 */}
<TabPane key='tab-4' tab='流转记录' forceRender></TabPane> <TabPane key='tab-4' tab='流转记录' forceRender>
<Table
columns={ExternalListColumns}
dataSource={query.externalList}
/>
</TabPane>
</Tabs> </Tabs>
</Card> </Card>
{/* 选择对应发货单 - createType === 1的时候才显示 */} {/* 选择对应发货单 - createType === 1的时候才显示 */}
......
/* /*
* @Author: LeeJiancong * @Author: LeeJiancong
* @Date: 2020-07-30 17:23:48 * @Date: 2020-07-30 17:23:48
* @LastEditors: LeeJiancong * @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 17:24:49 * @LastEditTime: 2020-07-30 17:24:49
*/ */
export default { export default {
default: { default: {
padding: '2px 5px', padding: '2px 5px',
background: 'rgba(244,245,247,1)', background: 'rgba(244,245,247,1)',
borderRadius: '4px' borderRadius: '4px'
}, },
confirm: { confirm: {
color: '#3F7ED2', color: '#3F7ED2',
padding: '2px 5px', padding: '2px 5px',
background: 'rgba(240, 248, 255, 1)', background: 'rgba(240, 248, 255, 1)',
borderRadius: '4px' borderRadius: '4px'
}, },
success: { success: {
color: '#00B37A', color: '#00B37A',
padding: '2px 5px', padding: '2px 5px',
background: 'rgba(235,247,242,1)', background: 'rgba(235,247,242,1)',
borderRadius: '4px' borderRadius: '4px'
}, },
warn: { warn: {
color: '#E63F3B', color: '#E63F3B',
padding: '2px 5px', padding: '2px 5px',
background: 'rgba(255,235,230,1)', background: 'rgba(255,235,230,1)',
borderRadius: '4px' borderRadius: '4px'
} },
} error: {
\ No newline at end of file color: '#ff0404',
padding: '2px 5px',
background: 'rgba(247,235,235,1)',
borderRadius: '4px'
}
}
This diff is collapsed.
...@@ -174,7 +174,8 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -174,7 +174,8 @@ const OrderList: React.FC<ListProps> = (props) => {
render: (text: any, reconds: any) => { render: (text: any, reconds: any) => {
let component: ReactNode = null let component: ReactNode = null
if (text == 3) { if (text == 3) {
component = <><span style={statuStyle.success}>不接受物流单</span></> //外部状态1-待提交2-待确认3-不接受物流单4-接受物流单
component = <><span style={statuStyle.error}>不接受物流单</span></>
} else if (text == 4) { } else if (text == 4) {
component = <><span style={statuStyle.warn}>接受物流单</span></> component = <><span style={statuStyle.warn}>接受物流单</span></>
} else if (text == 2) { } else if (text == 2) {
...@@ -194,7 +195,7 @@ const OrderList: React.FC<ListProps> = (props) => { ...@@ -194,7 +195,7 @@ const OrderList: React.FC<ListProps> = (props) => {
<> <>
{ {
(record.status === 1 || record.status === 4) && (record.status === 1 || record.status === 3) &&
<Button type="link" onClick={() => toEdit(record.id)}>编辑</Button> <Button type="link" onClick={() => toEdit(record.id)}>编辑</Button>
} }
......
...@@ -4,19 +4,20 @@ ...@@ -4,19 +4,20 @@
* @LastEditors: HJX * @LastEditors: HJX
* @LastEditTime: 2020-11-19 15:25:54 * @LastEditTime: 2020-11-19 15:25:54
*/ */
import React, { useState, useEffect} from 'react'; import React, { useState, useEffect } from 'react';
import { history } from 'umi';
import { Button, Card, Tabs, Space, Input } from 'antd'; import { Button, Card, Tabs, Space, Input } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import PayWayRadio from './components/payWayRadio'; import PayWayRadio from './components/payWayRadio';
import PayWayTable from './components/payWayTable'; import PayWayTable from './components/payWayTable';
import { set } from 'mobx';
const { TabPane } = Tabs const { TabPane } = Tabs
const PayWaySetTemplate: React.FC<{}> = () => { const PayWaySetTemplate: React.FC<{}> = () => {
const [config, setconfig] = useState<any>([]); const [config, setconfig] = useState<any>([]);
const [payItem, setPayItem] = useState<any>([]); const [payItem, setPayItem] = useState<any>([]);
const [step, setStep] = useState<Array<number>>([]); const [step, setStep] = useState<Array<number>>([]);
const [obj, setObj] = useState<any>({});
const payWayConfigInfo = () => { const payWayConfigInfo = () => {
// 支付配置信息 // 支付配置信息
return new Promise(resolve => { return new Promise(resolve => {
...@@ -107,9 +108,9 @@ const PayWaySetTemplate: React.FC<{}> = () => { ...@@ -107,9 +108,9 @@ const PayWaySetTemplate: React.FC<{}> = () => {
setPayItem(data); setPayItem(data);
} }
const onGet = (value:any, type:number, idx:number) => { const onGet = (value: any, type: number, idx: number) => {
const data = [...payItem]; const data = [...payItem];
if(type === 1) { if (type === 1) {
data[idx].payParametersAddListRequests = [...data[idx].payParametersAddListRequests, value] data[idx].payParametersAddListRequests = [...data[idx].payParametersAddListRequests, value]
} else { } else {
data[idx].payParametersList.push(value) data[idx].payParametersList.push(value)
...@@ -118,10 +119,10 @@ const PayWaySetTemplate: React.FC<{}> = () => { ...@@ -118,10 +119,10 @@ const PayWaySetTemplate: React.FC<{}> = () => {
} }
/**删除 */ /**删除 */
const onDel = (value:any, index:number, idx:number) => { const onDel = (value: any, index: number, idx: number) => {
console.log(value, index, idx, 10086) console.log(value, index, idx, 10086)
const data = [...payItem]; const data = [...payItem];
if(Number(value) === 1) { if (Number(value) === 1) {
data[idx].payParametersAddListRequests.splice(index, 1); data[idx].payParametersAddListRequests.splice(index, 1);
data[idx].payParametersAddListRequests = [...data[idx].payParametersAddListRequests] data[idx].payParametersAddListRequests = [...data[idx].payParametersAddListRequests]
} else { } else {
...@@ -131,14 +132,14 @@ const PayWaySetTemplate: React.FC<{}> = () => { ...@@ -131,14 +132,14 @@ const PayWaySetTemplate: React.FC<{}> = () => {
setPayItem([...data]); setPayItem([...data]);
} }
/**编辑 */ /**编辑 */
const onEdit = (value:any, type:number, index:number, idx: number) => { const onEdit = (value: any, type: number, index: number, idx: number) => {
console.log(value, type, index, idx) console.log(value, type, index, idx)
const data = [...payItem]; const data = [...payItem];
if(type === 1) { if (type === 1) {
data[idx].payParametersAddListRequests[index] = {...value}; data[idx].payParametersAddListRequests[index] = { ...value };
data[idx].payParametersAddListRequests = [...data[idx].payParametersAddListRequests] data[idx].payParametersAddListRequests = [...data[idx].payParametersAddListRequests]
} else { } else {
data[idx].payParametersList[index] = {...value}; data[idx].payParametersList[index] = { ...value };
data[idx].payParametersList = [...data[idx].payParametersList] data[idx].payParametersList = [...data[idx].payParametersList]
} }
console.log(data, 10086) console.log(data, 10086)
...@@ -150,12 +151,22 @@ const PayWaySetTemplate: React.FC<{}> = () => { ...@@ -150,12 +151,22 @@ const PayWaySetTemplate: React.FC<{}> = () => {
PublicApi.postPayMemberQueryPlatformUpdate({ PublicApi.postPayMemberQueryPlatformUpdate({
platformPayWays: payItem platformPayWays: payItem
}).then(res => { }).then(res => {
if(res.code === 1000) { if (res.code === 1000) {
location.reload(); history.push('/memberCenter/payandSettle/paySetting/payParamsSetting')
// location.reload();
} }
}) })
} }
/** */
const handleBlur = (e, name, idx) => {
const data = [...payItem];
const assginObj = {...obj, ...{[name]: e.target.value}}
setObj(assginObj)
const arr: any[] = []
arr.push(assginObj)
data[idx].payParametersAddListRequests = [...arr]
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
extra={<Button type='primary' onClick={onHnadleSubmit}>保存</Button>} extra={<Button type='primary' onClick={onHnadleSubmit}>保存</Button>}
...@@ -189,16 +200,14 @@ const PayWaySetTemplate: React.FC<{}> = () => { ...@@ -189,16 +200,14 @@ const PayWaySetTemplate: React.FC<{}> = () => {
} }
{ {
(payItem[idx].id === 6 && !!payItem[idx].isPitchOn) && (payItem[idx].id === 6 && !!payItem[idx].isPitchOn) &&
payItem[idx].payParametersAddListRequests.map((item: any, index: number) => ( <div style={{ marginTop: 42 }}>
<div style={{ marginTop: 42 }} key={`space_${index}`}> <Space direction="horizontal" size={16}>
<Space direction="horizontal" size={16}> 初始申请额度不超过
初始申请额度不超过 <Input onChange={(e) => handleBlur(e, 'code', idx)} value={payItem[idx].payParametersAddListRequests.length > 0 ? payItem[idx].payParametersAddListRequests[0].code : undefined} addonBefore="¥" />
<Input value={item.code} addonBefore="¥" /> 允许满<Input onChange={(e) => handleBlur(e, 'value', idx)} value={payItem[idx].payParametersAddListRequests.length > 0 ? payItem[idx].payParametersAddListRequests[0].value : undefined} />
允许满<Input value={item.value} /> 天后申请上调<Input onChange={(e) => handleBlur(e, 'describe', idx)} value={payItem[idx].payParametersAddListRequests.length > 0 ? payItem[idx].payParametersAddListRequests[0].describe : undefined} addonAfter="%" />
天后申请上调<Input value={item.describe} addonAfter="%" /> </Space>
</Space> </div>
</div>
))
} }
</> </>
......
...@@ -205,14 +205,15 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => { ...@@ -205,14 +205,15 @@ const CreateOrderElectronModal:React.FC<OrderElectronModalProps> = (props) => {
} }
} else { } else {
actions.setFieldState('usingElectronicContracts', state => { actions.setFieldState('usingElectronicContracts', state => {
state.value = 0 // state.value = 0
state.props["x-component-props"] = { state.props["x-component-props"] = {
disabled: true disabled: true
} }
}) })
actions.setFieldValue('usingElectronicContracts', data.usingElectronicContracts || 0)
} }
$('onFieldValueChange', 'contractTemplateId').subscribe(state => { $('onFieldValueChange', 'contractTemplateId').subscribe(state => {
console.log(state.props) // console.log(state.props)
}) })
// }) // })
}} }}
......
...@@ -153,7 +153,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -153,7 +153,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(qrCodeInfo.qrUrl) { if(qrCodeInfo.qrUrl) {
// @ts-ignore // @ts-ignore
PublicApi.getOrderPayResultsl({id, paymentInformationId: currentPayInfoId}).then(res => { PublicApi.getOrderPayResultsl({id, paymentInformationId: currentPayInfoId}).then(res => {
console.log(res)
if(res.code === 1000) { if(res.code === 1000) {
if(res.data) { if(res.data) {
setOpenTimer(0) setOpenTimer(0)
...@@ -170,14 +169,13 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -170,14 +169,13 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
const handleConfirm = () => { const handleConfirm = () => {
console.log(data,'data')
if (current === 0) { if (current === 0) {
if (checked.id) { if (checked.id) {
if (checked.id === 5) { // 线下支付 if (checked.id === 5) { // 线下支付
setCurrent(1) setCurrent(1)
setPayStep(1) setPayStep(1)
// 获取账户信息 // 获取对公账户信息
PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId}).then(res => { PublicApi.getSettleAccountsCorporateAccountConfig({memberId: data.supplyMembersId, memberRoleId: data.supplyMembersRoleId}).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
setBlankAccountInfo(res.data) setBlankAccountInfo(res.data)
} }
...@@ -261,7 +259,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -261,7 +259,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
handleSubmitPay() handleSubmitPay()
} else if (current === 2) { } else if (current === 2) {
// 开始提交授信支付数据 (需要输入支付密码) // 开始提交授信支付数据 (需要输入支付密码)
console.log('开始提交授信支付数据', payPrice)
if(payPrice <= creditInfo.canUseQuota){ if(payPrice <= creditInfo.canUseQuota){
setPayStep(2) setPayStep(2)
setCurrent(1000) setCurrent(1000)
...@@ -270,7 +267,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -270,7 +267,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
} else if(current === 3) { } else if(current === 3) {
// 开始提交余额支付数据 (需要输入支付密码) // 开始提交余额支付数据 (需要输入支付密码)
console.log('开始提交余额支付数据', payPrice)
if(payPrice <= balanceInfo){ if(payPrice <= balanceInfo){
setPayStep(2) setPayStep(2)
setCurrent(1000) setCurrent(1000)
...@@ -279,7 +275,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -279,7 +275,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
} }
} else if(current === 5) { } else if(current === 5) {
// 开始提交货到付款数据 // 开始提交货到付款数据
console.log('开始提交货到付款数据', payPrice)
handleSubmitPay() handleSubmitPay()
} }
......
...@@ -251,8 +251,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -251,8 +251,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
history.goBack() history.goBack()
}, 1000) }, 1000)
// history.replace('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder') // history.replace('/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder')
} else {
setBtnLoading(false)
} }
setBtnLoading(false)
} catch (error) { } catch (error) {
setBtnLoading(false) setBtnLoading(false)
error?.message && message.error(error.message) error?.message && message.error(error.message)
......
...@@ -87,6 +87,14 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions ...@@ -87,6 +87,14 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
if(options.filter(_item => _item.payType === 4).length) if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false options.filter(_item => _item.payType === 4)[0].disabled = false
} }
// 多次支付也要禁用到付
if(ctx.getFieldValue('paymentInformationResponses').length > 1) {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = true
} else {
if(options.filter(_item => _item.payType === 4).length)
options.filter(_item => _item.payType === 4)[0].disabled = false
}
} }
}, [orderProducts, columns]) }, [orderProducts, columns])
......
...@@ -66,6 +66,11 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -66,6 +66,11 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
rowSelectionCtl.setSelectRow(newData) rowSelectionCtl.setSelectRow(newData)
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id)) rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('orderProductRequests', newData) ctx.setFieldValue('orderProductRequests', newData)
// 商品行数变动 清空之前的支付信息
if (pageStatus === PageStatus.ADD) {
ctx.setFieldValue('paymentInformationResponses', [])
}
} }
const [productColumns, setProductColumns] = useState(() => { const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) { if (pageStatus === PageStatus.ADD) {
......
import React, { useState, useRef, useEffect } from 'react' import React, { useState, useRef, useEffect } from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { ISchemaFormProps, ISchemaFieldProps, ISchemaFieldComponentProps, createFormActions, useFieldState } from '@formily/antd' import { ISchemaFormProps, ISchemaFieldProps, ISchemaFieldComponentProps, createFormActions, useFieldState } from '@formily/antd'
import { Button, Space, Row, Col, Tag } from 'antd' import { Button, Space, Row, Col, Tag } from 'antd'
import { PlusOutlined, DeleteColumnOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons' import { PlusOutlined, DeleteColumnOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons'
import cx from 'classnames' import cx from 'classnames'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)` const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border { .select_style_border {
border: 1px solid #EEF0F3; border: 1px solid #EEF0F3;
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 8px 14px; padding: 8px 14px;
cursor: pointer; cursor: pointer;
line-height: 28px; line-height: 28px;
position:relative; position:relative;
} }
.select_style_border.active { .select_style_border.active {
border: 1px solid #00B382; border: 1px solid #00B382;
} }
.select_style_border.active::after { .select_style_border.active::after {
content: ''; content: '';
position: absolute; position: absolute;
width: 0; width: 0;
height: 0; height: 0;
border-bottom: 12px solid #00B37A; border-bottom: 12px solid #00B37A;
border-left: 12px solid transparent; border-left: 12px solid transparent;
bottom: 0; bottom: 0;
right: 0; right: 0;
z-index: 5; z-index: 5;
} }
` `
enum ProcessTagColor { enum ProcessTagColor {
'red', 'red',
'orange', 'orange',
'purple', 'purple',
'blue' 'blue',
} 'green'
}
enum ProcessTagType {
'订单交易流程', enum ProcessTagType {
'售后换货流程', '订单交易流程',
'售后退货流程', '售后换货流程',
'售后维修流程' '售后退货流程',
} '售后维修流程',
'加工生产流程'
const SelectProcesss = (props: ISchemaFieldComponentProps) => { }
const [formInitValue, setFormInitValue] = useState<any>(null)
const [state, setFieldState] = useFieldState({ const SelectProcesss = (props: ISchemaFieldComponentProps) => {
dataSource: [], const [formInitValue, setFormInitValue] = useState<any>(null)
showMore: false const [state, setFieldState] = useFieldState({
}) dataSource: [],
const { dataSource, showMore } = state showMore: false
const { value, mutators, editable } = props })
const { dataSource, showMore } = state
useEffect(() => { const { value, mutators, editable } = props
PublicApi.getOrderTradingRulesTransactionProcessList().then(res => {
setFieldState({ useEffect(() => {
dataSource: res.data, PublicApi.getOrderTradingRulesTransactionProcessList().then(res => {
showMore setFieldState({
}) dataSource: res.data,
}) showMore
}, []) })
})
const showDataSource = showMore ? dataSource : [...dataSource].splice(0, 3) }, [])
const handleCheck = (id) => { const showDataSource = showMore ? dataSource : [...dataSource].splice(0, 3)
if (editable) {
mutators.change(id) const handleCheck = (id) => {
} if (editable) {
} mutators.change(id)
}
const toogleMore = () => { }
setFieldState({
dataSource, const toogleMore = () => {
showMore: !showMore setFieldState({
}) dataSource,
} showMore: !showMore
})
const renderProcessType = (v: any) => { }
return <Tag color={ProcessTagColor[v.type - 1]}>
{ProcessTagType[v.type - 1]} const renderProcessType = (v: any) => {
</Tag> return <Tag color={ProcessTagColor[v.type - 1]}>
} {ProcessTagType[v.type - 1]}
</Tag>
return ( }
<div style={{ width: '100%' }}>
<SelectStyles> return (
{ <div style={{ width: '100%' }}>
showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v.id)} className={cx('select_style_border', value === v.id ? 'active' : '')}> <SelectStyles>
<div> {
<Row style={{ color: '#303133' }}> showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v.id)} className={cx('select_style_border', value === v.id ? 'active' : '')}>
<Col>{v.name}</Col> <div>
<Col style={{ marginLeft: 6 }}> <Row style={{ color: '#303133' }}>
{ <Col>{v.name}</Col>
renderProcessType(v) <Col style={{ marginLeft: 6 }}>
} {
</Col> renderProcessType(v)
</Row> }
<div style={{ color: '#909399' }}>{v.explain}</div> </Col>
</div> </Row>
</div>) <div style={{ color: '#909399' }}>{v.explain}</div>
} </div>
</SelectStyles> </div>)
{dataSource.length > 3 && }
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer' }}> </SelectStyles>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />} {dataSource.length > 3 &&
</div> <div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer' }}>
} 显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div> </div>
) }
} </div>
)
SelectProcesss.defaultProps = {} }
SelectProcesss.isFieldComponent = true; SelectProcesss.defaultProps = {}
export default SelectProcesss SelectProcesss.isFieldComponent = true;
\ No newline at end of file
export default SelectProcesss
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