Commit 419e7b55 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 新增需求审核页面

parent 932b7eb5
/*
* @Author: HJX
* @Date: 2020-11-17 13:47:40
* @LastEditors: HJX
* @LastEditTime: 2020-11-17 13:47:40
* @RouterName: 需求单审核
*/
const router = {
path: '/demandOrder',
name: 'demandOrder',
icon: 'SmileOutlined',
routes: [{
// 需求单查询列表
path: '/demandOrder/demandOrderInquire',
name: 'demandOrderInquire',
hidePageHeader: true,
component: '@/pages/demandOrder/demandOrderInquire',
},{
// 需求单查询 - 查看详情
path: '/demandOrder/demandOrderInquire/preview',
name: 'demandOrderInquirePreview',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/demandOrder/demandOrderInquire/preview',
},{
// 需求单审核列表
path: '/demandOrder/demandOrderAudit',
name: 'demandOrderAudit',
hidePageHeader: true,
component: '@/pages/demandOrder/demandOrderAudit',
},{
// 需求单审核 - 查看详情
path: '/demandOrder/demandOrderAudit/preview',
name: 'demandOrderAuditPreview',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/demandOrder/demandOrderAudit/preview',
},{
// 需求单审核 - 查看详情 - 审核
path: '/demandOrder/demandOrderAudit/detail',
name: 'demandOrderAuditDetail',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/demandOrder/demandOrderAudit/detail',
}]
}
export default router
\ No newline at end of file
/*
* @Author: HJX
* @Date: 2020-11-17 13:47:40
* @LastEditors: HJX
* @LastEditTime: 2020-11-17 13:47:40
* @RouterName: 需求报价单管理
*/
const router = {
path: '/demandQuoteOrder',
name: 'demandQuoteOrder',
icon: 'SmileOutlined',
routes: [
{
// 需求报价单管理列表
path: '/demandQuoteOrder/demandQuoteOrderInquire',
name: 'demandQuoteOrderInquire',
hidePageHeader: true,
component: '@/pages/demandQuoteOrder',
},
{
// 需求报价单管理 - 报价单号
path: '/demandQuoteOrder/demandQuoteOrderInquire/quote/preview',
name: 'demandQuoteOrderInquireQuote',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/demandQuoteOrder/quote',
},
{
// 需求报价单管理 - 需求单号
path: '/demandQuoteOrder/demandQuoteOrderInquire/demand/preview',
name: 'demandQuoteOrderInquireDemand',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/demandQuoteOrder/demand',
}
]
}
export default router
\ No newline at end of file
/*
* @Author: HJX
* @Date: 2020-11-17 13:47:40
* @LastEditors: HJX
* @LastEditTime: 2020-11-17 13:47:40
* @RouterName: 需求单审核
*/
const router = {
path: '/demand',
name: '采购需求单审核',
routes: [
{
// 采购需求单查询
path: '/demand/demandInquiry',
name: '采购需求单查询',
hidePageHeader: true,
component: '@/pages/demand/demandInquiry',
},
{
// 采购需求单详情
path: '/demand/demandInquiry/preview',
name: '采购需求单详情',
component: '@/pages/demand/detail',
hidePageHeader: true,
hideInMenu: true,
noMargin: true,
},
{
// 待审核采购需求单
path: '/demand/auditDemandInquiry',
name: '待审核采购需求单',
hidePageHeader: true,
component: '@/pages/demand/auditDemandInquiry',
},
{
// 采购需求单详情 审核
path: '/demand/auditDemandInquiry/detail',
name: '待审核采购需求单详情',
component: '@/pages/demand/detail',
hidePageHeader: true,
hideInMenu: true,
noMargin: true,
},
{
// 采购需求单详情
path: '/demand/auditDemandInquiry/preview',
name: '待审核采购需求单详情',
component: '@/pages/demand/detail',
hidePageHeader: true,
hideInMenu: true,
noMargin: true,
},
]
}
export default router
......@@ -10,7 +10,7 @@
// import calssPropertyRoute from './calssPropertyRoute' // 品类属性路由
// import trademarkRoute from './brandRoute' // 品牌路由
// import commodity from './commodityRoute' // 商品审核路由
// import demandOrderRoute from './demandOrderRoute' //需求单审核
import demandRoute from './demandRoute' //需求单审核
// import demandQuoteOrderRoute from './demandQuoteOrderRoute' //需求报价单管理
// import logisticsRoutes from './logisticsRoutes'
// import memberAbility from './memberAbility'
......@@ -32,7 +32,7 @@
//@ts-ignore
import asyncRoutes from '../router.config.json'
// const routeList = [
const routeList = [
// pageCustomized,
// calssPropertyRoute,
// trademarkRoute,
......@@ -46,7 +46,7 @@ import asyncRoutes from '../router.config.json'
// commentRoutes,
// contentRoute,
// balancedRoute,
// demandOrderRoute,
demandRoute,
// demandQuoteOrderRoute,
// capitalAccount,
// messageRoute,
......@@ -56,7 +56,7 @@ import asyncRoutes from '../router.config.json'
// exchangeManageRoutes,
// returnManageRoute,
// repairManageRoute,
// ]
]
const router = [
{
......@@ -97,6 +97,7 @@ const router = [
// component: '@/pages/home',
// icon: 'BarChartOutlined'
// },
...routeList,
...asyncRoutes,
{
path: '/noAuth',
......
......@@ -31,6 +31,7 @@
"start:cross-dev": "cross-env SITE_ID=352 SOCKET_URL=ws://10.0.0.25:9400 yarn start:dev",
"start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 SOCKET_URL=ws://10.0.0.10:9400 yarn start",
"start:25": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.25:8100 SOCKET_URL=ws://10.0.0.25:9400 yarn start",
"start:v2": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.17:8100 SOCKET_URL=ws://10.0.0.17:9400 yarn start",
"start:scm": "cross-env BACK_GATEWAY=http://lingxi-scm.wg.shushangyun.com SOCKET_URL=ws://lingxi-scm.wg.shushangyun.com SITE_ID=1 yarn start",
"start:study": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.1.207:8100 SOCKET_URL=ws://10.0.1.207:9400 yarn start"
},
......
import React, { useRef, useState } from 'react';
import Table from '../components/table'
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button, Tag, Badge, Typography, Space } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../constants';
const { Text } = Typography;
const AuditInquiryOne = () => {
const ref = useRef<any>({});
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const [rowkeys, setRowKeys] = useState<Array<number>>([]);
/** 批量审核 */
const fetchSubmitBatch = async () => {
const res = await PublicApi.postPurchasePlatformPurchaseInquiryExamineBatch({ ids: rowkeys });
if (res.code === 1000) {
ref.current.reload();
}
}
const columns: ColumnType<any>[] = [{
title: '需求单号/摘要',
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview
url={`/demand/auditDemandInquiry/preview?id=${record.id}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
<Text type="secondary">{record.details}</Text>
</Space>
)
}, {
title: '需求会员',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => (
<>
<Button
type='link'
onClick={() => history.push(`/demand/auditDemandInquiry/detail?id=${record.id}&number=${record.purchaseInquiryNo}`)}
>
审核
</Button>
</>
)
}];
return (
<Table
selectedRow
reload={ref}
schemaType="PurchaseDemandPublic"
columns={columns}
effects="purchaseInquiryNo"
fetch={PublicApi.getPurchasePlatformPurchaseInquiryExamineList}
fetchRowkeys={(e) => setRowKeys(e)}
controllerBtns={
<Row>
<Col span={6}>
<Button
disabled={rowkeys.length === 0}
onClick={fetchSubmitBatch}
>
批量提交审核
</Button>
</Col>
</Row>
}
/>
)
}
export default AuditInquiryOne
.anchorWrap {
:global {
.ant-anchor {
display: flex;
.ant-anchor-ink {
display: none;
}
.ant-anchor-link {
padding: 14px 0 !important;
margin: 0 16px;
.ant-anchor-link-title {
font-size: 14px;
color: #909399;
}
}
.ant-anchor-link-active {
position: relative;
border-bottom: 2px solid #00B37A;
box-sizing: border-box;
.ant-anchor-link-title {
font-weight: 500;
color: #303133;
}
}
}
}
.titleBox {
padding: 8px 16px;
}
.anchorBox {
display: flex;
padding: 0 16px;
}
}
/** 卡片样式 */
.card {
margin: 24px;
:global {
.ant-card {
margin-bottom: 24px;
.ant-card-head {
> .ant-card-head-wrapper {
padding: 12px 0;
}
}
.ant-card-extra {
padding: 0 0;
.ant-radio-button-wrapper {
height: 24px;
line-height: 23px;
}
.ant-radio-button-wrapper:hover {
color: #606266;
}
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
color: #fff;
background: #6B778C;
border-color: #6B778C;
}
}
}
.god-table-control {
margin-bottom: 0;
}
}
.list {
display: flex;
h5 {
margin-bottom: 2em;
}
.listLable {
flex: 0 0 25%;
color: #909399;
}
}
}
This diff is collapsed.
.drawerBox {
:global {
.ant-drawer-body {
padding: 0;
.ant-row {
height: 100%;
.ant-anchor {
padding-left: 0px;
.ant-anchor-ink {
display: none;
}
.ant-anchor-link {
padding: 12px 12px 12px 12px;
}
.ant-anchor-link-active {
box-sizing: border-box;
border-left: 2px solid #00B37A;
}
}
}
}
}
.affix_title {
font-size: 14px;
margin-bottom: 12px;
color: #909399;
.divider_style {
width: 2px;
height: 16px;
margin: 0px 5px 0px 0px ;
background-color: #00B37A;
}
}
.list {
display: flex;
h5 {
margin-bottom: 2em;
}
.listLable {
flex: 0 0 25%;
color: #909399;
}
}
}
import React from 'react';
import { Drawer, Anchor, Row, Col, Divider } from 'antd';
import style from './index.less';
const { Link } = Anchor;
interface IProps {
dataSource: any,
visible: boolean,
title?: string,
onOk?: () => void,
onCalcel?: () => void,
}
const DetailDrawer: React.FC<IProps> = (props: any) => {
const { dataSource, visible, title, onOk, onCalcel } = props;
return (
<Drawer
title={title}
placement='right'
visible={visible}
onClose={onCalcel}
width="40%"
className={style.drawerBox}
>
<Row>
<Col span={6}>
<Anchor>
{dataSource.map((item, index) => (
<Link key={`link${index + 1}`} href={`#link${index + 1}`} title={item.linkTitle} />
))}
</Anchor>
</Col>
<Col
span={18}
style={{
height: '100%',
padding: '16px',
overflowY: 'scroll',
borderLeft: '1px solid #F4F5F7',
}}
>
{dataSource.map((item, index) => (
<div key={`link${index + 1}`} id={`#link${index + 1}`}>
<div className={style.affixTitle}>
<Divider type="vertical" className={style.dividerStyle} />
{item.linkTitle}
</div>
{ item.linkContent.map((items, keys) => (
<div key={`content${keys + 1}`} className={style.list}>
<h5 className={style.listLable} style={{ flex: '0 0 100px' }}>{items.label}</h5>
<h5 className={style.listContent}>{items.content}</h5>
</div>
))}
</div>
))}
</Col>
</Row>
</Drawer>
)
}
export default DetailDrawer;
......@@ -5,82 +5,126 @@ import {
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { PublicApi } from '@/services/api';
import { Input, Radio, DatePicker } from '@formily/antd-components'
import moment from 'moment';
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks;
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
export interface IProps {
title: string,
visible: boolean,
id: number,
modalType: 'audit' | 'abandon',
onCancel?: () => void,
onOk?: () => void,
fetch?: () => Promise<unknown>,
}
const AuditModal: React.FC<Params> = (props) => {
const ModalOperate: React.FC<IProps> = (props: any) => {
const {
title,
visible,
id,
onCancel,
onOk,
modalType,
fetch,
} = props;
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('state').subscribe(({ value }) => {
setFieldState('cause', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
}
if (modalType === 'audit') {
onFieldChange$('state').subscribe(({ value }) => {
setFieldState('auditOpinion', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
}
})
})
})
}
}
const disabledDate = (current) => {
return current && current <= moment().startOf('day');
}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id;
PublicApi.postOrderPlatformRequisitionFormAudit(value).then(res => {
if(res.code === 1000) {
props.onOK()
const modalText = modalType === 'audit' ? '审核不通过原因' : '作废原因';
const modalNode = modalType === 'audit' ?
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{}}
/> :
<Field
title="作废时间"
name="reasonTime"
required
x-component="DatePicker"
x-component-props={{
format: 'YYYY-MM-DD HH:mm:ss',
disabledDate,
}}
/>
const handleSubmit = (val: any) => {
let value = { ...val }
let params: any = {}
if (modalType === 'audit') {
params.state = value.state;
value.state !== 1 && (params.auditOpinion = value.auditOpinion);
} else {
params.reason = value.reason
params.reasonTime = new Date(value.reasonTime).getTime();
}
fetch({id, ...params}).then(res => {
if (res.code === 1000) {
onOk()
}
})
}
const handleClose = () => {
onCancel();
actions.reset();
}
return (
<Modal
title='单据审核'
width={576}
visible={props.dialogVisible}
width={600}
title={title}
visible={visible}
onCancel={handleClose}
onOk={() => actions.submit()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
okText='确定'
cancelText={`取消`}
>
<SchemaForm
layout="vertical"
labelCol={6}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
Input,
Radio: Radio.Group,
TextArea: Input.TextArea,
DatePicker,
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
onSubmit={(values) => handleSubmit(values)}
initialValues={{
state: 1
}}
>
{modalNode}
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
<Field
title='审核不通过原因'
name="cause"
title={modalText}
name={modalType === 'audit' ? 'auditOpinion' : 'reason'}
x-component="TextArea"
required
x-component-props={{
......@@ -88,7 +132,6 @@ const AuditModal: React.FC<Params> = (props) => {
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message: '原因最多60个汉字'
}}
/>
......@@ -96,5 +139,4 @@ const AuditModal: React.FC<Params> = (props) => {
</Modal>
)
}
export default AuditModal
\ No newline at end of file
export default ModalOperate;
import React, { useRef, useState, useImperativeHandle } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd';
import { StandardTable } from 'god';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { searchSelectGetSelectCategoryOptionEffect } from '@/pages/systemManage/effect';
import {
PurchaseDemandSchema,
PurchaseDemandPublicSchema,
} from '../../schema';
interface Iprops {
fetch?: () => Promise<unknown>,
fetchRowkeys?(e: any),
controllerBtns?: React.ReactNode,
schemaType?: 'PurchaseDemand' | 'PurchaseDemandPublic',
columns: ColumnType<any>[],
effects?: string,
selectedRow?: boolean,
reload?: any,
}
const formActions = createFormActions();
const Table: React.FC<Iprops> = (props:any) => {
const {
schemaType,
columns,
effects,
fetch,
controllerBtns,
selectedRow,
reload,
fetchRowkeys
} = props;
const tableRef = useRef<any>({});
/** Schema */
const SchemaRender = () => {
switch (schemaType) {
case 'PurchaseDemand':
return PurchaseDemandSchema
case 'PurchaseDemandPublic':
return PurchaseDemandPublicSchema
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
fetch({ ...params }).then(res => {
resolve(res.data)
})
})
}
/**多选 */
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([]);
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
fetchRowkeys(selectedRowKeys)
setSelectedRowKeys(selectedRowKeys);
},
}
useImperativeHandle(reload, () => ({
reload: () => {
tableRef.current.reload();
}
}));
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={tableRef}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={ selectedRow && rowSelection }
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
expressionScope={{ controllerBtns }}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, effects, FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions, 'category')
})
}}
schema={
schemaType && SchemaRender()
}
>
</NiceForm>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default Table;
/** 报价外部状态 */
export const OFFTER_EXTERNALSTATE = {
'-1': '作废',
99: '已完成',
1: '待提交需求单',
2: '待审核需求单',
3: '待提交报价单',
4: '待确认授标结果'
}
/** 报价外部状态颜色 */
export const OFFTER_EXTERNALSTATE_COLOR = {
'-1': 'error',
99: 'success',
1: 'default',
2: 'warning',
3: 'warning',
4: 'warning'
}
/** 报价内部状态 */
export const OFFTER_INTERNALSTATE = {
'-1': '作废',
99: '已完成',
1: '待比价',
2: '待审核授标结果(一级)',
3: '待审核授标结果(二级)',
4: '待确认授标结果',
5: '审核授标结果通过(一级)',
6: '审核授标结果通过(二级)',
7: '审核授标结果不通过(一级)',
8: '审核授标结果不通过(二级)',
}
/** 报价内部状态颜色 */
export const OFFTER_INTERNALSTATE_COLOR = {
'-1': 'error',
99: 'success',
1: 'default',
2: 'warning',
3: 'warning',
4: 'warning',
5: 'success',
6: 'success',
7: 'error',
8: 'error',
}
export enum OFFTER_INTERNALSTATE_TYPE {
/** 作废 */
ABANDON_TYPE = -1,
/** 待提交审核 */
WAITSUBMITAUDIT_TYPE = 1,
/** 待审核(一级) */
WAITAUDIT1_TYPE,
/** 待审核(二级) */
WAITAUDIT2_TYPE,
/** 待提交报价单 */
WAITSUBMITOFFTER_TYPE,
/** 待比价 */
WAITSTHAN_TYPE,
/** 审核通过(一级) */
AUDITPASS1_TYPE,
/** 审核通过(二级) */
AUDITPASS2_TYPE,
/** 审核不通过(一级) */
AUDITNOPASS1_TYPE,
/** 审核不通过(二级) */
AUDITNOPASS2_TYPE,
/** 已完成 */
SUCCESS_TYPE = 99,
}
import React, { useRef, useState } from 'react';
import Table from '../components/table'
import { Tag, Badge, Typography, Space } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../constants';
const { Text } = Typography;
const Inquiry = () => {
const ref = useRef<any>({});
const [id, setId] = useState<number>();
const [visible, setVisible] = useState<boolean>(false);
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const columns: ColumnType<any>[] = [{
title: '需求单号/摘要',
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview
url={`/demand/demandInquiry/preview?id=${record.id}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
<Text type="secondary">{record.details}</Text>
</Space>
)
}, {
title: '需求会员',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}];
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
schemaType="PurchaseDemand"
columns={columns}
effects="purchaseInquiryNo"
fetch={PublicApi.getPurchasePlatformPurchaseInquiryList}
reload={ref}
/>
</>
)
}
export default Inquiry
.anchorWrap {
:global {
.ant-anchor {
display: flex;
.ant-anchor-ink {
display: none;
}
.ant-anchor-link {
padding: 14px 0 !important;
margin: 0 16px;
.ant-anchor-link-title {
font-size: 14px;
color: #909399;
}
}
.ant-anchor-link-active {
position: relative;
border-bottom: 2px solid #00B37A;
box-sizing: border-box;
.ant-anchor-link-title {
font-weight: 500;
color: #303133;
}
}
}
}
.titleBox {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 16px;
}
.anchorBox {
display: flex;
padding: 0 16px;
}
}
/** 卡片样式 */
.card {
margin: 24px;
:global {
.ant-card {
margin-bottom: 24px;
.ant-card-head {
> .ant-card-head-wrapper {
padding: 12px 0;
}
}
.ant-card-extra {
padding: 0 0;
.ant-radio-button-wrapper {
height: 24px;
line-height: 23px;
}
.ant-radio-button-wrapper:hover {
color: #606266;
}
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
color: #fff;
background: #6B778C;
border-color: #6B778C;
}
}
}
.god-table-control {
margin-bottom: 0;
}
}
.list {
display: flex;
h5 {
margin-bottom: 2em;
}
.listLable {
flex: 0 0 25%;
color: #909399;
}
}
}
This diff is collapsed.
This diff is collapsed.
.col {
margin-bottom: 16px;
}
.subRow {
width: 100%;
.subCol {
width : 100%;
text-align: right;
.select {
width : 160px;
margin : 0 0 16px 16px;
text-align: left;
&:nth-of-type(1) {
margin-left: 0;
}
}
}
}
.mainCol {
background-color: #fff;
margin-bottom : 24px;
padding : 0 24px;
box-sizing : border-box;
&-title {
font-size : 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color : #303133;
padding : 20px 0;
}
&:nth-last-of-type(1) {
margin: 0;
}
&-row {
display : flex;
flex-wrap : wrap;
padding-bottom: 16px;
&-col {
display: flex;
width : calc(100% / 2);
padding: 16px 0;
&-option {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #909399;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #303133;
}
}
}
}
&-rows {
display : flex;
padding-bottom: 16px;
&-cols {
flex: 1;
.cols-main {
display: flex;
padding: 16px 0;
&:nth-last-of-type(1) {
padding-bottom: 0;
}
&-options {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #909399;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #303133;
}
}
}
}
}
}
.nameCell {
text-align: left;
.nameCellTitle {
color : @main-color;
cursor: pointer;
}
.levelIcon1 {
width : 100%;
height : 16px;
background : url("/static/imgs/level1@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
.levelIcon2 {
width : 100%;
height : 16px;
background : url("/static/imgs/level2@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
.levelIcon3 {
width : 100%;
height : 16px;
background : url("/static/imgs/level3@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
}
.headerTop {
display : flex;
align-items: center;
font-size : 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
&-prefix {
width : 48px;
height : 48px;
line-height : 48px;
border-radius : 4px;
border : 1px solid #DFE1E6;
color : #fff;
text-align : center;
background-color: #8777D9;
}
&-name {
color : #303133;
margin: 0 8px 0 12px;
}
}
.headerMain {
display: flex;
&-left {
flex : 6;
display : flex;
flex-wrap : wrap;
padding-left: 90px;
&-option {
display : flex;
width : calc(100% / 3);
margin-bottom: 17px;
font-size : 14px;
font-family : PingFangSC-Regular, PingFang SC;
font-weight : 400;
color : #909399;
padding-right: 20px;
// &:nth-of-type(n + 4) {
// margin: 0;
// }
&:nth-of-type(3n+1) {
margin: 0;
}
div {
flex: 1;
&:nth-last-of-type(1) {
flex: 2;
}
}
}
}
&-right {
flex : 1;
text-align: right;
}
}
.saveBtn {
color : #fff;
background : @main-color;
margin-left: 10px;
}
.item_wrap {
margin-bottom: 24px;
background-color: #FFF;
border-radius: 8px;
padding: 24px;
&:last-child {
margin-bottom: 0px;
}
.mainCol_title {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #303133;
padding: 0px 0 20px;
}
:global {
.ant-tabs-nav {
&::before {
border-bottom-color: #FFF;
}
}
}
}
.header {
:global {
.ant-page-header {
padding: 24px 24px !important;
}
}
}
.upload_item {
width: 498px;
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #00B37A;
cursor: pointer;
:global {
.anticon-link {
color: #00B37A;
font-size: 16px;
margin-right: 8px;
}
}
}
}
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-09-10 11:00:17
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 11:17:09
*/
/**
* @description: 需求选择
* @param {type}
* @return {type}
*/
import React, { Component } from 'react';
import { Space, Radio, Tooltip } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
export interface plarms {
platType: number;//类型 1平台 2系统匹配 3会员选择
changePlatform?: Function;//事件
disabled?: boolean;
}
const PlatType: React.FC<plarms> = (props) => {
return (
<div style={{ marginBottom: '24px' }}>
<Space size={16}>
<Radio.Group disabled={props.disabled} value={props.platType}>
<Radio value={1}>
发布至平台
<Tooltip title="需求发布至企业商城求购频">
<QuestionCircleOutlined />
</Tooltip>
</Radio>
<Radio value={2}>
系统匹配
<Tooltip title="系统通过需求单品类、商品属性、适用地市与平台会员发布的商品品类、
商品属性、归属地区进行匹配,推荐满足条件的平台会员">
<QuestionCircleOutlined />
</Tooltip>
</Radio>
<Radio value={3}>
指定会员
<Tooltip title="选择与当前会员有归属关系的会员且角色类型为服务提供的会员(供应商),
需求只发送给指定会员">
<QuestionCircleOutlined />
</Tooltip>
</Radio>
</Radio.Group>
</Space>
</div>
)
}
PlatType.defaultProps = {
platType: 1,
disabled: false
}
export default PlatType
\ No newline at end of file
import React from 'react';
import DemandDetail from '../components/detail';
import { history } from 'umi';
const DemandOrderAuditDetail:React.FC<{}> = () => {
const { id } = history.location.query
console.log(id)
return(
<DemandDetail
id={id}
type={true}
/>
)
}
export default DemandOrderAuditDetail;
\ No newline at end of file
import React, { useRef, ReactNode, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Tag, Badge, Row, Col, Button, message } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../systemManage/effect'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { demandOrderAuditSchema } from '../schema';
import moment from 'moment';
import EyePreview from '@/components/EyePreview';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import { history } from 'umi';
const formActions = createFormActions();
const DemandOrderAudit:React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const ExternalState = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Tag color="default">提交询价单</Tag>:
text === 2 ? component = <Tag color="processing">提交报价单</Tag>:
text === 3 ? component = <Tag color="warning">确认报价单</Tag>:
text === 4 ? component = <Tag color="success">报价通过</Tag>:
component = <Tag color="error">报价不通过</Tag>
return component;
}
const InteriorState = (text:any) => {
// 内部状态:1.新增需求单 2.审核通过 3.审核通过 4.待提交需求单 5.审核通过 6.审核通过 7.取消报价单
let component: ReactNode = null;
text === 1 ? component = <Badge text="新增需求单" status="default"/>:
text === 2 ? component = <Badge text="审核通过" status="success"/>:
text === 3 ? component = <Badge text="审核通过" status="success"/>:
text === 4 ? component = <Badge text="待提交需求单" status="warning"/>:
text === 5 ? component = <Badge text="审核通过" status="success"/>:
text === 6 ? component = <Badge text="审核通过" status="error"/>:
component = <Badge text="取消报价单" status="error"/>
return component;
}
//审核跳转
const handleAuditOperations = (id: number) => {
history.push(`/demandOrder/demandOrderAudit/detail?id=${id}`);
}
// 表头
const columns: ColumnType<any>[] = [{
title: '需求单号',
key: 'requisitionFormNo',
dataIndex: 'requisitionFormNo',
render: (text: any, record: any) => <EyePreview
url={`/demandOrder/demandOrderAudit/preview?id=${record.id}`}>{text}</EyePreview>
},{
title: '需求摘要',
key: 'details',
dataIndex: 'details',
},{
title: '品类',
key: 'category',
dataIndex: 'category',
},{
title: '需求会员',
key: 'demandMembers',
dataIndex: 'demandMembers',
},{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
},{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
render: (text: any, record: any) => format(text)
},{
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
},{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => ExternalState(text)
},{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => InteriorState(text)
},{
title: '操作',
key: 'auditOperations',
dataIndex: 'auditOperations',
render: (text: any, record: any) => <Button type='link' onClick={() => handleAuditOperations(record.id)}>审核</Button>
}]
const fecheData = (params:any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderPlatformReviewedRequisitionFormList({...params}).then(res => {
resolve(res.data)
})
})
}
// 搜索
const search = (values: any) => {
if (values.voucherTime) {
values.startDocumentsTime = timeRange(values.voucherTime).st
values.endDocumentsTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
ref.current.reload(values)
}
// 批量选择
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
// 批量审核按钮
const controllerBtns = <Row>
<Col span={24}>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量审核通过</Button>
</Col>
</Row>
// 批量提交
const handleSubmitAll = (ids: number[]) => {
if(ids.length === 0){
message.error('请选择要操作的需求单')
return
} else {
PublicApi.postOrderPlatformRequisitionFormAuditAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
}
return(
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params:any) => fecheData(params)}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
expressionScope={{
controllerBtns
}}
schema={demandOrderAuditSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default DemandOrderAudit
\ No newline at end of file
import React from 'react';
import DemandPreview from '../components/detail';
import { history } from 'umi';
const DemandOrderAuditPreview:React.FC<{}> = () => {
const { id } = history.location.query
console.log(id)
return(
<DemandPreview
id={id}
type={false}
/>
)
}
export default DemandOrderAuditPreview;
\ No newline at end of file
import React, { useRef, ReactNode } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Tag, Badge } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../systemManage/effect'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { demandOrderInquireSchema } from '../schema';
import moment from 'moment';
import EyePreview from '@/components/EyePreview';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const DemandOrderInquire:React.FC<{}> = () => {
const ref = useRef<any>({});
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const ExternalState = (text:any) => {
//外部状态:1.待提交需求单 2.待审核需求单 3.待提交报价单 4.待确认报价单 5.接受报价 6.不接受报价 7.取消报价单
let component: ReactNode = null;
text === 1 ? component = <Tag color="default">待提交需求单</Tag>:
text === 2 ? component = <Tag color="processing">待审核需求单</Tag>:
text === 3 ? component = <Tag color="warning">待提交报价单</Tag>:
text === 4 ? component = <Tag color="warning">待确认报价单</Tag>:
text === 5 ? component = <Tag color="success">接受报价</Tag>:
text === 6 ? component = <Tag color="error">接受报价</Tag>:
component = <Tag color="error">取消报价单</Tag>
return component;
}
const InteriorState = (text:any) => {
// 内部状态:1.新增需求单 2.审核通过 3.审核通过 4.待提交需求单 5.审核通过 6.审核通过 7.取消报价单
let component: ReactNode = null;
text === 1 ? component = <Badge text="新增需求单" status="default"/>:
text === 2 ? component = <Badge text="审核通过" status="success"/>:
text === 3 ? component = <Badge text="审核通过" status="success"/>:
text === 4 ? component = <Badge text="待提交需求单" status="warning"/>:
text === 5 ? component = <Badge text="审核通过" status="success"/>:
text === 6 ? component = <Badge text="审核通过" status="error"/>:
component = <Badge text="取消报价单" status="error"/>
return component;
}
// 表头
const columns: ColumnType<any>[] = [{
title: '需求单号',
key: 'requisitionFormNo',
dataIndex: 'requisitionFormNo',
render: (text: any, record: any) => <EyePreview
url={`/demandOrder/demandOrderInquire/preview?id=${record.id}`}>{text}</EyePreview>
},{
title: '需求摘要',
key: 'details',
dataIndex: 'details',
},{
title: '品类',
key: 'category',
dataIndex: 'category',
},{
title: '需求会员',
key: 'demandMembers',
dataIndex: 'demandMembers',
},{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
},{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
render: (text: any, record: any) => format(text)
},{
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
},{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => ExternalState(text)
},{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => InteriorState(text)
}]
const fecheData = (params:any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderPlatformRequisitionFormList({...params}).then(res => {
resolve(res.data)
})
})
}
// 搜索
const search = (values: any) => {
if (values.voucherTime) {
values.startDocumentsTime = timeRange(values.voucherTime).st
values.endDocumentsTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
ref.current.reload(values)
}
return(
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params:any) => fecheData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={demandOrderInquireSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default DemandOrderInquire
\ No newline at end of file
import React from 'react';
import DemandPreview from '../components/detail';
import { history } from 'umi';
const demandOrderInquirePreview:React.FC<{}> = () => {
const { id } = history.location.query
console.log(id)
return(
<DemandPreview
id={id}
type={false}
/>
)
}
export default demandOrderInquirePreview;
\ No newline at end of file
import React from 'react';
import DemandDetailComponents from '../demandOrder/components/detail';
import { history } from 'umi'
const DemandDetail:React.FC<{}> = () => {
const { id } = history.location.query;
return(
<DemandDetailComponents
id={id}
type={false}
/>
)
}
export default DemandDetail
\ No newline at end of file
.col {
margin-bottom: 16px;
}
.subRow {
width: 100%;
.subCol {
width : 100%;
text-align: right;
.select {
width : 160px;
margin : 0 0 16px 16px;
text-align: left;
&:nth-of-type(1) {
margin-left: 0;
}
}
}
}
.mainCol {
background-color: #fff;
margin-bottom : 24px;
padding : 0 24px;
box-sizing : border-box;
&-title {
font-size : 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color : #303133;
padding : 20px 0;
}
&:nth-last-of-type(1) {
margin: 0;
}
&-row {
display : flex;
flex-wrap : wrap;
padding-bottom: 16px;
&-col {
display: flex;
width : calc(100% / 2);
padding: 16px 0;
&-option {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #909399;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #303133;
}
}
}
}
&-rows {
display : flex;
padding-bottom: 16px;
&-cols {
flex: 1;
.cols-main {
display: flex;
padding: 16px 0;
&:nth-last-of-type(1) {
padding-bottom: 0;
}
&-options {
flex : 1;
font-size : 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color : #909399;
&:nth-last-of-type(1) {
flex : 3;
padding-right: 20px;
box-sizing : border-box;
color : #303133;
}
}
}
}
}
}
.nameCell {
text-align: left;
.nameCellTitle {
color : @main-color;
cursor: pointer;
}
.levelIcon1 {
width : 100%;
height : 16px;
background : url("/static/imgs/level1@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
.levelIcon2 {
width : 100%;
height : 16px;
background : url("/static/imgs/level2@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
.levelIcon3 {
width : 100%;
height : 16px;
background : url("/static/imgs/level3@2x.png") no-repeat;
background-size: 54px 16px;
margin-top : 8px;
}
}
.headerTop {
display : flex;
align-items: center;
font-size : 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
&-prefix {
width : 48px;
height : 48px;
line-height : 48px;
border-radius : 4px;
border : 1px solid #DFE1E6;
color : #fff;
text-align : center;
background-color: #8777D9;
}
&-name {
color : #303133;
margin: 0 8px 0 12px;
}
}
.headerMain {
display: flex;
&-left {
flex : 6;
display : flex;
flex-wrap : wrap;
padding-left: 90px;
&-option {
display : flex;
width : calc(100% / 3);
margin-bottom: 17px;
font-size : 14px;
font-family : PingFangSC-Regular, PingFang SC;
font-weight : 400;
color : #909399;
padding-right: 20px;
// &:nth-of-type(n + 4) {
// margin: 0;
// }
&:nth-of-type(3n+1) {
margin: 0;
}
div {
flex: 1;
&:nth-last-of-type(1) {
flex: 2;
}
}
}
}
&-right {
flex : 1;
text-align: right;
}
}
.saveBtn {
color : #fff;
background : @main-color;
margin-left: 10px;
}
.item_wrap {
margin-bottom: 24px;
background-color: #FFF;
border-radius: 8px;
padding: 24px;
&:last-child {
margin-bottom: 0px;
}
.mainCol_title {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #303133;
padding: 0px 0 20px;
}
:global {
.ant-tabs-nav {
&::before {
border-bottom-color: #FFF;
}
}
}
}
.header {
:global {
.ant-page-header {
padding: 24px 24px !important;
}
}
}
.upload_item {
width: 498px;
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #00B37A;
cursor: pointer;
:global {
.anticon-link {
color: #00B37A;
font-size: 16px;
margin-right: 8px;
}
}
}
}
\ No newline at end of file
import React, { useRef, ReactNode } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Tag, Badge } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../systemManage/effect'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { demandQuoteOrderSchema } from './schema';
import moment from 'moment';
import EyePreview from '@/components/EyePreview';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const DemandOrderInquire:React.FC<{}> = () => {
const ref = useRef<any>({});
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const ExternalState = (text:any) => {
//外部状态:1.提交报价单 2.审核报价单 3.提交报价单 4.确认报价单 5.完成 6.审核不通过 7.取消报价单
let component: ReactNode = null;
text === 1 ? component = <Tag color="default">提交报价单</Tag>:
text === 2 ? component = <Tag color="processing">审核报价单</Tag>:
text === 3 ? component = <Tag color="warning">提交报价单</Tag>:
text === 4 ? component = <Tag color="warning">确认报价单</Tag>:
text === 5 ? component = <Tag color="success">完成</Tag>:
text === 6 ? component = <Tag color="error">审核不通过</Tag>:
component = <Tag color="error">取消报价单</Tag>
return component;
}
// 表头
const columns: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/demandQuoteOrder/demandQuoteOrderInquire/quote/preview?id=${record.id}`}>{text}</EyePreview>
},{
title: '对应需求单号',
key: 'requisitionFormNo',
dataIndex: 'requisitionFormNo',
render: (text: any, record: any) => <EyePreview
url={`/demandQuoteOrder/demandQuoteOrderInquire/demand/preview?id=${record.requisitionId}`}>{text}</EyePreview>
},{
title: '报价单摘要',
key: 'quotationSummary',
dataIndex: 'quotationSummary',
},{
title: '需求会员',
key: 'demandMembers',
dataIndex: 'demandMembers',
},{
title: '报价会员',
key: 'quotedMembers',
dataIndex: 'quotedMembers',
},{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
render: (text: any, record: any) => format(text)
},{
title: '单据时间',
key: 'documentsTime',
dataIndex: 'documentsTime',
render: (text: any, record: any) => format(text)
},{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => ExternalState(text)
}]
const fecheData = (params:any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderPlatformQuotationList({...params}).then(res => {
resolve(res.data)
})
})
}
// 搜索
const search = (values: any) => {
if (values.voucherTime) {
values.startDocumentsTime = timeRange(values.voucherTime).st
values.endDocumentsTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
ref.current.reload(values)
}
return(
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params:any) => fecheData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => search(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($,actions,'quotationNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={demandQuoteOrderSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default DemandOrderInquire
\ No newline at end of file
This diff is collapsed.
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PublicApi } from '@/services/api';
/**
* @description: 需求单列表
* @param {type}
* @return {type}
*/
export const demandQuoteOrderSchema: ISchema = {
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
properties: {
quotationNo: {
type: 'string',
"x-component": "Search",
"x-mega-props": {
},
"x-component-props": {
placeholder: '报价单号',
align: 'flex-left',
}
}
}
},
[FORM_FILTER_PATH]: {
type: 'object',
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'flex-start',
flexWrap: 'nowrap'
},
colStyle: {//改变间隔
marginRight: 20
}
},
properties: {
PRO_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-mega-props": {
span: 5
},
"x-component-props": {
inline: true
},
properties: {
requisitionFormNo: {
type: 'string',
"x-component-props": {
placeholder: '需求单号'
}
},
quotationSummary: {
type: 'string',
"x-component-props": {
placeholder: '报价单摘要'
}
},
voucherTime: {
type: 'string',
"x-component-props": {
placeholder: '单据时间',
style: {
width: 160
}
},
enum: [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
},
demandMembers: {
type: 'string',
"x-component-props": {
placeholder: '需求会员'
}
},
quotedMembers: {
type: 'string',
"x-component-props": {
placeholder: '报价会员'
}
},
externalState: {
type: 'string',
"x-component-props": {
placeholder: '外部状态'
},
//外部状态:1.提交报价单 2.审核报价单 3.提交报价单 4.确认报价单 5.完成 6.审核不通过 7.取消报价单
enum: [
{
label: '提交报价单', value: 1
},
{
label: '审核报价单', value: 2
},
{
label: '提交报价单', value: 3
},
{
label: '确认报价单', value: 4
},
{
label: '完成', value: 5
},
{
label: '审核不通过', value: 6
},
{
label: '取消报价单', value: 7
}
]
},
}
},
sumbit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
\ No newline at end of file
......@@ -11,12 +11,13 @@ import * as SettleApi from './SettleApi';
import * as ReportApi from './reportApi';
import * as EnhanceApi from './enhanceApi';
import * as AfterServiceApi from './AfterServiceApi';
import * as PurchaseApi from './PurchaseApi';
/**
* 可在这里写入自定义的接口
*/
export const CustomApi = {
}
// 公共的接口,从yapi拉下
......@@ -34,4 +35,5 @@ export const PublicApi = {
...ReportApi,
...EnhanceApi,
...AfterServiceApi,
...PurchaseApi,
}
......@@ -10,6 +10,7 @@ const tokenList = [
{ name: 'Order', token: '5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd', categoryIds: [0] }, //订单服务,
{ name: 'Settle', token: 'fffbeeaaa198c285955997c606bc279fc6950fea118580c786f2c73eecccaa6a', categoryIds: [0] }, //结算服务
{ name: 'report', token: 'e709e5bd31eb2b84de468944b153a62a05afcc13f0ea880be7333b928c7c0620', categoryIds: [0]}, //报表服务
{ name: 'Purchase', token: '425043481f605f76064951c72d26c412e5ba1baf2d70158300f560ef58358f41', categoryIds: [0]}, //采购服务
{ name: 'enhance', token: '594a7e7ff17f6f40fb9fb726c1da9a3f282a926a8d386eb6cbfd668a3f75f251', categoryIds: [0] }, // 加工服务
{ name: 'AfterService', token: 'bac1c7ca2c63869ec87085b0b33e830fea19f707dea5763f1bf8f2dc5996bde8', categoryIds: [0] } // 售后服务
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment