Commit 7834c7c7 authored by alwayOnlie's avatar alwayOnlie

优化代码

parent 758fb93d
......@@ -27,6 +27,7 @@ const Details = (props: any) => {
const [contractNo, setcontractNo] = useState();
/* 合同id */
const { location: { query: { contractId, type } } } = props;
console.log(type)
const [currLink, setCurrLink] = useState(activeAnchorClassName)
/**
* 渲染信息
......@@ -388,7 +389,7 @@ const Details = (props: any) => {
</div>
{
type != 'implement' &&
type && type != 'implement' &&
<div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>{type === 'Sign' ? '签订合同' : '审核'}</Button>
</div>
......
......@@ -13,11 +13,10 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import moment from 'moment';
import { history } from 'umi';
import ExamineFrom from '../../components/examine'
const pageToBeExamineOne = () => {
const ref = useRef<any>({});
......@@ -117,8 +116,7 @@ const pageToBeExamineOne = () => {
render: (text, record) => {
return (
<div>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => submitExamine(record.id)}>审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineOne/details?contractId=${record.id}&type=levelexamine`)}>查看</span>
<span style={{ color: '#00B37A', cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineOne/details?contractId=${record.id}&type=levelexamine`)}>审核</span>
</div>
)
}
......@@ -157,16 +155,6 @@ const pageToBeExamineOne = () => {
setIsModalVisible(!Visible)
}
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setIsModalVisible(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
return (
<PageHeaderWrapper>
<Card>
......@@ -198,13 +186,6 @@ const pageToBeExamineOne = () => {
}}
/>
</Card>
<ExamineFrom
ExamineFlag={Visible}
getfetchData={getfetchData}
applyId={id}
type="CoordinationPageToBeExamineOne"
/>
</PageHeaderWrapper>
)
}
......
import React, { useRef, useState } from 'react'
import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd';
import statuStyle from '../../common/colorTag'
......@@ -13,16 +13,11 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import moment from 'moment';
import ExamineFrom from '../../components/examine'
import { history } from 'umi';
const pageToBeExamineTwo = () => {
const ref = useRef<any>({});
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [id, setid] = useState("")
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
......@@ -116,22 +111,13 @@ const pageToBeExamineTwo = () => {
render: (text, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => submitExamine(record.id)}>审核</span>
<span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineTwo/details?contractId=${record.id}&type=pageToBeExamineTwo`)}>查看</span>
<span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/coordination/pageToBeExamineTwo/details?contractId=${record.id}&type=pageToBeExamineTwo`)}>审核</span>
</div>
)
}
}
]
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
}
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
......@@ -149,22 +135,6 @@ const pageToBeExamineTwo = () => {
})
})
}
/* 提交表单 */
const submitExamine = (id) => {
setid(id)
setIsModalVisible(!Visible)
}
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setIsModalVisible(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
return (
<PageHeaderWrapper>
<Card>
......@@ -196,12 +166,6 @@ const pageToBeExamineTwo = () => {
}}
/>
</Card>
<ExamineFrom
ExamineFlag={Visible}
getfetchData={getfetchData}
applyId={id}
type="CoordinationExamineStepTwo"
/>
</PageHeaderWrapper>
)
}
......
......@@ -9,6 +9,7 @@ import { PlusOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { addSchemaBli } from '../schema';
import Submit from '@/components/NiceForm/components/Submit'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
......@@ -100,7 +101,7 @@ const AddbillList: React.FC<{}> = () => {
return (
<>
{
record.status == 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => Submit(record.id)}>提交</span>
record.status == 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/addbill/Details?applyId=${record.id}&type=submitExamine`)}>提交</span>
}
{node}
{
......@@ -144,22 +145,6 @@ const AddbillList: React.FC<{}> = () => {
setSelectRow(selectedRows)
}
};
/* 提交审核的回调 */
const Submit = (applyId) => {
console.log(applyId)
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountSubmitExamine({ applyId }).then(res => {
if (res.code === 1000) {
ref.current.reload()
}
}).finally(() => {
msg();
});
}
/**删除 */
const confirmDel = (recode: any) => {
console.log(recode)
......@@ -200,10 +185,6 @@ const AddbillList: React.FC<{}> = () => {
'applyNo',
FORM_FILTER_PATH,
);
// useAsyncSelect(
// "status",
// fetchOptions(PublicApi.getContractApplyAmountGetStatusList)
// )
},
components: {
DateRangePickerUnix,
......
......@@ -35,7 +35,7 @@ const Bill: React.FC<{}> = () => {
return (
<div>
<EyePreview
url={`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=pageDetailList`}
url={`/memberCenter/contract/funds/bill/details?applyId=${record.id}`}
>
{text}
</EyePreview>
......
......@@ -103,7 +103,36 @@ const BillDetails = (props: any) => {
history.goBack()
}, 2000)
}
}
/* 显示审核弹出 */
const submitExaminefunds = () => {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
if (type == 'submitExamine') {
PublicApi.postContractApplyAmountSubmitExamine({ applyId }).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 2000);
}
}).finally(() => {
msg();
});
} else if (type == 'PageToBeSubmit') {
PublicApi.postContractApplyAmountSubmit({ applyId }).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 2000);
}
}).finally(() => {
msg();
});
} else {
setExamineFlag(true)
}
}
/* 作废 */
const oninvalid = () => {
......@@ -139,9 +168,6 @@ const BillDetails = (props: any) => {
getDetail()
}, []);
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
......@@ -188,10 +214,10 @@ const BillDetails = (props: any) => {
</div>
</div>
<div>
{
status == 1 && <Button type="primary" style={{ width: 80, marginRight: 16 }} onClick={() => setExamineFlag(!ExamineFlag)}>单据审核 </Button>
type && <Button type="primary" style={{ width: 80, marginRight: 16 }} onClick={() => submitExaminefunds()}>{type == 'PageToBeSubmit' ? '提交请款单' : type === 'pageDetailList' ? '作废' : '审核'} </Button>
}
</div>
</Anchor>
<div id='content' className={style.card}>
......@@ -253,7 +279,7 @@ const BillDetails = (props: any) => {
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="submitExamine"
type={type}
/>
</div>
)
......
......@@ -2,6 +2,7 @@ import React, { useState, useRef, ReactNode } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd';
import { SchemaBli } from '../schema';
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
......@@ -32,7 +33,7 @@ const Levelpayment: React.FC<{}> = () => {
return (
<div>
<EyePreview
url={`/memberCenter/contract/funds/levelpayment/details?applyId=${record.id}&type=PageToBeExamineOne`}
url={`/memberCenter/contract/funds/levelpayment/details?applyId=${record.id}`}
>
{text}
</EyePreview>
......@@ -88,15 +89,12 @@ const Levelpayment: React.FC<{}> = () => {
render: (text: any, record: any) => {
return (
<>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => isModal(record)}>审核</span>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/levelpayment/details?applyId=${record.id}&type=PageToBeExamineOne`)}>审核</span>
</>
)
}
}]
const isModal = (record) => {
setExamineFlag(!ExamineFlag)
setapplyId(record.id)
}
// 模拟请求
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
......@@ -113,14 +111,6 @@ const Levelpayment: React.FC<{}> = () => {
}
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
......@@ -173,12 +163,6 @@ const Levelpayment: React.FC<{}> = () => {
}}
/>
</Card>
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="PageToBeExamineOne"
/>
</PageHeaderWrapper>
)
......
......@@ -13,6 +13,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
import { history } from 'umi';
import Examine from '../../components/examine'
import "../../constants/index.less"
......@@ -32,7 +33,7 @@ const Secondpayment: React.FC<{}> = () => {
return (
<div>
<EyePreview
url={`/memberCenter/contract/funds/secondpayment/details?applyId=${record.id}&type=ToBeExamineTwo`}
url={`/memberCenter/contract/funds/secondpayment/details?applyId=${record.id}`}
>
{text}
</EyePreview>
......@@ -85,7 +86,7 @@ const Secondpayment: React.FC<{}> = () => {
render: (text: any, record: any) => {
return (
<>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => isModal(record)}>审核</span>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/secondpayment/details?applyId=${record.id}&type=ToBeExamineTwo`)}>审核</span>
</>
)
}
......
......@@ -13,9 +13,8 @@ import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
import Examine from '../../components/examine'
import { history } from 'umi';
import "../../constants/index.less"
const Submitpayment: React.FC<{}> = () => {
const ref = useRef<any>({});
const [ExamineFlag, setExamineFlag] = useState<boolean>(false);
......@@ -29,7 +28,7 @@ const Submitpayment: React.FC<{}> = () => {
return (
<div>
<EyePreview
url={`/memberCenter/contract/funds/submitpayment/details?applyId=${record.id}&type=pageToBeSubmit`}
url={`/memberCenter/contract/funds/submitpayment/details?applyId=${record.id}`}
>
{text}
</EyePreview>
......@@ -82,28 +81,11 @@ const Submitpayment: React.FC<{}> = () => {
render: (text: any, record: any) => {
return (
<>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => ApplyAmountSubmit(record.id)}>提交请款单</span>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/submitpayment/details?applyId=${record.id}&type=pageToBeSubmit`)}>提交请款单</span>
</>
)
}
}]
const ApplyAmountSubmit = (applyId) => {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountSubmit({ applyId }).then(res => {
if (res.code === 1000) {
getfetchData({
ExamineFlag: false,
code: 1000
})
}
}).finally(() => {
msg();
});
}
// 模拟请求
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
......@@ -119,13 +101,6 @@ const Submitpayment: React.FC<{}> = () => {
})
}
/* 提交审核的回调 */
const getfetchData = (data) => {
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
......@@ -178,12 +153,6 @@ const Submitpayment: React.FC<{}> = () => {
}}
/>
</Card>
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="PageToBeSubmit"
/>
</PageHeaderWrapper>
)
}
......
......@@ -153,11 +153,14 @@ const addList = () => {
}]
/**删除 */
const confirmDel = (recode: any) => {
console.log(recode)
// / contract / manage / delete
PublicApi.postContractManageDelete({ contractId: recode.id }).then(res => {
ref.current.reload()
if (res.code === 1000) {
ref.current.reload()
}
}).catch(err => {
console.log(err)
})
}
/* 修改 */
......@@ -177,7 +180,9 @@ const addList = () => {
}
}).finally(() => {
msg();
});
}).catch(err => {
console.log(err)
})
}
// 列表数据
const fetchData = (params?: any) => {
......
......@@ -13,7 +13,6 @@ const { Text } = Typography;
const FormList = (props: any) => {
const { currentRef, Row, sourceType } = props;
console.log(sourceType)
const refs = useRef({});
/* 显示模态框 */
const [isModalVisible, setIsModalVisible] = useState(false);// 显示模态框
......@@ -90,13 +89,16 @@ const FormList = (props: any) => {
/* 过滤字段 */
const _filter = (sourceType: string, newObj: any, callBackArr: Array) => {
const key = callBackArr[sourceType]
console.log(sourceType, newObj, key)
if (!key) {
return '';
}
let callBlackString = '';
if (sourceType == '2') {
return newObj.inviteTenderMateriel[key]
if (newObj.inviteTenderMateriel[key]) {
return newObj.inviteTenderMateriel[key]
} else {
return newObj[key]
}
}
callBlackString = newObj[key]
if (callBlackString == null) {
......@@ -107,8 +109,6 @@ const FormList = (props: any) => {
/* 处理数组 */
const _filterArr = (sourceType: string, newObj: any, callBackArr: Array) => {
let callBlackString = _filter(sourceType, newObj, callBackArr);
console.log(callBlackString, 'callBlackString')
if (Object.getPrototypeOf(callBlackString) === Array.prototype) {
callBlackString = callBlackString[0]
}
......@@ -117,10 +117,12 @@ const FormList = (props: any) => {
/* 处理布尔值 */
const _filterFalg = (sourceType: string, newObj: any, callBackArr: Array) => {
let callBlackString = _filter(sourceType, newObj, callBackArr);
console.log(callBlackString, 'callBlackString')
if (sourceType !== '1') {
callBlackString = callBlackString ? '1' : '0';
}
return callBlackString
console.log(callBlackString)
return Number(callBlackString)
}
fn(parmas).then(res => {
......@@ -148,7 +150,7 @@ const FormList = (props: any) => {
// productBrand
associatedType: _filter(sourceType, item, ['', '', '', '']),
associatedBrand: _filter(sourceType, item, ['', 'productAttributeJson', '', '']),
associatedDataId: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联商品id
associatedDataId: _filter(sourceType, item, ['', 'productId', 'commoditySkuId']), // 关联商品id
associatedMaterielNo: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联物料编号
associatedMaterielName: _filter(sourceType, item, ['', 'productName', 'commodityName']), // 关联商品名称
associatedGoods: _filter(sourceType, item, ['', 'productAttributeJson', 'commodityBrand']), //关联品牌
......@@ -157,9 +159,10 @@ const FormList = (props: any) => {
rowId: index,
}
})
console.log(data, 'data')
setData(data)
}
}).catch(err => {
console.log(err)
})
}
useEffect(() => {
......@@ -337,9 +340,9 @@ const FormList = (props: any) => {
associatedGoods: Object.keys(Row).length === 0 ? '' : item.associatedGoods,
associatedDataId: Object.keys(Row).length === 0 ? '' : item.associatedDataId,
associatedMaterielNo: Object.keys(Row).length === 0 ? '' : item.associatedMaterielNo,
associatedType: Object.keys(Row).length === 0 ? '' : item.type,
associatedCategory: Object.keys(Row).length === 0 ? '' : item.customerCategory.name,
associatedBrand: Object.keys(Row).length === 0 ? '' : item.brand.name,
associatedType: Object.keys(Row).length === 0 ? '' : item.associatedType,
associatedCategory: Object.keys(Row).length === 0 ? '' : item.associatedCategory,
associatedBrand: Object.keys(Row).length === 0 ? '' : item.associatedBrand,
})
})
resolve({
......
......@@ -44,6 +44,8 @@ const ContractText = (props: any) => {
}
})
setTemplatePage(list)
}).catch(err => {
console.log(err)
})
}
......
......@@ -139,6 +139,8 @@ const Information = (props: any) => {
return new Promise(resolve => {
fn({ ...params }, { ctlType: 'none' }).then(res => {
resolve(res.data)
}).catch(err => {
console.log(err)
})
})
}
......@@ -156,7 +158,7 @@ const Information = (props: any) => {
} else {
let totalAmount, sourceId, partyBName, partyBMemberId, sourceNo, partyBRoleId;
const selectRow = RowCtl.selectRow[0];
console.log(selectRow)
// console.log(selectRow)
switch (basicsVO.sourceType) {
case '1':
totalAmount = selectRow.awardAmount;
......@@ -387,10 +389,10 @@ const Information = (props: any) => {
>
<Button onClick={() => setvisible(!visible)} style={{ marginRight: 8 }}>
取消
</Button>
</Button>
<Button type="primary" onClick={() => Confirm()} >
确定
</Button>
</Button>
</div>
}
destroyOnClose
......
......@@ -106,13 +106,12 @@ const Auction = () => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => Like(record)}>创建采购竞价合同</span>
{/* <span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/manage/Auction/details?contractId=${record.id}`)}> 查看 </span> */}
</div>
)
}
}]
const Like = (record) => {
record.sourceId = record.viePriceId;
record.sourceNo = record.viePriceNO;
record.totalAmount = record.awardAmount;
......@@ -121,8 +120,6 @@ const Auction = () => {
record.partyBName = record.awardName;
record.sourceType = "3";
sessionStorage.setItem('record', JSON.stringify(record));
console.log(record);
// return;
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=3`)
}
const getdate = (time) => {
......@@ -137,6 +134,8 @@ const Auction = () => {
...params,
}).then(res => {
resolve(res.data)
}).catch(err => {
console.log(err)
})
})
......
......@@ -131,6 +131,8 @@ const BiddingList = () => {
...params,
}).then(res => {
resolve(res.data)
}).catch(err => {
console.log(err)
})
})
......
......@@ -11,7 +11,6 @@ import {
const ContractText = (props: any) => {
const { currentRef, ctText, memberId } = props;
console.log(ctText, '拉拉')
const [TemplatePage, setTemplatePage] = useState<any>([]);
const [Templatel, setTemplatel] = useState<any>({});
const [checkNick, setCheckNick] = useState(true);
......@@ -44,6 +43,8 @@ const ContractText = (props: any) => {
}
})
setTemplatePage(list)
}).catch(err => {
console.log(err)
})
}
......
......@@ -27,6 +27,7 @@ const Information = (props: any) => {
console.log(res.data)
if (res.code === 1000) {
basic.contractNo = res.data
attrValueForm.setFieldsValue(basic)
}
})
......
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