Commit 362704e8 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

商品询价

parent 6da0d601
......@@ -44,8 +44,8 @@ export enum LAYOUT_TYPE {
}
// 本地环境跳过权限校验
// export const isDev = process.env.NODE_ENV === "development"
export const isDev = false
export const isDev = process.env.NODE_ENV === "development"
// export const isDev = false
export const Environment_Status = {
0: "所有",
......
......@@ -91,4 +91,48 @@ export const filterInteriorStateList = [
]
/**
* @description: 商品询价外部状态筛选
* @param {type}
* @return {type} 内
*/
export const filterExternalState = [
{
text: '提交询价单', value: 1
},
{
text: '提交报价单', value: 2
},
{
text: '确认报价单', value: 3
},
{
text: '报价通过', value: 4
},
{
text: '报价不通过', value: 5
}
]
/**
* @description: 商品询价内部状态筛选
* @param {type}
* @return {type} 内
*/
export const filterInternalState = [
{
text: '待提交审核', value: 1
},
{
text: '待审核', value: 2
},
{
text: '审核通过', value: 3
},
{
text: '审核不通过', value: 4
}
]
......@@ -126,3 +126,18 @@ export const enquiryOfferConfirmSearchInteriorState = (text:any) => {
component = <Badge status='processing' text="提交报价单" />
return component;
}
/****** *********************** 待新增询价单 ************************** */
/**
* @description: 内部状态查询
* @param {type}
* @return {type} 外
*/
export const quoteOrderInternalState = (text:any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交审核" />:
text === 2 ? component = <Badge status='default' text="待审核" />:
text === 3 ? component = <Badge status='default' text="审核通过" />:
component = <Badge status='processing' text="审核不通过" />
return component;
}
\ No newline at end of file
......@@ -56,7 +56,6 @@ const comfirmDialog: React.FC<Params> = (props) => {
}
})
})
}
return (
<>
......
import React, { useState, useRef } from 'react';
import React, { useState, useRef, useEffect } from 'react';
import { history } from 'umi';
import { Button, Card, Tabs } from 'antd';
import { Button, Card, Tabs, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReutrnEle from '@/components/ReturnEle';
import BasicInfo from './components/basicInfo'; // 基本信息
......@@ -12,15 +12,50 @@ import { PublicApi } from '@/services/api'
const { TabPane } = Tabs;
const AddQuotes: React.FC<{}> = () => {
const { id } = history.location.query;
const [memberList, setmemberList] = useState([]); //存放用户信息
const [goodsList, setgoodsList] = useState([]); //存放商品
const basicInfoRef = useRef<any>({});
const tradingConditionsRef = useRef<any>({});
const [editData, setEditData] = useState<any>({});
useEffect(() => {
if(id) {
PublicApi.getOrderInquiryListDetails({id}).then(res => {
if(res.code === 1000) {
setEditData(res.data)
}
})
}
},[])
/************* 页面的一些操作start *************/
const onSumbit = async (params: any) => {
const basicInfo = await basicInfoRef.current.validateFields();
const tradingConditions = await tradingConditionsRef.current.validateFields();
console.log(tradingConditions, basicInfo, goodsList, memberList)
const basicInfoData = basicInfo.data;
const tradingConditionsData = tradingConditions.data;
if( basicInfo.state && tradingConditions.state) {
const parmas = {
inquiryListProductRequests: goodsList, // 商品列表 ,InquiryListProductRequest
...basicInfoData,
...tradingConditionsData,
memberName: memberList[0].name,
memberId: memberList[0].memberId
}
if(id) {
console.log(parmas)
} else {
await PublicApi.postOrderInquiryListAdd(parmas).then(res => {
if(res.code === 1000) {
console.log(res.data)
}
})
}
} else {
message.error('有必填字段没选择,请检查!');
}
}
// 获取到会员信息
const getMemberList = (list: any) => {
......@@ -30,6 +65,7 @@ const AddQuotes: React.FC<{}> = () => {
const getGoodsList = (list:any) => {
setgoodsList(list)
}
/************* 页面的一些操作end *************/
return (
<PageHeaderWrapper
......@@ -46,17 +82,20 @@ const AddQuotes: React.FC<{}> = () => {
<BasicInfo
currentRef={basicInfoRef}
getMemberList={getMemberList}
editData={editData}
/>
</TabPane>
<TabPane tab="询价商品" key="2">
<EnquiryGoods
memberList={memberList}
getGoodsList={getGoodsList}
editData={editData}
/>
</TabPane>
<TabPane tab="交易条件" key="3">
<TradingConditions
currentRef={tradingConditionsRef}
editData={editData}
/>
</TabPane>
<TabPane tab="附件" key="4">
......
import React from 'react';
import { Form, Button, Upload } from 'antd';
import React, { useState, useEffect } from 'react';
import { Form, Button, Upload, message } from 'antd';
import { UPLOAD_TYPE } from '@/constants'
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface';
import styles from './index.less';
import { UploadOutlined, DeleteOutlined, FileWordFilled } from '@ant-design/icons';
import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons';
const layout: any = {
colon: false,
......@@ -11,6 +12,23 @@ const layout: any = {
labelAlign: "left"
};
const Attached: React.FC<{}> = () => {
const [files, setFiles] = useState([]);
/**判断文件类型和大小 */
const beforeDocUpload = (file: UploadFile) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
}
return isLt20M;
}
// 上传回调
const handleChange = ({ fileList }) => {
const arr: any = [];
fileList.forEach(v => {
if(v)
console.log(v)
})
}
return (
<Form
{...layout}
......@@ -18,24 +36,28 @@ const Attached: React.FC<{}> = () => {
>
<Form.Item label='附件'>
<div className={styles.upload_data}>
{files.length > 0 && files.map(v => (
<div className={styles.upload_item}>
<div className={styles.upload_left}>
<FileWordFilled />
<LinkOutlined />
<span>验货详情.doc</span>
</div>
<div className={styles.upload_right}>
<DeleteOutlined />
</div>
</div>
))}
</div>
<Upload
action="/api/file/file/upload"
data={{ fileType: UPLOAD_TYPE }}
showUploadList={false}
accept='.doc,.docx'
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
>
<Button icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>支持扩展名:.doc,文件大小不超过 20M</div>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload>
</Form.Item>
</Form>
......
......@@ -6,6 +6,8 @@ import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { ISchema } from '@formily/antd';
import ModalTable from '@/components/ModalTable'
import { PublicApi } from '@/services/api'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { quoteOrderInternalState } from '../../../common/tableStatusList';
const layout: any = {
colon: false,
......@@ -16,12 +18,14 @@ const layout: any = {
const { Search } = Input;
interface queryProps {
currentRef?: any,
getMemberList?: Function
getMemberList?: Function,
editData: any
}
const BasicInfo: React.FC<queryProps> = (props) => {
const [basicform] = Form.useForm();
const { getMemberList, currentRef } = props;
const { getMemberList, currentRef, editData } = props;
console.log(editData, 10086)
// 会员添加弹窗控制
const [visibleChannelMember, setVisibleChannelMember] = useState(false);
const [memberList, setmemberList] = useState([]);
......@@ -143,6 +147,14 @@ const BasicInfo: React.FC<queryProps> = (props) => {
}
},[])
useEffect(() => {
if(Object.keys(editData).length > 0) {
basicform.setFieldsValue({
details: editData.details
})
}
}, [editData])
/************* 页面的一些操作end *************/
return (
<>
......@@ -159,16 +171,16 @@ const BasicInfo: React.FC<queryProps> = (props) => {
<Button type='link'>查看会员详情</Button>
</Form.Item>
<Form.Item label='询价单号' name='orderNumber'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? editData.inquiryListNo : '-'}</span>
</Form.Item>
<Form.Item label='单据时间' name='time'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? editData.voucherTime : '-'}</span>
</Form.Item>
<Form.Item label='外部状态' name='external'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? <StatusColors status={editData.inquiryListNo} type='out' /> : '-'}</span>
</Form.Item>
<Form.Item label='内部状态' name='internal'>
<span>-</span>
<span>{Object.keys(editData).length > 0 ? quoteOrderInternalState(editData.inquiryListNo) : '-'}</span>
</Form.Item>
</Form>
{/* 选择会员弹框 */}
......
......@@ -16,11 +16,12 @@ import Submit from '@/components/NiceForm/components/Submit'
interface queryProps extends ModalTableProps {
memberList?: any,
schemaAction?: ISchemaFormActions | ISchemaFormAsyncActions,
getGoodsList: Function
getGoodsList: Function,
editData: any
}
const EnquiryGoods: React.FC<queryProps> = (props) => {
const { memberList, schemaAction, getGoodsList, ...restProps } = props
const { memberList, schemaAction, getGoodsList, editData, ...restProps } = props
const [value, setValue] = useState<any>('')
const productFormActions = createAsyncFormActions()
const onChange = (value) => {
......@@ -243,6 +244,13 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
setgoodsList(newData)
}
// 编辑时回显的数据
useEffect(() => {
if(Object.keys(editData).length > 0) {
setgoodsList(editData.inquiryListProductRequests);
}
}, [])
return (
<div className={styles.revise_style}>
<Button block type='dashed' onClick={addGoods}><PlusOutlined />添加商品</Button>
......
......@@ -5,7 +5,8 @@ import { Form, Input, Select, Row, Col, DatePicker } from 'antd';
import { PublicApi } from '@/services/api';
interface queryProps {
currentRef?: any
currentRef?: any,
editData: any
}
const layout: any = {
colon: false,
......@@ -15,9 +16,9 @@ const layout: any = {
};
const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef } = props;
const { currentRef, editData } = props;
const [TradingConditionsForm] = Form.useForm();
const [address, setAddress] = useState<any>([]);
const [address, setAddress] = useState([]);
const hadnleValidateFields = () => {
return new Promise((resolve) => {
TradingConditionsForm.validateFields().then(values => {
......@@ -51,13 +52,24 @@ const TradingConditions: React.FC<queryProps> = (props) => {
currentRef.current = userAction;
}
}
// 获取交付地址
PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
setAddress(res.data)
console.log(res.data)
})
// 编辑时回显的数据
if(Object.keys(editData).length > 0) {
TradingConditionsForm.setFieldsValue({
paymentType: editData.paymentType,
taxes: editData.taxes,
logistics: editData.logistics,
packRequire: editData.packRequire,
otherRequire: editData.otherRequire,
offer: editData.offer,
quotationAsTime: moment(editData.quotationAsTime),
deliveryTime: moment(editData.deliveryTime),
fullAddress: editData.fullAddress,
})
}
}, [])
return (
<Form
......@@ -72,7 +84,7 @@ const TradingConditions: React.FC<queryProps> = (props) => {
</Form.Item>
<Form.Item label='交付地址' name='fullAddress' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select>
{address.lengtn > 0 && address.map(v => (
{address.map(v => (
<Select.Option key={v.id} value={v.id}>{v.fullAddress}</Select.Option>
))}
</Select>
......
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import { history, Link } from 'umi';
import { Button, Card, Space, Row, Col, Dropdown, Menu, Popconfirm } from 'antd';
import { PlusOutlined,DownOutlined,DeleteOutlined } from '@ant-design/icons';
import { PlusOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import {filterInteriorStateList,filterExternalStateList} from './../../common/statusList';
import {interiorState,interiorStateTwo,
enquirySearchInteriorState,enquirySearchexternalState} from '../../common/tableStatusList';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import {
interiorState, interiorStateTwo,
quoteOrderInternalState, enquirySearchexternalState
} from '../../common/tableStatusList';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { timeRange } from '@/utils/index';
......@@ -16,6 +18,7 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { commonEnquieryOfferSchema } from '../schema';
import StatusColors from '@/pages/transaction/components/StatusColors'
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import { PublicApi } from '@/services/api';
......@@ -30,7 +33,8 @@ const AddEnquiryOrder: React.FC<{}> = () => {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any,records: any) => <EyePreview type="button">{text}</EyePreview>
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/components/details?id=${record.id}`}>{text}</EyePreview>
},
{
title: '询价单摘要',
......@@ -46,41 +50,59 @@ const AddEnquiryOrder: React.FC<{}> = () => {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any) =>
format(text)
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
render: (text: any) =>
format(text)
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any) =>
format(text)
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalStateList,
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: (text: any, reconds) =>
enquirySearchexternalState(text)
render: text => <StatusColors status={text} type='out' />
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInteriorStateList,
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render:(text:any) =>
enquirySearchInteriorState(text)
render: (text: any) =>
quoteOrderInternalState(text)
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => {
console.log(record.interiorState)
return (
<>
<Button type='link'>提交审核</Button>
<Dropdown overlay={() => moreOption(record)}>
<Button type='link'>更多 <DownOutlined /></Button>
</Dropdown>
</>
)
}
},
]
const format = (text) => {
......@@ -98,11 +120,28 @@ const AddEnquiryOrder: React.FC<{}> = () => {
/**批量删除 */
const menu = (
<Menu>
<Menu.Item key='1' icon={<DeleteOutlined/>}>
<Menu.Item key='1' icon={<DeleteOutlined />}>
批量删除
</Menu.Item>
</Menu>
)
/**更多操作 */
/**删除 */
const confirmDel = (recode: any) => {
PublicApi.postOrderInquiryListDelete({ id: recode.id }).then(res => {
ref.current.reload()
})
}
const moreOption = (record: any) => {
return (
<Menu>
<Menu.Item key='1'><Link to={`/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add?id=${record.id}`}><Button type="link">编辑</Button></Link></Menu.Item>
<Menu.Item key='2'>
<Button onClick={() => confirmDel(record)} type="link">删除</Button>
</Menu.Item>
</Menu>
)
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={24}>
......
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';
const actions = createFormActions()
const { onFieldChange$ } = FormEffectHooks;
export interface Params {
id: number | string;
type: number | string; //1是待提交询价单 2是一级 3是二级
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
}
const AuditModal: React.FC<Params> = (props) => {
const actions = createFormActions()
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('state').subscribe(({ value }) => {
setFieldState('cause', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
}
})
})
}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
switch (props.type) {
case 1:
PublicApi.postOrderInquirySubmit(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
case 2:
PublicApi.postOrderInquiryDocumentsReview(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
case 3:
PublicApi.postOrderInquiryDocumentsReviewTwo(value).then(res => {
if(res.code === 1000) {
props.onOK()
}
})
break;
}
}
/**操作 */
return (
<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
}}
>
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='state'
required
x-component="Radio"
x-component-props={{
}}
/>
<Field
title='审核不通过原因'
name="cause"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message: '原因最多60个汉字'
}}
/>
</SchemaForm>
</Modal>
)
}
export default AuditModal
\ No newline at end of file
import React, { useRef, useState } from 'react';
import { Card, Button, Row, Col } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import moment from 'moment';
import { timeRange } from '@/utils/index';
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 { FORM_FILTER_PATH } from '@/formSchema/const';
import { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
const formActions = createFormActions();
const ReviewList: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
},
{
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
},
]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button>批量提交审核</Button>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
)
}
export default ReviewList
\ No newline at end of file
......@@ -9,6 +9,9 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import {searchSelectGetSelectCategoryOptionEffect} from '../../effect/index'
import { ColumnType } from 'antd/lib/table/interface';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState } from '../../common/tableStatusList';
import StatusColors from '@/pages/transaction/components/StatusColors';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
......@@ -42,10 +45,19 @@ const EnquiryOrder: React.FC<{}> = (props) => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
}];
//交易能力 询价报价 询价单查询
const fetchData = async (params: any) => {
......
import React, { useRef, useState } from 'react';
import { Card, Button, Row, Col } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import moment from 'moment';
import { timeRange } from '@/utils/index';
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 { FORM_FILTER_PATH } from '@/formSchema/const';
import { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import ReviewList from '../components/reviewList';
const formActions = createFormActions();
const PendingReviewOne: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
},
{
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
},
]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button>批量提交审核</Button>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
<ReviewList />
)
}
......
import React, { useRef, useState } from 'react';
import { Card, Button, Row, Col } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import moment from 'moment';
import { timeRange } from '@/utils/index';
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 { FORM_FILTER_PATH } from '@/formSchema/const';
import { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import ReviewList from '../components/reviewList';
const formActions = createFormActions();
const PendingReviewTwo: React.FC<{}> = () => {
const ref = useRef<any>({});
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
},
{
title: '询价单摘要',
key: 'details',
dataIndex: 'details',
},
{
title: '被询价会员',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
},
{
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
},
{
title: '询价时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
},
{
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
},
]
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
/**多选 */
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button>批量提交审核</Button>
</Col>
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={pendingReviewSchema}
>
</NiceForm>
}
>
</StandardTable>
</Card>
</PageHeaderWrapper>
<ReviewList />
)
}
......
import React, { useRef, useState } from 'react';
import React, { useRef, useState, useEffect } from 'react';
import { Card, Button, Row, Col } from 'antd';
import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { StandardTable } from 'god';
import moment from 'moment';
......@@ -12,11 +13,18 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { pendingReviewSchema } from '../schema/pendingReview';
import { PageStatus } from '@/hooks/usePageStatus';
import { values, action } from 'mobx';
import { filterInternalState, filterExternalState } from './../../common/statusList';
import { quoteOrderInternalState } from '../../common/tableStatusList';
import StatusColors from '@/pages/transaction/components/StatusColors';
import { PublicApi } from '@/services/api';
import AuditModal from '../components/auditModel';
const formActions = createFormActions();
const PendingSubmit: React.FC<{}> = () => {
const ref = useRef<any>({});
const [id, setId] = useState<any>(0);
const [selectRow, setSelectRow] = useState([])
const [visible, setvisible] = useState(false)
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([])
const columns: ColumnType<any>[] = [
{
......@@ -53,16 +61,25 @@ const PendingSubmit: React.FC<{}> = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
},
{
filters: filterExternalState,
filterMultiple: false,
onFilter: (value, record) => record.externalState === value,
render: text => <StatusColors status={text} type='out' />
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
filters: filterInternalState,
filterMultiple: false,
onFilter: (value, record) => record.interiorState === value,
render: (text: any) =>
quoteOrderInternalState(text)
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any,record:any) => <Button type='link' onClick={() => {setId(record.id);setvisible(true)}}>审核</Button>
},
]
const format = (text) => {
......@@ -77,14 +94,48 @@ const PendingSubmit: React.FC<{}> = () => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
},
}
/**批量审核通过按钮 */
const controllerBtns = <Row>
<Col span={6}>
<Button>批量提交审核</Button>
<Button onClick={() => handleSubmitAll(selectedRowKeys)}>批量提交审核</Button>
</Col>
</Row>
/**列表数据 */
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderSubmitInquirySheetList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/**搜索 */
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 handleSubmitAll = (ids: number[]) => {
PublicApi.postOrderInquirySubmitAll({ ids: ids }).then(res => {
ref.current.reload()
})
}
const handleModalOK = () => {
setvisible(false)
setTimeout(()=> {
history.goBack()
},1000)
}
return (
<PageHeaderWrapper>
<Card>
......@@ -93,9 +144,11 @@ const PendingSubmit: React.FC<{}> = () => {
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'inquiryListNo', FORM_FILTER_PATH)
}}
......@@ -110,6 +163,13 @@ const PendingSubmit: React.FC<{}> = () => {
</StandardTable>
</Card>
<AuditModal
id={id}
type={1}
dialogVisible={visible}
onCancel={() => setvisible(false)}
onOK={ handleModalOK}
/>
</PageHeaderWrapper>
)
}
......
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