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