Commit 1f8913c7 authored by xiexiuxing's avatar xiexiuxing
parents 4448de08 94591427
......@@ -71,7 +71,7 @@
"@linkseeks/design-core": "^1.0.0",
"@linkseeks/design-react": "^1.0.0",
"@linkseeks/design-react-web": "^1.0.0",
"@linkseeks/design-ui": "^1.0.5",
"@linkseeks/design-ui": "1.0.5",
"@linkseeks/god": "^1.0.0",
"@linkseeks/umi-plugin-yapi": "1.0.1",
"@turf/turf": "^6.4.0",
......
......@@ -210,7 +210,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.classify.monthDay': 'Settlement Date',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.addonAfter': 'monthDay',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.legal': 'Please enter a positive integer',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit': 'Please enter a value greater than 0 but less than or equal to 28',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit': 'Please enter a value greater than 0 but less than or equal to 31',
'member.management.memberPrComingClassify.drawer.form.classify.days.addonAfter': 'days',
'member.management.memberPrComingClassify.drawer.form.classify.days.legal': 'Please enter a positive integer',
'member.management.memberPrComingClassify.drawer.form.verify':'Document review',
......
......@@ -437,7 +437,7 @@ export default {
'saleOrder.zongjine': 'Total amount',
'saleOrder.yizhifu': 'paid',
'saleOrder.dingdanhao': 'Order number',
'saleOrder.dingdanzhaiyao': 'Order summary/order time',
'saleOrder.dingdanzhaiyao': 'Order summary',
'saleOrder.caigouhuiyuan': 'purchasing member',
'saleOrder.zongjine/yi': 'Total amount/paid (yuan)',
'saleOrder.zongjine:': 'Total amount:',
......
......@@ -202,7 +202,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.classify.monthDay': '결산일',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.addonAfter': '일',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.legal': '양의 정수를 입력하십시오',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit': '0보다 크고 28보다 작은 값을 입력하십시오',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit': '0보다 크고 31보다 작은 값을 입력하십시오',
'member.management.memberPrComingClassify.drawer.form.classify.days.addonAfter': '일수',
'member.management.memberPrComingClassify.drawer.form.classify.days.legal': '양의 정수를 입력하십시오',
'member.management.memberPrComingClassify.drawer.form.verify': '영수증 심사',
......
......@@ -435,7 +435,7 @@ export default {
'saleOrder.zongjine': '총금액',
'saleOrder.yizhifu': '지불됨',
'saleOrder.dingdanhao': '주문 번호',
'saleOrder.dingdanzhaiyao': '주문 요약/주문 시간',
'saleOrder.dingdanzhaiyao': '주문 요약',
'saleOrder.caigouhuiyuan': '구매 회원',
'saleOrder.zongjine/yi': '총 금액/지급(위안)',
'saleOrder.zongjine:': '총 금액:',
......
......@@ -206,7 +206,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.classify.monthDay': '结算日',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.addonAfter': '号',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.legal': '请输入正整数',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit': '请输入大于0 小于等于 28的数值',
'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit': '请输入大于0 小于等于 31的数值',
'member.management.memberPrComingClassify.drawer.form.classify.days.addonAfter': '天',
'member.management.memberPrComingClassify.drawer.form.classify.days.legal': '请输入正整数',
'member.management.memberPrComingClassify.drawer.form.verify': '单据审核',
......
......@@ -434,7 +434,7 @@ export default {
'saleOrder.zongjine': '总金额',
'saleOrder.yizhifu': '已支付',
'saleOrder.dingdanhao': '订单号',
'saleOrder.dingdanzhaiyao': '订单摘要/下单时间',
'saleOrder.dingdanzhaiyao': '订单摘要',
'saleOrder.caigouhuiyuan': '采购会员',
'saleOrder.zongjine/yi': '总金额/已支付(元)',
'saleOrder.zongjine:': '总金额:',
......
......@@ -299,8 +299,8 @@ export default {
'transaction_components.qingtianxiedanjia': '请填写单价',
'transaction_components.danjiajinxiansanweixiaoshu': '单价仅限三位小数',
'transaction_components.zaicishurunideyuanyin1': '在此输入你的原因, 最多50个汉字',
'transaction_components.quxiaoyuanyin': '取消原因',
'transaction_components.qingshuruquxiaoyuanyin': '请输入取消原因',
'transaction_components.xiugaiyuanyin': '修改原因',
'transaction_components.qingshuruxiugaiyuanyin': '请输入修改原因',
'transaction_components.qingzhengqueshurushuzijin': '请正确输入数字金额',
'transaction_components.yunfeijinxianliangweixiaoshu': '运费仅限两位小数',
'transaction_components.xinzengdingdan': '新增订单',
......
......@@ -70,8 +70,8 @@ const SearchDetail = () => {
},
{
col: [
{ label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payer, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payee, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payee, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payer, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.faqiduizhangfang' }), extra: data.launchReconciliation, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${priceFormat(data.reconciliationMoneyAmount)}`, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.danjushijian' }), extra: data.createTime, type: 'text' },
......
......@@ -25,6 +25,8 @@ const TABLINK = [
{ id: 'fileLayout', title: intl.formatMessage({ id: 'balance.fujian' }), },
]
const reg = /(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{0,3}$)/
const Add = () => {
const {
query: {
......@@ -77,8 +79,34 @@ const Add = () => {
}
const basicFormCol = [
{ label: intl.formatMessage({ id: 'balance.danjuzhaiyao' }), name: 'reconciliationAbstract', placeholder: '请输入对账单摘要', maxLength: 60, rules: [{ required: true, message: '请输入对账单摘要' }] },
{ label: intl.formatMessage({ id: 'balance.beizhu' }), name: 'remark', placeholder: '请输入对备注', maxLength: 120 },
{
label: intl.formatMessage({ id: 'balance.danjuzhaiyao' }), name: 'reconciliationAbstract', placeholder: '请输入对账单摘要', rules: [{ required: true, message: '请输入对账单摘要' }, {
validator: (_, value) => {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 30 * 2) {
return Promise.reject(new Error(`最长60个字符,30个汉字`))
} else {
return Promise.resolve();
}
}
}]
},
{
label: intl.formatMessage({ id: 'balance.beizhu' }), name: 'remark', placeholder: '请输入对备注', rules: [
{
validator: (_, value) => {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (value.length > 60 * 2) {
return Promise.reject(new Error(`最长120个字符`))
} else {
return Promise.resolve();
}
}
}
]
},
]
const basicFormColRight = [
......@@ -257,7 +285,13 @@ const Add = () => {
{ required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) },
{
validator: (_, value) => {
return value > record.reconciliationQuantity ? Promise.reject(new Error('不能大于待对账数量')) : Promise.resolve()
if (!reg.test(value)) {
return Promise.reject(new Error('数量需要大于0'))
}
if(value > record.reconciliationQuantity){
return Promise.reject(new Error('不能大于待对账数量'))
}
return Promise.resolve()
}
},
]}
......@@ -371,7 +405,7 @@ const Add = () => {
<Form.Item
{...item}
>
{_editAble ? <Input placeholder={item.placeholder} maxLength={item.maxLength} /> : dataSource[item.name]}
{_editAble ? <Input placeholder={item.placeholder} /> : dataSource[item.name]}
</Form.Item>
</Col>
))}
......
......@@ -148,6 +148,10 @@ const ReadyReconciliation: React.FC = () => {
key: 'receiveQuantity',
dataIndex: 'receiveQuantity',
}, {
title: '已对账数量',
key: 'reconciledQuantity',
dataIndex: 'reconciledQuantity',
}, {
title: intl.formatMessage({ id: 'balance.yiduizhangjine' }),
key: 'reconciledMoney',
dataIndex: 'reconciledMoney',
......
......@@ -138,7 +138,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > maxNumber * 2) {
return { type: 'error', message: `${intl.formatMessage({ id: 'detail.purchase.tips19' })}${maxNumber * 2}${intl.formatMessage({ id: 'detail.purchase.tips20' })},${maxNumber}${intl.formatMessage({ id: 'detail.purchase.tips18' })}` };
return { type: 'error', message: `最长${maxNumber * 2}个字符,${maxNumber}个汉字` };
} else {
return null;
}
......
......@@ -79,8 +79,8 @@ const SearchDetail = () => {
},
{
col: [
{ label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payer, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payee, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payee, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payer, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.faqiduizhangfang' }), extra: data.launchReconciliation, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${priceFormat(data.reconciliationMoneyAmount)}`, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.danjushijian' }), extra: data.createTime, type: 'text' },
......
......@@ -78,7 +78,7 @@ const ReadyConfirm: React.FC = () => {
title: intl.formatMessage({ id: 'balance.caozuo' }),
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => <Link to={`readyConfirm/detail?id=${record.reconciliationId}&no=${text}`}>{intl.formatMessage({ id: 'balance.queren' })}</Link>
render: (text: any, record: any) => <Link to={`readyConfirm/detail?id=${record.reconciliationId}&no=${record.reconciliationNo}`}>{intl.formatMessage({ id: 'balance.queren' })}</Link>
}];
return (
......
......@@ -43,6 +43,9 @@ const TABLINK = [
{ id: 'billLayout', title: '请款明细' },
]
const reg = /(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{0,3}$)/
const createMonthOrDays = (number: number, type: string) => {
let _list = [];
for (let i = 1; i <= number; i++) {
......@@ -70,6 +73,7 @@ const Add = () => {
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [payWayData, setPayWayData] = useState<any>([]);
const [payWay, setPayWay] = useState<number>(1);
const [applyType, setApplyType] = useState<number>(1);
const [dataSource, setDataSource] = useState<any>(_state?.data ?? {});
const [tabelSource, setTabelSource] = useState<any>([]);
const [applyOptions, setApplyOptions] = useState<any>((path === 'funds' || path === 'editFunds') ? [{ label: _state?.data?.applyTypeName, value: _state?.data?.applyType }] : []);
......@@ -359,7 +363,17 @@ const Add = () => {
<Col>
<Form.Item
name='payDate'
rules={[{ required: true, message: '请选择账期' }]}
rules={[
{ required: true, message: '请选择账期' },
{
validator: (_, value) => {
if (!(/(^[1-9]\d*$)/.test(value))) {
return Promise.reject(new Error('请输入整数'))
}
return Promise.resolve()
}
},
]}
>
<Input placeholder={'请输入账期'} addonAfter={'天'} />
</Form.Item>
......@@ -391,7 +405,7 @@ const Add = () => {
const _changeNumbers = (record: any, value: any) => {
let _val = value.replace(/^\D*(\d*(?:\.\d{0,3})?).*$/g, '$1');
let _dataSource = [...tabelSource];
const _i = _dataSource.findIndex((item) => item.billId === record.billId);
const _i = _dataSource.findIndex((item) => `applyPayment${item.billNo}_${item.taxRate}` === `applyPayment${record.billNo}_${record.taxRate}`);
let _item = { ..._dataSource[_i] };
_item.applyPayment = Number(_val);
_dataSource[_i] = _item;
......@@ -402,15 +416,15 @@ const Add = () => {
const handleRemove = (index: number, record: any) => {
const data = [...tabelSource];
data.splice(index, 1);
form.setFieldsValue({ [`applyPayment${record.billNo}_${record.billId}`]: null });
form.setFieldsValue({ [`applyPayment${record.billNo}_${record.taxRate}`]: null });
setTabelSource(data)
}
const handleRecordOk = (rows: any) => {
const _documentTypeList = tabelSource.filter((item) => item.billType === documentType).map((item) => `${item.billType}_${item.billId}`)
const _documentTypeList = tabelSource.filter((item) => item.billType === documentType).map((item) => `${item.billType}_${item.billId}_${item.taxRate}`)
let _flag = false;
for (let i = 0; i < rows.length; i++) {
if (_documentTypeList.includes(`${rows[i].billType}_${rows[i].billId}`)) {
if (_documentTypeList.includes(`${rows[i].billType}_${rows[i].billId}_${rows[i].taxRate}`)) {
_flag = true;
break;
}
......@@ -505,11 +519,14 @@ const Add = () => {
width: 150,
render: (text: any, record: any, index: number) => (
<Form.Item
name={`applyPayment${record.billNo}_${record.billId}`}
name={`applyPayment${record.billNo}_${record.taxRate}`}
style={{ margin: 0 }}
rules={[
{
validator: (_, value) => {
if (!reg.test(value)) {
return Promise.reject(new Error('请款金额需要大于0'))
}
if (value > (record.billAmount - record.paid - record.appliedUnpaid)) {
return Promise.reject(new Error('请款金额不能超过单据金额减去已付款及已请款待付款的和'))
}
......@@ -637,14 +654,28 @@ const Add = () => {
return current && current < moment().endOf('day');
}
const _handleApplyTypeChange = (value: any) => {
form.setFieldsValue({ applyType: value })
setApplyType(value);
}
useEffect(() => {
if (!_isFunds) {
tabelSource.forEach((item) => {
form.setFieldsValue({ [`applyPayment${item.billNo}_${item.billId}`]: item.applyPayment || null })
form.setFieldsValue({ [`applyPayment${item.billNo}_${item.taxRate}`]: item.applyPayment || null })
})
}
}, [tabelSource])
useEffect(() => {
if (!_isFunds) {
tabelSource.forEach((item) => {
form.setFieldsValue({ [`applyPayment${item.billNo}_${item.taxRate}`]: null })
})
}
setTabelSource([]);
}, [applyType])
return (
<>
<PeripheralLayout
......@@ -682,7 +713,7 @@ const Add = () => {
name='applyType'
rules={[{ required: true, message: '请选择请款类型' }]}
>
<Select placeholder={'请选择请款类型'} disabled={!_isAdd} options={applyOptions} />
<Select onChange={_handleApplyTypeChange} placeholder={'请选择请款类型'} disabled={!_isAdd} options={applyOptions} />
</Form.Item>
</Col>
</Row>
......@@ -839,7 +870,7 @@ const Add = () => {
/>
<WriteOffDrawer visible={writeOffDrawer} record={writeOffData} editAble={true} onClose={() => { setWriteOffDrawer(false) }} onOk={_handleWriteOffOk} />
<MemberDrawer visible={memberDrawerVisible} onClose={() => { setMemberDrawerVisible(false) }} onOk={_handleMemberOk} />
<ContractDrawer visible={contractDrawerVisible} partyBMemberId={dataSource?.vendorMemberId} partyBRoleId={dataSource?.vendorRoleId} onClose={() => { setContractDrawerVisible(false) }} onOk={handleRecordOk} />
<ContractDrawer visible={contractDrawerVisible} applyType={form.getFieldValue('applyType')} partyBMemberId={dataSource?.vendorMemberId} partyBRoleId={dataSource?.vendorRoleId} onClose={() => { setContractDrawerVisible(false) }} onOk={handleRecordOk} />
<RequestFundsDrawer visible={requestFundsDrawerVisible} applyType={form.getFieldValue('applyType')} onClose={() => { setRequestFundsDrawerVisible(false) }} onOk={handleRecordOk} />
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' }, { default: '您还有未保存的内容,是否确定要离开?' })} />
</>
......
import React, { useRef, useState } from 'react';
import { Drawer, Button } from 'antd';
import React, { useRef, useState, useEffect } from 'react';
import { Drawer, Button,message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
......@@ -13,6 +13,7 @@ import { getIntl } from 'umi';
interface ContractDrawerProps {
visible: boolean,
applyType: number,
partyBMemberId?: number,
partyBRoleId?: number,
onClose?: () => void,
......@@ -22,13 +23,13 @@ const intl = getIntl();
const formActions = createFormActions();
const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProps) => {
const { visible, partyBMemberId, partyBRoleId, onClose, onOk } = props;
const { visible, applyType, partyBMemberId, partyBRoleId, onClose, onOk } = props;
const ref = useRef<any>({})
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const [selectedRows, setSelectedRows] = useState<any>([])
const loadingTableData = async (params) => {
const _params = { ...params, partyBMemberId, partyBRoleId }
const _params = { ...params, sourceType: applyType, partyBMemberId, partyBRoleId }
const { data } = await getSettleAccountsBusinessApplyAmountFindApplyAmountRosSourceContracts(_params)
return data;
}
......@@ -72,16 +73,17 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
let childArr = [...selectedRowKeys];
let childRowArr = [...selectedRows]
const _key = `contract_${record['billNo']}_${record['taxRate']}`
if (selected) {
childArr.push(record.billId);
childArr.push(_key);
childRowArr.push(record);
} else {
childArr.splice(
childArr.findIndex((item) => item === record.billId),
childArr.findIndex((item) => item === _key),
1
);
childRowArr.splice(
childRowArr.findIndex((item) => item.billId === record.billId),
childRowArr.findIndex((item) => `contract_${item['billNo']}_${item['taxRate']}` === _key),
1
);
}
......@@ -94,17 +96,17 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
let childRowArr = [...selectedRows];
if (selected) {
childArr = Array.from(
new Set([...childArr, ...changeRows.map((item) => item.billId)])
new Set([...childArr, ...changeRows.map((item) => `contract_${item['billNo']}_${item['taxRate']}`)])
);
childRowArr = Array.from(
new Set([...childRowArr, ...changeRows])
);
} else {
childArr = childArr.filter(
(item) => !changeRows.some((e) => e.billId === item)
(item) => !changeRows.some((e) => `contract_${e['billNo']}_${e['taxRate']}` === item)
);
childRowArr = childRowArr.filter(
(item) => !changeRows.some((e) => e.billId === item.billId)
(item) => !changeRows.some((e) => `contract_${e['billNo']}_${e['taxRate']}` === `contract_${item['billNo']}_${item['taxRate']}`)
);
}
setSelectedRowKeys(childArr);
......@@ -113,11 +115,20 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
const _onOk = () => {
const _rows = [...selectedRows]
if(_rows.length <= 0){
message.error('请至少选择一条记录');
return;
}
setSelectedRows([])
setSelectedRowKeys([])
onOk?.(_rows);
}
useEffect(() => {
setSelectedRows([])
setSelectedRowKeys([])
}, [applyType, partyBMemberId])
return (
<Drawer
......@@ -143,7 +154,12 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="billId"
key={`contract_${partyBMemberId}_${applyType}`}
tableProps={{
rowKey: (record) => {
return `contract_${record['billNo']}_${record['taxRate']}`;
}
}}
rowSelection={{
selectedRowKeys: selectedRowKeys,
onSelect: handleSelectChange,
......@@ -177,6 +193,7 @@ const ContractDrawer: React.FC<ContractDrawerProps> = (props: ContractDrawerProp
'x-component-props': {
placeholder: '请输入合同编号',
align: 'flex-start',
allowClear: true,
},
},
}
......
......@@ -56,6 +56,14 @@ const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) =>
setSelectedRow(record)
};
const _onOk = () => {
if (!selectedRow?.memberId) {
message.error('请选择一条记录');
return;
}
onOk?.(selectedRow);
}
return (
<Drawer
......@@ -70,7 +78,7 @@ const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) =>
<Button onClick={onClose} style={{ marginRight: 8 }}>
{intl.formatMessage({ id: 'balance.quxiao' })}
</Button>
<Button onClick={() => { onOk?.(selectedRow) }} type="primary">
<Button onClick={_onOk} type="primary">
{'确定'}
</Button>
</div>
......@@ -101,13 +109,14 @@ const MemberDrawer: React.FC<MemberDrawerProps> = (props: MemberDrawerProps) =>
grid: true
},
properties: {
memberName: {
name: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入会员名称',
advanced: false,
align: 'flex-start',
allowClear: true,
},
},
}
......
import React, { useRef, useState } from 'react';
import { Drawer, Button } from 'antd';
import React, { useRef, useState, useEffect } from 'react';
import { Drawer, Button, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import StandardTable from '@/components/StandardTable';
import { createFormActions } from '@formily/antd'
......@@ -88,16 +88,17 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
const handleSelectChange = (record, selected, selectedRow, nativeEvent) => {
let childArr = [...selectedRowKeys];
let childRowArr = [...selectedRows]
const _key = `requestFunds_${record['billNo']}_${record['taxRate']}`
if (selected) {
childArr.push(record.billId);
childArr.push(_key);
childRowArr.push(record);
} else {
childArr.splice(
childArr.findIndex((item) => item === record.billId),
childArr.findIndex((item) => item === _key),
1
);
childRowArr.splice(
childRowArr.findIndex((item) => item.billId === record.billId),
childRowArr.findIndex((item) => `requestFunds_${item['billNo']}_${item['taxRate']}` === _key),
1
);
}
......@@ -110,17 +111,17 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
let childRowArr = [...selectedRows];
if (selected) {
childArr = Array.from(
new Set([...childArr, ...changeRows.map((item) => item.billId)])
new Set([...childArr, ...changeRows.map((item) => `requestFunds_${item['billNo']}_${item['taxRate']}`)])
);
childRowArr = Array.from(
new Set([...childRowArr, ...changeRows])
);
} else {
childArr = childArr.filter(
(item) => !changeRows.some((e) => e.billId === item)
(item) => !changeRows.some((e) => `requestFunds_${e['billNo']}_${e['taxRate']}` === item)
);
childRowArr = childRowArr.filter(
(item) => !changeRows.some((e) => e.billId === item.billId)
(item) => !changeRows.some((e) => `requestFunds_${e['billNo']}_${e['taxRate']}` === `requestFunds_${item['billNo']}_${item['taxRate']}`)
);
}
setSelectedRowKeys(childArr);
......@@ -129,11 +130,20 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
const _onOk = () => {
const _rows = [...selectedRows]
if (_rows.length <= 0) {
message.error('请至少选择一条记录');
return;
}
setSelectedRows([])
setSelectedRowKeys([])
onOk?.(_rows);
}
useEffect(() => {
setSelectedRows([])
setSelectedRowKeys([])
}, [applyType])
return (
<Drawer
......@@ -156,10 +166,15 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
>
<StandardTable
keepAlive={false}
key={`requestFunds_${applyType}`}
tableProps={{
rowKey: (record) => {
return `requestFunds_${record['billNo']}_${record['taxRate']}`;
}
}}
fetchTableData={params => loadingTableData(params)}
columns={columns}
currentRef={ref}
rowKey="billId"
rowSelection={{
selectedRowKeys: selectedRowKeys,
onSelect: handleSelectChange,
......@@ -193,6 +208,7 @@ const RequestFundsDrawer: React.FC<RequestFundsDrawerProps> = (props: RequestFun
'x-component-props': {
placeholder: '请输入单据号',
align: 'flex-start',
allowClear: true,
},
},
}
......
......@@ -3,12 +3,29 @@
flex-direction: row;
}
.period {
.flexRow();
margin-bottom: 20px;
.radiosContainer {
display: flex;
flex-direction: row;
.dayRadio {
margin-right: 20px
}
}
.values {
.days {
.flexRow();
margin-left: 25px;
// margin-left: 25px;
margin-top: 25px;
}
}
\ No newline at end of file
}
// .period {
// .flexRow();
// margin-bottom: 20px;
// .days {
// .flexRow();
// margin-left: 25px;
// }
// }
\ No newline at end of file
......@@ -5,6 +5,9 @@ import { Radio, Input, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import styles from './index.less';
import { registerValidationRules } from '@formily/antd' // 或者 @formily/next
import SettleMethod, { SettleActiveType } from './settleMethod';
type SettleMethodProps = React.ComponentProps<typeof SettleMethod>;
const DAY = 1;
const MONTH = 2;
......@@ -12,106 +15,52 @@ const MONTH = 2;
registerValidationRules({
settleMethodRule: value => {
const { active, otherValues } = value;
const isNumber = /^\d+$/; // 数字
const pattern = /[0-9]+\.[0-9]*/;
if (active == MONTH) {
return (otherValues[1] < 0 || otherValues[1] > 31) || pattern.test(otherValues[1]) ? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.1' }) : ''
} else {
return !isNumber.test(otherValues[0]) || pattern.test(otherValues[0]) ? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.2' }) : ""
}
return !isNumber.test(otherValues[1]) || ((otherValues[1] < 0 || otherValues[1] > 31) || pattern.test(otherValues[1])) ? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.1' }) : ''
}
return !isNumber.test(otherValues[0]) || pattern.test(otherValues[0]) ? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.2' }) : ""
}
})
const SettleMethod = (props) => {
const { active = DAY, otherValues = [30, 1] } = props.value || {};
const { daysVisible, monthVisible } = props;
const intl = useIntl();
const handleChange = (e, type) => {
if (active == type) {
return;
}
const previewValue = otherValues
// setActive(type)
props.onChange({
active: type,
otherValues: previewValue
})
}
type XcomponenetProps = {
options: {
days: boolean,
month: boolean
},
default: any
}
const handleInputChange = (value, type) => {
const target = type - 1;
const temp = [...otherValues];
temp[target] = value;
props.onChange({
active: type,
otherValues: temp
})
interface Iprops {
/** 编辑状态 */
editable: boolean,
initialValue?: SettleMethodProps['value'],
value: SettleMethodProps['value'],
props: {
['x-component-props']: XcomponenetProps
}
if (!monthVisible && !daysVisible) {
return null
mutators: {
change: (value: any) => void
}
return (
<div>
{
daysVisible
? (
<div className={styles.period}>
<div>
<Radio name="method" checked={active == DAY} onChange={(e) => handleChange(e, DAY)}>{intl.formatMessage({ id: 'balance.components.settleMethod.method.1' })}</Radio>
<Tooltip title={intl.formatMessage({ id: 'balance.components.settleMethod.method.1.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</div>
<div className={styles.days}>
<div style={{ margin: '0 20px 0 12px' }}>{intl.formatMessage({ id: 'balance.components.settleMethod.days.1' })}</div>
<div>
<Input
addonAfter={intl.formatMessage({ id: 'balance.components.settleMethod.days.1.addonAfter' })}
value={otherValues[DAY - 1]}
onChange={(e) => handleInputChange(e.target.value, DAY)}
disabled={active !== DAY}
style={{ width: '160px' }}
/></div>
</div>
</div>
)
: null
}
{
monthVisible
? <div className={styles.period}>
<div >
<Radio name="method" checked={active == MONTH} onChange={(e) => handleChange(e, MONTH)}>{intl.formatMessage({ id: 'balance.components.settleMethod.method.2' })}</Radio>
<Tooltip title={intl.formatMessage({ id: 'balance.components.settleMethod.method.2.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</div>
<div className={styles.days}>
<div style={{ marginRight: '20px' }}>{intl.formatMessage({ id: 'balance.components.settleMethod.days.2' })}</div>
<div><Input addonAfter={intl.formatMessage({ id: 'balance.components.settleMethod.days.2.addonAfter' })} style={{ width: '160px' }} value={otherValues[MONTH - 1]} onChange={(e) => handleInputChange(e.target.value, MONTH)} disabled={active !== MONTH} /></div> </div>
</div>
: null
}
</div>
)
}
const Index = (props) => {
const Index: React.FC<Iprops> & { isFieldComponent: boolean } = (props: Iprops) => {
const editable = props.editable;
const value = props.value || { active: 0, otherValues: [30, 1] };
const componentProps = props.props['x-component-props'] || {};
const options = componentProps.options || {};
const value = props.value || { active: 1, otherValues: [30, 1] };
const componentProps = props.props['x-component-props'] || {} as XcomponenetProps;
const options = componentProps.options || ({} as XcomponenetProps['options']);
const intl = useIntl();
// 默认选择
useEffect(() => {
// const componentProps = props.props['x-component-props'] || {};
const defaultValue = componentProps.default || {};
if (!options.days && !options.month) {
if (!options?.days && !options?.month) {
return
}
if (typeof props.initialValue == 'undefined') {
......@@ -127,15 +76,19 @@ const Index = (props) => {
}
if (!editable) {
return value.active == 1 ? intl.formatMessage({ id: 'balance.components.settleMethod.index.1' }, { data: value.otherValues[0] }) : intl.formatMessage({ id: 'balance.components.settleMethod.index.2' }, { data: value.otherValues[1] })
return (
<div>
{value.active == DAY ? intl.formatMessage({ id: 'balance.components.settleMethod.index.1' }, { data: value.otherValues[0] }) : intl.formatMessage({ id: 'balance.components.settleMethod.index.2' }, { data: value.otherValues[1] })}
</div>
)
}
return (
<div>
<SettleMethod
value={value}
daysVisible={options.days}
monthVisible={options.month}
daysVisible={options?.days || false}
monthVisible={options.month || false}
onChange={onChange}
/>
</div>
......
import { QuestionCircleOutlined } from "@ant-design/icons";
import { Input, Radio, Tooltip } from "antd";
import { useIntl } from "umi";
import styles from './index.less';
const DAY = 1;
const MONTH = 2;
/** 1 => 账期,2 => 月结 */
export type SettleActiveType = 1 | 2;
interface Iprops {
value: {
active: SettleActiveType,
/** 账期天数, 每月结算日 */
otherValues: [number, number]
},
onChange: (params: {active: 1 | 2, otherValues: [number, number]}) => void,
/** 是否显示账期结算 */
daysVisible: boolean,
/** 是否显示月结 */
monthVisible: boolean
}
const SettleMethod: React.FC<Iprops> = (props: Iprops) => {
const { value, daysVisible, monthVisible, onChange } = props;
const { active = DAY, otherValues = [30, 1] } = value || {};
const intl = useIntl();
const handleChange = (e, type: SettleActiveType) => {
if (active == type) {
return;
}
const previewValue = otherValues
// setActive(type)
onChange({
active: type,
otherValues: previewValue
})
}
const handleInputChange = (value: string, type: SettleActiveType) => {
const target = type - 1;
const temp = [...otherValues];
temp[target] = value as unknown as number;
props.onChange({
active: type,
otherValues: temp as [number, number]
})
}
if (!monthVisible && !daysVisible) {
return null
}
return (
<div>
<div>
<div className={styles.radiosContainer}>
{
daysVisible && (
<div className={styles.dayRadio}>
<Radio name="method" checked={active == DAY} onChange={(e) => handleChange(e, DAY)}>{intl.formatMessage({ id: 'balance.components.settleMethod.method.1' })}</Radio>
<Tooltip title={intl.formatMessage({ id: 'balance.components.settleMethod.method.1.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</div>
) || null
}
{
monthVisible && (
<div>
<Radio name="method" checked={active == MONTH} onChange={(e) => handleChange(e, MONTH)}>{intl.formatMessage({ id: 'balance.components.settleMethod.method.2' })}</Radio>
<Tooltip title={intl.formatMessage({ id: 'balance.components.settleMethod.method.2.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</div>
) || null
}
</div>
<div className={styles.values}>
{
active === DAY
? <div className={styles.days}>
<div style={{margin: '0 20px 0 0px'}}>{intl.formatMessage({ id: 'balance.components.settleMethod.days.1' })}</div>
<div>
<Input
addonAfter={intl.formatMessage({ id: 'balance.components.settleMethod.days.1.addonAfter' })}
value={otherValues[0]}
onChange={(e) => handleInputChange(e.target.value, DAY)}
disabled={active !== DAY}
style={{width: '160px'}}
/></div>
</div>
: <div className={styles.days}>
<div style={{marginRight: '20px'}}>{intl.formatMessage({ id: 'balance.components.settleMethod.days.2' })}</div>
<div>
<Input
// addonAfter={"号"}
addonAfter={intl.formatMessage({ id: 'balance.components.settleMethod.days.2.addonAfter' })}
style={{width: '160px'}}
value={otherValues[1]}
onChange={(e) => handleInputChange(e.target.value, MONTH)}
disabled={active !== MONTH}
/>
</div>
</div>
}
</div>
</div>
</div>
)
}
export default SettleMethod
\ No newline at end of file
......@@ -16,6 +16,8 @@ interface WriteOffDrawerProps {
onOk?: (rows: any[]) => void
}
const intl = getIntl();
const reg = /(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{0,3}$)/
const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProps) => {
const { visible, record, editAble = false, onClose, onOk } = props;
const ref = useRef<any>({})
......@@ -119,7 +121,10 @@ const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProp
rules={[
{
validator: (_, value) => {
return value > record.canWriteAmount ? Promise.reject(new Error('可以核销金额')) : Promise.resolve()
if (!reg.test(value)) {
return Promise.reject(new Error('本次核销金额需要大于0'))
}
return value > record.canWriteAmount ? Promise.reject(new Error('本次核销金额不能大于可以核销金额')) : Promise.resolve()
}
},
]}
......
......@@ -32,7 +32,7 @@ import {
} from '@/services/SettleV2Api';
import { getMemberManageLowerPageBynamerole, getMemberManageRoleSubList, getMemberManageUpperPage } from '@/services/MemberV2Api';
import { getManageRuleConfigurationList } from '@/services/ManageV2Api';
import { getOrderPlatformSettlementTypeList } from '@/services/OrderNewV2Api';
import { getOrderPlatformSettlementCategoryList, getOrderPlatformSettlementTypeList } from '@/services/OrderNewV2Api';
const formActions = createFormActions();
......@@ -92,7 +92,7 @@ const MemberSettleAdd: React.FC = () => {
title: intl.formatMessage({ id: 'balance.settleRules.memberSettle.info.columns.operation' }),
render: (text, record) => {
return (
<div onClick={() => handleRemove(record.uniqueId)}>{intl.formatMessage({ id: 'balance.settleRules.memberSettle.info.columns.operation.button' })}</div>
<a onClick={() => handleRemove(record.uniqueId)}>{intl.formatMessage({ id: 'balance.settleRules.memberSettle.info.columns.operation.button' })}</a>
)
}
}
......@@ -110,12 +110,21 @@ const MemberSettleAdd: React.FC = () => {
// 从PAAS平台--规则配置--平台规则配置取已勾选的结算方式决定是否显示结算方式
const fetchBalancedMethods = async () => {
const { data } = await getManageRuleConfigurationList({ platformType: '5' });
const length = data.length
return {
days: length > 0 && data[0].check,
month: length > 1 && data[1].check
};
const { data, code } = await getOrderPlatformSettlementCategoryList();
// const length = data.length
let config = {
days: false,
month: false,
}
if (code !== 1000) {
return config
}
const codeToMap = ["", "days", "month"]
data.forEach((_item) => {
config[codeToMap[_item.methodCode]] = true
})
return config
}
// 获取适用会员
......
......@@ -82,6 +82,10 @@ export const addSchema = {
type: 'string',
'x-rules': [
{ required: true, message: intl.formatMessage({ id: 'balance.settleRules.memberSettle.info.schema.addSchema.basicTab.name.message' }) },
{
limitByte: true,
maxByte: 48,
}
]
},
settlementWay: {
......
......@@ -227,7 +227,7 @@ export const schema: ISchema = {
{
validator(value) {
const intVal = +value;
return intVal > 28 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 28的数值' }) : '';
return intVal > 31 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 31的数值' }) : '';
}
},
],
......@@ -289,7 +289,7 @@ export const schema: ISchema = {
{
validator(value) {
const intVal = +value;
return intVal > 28 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 28的数值' }) : '';
return intVal > 31 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 31的数值' }) : '';
}
},
],
......
......@@ -227,7 +227,7 @@ export const schema: ISchema = {
{
validator(value) {
const intVal = +value;
return intVal > 28 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 28的数值' }) : '';
return intVal > 31 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 31的数值' }) : '';
}
},
],
......@@ -289,7 +289,7 @@ export const schema: ISchema = {
{
validator(value) {
const intVal = +value;
return intVal > 28 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 28的数值' }) : '';
return intVal > 31 || intVal < 0 ? intl.formatMessage({ id: 'member.management.memberPrComingClassify.drawer.form.classify.monthDay.limit' }, { default: '请输入大于0 小于等于 31的数值' }) : '';
}
},
],
......
......@@ -42,8 +42,8 @@ const QuotaMenage: React.FC = () => {
const defaultColumns: ColumnType<any>[] = [
{
title: '会员归属',
dataIndex: intl.formatMessage({id: 'payandSettle.creditApplication.quotaMenage.defaultColumns.parentMemberName'}),
title: intl.formatMessage({id: 'payandSettle.creditApplication.quotaMenage.defaultColumns.parentMemberName'}),
dataIndex: 'parentMemberName',
align: 'center',
render: (text, record) => (
<>
......
......@@ -5,7 +5,7 @@ import MellowCard from '@/components/MellowCard';
import { BIND_PHONE, EDetailContext, formItemLayout, formItemLayoutCompany, prefixSelector, prefixSelectorEle, tailFormItemLayout, tailFormItemLayoutCompany } from '../../constant';
import { EditOutlined } from '@ant-design/icons';
import UploadImage from '@/components/UploadImage';
import { getPayAllInPayGetBankList, postPayAllInPayBindCompanyAccount, postPayAllInPayBindPhone, postPayAllInPayIdCardCollect, postPayAllInPaySendVerificationCode, postPayAllInPaySetCompanyInfo, postPayAllInPaySignContract } from '@/services/PayV2Api';
import { getPayAllInPayGetBankList, postPayAllInPayBindCompanyAccount, postPayAllInPayBindPhone, postPayAllInPayIdCardCollect, postPayAllInPaySendVerificationCode, postPayAllInPaySetCompanyInfo, postPayAllInPaySignContract, postPayAllInPaySignContractQuery } from '@/services/PayV2Api';
import useCountDown from '@/utils/hooks';
/** 图片key对应的picType值 */
......@@ -117,9 +117,17 @@ const Company: React.FC<{}> = () => {
}
}
const contractPreview = async () => {
const {code, data} = await postPayAllInPaySignContractQuery({jumpPageType:1}, { ctlType: 'none' })
if(code === 1000) {
var signLink = document.getElementById('signPrewview')
signLink.setAttribute('href', data)
signLink.click()
}
}
const handleSendSMS = () => {
formPhone.validateFields(['phone']).then(result => {
console.log(result)
// 发送验证码
postPayAllInPaySendVerificationCode({ ...result, verificationCodeType: BIND_PHONE }).then(res => {
res.code === 1000 && start()
......@@ -447,7 +455,13 @@ const Company: React.FC<{}> = () => {
label={intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.company.mellowCard.2.electric' })}
name="electric"
>
<Button onClick={clickSign} icon={<EditOutlined />} style={{ width: '100%' }}>{intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.company.mellowCard.2.electric.button' })}</Button>
{
data?.contractNo
?
<Button type="link" onClick={contractPreview}>{data.contractNo}</Button>
:
<Button onClick={clickSign} icon={<EditOutlined />} style={{ width: '100%' }}>{intl.formatMessage({ id: 'payandSettle.eAccountApprove.components.company.mellowCard.2.electric.button' })}</Button>
}
</Form.Item>
<Form.Item {...tailFormItemLayout}>
......@@ -536,7 +550,9 @@ const Company: React.FC<{}> = () => {
</Form>
</MellowCard>
}
<a href="" target="_bank" id="signLink" style={{display: 'none', visibility: "hidden"}}></a>
<a href="" target="_blank" id="signPrewview" style={{display: 'none', visibility: "hidden"}}></a>
</>)
}
......
......@@ -114,7 +114,12 @@ const CouponCard: React.FC<CouponCardProps> = (props: CouponCardProps) => {
message.warning('没有商城地址信息,无法进行跳转')
return;
}
const url = `${REQUEST_HEADER}${shop.url}.${TOP_DOMAIN}/makeUpList/${data.couponId}?belongType=${data.belongType}`;
let url = `${REQUEST_HEADER}${shop.url}.${TOP_DOMAIN}/makeUpList/${data.couponId}?belongType=${data.belongType}`;
if (data.belongType === 1) {
url = `${REQUEST_HEADER}${shop.url}.${TOP_DOMAIN}/commodity`;
}
window.open(url);
};
......
......@@ -10,6 +10,7 @@ import { validatorByte } from '@/utils/regExp'
import UploadImage from '@/components/UploadImage'
import { getAuth } from '@/utils/auth'
import { getProductBrandGetBrand, postProductBrandApplyCheckBrand, postProductBrandSaveOrUpdateBrand } from '@/services/ProductV2Api'
import { postManageActivityShopRuleExistShop } from '@/services/ManageV2Api'
const { Step } = Steps;
......@@ -32,7 +33,8 @@ const AddBrand: React.FC<{}> = () => {
const [formValues, setFormValues] = useState<any>({})
const [isDisabledSave, setIsDisabledSave] = useState<boolean>(false)
const [isDisabledCheck, setDisabledCheck] = useState<boolean>(true)
const { roles, memberRoleId } = getAuth() || {};
const [hasSelfStore, setHasSelfStore] = useState<boolean>(false)
const { roles, memberRoleId, memberId } = getAuth() || {};
useEffect(() => {
const { id } = history.location.query
......@@ -58,6 +60,10 @@ const AddBrand: React.FC<{}> = () => {
}
})
}
postManageActivityShopRuleExistShop({memberId, memberRoleId}, { ctlType: 'none' }).then(res => {
const { code, data } = res
setHasSelfStore(data)
})
}, [])
useEffect(() => {
......@@ -143,7 +149,13 @@ const AddBrand: React.FC<{}> = () => {
<Card headStyle={{ borderBottom: 'none' }} title={intl.formatMessage({ id: 'trademark.addBrand.card.1' })}>
<Steps progressDot current={currentStep}>
<Step title={intl.formatMessage({ id: 'trademark.addBrand.card.1.step.1' })} description={roles.filter(item => item.memberRoleId === memberRoleId)[0]['memberRoleName']} />
<Step title={intl.formatMessage({ id: 'trademark.addBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.addBrand.card.1.step.2.description' })} />
{
hasSelfStore
?
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.1.description' })} />
:
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2.description' })} />
}
<Step title={intl.formatMessage({ id: 'trademark.addBrand.card.1.step.3' })} description="" />
</Steps>
</Card>
......
......@@ -212,7 +212,7 @@ const CheckBrandDetail: React.FC<{}> = () => {
<Card headStyle={{borderBottom:'none'}} title={intl.formatMessage({ id: 'trademark.viewBrand.card.1' })}>
<Steps progressDot current={fixStep}>
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.1' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.1.description' })} />
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2.description' })} />
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.1.description' })} />
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description="" />
</Steps>
</Card>
......
......@@ -141,7 +141,13 @@ const viewBrand: React.FC<{}> = () => {
<Card headStyle={{ borderBottom: 'none' }} title={intl.formatMessage({ id: 'trademark.viewBrand.card.1' })}>
<Steps progressDot current={fixStep}>
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.1' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.1.description' })} />
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2.description' })} />
{
brandInfo.type === 1
?
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.1.description' })} />
:
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2.description' })} />
}
<Step title={intl.formatMessage({ id: 'trademark.viewBrand.card.1.step.2' })} description="" />
</Steps>
</Card>
......
......@@ -363,11 +363,11 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
rows: 4,
placeholder: intl.formatMessage({ id: 'transaction_components.zaicishurunideyuanyin1' })
},
title: intl.formatMessage({ id: 'transaction_components.quxiaoyuanyin' }),
title: intl.formatMessage({ id: 'transaction_components.xiugaiyuanyin' }),
"x-rules": [
{
required: true,
message: intl.formatMessage({ id: 'transaction_components.qingshuruquxiaoyuanyin' })
message: intl.formatMessage({ id: 'transaction_components.qingshuruxiugaiyuanyin' })
},
{
limitByte: true,
......@@ -870,11 +870,11 @@ const SaleOrderProductTable: React.FC<OrderProductTableProps> = (props) => {
rows: 4,
placeholder: intl.formatMessage({ id: 'transaction_components.zaicishurunideyuanyin1' })
},
title: intl.formatMessage({ id: 'transaction_components.quxiaoyuanyin' }),
title: intl.formatMessage({ id: 'transaction_components.xiugaiyuanyin' }),
"x-rules": [
{
required: true,
message: intl.formatMessage({ id: 'transaction_components.qingshuruquxiaoyuanyin' })
message: intl.formatMessage({ id: 'transaction_components.qingshuruxiugaiyuanyin' })
},
{
limitByte: true,
......
......@@ -299,17 +299,16 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
});
if (res.code === 1000) {
const { data = {} }: any = res;
const {
memberTypes = [],
levels = [],
suitableMemberTypes = [],
} = data;
} = res.data;
return {
memberType: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
memberTypeEnum: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
level: levels.map(item => ({ label: item.levelTag, value: item.level })),
suitableMemberType: suitableMemberTypes.map(item => ({ label: item.name, value: item.value })),
suitableMemberType: suitableMemberTypes?.map(item => ({ label: item.name, value: item.value })),
};
}
return {};
......@@ -406,7 +405,7 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['memberType', 'level', 'suitableMemberType'],
['memberTypeEnum', 'level', 'suitableMemberType'],
fetchSelectOptions,
);
},
......
......@@ -68,8 +68,10 @@ export const drawerSchema: ISchema = {
properties: {
memberId: {
type: 'string',
'x-component': 'NumberPicker',
'x-component-props': {
placeholder: intl.formatMessage({ id: 'merchantCoupon.MemberID' }),
min: 0,
},
},
memberTypeEnum: {
......
......@@ -42,7 +42,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', () => {
const intl = useIntl()
const { form } = useFormSpy({ selector: [['onFieldValueChange', 'detailList']], reducer: v => v })
const data = form.getFieldValue('detailList')
console.log(data, 'data')
const totalCarton = data.reduce((prev, next) => (prev*1000 + (next.carton || 0)*1000)/1000, 0)
const totalWeight = data.reduce((prev, next) => (prev*1000 + (next.weight || 0)*1000)/1000, 0)
const totalVolume = data.reduce((prev, next) => (prev*1000 + (next.volume || 0)*1000)/1000, 0)
......
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