Commit ac138cd4 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 7ff704a6 140e48b8
btnCode 是pass 平台配置唯一表示
btnCode 是pass 平台配置唯一表示
......@@ -76,6 +76,27 @@ repositories.edit:仓位库存调拨按钮
// 内容管理-contentAbility
// 内容管理-栏目管理
columnsManagement.del 栏目管理删除 栏目管理删除按钮
columnsManagement.edit 栏目管理编辑 栏目管理编辑按钮
columnsManagement.state 栏目管理状态 栏目管理状态是否有效按钮
columnsManagement.see 栏目管理查看 栏目管理查看按钮
columnsManagement.add 栏目管理添加 栏目管理添加按钮
// 内容管理 -分类管理 category.categorysonadd,category.categoryadd,category.categoryadd 没有处理
category.categorysonadd 分类管理节点新曾子节点 分类管理节点新曾子节点按钮
category.categoryadd 分类管理节点新曾节点 分类管理节点新曾按钮
category.categoryadd 分类管理节点删除 分类管理节点删除按钮
category.edit 分类管理保存 分类管理保存按钮
category.del 分类管理删除 分类管理删除按钮
// 内容管理 -标签管理
tagsManagement.add 标签管理新曾 标签管理按钮
tagsManagement.del 标签管理删除 标签管理删除按钮
tagsManagement.edit 标签管理编辑 标签管理编辑按钮
tagsManagement.see 标签管理查看 标签管理查看按钮
tagsManagement.state 标签管理状态 设置标签有效或者无效按钮
// 内容管理-资讯管理
infomations.del 资讯管理删除 资讯管理删除按钮
......@@ -84,7 +105,7 @@ infomations.state 资讯管理上下架 资讯管理上下架按钮
infomations.see 资讯管理查看 资讯管理查看按钮
infomations.add 资讯管理新曾 资讯管理新曾按钮
//内容管理-公告管理
// 内容管理-公告管理
contentAbility.add 公告管理新曾 公告管理新曾按钮
contentAbility.see 公告管理查看 公告管理查看按钮
contentAbility.state 公告管理操作上架下架 公告管理操作上架下架按钮
......
......@@ -49,7 +49,7 @@ export interface TabTreeProps extends TreeProps {
resetSearch?: boolean;
}
const intl = getIntl();
export interface InnermostTreeNodeProps {}
export interface InnermostTreeNodeProps { }
export interface RenderIconsProps {
node: any;
......@@ -76,11 +76,11 @@ export const createTreeActions = () => {
getSelectKeys() {
return [];
},
setSelectKey() {},
setSelectKeys() {},
setExpandedKeys() {},
getParentPath(id){return ''},
getParent(id){return null}
setSelectKey() { },
setSelectKeys() { },
setExpandedKeys() { },
getParentPath(id) { return '' },
getParent(id) { return null }
};
return actions;
};
......@@ -100,7 +100,7 @@ const RenderIcons: React.FC<RenderIconsProps> = props => {
// return <Space className={cx('god-tabtree-icons', props.nowKey === props.node.key ? 'show' : 'hide')}>
return (
<Space className={cx('god-tabtree-icons')}>
<Tooltip title={intl.formatMessage({id: 'components.xinzengjiedian'})}>
<Tooltip title={intl.formatMessage({ id: 'components.xinzengjiedian' })}>
<PlusCircleOutlined
onClick={e => {
e.stopPropagation();
......@@ -110,7 +110,7 @@ const RenderIcons: React.FC<RenderIconsProps> = props => {
}}
/>
</Tooltip>
<Tooltip title={intl.formatMessage({id: 'components.xinzengzijiedian'})}>
<Tooltip title={intl.formatMessage({ id: 'components.xinzengzijiedian' })}>
<PlusCircleOutlined
onClick={e => {
e.stopPropagation();
......@@ -120,7 +120,7 @@ const RenderIcons: React.FC<RenderIconsProps> = props => {
}}
/>
</Tooltip>
<Tooltip title={intl.formatMessage({id: 'components.shanchudangqianjiedian'})}>
<Tooltip title={intl.formatMessage({ id: 'components.shanchudangqianjiedian' })}>
<DeleteOutlined
onClick={e => {
e.stopPropagation();
......@@ -174,7 +174,7 @@ function transformSingleTitle(
}}
>
{checkable ||
(data[item].children && data[item].children.length !== 0) ? (
(data[item].children && data[item].children.length !== 0) ? (
data[item].title
) : (
<InnermostTreeNode>{data[item].title}</InnermostTreeNode>
......@@ -223,7 +223,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
handleCheck,
customExpandkeys,
enableSearch = false,
searchPlaceholder = intl.formatMessage({id: 'components.sousuo'}),
searchPlaceholder = intl.formatMessage({ id: 'components.sousuo' }),
checkStrictly = false,
resetSearch,
} = props;
......@@ -241,8 +241,8 @@ const TabTree: React.FC<TabTreeProps> = props => {
// 搜索的值
const [searchValue, setSearchValue] = useState()
useEffect(()=> {
if(resetSearch) {
useEffect(() => {
if (resetSearch) {
setSearchValue(null)
setExpandkeys([])
}
......@@ -278,7 +278,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
}, []);
useEffect(() => {
if(customExpandkeys?.length) {
if (customExpandkeys?.length) {
setExpandkeys(customExpandkeys)
setAutoExpandParent(true)
}
......@@ -315,7 +315,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
const targetInfo = reductData[id]
const parentInfo = reductData[targetInfo.parentId]
// fixbug 当选中根节点下的节点时, 由于无parentId, 需自动补充0
return parentInfo || {id: 0}
return parentInfo || { id: 0 }
}
}
const batchSelect = (items: any) => {
......@@ -336,7 +336,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
const onSearchChange = v => {
// todo 找到目标节点的父级key
setSearchValue(v)
if(v) {
if (v) {
const reductData = Object.values(treeReduction(treeData))
const expandedKeys = reductData.filter(item => item['title'].indexOf(v) > -1).map(_item => _item['parentId'])
setExpandkeys(expandedKeys)
......@@ -353,12 +353,12 @@ const TabTree: React.FC<TabTreeProps> = props => {
<div>{title}</div>
{checkable && (
<Button onClick={toggleSelectAll} disabled={disabled} type="link">
{allSelected ? intl.formatMessage({id: 'components.quxiaoquanxuan'}) : intl.formatMessage({id: 'components.quanxuan'})}
{allSelected ? intl.formatMessage({ id: 'components.quxiaoquanxuan' }) : intl.formatMessage({ id: 'components.quanxuan' })}
</Button>
)}
{showSave && checkable && (
<Button onClick={handleSubmit} disabled={disabled} type="link">
{intl.formatMessage({id: 'components.baocun'})}
{intl.formatMessage({ id: 'components.baocun' })}
</Button>
)}
</div>
......@@ -368,7 +368,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
style={{ marginBottom: 8 }}
placeholder={searchPlaceholder}
value={searchValue}
onChange={(v:any) => setSearchValue(v.target.value)}
onChange={(v: any) => setSearchValue(v.target.value)}
onSearch={onSearchChange}
/>
}
......@@ -410,7 +410,7 @@ const TabTree: React.FC<TabTreeProps> = props => {
: [...expandkeys, node.key],
);
})
.catch(() => {});
.catch(() => { });
return false;
}
}
......
......@@ -36,7 +36,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
Object.values(buttonTextFieldMap).filter(Boolean).length > 2
?
<>
<AuthButton btnCode={buttonPermissionsMap[keyNames[0]]} menuCode={menuCode}>
<AuthButton btnCode={buttonPermissionsMap ? buttonPermissionsMap[keyNames[0]] : 'DevTest'} menuCode={menuCode}>
<Button type='link' onClick={operationHandler[keyNames[0]]}>{keyNames[0]}</Button>
</AuthButton>
......@@ -45,7 +45,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
{
keyNames.slice(1, keyNames.length).map((item, i) => buttonTextFieldMap[item] ? (
<Menu.Item key={`menuItem${i}`}>
<AuthButton btnCode={buttonPermissionsMap[item]} menuCode={menuCode}>
<AuthButton btnCode={buttonPermissionsMap ? buttonPermissionsMap[item] : 'DevTest'} menuCode={menuCode}>
<Button type='link' onClick={operationHandler[item]}>{item}</Button>
</AuthButton>
</Menu.Item>
......@@ -59,7 +59,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
</Dropdown>
</>
:
keyNames.map((item, i) => (buttonTextFieldMap[item] ? <AuthButton btnCode={buttonPermissionsMap[item]} menuCode={menuCode}><Button key={`btnItem${i}`} type='link' onClick={operationHandler[item]}>{item}</Button></AuthButton> : null))
keyNames.map((item, i) => (buttonTextFieldMap[item] ? <AuthButton btnCode={buttonPermissionsMap ? buttonPermissionsMap[item] : 'DevTest'} menuCode={menuCode}><Button key={`btnItem${i}`} type='link' onClick={operationHandler[item]}>{item}</Button></AuthButton> : null))
}
</>)
}
......
......@@ -123,7 +123,7 @@ export default {
'purchaseOrder.orderCollect.schema.buyerMemberMajorId': 'Purchase Member',
'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh': 'Please enter the search purchasing member',
'purchaseOrder.orderCollect.memberSchema.placeholder': 'Please enter the name of the member',
'purchaseOrder.orderCollect.model.message': 'Please select a supply member first',
'purchaseOrder.orderCollect.model.message': 'Please select supply member and adapt mall first',
'purchaseOrder.orderCollect.model.message1': 'Please select purchase inquiry contract first',
'purchaseOrder.orderCollect.model.message2': 'Please select a purchasing member first',
'purchaseOrder.orderCollect.model.button1': 'Select order item',
......@@ -335,6 +335,7 @@ export default {
'purchaseOrder.shifouquerenshen': 'Whether to confirm the review of the warehouse receipt number is',
'purchaseOrder.decaigouruku': 'Purchase receipt order?',
'saleOrder.daochuerweima': 'Export qr Code',
'saleOrder.tijiaoshenhe': 'Submit for review',
'saleOrder.qinggouxuanyaoshen': 'Please check the order to be reviewed',
'saleOrder.piliangtijiaoshen': 'Batch submission for review',
......
......@@ -123,7 +123,7 @@ export default {
'purchaseOrder.orderCollect.schema.buyerMemberMajorId': '구매 회원',
'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh': '구매 회원 검색 입력',
'purchaseOrder.orderCollect.memberSchema.placeholder': '회원 이름 입력',
'purchaseOrder.orderCollect.model.message': '우선 공급 회원을 선택하세요',
'purchaseOrder.orderCollect.model.message': '공급회원제와 쇼핑몰에 적합한 상품을 먼저 선택하십시오',
'purchaseOrder.orderCollect.model.message1': '먼저 구매 문의 계약을 선택하세요',
'purchaseOrder.orderCollect.model.message2': '먼저 구매 회원을 선택하세요',
'purchaseOrder.orderCollect.model.button1': '주문 품목 선택',
......@@ -335,6 +335,7 @@ export default {
'purchaseOrder.shifouquerenshen': '감사 입고 양식 번호가',
'purchaseOrder.decaigouruku': '의 구매 입고서?',
'saleOrder.daochuerweima': 'qr 코드를 내보내다',
'saleOrder.tijiaoshenhe': '제출 심사',
'saleOrder.qinggouxuanyaoshen': '검토할 주문을 선택하십시오.',
'saleOrder.piliangtijiaoshen': '대량 제출 심사',
......
......@@ -123,7 +123,7 @@ export default {
'purchaseOrder.orderCollect.schema.buyerMemberMajorId': '采购会员',
'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh': '请输入搜索采购会员',
'purchaseOrder.orderCollect.memberSchema.placeholder': '请输入会员名称',
'purchaseOrder.orderCollect.model.message': '请先选择供应会员',
'purchaseOrder.orderCollect.model.message': '请先选择供应会员和适应商城',
'purchaseOrder.orderCollect.model.message1': '请先选择采购询价合同',
'purchaseOrder.orderCollect.model.message2': '请先选择采购会员',
'purchaseOrder.orderCollect.model.button1': '选择订单商品',
......@@ -335,6 +335,7 @@ export default {
'purchaseOrder.shifouquerenshen': '是否确认审核入库单号为',
'purchaseOrder.decaigouruku': '的采购入库单?',
'saleOrder.daochuerweima': '导出二维码',
'saleOrder.tijiaoshenhe': '提交审核',
'saleOrder.qinggouxuanyaoshen': '请勾选要审核的订单',
'saleOrder.piliangtijiaoshen': '批量提交审核',
......
......@@ -35,6 +35,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
const loadingTableData = async (params) => {
const _params = { ...params, ...searchParams }
const { data } = await getSettleAccountsBusinessReconciliationToReconciliationList(_params)
setDataSource(data);
return data;
}
......@@ -53,7 +54,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
title: intl.formatMessage({ id: 'balance.fahuopici' }),
key: 'deliveryBatch',
dataIndex: 'deliveryBatch',
// render: (text: any, record: any) => `第${text}批`,
render: (text: any, record: any) => `第${text}批`,
}, {
title: intl.formatMessage({ id: 'balance.fahuodanhao' }),
key: 'deliveryNo',
......@@ -343,7 +344,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
selectedRows.forEach((item) => {
item.products.forEach((child) => {
if (childSelectedRowKeys.includes(child.productId)) {
_rows.push({ ...child, orderId: item.billId, orderNo: item.billNo, expectPayTime: formatTimeString(child?.expectPayTime, 'YYYY-MM-DD') });
_rows.push({ ...child, ...item, orderId: item.billId, orderNo: item.billNo, expectPayTime: formatTimeString(child?.expectPayTime, 'YYYY-MM-DD') });
}
})
})
......@@ -351,6 +352,17 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
onOk?.(_rows);
}
useEffect(() => {
if (visible) {
ref?.current?.reload();
}else{
setChildSelectedRowKeys([]);
setSelectedRowKeys([]);
setChildSelectedRows([]);
setSelectedRows([]);
}
}, [visible])
return (
<Drawer
title={intl.formatMessage({ id: 'balance.xuanzedaiduizhangmingxi' })}
......@@ -437,7 +449,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
},
},
properties: {
"batch": {
"deliveryBatch": {
type: 'string',
"x-component-props": {
placeholder: intl.formatMessage({ id: 'balance.qingshurufahuopici' }),
......
......@@ -26,7 +26,7 @@ const TABLINK = [
{ id: 'billLayout', title: intl.formatMessage({ id: 'balance.duizhangdanmingxi' }) },
{ id: 'fileLayout', title: intl.formatMessage({ id: 'balance.fujian' }), },
{ id: 'invoiceLayout', title: intl.formatMessage({ id: 'balance.fapiaoxinxi' }), },
{ id: 'recordLayout', title: '流转记录'}
{ id: 'recordLayout', title: '流转记录' }
]
const SearchDetail = () => {
......@@ -108,88 +108,109 @@ const SearchDetail = () => {
title: '订单号',
key: 'orderNo',
dataIndex: 'orderNo',
fixed: 'left',
width: 100
},
{
title: '预计结算日期',
key: 'settlementDate',
dataIndex: 'settlementDate',
key: 'expectPayTime',
dataIndex: 'expectPayTime',
width: 150
},
{
title: '发货批次',
key: 'deliveryBatch',
dataIndex: 'deliveryBatch',
width: 150
},
{
title: '发货单号',
key: 'deliveryNo',
dataIndex: 'deliveryNo',
width: 150
},
{
title: '收货单号',
key: 'receiveNo',
dataIndex: 'receiveNo',
width: 150
},
{
title: '物料编码',
key: 'productNo',
dataIndex: 'productNo',
width: 150
},
{
title: '物料名称',
key: 'productName',
dataIndex: 'productName',
width: 150
},
{
title: '规格型号',
key: 'spec',
dataIndex: 'spec',
width: 150
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
width: 150
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
width: 150
},
{
title: '单位',
key: 'unit',
dataIndex: 'unit',
width: 150
},
{
title: '税率',
title: '含税/税率',
key: 'taxRate',
dataIndex: 'taxRate',
width: 150,
render: (text: any) => {
return text > 0 ? `是/${text}%` : '否';
}
},
{
title: '单价(含税)',
key: 'price',
dataIndex: 'price',
width: 150,
render: (text: any) => ${priceFormat(text)}`
},
{
title: '待对账数量',
key: 'reconciliationQuantity',
dataIndex: 'reconciliationQuantity',
width: 150
},
{
title: '待对账金额(含税)',
key: 'reconciliationMoneyAmount',
dataIndex: 'reconciliationMoneyAmount',
width: 150,
render: (text: any) => ${priceFormat(text)}`
},
{
title: '本次对账数量',
key: 'currentReconciliationQuantity',
dataIndex: 'currentReconciliationQuantity',
width: 150
},
{
title: '本次对账金额(含税)',
key: 'currentMoney',
dataIndex: 'currentMoney',
width: 150,
render: (text: any) => ${priceFormat(text)}`
},
];
......@@ -217,7 +238,7 @@ const SearchDetail = () => {
keepAlive={false}
currentRef={currentRef}
columns={columns}
tableProps={{ rowKey: 'reconciliationRowId' }}
tableProps={{ rowKey: 'reconciliationRowId', scroll: { x: 2600 } }}
fetchTableData={(params: any) => loadingTableData(params)}
/>
</Card>
......
......@@ -29,7 +29,6 @@ const TABLINK = [
]
const Add = () => {
console.log(history)
const {
query: {
id,
......@@ -47,6 +46,7 @@ const Add = () => {
const [drawerVisible, setDrawerVisible] = useState<boolean>(false);
const [unsaved, setUnsaved] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const [buyerData, setBuyerData] = useState<any>({});
const filesRef = useRef<any>({});
const _tabs = useMemo(() => {
......@@ -120,7 +120,7 @@ const Add = () => {
const data = res.data.data;
let _fields = {}
for (let key in data) {
_fields[`currentReconciliationQuantity_${key}`] = data[key]['currentReconciliationQuantity']
_fields[`currentReconciliationQuantity_${data[key].orderNo}_${data[key].productId}`] = data[key]['currentReconciliationQuantity']
}
form.setFieldsValue(_fields);
setTabelSource(data);
......@@ -137,6 +137,7 @@ const Add = () => {
const data = res.data;
setDataSource(data);
setTabelSource(data.rows);
setBuyerData({ buyerMemberId: state?.rows?.[0]?.buyerMemberId, buyerRoleId: state?.rows?.[0]?.buyerRoleId })
}
})
} else {
......@@ -161,9 +162,10 @@ const Add = () => {
}
/** 删除列表 */
const handleRemove = (index: number) => {
const handleRemove = (index: number, record: any) => {
const data = [...tabelSource];
data.splice(index, 1);
form.setFieldsValue({ [`currentReconciliationQuantity_${record.orderNo}_${record.productId}`]: null });
setTabelSource(data)
}
......@@ -183,7 +185,7 @@ const Add = () => {
key: 'deliveryBatch',
dataIndex: 'deliveryBatch',
width: 100,
// render: (text: any, record: any) => `第${text}批`,
render: (text: any, record: any) => `第${text}批`,
}, {
title: intl.formatMessage({ id: 'balance.fahuodanhao' }),
key: 'deliveryNo',
......@@ -246,7 +248,7 @@ const Add = () => {
render: (text: any, record: any, index: number) => (
_editAble ? (
<Form.Item
name={`currentReconciliationQuantity_${index}`}
name={`currentReconciliationQuantity_${record.orderNo}_${record.productId}`}
style={{ margin: 0 }}
rules={[
{ required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) }
......@@ -271,7 +273,7 @@ const Add = () => {
fixed: 'right',
width: 100,
render: (text: any, record: any, index: number) => (
<Button type='link' onClick={() => { handleRemove(index) }}>
<Button type='link' onClick={() => { handleRemove(index, record) }}>
{intl.formatMessage({ id: 'balance.shanchu' })}
</Button>
)
......@@ -313,6 +315,8 @@ const Add = () => {
_params.payer = dataSource.payer;
_params.payee = dataSource.payee;
_params.launchReconciliation = dataSource.launchReconciliation;
_params.buyerMemberId = buyerData.buyerMemberId;
_params.buyerRoleId = buyerData.buyerRoleId;
} else {
_params.reconciliationId = id;
}
......@@ -393,14 +397,14 @@ const Add = () => {
</Button> : null}
<Table dataSource={tabelSource} columns={_editAble ? columnsEdit : columns} scroll={{ x: 1300 }} pagination={false} />
</Card>
<BusinessFileLayout fetchdata={[]} currentRef={filesRef} editAble={_editAble} />
<BusinessFileLayout fetchdata={dataSource?.files} currentRef={filesRef} editAble={_editAble} />
<DetailDrawer
searchParams={
{
payer: dataSource.payer,
payee: dataSource.payee,
// payee: dataSource.payee,
taxRate: tabelSource?.[0]?.taxRate || '',
ids: ids?.join(',') || ''
ids: ids
}
}
visible={drawerVisible}
......
......@@ -14,7 +14,7 @@ import { priceFormat } from '@/utils/numberFomat'
import { createFormActions } from '@formily/antd'
import { getIntl, history, Link } from 'umi';
import { getSettleAccountsBusinessReconciliationToSaveReconciliationList, postSettleAccountsBusinessReconciliationSubmitReconciliation, postSettleAccountsBusinessReconciliationDeleteReconciliation } from '@/services/SettleV2Api'
import { postSettleAccountsBusinessReconciliationToSaveReconciliationList, postSettleAccountsBusinessReconciliationSubmitReconciliation, postSettleAccountsBusinessReconciliationDeleteReconciliation } from '@/services/SettleV2Api'
const intl = getIntl();
......@@ -34,7 +34,7 @@ const ReadyAdd: React.FC = () => {
if (params.createTimeEnd) {
_params.createTimeEnd = formatTimeString(Number(params.createTimeEnd), 'YYYY-MM-DD');
}
const { data } = await getSettleAccountsBusinessReconciliationToSaveReconciliationList(_params)
const { data } = await postSettleAccountsBusinessReconciliationToSaveReconciliationList(_params)
return data
}
......@@ -72,8 +72,8 @@ const ReadyAdd: React.FC = () => {
width: 180
}, {
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
key: 'statusName',
dataIndex: 'statusName',
render: (text: any) => <StatusTag type='primary' title={text} />
},
{
......@@ -81,7 +81,7 @@ const ReadyAdd: React.FC = () => {
dataIndex: 'operate',
align: 'center',
render: (text: any, record: any) => <>
{record.button === 1 && <Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })} onConfirm={() => fetchSubmitBatch(record.reconciliationId)}>
{record.status === 1 && <Popconfirm title={intl.formatMessage({ id: 'balance.quedingyaotijiaoma' })} okText={intl.formatMessage({ id: 'balance.shi' })} cancelText={intl.formatMessage({ id: 'balance.fou' })} onConfirm={() => fetchSubmitBatch(record.reconciliationId)}>
<Button type='link'>
{intl.formatMessage({ id: 'balance.tijiao' })}
</Button>
......@@ -100,15 +100,15 @@ const ReadyAdd: React.FC = () => {
}];
const fetchSubmitBatch = (id: number) => {
postSettleAccountsBusinessReconciliationSubmitReconciliation({ reconciliationId: id }).then((res) => {
postSettleAccountsBusinessReconciliationSubmitReconciliation({ id }).then((res) => {
if (res.code === 1000) {
ref.current.reload();
}
})
}
const fetchDelete = (id: string) => {
postSettleAccountsBusinessReconciliationDeleteReconciliation({ id: id }).then((res) => {
const fetchDelete = (id: number) => {
postSettleAccountsBusinessReconciliationDeleteReconciliation({ id }).then((res) => {
if (res.code === 1000) {
ref.current.reload();
}
......
......@@ -55,7 +55,7 @@ const ReadyReconciliation: React.FC = () => {
title: intl.formatMessage({ id: 'balance.fahuopici' }),
key: 'deliveryBatch',
dataIndex: 'deliveryBatch',
// render: (text: any, record: any) => `第${text}批`,
render: (text: any, record: any) => `第${text}批`,
}, {
title: intl.formatMessage({ id: 'balance.fahuodanhao' }),
key: 'deliveryNo',
......
......@@ -76,8 +76,8 @@ const Search: React.FC = () => {
width: 180
}, {
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
key: 'statusName',
dataIndex: 'statusName',
render: (text: any) => <StatusTag type='primary' title={text} />
}];
......
......@@ -17,7 +17,7 @@ const { onFieldChange$ } = FormEffectHooks;
export interface IProps {
title: string,
visible: boolean,
id: number,
id: any,
onCancel?: () => void,
onOk?: () => void,
fetch?: () => Promise<unknown>,
......@@ -38,8 +38,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
const useFormEffects = () => {
onFieldChange$('state').subscribe(({ value }) => {
actions.setFieldState('auditOpinion', state => {
onFieldChange$('isConfirm').subscribe(({ value }) => {
actions.setFieldState('reason', state => {
if (value == 1) {
state.visible = false
} else {
......@@ -60,7 +60,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
{ label: intl.formatMessage({ id: 'detail.purchase.message86' }), value: 1 },
{ label: intl.formatMessage({ id: 'detail.purchase.message87' }), value: 0 }
]}
name='state'
name='isConfirm'
required
x-component="Radio"
x-component-props={{}}
......@@ -78,9 +78,9 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
setConfirmLoading(true);
let value = { ...val }
let params: any = {}
params.state = value.state;
value.state !== 1 && (params.auditOpinion = value.auditOpinion);
fetch({ id, ...params }).then(res => {
params.isConfirm = value.isConfirm;
value.isConfirm !== 1 && (params.reason = value.reason);
fetch({ reconciliationId: id, ...params }).then(res => {
if (res.code === 1000) {
onOk && onOk()
}
......@@ -120,14 +120,14 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
effects={() => useFormEffects()}
onSubmit={(values) => handleSubmit(values)}
initialValues={{
state: 1,
isConfirm: 1,
status: 1
}}
>
{modalNode()}
<Field
title={modalText()}
name={'auditOpinion'}
name={'reason'}
x-component="TextArea"
required
x-component-props={{
......
......@@ -12,10 +12,10 @@ import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import { getSettleAccountsBusinessReconciliationTeamworkConfirmReconciliationList } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd'
import { getIntl } from 'umi';
import { getIntl, Link } from 'umi';
const intl = getIntl();
const { Link, Text } = Typography;
const { Text } = Typography;
// 对账单查询
......@@ -42,8 +42,8 @@ const ReadyConfirm: React.FC = () => {
title: intl.formatMessage({ id: 'balance.duizhangdanhao' }),
key: 'reconciliationNo',
dataIndex: 'reconciliationNo',
render: (text: any) => (
<Link>{text}</Link>
render: (text: any, record: any) => (
<Link to={`readyConfirm/preview?id=${record.reconciliationId}&no=${text}`}>{text}</Link>
)
}, {
title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
......@@ -78,7 +78,7 @@ const ReadyConfirm: React.FC = () => {
title: intl.formatMessage({ id: 'balance.caozuo' }),
key: 'operate',
dataIndex: 'operate',
render: (text: any) => <Button type='link'>{intl.formatMessage({ id: 'balance.queren' })}</Button>
render: (text: any, record: any) => <Link to={`readyConfirm/detail?id=${record.reconciliationId}&no=${text}`}>{intl.formatMessage({ id: 'balance.queren' })}</Link>
}];
return (
......
......@@ -12,10 +12,10 @@ import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import { getSettleAccountsBusinessReconciliationTeamworkTobeApplyamountList } from '@/services/SettleV2Api'
import { createFormActions } from '@formily/antd'
import { getIntl } from 'umi';
import { getIntl, Link } from 'umi';
const intl = getIntl();
const { Link, Text } = Typography;
const { Text } = Typography;
// 待请款
......@@ -39,14 +39,14 @@ const ReadyPay: React.FC = () => {
}
const columns: ColumnType<any>[] = [{
title: intl.formatMessage({id: 'balance.duizhangdanhao'}),
title: intl.formatMessage({ id: 'balance.duizhangdanhao' }),
key: 'reconciliationNo',
dataIndex: 'reconciliationNo',
render: (text: any, record: any) => (
<Link>{text}</Link>
<Link to={`readyPay/preview?id=${record.reconciliationId}&no=${text}`}>{text}</Link>
)
}, {
title: intl.formatMessage({id: 'balance.danjuzhaiyao'}),
title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
key: 'reconciliationAbstract',
dataIndex: 'reconciliationAbstract',
render: (text: any, record: any) => (
......@@ -55,30 +55,30 @@ const ReadyPay: React.FC = () => {
</Space>
)
}, {
title: intl.formatMessage({id: 'balance.shoukuanfang'}),
title: intl.formatMessage({ id: 'balance.shoukuanfang' }),
key: 'payee',
dataIndex: 'payee',
}, {
title: intl.formatMessage({id: 'balance.duizhangzongjinehanshui'}),
title: intl.formatMessage({ id: 'balance.duizhangzongjinehanshui' }),
key: 'reconciliationMoneyAmount',
dataIndex: 'reconciliationMoneyAmount',
render: (text: any, record: any) => ${priceFormat(text)}`,
}, {
title: intl.formatMessage({id: 'balance.danjushijian'}),
title: intl.formatMessage({ id: 'balance.danjushijian' }),
key: 'createTime',
dataIndex: 'createTime',
render: (text: any, record: any) => formatTimeString(text, 'YYYY-MM-DD HH:mm'),
width: 180
}, {
title: intl.formatMessage({id: 'balance.waibuzhuangtai'}),
title: intl.formatMessage({ id: 'balance.waibuzhuangtai' }),
key: 'status',
dataIndex: 'status',
render: (text: any, record: any) => <StatusTag type='primary' title={text} />
}, {
title: intl.formatMessage({id: 'balance.caozuo'}),
title: intl.formatMessage({ id: 'balance.caozuo' }),
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => <Button type='link'>{intl.formatMessage({id: 'balance.qingkuan'})}</Button>
render: (text: any, record: any) => <Link to={`readyPay/detail?id=${record.reconciliationId}&no=${text}`}>{intl.formatMessage({ id: 'balance.qingkuan' })}</Link>
}];
return (
......@@ -115,7 +115,7 @@ const ReadyPay: React.FC = () => {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruduizhangdanhao'}),
placeholder: intl.formatMessage({ id: 'balance.qingshuruduizhangdanhao' }),
align: 'flex-start',
allowClear: true,
},
......@@ -138,14 +138,14 @@ const ReadyPay: React.FC = () => {
"reconciliationAbstract": {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'balance.qingshuruduizhangdanzhaiyao'}),
placeholder: intl.formatMessage({ id: 'balance.qingshuruduizhangdanzhaiyao' }),
allowClear: true,
}
},
"payee": {
type: 'string',
"x-component-props": {
placeholder: intl.formatMessage({id: 'balance.qingshurushoukuanfang'}),
placeholder: intl.formatMessage({ id: 'balance.qingshurushoukuanfang' }),
allowClear: true,
}
},
......@@ -153,14 +153,14 @@ const ReadyPay: React.FC = () => {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: intl.formatMessage({id: 'balance.danjushijianquanbu'}),
placeholder: intl.formatMessage({ id: 'balance.danjushijianquanbu' }),
allowClear: true,
}
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: intl.formatMessage({id: 'balance.chaxun'}),
children: intl.formatMessage({ id: 'balance.chaxun' }),
},
},
},
......
......@@ -47,7 +47,7 @@ const Search: React.FC = () => {
key: 'reconciliationNo',
dataIndex: 'reconciliationNo',
render: (text: any, record: any) => (
<Link to={`search/preview?id=${record.id}`}>{text}</Link>
<Link to={`search/preview?id=${record.reconciliationId}&no=${text}`}>{text}</Link>
)
}, {
title: intl.formatMessage({ id: 'balance.danjuzhaiyao' }),
......
import React, { useEffect, useState, useMemo, useRef } from 'react';
import { Form, Button, Row, Col, Input, Select, DatePicker, Radio, Table, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { CheckCircleOutlined, PlusOutlined, LinkOutlined } from '@ant-design/icons';
import { getIntl, history, Prompt } from 'umi';
import { GlobalConfig } from '@/global/config'
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat';
import StatusTag from '@/components/StatusTag';
import { getSettleAccountsBusinessReconciliationDetailReconciliation, getSettleAccountsBusinessReconciliationReconciliationRowList, postSettleAccountsBusinessReconciliationUpdateReconciliation, postSettleAccountsBusinessReconciliationSaveReconciliation, postSettleAccountsBusinessReconciliationGenerateReconciliation } from '@/services/SettleV2Api'
import PeripheralLayout from '@/pages/transaction/purchaseAbility/components/detail';
import Card from '@/pages/transaction/purchaseAbility/components/card';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 24 },
labelAlign: "left"
}
const intl = getIntl();
const TABLINK = [
{ id: 'basicLayout', title: intl.formatMessage({ id: 'balance.jibenxinxi' }) },
{ id: 'billLayout', title: '请款明细' },
]
const Add = () => {
const {
query: {
id,
no
},
pathname,
} = history.location;
const [form] = Form.useForm();
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [dataSource, setDataSource] = useState<any>({});
const [tabelSource, setTabelSource] = useState<any>([]);
const [ids, setIds] = useState<any>([]);
const [drawerVisible, setDrawerVisible] = useState<boolean>(false);
const [unsaved, setUnsaved] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const [buyerData, setBuyerData] = useState<any>({});
const filesRef = useRef<any>({});
const _tabs = useMemo(() => {
let _list = [];
TABLINK.forEach((item) => {
_list.push(item)
})
return _list;
}, [pathPci])
const _title = useMemo(() => {
switch (path) {
case 'add': return '新增请款单';
case 'edit': return '对账单请款';
}
}, [path])
const _editAble = useMemo(() => {
return path !== 'preview';
}, [path])
const _returnTopButton = () => {
return (
<Button type='primary' loading={submitLoading} icon={<CheckCircleOutlined />} >{intl.formatMessage({ id: 'balance.baocun' })}</Button>
)
}
return (
<div style={{ margin: '-24px -24px 0' }}>
<PeripheralLayout
no={_title}
tabLink={_tabs}
effect={_editAble && _returnTopButton()}
components={
<Form
{...layout}
form={form}
>
<Card id='basicLayout' title={intl.formatMessage({ id: 'balance.jibenxinxi' })}>
<Row gutter={[8, 8]} justify="space-between">
<Col span={11}>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='单据摘要'
name='reconciliationAbstract'
rules={[{ required: true, message: '请输入单据摘要' }]}
>
<Input placeholder={'请输入单据摘要'} maxLength={60} />
</Form.Item></Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='请款类型'
name='reconciliationtype'
rules={[{ required: true, message: '请选择请款类型' }]}
>
<Select placeholder={'请选择请款类型'} />
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='预计付款日期'
name='reconciliationDate'
rules={[{ required: true, message: '请选择预计付款日期' }]}
>
<DatePicker placeholder={'请选择预计付款日期'} style={{ width: '100%' }} />
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='付款方式'
name='reconciliationWay'
rules={[{ required: true, message: '请选择付款方式' }]}
>
<Radio.Group>
<Radio.Button value="1">现结</Radio.Button>
<Radio.Button value="2">月结</Radio.Button>
<Radio.Button value="3">帐期(按天)</Radio.Button>
<Radio.Button value="4">帐期(按月)</Radio.Button>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='支付方式'
name='reconciliationtPayWay'
rules={[{ required: true, message: '请选择支付方式' }]}
>
<Select placeholder={'请选择支付方式'} />
</Form.Item>
</Col>
</Row>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='请款备注'
name='remarks'
rules={[{ required: true, message: '请输入请款备注' }]}
>
<Input placeholder={'请输入请款备注'} maxLength={80} />
</Form.Item>
</Col>
</Row>
</Col>
<Col span={11}>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='收款方'
>
<Input readOnly maxLength={80} addonAfter={<Button type='primary' icon={<LinkOutlined />} />} />
</Form.Item>
</Col>
</Row>
<Row>
<Form.Item
label='账号名称'
>
广州白马家具交易中心
</Form.Item>
</Row>
<Row>
<Form.Item
label='银行账号'
>
6214 7812 3456 7891 1234
</Form.Item>
</Row>
<Row>
<Form.Item
label='开户行'
>
中国建设银行广州市分行营业部
</Form.Item>
</Row>
<Row>
<Form.Item
label='请款金额'
>
¥ 10,000.00
</Form.Item>
</Row>
</Col>
</Row>
</Card>
<Card id='billLayout' title={'请款明细'}>
{_editAble ? <>
<Row gutter={[8, 8]}>
<Col span={24}>
<Form.Item
label='单据类型'
name='reconciliationWay'
rules={[{ required: true, message: '请选择单据类型' }]}
>
<Radio.Group>
<Radio value="1">待请款单据</Radio>
<Radio value="2">待请款合同</Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Button
type='dashed'
block
style={{
marginBottom: '24px',
}}
onClick={() => { setDrawerVisible(true) }}
>
<PlusOutlined />
{intl.formatMessage({ id: 'balance.xuanze' })}
</Button>
</> : null}
<Table dataSource={tabelSource} columns={[]} scroll={{ x: 1300 }} pagination={false} />
</Card>
</Form>
}
/>
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' }, { default: '您还有未保存的内容,是否确定要离开?' })} />
</div>
)
}
export default Add;
......@@ -34,7 +34,7 @@ const SearchDetail = () => {
} = history.location;
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [writeOffVisible, setWriteOffVisible] = useState<any>({});
const [writeOffVisible, setWriteOffVisible] = useState<any>(false);
const [dataSource, setDataSource] = useState<any>({});
const currentRef = useRef({});
const [basicEffect, setBasicEffect] = useState<any>([
......
......@@ -45,7 +45,7 @@ const RecordLayout: React.FC<ProgressProps> = (props: any) => {
title: intl.formatMessage({ id: 'table.purchase.status' }),
key: 'status',
dataIndex: 'status',
render: (_text: any, _record: any) => <StatusTag type='primary' title={_record.stateName} />
render: (_text: any, _record: any) => <StatusTag type='primary' title={_text} />
},
{
title: intl.formatMessage({ id: 'table.purchase.operate' }),
......
......@@ -124,7 +124,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
}, {}))
// 遍历 排空
let resultParams = _resultParams.filter((_item: any) => _item.customerAttributeValueList.length != 0)
let resultParams = _resultParams.filter((_item: any) => (_item.customerAttributeValueList.length != 0 && _item.customerAttributeValueList[0]['value'] !== ''))
setProductSelectAttribute(resultParams)
}
......
......@@ -36,6 +36,7 @@ import PutawayGuide from './components/putawayGuide'
import { useRowSelectionTable, useRowSelectionTableCtl } from '@/hooks/useRowSelectionTable'
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
import allRouters from '../../../../config/router.config.json'
const { confirm } = Modal;
......
......@@ -10,6 +10,8 @@ import NiceForm from '@/components/NiceForm';
import styles from './index.less';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { getManageMemberCategoryAll, getManageMemberCategoryGet, postManageMemberCategoryAdd, postManageMemberCategoryDelete, postManageMemberCategoryUpdate } from '@/services/ManageV2Api';
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
enum FormState {
FREE, // 空闲状态
......@@ -32,9 +34,9 @@ type TreeDataType = {
* @param level
* @returns
*/
const transferTreeData = (treeData: any, level: string, checkedKeys): TreeDataType[] => {
const transferTreeData = (treeData: any, level: string, checkedKeys): TreeDataType[] => {
let res: TreeDataType[] = [];
for(let i = 0; i < treeData.length; i++) {
for (let i = 0; i < treeData.length; i++) {
const item = treeData[i];
const key = level + item.id
let result: TreeDataType = {
......@@ -45,10 +47,10 @@ type TreeDataType = {
parentId: item.parentId,
children: [],
}
if(item.status) {
if (item.status) {
checkedKeys.push(key);
}
if(item.list.length !== 0) {
if (item.list.length !== 0) {
result.children = transferTreeData(item.list as any, key + "-", checkedKeys);
}
res.push(result)
......@@ -91,7 +93,7 @@ const ClassProperty: React.FC<{}> = () => {
const transferTreeDatarRes: TreeDataType[] = useMemo(() => transferTreeData(treeData, "", tempCheckedKeys), [treeData])
// const checkedKeys = useMemo(() => tempCheckedKeys, [transferTreeDatarRes])
const formInitValue = (nodeRecord && treeStatus === FormState.EDIT) ? getTreeMaps(nodeRecord.key) : {}
const formValue = formInitValue ? {...formInitValue, status: [formInitValue.status]} : {}
const formValue = formInitValue ? { ...formInitValue, status: [formInitValue.status] } : {}
const is3Level = useMemo(() => {
if (!nodeRecord || nodeRecord.parentId === 0) {
......@@ -102,7 +104,7 @@ const ClassProperty: React.FC<{}> = () => {
const splitRes = _key.split("-");
let flag = splitRes.length;
let i = 1;
for ( ; i <= splitRes.length; i++) {
for (; i <= splitRes.length; i++) {
if (splitRes[i - 1] === parentId?.toString()) {
console.log(i);
flag = i + 1;
......@@ -112,7 +114,7 @@ const ClassProperty: React.FC<{}> = () => {
return flag
}, [nodeRecord])
const onFinish = async (values: {id: number, parentId: number, name: string, describe: string, status: string[], level: number}) => {
const onFinish = async (values: { id: number, parentId: number, name: string, describe: string, status: string[], level: number }) => {
const _key = nodeRecord?._key?.split("-");
const isEdit = treeStatus === FormState.EDIT;
let parentId = nodeRecord?.parentId || 0;
......@@ -152,7 +154,7 @@ const ClassProperty: React.FC<{}> = () => {
useEffect(() => {
// 这里有个奇怪的地方,不知道为什么要医疗nodeRecord
if (treeStatus === FormState.ADD && is3Level === 3 || is3Level === 4) {
if (treeStatus === FormState.ADD && is3Level === 3 || is3Level === 4) {
formActions.setFieldValue("level", 3);
}
}, [treeStatus, nodeRecord, is3Level])
......@@ -165,8 +167,8 @@ const ClassProperty: React.FC<{}> = () => {
<h3 className="mb-30">{intl.formatMessage({ id: 'content.category.selectEditProject' })}</h3>
{
treeData && treeData.length > 0
? <TabTree
fetchData = {params => fetchClassTreeData(params)}
? <TabTree
fetchData={params => fetchClassTreeData(params)}
treeData={transferTreeDatarRes}
toolsRender={toolsRender}
actions={treeActions}
......@@ -191,12 +193,12 @@ const ClassProperty: React.FC<{}> = () => {
name='classForm'
onSubmit={onFinish}
actions={formActions}
effects={($, action)=> {}}
effects={($, action) => { }}
schema={classSchema()}
expressionScope={{
showWarn: (
<Tooltip placement="topLeft" title={intl.formatMessage({ id: 'content.category.handleTips' })}>
<span style={{marginTop: '-12px', width: '50px'}}>
<span style={{ marginTop: '-12px', width: '50px' }}>
<QuestionCircleOutlined />
</span>
</Tooltip>
......@@ -204,21 +206,27 @@ const ClassProperty: React.FC<{}> = () => {
}}
>
<FormButtonGroup>
<Button htmlType='submit' type="primary" >
{intl.formatMessage({ id: 'common.button.save' })}
</Button>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
okText={intl.formatMessage({ id: 'common.button.yes' })}
cancelText={intl.formatMessage({ id: 'common.button.no' })}
onConfirm={handleDeleteMenu}
>
{
treeStatus !== FormState.ADD && <Button >
{intl.formatMessage({ id: 'common.button.delete' })}
</Button>
}
</Popconfirm>
<AuthButton btnCode='category.edit' menuCode='contentAbility'>
<Button htmlType='submit' type="primary" >
{intl.formatMessage({ id: 'common.button.save' })}
</Button>
</AuthButton>
<AuthButton btnCode='category.del' menuCode='contentAbility'>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
okText={intl.formatMessage({ id: 'common.button.yes' })}
cancelText={intl.formatMessage({ id: 'common.button.no' })}
onConfirm={handleDeleteMenu}
>
{
treeStatus !== FormState.ADD && <Button >
{intl.formatMessage({ id: 'common.button.delete' })}
</Button>
}
</Popconfirm>
</AuthButton>
</FormButtonGroup>
</NiceForm>
</>
......
import React, { useRef } from 'react';
import { Card, Button, Popconfirm, Row, Col } from 'antd';
import { Card, Button, Popconfirm, Row, Col } from 'antd';
import { createFormActions, ISchema } from '@formily/antd';
import { history, useIntl } from 'umi';
import StatusSwitch from '@/components/StatusSwitch';
......@@ -12,6 +12,8 @@ import EyePreview from '@/components/EyePreview'
import StandardTable from '@/components/StandardTable';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { getManageMemberColumnPage, postManageMemberColumnDelete, postManageMemberColumnUpdateStatus } from '@/services/ManageV2Api';
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const formActions = createFormActions();
......@@ -63,13 +65,13 @@ const columnList: React.FC<{}> = () => {
ref.current.reload()
}
// 栏目删除
const handleRemove = async (id: number) => {
// 栏目删除
const handleRemove = async (id: number) => {
const res = await postManageMemberColumnDelete({ id })
if (res.code === 1000) {
ref.current.reload()
}
}
}
// 获取列表
const fetchData = (params: any) => {
......@@ -91,7 +93,7 @@ const columnList: React.FC<{}> = () => {
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => (
<EyePreview url={`/memberCenter/contentAbility/columnsManagement/detail?id=${record.id}&preview=1`}>
<EyePreview type={AuthUrl('columnsManagement.see', 'contentAbility') ? 'link' : 'button'} url={`/memberCenter/contentAbility/columnsManagement/detail?id=${record.id}&preview=1`}>
{text}
</EyePreview>
)
......@@ -115,11 +117,14 @@ const columnList: React.FC<{}> = () => {
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => (
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleModify(record)}
record={record}
/>
<AuthButton btnCode='columnsManagement.state' menuCode='contentAbility'>
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleModify(record)}
record={record}
/>
</AuthButton>
)
},
{
......@@ -129,13 +134,19 @@ const columnList: React.FC<{}> = () => {
dataIndex: 'operate',
render: (_, record) => !record.status && (
<>
<Button type='link' onClick={() => history.push(`/memberCenter/contentAbility/columnsManagement/detail?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleRemove(record.id)}
>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
<AuthButton btnCode='columnsManagement.edit' menuCode='contentAbility'>
<Button type='link' onClick={() => history.push(`/memberCenter/contentAbility/columnsManagement/detail?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
</AuthButton>
<AuthButton btnCode='columnsManagement.del' menuCode='contentAbility'>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleRemove(record.id)}
>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
</AuthButton>
</>
)
}
......@@ -143,17 +154,20 @@ const columnList: React.FC<{}> = () => {
const controllerBtns = <Row>
<Col span={6}>
<Button
onClick={() => history.push('/memberCenter/contentAbility/columnsManagement/add')}
type="primary"
icon={<PlusOutlined />}
>
{intl.formatMessage({ id: 'common.button.add' })}
</Button>
<AuthButton btnCode='columnsManagement.add1' menuCode='contentAbility'>
<Button
onClick={() => history.push('/memberCenter/contentAbility/columnsManagement/add')}
type="primary"
icon={<PlusOutlined />}
>
{intl.formatMessage({ id: 'common.button.add' })}
</Button>
</AuthButton>
</Col>
</Row>
return (
return (
<PageHeaderWrapper>
<Card>
<StandardTable
......@@ -176,7 +190,7 @@ const columnList: React.FC<{}> = () => {
/>
</Card>
</PageHeaderWrapper>
)
)
}
export default columnList
import React, { useRef } from 'react';
import { Card, Button, Popconfirm, Row, Col } from 'antd';
import { Card, Button, Popconfirm, Row, Col } from 'antd';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import { ColumnType } from 'antd/lib/table/interface'
......@@ -10,6 +10,8 @@ import StatusSwitch from '@/components/StatusSwitch';
import StandardTable from '@/components/StandardTable';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { getManageMemberLabelPage, postManageMemberLabelDelete, postManageMemberLabelUpdateStatus } from '@/services/ManageV2Api';
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const actions = createFormActions();
......@@ -18,11 +20,12 @@ const Tags = () => {
const ref = useRef<any>({})
const columns: ColumnType<any>[] = [
{title: 'ID', dataIndex: 'id'},
{ title: 'ID', dataIndex: 'id' },
{
title: intl.formatMessage({ id: 'content.tag.name' }), dataIndex: 'name',
render: (text: string, record: any) => (
<EyePreview
type={AuthUrl('tagsManagement.see', 'contentAbility') ? 'link' : 'button'}
url={`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}&preview=1`}
>
{text}
......@@ -39,11 +42,13 @@ const Tags = () => {
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => (
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleModify(record)}
record={record}
/>
<AuthButton btnCode='tagsManagement.state' menuCode='contentAbility'>
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleModify(record)}
record={record}
/>
</AuthButton>
)
},
{
......@@ -53,13 +58,19 @@ const Tags = () => {
dataIndex: 'operate',
render: (_, record) => !record.status && (
<>
<Button type='link' onClick={() => history.push(`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleRemove(record.id)}
>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
<AuthButton btnCode='tagsManagement.edit' menuCode='contentAbility'>
<Button type='link' onClick={() => history.push(`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
</AuthButton>
<AuthButton btnCode='tagsManagement.del' menuCode='contentAbility'>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleRemove(record.id)}
>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
</AuthButton>
</>
)
}
......@@ -107,38 +118,41 @@ const Tags = () => {
})
}
// 修改状态
const handleModify = (value) => {
const { id, status } = value;
const postData = {
id: id,
enableStatus: (status ^ 1),
}
postManageMemberLabelUpdateStatus(postData).then((res) => {
if (res.code === 1000) {
// 修改状态
const handleModify = (value) => {
const { id, status } = value;
const postData = {
id: id,
enableStatus: (status ^ 1),
}
postManageMemberLabelUpdateStatus(postData).then((res) => {
if (res.code === 1000) {
ref.current.reload()
}
})
}
})
}
// 栏目删除
const handleRemove = (id: number) => {
///manage/contentColumn/delete
postManageMemberLabelDelete({id: id}).then((res) => {
if (res.code === 1000) {
// 栏目删除
const handleRemove = (id: number) => {
///manage/contentColumn/delete
postManageMemberLabelDelete({ id: id }).then((res) => {
if (res.code === 1000) {
ref.current.reload()
}
})
}
})
}
const controllerBtns = <Row>
<Col span={6}>
<Button
onClick={() => history.push('/memberCenter/contentAbility/tagsManagement/add')}
type="primary"
>
{intl.formatMessage({ id: 'common.button.add' })}
</Button>
<AuthButton btnCode='tagsManagement.add' menuCode='contentAbility'>
<Button
onClick={() => history.push('/memberCenter/contentAbility/tagsManagement/add')}
type="primary"
>
{intl.formatMessage({ id: 'common.button.add' })}
</Button>
</AuthButton>
</Col>
</Row>
......
......@@ -130,6 +130,8 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
const newData = rowSelectionCtl.selectRow.map(v => {
v.orderMode = schemaAction.getFieldValue('orderMode')
v.shopId = schemaAction.getFieldValue('shopId')
v.buyerMemberId = schemaAction.getFieldValue('buyerMemberId')
v.buyerRoleId = schemaAction.getFieldValue('buyerRoleId')
return v
})
schemaAction.setFieldValue('products', await filterProductDataById([], newData))
......
......@@ -19,14 +19,14 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
useEffect(() => {
// 商品有传入时 调用支付方式api
if(products.length && markRef.current) {
getPayLists(products[0].memberId, products[0].memberRoleId)
getPayLists(products[0].buyerMemberId, products[0].buyerRoleId)
markRef.current = false
}
}, [products])
const initPayWayList = (memberId, memberRoleId) => {
let result = []
getOrderVendorCreateAgentPayTypes({vendorMemberId: memberId, vendorRoleId: memberRoleId}).then(res => {
getOrderVendorCreateAgentPayTypes({buyerMemberId: memberId, buyerRoleId: memberRoleId}).then(res => {
const { data = [], code } = res
for (let item of data) {
result.push({
......
......@@ -115,8 +115,9 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
return productInfoColumns
})
const handleShowProduct = () => {
const supplyMembersId = ctx.getFieldValue('vendorMemberName')
if (supplyMembersId) {
const buyerMemberId = ctx.getFieldValue('buyerMemberId')
const shopId = ctx.getFieldValue('shopId')
if (buyerMemberId && shopId) {
productRef.current.setVisible(true)
} else {
message.error(intl.formatMessage({id: 'purchaseOrder.orderCollect.model.message'}))
......
......@@ -18,7 +18,7 @@ import { getAuth } from '@/utils/auth'
import styles from './index.less'
import QRCode from 'qrcode'
import { MEMBER_ROLE_TYPE_SERVICE_CONSUMER } from '@/constants/member'
import { getOrderVendorGeneratePayLink, GetOrderVendorGeneratePayLinkResponse, getOrderVendorMiniAppCode, getOrderVendorPage, postOrderVendorCancel, postOrderVendorTerminate, postOrderVendorTransfer, postOrderVendorTransferPreview } from '@/services/OrderNewV2Api'
import { getOrderVendorGeneratePayLink, getOrderVendorMiniAppCode, getOrderVendorPage, postOrderVendorCancel, postOrderVendorTerminate, postOrderVendorTransfer, postOrderVendorTransferPreview } from '@/services/OrderNewV2Api'
import appImg from '@/assets/icons/app.png'
import miniappImg from '@/assets/icons/miniapp.png'
import scanImg from '@/assets/icons/scan.png'
......@@ -136,21 +136,20 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
const onSave = () => {
const img: any = document.getElementById('qrcodeElement');
const canvas = document.createElement('canvas');
// console.log(img)
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
const url = canvas.toDataURL('image/png');
var downloadLink = document.getElementById('downloadLink');
downloadLink.setAttribute('href', url);
downloadLink.setAttribute('download', '二维码.png');
downloadLink.setAttribute('download', `${intl.formatMessage({ id: 'saleOrder.daochuerweima', defaultMessage: '导出二维码' })}.png`);
downloadLink.click();
}
const generatePayChart = (record) => {
getOrderVendorGeneratePayLink({orderId: record.orderId}).then(({ data }) => {
currentPayRef.current = data
// setPayModel(ORDER_SHOP_ORIGIN_MAP[data['shopEnvironment']])
setPayChartVisible(true)
})
}
......
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