Commit 8245682b authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

重构了一下需求单审核和需求报价单管理

parent 75e0011c
/*
* @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: LeeJiancong
* @Date: 2020-08-04 16:21:48
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-10-12 13:37:53
*/
const router = {
path: '/enquiryOfferManager',
name: 'enquiryOfferManager',
key: 'enquiryOfferManager',
icon: 'SmileOutlined',
routes:[
//报价单查询
{
path: '/enquiryOfferManager/enquiryOffer/enquiryOfferSearch',
name: 'enquiryOfferSearch',
component: '@/pages/requisition/enquiryOffer/enquiryOfferSearch',
},
// 报价单查询详情
{
path: '/enquiryOfferManager/enquiryOffer/enquiryOfferDetail',
name: 'enquiryOfferDetail',
component: '@/pages/requisition/enquiryOffer/components/detail',
hideInMenu: true,
hidePageHeader: true
}
]
}
export default router
\ No newline at end of file
......@@ -10,8 +10,8 @@ import pageCustomized from './pageCustomized'
import calssPropertyRoute from './calssPropertyRoute' // 品类属性路由
import trademarkRoute from './brandRoute' // 品牌路由
import commodity from './commodityRoute' // 商品审核路由
import requisitionRoute from './requisitionRoute' //需求单
import enquiryOfferRoute from './enquiryOfferRoute' //报价单
import demandOrderRoute from './demandOrderRoute' //需求单审核
import demandQuoteOrderRoute from './demandQuoteOrderRoute' //需求报价单管理
import logisticsRoutes from './logisticsRoutes'
import memberAbility from './memberAbility'
import ruleSettingRoutes from './ruleSettingRoutes'
......@@ -38,8 +38,8 @@ const routeList = [
commentRoutes,
contentRoute,
balancedRoute,
requisitionRoute,
enquiryOfferRoute,
demandOrderRoute,
demandQuoteOrderRoute,
capitalAccount,
messageRoute,
systemManageRoute,
......
/*
* @Author: LeeJiancong
* @Date: 2020-08-04 16:21:48
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-25 14:31:33
*/
const router = {
path: '/requisitionManager',
name: 'requisitionManager',
key: 'requisitionManager',
icon: 'SmileOutlined',
routes:[
//需求单查询
{
path: '/requisitionManager/aduit/enquirySearch',
name: 'enquirySearch',
component: '@/pages/requisition/aduit/enquirySearch',
},
//需求单查询详情
{
path: '/requisitionManager/aduit/enquirySearch/enquiryDetail',
name: 'enquiryDetail',
component: '@/pages/requisition/aduit/enquirySearch/detail',
hideInMenu: true,
hidePageHeader: true
},
//需求单审核列表
{
path: '/requisitionManager/aduit/aduitList',
name: 'aduitList',
component: '@/pages/requisition/aduit/aduitList',
},
//审核需求单(详情)
{
path: '/requisitionManager/aduit/aduitDetail',
name: 'aduitDetail',
component: '@/pages/requisition/aduit/components/detail',
hideInMenu: true,
hidePageHeader: true
},
]
}
export default router
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Date: 2020-10-19 15:47:40
* @LastEditors: HJX
* @LastEditTime: 2020-10-19 15:47:40
* @RouterName: 询价单
* @RouterName: 询价报价
*/
const router = {
......@@ -11,17 +11,20 @@ const router = {
name: 'rfqOffer',
icon: 'SmileOutlined',
routes: [{
// 列表
path: '/rfqOffer/list',
name: 'list',
hidePageHeader: true,
component: '@/pages/rfqOffer/list',
}, {
// 报价详情
path: '/rfqOffer/rfq/details',
name: 'rfqDetails',
hideInMenu: true,
hidePageHeader: true,
component: '@/pages/rfqOffer/details',
}, {
// 询价详情
path: '/rfqOffer/inquiry/details',
name: 'inquiryDetails',
hideInMenu: true,
......
......@@ -11,11 +11,13 @@ const router = {
name: 'rfq',
icon: 'SmileOutlined',
routes: [{
// 列表
path: '/rfq/list',
name: 'list',
hidePageHeader: true,
component: '@/pages/rfq/list',
}, {
// 详情
path: '/rfq/details',
name: 'details',
hideInMenu: true,
......
......@@ -80,17 +80,19 @@ export default {
'menu.memberAbility.memberLevel': '会员等级',
'menu.memberAbility.addEquity': '会员权益设置',
//需求单
'menu.requisitionManager':'需求单审核',
'menu.requisitionManager.enquirySearch':'需求单查询',
'menu.requisitionManager.enquiryDetail':'需求单详情',
'menu.requisitionManager.aduitList':'需求单审核',
'menu.requisitionManager.aduitDetail':'需求单审核详情',
//报价单
'menu.enquiryOfferManager':'报价单管理',
'menu.enquiryOfferManager.enquiryOfferSearch':'报价单查询',
'menu.enquiryOfferManager.enquiryOfferDetail':'报价单详情',
//需求单 2020-11-17
'menu.demandOrder': '需求单审核',
'menu.demandOrder.demandOrderInquire': '需求单查询',
'menu.demandOrder.demandOrderInquirePreview': '需求单详情',
'menu.demandOrder.demandOrderAudit': '待审核需求单',
'menu.demandOrder.demandOrderAuditPreview': '需求单详情',
'menu.demandOrder.demandOrderAuditDetail': '审核需求单',
//需求报价单管理 2020-11-17
'menu.demandQuoteOrder':'需求报价单管理',
'menu.demandQuoteOrder.demandQuoteOrderInquire':'报价单查询',
'menu.demandQuoteOrder.demandQuoteOrderInquireQuote':'报价单详情',
'menu.demandQuoteOrder.demandQuoteOrderInquireDemand':'需求单详情',
//物流管理
'menu.logisticsManager': '物流管理',
......
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form } from 'antd'
import React from 'react';
import { Modal } from 'antd';
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
import { PublicApi } from '@/services/api';
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks;
export interface Params {
id: number | string;
type: number|string;//1是一级 2是二级
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props:any) => {
console.log(props.dialogVisible)
const handleCancel = () => {
}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
console.log('value',value)
//平台审核
if(props.type == 1){
PublicApi.postOrderPlatformRequisitionFormAudit(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
})
}
// else if(props.type == 2){
// PublicApi.postOrderRequisitionFormAuditTwo(value).then(res => {
// if (res.code === 1000) {
// props.onOK()
// }
// })
// }
}
useEffect(() => {
return () => {
}
}, [])
const AuditModal: React.FC<Params> = (props) => {
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('state').subscribe(({ value }) => {
......@@ -58,75 +28,73 @@ const comfirmDialog: React.FC<Params> = (props:any) => {
}
})
})
}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id;
PublicApi.postOrderPlatformRequisitionFormAudit(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
}
return (
<>
<Modal
title='审核确认'
width={800}
visible={props.dialogVisible}
onOk={() => actions.submit()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
okText='确定'
cancelText={`取消`}
<Modal
title='单据审核'
width={576}
visible={props.dialogVisible}
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
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
state: 1
}}
>
<SchemaForm
labelCol={4}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
state: 1
}}
>
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
{props.dontReceive &&
<>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='审核不通过原因'
name="cause"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules ={{
max:60,
// maximum:10,//最大数值
message:'原因最多60个汉字'
}}
/>
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
<Field
title='审核不通过原因'
name="cause"
</>
}
</SchemaForm>
</Modal>
</>
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message: '原因最多60个汉字'
}}
/>
</SchemaForm>
</Modal>
)
}
comfirmDialog.defaultProps = {
dontReceive: true
}
export default comfirmDialog
\ No newline at end of file
export default AuditModal
\ No newline at end of file
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;
......@@ -104,119 +205,58 @@
background : @main-color;
margin-left: 10px;
}
.count{
font-size: 24px;
color: #303133;
font-weight: 500;
}
.add-btn{
.item_wrap {
margin-bottom: 24px;
padding: 6px 0;
text-align: center;
background: #FAFBFC;
background-color: #FFF;
border-radius: 8px;
padding: 24px;
}
.alignCenter{
text-align: center;
}
.alignLeft{
text-align: left;
}
.hidden{
display: none;
}
.block{
display: block;
}
.selectBtn {
margin: 0 16px;
}
.filter-btn{
width : 112px;
margin: 0 0 0 16px;
}
.select {
width : 160px;
&:nth-last-of-type(1) {
margin-right: 0;
&:last-child {
margin-bottom: 0px;
}
}
.mainCol {
background-color: #fff;
margin-bottom : 24px;
padding : 0 24px;
box-sizing : border-box;
&-title {
font-size : 16px;
.mainCol_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;
color: #303133;
padding: 0px 0 20px;
}
&-row {
display : flex;
flex-wrap : wrap;
padding-bottom: 16px;
&-col {
display: flex;
width : calc(100% / 3);
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;
}
: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;
&-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;
}
}
.upload_left {
display: flex;
align-items: center;
color: #00B37A;
cursor: pointer;
:global {
.anticon-link {
color: #00B37A;
font-size: 16px;
margin-right: 8px;
}
}
}
......
......@@ -11,42 +11,45 @@
* @return {type}
*/
import React, { Component } from 'react';
import {Space,Radio,Tooltip} from 'antd'
import {QuestionCircleOutlined} from '@ant-design/icons'
export interface plarms{
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 (
<Space size={16}>
<Radio.Group disabled={props.disabled} value={props.platType} onChange={(e) => props.changePlatform(e)}>
<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 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.defaultProps = {
platType: 1,
disabled: false
}
......
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 { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PublicApi } from '@/services/api';
/**
* @description: 需求单审核列表
* @param {type}
* @return {type}
*/
export const demandOrderAuditSchema: ISchema = {
type: 'object',
properties: {
megalayout: {
type:'object',
"x-component":'mega-layout',
"x-component-props":{
grid:true
},
properties: {
ctl:{
type:'object',
"x-component":"Children",
"x-component-props":{
children:"{{controllerBtns}}"
}
},
requisitionFormNo: {
type: 'string',
"x-component": "Search",
"x-mega-props": { },
"x-component-props": {
placeholder: '需求单号',
}
}
}
},
[FORM_FILTER_PATH]: {
type:'object',
"x-component":"flex-layout",
"x-component-props":{
rowStyle:{
flexWrap:'nowrap'
},
colStyle:{
marginLeft: 20
}
},
properties: {
PRO_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-mega-props": {
span: 5
},
"x-component-props": {
inline: true
},
properties: {
details: {
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
}
]
},
category: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
style: {
width: 160
}
}
},
demandMembers: {
type: 'string',
"x-component-props": {
placeholder: '需求会员'
}
},
}
},
sumbit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
/**
* @description: 需求单列表
* @param {type}
* @return {type}
*/
export const demandOrderInquireSchema: ISchema = {
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
properties: {
requisitionFormNo: {
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: {
details: {
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
}
]
},
category: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCategory,
style: {
width: 160
}
}
},
demandMembers: {
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
}
]
},
interiorState: {
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
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
import React, { Component } from 'react'
import OrderList from "../components/index"
const List = () => {
return (
<OrderList des='审核需求单' type={1}/>
)
}
export default List
\ No newline at end of file
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-28 15:29:39
*/
/**
* @description: 组件描述: 一级 二级 待提交需求单
* @param {type}
* @return {type}
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
import {
Button,
Card,
Space,
Row,
Col,
Dropdown,
Menu,
Popconfirm
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined,DownOutlined,DeleteOutlined
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import {
IFormFilter,
IButtonFilter,
} from 'god/dist/src/standard-table/TableController';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import {interiorState,interiorStateTwo,enquirySearchInteriorState,enquirySearchexternalState2} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../effect/index'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySchema } from '../../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
/**
* @description: 按页面来 type一级为1 二级为2 待提交需求单3
* @param {type}
* @return {type}
*/
export interface listParams{
type: number;
des?: string;
}
const formActions = createFormActions();
const List:React.FC<listParams> = (props) => {
console.log(props)
const ref = useRef<any>({})
const [more, setmore] = useState(false)
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const fetchData = async (params: any) => {
if(props.type === 1){//一级
const res = await PublicApi.getOrderPlatformReviewedRequisitionFormList(params);
return res.data
}
// else if(props.type === 2){//二级
// const res = await PublicApi.getOrderRequisitionFormAuditTwoList(params);
// return res.data
// }
// else if(props.type === 3){//待提交需求单
// const res = await PublicApi.getOrderRequisitionFormSubmitList(params);
// return res.data
// }
}
/**
* @description:
* @param {type} 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (id) => {
history.push(`/requisitionManager/aduit/aduitDetail?page_type=${props.type}&id=${id}`)
}
const columns : ColumnType<any>[] = [
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(records.id)
}}>{text}</EyePreview>
},
{
title:'需求摘要',
key:'details',
dataIndex:'details',
align:'left'
},
{
title:'品类',
key:'category',
dataIndex:'category',
align:'left'
},
{
title:'需求会员',
key:'demandMembers',
dataIndex:'demandMembers',
align:'left'
},
{
title:'交付日期',
key:'deliveryTime',
dataIndex:'deliveryTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'单据时间',
key:'voucherTime',
dataIndex:'voucherTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'外部状态',
key:'externalState',
dataIndex:'externalState',
align:'center',
render: (text: any, reconds) =>
enquirySearchexternalState2(text)
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'center',
render:(text:any) =>
enquirySearchInteriorState(text)
},
{
title:'操作',
key:'options',
dataIndex:'options',
align:'center',
render: (_: any, record: any) => {
return (
<>
{
(props.type === 1 || props.type === 2) ?
<Button type="link" onClick={() =>
history.push(`/requisitionManager/aduit/aduitDetail?page_type=${props.type}&id=${record.id}`)}>
审核
</Button>
:
<>
{
(props.type === 3 && record.externalState === 1) &&
<Button type="link" onClick={() =>
history.push(`/memberCenter/tranactionAbility/enquirySubmit/viewEnquiryDetail?page_type=${props.type}&id=${record.id}`)}>
提交</Button>
}
{
(record.externalState === 1 && record.interiorState === 1) &&
<>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelete([record.id])}>
<Button type='link'>
删除
</Button>
</Popconfirm>
<Popconfirm title="确定要提交吗?" okText="是" cancelText="否" onConfirm={() => handleSubmit(record.id)}>
<Button type='link'>提交</Button>
</Popconfirm>
</>
}
</>
}
</>
)
}
},
]
useEffect(()=> {
},[])
const toEdit = (id:number | string) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/addEnquiry?id=${id}`)
}
/**
* @description: 删除
* @param {type}
* @return {type}
*/
const handleDelete = (arr:number[]| string[]) => {
PublicApi.postOrderRequisitionFormDeleteAll({ ids: arr }).then(res => {
ref.current.reload()
})
}
//批量提交
const handleSubmitAll = (ids: number[]) => {
if(ids.length === 0){
return
}
if(props.type === 1){//一级(审核)
PublicApi.postOrderPlatformRequisitionFormAuditAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
// else if(props.type === 2){//二级
// PublicApi.postOrderRequisitionFormAuditAllTwo({ ids: ids }).then(res => {
// ref.current.reload()
// })
// }else if(props.type === 3){//待提交审核
// PublicApi.postOrderSubmitRequisitionFormAll({ ids: ids }).then(res => {
// ref.current.reload()
// })
// }
}
//提交审核
const handleSubmit = (id) => {
PublicApi.postOrderNewRequisitionFormAudit({ id: id }).then(res => {
ref.current.reload()
})
}
const handleSumbit = (values:any) => {
if(values.voucherTime){
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values',values)
ref.current.reload(values)
}
const menu = (
<Menu onClick={() => handleDelete(selectedRowKeys)}>
<Menu.Item key='1' icon={<DeleteOutlined/>}>
批量删除
</Menu.Item>
</Menu>
)
const handleBatchDel = (e:any) => {
}
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}>
<Space direction="horizontal" size={16}>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>
{ (props.type == 1 || props.type == 2) ? '批量提交审核' :'批量审核通过'}
</Button>
{
(props.type !== 1 && props.type !== 2 && props.type !== 3)&&
<>
<Dropdown.Button
overlay={menu}
trigger={['click']}
icon={<DownOutlined />}
>
更多
</Dropdown.Button>
</>
}
</Space>
</Col>
</Row>
return (
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{rowKew:'id'}}
fetchTableData={(params: any) => fetchData(params)}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
expressionScope={{
controllerBtns
}}
schema={enquierySchema}
>
</NiceForm>
}
/>
</Card>
)
}
export default List
\ No newline at end of file
This diff is collapsed.
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-25 14:27:52
*/
/**
* @description: 组件描述:
* @param {type}
* @return {type}
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
import {
Button,
Card,
Space,
Row,
Col,
Dropdown,
Menu,
Popconfirm
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined,DownOutlined,DeleteOutlined
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import {
IFormFilter,
IButtonFilter,
} from 'god/dist/src/standard-table/TableController';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import {interiorState,interiorStateTwo,
enquirySearchInteriorState,enquirySearchexternalState} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import {filterInteriorStateList,filterExternalStateList} from './../../common/statusList'
import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../effect/index'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySearchSchema } from '../../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
export interface listParams{
type: number;
des?: string;
}
const formActions = createFormActions();
const List:React.FC<{listParams}> = (props) => {
const ref = useRef<any>({})
const [more, setmore] = useState(false)
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderPlatformRequisitionFormList(params);
return res.data
}
/**
* @description:
* @param {type} 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (id) => {
history.push(`/requisitionManager/aduit/enquirySearch/enquiryDetail?page_type=${6}&id=${id}`)
}
const columns : ColumnType<any>[] = [
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(records.id)
}}>{text}</EyePreview>
},
{
title:'需求摘要',
key:'details',
dataIndex:'details',
align:'left'
},
{
title:'品类',
key:'category',
dataIndex:'category',
align:'left'
},
{
title:'需求会员',
key:'demandMembers',
dataIndex:'demandMembers',
align:'left'
},
{
title:'交付日期',
key:'deliveryTime',
dataIndex:'deliveryTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'单据时间',
key:'voucherTime',
dataIndex:'voucherTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'外部状态',
key:'externalState',
dataIndex:'externalState',
align:'center',
filters: filterExternalStateList,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: (text: any, reconds) =>
enquirySearchexternalState(text)
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'left',
filters: filterInteriorStateList,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render:(text:any) =>
enquirySearchInteriorState(text)
}
]
useEffect(()=> {
},[])
const toEdit = (id:number | string) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/addEnquiry?id=${id}`)
}
/**
* @description: 删除
* @param {type}
* @return {type}
*/
const handleDelete = (arr:number[]| string[]) => {
PublicApi.postOrderRequisitionFormDeleteAll({ ids: arr }).then(res => {
ref.current.reload()
})
}
//提交审核
const handleSubmit = (id) => {
PublicApi.postOrderNewRequisitionFormAudit({ id: id }).then(res => {
ref.current.reload()
})
}
const handleSumbit = (values:any) => {
if(values.voucherTime){
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values',values)
ref.current.reload(values)
}
const handleBatchDel = (e:any) => {
}
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}>
</Col>
</Row>
return (
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{rowKew:'id'}}
fetchTableData={(params: any) => fetchData(params)}
// rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={enquierySearchSchema}
>
</NiceForm>
}
/>
</Card>
)
}
export default List
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-07-30 17:23:48
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-28 16:12:56
*/
export default {
default: {
padding: '2px 5px',
background: 'rgba(244,245,247,1)',
borderRadius: '4px'
},
confirm: {
color: '#3F7ED2',
padding: '2px 5px',
background: 'rgba(240, 248, 255, 1)',
borderRadius: '4px'
},
success: {
color: '#00B37A',
padding: '2px 5px',
background: 'rgba(235,247,242,1)',
borderRadius: '4px'
},
warn: {
color: '#E63F3B',
padding: '2px 5px',
background: 'rgb(255, 235, 230)',
borderRadius: '4px'
},
Error: {
color: 'red',
padding: '2px 5px',
background: 'rgba(255,247,227,1)',
borderRadius: '4px'
}
}
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-08-27 16:27:53
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-10 10:22:41
*/
import { ColumnType } from 'antd/lib/table/interface'
import moment from 'moment'
export const dockingColumn = (children,optionChild) => {
let columns: ColumnType<any>[] = []
columns =
[
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '会员名称',
dataIndex: 'memberName',
key: 'memberName',
align: 'left'
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
key: 'memberTypeName',
align: 'center'
},
{
title: '会员角色',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '会员等级',
dataIndex: 'levelTag',
key: 'levelTag',
align: 'center'
},
{
title: '是否归属会员',
dataIndex: 'membershipOrNot',
key: 'membershipOrNot',
align: 'center',
render:(text:any) => (
text == 0 ?'否':'是'
)
},
{
title: '需求发送状态',
dataIndex: 'state',
key: 'state',
align: 'center',
render:(text:any,records,index) => children? children(text,records,index) :''
},
{
title: '操作',
dataIndex: 'option',
key: 'option',
align: 'center',
render:(text:any,records,index) => optionChild? optionChild(text,records,index) :''
}
]
return columns
}
export const memberColumn = (children?) => {
let columns: ColumnType<any>[] = []
columns =
[
{
title: '序号',
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
dataIndex: 'name',
key: 'name',
align: 'left'
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
key: 'memberTypeName',
align: 'center'
},
{
title: '会员角色',
dataIndex: 'roleName',
key: 'roleName',
align: 'center'
},
{
title: '会员等级',
dataIndex: 'levelTag',
key: 'levelTag',
align: 'center'
},
{
title: '是否归属会员',
dataIndex: 'membershipOrNot',
key: 'membershipOrNot',
align: 'center',
render:(text:any) => (
text == 0 ?'否':'是'
)
},
{
title: '需求发送状态',
dataIndex: 'state',
key: 'state',
align: 'center',
render:(text:any,records,index) => children? children(text,records,index) :''
}
]
return columns
}
/**
* @description: 内部流转interiorRequisitionForms
* 外部流转 externalRequisitionForms
* @param {type}
* @return {type}
*/
export const externalColumn = (childeren,stateList?) => {
let culumn:ColumnType<any>[] = []
return culumn = [
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '操作角色',
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '状态',
dataIndex: 'state',
align: 'center',
key: 'state',
render:(text:any,record:any) => stateList(text)
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
dataIndex: 'operationTime',
align: 'center',
key: 'operationTime',
render: (text: any, record: any) => childeren(text)
},
{
title: '审核意见',
dataIndex: 'auditOpinion',
align: 'left',
key: 'auditOpinion'
}
]
}
export const interiorColumn = (childeren,stateList?) => {
let culumn:ColumnType<any>[] = []
return culumn = [
{
title: '序号',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '操作人',
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '部门',
dataIndex: 'department',
align: 'center',
key: 'department',
},
{
title: '职位',
dataIndex: 'position',
align: 'center',
key: 'position',
},
{
title: '状态',
dataIndex: 'state',
align: 'center',
key: 'state',
render:(text:any,record:any) => stateList(text)
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
key: 'operation',
},
{
title: '操作时间',
dataIndex: 'operationTime',
align: 'center',
key: 'operationTime',
render: (text: any, record: any) => childeren(text)
},
{
title: '审核意见',
dataIndex: 'auditOpinion',
align: 'left',
key: 'auditOpinion'
}
]
}
/*
* @Author: LeeJiancong
* @Date: 2020-08-01 11:06:09
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-09-09 14:47:02
*/
export const TimeList = [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
/**
* @description: 需求单发布状态筛选
* @param {type}
* @return {type} 内
*/
export const filterExternalStateList = [
{
text: '提交需求单', value: 1
},
{
text: '审核需求单', value: 2
},
{
text: '提交报价单', value: 3
},
{
text: '确认报价单', value: 4
},
{
text: '完成', value: 5
},
{
text: '审核不通过', value: 6
},
{
text: '取消报价单', value: 7
}
]
/**
* @description: 需求单发布状态筛选
* @param {type}
* @return {type} 内
*/
export const filterInteriorStateList = [
{
text: '新增需求单', value: 1
},
{
text: '审核需求单一级', value: 2
},
{
text: '审核需求单二级', value: 3
},
{
text: '提交需求单', value: 4
},
{
text: '完成', value: 5
},
{
text: '审核不通过', value: 6
},
{
text: '取消需求单', value: 7
}
]
import React, { Component,ReactNode } from 'react';
import {Badge} from 'antd'
import statuStyle from './colorTag'
/****** *********************** 需求单 ************************** */
/**
* @description: 需求提交一级
* @param {type}
* @return {type}
*/
export const interiorState = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交审核" />:
text === 2 ? component = <Badge status='processing' text="待审核" />:
text === 3 ? component = <Badge status='success' text="审核通过" />:
component = <Badge status='error' text="审核不通过" />
return component;
}
/**
* @description: 需求提交二级
* @param {type}
* @return {type}
*/
export const interiorStateTwo = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交审核" />:
text === 3 ? component = <Badge status='processing' text="待审核" />:
text === 4 ? component = <Badge status='success' text="审核通过" />:
component = <Badge status='error' text="审核不通过" />
return component;
}
/**
* @description: 专用需求发布的需求单查询
* @param {type}
* @return {type} 内
*/
export const enquirySearchInteriorState = (text:any) => {
//内部状态:1.新增需求单 2.审核通过 3.审核通过 4.待提交需求单 5.审核通过 6.审核不通过 7.取消报价单
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="新增需求单" />:
text === 2 ? component = <Badge color="#FFC400" text="审核通过" />:
text === 3 ? component = <Badge color="#FFC400" text="审核通过" />:
text === 4 ? component = <Badge status='processing' text="待提交需求单" />:
text === 5 ? component = <Badge status='success' text="审核通过" />:
text === 6 ? component = <Badge status='error' text="审核不通过" />:
component = <Badge status="default" text="取消报价单" />
return component;
}
/**
* @description: 专用需求发布的需求单查询
* @param {type}
* @return {type} 外
*/
export const enquirySearchexternalState = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="提交需求单" />:
text === 2 ? component = <Badge color="#FFC400" text="审核需求单" />:
text === 3 ? component = <Badge status='default' text="提交报价单" />:
text === 4 ? component = <Badge status='processing' text="确认报价单" />:
text === 5 ? component = <Badge status='success' text="完成" />:
text === 6 ? component = <Badge status='error' text="审核不通过" />:
component = <Badge status="default" text="取消报价单" />
return component;
}
export const enquirySearchexternalState2 = (text:any) => {
//外部状态:1.待提交需求单 2.待审核需求单 3.待提交报价单 4.待确认报价单 5.接受报价 6.不接受报价 7.取消报价单
let component: ReactNode = null;
text === 1 ? component = <span style={statuStyle.default}>待提交需求单</span>:
text === 2 ? component = <span style={statuStyle.warn}>待审核需求单</span>:
text === 3 ? component = <span style={statuStyle.confirm}>待提交报价单</span>:
text === 4 ? component = <span style={statuStyle.confirm}>待确认报价单</span>:
text === 5 ? component = <span style={statuStyle.success}>接受报价</span>:
text === 6 ? component = <span style={statuStyle.Error}>不接受报价</span>:
component = <span style={statuStyle.default}>取消报价单</span>
return component;
}
/****** *********************** 报价单 ************************** */
//内部
export const enquiryOfferSearchInteriorState = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="新增报价单" />:
text === 2 ? component = <Badge color="#FFC400" text="审核报价单一级" />:
text === 3 ? component = <Badge color="#FFC400" text="审核报价单二级" />:
text === 4 ? component = <Badge status='processing' text="待提交报价单" />:
text === 5 ? component = <Badge status='success' text="完成" />:
text === 6 ? component = <Badge status='error' text="审核不通过" />:
component = <Badge status="default" text="取消报价单" />
return component;
}
//外部
export const enquiryOfferSearchexternalState = (text:any) => {
let component: ReactNode = null;
// text === 1 ? component = <Badge status='default' text="提交需求单" />:
// text === 2 ? component = <Badge color="#FFC400" text="审核需求单" />:
// text === 3 ? component = <Badge status='default' text="待提交报价单" />:
// text === 4 ? component = <Badge status='processing' text="确认报价单" />:
// text === 5 ? component = <Badge status='success' text="完成" />:
// text === 6 ? component = <Badge status='error' text="审核不通过" />:
// component = <Badge status="default" text="取消报价单" />
text === 1 ? component = <span style={statuStyle.default}>待提交需求单</span>:
text === 2 ? component = <span style={statuStyle.default}>审核需求单</span>:
text === 3 ? component = <span style={statuStyle.confirm}>待提交报价单</span>:
text === 4 ? component = <span style={statuStyle.confirm}>确认报价单</span>:
text === 5 ? component = <span style={statuStyle.success}>完成</span>:
text === 6 ? component = <span style={statuStyle.Error}>审核不通过</span>:
component = <span style={statuStyle.default}>取消报价单</span>
return component;
}
import React, { useEffect } from 'react'
import { ISchemaFormActions, FormEffectHooks, IFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
const { onFieldValueChange$ } = FormEffectHooks
// 高级筛选schema中用于输入搜索需求发布品类的Effect
export const searchSelectGetSelectCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
\ No newline at end of file
import React, { Component, useState, useEffect } from 'react';
import { Modal, Button, Form } from 'antd'
import {
SchemaForm, SchemaMarkupField as Field,
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
export interface Params {
id: number | string;
type: number|string;//1是一级 2是二级
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
console.log(props.dialogVisible)
const handleCancel = () => {
}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
console.log('value',value)
if(props.type == 1){
PublicApi.postOrderRequisitionFormAudit(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
})
}else if(props.type == 2){
PublicApi.postOrderRequisitionFormAuditTwo(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
})
}
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('state').subscribe(({ value }) => {
setFieldState('cause', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
}
})
})
}
return (
<>
<Modal
title='审核确认'
width={800}
visible={props.dialogVisible}
onOk={() => actions.submit()}
onCancel={() => props.onCancel()}
destroyOnClose
afterClose={() => actions.reset()}
okText='确定'
cancelText={`取消`}
>
<SchemaForm
layout="vertical"
labelCol={4}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
state: 1
}}
>
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
{props.dontReceive &&
<>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='审核不通过原因'
name="cause"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules ={{
max:60,
// maximum:10,//最大数值
message:'原因最多60个汉字'
}}
/>
</>
}
</SchemaForm>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true
}
export default comfirmDialog
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-08-24 11:39:11
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-10-12 13:47:28
*/
/**
* @description: 组件描述:
* @param {type}
* @return {type}
*/
import React, { ReactNode, useRef, useState,useEffect } from 'react';
import { history } from 'umi';
import {
Button,
Card,
Space,
Row,
Col,
Dropdown,
Menu,
Popconfirm
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined,DownOutlined,DeleteOutlined
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import {
IFormFilter,
IButtonFilter,
} from 'god/dist/src/standard-table/TableController';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import {interiorState,interiorStateTwo,
enquirySearchInteriorState,enquirySearchexternalState,enquiryOfferSearchexternalState} from '../../common/tableStatusList'
import statuStyle from '../../common/colorTag'
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import {filterInteriorStateList,filterExternalStateList} from '../../common/tableStatusList'
import moment from 'moment'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import {PageStatus} from '@/hooks/usePageStatus'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../effect/index'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquieryOfferSearchSchema } from '../../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
export interface listParams{
type: number;
des?: string;
}
const formActions = createFormActions();
const List:React.FC<{listParams}> = (props) => {
const ref = useRef<any>({})
const [more, setmore] = useState(false)
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**
* @description:
* @param {type} type: 1 需求发布 2报价 可以根据props.type处理
* @return {type}
*/
const handleToDetail= (type,id) => {
if(type === 1){
history.push(`/requisitionManager/aduit/enquirySearch/enquiryDetail?page_type=${4}&id=${id}`)
}else{
history.push(`/enquiryOfferManager/enquiryOffer/enquiryOfferDetail?page_type=${4}&id=${id}`)
}
}
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderPlatformQuotationList(params);
return res.data
}
const columns : ColumnType<any>[] = [
{
title:'报价单号',
key:'quotationNo',
dataIndex:'quotationNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(2,records.id)
}}>{text}</EyePreview>
},
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center',
render: (text: any,records: any) => <EyePreview type="button" handleClick={() => {
handleToDetail(1,records.requisitionId)//需求单id
}}>{text}</EyePreview>
},
{
title:'报价单摘要',
key:'quotationSummary',
dataIndex:'quotationSummary',
align:'left'
},
{
title:'需求会员',
key:'demandMembers',
dataIndex:'demandMembers',
align:'left'
},
{
title:'报价会员',
key:'quotedMembers',
dataIndex:'quotedMembers',
align:'left'
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'单据时间',
key:'documentsTime',
dataIndex:'documentsTime',
align:'center',
render:(text:any)=> format(text)
},
{
title:'外部状态',
key:'externalState',
dataIndex:'externalState',
align:'center',
render: (text: any, reconds) =>
enquiryOfferSearchexternalState(text)
// {
// let component: ReactNode = null
// if (text == 3) {
// component = <><span style={statuStyle.warn}>审核不通过需求单</span></>
// }else if (text == 1) {
// component = <><span style={statuStyle.default}>待提交需求单</span></>
// }
// return component
// }
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'center',
render:(text:any) =>
enquirySearchInteriorState(text)
}
]
useEffect(()=> {
},[])
const toEdit = (id:number | string) => {
history.push(`/memberCenter/tranactionAbility/enquirySubmit/addEnquiry?id=${id}`)
}
/**
* @description: 删除
* @param {type}
* @return {type}
*/
const handleDelete = (arr:number[]| string[]) => {
PublicApi.postOrderRequisitionFormDeleteAll({ ids: arr }).then(res => {
ref.current.reload()
})
}
//提交审核
const handleSubmit = (id) => {
PublicApi.postOrderNewRequisitionFormAudit({ id: id }).then(res => {
ref.current.reload()
})
}
const handleSumbit = (values:any) => {
if(values.voucherTime){
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values',values)
ref.current.reload(values)
}
const handleBatchDel = (e:any) => {
}
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}>
</Col>
</Row>
return (
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{rowKew:'id'}}
fetchTableData={(params: any) => fetchData(params)}
// rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'quotationNo',FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions,'category')
})
}}
schema={enquieryOfferSearchSchema}
>
</NiceForm>
}
/>
</Card>
)
}
export default List
\ No newline at end of file
This diff is collapsed.
......@@ -20,8 +20,8 @@ const SensitiveWords: React.FC<{}> = () => {
dataIndex: 'name',
}, {
title: '备注',
key: 'remarks',
dataIndex: 'remarks',
key: 'remark',
dataIndex: 'remark',
}, {
title: '状态',
key: 'status',
......
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