Commit be2519b4 authored by alwayOnlie's avatar alwayOnlie

bug修复

parent a2165aba
......@@ -13,6 +13,7 @@ import EyePreview from '@/components/EyePreview';
const { Text } = Typography;
const activeAnchorClassName = 'ant-anchor-link-active'
import moment from 'moment';
import { values } from 'lodash';
const Details = (props: any) => {
const ref = useRef({});
......@@ -416,7 +417,20 @@ const Details = (props: any) => {
sessionStorage.setItem('basics', JSON.stringify(basics));
history.push('/memberCenter/contract/funds/addbill/Add?applyId=' + contractId + '&sourceType=' + sourceType)
}
/* 搜素 */
const onSearch = (values) => {
const data = {
contractId,
orderNo: values,
orderAbstract: '',
startTime: "",
endTime: "",
current: 1,
pageSize: 5,
}
console.log(data)
getContracInfoList(data)
}
return (
<div className={style.anchorWrap}>
<Anchor
......@@ -568,8 +582,9 @@ const Details = (props: any) => {
<div>
<Input.Search
style={{ width: 240 }}
placeholder="店铺名称"
placeholder="搜素"
allowClear
onSearch={onSearch}
/>
<Button style={{ paddingLeft: 10, paddingRight: 10, marginLeft: 10, marginRight: 10 }}> 重置 </Button>
<Button type="primary" onClick={() => onselect()}>批量请款</Button>
......
......@@ -86,6 +86,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
className={style.drawer}
onClose={handleClose}
visible={visible}
destroyOnClose
footer={
<div
style={{
......@@ -175,7 +176,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
</div>
<div className={style.row}>
<span className={style.label}>规格型号:</span>
<span className={style.col}>{record.model}</span>
<span className={style.col}>{record.associatedType}</span>
</div>
</div>
</div>
......
......@@ -18,6 +18,9 @@ import { history } from 'umi';
const coordinationList = () => {
const ref = useRef<any>({});
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
//表头
const columns: ColumnType<any>[] = [{
title: '合同编号/摘要',
......@@ -37,7 +40,7 @@ const coordinationList = () => {
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 1,
},
render: (text, record) =>
......
......@@ -315,11 +315,12 @@ const Details = (props: any) => {
/** 确定关联商品 */
const handleConfirm = (params: any) => {
const data = [...ListData];
console.log(data, '12313', params)
data[index].associatedCategory = params.product.customerCategoryName;
data[index].associatedBrand = params.product.brandName;
data[index].associatedGoods = params.product.name;
const purchaseMaterielId = data[index].id;
const associatedMaterielNo = data[index].associatedMaterielNo
const associatedMaterielNo = data[index].associatedMaterielNo ? data[index].associatedMaterielNo : params.product.code
const associatedMaterielName = data[index].materielName;
const associatedType = data[index].associatedType;
const associatedCategory = data[index].associatedCategory
......@@ -342,6 +343,13 @@ const Details = (props: any) => {
});
PublicApi.postContractCoordinationAssociatedOfferGoods(res_data).then(res => {
if (res.code === 1000) {
getDetail()
let data = {
current: 1,
pageSize: 10
}
fetchListData(data)
// window
// setTimeout(() => {
// history.push('/memberCenter/contract/coordination/pageToBeSubmitExamine')
// }, 2000);
......@@ -350,7 +358,9 @@ const Details = (props: any) => {
msg();
})
setListData(data)
setVisible(false);
setRecord({})
}
/* 提交表单 */
......
......@@ -25,6 +25,9 @@ const pageToBeExamineOne = () => {
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [id, setid] = useState("")
//表头
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
const columns: ColumnType<any>[] = [{
title: '合同编号/摘要',
dataIndex: 'contractNo',
......@@ -43,7 +46,7 @@ const pageToBeExamineOne = () => {
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 1,
},
render: (text, record) =>
......@@ -226,7 +229,7 @@ const pageToBeExamineOne = () => {
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<Form.Item label='' name="opinion" >
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
......
......@@ -23,6 +23,9 @@ const pageToBeExamineTwo = () => {
const [isPass, setIsAllMember] = useState()
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [id, setid] = useState("")
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
//表头
const columns: ColumnType<any>[] = [{
title: '合同编号/摘要',
......@@ -42,7 +45,7 @@ const pageToBeExamineTwo = () => {
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 1,
},
render: (text, record) =>
......@@ -224,7 +227,7 @@ const pageToBeExamineTwo = () => {
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<Form.Item label='' name="opinion">
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
......
......@@ -24,6 +24,9 @@ const pageToBeSubmitExamine = () => {
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [id, setid] = useState("")
//表头
const getdate = (time) => {
return new Date(Date.parse(time.replace(/-/g, "/"))).getTime() / 1000;
}
const columns: ColumnType<any>[] = [{
title: '合同编号/摘要',
dataIndex: 'contractNo',
......@@ -42,7 +45,7 @@ const pageToBeSubmitExamine = () => {
dataIndex: 'startTime',
align: 'center',
sorter: {
compare: (a, b) => a.demandPublishTime - b.demandPublishTime,
compare: (a, b) => getdate(a.startTime) - getdate(b.startTime),
multiple: 1,
},
render: (text, record) =>
......@@ -224,7 +227,7 @@ const pageToBeSubmitExamine = () => {
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请输入原因' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<Form.Item label='' name="opinion">
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
......
......@@ -144,14 +144,8 @@ const QueryList = () => {
}
};
const like = (record) => {
record.sourceId = record.demandId;
record.sourceNo = record.sourceNo;
record.totalAmount = record.totalAmount;
record.partyBMemberId = record.awardMemberId;
record.partyBRoleId = record.awardRoleId;
record.partyBName = record.awardName;
sessionStorage.setItem('record', JSON.stringify(record));
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=1`)
history.push(`/memberCenter/contract/manage/add/addList/editing?contractId=${record.id}&oldContractId=1`)
// history.push(`/memberCenter/contract/manage/add/QueryList/editing?contractId=${record.id}&oldContractId=1`)
};
const [form] = Form.useForm();
const [id, setId] = useState('');
......
......@@ -165,7 +165,7 @@ const FormList = (props: any) => {
/* 确定 */
const handleOk = () => {
console.log(selectRow);
console.log(selectRow, '显示');
let dataArr = [];
selectRow.map((item: any) => {
dataArr.push(item);
......
......@@ -71,6 +71,7 @@ const Information = (props: any) => {
}
/* 时间选中 */
const onChange = (value: any) => {
console.log(value)
let startTime = moment(Number(value[0])).format('YYYY-MM-DD HH:mm:ss')
let endTime = moment(Number(value[1])).format('YYYY-MM-DD HH:mm:ss')
setstartTime(startTime)
......@@ -129,7 +130,7 @@ const Information = (props: any) => {
break;
}
return new Promise(resolve => {
fn({ ...params }).then(res => {
fn({ ...params }, { ctlType: 'none' }).then(res => {
resolve(res.data)
})
})
......@@ -328,7 +329,7 @@ const Information = (props: any) => {
falg ?
<Input placeholder='最长60个字符,30个汉字' disabled />
:
<Search placeholder="最长60个字符,30个汉字" readOnly enterButton={<div onClick={() => Choose(basicsVO.sourceType == '4' ? '1' : basicsVO.sourceType)} ><LinkOutlined /> 选择</div>} />
<Search placeholder="最长60个字符,30个汉字" readOnly enterButton={<div onClick={() => Choose(basicsVO.sourceType == '4' ? Change : basicsVO.sourceType)} ><LinkOutlined /> 选择</div>} />
}
</Form.Item>
<Form.Item
......
......@@ -96,7 +96,8 @@ const Add: React.FC<{}> = (props: any) => {
basicsVO: basicsVO.data,
purchaseMaterielList: purchaseMaterielList.data.list,
payPlanList: payPlanList,
contractText: contract
contractText: contract,
operateType: 1
}
console.log(param)
PublicApi.postContractManageSave(param).then((res => {
......
import React, { useState, useEffect, forwardRef } from 'react';
import { Table, Input, Select, Form, Typography } from 'antd'
import styles from '../index.less'
const { Option } = Select;
const { Text } = Typography;
const FormList = (props: any) => {
const { currentRef, purchaseMaterielList } = props;
const [dataList, setData] = useState([])
const columnsTab: any = [
{
title: '物料编号/名称', dataIndex: 'materielName', align: 'center',
render: (text, item) =>
<div>
<p>{item.materielNo}</p>
<p>{text}</p>
</div>
},
{ title: '规格型号', dataIndex: 'type', align: 'center', },
{
title: '品类', dataIndex: 'category', align: 'center',
render: (text, item) =>
<span>{text}</span>
},
{
title: '品牌', dataIndex: 'brand', align: 'center',
render: (text, item) =>
<span>{text}</span>
},
{ title: '单位', dataIndex: 'unit', align: 'center', },
{
title: '采购数量',
dataIndex: 'purchaseCount',
key: 'purchaseCount',
align: 'center',
render: (text, record, index) =>
<Form.Item
name={`isHasTax${index}`}
rules={[{ required: true, message: '请选择' }]}
>
<Input
style={{
width: 120,
}}
placeholder=""
onChange={(e) => setInput(e, 'purchaseCount', index)}
defaultValue={record.purchaseCount}
/>
</Form.Item>
},
{
title: '含税', dataIndex: 'isHasTax', align: 'center',
render: (text, record, index) =>
<Form.Item
name={`isHasTax${index}`}
initialValue={text + index}
rules={[{ required: true, message: '请选择' }]}
>
<Select
style={{ width: 80 }}
defaultValue={text ? text.toString() : ''}
onChange={(e) => setInput(e, 'isHasTax', index)}
>
<Option value="0" key={0}></Option>
<Option value="1" key={1}></Option>
</Select>
</Form.Item>
},
{
title: '税率', dataIndex: 'taxRate', align: 'center',
render: (text: any, record: any, index: number) =>
<Form.Item
name={`taxRate${index}`}
rules={[{ required: true, message: '请输入' }]}
>
<Input
style={{
width: 120,
}}
defaultValue={text}
onChange={(e) => setInput(e, 'taxRate', index)}
addonAfter="%"
/>
</Form.Item>
},
{
title: '单价(含税)', dataIndex: 'price', align: 'center',
render: (text: any, record: any, index: number) =>
<Form.Item
name={`price${index}`}
initialValue={text}
rules={[{ required: true, message: '请输入' }]}
>
<Input
style={{
width: 120,
}}
onChange={(e) => setInput(e, 'price', index)}
addonBefore="¥"
defaultValue={text}
/>
</Form.Item>
},
{
title: '授标数量', dataIndex: 'bidCount', align: 'center',
render: (text, record, index) =>
<Form.Item
name={`bidCount${index}`}
rules={[{ required: true, message: '请输入' }]}
>
<Input
style={{
width: 120,
}}
onChange={(e) => setInput(e, 'bidCount', index)}
addonBefore="¥"
defaultValue={text ? text : ''}
/>
</Form.Item>
},
{
title: '金额(含税)',
dataIndex: 'bidAmount',
key: 'bidAmount',
align: 'center',
render: (text: any, record: any) => <Text>{record.bidAmount}</Text>
},
];
useEffect(() => {
setData(purchaseMaterielList)
}, [purchaseMaterielList])
/* 回调出来的数据 */
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
let list = [];
dataList.map(item => {
list.push({
id: item.id,
materielNo: item.materielNo,
materielName: item.materielName,
type: item.type,
category: item.category,
brand: item.brand,
unit: item.unit,
isHasTax: item.isHasTax,
taxRate: item.taxRate,
purchaseCount: item.purchaseCount,
price: Number(item.price),
bidCount: item.bidCount,
bidAmount: item.bidCount && item.price ? Number(item.bidCount) * Number(item.price) : '',
associatedMaterielName: item.associatedMaterielName ? item.associatedMaterielName : '',
associatedGoods: item.associatedGoods ? item.associatedGoods : '',
associatedDataId: item.associatedDataId ? item.associatedDataId : '',
associatedMaterielNo: item.associatedMaterielNo ? item.associatedMaterielNo : '',
associatedType: item.type ? item.type : '',
associatedCategory: item.customerCategory != null ? item.customerCategory.name : '',
associatedBrand: item.brand != null ? item.brand.name : '',
})
})
resolve({
state: true,
name: 'purchaseMaterielList',
data: { list }
})
})
}
})
/* 下拉的子元素 */
const listItem = (record) => (
<div className={styles.listItem}>
<div className={styles.label}>
<p>关联</p>
<p>报价商品</p>
</div>
<div className={styles.text}>
<p>商品ID:{record.associatedDataId}</p>
<p>商品名称:{record.associatedMaterielName}</p>
</div>
<div className={styles.text}>
<p>规格:{record.associatedGoods}</p>
<p>品类:{record.associatedCategory}</p>
</div>
<div className={styles.text}>
<p>品牌:{record.brand ? record.associatedBrand : ''}</p>
</div>
</div>
)
/* 设置值 */
const setInput = (e, name, idx) => {
let item: any = [...dataList];
console.log(e)
switch (name) {
case 'isHasTax':
item[idx].isHasTax = e
break;
case 'taxRate':
item[idx].taxRate = e.target.value;
break;
case 'price':
item[idx].price = e.target.value;
break;
case 'bidCount':
item[idx].bidCount = e.target.value;
break;
case 'purchaseCount':
item[idx].purchaseCount = e.target.value;
break;
}
item[idx].bidAmount = item[idx].bidCount && item[idx].price ? Number(item[idx].bidCount) * Number(item[idx].price) : 0;
console.log(item)
setData(item)
}
return (
<div className={styles.box}>
<Table
rowKey="id"
dataSource={dataList}
columns={columnsTab}
expandable={{
expandedRowRender: record => listItem(record),
}}
style={{
width: "100%"
}}
/>
</div>
)
}
export default forwardRef(FormList)
import React, { useState, useEffect, forwardRef } from 'react';
import { Button, Select, Form, Checkbox } from 'antd'
import styles from '../index.less'
import { PublicApi } from '@/services/api';
import {
FileWordFilled,
} from '@ant-design/icons'
const ContractText = (props: any) => {
const { currentRef, ctText } = props;
const [TemplatePage, setTemplatePage] = useState<any>([]);
const [Templatel, setTemplatel] = useState<any>({});
const [checkNick, setCheckNick] = useState(true);
/* 第四个tab */
const onCheckboxChange = (e: { target: { checked: boolean } }) => {
setCheckNick(e.target.checked);
};
const getTemplate = (e) => {
PublicApi.getContractContractTemplateGet({ id: e }).then(res => {
setTemplatel(res.data)
})
}
/* 获取合同详情数据 */
const contractTemplate = () => {
let data: any = {
current: 1,
pageSize: 99
}
PublicApi.getContractContractTemplatePage(data).then(res => {
console.log(res);
let list = res.data.data.map((item: any) => {
if (item.state != 0) {
return {
label: item.name + item.version,
value: item.id,
id: item.id,
}
}
})
setTemplatePage(list)
})
}
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
let contractText = {
id: Templatel.id ? Templatel.id : 0,
templateId: Templatel.templateId ? Templatel.templateId : Templatel.id,
isUseElectronicContract: checkNick ? 1 : 0,
contractName: Templatel.name,
contractUrl: Templatel.fileExampleUrl ? Templatel.fileExampleUrl : Templatel.contractUrl
}
resolve(contractText)
})
}
})
useEffect(() => {
contractTemplate();
}, [])
useEffect(() => {
ctText.name = ctText.contractName;
// console.log(ctText, '牛蛙牛蛙')
setTemplatel(ctText)
}, [ctText])
return (
<div
style={{
width: '100%',
}}
>
<Form.Item label="合同模板" labelAlign="left" labelCol={{ span: 2 }}>
<Select
style={{ width: 600 }}
options={TemplatePage}
placeholder="请选择合同模板"
onChange={(e) => getTemplate(e)}
value={Templatel.templateId}
>
</Select>
<Button type='link' >生成合同</Button>
</Form.Item>
{
Object.keys(Templatel).length != 0 &&
<Form.Item label="合同文本" labelAlign="left" labelCol={{ span: 2 }}>
<div className={styles.upload_item} style={{ width: 680 }}>
<div className={styles.upload_left} style={{ width: 600 }}>
<FileWordFilled />
<span>{Templatel.name}</span>
</div>
<Button type='link' >编辑合同</Button>
</div>
</Form.Item>
}
<Form.Item label="电子合同" labelAlign="left" labelCol={{ span: 2 }}>
<Checkbox checked={checkNick} onChange={onCheckboxChange}>
使用电子合同
</Checkbox>
</Form.Item>
</div>
)
}
export default forwardRef(ContractText)
import React, { useRef, useState, useEffect, useImperativeHandle, forwardRef } from 'react';
import { Button, Card, Tabs, Table, Input, Select, DatePicker, Popconfirm, Form, Checkbox, Drawer, Typography, Modal, InputNumber } from 'antd'
import {
PlusOutlined
} from '@ant-design/icons'
import styles from '../index.less'
const { TextArea, Search } = Input
const { Option } = Select;
import moment from 'moment';
const FormList = (props: any) => {
const { currentRef, payPlanList } = props;
const [payNumArr, setpayNumArr] = useState<any>([1,])
const [PlanList, setPlanList] = useState<any>([
]);
/* 显示模态框 */
const tabcolumns: any = [
{
title: '付款次数', dataIndex: 'payNum', align: 'center',
render: (_, item, index) => {
const options = [];
for (let i = 0; i < PlanList.length; i++) {
let Index = payNumArr.indexOf(i + 1);
options.push({
value: i + 1,
disabled: Index == -1 ? false : true
});
}
return (
<Select
style={{ width: 200 }}
defaultValue={item.payNum}
options={options}
key='1'
onChange={(e) => onSelectChange(e, 'payNum', index)}
>
</Select>
)
}
},
{
title: '付款阶段', dataIndex: 'payStage', align: 'center',
render: (_, item, index) => <TextArea defaultValue={item.payStage} maxLength={150} rows={1} onChange={(e) => onSelectChange(e, 'payStage', index)} />
},
{
title: '预计付款时间', dataIndex: 'expectPayTime', align: 'center',
render: (_, item, index) => <DatePicker
style={{ width: '100%' }}
format="YYYY-MM-DD"
onChange={(e) => onSelectChange(e, 'expectPayTime', index)}
/>
},
{
title: '付款比例', dataIndex: 'payRatio', align: 'center',
render: (text, item, index) =>
<div className={styles.flex}>
<Input
style={{
width: 150,
}}
defaultValue={text}
placeholder=""
onChange={(e) => onSelectChange(e, 'payRatio', index)}
/>
<span>%</span>
</div>
},
{
title: '付款金额', dataIndex: 'payAmount', align: 'center',
render: (text, item, index) =>
<div className={styles.flex}>
<span></span>
<Input
style={{
width: 130,
}}
placeholder=""
defaultValue={text}
onChange={(e) => onSelectChange(e, 'payAmount', index)}
/>
</div>
},
{
title: '付款方式', dataIndex: 'payWay', align: 'left',
render: (_, item, index) =>
<div
className={styles.select}
>
<Select
style={{ width: 208 }}
onChange={(e) => onSelectChange(e, 'payWay', index)}
defaultValue={item.payWay}
>
<Option value="3" key={3}>现结</Option>
<Option value="1" key={1}>账期:</Option>
<Option value="2" key={2}>月结:</Option>
</Select>
{
item.payWay != 3 &&
<div className={styles.setBox}>
{/* payParam */}
<InputNumber defaultValue={item.payWay} placeholder='' onChange={(e) => onSelectChange(e, 'payParam', index)} width={60} max={31} />
<span>{item.payWay == 2 ? '号' : item.payWay == 1 ? '天' : ''}</span>
</div>
}
</div>
},
{
title: '操作',
dataIndex: '',
align: 'center',
key: 'x',
render: (_, item, index) => <a onClick={() => Delete(item, index)}>删除</a>,
},
];
/* 添加 */
const addtable = () => {
const data = [...PlanList];
data.push(
{
payNum: '',
payStage: '',
expectPayTime: '',
payRatio: '',
payAmount: '',
payWay: '1',
payParam: '',
id: 0,
},
)
console.log(data)
setPlanList(data)
};
/* 删除 */
const Delete = (elm, idx) => {
const dataSource = [...PlanList];
const arr = [...payNumArr]
let List = dataSource.filter((item, index) => index !== idx);
let numberArr = arr.filter((item, index) => elm.payNum !== item);
console.log(numberArr);
setpayNumArr(numberArr)
setPlanList(List)
};
/* 选中设置值 */
const onSelectChange = (e, name, idx) => {
let item = [...PlanList];
let NumArr = [...payNumArr]
console.log(e, name, idx, item);
// return;
switch (name) {
case 'payWay':
item[idx].payWay = e;
break;
case 'payNum':
item[idx].payNum = e;
NumArr.push(e);
break;
case 'expectPayTime':
item[idx].expectPayTime = moment(e).format('YYYY-MM-DD HH:mm:ss');
break;
case 'payStage':
item[idx].payStage = e.target.value;
break;
case 'payRatio':
item[idx].payRatio = e.target.value;
break;
case 'payAmount':
item[idx].payAmount = e.target.value;
break;
case 'payParam':
item[idx].payParam = e;
break;
}
NumArr = Array.from(new Set(NumArr))
setpayNumArr(NumArr)
setPlanList(item)
}
useEffect(() => {
setPlanList(payPlanList)
}, [payPlanList])
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
PlanList.map(item => {
item.id = item.id
item.payNum = Number(item.payNum)
item.payRatio = Number(item.payRatio)
item.payAmount = Number(item.payAmount)
item.payWay = Number(item.payWay)
item.payParam = Number(item.payParam)
// 付款方式: 1 - 账期,2 - 月结,3 - 现结
item.payWayName = item.payWay == 1 ? '账期' : item.payWay == 2 ? '月结' : '现结'
})
resolve(PlanList)
})
}
})
return (
<div className="table">
<Table
columns={tabcolumns}
dataSource={PlanList}
rowKey="id"
style={{
width: "100%"
}}
pagination={false}
/>
<div style={{ background: '#F4F5F7' }} onClick={() => addtable()} >
<Button block type='dashed'><PlusOutlined />添加付款计划</Button>
</div>
</div>
)
}
export default forwardRef(FormList)
......@@ -9,14 +9,32 @@ const { Option } = Select;
const { RangePicker } = DatePicker;
const Information = (props: any) => {
const { currentRef, basic } = props;
const { currentRef, basic, oldContractId } = props;
const [attrValueForm] = Form.useForm();
const [startTime, setstartTime] = useState('');
const [endTime, setendTime] = useState('');
/**
* @param {{basicsVO}} 表单数据集合
* */
useEffect(() => {
console.log(basic)
attrValueForm.setFieldsValue(basic)
basic.sourceType = String(basic.sourceType);
if (basic.contractNo) {
if (oldContractId) {
let data = { oldContractNo: basic.contractNo }
console.log(data, 123131, basic)
PublicApi.getContractManageGetContractNo(data).then(res => {
console.log(res.data)
if (res.code === 1000) {
basic.contractNo = res.data
attrValueForm.setFieldsValue(basic)
}
})
}
} else {
attrValueForm.setFieldsValue(basic)
}
}, [basic])
useEffect(() => {
......@@ -26,7 +44,16 @@ const Information = (props: any) => {
resolve({
state: true,
name: 'basic',
data: res
data: Object.assign(res, {
id: oldContractId ? 0 : basic.id,
partyBRoleId: basic.partyBRoleId,
startTime, endTime,
sourceId: basic.sourceId,
totalAmount: basic.totalAmount,
partyBMemberId: basic.partyBMemberId,
partyBName: basic.partyBName,
oldContractId: oldContractId ? basic.id : 0
}),
})
}).catch(error => {
if (error && error.errorFields) {
......@@ -37,6 +64,27 @@ const Information = (props: any) => {
}
})
// useEffect(() => {
// if (oldContractId) {
// let data = { oldContractNo: basic.contractNo }
// console.log(data, 123131, basic)
// PublicApi.getContractManageGetContractNo(data).then(res => {
// console.log(res.data)
// if (res.code === 1000) {
// basic.contractNo = res.data
// attrValueForm.setFieldsValue(basic)
// }
// })
// }
// }, [oldContractId])
/* 时间选中 */
const onChange = (value: any) => {
console.log(value)
let startTime = moment(Number(value[0])).format('YYYY-MM-DD HH:mm:ss')
let endTime = moment(Number(value[1])).format('YYYY-MM-DD HH:mm:ss')
setstartTime(startTime)
setendTime(endTime)
}
const rangeConfig = {
rules: [{ type: 'array' as const, required: true, message: ' 请选择开始或者结束时间' }],
};
......@@ -65,7 +113,7 @@ const Information = (props: any) => {
]}
>
{/* disabled */}
<Input placeholder='请输入合同编号' disabled />
<Input placeholder='请输入合同编号' disabled={oldContractId ? false : true} />
</Form.Item>
<Form.Item
label="合同摘要"
......@@ -110,7 +158,9 @@ const Information = (props: any) => {
name="range-picker"
{...rangeConfig}
>
<RangePicker style={{ width: '100%' }} />
<RangePicker style={{ width: '100%' }}
onChange={(e) => onChange(e)}
/>
</Form.Item>
<Form.Item
label="对应单据"
......
.box {
width: 100%;
:global {
.ant-table-expanded-row-level-1 .ant-table-cell {
padding: 0px !important;
background-color: #ffffff;
}
.ant-form-item{
margin: 0 !important;
}
}
.listItem {
display: flex;
.label {
flex: 0.2;
padding: 0 16px;
color: #00B37A;
background: linear-gradient(270deg, #ffffff 0%, #daf2e7 100%);
}
.text {
padding: 0px 0px;
flex: 1;
}
p {
margin-bottom: 0;
}
}
}
.flex {
display: flex;
align-items: center;
justify-content: center;
span {
background: #e4e6eb;
padding: 7px 12px;
color: #c0c4cc;
}
}
.upload_item {
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
.upload_left {
display: flex;
align-items: center;
color: #303133;
background-color: #fafbfc;
:global {
.anticon-file-word {
color: #4279df;
font-size: 18px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00b37a;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #c0c4cc;
}
}
}
}
.select{
position: relative;
width: 259px;
text-align: left;
.setBox{
width: 100px;
display: flex;
align-items: center;
position: absolute;
top: 1px;
right: 78px;
:global {
.ant-input-number{
border: none !important;
background: transparent;
box-shadow:none !important;
}
.select{
.ant-input-number:focus{
border: none !important;
background: transparent !important;
box-shadow:none !important;
}
}
.ant-input:focus, .ant-input-focused{
border: none !important;
background: transparent !important;
box-shadow:none !important;
}
span{
margin-left: 10px;
}
}
}
}
......@@ -4,6 +4,9 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api';
import { history } from 'umi'
import Information from './components/information'
import FormList from './components/FormList';
import Fromtable from './components/Fromtable'
import ContractText from './components/contractText'
import {
SaveOutlined,
} from '@ant-design/icons'
......@@ -13,6 +16,7 @@ const Editing: React.FC<{}> = (props: any) => {
location: {
query: {
contractId, // 寻源类型
oldContractId,
} } } = props;
const currentBasic = useRef<any>({});
const purchaseMate = useRef<any>([])
......@@ -23,50 +27,108 @@ const Editing: React.FC<{}> = (props: any) => {
* @param components 显示内容
*/
const [basic, setbasic] = useState<any>({});
const [purchaseMaterielList, setpurchaseMaterielList] = useState<any>({})
const [purchaseMaterielList, setpurchaseMaterielList] = useState<any>([])
const [payPlanList, setpayPlanList] = useState<any>([]);
const [ctText, setcontractText] = useState<any>({})
/* 查询详情 */
const getDetail = () => {
PublicApi.getContractManageGetDetail({ contractId }).then(res => {
if (res.code === 1000) {
console.log(res);
const { basics, payPlanList, contractText } = res.data;
setbasic(basics)
setpayPlanList(payPlanList)
setcontractText(contractText)
}
})
}
/* 查询购物料 */
const getMaterielList = () => {
PublicApi.getContractManagePagePurchaseMaterielList({
current: 1,
pageSize: 10,
contractId
}).then(res => {
if (res.code === 1000) {
setpurchaseMaterielList(res.data.data)
}
})
}
useEffect(() => {
getDetail();
getMaterielList()
}, [])
/* 提交*/
const submit = async () => {
/* 基本信息 */
const basicsVO = await currentBasic.current.get();
const purchaseMaterielList = await purchaseMate.current.length != 0 ? await purchaseMate.current.get() : [];
const payPlanList = await payPlan.current.length != 0 ? await payPlan.current.get() : [];
const contract = await Object.keys(contractText.current).length != 0 ? await contractText.current.get() : {}
let param: any = {
basicsVO: basicsVO.data,
purchaseMaterielList: purchaseMaterielList.length != 0 ? purchaseMaterielList.data.list : purchaseMaterielList,
payPlanList: payPlanList,
contractText: contract,
operateType: oldContractId ? 3 : 2,
}
console.log(param)
PublicApi.postContractManageSave(param).then((res => {
if (res.code === 1000) {
setTimeout(() => {
history.push('/memberCenter/contract/manage/add/addList')
}, 1000)
}
}))
}
const TabList = [
{
name: '基本信息',
components:
<Information currentRef={currentBasic} basic={basic} />
<Information
currentRef={currentBasic}
basic={basic}
oldContractId={oldContractId}
/>
},
{
name: '采购物料',
components:
2
<FormList
currentRef={purchaseMate}
purchaseMaterielList={purchaseMaterielList}
/>
},
{
name: '付款计划',
components:
3
<Fromtable
currentRef={payPlan}
payPlanList={payPlanList}
/>
},
{
name: '合同文本', components:
<ContractText
currentRef={contractText}
ctText={ctText}
/>
},
{ 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="新建合同"
title={contractId ? '合同变更' : '编辑合同'}
extra={[
<Button key="1" type="primary" icon={<SaveOutlined />} > 保存</Button>
<Button key="1" type="primary" icon={<SaveOutlined />} onClick={() => submit()} > 保存</Button>
]}
>
<Card>
<Tabs defaultActiveKey="0" type="card" size="small">
{
TabList.map((item, index) => (
<TabPane tab={item.name} key={index}>
<TabPane tab={item.name} key={index} forceRender>
{item.components}
</TabPane>
))
......
......@@ -242,7 +242,7 @@ const Examine = () => {
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<Form.Item label='' name="opinion" >
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
......
......@@ -241,7 +241,7 @@ const Levelexamine = () => {
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<Form.Item label='' name="opinion">
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
......
......@@ -27,7 +27,7 @@ const PurchaseList = () => {
<div>
<EyePreview
// type={record.quotedPriceOrderId ? 'link' : 'button'}
url={`/memberCenter/procurementAbility/offter/inquiry/preview??id=${record.quotedPriceOrderId}&number=${record.quotedPriceOrderNo}`}
url={`/memberCenter/procurementAbility/confirmOffer/offerInquire/preview?id=${record.demandId}&turn=${record.turn}`}
>
{text}
</EyePreview>
......
......@@ -287,7 +287,7 @@ export const QueryListSchema: ISchema = {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入搜索内容',
placeholder: '请输入合同编号',
align: 'start',
},
},
......@@ -301,12 +301,6 @@ export const QueryListSchema: ISchema = {
}
},
properties: {
contractNo: {
type: 'string',
'x-component-props': {
placeholder: '请输入合同编号',
}
},
contractAbstract: {
type: 'string',
"x-component-props": {
......
......@@ -245,7 +245,7 @@ const Secondaryexamine = () => {
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<Form.Item label='' name="opinion">
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
......
......@@ -124,6 +124,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
}
useEffect(() => {
console.log(record)
if (preview && Object.keys(record).length > 0) {
setProduct({
name: record.productName,
......
/*
* @Author: XieZhiXiong
* @Date: 2020-09-23 17:00:24
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-13 10:16:27
* @Description:
*/
import { ISchema } from '@formily/antd';
import { UPLOAD_TYPE } from '@/constants';
export const evaluateSchema: ISchema = {
type: 'object',
properties: {
comments: {
type: 'array',
'x-component': 'EvaluationList',
default: [],
items: {
type: 'object',
properties: {
LEFT_RIGHT: {
type: 'object',
'x-component': 'LeftRightLayout',
'x-component-props': {
rightProps: {
span: 2,
offset: 4,
},
},
properties: {
MEGA_LADYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 6,
labelAlign: 'left',
position: 'left',
},
properties: {
star: {
title: '满意程度',
required: true,
'x-component': 'Rating',
'x-component-props': {
allowHalf: false,
allowClear: false,
},
'x-rules': [
{
required: true,
message: '请选择满意程度',
},
],
},
comment: {
type: 'string',
title: '评价',
'x-component': 'TextArea',
'x-component-props': {
rows: 4,
},
'x-rules': {
max: 200,
},
},
picture: {
type: 'array',
title: '图片',
'x-component': 'AntUpload',
'x-component-props': {
listType: 'card',
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/purchaserEvaluation/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.png, .jpg, .jpeg',
},
'x-rules': [
{
max: 4,
message: '最多可上传4张图片',
},
],
'x-mega-props': {
addonAfter: '{{UploadTip}}',
},
},
},
},
smile: {
type: 'object',
default: 5,
'x-component': 'SmilingFace',
'x-component-props': {
position: 'right',
},
},
},
},
},
},
},
},
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2020-09-23 17:00:24
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-13 10:16:27
* @Description:
*/
import { ISchema } from '@formily/antd';
import { UPLOAD_TYPE } from '@/constants';
export const evaluateSchema: ISchema = {
type: 'object',
properties: {
comments: {
type: 'array',
'x-component': 'EvaluationList',
default: [],
items: {
type: 'object',
properties: {
LEFT_RIGHT: {
type: 'object',
'x-component': 'LeftRightLayout',
'x-component-props': {
rightProps: {
span: 2,
offset: 4,
},
},
properties: {
MEGA_LADYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 6,
labelAlign: 'left',
position: 'left',
},
properties: {
star: {
title: '满意程度',
required: true,
'x-component': 'Rating',
'x-component-props': {
allowHalf: false,
allowClear: false,
},
'x-rules': [
{
required: true,
message: '请选择满意程度',
},
],
},
comment: {
type: 'string',
title: '评价',
'x-component': 'TextArea',
'x-component-props': {
rows: 4,
},
'x-rules': {
max: 200,
},
},
picture: {
type: 'array',
title: '图片',
'x-component': 'AntUpload',
'x-component-props': {
listType: 'card',
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/purchaserEvaluation/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.png, .jpg, .jpeg',
},
'x-rules': [
{
max: 4,
message: '最多可上传4张图片',
},
],
'x-mega-props': {
addonAfter: '{{UploadTip}}',
},
},
},
},
smile: {
type: 'object',
default: 5,
'x-component': 'SmilingFace',
'x-component-props': {
position: 'right',
},
},
},
},
},
},
},
},
};
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