Commit cd264ca1 authored by 前端-彭佳文's avatar 前端-彭佳文

Merge branch 'v2-0418-xxx' into 'v2-220418'

请购单按钮权限添加 See merge request linkseeks-design/pro-platform!288
parents d53ff062 c0863f72
......@@ -58,7 +58,7 @@ const BillDelivery: React.FC<BasicInfoProps> = ({ cardTitle, type, styles }) =>
{_v?.noTitle ? null : <Col span={6} className={style['card-list_title']}>{_v.title}</Col>}
{
_data.deliveryMethodName == "物流" && _v.title == '送货地址:' ?
<Col><p style={{ paddingRight: 20 }}>{_data.receiverAddressResponse.provinceName + _data.receiverAddressResponse.districtName + _data.receiverAddressResponse.cityName}</p></Col>
<Col><p style={{ paddingRight: 20 }}>{_data.deliveryAddressId ? _data.receiverAddressResponse.provinceName + _data.receiverAddressResponse.districtName + _data.receiverAddressResponse.cityName : _data.deliveryAddress}</p></Col>
: <Col><p style={{ paddingRight: 20 }}>{_v.render ? _v.render(dataSource[_v.name], dataSource) : dataSource[_v.name]}</p></Col>
}
......
......@@ -4,6 +4,7 @@ import EyePreview from '@/components/EyePreview'
import { history, useIntl } from 'umi'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getPurchaseRequisitionOrderPageSelectOption } from '@/pages/transaction/effect';
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
/** 采购 请购单查询 带内部状态schmea */
export const tableSearchListSchema: any = (align?: String, colStyle?: Object) => {
......@@ -212,7 +213,7 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
}
/** 采购 请购单 公共列 */
export const baseOrderListColumns: any = () => {
export const baseOrderListColumns: any = (code: string) => {
const intl = useIntl()
return [
......@@ -223,7 +224,7 @@ export const baseOrderListColumns: any = () => {
key: 'requisitionNo',
render: (text, record) => {
return (
<EyePreview url={`${history.location.pathname}/preview?id=${record.id}`}>
<EyePreview type={AuthUrl(code) ? 'link' : 'button'} url={`${history.location.pathname}/preview?id=${record.id}`}>
{text}
</EyePreview>
)
......
......@@ -10,11 +10,12 @@ import { useHttpRequest } from '@/hooks/useHttpRequest';
import { history, useIntl } from 'umi';
import ApprovedOrderModal from '@/pages/transaction/components/approvedOrderModal';
import { postPurchaseRequisitionFirstAudit } from '@/services/PurchaseV2Api';
import AuthButton from '@/components/AuthButton';
// 待审核请购单详情 一级
const FirstOrderPreview: React.FC = () => {
const { formContext, id, anchorTitleList } = useBillDetail({type: 'requestBill'})
const { formContext, id, anchorTitleList } = useBillDetail({ type: 'requestBill' })
const { run, loading } = useHttpRequest(postPurchaseRequisitionFirstAudit)
const approvedRef = useRef<any>({})
......@@ -25,7 +26,7 @@ const FirstOrderPreview: React.FC = () => {
// 提交表单
const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async ({values}) => {
approvedRef.current.actions.submit().then(async ({ values }) => {
const params = {
id: Number(id),
...values,
......@@ -46,9 +47,11 @@ const FirstOrderPreview: React.FC = () => {
formContext={formContext}
anchorList={anchorTitleList}
extraRight={
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
<AuthButton btnCode='firstApprovedBill.xiangqingshenhe'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
</AuthButton>
}
/>
<BillDetailWrapper>
......
......@@ -16,7 +16,7 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'审核': 'DevTest',
'审核': 'firstApprovedBill.shenhe',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.shenhe', defaultMessage: '审核' })]: true }
......@@ -34,7 +34,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns("firstApprovedBill.see")
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -25,6 +25,7 @@ import { getPurchaseRequisitionDeliveryMethodItems, getPurchaseRequisitionDetail
import { UPLOAD_TYPE } from '@/constants'
import styles from './index.less'
import { getAuth } from '@/utils/auth'
import AuthButton from '@/components/AuthButton'
const addSchemaAction = createFormActions()
......@@ -450,9 +451,11 @@ const IncreaseRequisition: React.FC<{}> = () => {
title={id ? intl.formatMessage({ id: 'purchaseRequisition.bianjiqinggoudan', defaultMessage: '编辑请购单' }) : intl.formatMessage({ id: 'purchaseRequisition.xinzengqinggoudan', defaultMessage: '新增请购单' })}
schema={increaseSchema}
extraRight={[
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
{intl.formatMessage({ id: 'purchaseRequisition.baocun', defaultMessage: '保存' })}
</Button>,
<AuthButton btnCode={id ? 'increaseRequisition.bianji' : 'increaseRequisition.xingzheng'}>
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
{intl.formatMessage({ id: 'purchaseRequisition.baocun', defaultMessage: '保存' })}
</Button>,
</AuthButton>
]}
/>
<FormDetailWrapper>
......
......@@ -93,8 +93,8 @@ const RequestBill: React.FC<RequestBillProps> = () => {
/** 参照后台数据生成 */
const renderOptionButton = record => {
const btnAuthOfOperationTextMap = {
'取消订单': 'DevTest',
'中止': 'DevTest',
'取消订单': 'purchaseRequisition.quxiaodingdan',
'中止': 'purchaseRequisition.zhongzhi',
}
const buttonGroup = {
......@@ -129,7 +129,7 @@ const RequestBill: React.FC<RequestBillProps> = () => {
};
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns();
const alreadyColumns = baseOrderListColumns('purchaseRequisition.see');
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -16,6 +16,7 @@ import { createAsyncFormActions, createFormActions, FormEffectHooks } from '@for
import { searchOptionEffect } from './effect';
import { getMemberUserPage } from '@/services/MemberV2Api';
import NiceForm from '@/components/NiceForm';
import AuthButton from '@/components/AuthButton';
// 待新增请购单
......@@ -52,13 +53,16 @@ const ReadyAddBill: React.FC<ReadyAddBillProps> = () => {
const controllerBtns = (
<Space>
<Button
icon={<PlusCircleOutlined />}
type='primary'
onClick={clickAdd}
>
{intl.formatMessage({ id: 'purchaseRequisition.xinjian', defaultMessage: '新建' })}
</Button>
<AuthButton btnCode='readyAddBill.add'>
<Button
icon={<PlusCircleOutlined />}
type='primary'
onClick={clickAdd}
>
{intl.formatMessage({ id: 'purchaseRequisition.xinjian', defaultMessage: '新建' })}
</Button>
</AuthButton>
</Space>
)
return <PageHeaderWrapper>
......
......@@ -34,9 +34,9 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'提交审核': 'DevTest',
'修改': 'DevTest',
'删除': 'DevTest',
'提交审核': 'readyAddBill.tijiaoshenhe',
'修改': 'readyAddBill.xiugai',
'删除': 'readyAddBill.shanchu',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })]: record.showSubmit, [intl.formatMessage({ id: 'purchaseRequisition.xiugai', defaultMessage: '修改' })]: true, [intl.formatMessage({ id: 'purchaseRequisition.shanchu', defaultMessage: '删除' })]: record.showDelete }
......@@ -56,7 +56,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns("readyAddBill.add")
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -9,18 +9,19 @@ import { Button } from 'antd';
import { useHttpRequest } from '@/hooks/useHttpRequest';
import { history, useIntl } from 'umi';
import { postPurchaseRequisitionSubmit } from '@/services/PurchaseV2Api';
import AuthButton from '@/components/AuthButton';
// 待提交请购单详情
const ReadySubmitBillDetail: React.FC = () => {
const { formContext, id, anchorTitleList } = useBillDetail({type: 'requestBill'})
const { formContext, id, anchorTitleList } = useBillDetail({ type: 'requestBill' })
const intl = useIntl()
const { run, loading } = useHttpRequest(postPurchaseRequisitionSubmit)
const approvedRef = useRef<any>({})
const handleClick = async () => {
const result = await run({id})
const result = await run({ id })
if (result.code === 1000) {
history.goBack()
}
......@@ -33,9 +34,11 @@ const ReadySubmitBillDetail: React.FC = () => {
formContext={formContext}
anchorList={anchorTitleList}
extraRight={
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
<AuthButton btnCode='readySubmitBill.xiangqingsheng'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
</AuthButton>
}
/>
<BillDetailWrapper>
......
......@@ -7,7 +7,7 @@ import TableOperation from '@/components/TableOperation'
// 待提交请购单 Hook
export const useSelfTable = () => {
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({ customKey: 'id' })
const intl = useIntl()
......@@ -15,8 +15,11 @@ export const useSelfTable = () => {
history.push(`/memberCenter/procurementAbility/purchaseRequisition/readySubmitBill/detail?id=${id}`)
}
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'审核': 'readySubmitBill.shenhe',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.shenhe', defaultMessage: '审核' })]: true }
const operationHandler = {
......@@ -27,13 +30,14 @@ export const useSelfTable = () => {
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
const alreadyColumns = baseOrderListColumns("readySubmitBill.see")
if (alreadyColumns) {
return alreadyColumns.concat([
{
title: intl.formatMessage({ id: 'purchaseRequisition.caozuo', defaultMessage: '操作' }),
......
......@@ -34,7 +34,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns('readyRequisitionOrder.see')
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -10,12 +10,13 @@ import { useHttpRequest } from '@/hooks/useHttpRequest';
import { history, useIntl } from 'umi';
import ApprovedOrderModal from '@/pages/transaction/components/approvedOrderModal';
import { postPurchaseRequisitionTwoAudit } from '@/services/PurchaseV2Api';
import AuthButton from '@/components/AuthButton';
// 待审核请购单详情 二级
const SecondOrderPreview: React.FC = () => {
const { formContext, id, anchorTitleList } = useBillDetail({type: 'requestBill'})
const { formContext, id, anchorTitleList } = useBillDetail({ type: 'requestBill' })
const intl = useIntl()
const { run, loading } = useHttpRequest(postPurchaseRequisitionTwoAudit)
const approvedRef = useRef<any>({})
......@@ -26,7 +27,7 @@ const SecondOrderPreview: React.FC = () => {
// 提交表单
const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async ({values}) => {
approvedRef.current.actions.submit().then(async ({ values }) => {
const params = {
id: Number(id),
...values,
......@@ -47,9 +48,11 @@ const SecondOrderPreview: React.FC = () => {
formContext={formContext}
anchorList={anchorTitleList}
extraRight={
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
<AuthButton btnCode='secondApprovedBill.xiangqingshenghe'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
</AuthButton>
}
/>
<BillDetailWrapper>
......
......@@ -17,7 +17,7 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'审核': 'DevTest',
'审核': 'secondApprovedBill.shenghe',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.shenhe', defaultMessage: '审核' })]: true }
......@@ -35,7 +35,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns('secondApprovedBill.see')
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
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