Commit 0767c896 authored by 许佳敏's avatar 许佳敏

Merge branch 'mj' into 'v2-miju-srm'

flx:合同代码合并miju See merge request linkseeks-design/pro-platform!32
parents ff0162b6 a32d2cbe
......@@ -33,6 +33,7 @@ const Examine: React.FC<Iprops> = ({
}) => {
const [isPass, setIsAllMember] = useState(1)
const [state, setstate] = useState<any>(false);
const [contractUrl, setcontractUrl] = useState('');
/* 设置选中值 */
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
......@@ -91,11 +92,13 @@ const Examine: React.FC<Iprops> = ({
/* 合同协同签订-签订合同 */
case 'Signacontract':
fn = postContractManageSign
values.contractUrl = contractUrl;
values.contractId = applyId;
break;
}
console.log(values)
const msg = message.loading({
content: intl.formatMessage({id: 'contract.zhengzaicaozuo'}),
content: intl.formatMessage({ id: 'contract.zhengzaicaozuo' }),
duration: 0,
});
fn(values).then(res => {
......@@ -136,9 +139,10 @@ const Examine: React.FC<Iprops> = ({
},
onChange(info) {
if (info.file.response) {
const { code } = info.file.response;
const { code, data: { url } } = info.file.response;
console.log(code);
message.info(intl.formatMessage({id: 'contract.shangchuanchenggong'}));
setcontractUrl(url)
message.info(intl.formatMessage({ id: 'contract.shangchuanchenggong' }));
console.log(info.file)
setstate(true);
}
......@@ -148,12 +152,12 @@ const Examine: React.FC<Iprops> = ({
}
if (info.file.status === 'done') {
} else if (info.file.status === 'error') {
message.error(`${info.file.name} ${intl.formatMessage({id: 'contract.shangchuanshibai'})}`);
message.error(`${info.file.name} ${intl.formatMessage({ id: 'contract.shangchuanshibai' })}`);
}
},
beforeUpload(file) {
if (file.size / 1024 / 1024 > 20) {
message.warning(intl.formatMessage({id: 'contract.fujiandaxiaochaoguo20M'}));
message.warning(intl.formatMessage({ id: 'contract.fujiandaxiaochaoguo20M' }));
return Promise.reject();
}
},
......@@ -161,13 +165,14 @@ const Examine: React.FC<Iprops> = ({
const uploadNode = () => {
return (
<div>
<p style={{ paddingTop: 10, paddingBottom: 10, }}>{intl.formatMessage({id: 'contract.zhizhihetongyifangyi'})}</p>
<p style={{ paddingTop: 10, paddingBottom: 10, }}>{intl.formatMessage({ id: 'contract.zhizhihetongyifangyi' })}</p>
<Row style={{ marginBottom: 30, }}>
<Col>
<Upload
{...uploadProps}
maxCount={1}
>
<Button icon={<UploadOutlined />}>{intl.formatMessage({id: 'contract.shangchuanfujian'})}</Button>
<Button icon={<UploadOutlined />}>{intl.formatMessage({ id: 'contract.shangchuanfujian' })}</Button>
</Upload>
</Col>
</Row>
......@@ -176,7 +181,7 @@ const Examine: React.FC<Iprops> = ({
}
return (
<div>
<Modal footer={null} title={intl.formatMessage({id: 'contract.tijiaoshenhe'})} visible={ExamineFlag} onCancel={() => fetchData('onCancel')}>
<Modal footer={null} title={intl.formatMessage({ id: 'contract.tijiaoshenhe' })} visible={ExamineFlag} onCancel={() => fetchData('onCancel')}>
<Form
name="basic"
form={form}
......@@ -185,20 +190,20 @@ const Examine: React.FC<Iprops> = ({
onFinishFailed={onFinishFailed}
>
{type === 'Signacontract' ? uploadNode() : null}
<Form.Item name="isPass" label="" rules={[{ required: true, message: intl.formatMessage({id: 'contract.qingxuanzetongguofangshi'}) }]} initialValue={isPass} >
<Form.Item name="isPass" label="" rules={[{ required: true, message: intl.formatMessage({ id: 'contract.qingxuanzetongguofangshi' }) }]} initialValue={isPass} >
<Radio.Group onChange={handleIsAllMemberChange}>
<Radio value={1}>{agreeText}</Radio>
<Radio value={0}>{disagree}</Radio>
</Radio.Group>
</Form.Item>
<Form.Item label={isPass ? intl.formatMessage({id: 'contract.shenhetongguoyuanyin'}) : intl.formatMessage({id: 'contract.shenbuhetongguoyuanyin'})} rules={[{ required: true, message: intl.formatMessage({id: 'contract.qingxuanzezuofeiriqi'}) }]}>
<Form.Item label={isPass ? intl.formatMessage({ id: 'contract.shenhetongguoyuanyin' }) : intl.formatMessage({ id: 'contract.shenbuhetongguoyuanyin' })} rules={[{ required: true, message: intl.formatMessage({ id: 'contract.qingxuanzezuofeiriqi' }) }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: isPass ? false : true, message: intl.formatMessage({id: 'contract.shenhetongguoyijian'}) }]}>
<TextArea placeholder={intl.formatMessage({id: 'contract.zaicishurunideyuanyin'})} maxLength={120} />
<Form.Item label='' name="opinion" rules={[{ required: isPass ? false : true, message: intl.formatMessage({ id: 'contract.shenhetongguoyijian' }) }]}>
<TextArea placeholder={intl.formatMessage({ id: 'contract.zaicishurunideyuanyin' })} maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button onClick={() => fetchData('onCancel')} style={{ marginRight: 10 }}>{intl.formatMessage({id: 'contract.quxiao'})}</Button>
<Button type="primary" htmlType="submit">{intl.formatMessage({id: 'contract.baocun'})}</Button>
<Button onClick={() => fetchData('onCancel')} style={{ marginRight: 10 }}>{intl.formatMessage({ id: 'contract.quxiao' })}</Button>
<Button type="primary" htmlType="submit">{intl.formatMessage({ id: 'contract.baocun' })}</Button>
</div>
</Form>
</Modal>
......@@ -206,8 +211,8 @@ const Examine: React.FC<Iprops> = ({
)
}
Examine.defaultProps = {
agreeText: intl.formatMessage({id: 'contract.tongguo'}),
disagree: intl.formatMessage({id: 'contract.butongguo'}),
agreeText: intl.formatMessage({ id: 'contract.tongguo' }),
disagree: intl.formatMessage({ id: 'contract.butongguo' }),
uploadNode: null
}
export default Examine;
......@@ -64,6 +64,7 @@ const Details = (props: any) => {
const [basicData, setbasicData] = useState<any>({
invoiceProveVOList: [],
}) // 合同付款基本信息
const [contractUrl, setcontractUrl] = useState('');
/* 获取详情的数据 */
const getDetail = () => {
getContractCoordinationGetDetail({ contractId }).then(res => {
......@@ -178,8 +179,10 @@ const Details = (props: any) => {
},
onChange(info) {
if (info.file.response) {
const { code } = info.file.response;
console.log(info.file)
const { code, data: { url } } = info.file.response;
console.log(code);
setcontractUrl(url)
message.info(intl.formatMessage({ id: 'contract.shangchuanchenggong' }));
setstate(true);
}
......@@ -247,6 +250,7 @@ const Details = (props: any) => {
break;
case 'Sign':
fn = postContractCoordinationSign;
values.contractUrl = contractUrl
break;
default:
break;
......@@ -479,6 +483,7 @@ const Details = (props: any) => {
<Col>
<Upload
{...uploadProps}
maxCount={1}
>
<Button icon={<UploadOutlined />}>{intl.formatMessage({ id: 'contract.shangchuanfujian' })}</Button>
</Upload>
......
......@@ -145,8 +145,8 @@ export const supplierColumns = [
* 第二个内容
*/
export const goodcolumns: any = [
{ title: intl.formatMessage({id: 'contract.wuliaobianhao'}), dataIndex: 'code', align: 'left', },
{ title: intl.formatMessage({id: 'contract.wuliaomingcheng'}), dataIndex: 'name', key: 'name', align: 'left', },
{ title: intl.formatMessage({id: 'contract.huohao'}), dataIndex: 'code', align: 'left', },
{ title: intl.formatMessage({id: 'contract.huopinmingcheng'}), dataIndex: 'name', key: 'name', align: 'left', },
{ title: intl.formatMessage({id: 'contract.guigexinghao'}), dataIndex: 'type', align: 'left', },
{
title: intl.formatMessage({id: 'contract.pinlei'}), dataIndex: 'type', align: 'left',
......
......@@ -72,7 +72,7 @@ const ContractText = (props: any) => {
/* 生成电子合同 */
const generate = () => {
if (!Templatel.id) {
message.info(intl.formatMessage({id: 'contract.qingxianxuanzehetongmoban'}))
message.info(intl.formatMessage({ id: 'contract.qingxianxuanzehetongmoban' }))
} else {
const param = {
contractTemplateId: Templatel.id,
......@@ -98,7 +98,7 @@ const ContractText = (props: any) => {
const beforeDocUpload = (file: any) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error(intl.formatMessage({id: 'contract.shangchuanwenjiandaxiaobuchao'}));
message.error(intl.formatMessage({ id: 'contract.shangchuanwenjiandaxiaobuchao' }));
}
return isLt20M;
}
......@@ -119,21 +119,21 @@ const ContractText = (props: any) => {
width: '100%',
}}
>
<Form.Item label={intl.formatMessage({id: 'contract.hetongmuban'})} labelAlign="left" labelCol={{ span: 2 }}>
<Form.Item label={intl.formatMessage({ id: 'contract.hetongmuban' })} labelAlign="left" labelCol={{ span: 2 }}>
<Select
style={{ width: 600 }}
options={TemplatePage}
placeholder={intl.formatMessage({id: 'contract.qingxuanzehetongmuban'})}
placeholder={intl.formatMessage({ id: 'contract.qingxuanzehetongmuban' })}
onChange={(e) => getTemplate(e)}
>
</Select>
{
checkNick && <Button type='link' onClick={() => generate()}>{intl.formatMessage({id: 'contract.shengchenghetong'})}</Button>
checkNick && <Button type='link' onClick={() => generate()}>{intl.formatMessage({ id: 'contract.shengchenghetong' })}</Button>
}
</Form.Item>
{
Object.keys(Templatel).length != 0 &&
<Form.Item label={intl.formatMessage({id: 'contract.hetongwenben'})} labelAlign="left" labelCol={{ span: 2 }}>
<Form.Item label={intl.formatMessage({ id: 'contract.hetongwenben' })} labelAlign="left" labelCol={{ span: 2 }}>
<div className={styles.upload_item} style={{ width: 680 }}>
<div className={styles.upload_left} style={{ width: 600 }} onClick={() => onDownload()}>
<FileWordFilled />
......@@ -147,17 +147,18 @@ const ContractText = (props: any) => {
beforeUpload={beforeDocUpload}
onChange={handleChange}
accept='.doc,.docx'
maxCount={1}
>
<div className={styles.uploadIconBtn}>
<Button type='link' >{intl.formatMessage({id: 'contract.shangchuanhetong'})}</Button>
<Button type='link' >{intl.formatMessage({ id: 'contract.shangchuanhetong' })}</Button>
</div>
</Upload>
</div>
</Form.Item>
}
<Form.Item label={intl.formatMessage({id: 'contract.dianzihetong'})} labelAlign="left" labelCol={{ span: 2 }}>
<Form.Item label={intl.formatMessage({ id: 'contract.dianzihetong' })} labelAlign="left" labelCol={{ span: 2 }}>
<Checkbox checked={checkNick} onChange={onCheckboxChange}>
{intl.formatMessage({id: 'contract.shiyongdianzihetong'})}
{intl.formatMessage({ id: 'contract.shiyongdianzihetong' })}
</Checkbox>
</Form.Item>
</div>
......
......@@ -310,6 +310,7 @@ const Details = (props: any) => {
window.open(res.data.url)
}
} else {
console.log(1111)
setIsModalVisible(!Visible)
}
}
......@@ -432,14 +433,14 @@ const Details = (props: any) => {
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
{intl.formatMessage({ id: 'contract.dianzihetong' })}
{contractText.isUseElectronicContract ? intl.formatMessage({ id: 'contract.dianzihetong' }) : intl.formatMessage({ id: 'contract.zhizhihetong' })}
</div>
</div>
</div>
<div className='ant-card-body'>
<div className={style.upload_item} style={{ width: 680 }}>
<div className='ant-card-head-wrapper'>
{intl.formatMessage({ id: 'contract.dianzihetong' })}
{contractText.isUseElectronicContract ? intl.formatMessage({ id: 'contract.dianzihetong' }) : intl.formatMessage({ id: 'contract.zhizhihetong' })}
</div>
<div className={style.upload_left} onClick={() => onDownload(contractText)} style={{ width: 600, cursor: 'pointer' }}>
<FileWordFilled />
......
......@@ -88,9 +88,10 @@ const ContractText = (props: any) => {
// 上传回调
const handleChange = ({ fileList }) => {
if (fileList[0].response) {
console.log(fileList[0].name, fileList[0].response.data)
if (fileList[0].response.code === 1000) {
Templatel.name = fileList[0].name
Templatel.fileUrl = fileList[0].response.data
Templatel.fileName = fileList[0].name
Templatel.contractUrl = fileList[0].response.data
setTemplatel({ ...Templatel })
}
}
......@@ -153,6 +154,7 @@ const ContractText = (props: any) => {
onChange={handleChange}
accept='.doc,.docx'
maxCount={1}
>
<div className={styles.uploadIconBtn}>
<Button type='link' >{intl.formatMessage({ id: 'contract.shangchuanhetong' })}</Button>
......
......@@ -23,7 +23,7 @@ const PurchaseList = () => {
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
//表头
const columns: ColumnType<any>[] = [{
title: intl.formatMessage({id: 'contract.xuqiudanhaozhaiyao'}),
title: intl.formatMessage({ id: 'contract.xuqiudanhaozhaiyao' }),
dataIndex: 'demandNO',
align: 'left',
render: (text, record) =>
......@@ -37,7 +37,7 @@ const PurchaseList = () => {
<p>{record.demandAbstract}</p>
</div>
}, {
title: intl.formatMessage({id: 'contract.xuqiufabushijian'}),
title: intl.formatMessage({ id: 'contract.xuqiufabushijian' }),
dataIndex: 'demandPublishTime',
align: 'left',
sorter: {
......@@ -45,12 +45,12 @@ const PurchaseList = () => {
multiple: 1,
},
}, {
title: intl.formatMessage({id: 'contract.shoubiaohuiyuan'}),
title: intl.formatMessage({ id: 'contract.shoubiaohuiyuan' }),
dataIndex: 'awardName',
align: 'left',
},
{
title: intl.formatMessage({id: 'contract.shoubiaoshijian'}),
title: intl.formatMessage({ id: 'contract.shoubiaoshijian' }),
dataIndex: 'awardTime',
align: 'left',
sorter: {
......@@ -59,7 +59,7 @@ const PurchaseList = () => {
},
},
{
title: intl.formatMessage({id: 'contract.shoubiaojine'}),
title: intl.formatMessage({ id: 'contract.shoubiaojine' }),
dataIndex: 'awardAmount',
align: 'left',
sorter: {
......@@ -75,7 +75,7 @@ const PurchaseList = () => {
}
},
{
title: intl.formatMessage({id: 'contract.waibuzhuangtai'}),
title: intl.formatMessage({ id: 'contract.waibuzhuangtai' }),
dataIndex: 'outerStatus',
align: 'left',
......@@ -87,7 +87,7 @@ const PurchaseList = () => {
}
},
{
title: intl.formatMessage({id: 'contract.neibuzhuangtai'}),
title: intl.formatMessage({ id: 'contract.neibuzhuangtai' }),
dataIndex: 'innerStatus',
align: 'left',
render: (text) => {
......@@ -99,13 +99,13 @@ const PurchaseList = () => {
)
}
}, {
title: intl.formatMessage({id: 'contract.caozuo'}),
title: intl.formatMessage({ id: 'contract.caozuo' }),
dataIndex: 'state',
align: 'left',
render: (_, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => like(record)}>{intl.formatMessage({id: 'contract.chuangjiancaigouxunjiahetong'})}</span>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => like(record)}>{intl.formatMessage({ id: 'contract.chuangjiancaigouxunjiahetong' })}</span>
</div>
)
}
......
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