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

修改物流,询价商品|询价报价|确认询价报价|需求发布缺少的一些显示

parent 5ef44bef
/*
* @Author: LeeJiancong
* @Date: 2020-07-30 17:23:48
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 17:24:49
*/
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: 'rgba(255,235,230,1)',
borderRadius: '4px'
}
/*
* @Author: LeeJiancong
* @Date: 2020-07-30 17:23:48
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-30 17:24:49
*/
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: 'rgba(255,235,230,1)',
borderRadius: '4px'
}
}
\ No newline at end of file
import React, { useRef, ReactNode, useEffect } from 'react';
import { StandardTable } from 'god';
import { Row, Col, Space, Button, Card } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { LogisticsOrderSubmitSearchSchema, LogisticsOrderToBeSubmitSearchSchema, LogisticsOrderProcessingSearchSchema, LogisticsOrderToBeConfirmedSearchSchema, None } from './schema';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
interface tableListParams {
columns?: any, // 表头
reloadRef?: any, // 处理刷新
fetchData?: Function, // 列表数据
schema?: boolean, // 是否显示schema 搜索
schemaType?: 'LogisticsOrderSubmitSearchSchema' | 'LogisticsOrderToBeSubmitSearchSchema' | 'LogisticsOrderProcessingSearchSchema' | 'LogisticsOrderToBeConfirmedSearchSchema' | 'none'
}
const formActions = createFormActions();
const LogisticsTableList: React.FC<tableListParams> = (props) => {
const { columns, reloadRef, fetchData, schema = false, schemaType = 'none' } = props;
const ref = useRef<any>({});
const controllerBtns: ReactNode = <Row>
<Col>
<Button type='primary'>新建</Button>
</Col>
</Row>
const schemaRender = () => {
switch (schemaType) {
case 'LogisticsOrderSubmitSearchSchema': {
return LogisticsOrderSubmitSearchSchema
}
case 'LogisticsOrderToBeSubmitSearchSchema': {
return LogisticsOrderToBeSubmitSearchSchema
}
case 'LogisticsOrderProcessingSearchSchema': {
return LogisticsOrderProcessingSearchSchema
}
case 'LogisticsOrderToBeConfirmedSearchSchema': {
return LogisticsOrderToBeConfirmedSearchSchema
}
case 'none': {
return None
}
}
}
useEffect(() => {
if (reloadRef) {
const userAction = {
reload: () => ref.current.reload()
}
if (reloadRef && typeof reloadRef === 'function') {
reloadRef(userAction);
}
if (reloadRef && typeof reloadRef !== 'function') {
reloadRef.current = userAction;
}
}
})
return (
<PageHeaderWrapper>
<Card >
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'logisticsOrderNo', FORM_FILTER_PATH)
}}
expressionScope={{ controllerBtns }}
schema={schemaRender()}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default LogisticsTableList
import React, { useRef, ReactNode, useEffect } from 'react';
import { StandardTable } from 'god';
import { Row, Col, Space, Button, Card } from 'antd';
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { LogisticsOrderSubmitSearchSchema, LogisticsOrderToBeSubmitSearchSchema, LogisticsOrderProcessingSearchSchema, LogisticsOrderToBeConfirmedSearchSchema, None } from './schema';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
interface tableListParams {
columns?: any, // 表头
reloadRef?: any, // 处理刷新
fetchData?: Function, // 列表数据
schema?: boolean, // 是否显示schema 搜索
schemaType?: 'LogisticsOrderSubmitSearchSchema' | 'LogisticsOrderToBeSubmitSearchSchema' | 'LogisticsOrderProcessingSearchSchema' | 'LogisticsOrderToBeConfirmedSearchSchema' | 'none'
}
const formActions = createFormActions();
const LogisticsTableList: React.FC<tableListParams> = (props) => {
const { columns, reloadRef, fetchData, schema = false, schemaType = 'none' } = props;
const ref = useRef<any>({});
const controllerBtns: ReactNode = <Row>
<Col>
<Button type='primary'>新建</Button>
</Col>
</Row>
const schemaRender = () => {
switch (schemaType) {
case 'LogisticsOrderSubmitSearchSchema': {
return LogisticsOrderSubmitSearchSchema
}
case 'LogisticsOrderToBeSubmitSearchSchema': {
return LogisticsOrderToBeSubmitSearchSchema
}
case 'LogisticsOrderProcessingSearchSchema': {
return LogisticsOrderProcessingSearchSchema
}
case 'LogisticsOrderToBeConfirmedSearchSchema': {
return LogisticsOrderToBeConfirmedSearchSchema
}
case 'none': {
return None
}
}
}
useEffect(() => {
if (reloadRef) {
const userAction = {
reload: () => ref.current.reload()
}
if (reloadRef && typeof reloadRef === 'function') {
reloadRef(userAction);
}
if (reloadRef && typeof reloadRef !== 'function') {
reloadRef.current = userAction;
}
}
})
return (
<PageHeaderWrapper>
<Card >
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'logisticsOrderNo', FORM_FILTER_PATH)
}}
expressionScope={{ controllerBtns }}
schema={schemaRender()}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default LogisticsTableList
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, NumberPicker } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
import { PATTERN_MAPS } from '@/constants/regExp'
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
freightPrice?: any;
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
if(props.freightPrice) {
value.freightPrice = props.freightPrice
}
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
})
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 4) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value != 4) {
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
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea, NumberPicker
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 4
}}
>
<Field
enum={
[
{ label: '接受物流单', value: 4 },
{ label: '不接受物流单', value: 3 }
]}
name='status'
required
x-component="Radio"
/>
{props.dontReceive &&
<>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-mega-prop={{
labelAlign: 'left'
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message: '原因最多60个汉字'
}}
/>
</>
}
</SchemaForm>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true
}
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, NumberPicker } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
import { PATTERN_MAPS } from '@/constants/regExp'
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
freightPrice?: any;
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
if(props.freightPrice) {
value.freightPrice = props.freightPrice
}
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
}
})
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 4) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value != 4) {
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
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea, NumberPicker
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 4
}}
>
<Field
enum={
[
{ label: '接受物流单', value: 4 },
{ label: '不接受物流单', value: 3 }
]}
name='status'
required
x-component="Radio"
/>
{props.dontReceive &&
<>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-mega-prop={{
labelAlign: 'left'
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message: '原因最多60个汉字'
}}
/>
</>
}
</SchemaForm>
</Modal>
</>
)
}
comfirmDialog.defaultProps = {
dontReceive: true
}
export default comfirmDialog
\ No newline at end of file
@import "../../member/components/index.less";
.count{
font-size: 24px;
color: #303133;
font-weight: 500;
}
.add-btn{
margin-bottom: 24px;
padding: 6px 0;
text-align: center;
background: #FAFBFC;
}
.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;
}
}
.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% / 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;
}
}
}
}
&-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;
}
}
}
}
}
@import "../../member/components/index.less";
.count{
font-size: 24px;
color: #303133;
font-weight: 500;
}
.add-btn{
margin-bottom: 24px;
padding: 6px 0;
text-align: center;
background: #FAFBFC;
}
.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;
}
}
.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% / 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;
}
}
}
}
&-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;
}
}
}
}
}
}
\ No newline at end of file
......@@ -452,6 +452,7 @@ const detailInfo: React.FC<{}> = () => {
columns={columns}
dataSource={dataInfo.logisticsOrderLogList}
pagination={false}
rowKey={(record:any, index:number) => index}
/>
{/* <OrderLog id={id} pathName={history.location.pathname} /> 2020-12-11 已经在详情接口返回 不需要这个了 */}
</Col>
......
/*
* @Author: LeeJiancong
* @Date: 2020-09-23 10:24:42
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-29 14:25:20
* 外部流转记录
*/
import React, { Component,useRef,ReactNode } from 'react';
import { PublicApi } from '@/services/api'
import {StandardTable} from 'god'
import {Badge} from 'antd'
import {ColumnType} from 'antd/lib/table/interface'
import moment from 'moment'
const columns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'operatorRoleId',
align: 'center',
key: 'operatorRoleId',
},
{
title: '操作角色',
dataIndex: 'operatorRoleName',
align: 'center',
key: 'operatorRoleName',
},
{
title: '状态',
dataIndex: 'status',
align: 'left',
key: 'status',
render: (text: number, record: any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交" />:
text === 2 ? component = <Badge status='processing' text="待确认" />:
text === 3 ? component = <Badge status='error' text="不接受物流单" />:
component = <Badge status='success' text="接受物流单" />
return component;
},
},
{
title: '操作',
dataIndex: 'type',
align: 'center',
key: 'type',
render: (text: number ,record:any) =>
<>{text === 1 ?'提交物流单':'确认物流单'}</>
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
key: 'operateTime',
render:(text: any, record: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
key: 'remark',
width: 300
},
];
export interface Params{
id: string | number,
pathName?: string,
type?: string //Submit 能力中心待提交新增编辑
}
const Log: React.FC<Params> = (props) => {
const ref = useRef<any>({})
const fetchData = (params: any) => {
//待提交新增物流单
if(props.type === 'Submit' ){
return new Promise((resolve, reject) => {
if(!props.id){
resolve([])
}else{
PublicApi.getLogisticsOrderWaitSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
}
});
}
//物流单提交-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-待确认物流单
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderWaitConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
};
return <StandardTable
tableProps={{rowKey:'operatorRoleId'}}
currentRef={ref}
columns={columns}
fetchTableData={(params: any) => fetchData(params)}
/>
}
Log.defaultProps= {
type:"Submit"
}
/*
* @Author: LeeJiancong
* @Date: 2020-09-23 10:24:42
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-09-29 14:25:20
* 外部流转记录
*/
import React, { Component,useRef,ReactNode } from 'react';
import { PublicApi } from '@/services/api'
import {StandardTable} from 'god'
import {Badge} from 'antd'
import {ColumnType} from 'antd/lib/table/interface'
import moment from 'moment'
const columns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'operatorRoleId',
align: 'center',
key: 'operatorRoleId',
},
{
title: '操作角色',
dataIndex: 'operatorRoleName',
align: 'center',
key: 'operatorRoleName',
},
{
title: '状态',
dataIndex: 'status',
align: 'left',
key: 'status',
render: (text: number, record: any) => {
let component: ReactNode = null;
text === 1 ? component = <Badge status='default' text="待提交" />:
text === 2 ? component = <Badge status='processing' text="待确认" />:
text === 3 ? component = <Badge status='error' text="不接受物流单" />:
component = <Badge status='success' text="接受物流单" />
return component;
},
},
{
title: '操作',
dataIndex: 'type',
align: 'center',
key: 'type',
render: (text: number ,record:any) =>
<>{text === 1 ?'提交物流单':'确认物流单'}</>
},
{
title: '操作时间',
dataIndex: 'operateTime',
align: 'center',
key: 'operateTime',
render:(text: any, record: any) => <>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</>
},
{
title: '审核意见',
dataIndex: 'remark',
align: 'center',
key: 'remark',
width: 300
},
];
export interface Params{
id: string | number,
pathName?: string,
type?: string //Submit 能力中心待提交新增编辑
}
const Log: React.FC<Params> = (props) => {
const ref = useRef<any>({})
const fetchData = (params: any) => {
//待提交新增物流单
if(props.type === 'Submit' ){
return new Promise((resolve, reject) => {
if(!props.id){
resolve([])
}else{
PublicApi.getLogisticsOrderWaitSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
}
});
}
//物流单提交-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderSubmitPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-物流单查询
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsSubmit/orderSubmitSearchList/detail'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
//物流单处理-待确认物流单
else if(props.pathName == '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail'){
return new Promise((resolve, reject) => {
PublicApi.getLogisticsOrderWaitConfirmPageOrderLog({...params,orderId:props.id}).then(res => {
if(res.code === 1000){
resolve(res.data)
}
})
});
}
};
return <StandardTable
tableProps={{rowKey:'operatorRoleId'}}
currentRef={ref}
columns={columns}
fetchTableData={(params: any) => fetchData(params)}
/>
}
Log.defaultProps= {
type:"Submit"
}
export default Log
\ No newline at end of file
This diff is collapsed.
.selectBtn {
padding: 0 !important;
}
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-group .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-group .ant-input-group-addon {
padding: 0 !important;
}
.selectBtn {
padding: 0 !important;
}
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-wrapper .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .ant-input-group-wrapper .ant-input-group .ant-input-group-addon,
.ant-form-item-control .ant-form-item-control-input .ant-form-item-control-input-content .selectBtn .ant-input-group .ant-input-group-addon {
padding: 0 !important;
}
.selectBtn{
padding: 0 !important;
}
.ant-form-item-control{
.ant-form-item-control-input{
.ant-form-item-control-input-content{
.ant-input-group-wrapper, .selectBtn{
.ant-input-wrapper ,.ant-input-group{
.ant-input-group-addon{
padding: 0 !important;
}
}
}
}
}
.selectBtn{
padding: 0 !important;
}
.ant-form-item-control{
.ant-form-item-control-input{
.ant-form-item-control-input-content{
.ant-input-group-wrapper, .selectBtn{
.ant-input-wrapper ,.ant-input-group{
.ant-input-group-addon{
padding: 0 !important;
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
.schemaform {
:global {
.ant-row {
.ant-form-item-label {
label {
font-size: 12px !important;
}
}
.formily-mega-item-after,
.formily-mega-item-before {
font-size: 12px !important;
}
.mega-layout-item-content {
line-height: normal !important;
}
.formily-mega-item-before {
margin-left: 108px;
}
.preview-text {
line-height: 32px;
}
}
}
.schemaform {
:global {
.ant-row {
.ant-form-item-label {
label {
font-size: 12px !important;
}
}
.formily-mega-item-after,
.formily-mega-item-before {
font-size: 12px !important;
}
.mega-layout-item-content {
line-height: normal !important;
}
.formily-mega-item-before {
margin-left: 108px;
}
.preview-text {
line-height: 32px;
}
}
}
}
\ No newline at end of file
import React, { useState } from 'react';
import AddressList from './components/addressList'
const List = () => {
return (
<AddressList title='发货地址管理' type='1'/>
)
}
import React, { useState } from 'react';
import AddressList from './components/addressList'
const List = () => {
return (
<AddressList title='发货地址管理' type='1'/>
)
}
export default List
\ No newline at end of file
import React, { useState } from 'react';
import AddressList from './components/addressList'
const List = () => {
return (
<AddressList title='收货地址管理' type='2'/>
)
}
import React, { useState } from 'react';
import AddressList from './components/addressList'
const List = () => {
return (
<AddressList title='收货地址管理' type='2'/>
)
}
export default List
\ No newline at end of file
This diff is collapsed.
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const AddCompany: React.FC<{}> = () => {
return(
<CompanyTemplate />
)
}
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const AddCompany: React.FC<{}> = () => {
return(
<CompanyTemplate />
)
}
export default AddCompany;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const DetailCompany: React.FC<{}> = () => {
const { id } = history.location.query;
return(
<CompanyTemplate
pageStatus={'PREVIEW'}
id={id}
isSee={true}
/>
)
}
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const DetailCompany: React.FC<{}> = () => {
const { id } = history.location.query;
return(
<CompanyTemplate
pageStatus={'PREVIEW'}
id={id}
isSee={true}
/>
)
}
export default DetailCompany;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const EditCompany: React.FC<{}> = () => {
const { id } = history.location.query;
return(
<CompanyTemplate
pageStatus={'EDIT'}
id={id}
/>
)
}
import React from 'react';
import { history } from 'umi';
import CompanyTemplate from '../list/addCompany';
const EditCompany: React.FC<{}> = () => {
const { id } = history.location.query;
return(
<CompanyTemplate
pageStatus={'EDIT'}
id={id}
/>
)
}
export default EditCompany;
\ No newline at end of file
import React, { Component } from 'react'
import OrderList from '../components/orderSearchList'
const List = () => {
return (
<OrderList title='处理' type='2'/>
)
}
import React, { Component } from 'react'
import OrderList from '../components/orderSearchList'
const List = () => {
return (
<OrderList title='处理' type='2'/>
)
}
export default List
\ No newline at end of file
......@@ -128,9 +128,9 @@ const EditableCell: React.FC<EditableCellProps> = ({
);
};
/**
* @description:
* @param {type}
* @return:
* @description:
* @param {type}
* @return:
*/
const OrderList: React.FC<ListProps> = (props) => {
......@@ -168,15 +168,15 @@ const OrderList: React.FC<ListProps> = (props) => {
},
{
title: '发货方',
dataIndex: 'shipperName',
dataIndex: 'shipperMemberName',
align: 'center',
key: 'shipperName'
key: 'shipperMemberName'
},
{
title: '收货方',
align: 'center',
dataIndex: 'receiverName',
key: 'receiverName',
dataIndex: 'receiverMemberName',
key: 'receiverMemberName',
},
{
title: '总箱数',
......@@ -348,4 +348,4 @@ const OrderList: React.FC<ListProps> = (props) => {
OrderList.defaultProps = {
}
export default OrderList
\ No newline at end of file
export default OrderList
......@@ -40,7 +40,7 @@ const BasicInfo: React.FC<interfaceinfo> = (props) => {
//获取物流服务商
const getListCompany = () => {
const company = new Promise(resolve => {
PublicApi.getLogisticsSelectListmemberCompany({}).then(res => {
PublicApi.getLogisticsSelectListMemberCompany({}).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
/**
* @Name: 新增编辑 - 待提交物流单 - 流转记录
* @Date: 2020-11-06
* @Author: HJX
*/
import React from 'react';
import { Table } from 'antd';
import {ColumnType} from 'antd/lib/table/interface'
const TableLOG:React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'operatorRoleId'
},{
title: '操作角色',
dataIndex: 'operatorRoleName'
},{
title: '状态',
dataIndex: 'status'
},{
title: '操作',
dataIndex: 'type'
},{
title: '操作时间',
dataIndex: 'operateTime'
},{
title: '审核意见',
dataIndex: 'remark'
}
]
return(
<Table columns={columns} />
)
}
/**
* @Name: 新增编辑 - 待提交物流单 - 流转记录
* @Date: 2020-11-06
* @Author: HJX
*/
import React from 'react';
import { Table } from 'antd';
import {ColumnType} from 'antd/lib/table/interface'
const TableLOG:React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'operatorRoleId'
},{
title: '操作角色',
dataIndex: 'operatorRoleName'
},{
title: '状态',
dataIndex: 'status'
},{
title: '操作',
dataIndex: 'type'
},{
title: '操作时间',
dataIndex: 'operateTime'
},{
title: '审核意见',
dataIndex: 'remark'
}
]
return(
<Table columns={columns} />
)
}
export default TableLOG
\ No newline at end of file
import { useState } from 'react'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
export const useModalTable = (options?) => {
const [visible, setVisible] = useState(false)
const [rowSelection, rowSelectionCtl] = useRowSelectionTable(options)
return {
visible,
setVisible,
rowSelection,
rowSelectionCtl
}
import { useState } from 'react'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
export const useModalTable = (options?) => {
const [visible, setVisible] = useState(false)
const [rowSelection, rowSelectionCtl] = useRowSelectionTable(options)
return {
visible,
setVisible,
rowSelection,
rowSelectionCtl
}
}
\ No newline at end of file
import React, { useRef, useMemo, useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions, createControllerBox, useFormSpy } from '@formily/antd';
import { Button, Row, Col } from 'antd';
import { productInfoColumns } from '../constant';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
const getUnitPriceTotal = (record) => {
const purchaseCount = Number(record['purchaseCount']) || 0
let unitPrice = 0
Object.entries(record.unitPrice).forEach(([key, value]) => {
const [min, max] = key.split('-').map(v => Number(v))
if (min === 0 && max === 0) {
unitPrice = Number(value)
return false
}
if (purchaseCount >= min && purchaseCount <= max) {
// 处于该区间
unitPrice = Number(value)
return false
}
})
return unitPrice * purchaseCount
}
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const productRef = useRef<any>({})
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
const { pageStatus } = usePageStatus()
const handleDelete = (record) => {
const newData = [...ctx.getFieldValue('orderProductRequests')]
// 删除formvalue
const colIndex = newData.findIndex(v => v.id === record.id)
newData.splice(colIndex, 1)
// 删除选中的项
rowSelectionCtl.setSelectRow(newData)
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('orderProductRequests', newData)
}
const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) {
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => {
return <>
<Button type='link' onClick={() => handleDelete(record)}>删除</Button>
<Button type='link'>选择合并订单</Button>
</>
}
} else {
return [...productInfoColumns].slice(0, productInfoColumns.length - 1)
}
return productInfoColumns
})
const productAddButton = <Button onClick={() => productRef.current.setVisible(true)} block type='default' style={{margin: '24px auto'}}>选择订单商品</Button>
const productComponents = {
body: {
row: ProductEditableRow,
cell: ProductTableCell
}
}
const handleSave = row => {
return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id);
const item = newData[index];
row['price'] = getUnitPriceTotal(row)
row['productId'] = row.id
newData.splice(index, 1, {
...item,
...row,
});
ctx.setFieldValue('orderProductRequests', newData)
resolve({item, newData})
})
};
const productMergeColumns = productColumns.map(col => {
if (!col.editable) {
return col;
}
return {
...col,
onCell: record => ({
record,
editable: ctx.getFormState().editable === false ? false : col.editable,
dataIndex: col.dataIndex,
title: col.title,
formItem: col.formItem,
formItemProps: col.formItemProps,
handleSave
}),
};
})
return {
productRef,
productAddButton,
productColumns: productMergeColumns,
productComponents,
visible,
setVisible,
rowSelection,
rowSelectionCtl
}
import React, { useRef, useMemo, useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions, createControllerBox, useFormSpy } from '@formily/antd';
import { Button, Row, Col } from 'antd';
import { productInfoColumns } from '../constant';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
const getUnitPriceTotal = (record) => {
const purchaseCount = Number(record['purchaseCount']) || 0
let unitPrice = 0
Object.entries(record.unitPrice).forEach(([key, value]) => {
const [min, max] = key.split('-').map(v => Number(v))
if (min === 0 && max === 0) {
unitPrice = Number(value)
return false
}
if (purchaseCount >= min && purchaseCount <= max) {
// 处于该区间
unitPrice = Number(value)
return false
}
})
return unitPrice * purchaseCount
}
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const productRef = useRef<any>({})
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
const { pageStatus } = usePageStatus()
const handleDelete = (record) => {
const newData = [...ctx.getFieldValue('orderProductRequests')]
// 删除formvalue
const colIndex = newData.findIndex(v => v.id === record.id)
newData.splice(colIndex, 1)
// 删除选中的项
rowSelectionCtl.setSelectRow(newData)
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('orderProductRequests', newData)
}
const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) {
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => {
return <>
<Button type='link' onClick={() => handleDelete(record)}>删除</Button>
<Button type='link'>选择合并订单</Button>
</>
}
} else {
return [...productInfoColumns].slice(0, productInfoColumns.length - 1)
}
return productInfoColumns
})
const productAddButton = <Button onClick={() => productRef.current.setVisible(true)} block type='default' style={{margin: '24px auto'}}>选择订单商品</Button>
const productComponents = {
body: {
row: ProductEditableRow,
cell: ProductTableCell
}
}
const handleSave = row => {
return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('orderProductRequests')];
const index = newData.findIndex(item => row.id === item.id);
const item = newData[index];
row['price'] = getUnitPriceTotal(row)
row['productId'] = row.id
newData.splice(index, 1, {
...item,
...row,
});
ctx.setFieldValue('orderProductRequests', newData)
resolve({item, newData})
})
};
const productMergeColumns = productColumns.map(col => {
if (!col.editable) {
return col;
}
return {
...col,
onCell: record => ({
record,
editable: ctx.getFormState().editable === false ? false : col.editable,
dataIndex: col.dataIndex,
title: col.title,
formItem: col.formItem,
formItemProps: col.formItemProps,
handleSave
}),
};
})
return {
productRef,
productAddButton,
productColumns: productMergeColumns,
productComponents,
visible,
setVisible,
rowSelection,
rowSelectionCtl
}
}
\ No newline at end of file
import React, { Component } from 'react'
import OrderList from '../components/orderSearchList'
const List = () => {
return (
<OrderList title='提交' type='1'/>
)
}
import React, { Component } from 'react'
import OrderList from '../components/orderSearchList'
const List = () => {
return (
<OrderList title='提交' type='1'/>
)
}
export default List
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const AddShipingAddress:React.FC<{}> = () => {
return(
<AddressTemplate
type={2}
/>
)
}
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const AddShipingAddress:React.FC<{}> = () => {
return(
<AddressTemplate
type={2}
/>
)
}
export default AddShipingAddress;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const EditShipingAddress:React.FC<{}> = () => {
const { id } = history.location.query;
return(
<AddressTemplate
type={2}
id={id}
/>
)
}
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const EditShipingAddress:React.FC<{}> = () => {
const { id } = history.location.query;
return(
<AddressTemplate
type={2}
id={id}
/>
)
}
export default EditShipingAddress;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const AddShipingAddress:React.FC<{}> = () => {
return(
<AddressTemplate
type={1}
id={0}
/>
)
}
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const AddShipingAddress:React.FC<{}> = () => {
return(
<AddressTemplate
type={1}
id={0}
/>
)
}
export default AddShipingAddress;
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const EditShipingAddress:React.FC<{}> = () => {
const { id } = history.location.query;
return(
<AddressTemplate
type={1}
id={id}
/>
)
}
import React from 'react';
import { history } from 'umi';
import AddressTemplate from '../list/components/addressForm';
const EditShipingAddress:React.FC<{}> = () => {
const { id } = history.location.query;
return(
<AddressTemplate
type={1}
id={id}
/>
)
}
export default EditShipingAddress;
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-08-01 11:06:09
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-01 11:07:49
*/
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
}
]
export const outSideStatusList = [
{
label: '外部状态(全部)', value: ''
},
{
label: '待提交', value: 1
},
{
label: '待确认', value: 2
},
{
label: '接受物流单', value: 3
},
{
label: '不接受物流单', value: 4
}
]
export const statusList = [
{
text: '待提交', value: 1
},
{
text: '待确认', value: 2
},
{
text: '接受物流单', value: 3
},
{
text: '不接受物流单', value: 4
}
/*
* @Author: LeeJiancong
* @Date: 2020-08-01 11:06:09
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-01 11:07:49
*/
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
}
]
export const outSideStatusList = [
{
label: '外部状态(全部)', value: ''
},
{
label: '待提交', value: 1
},
{
label: '待确认', value: 2
},
{
label: '接受物流单', value: 3
},
{
label: '不接受物流单', value: 4
}
]
export const statusList = [
{
text: '待提交', value: 1
},
{
text: '待确认', value: 2
},
{
text: '接受物流单', value: 3
},
{
text: '不接受物流单', value: 4
}
]
\ No newline at end of file
import React, { useState, useRef } from 'react';
import { message, Button, Popconfirm } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandAdd: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderNewRequisitionFormAuditAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormAwaitList({ ...params }).then(res => {
resolve(res.data);
})
})
}
/** 批量删除 */
const batchDel = () => {
if (selectRow.length > 0) {
PublicApi.postOrderRequisitionFormDeleteAll({ ids: selectRow }).then(res => {
ref.current.reload()
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 删除 -> 单个 */
const handleDelete = (id:any) => {
PublicApi.getOrderRequisitionFormIsDelete({id, current: '1', pageSize: '100'}).then(res => {
if(res.code === 1000) {
message.error('删除成功')
ref.current.reload();
}
})
console.log(id)
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<>
{
(record.interiorState !== 3 &&
<Button type="link" onClick={() => history.push(`/memberCenter/tranactionAbility/demandPosts/demandAdd/edit?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={() => PublicApi.postOrderNewRequisitionFormAudit({ id: record.id }).then(res => {
ref.current.reload()
})}>
<Button type='link'>提交</Button>
</Popconfirm>
</>
}
</>
}
return (
<TableListInfo
type={2}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
batchDel={batchDel}
column={optionColumns}
/>
)
}
export default DemandAdd;
import React, { useState, useRef } from 'react';
import { message, Button, Popconfirm } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandAdd: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderNewRequisitionFormAuditAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
setSelectRow([])
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormAwaitList({ ...params }).then(res => {
resolve(res.data);
})
})
}
/** 批量删除 */
const batchDel = () => {
if (selectRow.length > 0) {
PublicApi.postOrderRequisitionFormDeleteAll({ ids: selectRow }).then(res => {
ref.current.reload()
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 删除 -> 单个 */
const handleDelete = (id:any) => {
PublicApi.getOrderRequisitionFormIsDelete({id, current: '1', pageSize: '100'}).then(res => {
if(res.code === 1000) {
message.error('删除成功')
ref.current.reload();
}
})
console.log(id)
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<>
{
(record.interiorState !== 3 &&
<Button type="link" onClick={() => history.push(`/memberCenter/tranactionAbility/demandPosts/demandAdd/edit?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={() => PublicApi.postOrderNewRequisitionFormAudit({ id: record.id }).then(res => {
ref.current.reload()
})}>
<Button type='link'>提交</Button>
</Popconfirm>
</>
}
</>
}
return (
<TableListInfo
type={2}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
batchDel={batchDel}
column={optionColumns}
/>
)
}
export default DemandAdd;
import React, { useState, useRef } from 'react';
import { message, Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandAuditOne: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderRequisitionFormAuditAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormAuditList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Button
type="link"
onClick={() =>
history.push(`/memberCenter/tranactionAbility/demandPosts/demandAuditOne/detail?id=${record.id}`)
}
>
审核
</Button>
}
return (
<TableListInfo
type={3}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
column={optionColumns}
/>
)
}
export default DemandAuditOne;
import React, { useState, useRef } from 'react';
import { message, Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandAuditOne: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderRequisitionFormAuditAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
setSelectRow([])
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormAuditList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Button
type="link"
onClick={() =>
history.push(`/memberCenter/tranactionAbility/demandPosts/demandAuditOne/detail?id=${record.id}`)
}
>
审核
</Button>
}
return (
<TableListInfo
type={3}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
column={optionColumns}
/>
)
}
export default DemandAuditOne;
import React, { useState, useRef } from 'react';
import { message, Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandAuditTwo: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderRequisitionFormAuditAllTwo({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormAuditTwoList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Button
type="link"
onClick={() =>
history.push(`/memberCenter/tranactionAbility/demandPosts/demandAuditTwo/detail?id=${record.id}`)
}
>
审核
</Button>
}
return(
<TableListInfo
type={4}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
column={optionColumns}
/>
)
}
export default DemandAuditTwo;
import React, { useState, useRef } from 'react';
import { message, Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandAuditTwo: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderRequisitionFormAuditAllTwo({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
setSelectRow([])
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormAuditTwoList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Button
type="link"
onClick={() =>
history.push(`/memberCenter/tranactionAbility/demandPosts/demandAuditTwo/detail?id=${record.id}`)
}
>
审核
</Button>
}
return(
<TableListInfo
type={4}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
column={optionColumns}
/>
)
}
export default DemandAuditTwo;
import React, { useState, useRef } from 'react';
import { message, Button, Popconfirm } from 'antd';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandSubmit: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderSubmitRequisitionFormAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormSubmitList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Popconfirm title="确定要提交吗?" okText="是" cancelText="否" onConfirm={() => PublicApi.postOrderSubmitRequisitionForm({ id: record.id }).then(res => {
ref.current.reload()
})}>
<Button type='link'>提交</Button>
</Popconfirm>
}
return(
<TableListInfo
type={5}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
column={optionColumns}
/>
)
}
export default DemandSubmit;
import React, { useState, useRef } from 'react';
import { message, Button, Popconfirm } from 'antd';
import { PublicApi } from '@/services/api';
import TableListInfo from '../components/tableList';
const DemandSubmit: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
/** 多选 */
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
/** 批量操作 */
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderSubmitRequisitionFormAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
setSelectRow([])
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的单据!')
}
}
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderRequisitionFormSubmitList({ ...params }).then(res => {
resolve(res.data)
})
})
}
/** 操作的columns */
const optionColumns = {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) =>
<Popconfirm title="确定要提交吗?" okText="是" cancelText="否" onConfirm={() => PublicApi.postOrderSubmitRequisitionForm({ id: record.id }).then(res => {
ref.current.reload()
})}>
<Button type='link'>提交</Button>
</Popconfirm>
}
return(
<TableListInfo
type={5}
reloadRef={ref}
loading={loading}
fetchData={fetchData}
select={selectAll}
batch={batchAction}
column={optionColumns}
/>
)
}
export default DemandSubmit;
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
const PendingReviewOne: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderInquiryToAuditList({ ...params }).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderInquiryDocumentsReviewAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的询价单!')
}
}
const column = {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/preview?id=${record.id}`}>{text}</EyePreview>
}
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
loading={loading}
type={2}
column={column}
/>
)
}
export default PendingReviewOne
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
const PendingReviewOne: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderInquiryToAuditList({ ...params }).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
setLoading(true)
return new Promise((resolve, reject) => {
PublicApi.postOrderInquiryDocumentsReviewAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
setSelectRow([])
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的询价单!')
}
}
const column = {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/preview?id=${record.id}`}>{text}</EyePreview>
}
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
loading={loading}
type={2}
column={column}
/>
)
}
export default PendingReviewOne
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
const PendingReviewTwo: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
//列表数据
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderInquiryToAuditListTwo({...params}).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
setLoading(true)
PublicApi.postOrderInquiryDocumentsReviewAllTwo({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的询价单!')
}
}
const column = {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo/preview?id=${record.id}`}>{text}</EyePreview>
}
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={3}
loading={loading}
column={column}
/>
)
}
export default PendingReviewTwo
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
const PendingReviewTwo: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
//列表数据
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
PublicApi.getOrderInquiryToAuditListTwo({...params}).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
setLoading(true)
PublicApi.postOrderInquiryDocumentsReviewAllTwo({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
setLoading(false)
setSelectRow([])
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的询价单!')
}
}
const column = {
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo/preview?id=${record.id}`}>{text}</EyePreview>
}
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={3}
loading={loading}
column={column}
/>
)
}
export default PendingReviewTwo
import React, { useState, useEffect, ReactNode } from 'react';
import styles from './index.less';
import { Input, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
interface queryProps {
inquiryNo?: any,
getGoodsList: Function,
editData: any,
type?: any
}
const EnquiryGoods: React.FC<queryProps> = (props) => {
const { inquiryNo, getGoodsList, editData, type } = props
// 会员添加弹窗控制
const [goodsList, setgoodsList] = useState([]);
// 计算金额
const countMoney = (num: any, money: any) => {
let price: ReactNode = null;
price = (Number(money) * 1) / Number(num);
return Number(price).toFixed(4);
}
/**输入框输入 */
const inputOnchange = (id, e) => {
const { value } = e.target
goodsList.forEach(v => {
if (v.productId === id) {
v.money = value
v.price = countMoney(v.purchaseCount, value);
}
})
getGoodsList([...goodsList]) // 返回给父级
setgoodsList([...goodsList])
}
const columns: ColumnType<any>[] = [{
title: '商品ID',
dataIndex: 'productId',
}, {
title: '商品名称',
dataIndex: 'productName',
}, {
title: '品类',
dataIndex: 'category',
}, {
title: '品牌',
dataIndex: 'brand',
}, {
title: '单位',
dataIndex: 'unit',
}, {
title: '采购数量',
dataIndex: 'purchaseCount',
}, {
title: '报价单价',
dataIndex: 'price',
}, {
title: '金额',
dataIndex: 'money',
render: (text: any, record: any) => (
<Form.Item name={record.productId} noStyle initialValue={record.money}>
<Input
addonBefore="¥"
onBlur={(e) => inputOnchange(record.productId, e)}
type='number'
maxLength={25}
/>
</Form.Item>
)
}]
useEffect(() => {
if (Object.keys(inquiryNo).length > 0 && inquiryNo.orderId) {
console.log(inquiryNo)
PublicApi.getOrderProductInquiryDetails({ id: inquiryNo.orderId }).then(res => {
if (res.code === 1000) {
const data = res.data.inquiryListProductRequests;
data.forEach((item: any) => {
item.money = item.purchaseCount * item.price
})
getGoodsList(data)
setgoodsList(data)
}
})
}
}, [inquiryNo])
// 编辑时回显的数据
useEffect(() => {
if (Object.keys(editData).length > 0) {
setgoodsList(editData.inquiryListProductRequests);
}
}, [])
return (
<div className={styles.revise_style}>
<Form>
<Table rowKey={'productId'} style={{ marginTop: '16px' }} columns={columns} dataSource={goodsList} pagination={false} />
</Form>
</div>
)
}
export default EnquiryGoods
\ No newline at end of file
import React, { useState, useEffect, ReactNode } from 'react';
import styles from './index.less';
import { Input, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
interface queryProps {
inquiryNo?: any,
getGoodsList: Function,
editData: any,
type?: any
}
const EnquiryGoods: React.FC<queryProps> = (props) => {
const { inquiryNo, getGoodsList, editData, type } = props
// 会员添加弹窗控制
const [goodsList, setgoodsList] = useState([]);
// 计算金额
const countMoney = (num: any, money: any) => {
let price: ReactNode = null;
price = (Number(money) * 1) / Number(num);
return Number(price).toFixed(4);
}
/**输入框输入 */
const inputOnchange = (id, e) => {
const { value } = e.target
goodsList.forEach(v => {
if (v.productId === id) {
v.money = value
v.price = countMoney(v.purchaseCount, value);
}
})
getGoodsList([...goodsList]) // 返回给父级
setgoodsList([...goodsList])
}
const columns: ColumnType<any>[] = [{
title: '商品ID',
dataIndex: 'productId',
}, {
title: '商品名称',
dataIndex: 'productName',
}, {
title: '品类',
dataIndex: 'category',
}, {
title: '品牌',
dataIndex: 'brand',
}, {
title: '单位',
dataIndex: 'unit',
}, {
title: '采购数量',
dataIndex: 'purchaseCount',
}, {
title: '报价单价',
dataIndex: 'price',
}, {
title: '金额',
dataIndex: 'money',
render: (text: any, record: any) => (
<Form.Item name={record.productId} noStyle initialValue={record.money}>
<Input
addonBefore="¥"
onBlur={(e) => inputOnchange(record.productId, e)}
type='number'
maxLength={25}
/>
</Form.Item>
)
}]
useEffect(() => {
if (Object.keys(inquiryNo).length > 0 && inquiryNo.orderId) {
console.log(inquiryNo)
PublicApi.getOrderProductInquiryDetails({ id: inquiryNo.orderId }).then(res => {
if (res.code === 1000) {
const data = res.data.inquiryListProductRequests;
data.forEach((item: any) => {
item.money = item.purchaseCount * item.price
})
getGoodsList(data)
setgoodsList(data)
}
})
}
}, [inquiryNo])
// 编辑时回显的数据
useEffect(() => {
if (Object.keys(editData).length > 0) {
setgoodsList(editData.inquiryListProductRequests);
}
}, [])
return (
<div className={styles.revise_style}>
<Form>
<Table rowKey={'productId'} style={{ marginTop: '16px' }} columns={columns} dataSource={goodsList} pagination={false} />
</Form>
</div>
)
}
export default EnquiryGoods
import React, { useEffect, useState } from 'react';
import styles from './index.less';
import { Radio } from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import GeneralExternalState from '@/pages/transaction/common/externalState';
import GeneralInteriorState from '@/pages/transaction/common/interiorState';
export interface parmas {
editData?: any
}
const FlowRecord: React.FC<parmas> = (props) => {
const { editData } = props;
const [radio, setRadio] = useState<string>('outer'); //切换单据
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const outerColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'id',
}, {
title: '操作角色',
dataIndex: 'roleName',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <GeneralExternalState colorType={2} state={text} data={externalState} />
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const insideColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'id',
}, {
title: '操作人',
dataIndex: 'roleName',
}, {
title: '部门',
dataIndex: 'department',
}, {
title: '职位',
dataIndex: 'position',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <GeneralInteriorState colorType={2} state={text} data={interiorState} />
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const onChange = (e: any) => {
setRadio(e.target.value)
}
/**
* @description: 外部流转记录
* @param {type}
* @return {type}
*/
const externalTextState = (text) => {
let name = ''
editData.externalQuotationStateResponses.forEach(element => {
if (element.state === text) {
name = element.operationalProcess
}
})
return <>{name}</>
}
/**
* @description: 内部流转记录
* @param {type}
* @return {type}
*/
const interiorTextState = (text) => {
let name = ''
editData.interiorQuotationStateResponses.forEach(element => {
if (element.state === text) {
name = element.operationalProcess
}
})
return <>{name}</>
}
const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]);
useEffect(() => {
const external = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用外部状态
PublicApi.getOrderProductInquiryExternalStateEnum().then((res:any) => {
if(res.code === 1000) {
resolve(res.data)
}
})
})
const interior = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用内部状态
PublicApi.getOrderProductInquiryInteriorStateEnum().then((res:any) => {
if(res.code === 1000) {
resolve(res.data)
}
})
})
Promise.all([external,interior]).then(res => {
setExternalState(res[0])
setInteriorState(res[1])
})
},[])
return (
<div className={styles.revise_style}>
<Radio.Group defaultValue="outer" buttonStyle="solid" onChange={onChange}>
<Radio.Button value="outer">外部单据</Radio.Button>
<Radio.Button value="inside">内部单据</Radio.Button>
</Radio.Group>
{radio === 'outer' ?
<PolymericTable
dataSource={editData.externalRequisitionFormResponses}
columns={outerColumns}
loading={false}
pagination={null}
/>
:
<PolymericTable
dataSource={editData.interiorQuotationLogResponses}
columns={insideColumns}
loading={false}
pagination={null}
/>
}
</div>
)
}
export default FlowRecord
import React, { useEffect, useState } from 'react';
import styles from './index.less';
import { Radio } from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import GeneralExternalState from '@/pages/transaction/common/externalState';
import GeneralInteriorState from '@/pages/transaction/common/interiorState';
export interface parmas {
editData?: any
}
const FlowRecord: React.FC<parmas> = (props) => {
const { editData } = props;
const [radio, setRadio] = useState<string>('outer'); //切换单据
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const outerColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'id',
}, {
title: '操作角色',
dataIndex: 'roleName',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <GeneralExternalState colorType={2} state={text} data={externalState} />
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const insideColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'id',
}, {
title: '操作人',
dataIndex: 'roleName',
}, {
title: '部门',
dataIndex: 'department',
}, {
title: '职位',
dataIndex: 'position',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <GeneralInteriorState colorType={2} state={text} data={interiorState} />
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const onChange = (e: any) => {
setRadio(e.target.value)
}
const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]);
useEffect(() => {
const external = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用外部状态
PublicApi.getOrderProductInquiryExternalStateEnum().then((res:any) => {
if(res.code === 1000) {
resolve(res.data)
}
})
})
const interior = new Promise(resolve => {
// 询价查询, 询价报价, 确认询价报价单 通用内部状态
PublicApi.getOrderProductInquiryInteriorStateEnum().then((res:any) => {
if(res.code === 1000) {
resolve(res.data)
}
})
})
Promise.all([external,interior]).then(res => {
setExternalState(res[0])
setInteriorState(res[1])
})
},[])
return (
<div className={styles.revise_style}>
<Radio.Group defaultValue="outer" buttonStyle="solid" onChange={onChange}>
<Radio.Button value="outer">外部单据</Radio.Button>
<Radio.Button value="inside">内部单据</Radio.Button>
</Radio.Group>
{radio === 'outer' ?
<PolymericTable
dataSource={editData.externalRequisitionFormResponses}
columns={outerColumns}
loading={false}
pagination={null}
/>
:
<PolymericTable
dataSource={editData.interiorQuotationLogResponses}
columns={insideColumns}
loading={false}
pagination={null}
/>
}
</div>
)
}
export default FlowRecord
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
const PendingReviewOne: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderAuditProductQuotationList({...params}).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
PublicApi.postOrderProductQuotationtAuditAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的报价单!')
}
}
const column: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/quote/preview?id=${record.id}`}>{text}</EyePreview>
},
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/rfq/preview?id=${record.inquiryListId}`}>{text}</EyePreview>
}]
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={2}
column={column}
/>
)
}
export default PendingReviewOne
\ No newline at end of file
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
const PendingReviewOne: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderAuditProductQuotationList({...params}).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
PublicApi.postOrderProductQuotationtAuditAll({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
ref.current.reload();
setSelectRow([])
}
})
})
} else {
message.error('请选择要操作的报价单!')
}
}
const column: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/quote/preview?id=${record.id}`}>{text}</EyePreview>
},
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/rfq/preview?id=${record.inquiryListId}`}>{text}</EyePreview>
}]
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={2}
column={column}
/>
)
}
export default PendingReviewOne
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
const PendingReviewTwo: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderAuditProductQuotationListTwo({...params}).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
PublicApi.postOrderProductQuotationtAuditAllTwo({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
ref.current.reload();
}
})
})
} else {
message.error('请选择要操作的报价单!')
}
}
const column: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/quote/preview?id=${record.id}`}>{text}</EyePreview>
},
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/rfq/preview?id=${record.inquiryListId}`}>{text}</EyePreview>
}]
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={3}
column={column}
/>
)
}
export default PendingReviewTwo
\ No newline at end of file
import React, { useRef, useState } from 'react';
import { message } from 'antd';
import ReviewList from '../components/reviewList';
import { timeRange } from '@/utils/index';
import { PublicApi } from '@/services/api';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
const PendingReviewTwo: React.FC<{}> = () => {
const [selectRow, setSelectRow] = useState<Array<number>>([]);
const ref = useRef<any>({});
// 多选
const selectAll = (values: any) => {
setSelectRow(values);
console.log(values, '我是多选的id')
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getOrderAuditProductQuotationListTwo({...params}).then(res => {
resolve(res.data)
})
})
}
// 批量操作
const batchAction = () => {
if (selectRow.length > 0) {
return new Promise((resolve, reject) => {
PublicApi.postOrderProductQuotationtAuditAllTwo({ ids: selectRow }).then(res => {
if (res.code === 1000) {
resolve(res.data)
ref.current.reload();
setSelectRow([])
}
})
})
} else {
message.error('请选择要操作的报价单!')
}
}
const column: ColumnType<any>[] = [{
title: '报价单号',
key: 'quotationNo',
dataIndex: 'quotationNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/quote/preview?id=${record.id}`}>{text}</EyePreview>
},
{
title: '询价单号',
key: 'inquiryListNo',
dataIndex: 'inquiryListNo',
render: (text: any, record: any) => <EyePreview
url={`/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/rfq/preview?id=${record.inquiryListId}`}>{text}</EyePreview>
}]
return (
<ReviewList
reloadRef={ref}
fetchData={fetchData}
selectAll={selectAll}
batchAction={batchAction}
type={3}
column={column}
/>
)
}
export default PendingReviewTwo
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