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

Merge branch 'dev-srm' into v2

parents 4edc4b00 a57bc860
/** 详情通用 - 流转进度 */ /** 详情通用 - 流转进度 */
import React, { useContext, useState } from 'react'; import React, { useContext, useEffect, useState } from 'react';
import { Radio, Steps } from 'antd'; import { Radio, Steps } from 'antd';
import { Context } from '../context'; import { Context } from '../context';
import Card from '../../../card'; import Card from '../../../card';
import style from './index.less'; import style from './index.less';
import { isEmpty } from 'lodash';
const LOGSTATESTYPE = { const LOGSTATESTYPE = {
/** 外部流转 */ /** 外部流转 */
...@@ -22,28 +23,41 @@ export interface ProgressProps { ...@@ -22,28 +23,41 @@ export interface ProgressProps {
const ProgressLayout: React.FC<ProgressProps> = (props: any) => { const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
const { logstate } = props; const { logstate } = props;
const context = useContext(Context); const context = useContext(Context);
const [logStatesStatus, setLogStatesStatus] = useState<number>( logstate || LOGSTATESTYPE.EXTERNALSTATES); console.log(context)
const [logStatesStatus, setLogStatesStatus] = useState<number>(1);
const [data, setData] = useState<any>({})
useEffect(() => {
if (!isEmpty(context)) {
setLogStatesStatus(context.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES)
setData(context)
}
}, [context])
return ( return (
<Card <Card
id='progressLayout' id='progressLayout'
title='流转进度' title='流转进度'
extra={ extra={
<>
{!isEmpty(data) && (
<Radio.Group <Radio.Group
onChange={(e) => setLogStatesStatus(e.target.value)} onChange={(e) => setLogStatesStatus(e.target.value)}
defaultValue={logStatesStatus} defaultValue={data.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
> >
{context.externalLogStates && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>} {data.externalLogStates && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{context.interiorLogStates && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>} {data.interiorLogStates && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
{context.examineInteriorLogStates && <Radio.Button value={LOGSTATESTYPE.EXMAINEINERIORSTATES}>竞价结果内部流转</Radio.Button>} {data.examineInteriorLogStates && <Radio.Button value={LOGSTATESTYPE.EXMAINEINERIORSTATES}>竞价结果内部流转</Radio.Button>}
</Radio.Group> </Radio.Group>
)}
</>
} }
> >
<Steps <Steps
progressDot progressDot
> >
{logStatesStatus === LOGSTATESTYPE.EXTERNALSTATES ? {logStatesStatus === LOGSTATESTYPE.EXTERNALSTATES ?
context.externalLogStates && context.externalLogStates.map(item => ( data.externalLogStates && data.externalLogStates.map(item => (
<Steps.Step <Steps.Step
key={item.state} key={item.state}
title={item.operationalProcess} title={item.operationalProcess}
...@@ -51,7 +65,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => { ...@@ -51,7 +65,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
status={item.isExecute ? 'finish' : 'wait'} status={item.isExecute ? 'finish' : 'wait'}
/> />
)) : (logStatesStatus === LOGSTATESTYPE.INTERIORSTATES ? )) : (logStatesStatus === LOGSTATESTYPE.INTERIORSTATES ?
context.interiorLogStates && context.interiorLogStates.map(item => ( data.interiorLogStates && data.interiorLogStates.map(item => (
<Steps.Step <Steps.Step
key={item.state} key={item.state}
title={item.operationalProcess} title={item.operationalProcess}
...@@ -59,7 +73,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => { ...@@ -59,7 +73,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
status={item.isExecute ? 'finish' : 'wait'} status={item.isExecute ? 'finish' : 'wait'}
/> />
)) : )) :
context.examineInteriorLogStates && context.examineInteriorLogStates.map(item => ( data.examineInteriorLogStates && data.examineInteriorLogStates.map(item => (
<Steps.Step <Steps.Step
key={item.state} key={item.state}
title={item.operationalProcess} title={item.operationalProcess}
......
/** 详情通用 - 流转进度 */ /** 详情通用 - 流转进度 */
import React, { useContext, useState } from 'react'; import React, { useContext, useEffect, useState } from 'react';
import { Radio, Table } from 'antd'; import { Radio, Table } from 'antd';
import { Context } from '../context'; import { Context } from '../context';
import Card from '../../../card'; import Card from '../../../card';
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
EXTERNALLOGS, EXTERNALLOGS,
INTERNALLOGS, INTERNALLOGS,
} from './columns'; } from './columns';
import { isEmpty } from 'lodash';
const LOGSTATESTYPE = { const LOGSTATESTYPE = {
/** 外部流转 */ /** 外部流转 */
...@@ -23,30 +24,41 @@ export interface ProgressProps { ...@@ -23,30 +24,41 @@ export interface ProgressProps {
const RecordLayout: React.FC<ProgressProps> = (props: any) => { const RecordLayout: React.FC<ProgressProps> = (props: any) => {
const { logstate } = props; const { logstate } = props;
const context = useContext(Context); const context = useContext(Context);
const [logStatus, setLogStatus] = useState<number>(context.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES ); const [logStatus, setLogStatus] = useState<number>(context.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES);
const [data, setData] = useState<any>({})
useEffect(() => {
if (!isEmpty(context)) {
setLogStatus(context.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES)
setData(context)
}
}, [context])
return ( return (
<Card <Card
id='recordLyout' id='recordLyout'
title='流转记录' title='流转记录'
extra={ extra={
<>
{!isEmpty(data) && (
<Radio.Group <Radio.Group
onChange={(e) => setLogStatus(e.target.value)} onChange={(e) => setLogStatus(e.target.value)}
defaultValue={context.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES} defaultValue={data.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
> >
{/* {context.externalLogs && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>} {data.externalLogs && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{context.interiorLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>} */} {data.interiorLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
<Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>
<Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>
</Radio.Group> </Radio.Group>
)}
</>
} }
> >
<Table <Table
columns={logStatus === LOGSTATESTYPE.EXTERNALSTATES ? EXTERNALLOGS : INTERNALLOGS} columns={logStatus === LOGSTATESTYPE.EXTERNALSTATES ? EXTERNALLOGS : INTERNALLOGS}
dataSource={ dataSource={
logStatus === LOGSTATESTYPE.EXTERNALSTATES ? logStatus === LOGSTATESTYPE.EXTERNALSTATES ?
context.externalLogs : data.externalLogs :
context.interiorLogs data.interiorLogs
} }
rowKey={(record) => record.id} rowKey={(record) => record.id}
pagination={{ pagination={{
......
...@@ -122,9 +122,7 @@ const InquiryOfferPreview = () => { ...@@ -122,9 +122,7 @@ const InquiryOfferPreview = () => {
} }
const { data } = res; const { data } = res;
data.externalLogStates = [...data.externalInquiryListStateResponses]; data.externalLogStates = [...data.externalInquiryListStateResponses];
data.interiorLogStates = [...data.interiorRequisitionFormStateResponses];
data.externalLogs = [...data.externalInquiryListLogResponses]; data.externalLogs = [...data.externalInquiryListLogResponses];
data.interiorLogs = [...data.interiorInquiryListLogResponses];
setDataSource(data); setDataSource(data);
handleBasicEffect(data); handleBasicEffect(data);
handleConditionEffect(data); handleConditionEffect(data);
......
...@@ -40,7 +40,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => { ...@@ -40,7 +40,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
const count = (num: any, price: any) => { const count = (num: any, price: any) => {
let money: any = null; let money: any = null;
money = (Number(price) * 1) / Number(num); money = (Number(price) * 1) * Number(num);
return Number(money).toFixed(2); return Number(money).toFixed(2);
} }
......
...@@ -14,7 +14,7 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => { ...@@ -14,7 +14,7 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
const [dataSource, setDataSource] = useState<any[]>([]); const [dataSource, setDataSource] = useState<any[]>([]);
const count = (num: any, price: any) => { const count = (num: any, price: any) => {
let money: any = null; let money: any = null;
money = (Number(price) * 1) / Number(num); money = (Number(price) * 1) * Number(num);
return Number(money).toFixed(2); return Number(money).toFixed(2);
} }
const handleChange = (id, e) => { const handleChange = (id, e) => {
......
...@@ -74,26 +74,6 @@ export const WAITSUBMITOFFERSCHEMA: ISchema = { ...@@ -74,26 +74,6 @@ export const WAITSUBMITOFFERSCHEMA: ISchema = {
placeholder: "单据时间(全部)", placeholder: "单据时间(全部)",
} }
}, },
externalState: {
type: "string",
"x-component-props": {
placeholder: "外部状态",
style: {
width: 160
}
},
enum: []
},
interiorState: {
type: "string",
"x-component-props": {
placeholder: "内部状态",
style: {
width: 160
}
},
enum: []
},
} }
}, },
sumbit: { sumbit: {
......
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