Commit c469bb60 authored by alwayOnlie's avatar alwayOnlie

dom站的bug修复

parent e6d84293
...@@ -25,17 +25,24 @@ const FormList = (props: any) => { ...@@ -25,17 +25,24 @@ const FormList = (props: any) => {
onChange: (selectedRowKeys: any, selectedRows: any) => { onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectedRowKeys(selectedRowKeys) setSelectedRowKeys(selectedRowKeys)
setSelectRow(selectedRows) setSelectRow(selectedRows)
console.log(setSelectedRowKeys)
} }
}; };
const [columnsTab, setcolumnsTab] = useState<any>([]); const [columnsTab, setcolumnsTab] = useState<any>([]);
/* 确定 */ /* 确定 */
const handleOk = () => { const handleOk = () => {
let dataArr = []; console.log(dataList)
selectRow.map((item: any, index: number) => { let dataArr = dataList.length != 0 ? dataList.concat(selectRow) : selectRow;
const hash = {}
let templateList = dataArr.reduceRight((item, next) => {
if (!hash[next.id]) hash[next.id] = true && item.push(next)
return item
}, [])
templateList.map((item: any, index: number) => {
item.rowId = index + 1 item.rowId = index + 1
dataArr.push(item); dataArr.push(item);
}) })
setData(dataArr) setData(templateList)
setIsModalVisible(false); setIsModalVisible(false);
}; };
/* 获取商品 */ /* 获取商品 */
......
...@@ -90,7 +90,7 @@ const ContractText = (props: any) => { ...@@ -90,7 +90,7 @@ const ContractText = (props: any) => {
} }
/**下载 */ /**下载 */
const onDownload = () => { const onDownload = () => {
window.location.href = `/api/contract/contractTemplate/downloadContract?contractName=${Templatel.name}&contractUrl=${Templatel.fileUrl}` window.location.href = `/api/contract/contractTemplate/downloadContract?contractName=${Templatel.fileName}&contractUrl=${Templatel.fileUrl}`
} }
/**判断文件类型和大小 */ /**判断文件类型和大小 */
...@@ -106,6 +106,7 @@ const ContractText = (props: any) => { ...@@ -106,6 +106,7 @@ const ContractText = (props: any) => {
if (fileList[0].response) { if (fileList[0].response) {
if (fileList[0].response.code === 1000) { if (fileList[0].response.code === 1000) {
Templatel.name = fileList[0].name Templatel.name = fileList[0].name
Templatel.fileName = fileList[0].name
Templatel.fileUrl = fileList[0].response.data Templatel.fileUrl = fileList[0].response.data
console.log(Templatel, '上传成功执行的') console.log(Templatel, '上传成功执行的')
setTemplatel({ ...Templatel }) setTemplatel({ ...Templatel })
......
...@@ -10,8 +10,7 @@ const { Option } = Select; ...@@ -10,8 +10,7 @@ const { Option } = Select;
import moment from 'moment'; import moment from 'moment';
const FormList = (props: any) => { const FormList = (props: any) => {
console.log(props) const { fromData, currentRef, fetchdata, Price } = props;
const { fromData, currentRef, fetchdata } = props;
const [keys, setkeys] = useState<any>(); // 记录上次删除的 const [keys, setkeys] = useState<any>(); // 记录上次删除的
const [options, setoptions] = useState<any>([ const [options, setoptions] = useState<any>([
{ {
...@@ -74,6 +73,7 @@ const FormList = (props: any) => { ...@@ -74,6 +73,7 @@ const FormList = (props: any) => {
style={{ style={{
width: 150, width: 150,
}} }}
value={item.payRatio}
placeholder="" placeholder=""
onChange={(e) => onSelectChange(e, 'payRatio', index)} onChange={(e) => onSelectChange(e, 'payRatio', index)}
/> />
...@@ -91,6 +91,7 @@ const FormList = (props: any) => { ...@@ -91,6 +91,7 @@ const FormList = (props: any) => {
width: 130, width: 130,
}} }}
placeholder="" placeholder=""
value={item.payAmount}
onChange={(e) => onSelectChange(e, 'payAmount', index)} onChange={(e) => onSelectChange(e, 'payAmount', index)}
/> />
</div> </div>
...@@ -200,15 +201,21 @@ const FormList = (props: any) => { ...@@ -200,15 +201,21 @@ const FormList = (props: any) => {
break; break;
case 'payRatio': case 'payRatio':
item[idx].payRatio = e.target.value; item[idx].payRatio = e.target.value;
if (Price != 0) {
item[idx].payAmount = e.target.value / 100 * Price;
}
break; break;
case 'payAmount': case 'payAmount':
if (Price != 0) {
item[idx].payRatio = e.target.value / Price * 100;
}
item[idx].payAmount = e.target.value; item[idx].payAmount = e.target.value;
break; break;
case 'payParam': case 'payParam':
item[idx].payParam = e; item[idx].payParam = e;
break; break;
} }
console.log(item[idx])
setPlanList(item) setPlanList(item)
} }
useEffect(() => { useEffect(() => {
...@@ -227,6 +234,7 @@ const FormList = (props: any) => { ...@@ -227,6 +234,7 @@ const FormList = (props: any) => {
}) })
} }
}) })
return ( return (
<div className="table"> <div className="table">
<Table <Table
......
...@@ -29,14 +29,20 @@ const Add: React.FC<{}> = (props: any) => { ...@@ -29,14 +29,20 @@ const Add: React.FC<{}> = (props: any) => {
const [purchaseMaterielList, setpurchaseMaterielList] = useState<any>({}) const [purchaseMaterielList, setpurchaseMaterielList] = useState<any>({})
const [payPlanList, setpayPlanList] = useState<any>([]); const [payPlanList, setpayPlanList] = useState<any>([]);
const [type, setType] = useState<any>('1'); const [type, setType] = useState<any>('1');
const [Price, setPrice] = useState(0); // 合同总金额
/* 初始值 */ /* 初始值 */
const [Row, setRow] = useState<any>({}) const [Row, setRow] = useState<any>({})
const [memberId, setmemberId] = useState<string>('') const [memberId, setmemberId] = useState<string>('')
/* 获取下拉框选中的id 查询物料 */ /* 获取下拉框选中的id 查询物料 */
const getrow = (row) => { const getrow = (row) => {
let price = row.awardAmount ? row.awardAmount : row.bidWinnerAmount ? row.bidWinnerAmount : 0;
console.log(price, '10000')
setPrice(price)
setRow(row) setRow(row)
} }
/* 获取供应商角色id */ /* 获取供应商角色id */
const getmemberId = (memberId) => { const getmemberId = (memberId) => {
setmemberId(memberId) setmemberId(memberId)
...@@ -77,6 +83,7 @@ const Add: React.FC<{}> = (props: any) => { ...@@ -77,6 +83,7 @@ const Add: React.FC<{}> = (props: any) => {
<Fromtable <Fromtable
fetchdata={payPlanList} fetchdata={payPlanList}
currentRef={payPlan} currentRef={payPlan}
Price={Price}
/> />
}, },
{ {
...@@ -91,7 +98,6 @@ const Add: React.FC<{}> = (props: any) => { ...@@ -91,7 +98,6 @@ const Add: React.FC<{}> = (props: any) => {
/* 提交*/ /* 提交*/
const submit = async () => { const submit = async () => {
/* 基本信息 */ /* 基本信息 */
console.log('basicsVO', '拉拉')
const basicsVO = await currentBasic.current.get(); const basicsVO = await currentBasic.current.get();
let totalAmount = 0; let totalAmount = 0;
if (basicsVO.data.sourceId == undefined || basicsVO.data.sourceId == '') { if (basicsVO.data.sourceId == undefined || basicsVO.data.sourceId == '') {
...@@ -137,6 +143,7 @@ const Add: React.FC<{}> = (props: any) => { ...@@ -137,6 +143,7 @@ const Add: React.FC<{}> = (props: any) => {
if (sourceType) { if (sourceType) {
setType(sourceType) setType(sourceType)
setRow(JSON.parse(sessionStorage.getItem('record'))) setRow(JSON.parse(sessionStorage.getItem('record')))
setPrice(JSON.parse(sessionStorage.getItem('record')).totalAmount)
const memberId = JSON.parse(sessionStorage.getItem('record')).partyBMemberId const memberId = JSON.parse(sessionStorage.getItem('record')).partyBMemberId
setmemberId(memberId) setmemberId(memberId)
} }
......
...@@ -423,7 +423,7 @@ const Details = (props: any) => { ...@@ -423,7 +423,7 @@ const Details = (props: any) => {
<Step <Step
title={item.taskName} title={item.taskName}
description={item.roleName} description={item.roleName}
status={item.isExecute ? 'finish' : 'wait'} status={item.isExecute == 1 ? 'finish' : 'wait'}
/> />
)) ))
} }
......
...@@ -9,7 +9,7 @@ const { TextArea, Search } = Input ...@@ -9,7 +9,7 @@ const { TextArea, Search } = Input
const { Option } = Select; const { Option } = Select;
import moment from 'moment'; import moment from 'moment';
const FormList = (props: any) => { const FormList = (props: any) => {
const { currentRef, payPlanList } = props; const { currentRef, payPlanList, Price } = props;
// const [payNumArr, setpayNumArr] = useState<any>([1,]) // const [payNumArr, setpayNumArr] = useState<any>([1,])
const [keys, setkeys] = useState<any>(); // 记录上次删除的 const [keys, setkeys] = useState<any>(); // 记录上次删除的
const [options, setoptions] = useState<any>([ const [options, setoptions] = useState<any>([
...@@ -62,7 +62,8 @@ const FormList = (props: any) => { ...@@ -62,7 +62,8 @@ const FormList = (props: any) => {
style={{ style={{
width: 150, width: 150,
}} }}
defaultValue={text} // defaultValue={text}
value={text}
placeholder="" placeholder=""
onChange={(e) => onSelectChange(e, 'payRatio', index)} onChange={(e) => onSelectChange(e, 'payRatio', index)}
/> />
...@@ -80,7 +81,7 @@ const FormList = (props: any) => { ...@@ -80,7 +81,7 @@ const FormList = (props: any) => {
width: 130, width: 130,
}} }}
placeholder="" placeholder=""
defaultValue={text} value={text}
onChange={(e) => onSelectChange(e, 'payAmount', index)} onChange={(e) => onSelectChange(e, 'payAmount', index)}
/> />
</div> </div>
...@@ -149,7 +150,6 @@ const FormList = (props: any) => { ...@@ -149,7 +150,6 @@ const FormList = (props: any) => {
} }
}) })
console.log('optionsDataadd', data, optionsData, 'optionsList')
setPlanList(data) setPlanList(data)
setoptions(optionsData) setoptions(optionsData)
}; };
...@@ -175,7 +175,7 @@ const FormList = (props: any) => { ...@@ -175,7 +175,7 @@ const FormList = (props: any) => {
console.log(e, name, idx) console.log(e, name, idx)
let item = [...PlanList]; let item = [...PlanList];
console.log(item, '哈哈');
// return; // return;
switch (name) { switch (name) {
case 'payWay': case 'payWay':
...@@ -192,9 +192,15 @@ const FormList = (props: any) => { ...@@ -192,9 +192,15 @@ const FormList = (props: any) => {
item[idx].payStage = e.target.value; item[idx].payStage = e.target.value;
break; break;
case 'payRatio': case 'payRatio':
if (Price != 0) {
item[idx].payAmount = e.target.value / 100 * Price;
}
item[idx].payRatio = e.target.value; item[idx].payRatio = e.target.value;
break; break;
case 'payAmount': case 'payAmount':
if (Price != 0) {
item[idx].payRatio = e.target.value / Price * 100;
}
item[idx].payAmount = e.target.value; item[idx].payAmount = e.target.value;
break; break;
case 'payParam': case 'payParam':
......
...@@ -23,6 +23,7 @@ const Editing: React.FC<{}> = (props: any) => { ...@@ -23,6 +23,7 @@ const Editing: React.FC<{}> = (props: any) => {
const payPlan = useRef<any>([]) const payPlan = useRef<any>([])
const contractText = useRef<any>({}) const contractText = useRef<any>({})
const [btnType, setbtnType] = useState<any>(false); const [btnType, setbtnType] = useState<any>(false);
const [Price, setPrice] = useState(0); // 合同总金额
/** /**
* @param name tag标签名 * @param name tag标签名
* @param components 显示内容 * @param components 显示内容
...@@ -39,6 +40,7 @@ const Editing: React.FC<{}> = (props: any) => { ...@@ -39,6 +40,7 @@ const Editing: React.FC<{}> = (props: any) => {
console.log(res); console.log(res);
const { basics, payPlanList, contractText } = res.data; const { basics, payPlanList, contractText } = res.data;
setbasic(basics) setbasic(basics)
setPrice(basics.totalAmount)
setpayPlanList(payPlanList) setpayPlanList(payPlanList)
setcontractText(contractText) setcontractText(contractText)
} }
...@@ -121,6 +123,7 @@ const Editing: React.FC<{}> = (props: any) => { ...@@ -121,6 +123,7 @@ const Editing: React.FC<{}> = (props: any) => {
<Fromtable <Fromtable
currentRef={payPlan} currentRef={payPlan}
payPlanList={payPlanList} payPlanList={payPlanList}
Price={Price}
/> />
}, },
{ {
......
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