Commit 0f9ef1b9 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents dfffcc75 4e23fcc7
......@@ -82,31 +82,33 @@ const FormList = (props: any) => {
console.log(parmas, '请求参数是啥')
fn(parmas).then(res => {
console.log(res);
let data = res.data.data.map(item => {
return {
code: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 物料编号
name: sourceType == '1' ? item.name : sourceType == '2' ? item.inviteTenderMateriel.name : '', // 物料名称
type: sourceType == '1' ? item.model : sourceType == '2' ? item.inviteTenderMateriel.type : '', // 物料规格
customerCategory: {
name: sourceType == '1' ? item.category : sourceType == '2' ? item.inviteTenderMateriel.brandName : '',
id: sourceType == '1' ? item.goodsId : sourceType == '2' ? item.inviteTenderMateriel.categoryId[0] : ''
},
brand: { name: sourceType == '1' ? item.brand : sourceType == '2' ? item.inviteTenderMateriel.categoryName : '' },
unitName: sourceType == '1' ? item.unit : sourceType == '2' ? item.unitName : '',
purchaseCount: sourceType == '1' ? item.purchaseCount : sourceType == '2' ? item.inviteTenderMateriel.count : '', // 数量
isHasTax: sourceType == '1' ? item.isTax : sourceType == '2' ? item.isTax ? 1 : 0 : '',
taxRate: sourceType == '1' ? item.taxProbability : sourceType == '2' ? item.taxRate : '',
price: sourceType == '1' ? item.taxUnitPrice : sourceType == '2' ? item.price : '',
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : '',
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : '',
associatedDataId: sourceType == '1' ? item.productId : sourceType == '1' ? item.commodityId : '', // 关联商品id
associatedMaterielNo: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 关联物料编号
associatedMaterielName: sourceType == '1' ? item.productName : sourceType == '2' ? item.commodityName : '', // 关联商品名称
associatedGoods: sourceType == '1' ? item.productAttributeJson : sourceType == '2' ? item.commodityName : ''// 关联品牌
}
})
console.log(data, '拉拉')
setData(data)
if (res.code === 1000) {
let data = res.data.data.map(item => {
return {
code: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 物料编号
name: sourceType == '1' ? item.name : sourceType == '2' ? item.inviteTenderMateriel.name : '', // 物料名称
type: sourceType == '1' ? item.model : sourceType == '2' ? item.inviteTenderMateriel.type : '', // 物料规格
customerCategory: {
name: sourceType == '1' ? item.category : sourceType == '2' ? item.inviteTenderMateriel.brandName : '',
id: sourceType == '1' ? item.goodsId : sourceType == '2' ? item.inviteTenderMateriel.categoryId[0] : ''
},
brand: { name: sourceType == '1' ? item.brand : sourceType == '2' ? item.inviteTenderMateriel.categoryName : '' },
unitName: sourceType == '1' ? item.unit : sourceType == '2' ? item.inviteTenderMateriel.unitName : '', //单位
purchaseCount: sourceType == '1' ? item.purchaseCount : sourceType == '2' ? item.inviteTenderMateriel.count : '', // 数量
isHasTax: sourceType == '1' ? item.isTax : sourceType == '2' ? item.isTax ? 1 : 0 : '',
taxRate: sourceType == '1' ? item.taxProbability : sourceType == '2' ? item.taxRate : '',
price: sourceType == '1' ? item.taxUnitPrice : sourceType == '2' ? item.price : '',
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : '',
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : '',
associatedDataId: sourceType == '1' ? item.productId : sourceType == '2' ? item.commodityId : '', // 关联商品id
associatedMaterielNo: sourceType == '1' ? item.number : sourceType == '2' ? item.inviteTenderMateriel.code : '', // 关联物料编号
associatedMaterielName: sourceType == '1' ? item.productName : sourceType == '2' ? item.commodityName : '', // 关联商品名称
associatedGoods: sourceType == '1' ? item.productAttributeJson : sourceType == '2' ? item.commodityName : ''// 关联品牌
}
})
console.log(data, '拉拉')
setData(data)
}
})
}
useEffect(() => {
......@@ -235,10 +237,7 @@ const FormList = (props: any) => {
},
];
if (Object.keys(Row).length != 0) {
console.log(Row, 13213212321)
getList()
} else {
if (dataList.length === 0) {
columnsTab.push(
{
title: '操作',
......@@ -256,9 +255,13 @@ const FormList = (props: any) => {
)
}
setcolumnsTab(columnsTab);
console.log(dataList)
}, [Row && dataList.length != 0])
}, [dataList])
useEffect(() => {
if (Object.keys(Row).length != 0) {
getList()
}
}, [Row])
/* 回调出来的数据 */
useEffect(() => {
currentRef.current = {
......
import React, { useState, useEffect, forwardRef } from 'react';
import { Button, Select, Form, Checkbox, message } from 'antd'
import { Button, Select, Form, Checkbox, message, Upload } from 'antd'
import { PublicApi } from '@/services/api';
import styles from '../index.less'
import {
......@@ -76,10 +76,12 @@ const ContractText = (props: any) => {
// console.log(Templatel)
PublicApi.postContractSignatureContractCreate(param).then(res => {
console.log(res);
Templatel.name = res.data.contractName
Templatel.fileUrl = res.data.contractUrl
setTemplatel(Templatel)
setcontractFlag(true)
if (res.code == 1000) {
Templatel.name = res.data.contractName
Templatel.fileUrl = res.data.contractUrl
setTemplatel(Templatel)
setcontractFlag(true)
}
})
}
}
......@@ -87,6 +89,24 @@ const ContractText = (props: any) => {
const onDownload = () => {
window.location.href = `/api/contract/contractTemplate/downloadContract?contractName=${Templatel.name}&contractUrl=${Templatel.contractUrl}`
}
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
}
return isLt20M;
}
// 上传回调
const handleChange = ({ file }) => {
console.log(file.response)
if (file.response) {
if (file.response.code === 1000) {
Templatel.fileUrl = file.response.data
setTemplatel(Templatel)
}
}
}
return (
<div
style={{
......@@ -113,7 +133,19 @@ const ContractText = (props: any) => {
<FileWordFilled />
<span>{Templatel.name}</span>
</div>
<Button type='link' >编辑合同</Button>
<Upload
action="/api/file/file/upload"
data={{ fileType: 1 }}
showUploadList={false}
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
>
<div className={styles.uploadIconBtn}>
<Button type='link' >上传合同</Button>
</div>
</Upload>
</div>
</Form.Item>
}
......
......@@ -103,8 +103,9 @@ const Information = (props: any) => {
basicsVO.partyBName = Row.partyBName ? Row.partyBName : '';
basicsVO.sourceNo = Row.sourceNo ? Row.sourceNo : '';
basicsVO.totalAmount = Row.totalAmount ? Row.totalAmount : '';
basicsVO.partyBMemberId = Row.awardRoleId ? Row.awardMemberId : '';
basicsVO.partyBRoleId = Row.awardRoleId ? Row.awardRoleId : '';
basicsVO.partyBMemberId = sourceType === '1' ? Row.awardRoleId ? Row.awardMemberId : '' : Row.partyBMemberId;
basicsVO.partyBRoleId = sourceType === '1' ? Row.awardRoleId ? Row.awardRoleId : '' : Row.partyBRoleId;
console.log(Row, basicsVO)
setbasicsVO(basicsVO)
attrValueForm.setFieldsValue(basicsVO)
setfalg(Row.sourceNo ? true : false)
......@@ -147,7 +148,6 @@ const Information = (props: any) => {
basicsVO.partyBMemberId = RowCtl.selectRow[0].memberId;
basicsVO.partyBRoleId = RowCtl.selectRow[0].roleId
basicsVO.sourceType = Change;
setfalg(true)
attrValueForm.setFieldsValue(basicsVO);
getmemberId(basicsVO.partyBMemberId)
......
......@@ -126,7 +126,7 @@ const Add: React.FC<{}> = (props: any) => {
if (sourceType) {
setType(sourceType)
setRow(JSON.parse(sessionStorage.getItem('record')))
const memberId = JSON.parse(sessionStorage.getItem('record')).partyBMemberId;
const memberId = JSON.parse(sessionStorage.getItem('record')).partyBMemberId
setmemberId(memberId)
}
}, [])
......
......@@ -92,13 +92,25 @@ const BiddingList = () => {
render: (_, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=2`)}>创建采购招标合同</span>
<span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/manage/bidding/details?contractId=${record.id}`)}> 查看 </span>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => Like(record)}>创建采购招标合同</span>
</div>
)
}
}]
const Like = (record) => {
record.sourceId = record.inviteBidId;
record.sourceNo = record.inviteBidNO;
record.totalAmount = record.bidWinnerAmount;
record.partyBMemberId = record.bidWinnerMemberId;
record.partyBRoleId = record.inviteBidRoleId;
record.partyBName = record.bidWinnerName;
record.sourceType = "2";
sessionStorage.setItem('record', JSON.stringify(record));
console.log(record);
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=2`)
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
......
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