Commit 13102e77 authored by alwayOnlie's avatar alwayOnlie

修改

parent c246086e
......@@ -436,6 +436,7 @@ const Details = (props: any) => {
fontSize: '14px',
color: '#909399',
}}
onClick={() => history.goBack()}
/>
<span
style={{
......
......@@ -53,11 +53,6 @@ const AddInfo = (props: any) => {
/* 付款阶段 */
const [payPlanList, setpayPlanList] = useState<any>([]);
/* 选中设置值 */
// const tag = [
// { name: '账期(默认)', Index: 1 },
// { name: '现结', Index: 2 },
// { name: '月结', Index: 3 },
// ]
const [Index, setIndex] = useState<number>(1)
const columnsList: any = [
{
......@@ -119,7 +114,6 @@ const AddInfo = (props: any) => {
const basic = basics;
basics[key] = e;
setBasics(basic);
console.log(e, key);
}
/* 确认回显数据 */
const Confirm = () => {
......@@ -145,6 +139,7 @@ const AddInfo = (props: any) => {
basicsData.contractId = selectRow.id;
basicsData.payParam = res.data.payPlanList[0].payParam
info.startTime = selectRow.startTime;
basicsData.applyAmount = res.data.payPlanList[0].payAmount;
setapplyAmount(res.data.payPlanList[0].payAmount)
info.status = "同意签订合同";
setpayPlanList(res.data.payPlanList)
......@@ -157,7 +152,8 @@ const AddInfo = (props: any) => {
tagList.push({
name: item.payWay == 1 ? '账期' : item.payWay == 2 ? '月结' : '现结',
payParam: item.payParam,
Index: index + 1
Index: index + 1,
id: item.id,
})
})
setTag(tagList)
......@@ -210,8 +206,32 @@ const AddInfo = (props: any) => {
})
})
}
return (
/* 切换请款金额 */
const onSelect = (e) => {
setBasicsKey(e)
}
/* 切换 给对应的赋值 */
const setBasicsKey = (id: string) => {
let key: any = {};
payPlanList.some((item: any, index: number) => {
item.Index = index + 1;
if (item.id == id) {
key = item
}
})
console.log(key);
const basicsData = basics;
basicsData.applyAmount = key.payAmount;
basicsData.payWay = key.payWay;
basicsData.payPlanId = key.id;
basicsData.expectPayTime = moment(key.expectPayTime),
basicsData.payRatio = key.payRatio;
setBasics(basicsData)
setIndex(key.Index);
attrValueForm.setFieldsValue(basicsData);
}
return (
<div>
<Form
form={attrValueForm}
......@@ -281,7 +301,7 @@ const AddInfo = (props: any) => {
initialValue={basics.payPlanId}
labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<Select
// onChange={(e) => onSelectChange(e)}
onChange={(e) => onSelect(e)}
>
{
payPlanList.map(item => (
......@@ -335,7 +355,7 @@ const AddInfo = (props: any) => {
{
tag.map((item: any) => {
return (
<span className={item.Index == Index ? styles.tative : styles.tag} onClick={() => setIndex(item.Index)}>{item.name}</span>
<span className={item.Index == Index ? styles.tative : styles.tag} onClick={() => setBasicsKey(item.id)}>{item.name}</span>
)
})
}
......
......@@ -221,7 +221,7 @@ const QueryList = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
'contractNo',
FORM_FILTER_PATH,
);
},
......
......@@ -162,7 +162,7 @@ const addList = () => {
/* 修改 */
const edit = (record) => {
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?sourceType=${record.sourceType}&id=${record.id}`)
history.push(`/memberCenter/contract/manage/add/addList/editing?contractId=${record.id}`)
}
/* 提交审核 */
......
import React, { useState, useEffect, forwardRef } from 'react';
import { Button, Input, Select, DatePicker, Form, Drawer } from 'antd'
import { PublicApi } from '@/services/api';
import moment from 'moment';
const { Option } = Select;
const { RangePicker } = DatePicker;
const Information = (props: any) => {
const { currentRef, basic } = props;
const [attrValueForm] = Form.useForm();
/**
* @param {{basicsVO}} 表单数据集合
* */
useEffect(() => {
console.log(basic)
attrValueForm.setFieldsValue(basic)
}, [basic])
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
attrValueForm.validateFields().then(res => {
resolve({
state: true,
name: 'basic',
data: res
})
}).catch(error => {
if (error && error.errorFields) {
}
})
})
}
})
const rangeConfig = {
rules: [{ type: 'array' as const, required: true, message: ' 请选择开始或者结束时间' }],
};
return (
<div>
<Form
form={attrValueForm}
name="edit_infomation"
layout="horizontal"
labelAlign="left"
colon={false}
autoComplete="off"
>
<Form.Item
label="合同编号"
labelAlign="left"
name="contractNo"
labelCol={{ span: 2 }}
wrapperCol={{ span: 8 }}
initialValue={basic.contractNo}
rules={[
{
required: true,
message: '请输入合同编号',
},
]}
>
{/* disabled */}
<Input placeholder='请输入合同编号' disabled />
</Form.Item>
<Form.Item
label="合同摘要"
labelAlign="left"
name="contractAbstract"
labelCol={{ span: 2 }}
wrapperCol={{ span: 8 }}
rules={[
{
required: true,
message: '请输入合同摘要',
},
]}
>
<Input placeholder='请输入合同摘要' />
</Form.Item>
<Form.Item
label="寻源类型"
labelAlign="left"
name="sourceType"
labelCol={{ span: 2 }}
wrapperCol={{ span: 8 }}
initialValue={basic.sourceType}
rules={[
{
required: true,
message: '请选择寻源类型',
},
]}
>
<Select disabled>
<Option value="1" >采购询价</Option>
<Option value="2" >采购招标</Option>
<Option value="3" >采购竞价</Option>
</Select>
</Form.Item>
<Form.Item
label="合同有效期"
labelAlign="left"
labelCol={{ span: 2 }}
wrapperCol={{ span: 8 }}
name="range-picker"
{...rangeConfig}
>
<RangePicker style={{ width: '100%' }} />
</Form.Item>
<Form.Item
label="对应单据"
labelAlign="left"
labelCol={{ span: 2 }}
name="sourceNo"
initialValue={basic.sourceNo ? basic.sourceNo : ''}
wrapperCol={{ span: 8 }}
>
<Input placeholder='最长60个字符,30个汉字' disabled />
</Form.Item>
<Form.Item
label="授标会员"
labelAlign="left"
labelCol={{ span: 2 }}
name="partyBName"
initialValue={basic.partyBName ? basic.partyBName : ''}
wrapperCol={{ span: 8 }}
rules={[
{
required: true,
message: '请选择授标会员',
},
]}
>
<Input placeholder='最长60个字符,30个汉字' disabled />
</Form.Item>
<Form.Item
label="授标金额"
labelAlign="left"
labelCol={{ span: 2 }}
wrapperCol={{ span: 8 }}
>
<p>{basic.totalAmount ? `¥${basic.totalAmount}` : ''}</p>
</Form.Item>
</Form>
</div>
)
}
export default forwardRef(Information)
import React, { useState, useRef, useEffect } from 'react'
import { Button, Card, Tabs, Form } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api';
import { history } from 'umi'
import Information from './components/information'
import {
SaveOutlined,
} from '@ant-design/icons'
const { TabPane } = Tabs;
const Editing: React.FC<{}> = (props: any) => {
const {
location: {
query: {
contractId, // 寻源类型
} } } = props;
const currentBasic = useRef<any>({});
const purchaseMate = useRef<any>([])
const payPlan = useRef<any>([])
const contractText = useRef<any>({})
/**
* @param name tag标签名
* @param components 显示内容
*/
const [basic, setbasic] = useState<any>({});
const [purchaseMaterielList, setpurchaseMaterielList] = useState<any>({})
const [payPlanList, setpayPlanList] = useState<any>([]);
const TabList = [
{
name: '基本信息',
components:
<Information currentRef={currentBasic} basic={basic} />
},
{
name: '采购物料',
components:
2
},
{
name: '付款计划',
components:
3
},
{ name: '合同文本', components: 5 },
]
useEffect(() => {
PublicApi.getContractManageGetDetail({ contractId }).then(res => {
if (res.code === 1000) {
console.log(res);
const { basics } = res.data;
basic.sourceType = String(basic.sourceType);
console.log(basics.sourceType)
setbasic(basics)
}
})
console.log(contractId);
}, [])
return (
<PageHeaderWrapper
title="新建合同"
extra={[
<Button key="1" type="primary" icon={<SaveOutlined />} > 保存</Button>
]}
>
<Card>
<Tabs defaultActiveKey="0" type="card" size="small">
{
TabList.map((item, index) => (
<TabPane tab={item.name} key={index}>
{item.components}
</TabPane>
))
}
</Tabs>
</Card>
</PageHeaderWrapper>
)
}
export default Editing;
......@@ -283,7 +283,7 @@ export const userchema: any = {
export const QueryListSchema: ISchema = {
type: 'object',
properties: {
orderNo: {
contractNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
......
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