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

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

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