Commit c469bb60 authored by alwayOnlie's avatar alwayOnlie

dom站的bug修复

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