Commit 00dfdc15 authored by xiexiuxing's avatar xiexiuxing

flx: 渠道按钮权限

parent e92cf9c7
# btnCode 是pass 平台配置唯一表示 # btnCode 是pass 平台配置唯一表示
...@@ -126,12 +126,54 @@ ...@@ -126,12 +126,54 @@
ownMallSeodetail.edit 自营商城SEO设置编辑 自营商城SEO设置编辑-按钮 ownMallSeodetail.edit 自营商城SEO设置编辑 自营商城SEO设置编辑-按钮
ownMallSeodetail.add 自营商城SEO设置新曾 自营商城SEO设置新曾-按钮 ownMallSeodetail.add 自营商城SEO设置新曾 自营商城SEO设置新曾-按钮
# 渠道 # 渠道-channelAbility (已完成)
- 1 创建渠道商城
channelInfo.add 渠道-创建渠道商城 渠道-创建渠道商城-按钮
- 2 渠道商城装修模板
channelTemplate.see 渠道商城装修模板-查看 渠道商城装修模板-查看-按钮
2.1 渠道商城装修模板详情
channelTemplate.Detail.see 渠道商城装修模板详情-预览 渠道商城装修模板详情-预览-按钮 删除
channelTemplate.Detail.renovation 渠道商城装修模板详情-装修 渠道商城装修模板详情-装修-按钮
channelTemplate.Detail.categoryrenovation 渠道商城装修模板详情-品类装修 渠道商城装修模板详情-品类装修-按钮
channelTemplate.Detail.use 渠道商城装修模板详情-使用 渠道商城装修模板详情-使用-按钮
- 3 渠道商城SEO设置
channelSeo.add 渠道商城SEO设置-新曾 渠道商城SEO设置-新曾-按钮
channelSeo.see 渠道商城SEO设置-查看 渠道商城SEO设置-查看-按钮
channelSeo.state 渠道商城SEO设置-修改状态 渠道商城SEO设置-修改状态-按钮
channelSeo.del 渠道商城SEO设置-删除 渠道商城SEO设置-删除-按钮
channelSeo.edit 渠道商城SEO设置-编辑 渠道商城SEO设置-编辑-按钮
- 3.3 渠道商城SEO设置详情
channelSeodetail.add 渠道商城SEO设置-新曾 渠道商城SEO设置-新曾-按钮
channelSeodetail.edit 渠道商城SEO设置-修改 渠道商城SEO设置-修改-按钮
- 4 业务员管理
memberList.add 业务员管理-新曾 业务员管理-新曾-按钮
memberList.see 业务员管理-查看 业务员管理-查看-按钮
memberList.update 业务员管理-修改 业务员管理-修改-按钮
memberList.del 业务员管理-删除 业务员管理-删除-按钮
4.1 详情
memberListdetail.add 业务员管理-详情新曾 业务员管理-详情新曾-按钮
memberListdetail.update 业务员管理-详情修改 业务员管理-详情修改-按钮
# 采购能力 # 采购能力
# 合同能力 # 合同能力-contract
- 1 电子签章申请
1.1 电子签章申请
ElectronicSignature.apply 电子签章申请 电子签章申请-按钮
- 2 合同模板管理
2.1 合同模板参数查询
显示无按钮操作
2.2 合同模板
templateList.see 合同模板-查看 合同模板-查看-按钮
templateList.add 合同模板-新曾 合同模板-新曾-按钮
templateList.state 合同模板-状态设置是否有效 合同模板-状态设置是否有效-按钮
templateList.edit 合同模板-修改 合同模板-修改-按钮
templateList.del 合同模板-删除 合同模板-删除-按钮
- 3 合同管理
# 交易能力 # 交易能力
# 售后管理 # 售后管理
......
...@@ -15,6 +15,7 @@ import { isEmpty } from '@formily/antd/esm/shared' ...@@ -15,6 +15,7 @@ import { isEmpty } from '@formily/antd/esm/shared'
import { getAuth } from '@/utils/auth' import { getAuth } from '@/utils/auth'
import { getTemplateWebMemberChannelWebFindCurrMemberChannel, postTemplateWebMemberChannelWebSaveCurrMemberChannel } from '@/services/TemplateV2Api' import { getTemplateWebMemberChannelWebFindCurrMemberChannel, postTemplateWebMemberChannelWebSaveCurrMemberChannel } from '@/services/TemplateV2Api'
import { getManageShopFindByDoorType } from '@/services/ManageV2Api' import { getManageShopFindByDoorType } from '@/services/ManageV2Api'
import AuthButton from '@/components/AuthButton'
interface ShopInfoPropsType { interface ShopInfoPropsType {
SiteStore: { SiteStore: {
...@@ -86,7 +87,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => { ...@@ -86,7 +87,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息 // 根据站点获取商城信息
const fetchAllShop = () => { const fetchAllShop = () => {
const params: any = { const params: any = {
doorType: 2 doorType: 2
} }
getManageShopFindByDoorType(params).then(res => { getManageShopFindByDoorType(params).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
...@@ -345,7 +346,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => { ...@@ -345,7 +346,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
labelAlign="left" labelAlign="left"
name="logo" name="logo"
label={<RequireItem label={intl.formatMessage({ id: 'shop.form.label.logo' })} isRequire={true} />} label={<RequireItem label={intl.formatMessage({ id: 'shop.form.label.logo' })} isRequire={true} />}
rules={[{ required: true, message: intl.formatMessage({ id: 'shop.form.logo.required' })}]} rules={[{ required: true, message: intl.formatMessage({ id: 'shop.form.logo.required' }) }]}
> >
<UploadImage <UploadImage
imgUrl={logo} imgUrl={logo}
...@@ -489,7 +490,10 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => { ...@@ -489,7 +490,10 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
<Form.Item <Form.Item
label={<RequireItem label="" />} label={<RequireItem label="" />}
> >
<Button loading={confirmLoading} type="primary" style={{ marginRight: 16 }} onClick={handleSave}>{intl.formatMessage({ id: 'common.button.save' })}</Button> <AuthButton btnCode='channelInfo.add' menuCode='channelAbility'>
<Button loading={confirmLoading} type="primary" style={{ marginRight: 16 }} onClick={handleSave}>{intl.formatMessage({ id: 'common.button.save' })}</Button>
</AuthButton>
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
......
...@@ -14,6 +14,7 @@ const layout: any = { ...@@ -14,6 +14,7 @@ const layout: any = {
wrapperCol: { span: 9 }, wrapperCol: { span: 9 },
labelAlign: "left" labelAlign: "left"
} }
import AuthButton from '@/components/AuthButton'
const ChannelSeoAdded = () => { const ChannelSeoAdded = () => {
const { query: { id }, pathname } = history.location; const { query: { id }, pathname } = history.location;
...@@ -60,7 +61,7 @@ const ChannelSeoAdded = () => { ...@@ -60,7 +61,7 @@ const ChannelSeoAdded = () => {
if (res.code !== 1000) { if (res.code !== 1000) {
return return
} }
form.setFieldsValue({...res.data}) form.setFieldsValue({ ...res.data })
}) })
} }
}, []) }, [])
...@@ -70,7 +71,11 @@ const ChannelSeoAdded = () => { ...@@ -70,7 +71,11 @@ const ChannelSeoAdded = () => {
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'common.button.back' })} />} backIcon={<ReutrnEle description={intl.formatMessage({ id: 'common.button.back' })} />}
extra={ extra={
link !== 'detail' && <Button type="primary" loading={confirmLoading} onClick={handleSave}> {intl.formatMessage({ id: 'common.button.save' })}</Button> link !== 'detail' &&
<AuthButton btnCode={id ? 'channelSeodetail.edit' : 'channelSeodetail.add'} menuCode='channelAbility'>
<Button type="primary" loading={confirmLoading} onClick={handleSave}> {intl.formatMessage({ id: 'common.button.save' })}</Button>
</AuthButton>
} }
> >
<Prompt when={formIsHalfFilledOut} message={intl.formatMessage({ id: 'common.tip.save.confirm' })} /> <Prompt when={formIsHalfFilledOut} message={intl.formatMessage({ id: 'common.tip.save.confirm' })} />
...@@ -106,21 +111,21 @@ const ChannelSeoAdded = () => { ...@@ -106,21 +111,21 @@ const ChannelSeoAdded = () => {
label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.title' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.title.tip' })}><QuestionCircleOutlined /></Tooltip>} />} label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.title' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.title.tip' })}><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.title.required' }) }]} rules={[{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.title.required' }) }]}
> >
<Input maxLength={50} disabled={link === 'detail'} placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}50${intl.formatMessage({ id: 'common.unit.individual.chinese'})}`} /> <Input maxLength={50} disabled={link === 'detail'} placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}50${intl.formatMessage({ id: 'common.unit.individual.chinese' })}`} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name='description' name='description'
label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.description' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.description.tip' })}><QuestionCircleOutlined /></Tooltip>} />} label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.description' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.description.tip' })}><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.description.required' }) }]} rules={[{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.description.required' }) }]}
> >
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}200${intl.formatMessage({ id: 'common.unit.individual.chinese'})}`} maxLength={200} /> <Input.TextArea disabled={link === 'detail'} rows={5} placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}200${intl.formatMessage({ id: 'common.unit.individual.chinese' })}`} maxLength={200} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name='keywords' name='keywords'
label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.keywords' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.keywords.tip' })}><QuestionCircleOutlined /></Tooltip>} />} label={<RequireItem label={intl.formatMessage({ id: 'shop.seo.table.keywords' })} isRequire={true} brief={<Tooltip placement="top" title={intl.formatMessage({ id: 'shop.seo.table.keywords.tip' })}><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.keywords.required' }) }]} rules={[{ required: true, message: intl.formatMessage({ id: 'shop.seo.form.keywords.required' }) }]}
> >
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}100${intl.formatMessage({ id: 'common.unit.individual.chinese'})}`} maxLength={100} /> <Input.TextArea disabled={link === 'detail'} rows={5} placeholder={`${intl.formatMessage({ id: 'common.text.longest' })}100${intl.formatMessage({ id: 'common.unit.individual.chinese' })}`} maxLength={100} />
</Form.Item> </Form.Item>
</Form> </Form>
</TabPane> </TabPane>
......
...@@ -12,6 +12,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -12,6 +12,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { searchSelectGetSelectCategoryOptionEffect } from '@/pages/transaction/effect/index'; import { searchSelectGetSelectCategoryOptionEffect } from '@/pages/transaction/effect/index';
import { PauseCircleOutlined, PlayCircleOutlined, PlusOutlined } from '@ant-design/icons'; import { PauseCircleOutlined, PlayCircleOutlined, PlusOutlined } from '@ant-design/icons';
import { getTemplateWebSeoWebPage, postTemplateWebSeoWebDelete, postTemplateWebSeoWebUpdateStatus } from '@/services/TemplateV2Api'; import { getTemplateWebSeoWebPage, postTemplateWebSeoWebDelete, postTemplateWebSeoWebUpdateStatus } from '@/services/TemplateV2Api';
import AuthButton from '@/components/AuthButton'
const ChannelSeo = () => { const ChannelSeo = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
...@@ -49,7 +50,11 @@ const ChannelSeo = () => { ...@@ -49,7 +50,11 @@ const ChannelSeo = () => {
key: 'name', key: 'name',
dataIndex: 'name', dataIndex: 'name',
// eslint-disable-next-line react/display-name // eslint-disable-next-line react/display-name
render: (text: any,record: any) => <Typography.Link href={`/memberCenter/shopAbility/shopSeo/detail?id=${record.id}`}>{text}</Typography.Link> render: (text: any, record: any) =>
<AuthButton menuCode='channelAbility' btnCode='channelSeo.see'>
<Typography.Link href={`/memberCenter/shopAbility/shopSeo/detail?id=${record.id}`}>{text}</Typography.Link>
</AuthButton>
}, },
{ {
title: intl.formatMessage({ id: 'shop.seo.table.link' }), title: intl.formatMessage({ id: 'shop.seo.table.link' }),
...@@ -64,18 +69,21 @@ const ChannelSeo = () => { ...@@ -64,18 +69,21 @@ const ChannelSeo = () => {
render: (text: any, record: any) => { render: (text: any, record: any) => {
let component: ReactNode = null let component: ReactNode = null
component = ( component = (
<Popconfirm <AuthButton menuCode='channelAbility' btnCode='channelSeo.state'>
title={intl.formatMessage({ id: 'common.tip.option.confirm' })} <Popconfirm
onConfirm={() => confirm(record)} title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
okText={intl.formatMessage({ id: 'common.button.yes' })} onConfirm={() => confirm(record)}
cancelText={intl.formatMessage({ id: 'common.button.no' })} okText={intl.formatMessage({ id: 'common.button.yes' })}
> cancelText={intl.formatMessage({ id: 'common.button.no' })}
<Button >
type="link" <Button
style={record.status === 1 ? { color: '#00B37A' } : { color: 'red' }}> type="link"
{record.status === 1 ? <>{intl.formatMessage({ id: 'common.status.effective' })} <PlayCircleOutlined /></> : <>{intl.formatMessage({ id: 'common.status.invalid' })} <PauseCircleOutlined /></>} style={record.status === 1 ? { color: '#00B37A' } : { color: 'red' }}>
</Button> {record.status === 1 ? <>{intl.formatMessage({ id: 'common.status.effective' })} <PlayCircleOutlined /></> : <>{intl.formatMessage({ id: 'common.status.invalid' })} <PauseCircleOutlined /></>}
</Popconfirm> </Button>
</Popconfirm>
</AuthButton>
) )
return component return component
} }
...@@ -88,16 +96,20 @@ const ChannelSeo = () => { ...@@ -88,16 +96,20 @@ const ChannelSeo = () => {
// eslint-disable-next-line react/display-name // eslint-disable-next-line react/display-name
render: (_text: any, record: any) => ( render: (_text: any, record: any) => (
<> <>
<Popconfirm <AuthButton menuCode='channelAbility' btnCode='channelSeo.del'>
title={intl.formatMessage({ id: 'common.tip.option.confirm' })} <Popconfirm
onConfirm={() => handleDelete(record.id)} title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
disabled={record.status === 1} onConfirm={() => handleDelete(record.id)}
okText={intl.formatMessage({ id: 'common.button.yes' })} disabled={record.status === 1}
cancelText={intl.formatMessage({ id: 'common.button.no' })} okText={intl.formatMessage({ id: 'common.button.yes' })}
> cancelText={intl.formatMessage({ id: 'common.button.no' })}
<Button disabled={record.status === 1} type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button> >
</Popconfirm> <Button disabled={record.status === 1} type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
<Button disabled={record.status === 1} type='link' onClick={() => history.push(`/memberCenter/channelAbility/channelSeo/edit?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button> </Popconfirm>
</AuthButton>
<AuthButton menuCode='channelAbility' btnCode='channelSeo.edit'>
<Button disabled={record.status === 1} type='link' onClick={() => history.push(`/memberCenter/channelAbility/channelSeo/edit?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
</AuthButton>
</> </>
) )
} }
...@@ -118,13 +130,16 @@ const ChannelSeo = () => { ...@@ -118,13 +130,16 @@ const ChannelSeo = () => {
const controllerBtns = <Row> const controllerBtns = <Row>
<Col span={6}> <Col span={6}>
<Button <AuthButton menuCode='channelAbility' btnCode='channelSeo.add'>
onClick={() => history.push('/memberCenter/channelAbility/channelSeo/add')} <Button
type="primary" onClick={() => history.push('/memberCenter/channelAbility/channelSeo/add')}
icon={<PlusOutlined />} type="primary"
> icon={<PlusOutlined />}
{intl.formatMessage({ id: 'common.button.add' })} >
</Button> {intl.formatMessage({ id: 'common.button.add' })}
</Button>
</AuthButton>
</Col> </Col>
</Row> </Row>
......
...@@ -3,7 +3,7 @@ import { PlayCircleOutlined } from '@ant-design/icons' ...@@ -3,7 +3,7 @@ import { PlayCircleOutlined } from '@ant-design/icons'
import cx from 'classnames' import cx from 'classnames'
import { Link, useIntl } from 'umi' import { Link, useIntl } from 'umi'
import styles from './index.less' import styles from './index.less'
import AuthButton from '@/components/AuthButton'
interface TemplateItemPropsType { interface TemplateItemPropsType {
templateInfo: any; templateInfo: any;
type: string; type: string;
...@@ -35,7 +35,10 @@ const TemplateItem: React.FC<TemplateItemPropsType> = (props) => { ...@@ -35,7 +35,10 @@ const TemplateItem: React.FC<TemplateItemPropsType> = (props) => {
<div className={styles.template_item}> <div className={styles.template_item}>
<div className={styles.img_box} style={{ backgroundImage: `url(${templateInfo.templatePicUrl})` }}> <div className={styles.img_box} style={{ backgroundImage: `url(${templateInfo.templatePicUrl})` }}>
<div className={styles.img_box_mask}> <div className={styles.img_box_mask}>
<Link to={`/memberCenter/channelAbility/template/detail?type=${type}&id=${templateInfo.id}`} className={styles.detail_btn}>{intl.formatMessage({ id: 'common.button.view.details' })}</Link> <AuthButton btnCode='channelTemplate.see' menuCode='channelAbility'>
<Link to={`/memberCenter/channelAbility/template/detail?type=${type}&id=${templateInfo.id}`} className={styles.detail_btn}>{intl.formatMessage({ id: 'common.button.view.details' })}</Link>
</AuthButton>
</div> </div>
<div className={cx(styles.type_tag, templateInfo.environment === 2 ? styles.h5 : '')}>{Environment_Status[templateInfo.environment].name}</div> <div className={cx(styles.type_tag, templateInfo.environment === 2 ? styles.h5 : '')}>{Environment_Status[templateInfo.environment].name}</div>
</div> </div>
......
...@@ -30,6 +30,7 @@ import StandardTable from '@/components/StandardTable'; ...@@ -30,6 +30,7 @@ import StandardTable from '@/components/StandardTable';
import ModalTable from '@/components/ModalTable'; import ModalTable from '@/components/ModalTable';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { getMemberAbilitySalesChannel, getMemberAbilitySalesChannelPage, getMemberAbilitySalesSelect, postMemberAbilitySalesChannelBind, postMemberAbilitySalesChannelUnbind } from '@/services/MemberV2Api'; import { getMemberAbilitySalesChannel, getMemberAbilitySalesChannelPage, getMemberAbilitySalesSelect, postMemberAbilitySalesChannelBind, postMemberAbilitySalesChannelUnbind } from '@/services/MemberV2Api';
import AuthButton from '@/components/AuthButton'
const TabFormErrors = props => { const TabFormErrors = props => {
return ( return (
...@@ -52,10 +53,10 @@ const fetchMemberAbilitySelect = async (params) => { ...@@ -52,10 +53,10 @@ const fetchMemberAbilitySelect = async (params) => {
const MemberDetail: React.FC<{}> = () => { const MemberDetail: React.FC<{}> = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const staticData = useRef<any>([]) const staticData = useRef<any>([])
const [rowSelection, rowCtl] = useRowSelectionTable({customKey: 'memberId'}) const [rowSelection, rowCtl] = useRowSelectionTable({ customKey: 'memberId' })
const [realRowSelection, realRowCtl] = useRowSelectionTable({customKey: 'relationId'}) const [realRowSelection, realRowCtl] = useRowSelectionTable({ customKey: 'relationId' })
const [memberVisible, setMemberVisible] = useState(false) const [memberVisible, setMemberVisible] = useState(false)
const { pageStatus, id} = usePageStatus() const { pageStatus, id } = usePageStatus()
const [tableData, setTableData] = useState<any[]>([]) const [tableData, setTableData] = useState<any[]>([])
const [keywordName, setKeywordName] = useState<string>('') const [keywordName, setKeywordName] = useState<string>('')
const intl = useIntl() const intl = useIntl()
...@@ -101,7 +102,7 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -101,7 +102,7 @@ const MemberDetail: React.FC<{}> = () => {
if (res.code === 1000) { if (res.code === 1000) {
formAction.setFieldValue('userId', [res.data]) formAction.setFieldValue('userId', [res.data])
// 添加一个remote标识, 带有此标识的 将会调用接口解绑 // 添加一个remote标识, 带有此标识的 将会调用接口解绑
setTableData(res.data.data.map(v => ({...v, isRemote: true}))) setTableData(res.data.data.map(v => ({ ...v, isRemote: true })))
} }
}) })
} }
...@@ -206,8 +207,8 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -206,8 +207,8 @@ const MemberDetail: React.FC<{}> = () => {
title: intl.formatMessage({ id: 'common.table.action' }), title: intl.formatMessage({ id: 'common.table.action' }),
align: 'center', align: 'center',
render: (_, record) => { render: (_, record) => {
return <Popconfirm disabled={pageStatus === PageStatus.PREVIEW} title={intl.formatMessage({ id: 'channel.member.relieve.confirm' })} onConfirm={() => cacelConnect(record)}> return <Popconfirm disabled={pageStatus === PageStatus.PREVIEW} title={intl.formatMessage({ id: 'channel.member.relieve.confirm' })} onConfirm={() => cacelConnect(record)}>
<Button type='link' disabled={pageStatus === PageStatus.PREVIEW}>{intl.formatMessage({ id: 'channel.member.relieve' })}</Button> <Button type='link' disabled={pageStatus === PageStatus.PREVIEW}>{intl.formatMessage({ id: 'channel.member.relieve' })}</Button>
</Popconfirm> </Popconfirm>
} }
} }
...@@ -348,20 +349,22 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -348,20 +349,22 @@ const MemberDetail: React.FC<{}> = () => {
const extraButtons = ( const extraButtons = (
<Space> <Space>
<Button <AuthButton btnCode={id ? 'memberListdetail.update' : ' memberListdetail.add'} menuCode='channelAbility'>
type="primary" <Button
disabled={pageStatus === PageStatus.PREVIEW} type="primary"
onClick={handleSubmit} disabled={pageStatus === PageStatus.PREVIEW}
> onClick={handleSubmit}
{intl.formatMessage({ id: 'common.button.save' })} >
</Button> {intl.formatMessage({ id: 'common.button.save' })}
</Button>
</AuthButton>
</Space> </Space>
); );
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'common.button.back' })}/>} backIcon={<ReutrnEle description={intl.formatMessage({ id: 'common.button.back' })} />}
className="addRepository" className="addRepository"
title={pageTitles[pageStatus]} title={pageTitles[pageStatus]}
extra={extraButtons} extra={extraButtons}
...@@ -389,7 +392,7 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -389,7 +392,7 @@ const MemberDetail: React.FC<{}> = () => {
'x-component-props': { 'x-component-props': {
title: intl.formatMessage({ id: 'common.text.select' }), title: intl.formatMessage({ id: 'common.text.select' }),
modalProps: { modalProps: {
title: intl.formatMessage({ id: 'channel.form.modal.salesman.title' }), title: intl.formatMessage({ id: 'channel.form.modal.salesman.title' }),
}, },
columns: abilityColumns, columns: abilityColumns,
...@@ -477,16 +480,16 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -477,16 +480,16 @@ const MemberDetail: React.FC<{}> = () => {
></NiceForm> ></NiceForm>
</TabsItem> </TabsItem>
<TabsItem tab={intl.formatMessage({ id: 'channel.member.tab.manage.subordinate' })} key="2"> <TabsItem tab={intl.formatMessage({ id: 'channel.member.tab.manage.subordinate' })} key="2">
<Row justify='space-between' style={{marginBottom: 20}}> <Row justify='space-between' style={{ marginBottom: 20 }}>
<Col> <Col>
<Button type='default' onClick={() => unBindMember()} disabled={pageStatus === PageStatus.PREVIEW}>{intl.formatMessage({ id: 'channel.member.relieve.batch' })}</Button> <Button type='default' onClick={() => unBindMember()} disabled={pageStatus === PageStatus.PREVIEW}>{intl.formatMessage({ id: 'channel.member.relieve.batch' })}</Button>
</Col> </Col>
<Col style={{display: 'flex'}}> <Col style={{ display: 'flex' }}>
<Input.Search placeholder={intl.formatMessage({ id: 'channel.form.memberName.placeholder' })} value={keywordName} onChange={e => setKeywordName(e.target.value)} onPressEnter={handleSearchChannel}/> <Input.Search placeholder={intl.formatMessage({ id: 'channel.form.memberName.placeholder' })} value={keywordName} onChange={e => setKeywordName(e.target.value)} onPressEnter={handleSearchChannel} />
<Button type='default' style={{marginLeft: 20}} onClick={() => setKeywordName('')}>{intl.formatMessage({ id: 'common.button.reset' })}</Button> <Button type='default' style={{ marginLeft: 20 }} onClick={() => setKeywordName('')}>{intl.formatMessage({ id: 'common.button.reset' })}</Button>
</Col> </Col>
</Row> </Row>
<Button block type='dashed' onClick={() => setMemberVisible(true)} disabled={pageStatus === PageStatus.PREVIEW}>{intl.formatMessage({ id: 'channel.member.wait.bind.select' })}</Button> <Button block type='dashed' onClick={() => setMemberVisible(true)} disabled={pageStatus === PageStatus.PREVIEW}>{intl.formatMessage({ id: 'channel.member.wait.bind.select' })}</Button>
<StandardTable <StandardTable
columns={connectMemberColumns} columns={connectMemberColumns}
rowSelection={pageStatus !== PageStatus.PREVIEW && realRowSelection} rowSelection={pageStatus !== PageStatus.PREVIEW && realRowSelection}
......
...@@ -5,11 +5,13 @@ import { ...@@ -5,11 +5,13 @@ import {
PlusOutlined, PlusOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import StandardTable from '@/components/StandardTable'; import StandardTable from '@/components/StandardTable';
import {ColumnType} from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { getMemberAbilitySalesPage, postMemberAbilitySalesDelete } from '@/services/MemberV2Api'; import { getMemberAbilitySalesPage, postMemberAbilitySalesDelete } from '@/services/MemberV2Api';
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const fetchData = async (params) => { const fetchData = async (params) => {
const { data } = await getMemberAbilitySalesPage(params) const { data } = await getMemberAbilitySalesPage(params)
return data return data
...@@ -43,7 +45,7 @@ const ChannelMember: React.FC<{}> = () => { ...@@ -43,7 +45,7 @@ const ChannelMember: React.FC<{}> = () => {
align: 'center', align: 'center',
key: 'name', key: 'name',
className: 'commonPickColor', className: 'commonPickColor',
render: (text, record) => <EyePreview url={`/memberCenter/channelAbility/memberList/detail?id=${record.userId}&preview=1`}>{text}</EyePreview> render: (text, record) => <EyePreview type={AuthUrl('memberList.see', 'channelAbility') ? 'link' : 'button'} url={`/memberCenter/channelAbility/memberList/detail?id=${record.userId}&preview=1`}>{text}</EyePreview>
}, },
{ {
title: intl.formatMessage({ id: 'channel.member.table.orgName' }), title: intl.formatMessage({ id: 'channel.member.table.orgName' }),
...@@ -73,18 +75,24 @@ const ChannelMember: React.FC<{}> = () => { ...@@ -73,18 +75,24 @@ const ChannelMember: React.FC<{}> = () => {
title: intl.formatMessage({ id: 'common.table.action' }), title: intl.formatMessage({ id: 'common.table.action' }),
dataIndex: 'option', dataIndex: 'option',
align: 'center', align: 'center',
render: (text:any, record:any) => { render: (text: any, record: any) => {
return <> return <>
<Button type='link' onClick={()=>updateItem(record)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button> <AuthButton btnCode='memberList.update' menuCode='channelAbility'>
<Button type='link' onClick={() => updateItem(record)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
</AuthButton>
{ {
<Popconfirm <AuthButton btnCode='memberList.del' menuCode='channelAbility'>
title={intl.formatMessage({ id: 'common.tip.option.confirm' })} <Popconfirm
onConfirm={() => deleteItem(record)} title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
okText={intl.formatMessage({ id: 'common.button.yes' })} onConfirm={() => deleteItem(record)}
cancelText={intl.formatMessage({ id: 'common.button.no' })} okText={intl.formatMessage({ id: 'common.button.yes' })}
> cancelText={intl.formatMessage({ id: 'common.button.no' })}
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button> >
</Popconfirm> <Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
</AuthButton>
} }
</> </>
} }
...@@ -92,55 +100,58 @@ const ChannelMember: React.FC<{}> = () => { ...@@ -92,55 +100,58 @@ const ChannelMember: React.FC<{}> = () => {
]; ];
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card className="common-wrapper"> <Card className="common-wrapper">
<StandardTable <StandardTable
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
fetchTableData={(params:any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
rowKey='userId' rowKey='userId'
formilyChilds={{ formilyChilds={{
layouts: { layouts: {
order: 2 order: 2
},
children: <Button style={{width: 140}} icon={<PlusOutlined/>} onClick={() => history.push('/memberCenter/channelAbility/memberList/add')} type='primary'>{intl.formatMessage({id: 'common.button.add'})}</Button>
}}
formilyProps={{
layouts: {
order: 3
},
ctx: {
effects: ($) => {
$('onFieldInputChange', 'status').subscribe(() => {
ref.current.reload()
})
}, },
schema: { children:
type: 'object', <AuthButton btnCode='memberList.add' menuCode='channelAbility'>
properties: { <Button style={{ width: 140 }} icon={<PlusOutlined />} onClick={() => history.push('/memberCenter/channelAbility/memberList/add')} type='primary'>{intl.formatMessage({ id: 'common.button.add' })}</Button>
account: { </AuthButton>
type: 'Search', }}
"x-component-props": { formilyProps={{
placeholder: intl.formatMessage({ id: 'channel.member.table.account.placeholder' }) layouts: {
} order: 3
}, },
name: { ctx: {
type: 'Search', effects: ($) => {
"x-component-props": { $('onFieldInputChange', 'status').subscribe(() => {
placeholder: intl.formatMessage({ id: 'channel.form.name.placeholder' }) ref.current.reload()
})
},
schema: {
type: 'object',
properties: {
account: {
type: 'Search',
"x-component-props": {
placeholder: intl.formatMessage({ id: 'channel.member.table.account.placeholder' })
}
},
name: {
type: 'Search',
"x-component-props": {
placeholder: intl.formatMessage({ id: 'channel.form.name.placeholder' })
}
} }
} }
} }
} }
} }}
}} />
/> </Card>
</Card> </PageHeaderWrapper>
</PageHeaderWrapper>
) )
} }
......
...@@ -9,6 +9,7 @@ import { Environment_Status } from '@/constants' ...@@ -9,6 +9,7 @@ import { Environment_Status } from '@/constants'
import { GlobalConfig } from '@/global/config' import { GlobalConfig } from '@/global/config'
import { getTemplateWebPageTemplateWebFindChannelTemplateDetails, postTemplateWebPageTemplateWebUseChannelTemplate } from '@/services/TemplateV2Api' import { getTemplateWebPageTemplateWebFindChannelTemplateDetails, postTemplateWebPageTemplateWebUseChannelTemplate } from '@/services/TemplateV2Api'
import styles from './index.less' import styles from './index.less'
import AuthButton from '@/components/AuthButton'
interface TemplateDetailPropsType { interface TemplateDetailPropsType {
location: { location: {
...@@ -65,10 +66,10 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { ...@@ -65,10 +66,10 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
} }
const handleLinkEdit = () => { const handleLinkEdit = () => {
if(detailInfo?.environment === 1) { if (detailInfo?.environment === 1) {
// web店铺装修 // web店铺装修
window.location.href = `/memberCenter/channelAbility/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}` window.location.href = `/memberCenter/channelAbility/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}`
} else if(detailInfo?.environment === 4) { } else if (detailInfo?.environment === 4) {
// app店铺装修 // app店铺装修
window.location.href = `/memberCenter/channelAbility/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}` window.location.href = `/memberCenter/channelAbility/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}`
} else { } else {
...@@ -77,9 +78,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { ...@@ -77,9 +78,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
} }
const handleLinkPreview = () => { const handleLinkPreview = () => {
if(detailInfo?.environment === 1) { if (detailInfo?.environment === 1) {
window.location.href = `/memberCenter/channelAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}` window.location.href = `/memberCenter/channelAbility/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}`
} else if(detailInfo?.environment === 4) { } else if (detailInfo?.environment === 4) {
window.location.href = `/memberCenter/channelAbility/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}` window.location.href = `/memberCenter/channelAbility/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&type=${shopType}&shopId=${detailInfo.shopId}`
} else { } else {
message.info(intl.formatMessage({ id: 'shop.template.preview.tip' })) message.info(intl.formatMessage({ id: 'shop.template.preview.tip' }))
...@@ -115,11 +116,11 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { ...@@ -115,11 +116,11 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
<span>{Environment_Status[detailInfo?.environment]}</span> <span>{Environment_Status[detailInfo?.environment]}</span>
</div> </div>
<div className={styles.template_info_line}> <div className={styles.template_info_line}>
<label>{intl.formatMessage({ id: 'shop.template.form.label.templateDescribe' })}</label> <label>{intl.formatMessage({ id: 'shop.template.form.label.templateDescribe' })}</label>
<span>{detailInfo?.templateDescribe}</span> <span>{detailInfo?.templateDescribe}</span>
</div> </div>
<div className={styles.template_info_line}> <div className={styles.template_info_line}>
<label>{intl.formatMessage({ id: 'shop.template.form.label.siteName' })}</label> <label>{intl.formatMessage({ id: 'shop.template.form.label.siteName' })}</label>
<span>{detailInfo?.siteName}</span> <span>{detailInfo?.siteName}</span>
</div> </div>
<div className={styles.template_info_line}> <div className={styles.template_info_line}>
...@@ -128,26 +129,38 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => { ...@@ -128,26 +129,38 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div> </div>
</div> </div>
</div> </div>
<div className={styles.btn} onClick={() => handleLinkPreview()}> <AuthButton btnCode='channelTemplate.Detail.see' menuCode='channelAbility'>
<EyeOutlined /> <div className={styles.btn} onClick={() => handleLinkPreview()}>
<label>{intl.formatMessage({ id: 'common.button.preview' })}</label> <EyeOutlined />
</div> <label>{intl.formatMessage({ id: 'common.button.preview' })}</label>
<div className={cx(styles.btn, styles.fit)} onClick={() => handleLinkEdit()}> </div>
<LayoutOutlined /> </AuthButton>
<label>{intl.formatMessage({ id: 'channel.template.button.mall.edit' })}</label>
</div> <AuthButton btnCode='channelTemplate.Detail.renovation' menuCode='channelAbility'>
{ <div className={cx(styles.btn, styles.fit)} onClick={() => handleLinkEdit()}>
detailInfo?.environment === 4 && ( <LayoutOutlined />
<div className={cx(styles.btn, styles.fit)} onClick={handleJump}> <label>{intl.formatMessage({ id: 'channel.template.button.mall.edit' })}</label>
<LayoutOutlined /> </div>
<label>{intl.formatMessage({ id: 'channel.template.button.mall.category.edit' })}</label> </AuthButton>
</div>
) <AuthButton btnCode='channelTemplate.Detail.categoryrenovation' menuCode='channelAbility'>
} {
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => detailInfo?.use !== 1 ? setUseModalVisible(true) : {}}> detailInfo?.environment === 4 && (
<PushpinOutlined /> <div className={cx(styles.btn, styles.fit)} onClick={handleJump}>
<label>{detailInfo?.use === 1 ? intl.formatMessage({ id: 'shop.template.button.state.using' }) : intl.formatMessage({ id: 'shop.template.button.state.use' })}</label> <LayoutOutlined />
</div> <label>{intl.formatMessage({ id: 'channel.template.button.mall.category.edit' })}</label>
</div>
)
}
</AuthButton>
<AuthButton btnCode='channelTemplate.Detail.use' menuCode='channelAbility'>
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => detailInfo?.use !== 1 ? setUseModalVisible(true) : {}}>
<PushpinOutlined />
<label>{detailInfo?.use === 1 ? intl.formatMessage({ id: 'shop.template.button.state.using' }) : intl.formatMessage({ id: 'shop.template.button.state.use' })}</label>
</div>
</AuthButton>
<UseModal <UseModal
title={intl.formatMessage({ id: 'channel.template.modal.title.use' })} title={intl.formatMessage({ id: 'channel.template.modal.title.use' })}
......
...@@ -8,6 +8,7 @@ import div from './../../../editor/configs/componentConfigs/HTML/div'; ...@@ -8,6 +8,7 @@ import div from './../../../editor/configs/componentConfigs/HTML/div';
import Test from '../../components/test' import Test from '../../components/test'
import { getContractSignatureAuthGet, postContractSignatureAuthApply } from '@/services/ContractV2Api' import { getContractSignatureAuthGet, postContractSignatureAuthApply } from '@/services/ContractV2Api'
const intl = getIntl(); const intl = getIntl();
import AuthButton from '@/components/AuthButton'
const Apply = () => { const Apply = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
/**头部状态的颜色值 /**头部状态的颜色值
...@@ -15,22 +16,22 @@ const Apply = () => { ...@@ -15,22 +16,22 @@ const Apply = () => {
*/ */
const applyStaus = [{ const applyStaus = [{
status: 1, status: 1,
name: intl.formatMessage({id: 'contract.weishenqing'}), name: intl.formatMessage({ id: 'contract.weishenqing' }),
icon: <ExclamationCircleFilled />, icon: <ExclamationCircleFilled />,
color: '#909399', color: '#909399',
}, { }, {
status: 2, status: 2,
name: intl.formatMessage({id: 'contract.shenqingzhong'}), name: intl.formatMessage({ id: 'contract.shenqingzhong' }),
icon: <ClockCircleFilled />, icon: <ClockCircleFilled />,
color: '#4279DF', color: '#4279DF',
}, { }, {
status: 3, status: 3,
name: intl.formatMessage({id: 'contract.shenqingbutongguo'}), name: intl.formatMessage({ id: 'contract.shenqingbutongguo' }),
icon: <CloseCircleFilled />, icon: <CloseCircleFilled />,
color: '#D32F2F', color: '#D32F2F',
}, { }, {
status: 4, status: 4,
name: intl.formatMessage({id: 'contract.shenqingtongguo'}), name: intl.formatMessage({ id: 'contract.shenqingtongguo' }),
icon: <CheckCircleFilled />, icon: <CheckCircleFilled />,
color: '#00B37A', color: '#00B37A',
}] }]
...@@ -75,14 +76,17 @@ const Apply = () => { ...@@ -75,14 +76,17 @@ const Apply = () => {
data.state === item.status && data.state === item.status &&
<div className={styles.apply_status} style={{ backgroundColor: item.color }}> <div className={styles.apply_status} style={{ backgroundColor: item.color }}>
<div> <div>
<div className={styles.status} style={{ opacity: .6, fontSize: '12px' }}>{intl.formatMessage({id: 'contract.shenqingzhuangtai'})}</div> <div className={styles.status} style={{ opacity: .6, fontSize: '12px' }}>{intl.formatMessage({ id: 'contract.shenqingzhuangtai' })}</div>
<div className={styles.status}>{item.icon} {item.name}</div> <div className={styles.status}>{item.icon} {item.name}</div>
</div> </div>
<div className={styles.apply_status_btn}> <div className={styles.apply_status_btn}>
<Button size='middle' style={{ color: item.color }} onClick={AuthApply}> <AuthButton btnCode='ElectronicSignature.apply' menuCode='contract'>
{item.status === 1 ? intl.formatMessage({id: 'contract.lijishenqing'}) : intl.formatMessage({id: 'contract.chongxinshenqing'})} <Button size='middle' style={{ color: item.color }} onClick={AuthApply}>
</Button> {item.status === 1 ? intl.formatMessage({ id: 'contract.lijishenqing' }) : intl.formatMessage({ id: 'contract.chongxinshenqing' })}
{data.state === 3 && <Button style={{ marginLeft: '24px' }} size='middle' ghost>{intl.formatMessage({id: 'contract.zhakanjindu'})}</Button>} </Button>
</AuthButton>
{data.state === 3 && <Button style={{ marginLeft: '24px' }} size='middle' ghost>{intl.formatMessage({ id: 'contract.zhakanjindu' })}</Button>}
</div> </div>
</div> </div>
} }
...@@ -95,14 +99,14 @@ const Apply = () => { ...@@ -95,14 +99,14 @@ const Apply = () => {
<> <>
{data.state !== 1 ? {data.state !== 1 ?
<div className={styles.apply_item}> <div className={styles.apply_item}>
<Descriptions title={intl.formatMessage({id: 'contract.shenqingxinxi'})} column={1}> <Descriptions title={intl.formatMessage({ id: 'contract.shenqingxinxi' })} column={1}>
<Descriptions.Item label={intl.formatMessage({id: 'contract.gongsimingcheng'})}>{data.orgName}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.gongsimingcheng' })}>{data.orgName}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.tongyishehuixinyongdaima'})}>{data.orgCode}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.tongyishehuixinyongdaima' })}>{data.orgCode}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.farenxingming'})}>{data.legalRepName}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.farenxingming' })}>{data.legalRepName}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.farenshoujihao'})}>{data.legalRepMobile}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.farenshoujihao' })}>{data.legalRepMobile}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.farenshenfenzhenghao'})}>{data.legalRepIdNo}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.farenshenfenzhenghao' })}>{data.legalRepIdNo}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.renzhengfangshi'})}>-</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.renzhengfangshi' })}>-</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.yanzhengfangshi'})}>-</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.yanzhengfangshi' })}>-</Descriptions.Item>
</Descriptions> </Descriptions>
</div> </div>
: :
...@@ -116,11 +120,11 @@ const Apply = () => { ...@@ -116,11 +120,11 @@ const Apply = () => {
<> <>
{data.state !== 1 ? {data.state !== 1 ?
<div className={styles.apply_item}> <div className={styles.apply_item}>
<Descriptions title={intl.formatMessage({id: 'contract.shenqingxinxi'})} column={1}> <Descriptions title={intl.formatMessage({ id: 'contract.shenqingxinxi' })} column={1}>
<Descriptions.Item label={intl.formatMessage({id: 'contract.xingming'})}>{data.transactorName}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.xingming' })}>{data.transactorName}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.shoujihao'})}>{data.transactorMobile}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.shoujihao' })}>{data.transactorMobile}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.shenfenzhenghao'})}>{data.transactorIdNumber}</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.shenfenzhenghao' })}>{data.transactorIdNumber}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({id: 'contract.yanzhengfangshi'})}>-</Descriptions.Item> <Descriptions.Item label={intl.formatMessage({ id: 'contract.yanzhengfangshi' })}>-</Descriptions.Item>
</Descriptions> </Descriptions>
</div> </div>
: :
......
...@@ -33,10 +33,10 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -33,10 +33,10 @@ const AddContract: React.FC<parmas> = (props) => {
const isJpgOrPng = type === 'doc' || type === 'docx'; const isJpgOrPng = type === 'doc' || type === 'docx';
const isLt20M = file.size / 1024 / 1024 < 20; const isLt20M = file.size / 1024 / 1024 < 20;
if (!isJpgOrPng) { if (!isJpgOrPng) {
message.error(intl.formatMessage({id: 'contract.bushidocdocxwenjian'})); message.error(intl.formatMessage({ id: 'contract.bushidocdocxwenjian' }));
} }
if (!isLt20M) { if (!isLt20M) {
message.error(intl.formatMessage({id: 'contract.shangchuanwenjiandaxiaobuchao'})); message.error(intl.formatMessage({ id: 'contract.shangchuanwenjiandaxiaobuchao' }));
} }
return isJpgOrPng && isLt20M; return isJpgOrPng && isLt20M;
} }
...@@ -101,7 +101,7 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -101,7 +101,7 @@ const AddContract: React.FC<parmas> = (props) => {
sharedFn(parmas) sharedFn(parmas)
console.log(parmas) console.log(parmas)
} else { } else {
message.warning(intl.formatMessage({id: 'contract.qingxianshangchuanhetongwenjian'})) message.warning(intl.formatMessage({ id: 'contract.qingxianshangchuanhetongwenjian' }))
} }
...@@ -163,37 +163,37 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -163,37 +163,37 @@ const AddContract: React.FC<parmas> = (props) => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description={intl.formatMessage({id: 'contract.fanhui'})}/>} backIcon={<ReutrnEle description={intl.formatMessage({ id: 'contract.fanhui' })} />}
> >
<Card> <Card>
<div className={styles.addcontract_wrap}> <div className={styles.addcontract_wrap}>
<Form form={form}> <Form form={form}>
<Form.Item label={intl.formatMessage({id: 'contract.hetongmubanmingcheng'})} colon={false} name='name' rules={[{ required: page_type && true, message: intl.formatMessage({id: 'contract.qingshuruhetongmubanming'}) }]}> <Form.Item label={intl.formatMessage({ id: 'contract.hetongmubanmingcheng' })} colon={false} name='name' rules={[{ required: page_type && true, message: intl.formatMessage({ id: 'contract.qingshuruhetongmubanming' }) }]}>
{page_type ? <Input /> : <span>{data.name}</span>} {page_type ? <Input /> : <span>{data.name}</span>}
</Form.Item> </Form.Item>
<Form.Item label={intl.formatMessage({id: 'contract.banbenhao'})} colon={false} name='version' rules={[{ required: page_type && true, message: intl.formatMessage({id: 'contract.qingshurubanbenhao'}) }]}> <Form.Item label={intl.formatMessage({ id: 'contract.banbenhao' })} colon={false} name='version' rules={[{ required: page_type && true, message: intl.formatMessage({ id: 'contract.qingshurubanbenhao' }) }]}>
{page_type ? <Input /> : <span>{data.version}</span>} {page_type ? <Input /> : <span>{data.version}</span>}
</Form.Item> </Form.Item>
{!page_type && {!page_type &&
<Form.Item label={intl.formatMessage({id: 'contract.zhuangtai'})} colon={false} name='status'> <Form.Item label={intl.formatMessage({ id: 'contract.zhuangtai' })} colon={false} name='status'>
<span>{data.state === 1 ? <><Badge status="success" /> {intl.formatMessage({id: 'contract.youxiao'})}</> : <><Badge status="error" /> {intl.formatMessage({id: 'contract.shixiao'})}</>}</span> <span>{data.state === 1 ? <><Badge status="success" /> {intl.formatMessage({ id: 'contract.youxiao' })}</> : <><Badge status="error" /> {intl.formatMessage({ id: 'contract.shixiao' })}</>}</span>
</Form.Item> </Form.Item>
} }
<Form.Item label={intl.formatMessage({id: 'contract.hetongmubanshuoming'})} colon={false} name='description'> <Form.Item label={intl.formatMessage({ id: 'contract.hetongmubanshuoming' })} colon={false} name='description'>
{page_type ? <TextArea rows={4} /> : <span>{data.description}</span>} {page_type ? <TextArea rows={4} /> : <span>{data.description}</span>}
</Form.Item> </Form.Item>
<Form.Item label={<div>{intl.formatMessage({id: 'contract.hetongwenjianmubanyangli'})}&nbsp;<Tooltip placement="top" title={intl.formatMessage({id: 'contract.zhizuohetongmubanqian'})}><QuestionCircleOutlined /></Tooltip></div>} colon={false}> <Form.Item label={<div>{intl.formatMessage({ id: 'contract.hetongwenjianmubanyangli' })}&nbsp;<Tooltip placement="top" title={intl.formatMessage({ id: 'contract.zhizuohetongmubanqian' })}><QuestionCircleOutlined /></Tooltip></div>} colon={false}>
<div className={styles.upload_item}> <div className={styles.upload_item}>
<div className={styles.upload_left}> <div className={styles.upload_left}>
<FileWordFilled /> <FileWordFilled />
<span>{fileExampleUrl.contractName}</span> <span>{fileExampleUrl.contractName}</span>
</div> </div>
<div className={styles.upload_right}> <div className={styles.upload_right}>
<span onClick={() => onDownload(fileExampleUrl)}>{intl.formatMessage({id: 'contract.xiazai'})}</span> <span onClick={() => onDownload(fileExampleUrl)}>{intl.formatMessage({ id: 'contract.xiazai' })}</span>
</div> </div>
</div> </div>
</Form.Item> </Form.Item>
<Form.Item name="uploadFile" rules={[{ required: Object.keys(uploadFile).length === 0, message: intl.formatMessage({id: 'contract.qingxianshangchuanhetongxinxi'}) }]} label={<div>{intl.formatMessage({id: 'contract.hetongwenjianmuban'})}&nbsp;<Tooltip placement="top" title={intl.formatMessage({id: 'contract.zhizuowanchengdehetongmu'})}><QuestionCircleOutlined /></Tooltip></div>} colon={false} <Form.Item name="uploadFile" rules={[{ required: Object.keys(uploadFile).length === 0, message: intl.formatMessage({ id: 'contract.qingxianshangchuanhetongxinxi' }) }]} label={<div>{intl.formatMessage({ id: 'contract.hetongwenjianmuban' })}&nbsp;<Tooltip placement="top" title={intl.formatMessage({ id: 'contract.zhizuowanchengdehetongmu' })}><QuestionCircleOutlined /></Tooltip></div>} colon={false}
> >
<div className={styles.upload_data}> <div className={styles.upload_data}>
{Object.keys(uploadFile).length > 0 && {Object.keys(uploadFile).length > 0 &&
...@@ -203,7 +203,7 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -203,7 +203,7 @@ const AddContract: React.FC<parmas> = (props) => {
<span>{uploadFile.name}</span> <span>{uploadFile.name}</span>
</div> </div>
<div className={styles.upload_right}> <div className={styles.upload_right}>
<span onClick={() => onView(uploadFile)}>{intl.formatMessage({id: 'contract.yulan'})}</span> <span onClick={() => onView(uploadFile)}>{intl.formatMessage({ id: 'contract.yulan' })}</span>
{page_type && <DeleteOutlined onClick={delectContract} />} {page_type && <DeleteOutlined onClick={delectContract} />}
</div> </div>
</div> </div>
...@@ -219,21 +219,21 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -219,21 +219,21 @@ const AddContract: React.FC<parmas> = (props) => {
onChange={handleChange} onChange={handleChange}
accept='.doc,.docx' accept='.doc,.docx'
> >
<Button loading={loading} disabled={loading} icon={<UploadOutlined />}>{intl.formatMessage({id: 'contract.shangchuanwenjian'})}</Button> <Button loading={loading} disabled={loading} icon={<UploadOutlined />}>{intl.formatMessage({ id: 'contract.shangchuanwenjian' })}</Button>
<div style={{ marginTop: '8px' }}>{intl.formatMessage({id: 'contract.zhichikuozhanmingdocwenjian'})}</div> <div style={{ marginTop: '8px' }}>{intl.formatMessage({ id: 'contract.zhichikuozhanmingdocwenjian' })}</div>
</Upload> </Upload>
} }
</Form.Item> </Form.Item>
{page_type && {page_type &&
<Form.Item style={{ marginLeft: '174px' }}> <Form.Item style={{ marginLeft: '174px' }}>
<Button type="primary" style={{ marginRight: '24px' }} onClick={onSubmit}>{intl.formatMessage({id: 'contract.baocun'})}</Button> <Button type="primary" style={{ marginRight: '24px' }} onClick={onSubmit}>{intl.formatMessage({ id: 'contract.baocun' })}</Button>
<Popconfirm <Popconfirm
title="{intl.formatMessage({id: 'contract.weibaocunshifouqueding'})}" title="{intl.formatMessage({id: 'contract.weibaocunshifouqueding'})}"
onConfirm={confirm} onConfirm={confirm}
okText={intl.formatMessage({id: 'contract.shi'})} okText={intl.formatMessage({ id: 'contract.shi' })}
cancelText={intl.formatMessage({id: 'contract.fou'})} cancelText={intl.formatMessage({ id: 'contract.fou' })}
> >
<Button>{intl.formatMessage({id: 'contract.quxiao'})}</Button> <Button>{intl.formatMessage({ id: 'contract.quxiao' })}</Button>
</Popconfirm> </Popconfirm>
</Form.Item> </Form.Item>
} }
......
...@@ -10,6 +10,8 @@ import EyePreview from '@/components/EyePreview'; ...@@ -10,6 +10,8 @@ import EyePreview from '@/components/EyePreview';
import { PlusOutlined, PlayCircleOutlined, PauseCircleOutlined } from '@ant-design/icons'; import { PlusOutlined, PlayCircleOutlined, PauseCircleOutlined } from '@ant-design/icons';
import { getContractContractTemplatePage, postContractContractTemplateDelete, postContractContractTemplateEnable } from '@/services/ContractV2Api'; import { getContractContractTemplatePage, postContractContractTemplateDelete, postContractContractTemplateEnable } from '@/services/ContractV2Api';
const formActions = createFormActions(); const formActions = createFormActions();
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const intl = getIntl(); const intl = getIntl();
...@@ -27,6 +29,7 @@ const Template: React.FC<{}> = () => { ...@@ -27,6 +29,7 @@ const Template: React.FC<{}> = () => {
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<EyePreview <EyePreview
type={AuthUrl('templateList.see', 'contract') ? 'link' : 'button'}
url={`/memberCenter/contract/template/detail?id=${record.id}`} url={`/memberCenter/contract/template/detail?id=${record.id}`}
> >
{text} {text}
...@@ -49,16 +52,19 @@ const Template: React.FC<{}> = () => { ...@@ -49,16 +52,19 @@ const Template: React.FC<{}> = () => {
render: (text: any, record: any) => { render: (text: any, record: any) => {
let component: ReactNode = null let component: ReactNode = null
component = ( component = (
<Popconfirm <AuthButton menuCode="contract" btnCode='templateList.state' >
title={intl.formatMessage({ id: 'contract.quedingyaozhixingzhegecao' })} <Popconfirm
onConfirm={() => confirm(record)} title={intl.formatMessage({ id: 'contract.quedingyaozhixingzhegecao' })}
okText={intl.formatMessage({ id: 'contract.shi' })} onConfirm={() => confirm(record)}
cancelText={intl.formatMessage({ id: 'contract.fou' })} okText={intl.formatMessage({ id: 'contract.shi' })}
> cancelText={intl.formatMessage({ id: 'contract.fou' })}
<Button >
type="link" <Button
style={record.state ? { color: '#00B37A' } : { color: 'red' }}>{record.state ? <>{intl.formatMessage({id: 'contract.youxiao'})} <PlayCircleOutlined /></> : <>{intl.formatMessage({id: 'contract.wuxiao'})} <PauseCircleOutlined /></>}</Button> type="link"
</Popconfirm> style={record.state ? { color: '#00B37A' } : { color: 'red' }}>{record.state ? <>{intl.formatMessage({ id: 'contract.youxiao' })} <PlayCircleOutlined /></> : <>{intl.formatMessage({ id: 'contract.wuxiao' })} <PauseCircleOutlined /></>}</Button>
</Popconfirm>
</AuthButton>
) )
return component return component
} }
...@@ -72,20 +78,26 @@ const Template: React.FC<{}> = () => { ...@@ -72,20 +78,26 @@ const Template: React.FC<{}> = () => {
<> <>
{record.state === 0 && {record.state === 0 &&
<> <>
<Button disabled={record.state === 1} style={{ padding: '0px', marginRight: '24px' }} type='link'><Link to={`/memberCenter/contract/template/edit?id=${record.id}`}>{intl.formatMessage({id: 'contract.bianji'})}</Link></Button> <AuthButton menuCode="contract" btnCode='templateList.edit' >
<Popconfirm <Button disabled={record.state === 1} style={{ padding: '0px', marginRight: '24px' }} type='link'><Link to={`/memberCenter/contract/template/edit?id=${record.id}`}>{intl.formatMessage({ id: 'contract.bianji' })}</Link></Button>
title={intl.formatMessage({ id: 'contract.quedingyaozhixingzhegecao' })} </AuthButton>
onConfirm={() => confirmDel(record)}
okText={intl.formatMessage({ id: 'contract.shi' })} <AuthButton menuCode="contract" btnCode='templateList.del' >
cancelText={intl.formatMessage({ id: 'contract.fou' })} <Popconfirm
disabled={record.state === 1} title={intl.formatMessage({ id: 'contract.quedingyaozhixingzhegecao' })}
> onConfirm={() => confirmDel(record)}
<Button okText={intl.formatMessage({ id: 'contract.shi' })}
cancelText={intl.formatMessage({ id: 'contract.fou' })}
disabled={record.state === 1} disabled={record.state === 1}
style={{ padding: '0px' }} >
type="link" <Button
>{intl.formatMessage({id: 'contract.shanchu'})}</Button> disabled={record.state === 1}
</Popconfirm> style={{ padding: '0px' }}
type="link"
>{intl.formatMessage({ id: 'contract.shanchu' })}</Button>
</Popconfirm>
</AuthButton>
</> </>
} }
...@@ -117,13 +129,16 @@ const Template: React.FC<{}> = () => { ...@@ -117,13 +129,16 @@ const Template: React.FC<{}> = () => {
const Actions = ( const Actions = (
<Space> <Space>
<Button <AuthButton menuCode="contract" btnCode='templateList.add' >
type="primary" <Button
icon={<PlusOutlined />} type="primary"
onClick={handleJumpAdd} icon={<PlusOutlined />}
> onClick={handleJumpAdd}
{intl.formatMessage({id: 'contract.xinjian'})} >
</Button> {intl.formatMessage({ id: 'contract.xinjian' })}
</Button>
</AuthButton>
</Space> </Space>
); );
......
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