Commit a1dab835 authored by 卢均锐's avatar 卢均锐

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

* 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform: 🦄 refactor(询价报价): 新增页面ui修改 修改bug
parents 17ce401f 628cba35
......@@ -49,8 +49,8 @@ const NestTable: React.FC<NestTableProps> = (props) => {
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
)
<CaretRightOutlined onClick={e => onExpand(record, e)} />
)
}}
pagination={pagination}
{...resetProps}
......@@ -60,4 +60,4 @@ const NestTable: React.FC<NestTableProps> = (props) => {
NestTable.defaultProps = {}
export default NestTable
\ No newline at end of file
export default NestTable
......@@ -54,9 +54,8 @@ const PaymentCard: React.FC<Iprops> = ({
<div className={style.proportion}>{item.payRatio}%</div>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div className={style.Price}>¥{item.payAmount}</div>
{/* IsShow && <div onClick={() => like(1, item)} style={{ cursor: 'pointer', fontSize: 12, backgroundColor: '#00B37A', color: '#fff', padding: '4px 8px' }}>请款</div> */}
{
children
children ? children : IsShow && <div onClick={() => like(1, item)} style={{ cursor: 'pointer', fontSize: 12, backgroundColor: '#00B37A', color: '#fff', padding: '4px 8px' }}>请款</div>
}
</div>
<div className={style.warp_List}>
......
......@@ -25,19 +25,23 @@ const PopModal: React.FC<Iprops> = ({
}) => {
const [form] = Form.useForm();
/* 选中 */
const [paymentId, setpaymentId] = useState<any>()
/* 确定 */
const onFinish = (values: any) => {
sessionStorage.setItem('basics', JSON.stringify(basics))
sessionStorage.setItem('list', JSON.stringify(selectRowList))
history.push('/memberCenter/contract/funds/addbill/Add?applyId=' + contractId + '&sourceType=' + 2)
let payid = paymentId ? paymentId : payType[0].id;
history.push('/memberCenter/contract/funds/addbill/Add?applyId=' + contractId + '&sourceType=' + 2 + '&paymentId=' + payid)
}
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
return (
<Modal
footer={null}
title="提交审核"
title="提交请款单"
visible={ModalVisible}
onOk={() => setDrawerPopModal()}
onCancel={() => setDrawerPopModal()} >
......@@ -55,6 +59,9 @@ const PopModal: React.FC<Iprops> = ({
style={{
width: '290px'
}}
onChange={(value) => {
setpaymentId(value)
}}
>
{
payType.map(item => (
......
......@@ -159,9 +159,6 @@
color: #00B37A;
cursor: pointer;
}
.wrapper :global .ant-input-search .ant-input-group .ant-input {
padding: 0px !important;
}
.wrapper :global .ant-input-search .ant-input-group-addon .ant-input-search-button {
background-color: #F7F8FA;
}
......@@ -188,7 +188,7 @@
.ant-input-search {
.ant-input-group {
.ant-input {
padding: 0px !important;
// padding: 0px !important;
}
}
.ant-input-group-addon {
......
......@@ -361,9 +361,16 @@ const Details = (props: any) => {
current: current,
pageSize: pageSize,
}
setSize(pageSize)
console.log(current, pageSize, size)
getContracInfoList(data)
};
const like = (sourceType, item) => {
console.log(sourceType, item);
// sessionStorage.setItem('basics', JSON.stringify(basics));
// history.push('/memberCenter/contract/funds/addbill/Add?applyId=' + contractId + '&sourceType=' + sourceType + '&paymentId=' + item.id)
}
return (
<div className={style.anchorWrap}>
<Anchor
......@@ -411,7 +418,9 @@ const Details = (props: any) => {
{/* 基本信息 */}
<BasicInfo basicInfo={basicInfo} />
{/* 付款计划 */}
<PaymentCard payPlanList={payPlanList} basics={basicInfo} contractId={contractId} />
<PaymentCard
IsShow={true}
payPlanList={payPlanList} basics={basics} contractId={contractId} />
{/* 执行情况 */}
<div id='docking' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
......
......@@ -19,7 +19,7 @@ export interface Iprops extends IAntdSchemaFormProps {
const { Text } = Typography;
const situationList: React.FC<Iprops> = ({ contractId }) => {
const [page, setPage] = useState(1);
const [size, setSize] = useState(8);
const [size, setSize] = useState(10);
const [total, setTotal] = useState(0);
const [listLoading, setListLoading] = useState(false);
/* 单据总金额 */
......@@ -226,9 +226,10 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
columns={columns}
dataSource={data}
loading={listLoading}
pagination={
{
defaultPageSize: 20,
pageSize: size,
total,
onChange: handlePaginationChange
......
......@@ -29,14 +29,13 @@ const Add: React.FC<{}> = (props: any) => {
setid(data.selectRow.id)
console.log(data)
}
useEffect(() => {
// contract
PublicApi.getContractApplyAmountGetDetail({ applyId: paymentId }).then((res) => {
console.log(res)
}).catch((err) => {
// useEffect(() => {
// PublicApi.getContractApplyAmountGetDetail({ applyId: paymentId }).then((res) => {
// console.log(res)
// }).catch((err) => {
});
}, [])
// });
// }, [])
const TabList = [
{
name: '基本信息', components:
......
......@@ -129,19 +129,19 @@ const AddInfo = (props: any) => {
const info = Info;
if (res.code == 1000) {
if (res.data.payPlanList.length != 0) {
res.data.payPlanList.map((item, index) => {
console.log(index)
if (item.id == paymentId) {
const expectPayTime = new Date(item.expectPayTime).getTime();
basicsData.payPlanId = item.id;
basicsData.payRatio = item.payRatio;
for (let i = 0; i < res.data.payPlanList.length; i++) {
if (res.data.payPlanList[i].id == paymentId) {
console.log(1232131);
const expectPayTime = new Date(res.data.payPlanList[i].expectPayTime).getTime();
basicsData.payPlanId = res.data.payPlanList[i].id;
basicsData.payRatio = res.data.payPlanList[i].payRatio;
basicsData.expectPayTime = moment(expectPayTime);
basicsData.payWay = item.payWay;
basicsData.payParam = item.payParam;
basicsData.applyAmount = item.payAmount;
setapplyAmount(item.payAmount)
setIndex(index + 1)
return;
basicsData.payWay = res.data.payPlanList[i].payWay;
basicsData.payParam = res.data.payPlanList[i].payParam;
basicsData.applyAmount = res.data.payPlanList[i].payAmount;
setapplyAmount(res.data.payPlanList[i].payAmount)
setIndex(i + 1)
break;
} else {
const expectPayTime = new Date(res.data.payPlanList[0].expectPayTime).getTime();
basicsData.payPlanId = res.data.payPlanList[0].id;
......@@ -152,7 +152,7 @@ const AddInfo = (props: any) => {
basicsData.applyAmount = res.data.payPlanList[0].payAmount;
setapplyAmount(res.data.payPlanList[0].payAmount)
}
})
}
}
basicsData.contractNo = selectRow.contractNo;
......@@ -183,6 +183,7 @@ const AddInfo = (props: any) => {
const auth = JSON.parse(localStorage.getItem('auth'));
setaccount(auth.account);
setBasics(basicsData)
console.log(basicsData, 'basicsData')
attrValueForm.setFieldsValue(basicsData);
}
})
......
......@@ -33,9 +33,7 @@ const BillDetails = (props: any) => {
const [reason, setDatareason] = useState('');
const [status, setstatus] = useState<any>()
const [ExamineFlag, setExamineFlag] = useState<boolean>(false);
useEffect(() => {
setTargetOffset(window.innerHeight / 6);
}, []);
const handleAnchorClick = (e) => {
e.preventDefault()
}
......@@ -54,6 +52,7 @@ const BillDetails = (props: any) => {
})
/* 获取详情的数据 */
const getDetail = () => {
console.log(applyId, 'applyId')
PublicApi.getContractApplyAmountGetDetail({ applyId }).then(res => {
if (res.code === 1000) {
let { basics, taskStepList } = res.data
......@@ -134,7 +133,7 @@ const BillDetails = (props: any) => {
setIsModalVisible(!isModalVisible);
};
useEffect(() => {
setTargetOffset(window.innerHeight / 6);
setTargetOffset(window.innerHeight / 4);
getDetail()
}, []);
......
......@@ -12,13 +12,14 @@ import moment from 'moment';
const FormList = (props: any) => {
console.log(props)
const { fromData, currentRef, fetchdata } = props;
const [keys, setkeys] = useState<any>(); // 记录上次删除的
const [options, setoptions] = useState<any>([
{
value: 1,
disabled: true
}
])
const [id, setId] = useState<any>(''); // 记录上次的id
const [PlanList, setPlanList] = useState<any>([
{
payNum: '1',
......@@ -30,6 +31,7 @@ const FormList = (props: any) => {
payParam: '',
id: 0,
rowId: 1,
disabled: true
},
]);
......@@ -130,36 +132,43 @@ const FormList = (props: any) => {
/* 添加 */
const addtable = () => {
const data = [...PlanList];
data.push(
{
payNum: '',
payStage: '',
expectPayTime: '',
payRatio: '',
payAmount: '',
payWay: '1',
payParam: '',
id: 0,
rowId: data.length + 1,
},
)
let optionsData = [];
data.map((item, index) => {
console.log(item.payNum, index + 1)
optionsData.push({
value: index + 1,
if (keys) {
data.push(keys);
setkeys('');
} else {
data.push(
{
payNum: data.length + 1,
payStage: '',
expectPayTime: '',
payRatio: '',
payAmount: '',
payWay: '1',
payParam: '',
id: 0,
rowId: data.length + 1,
disabled: false,
},
)
}
let optionsData = data.map((item, index) => {
return {
value: item.payNum ? item.payNum : index + 1,
disabled: item.payNum ? true : false,
})
rowId: item.rowId,
}
})
console.log(optionsData, 'optionsDataadd', options)
console.log('optionsDataadd', data, optionsData, 'optionsList')
setPlanList(data)
setoptions(optionsData)
};
/* 删除 */
const Delete = (elm, idx) => {
const dataSource = [...PlanList];
let List = dataSource.filter((item, index) => index !== idx);
setPlanList(List)
let optionsData = options.map((keys => {
if (elm.payNum == keys.value) {
keys.disabled = false;
......@@ -168,7 +177,8 @@ const FormList = (props: any) => {
...keys
}
}))
console.log(optionsData, 'del')
setkeys(elm);
setPlanList(List)
setoptions(optionsData)
};
......@@ -181,7 +191,7 @@ const FormList = (props: any) => {
break;
case 'payNum':
item[idx].payNum = e;
setId(e);
break;
case 'expectPayTime':
item[idx].expectPayTime = moment(e).format('YYYY-MM-DD HH:mm:ss');
......@@ -199,30 +209,7 @@ const FormList = (props: any) => {
item[idx].payParam = e;
break;
}
let optionsData = [];
if (id) {
optionsData = options.map((keys => {
if (id == keys.value) {
keys.disabled = false;
}
if (keys.value == e) {
keys.disabled = true;
}
return {
...keys
}
}))
} else {
optionsData = options.map((keys => {
if (keys.value == e) {
keys.disabled = true;
}
return {
...keys
}
}))
}
setoptions(optionsData)
setPlanList(item)
}
useEffect(() => {
......
......@@ -11,6 +11,7 @@ const FormList = (props: any) => {
const { currentRef, purchaseMaterielList } = props;
const [dataList, setData] = useState([])
const columnsTab: any = [
{
title: '物料编号/名称', dataIndex: 'materielName', align: 'center',
......
......@@ -10,7 +10,16 @@ const { Option } = Select;
import moment from 'moment';
const FormList = (props: any) => {
const { currentRef, payPlanList } = props;
const [payNumArr, setpayNumArr] = useState<any>([1,])
// const [payNumArr, setpayNumArr] = useState<any>([1,])
const [keys, setkeys] = useState<any>(); // 记录上次删除的
const [options, setoptions] = useState<any>([
{
value: 1,
disabled: true
}
])
const [PlanList, setPlanList] = useState<any>([
]);
/* 显示模态框 */
......@@ -18,14 +27,6 @@ const FormList = (props: 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 }}
......@@ -119,38 +120,61 @@ const FormList = (props: any) => {
/* 添加 */
const addtable = () => {
const data = [...PlanList];
data.push(
{
payNum: '',
payStage: '',
expectPayTime: '',
payRatio: '',
payAmount: '',
payWay: '1',
payParam: '1',
id: 0,
rowId: data.length + 1,
},
)
console.log(data)
if (keys) {
data.push(keys);
setkeys('');
} else {
data.push(
{
payNum: data.length + 1,
payStage: '',
expectPayTime: '',
payRatio: '',
payAmount: '',
payWay: '1',
payParam: '',
id: 0,
rowId: data.length + 1,
disabled: false,
},
)
}
let optionsData = data.map((item, index) => {
return {
value: item.payNum ? item.payNum : index + 1,
disabled: item.payNum ? true : false,
rowId: item.rowId,
}
})
console.log('optionsDataadd', data, optionsData, 'optionsList')
setPlanList(data)
setoptions(optionsData)
};
/* 删除 */
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)
let optionsData = options.map((keys => {
if (elm.payNum == keys.value) {
keys.disabled = false;
}
return {
...keys
}
}))
setkeys(elm);
setPlanList(List)
setoptions(optionsData)
};
/* 选中设置值 */
const onSelectChange = (e, name, idx) => {
console.log(e, name, idx)
let item = [...PlanList];
let NumArr = [...payNumArr]
console.log(item, '哈哈');
// return;
switch (name) {
......@@ -159,7 +183,7 @@ const FormList = (props: any) => {
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');
......@@ -177,8 +201,7 @@ const FormList = (props: any) => {
item[idx].payParam = e;
break;
}
NumArr = Array.from(new Set(NumArr))
setpayNumArr(NumArr)
setPlanList(item)
}
useEffect(() => {
......
import React from 'react';
import AddQuoteForm from './addForm';
import {history} from 'umi';
const AddQuote: React.FC<{}> = () => {
const { id } = history.location.query;
return(
<AddQuoteForm
type={1}
import { history } from 'umi';
import { PublicApi } from '@/services/api';
const AddQuote = (props: any) => {
return (
<AddQuoteForm
title={props.route.name}
fetchRequest={PublicApi.postTransactionProductQuotationAdd}
/>
)
}
export default AddQuote;
\ No newline at end of file
export default AddQuote;
import React from 'react';
import { Form, Row, Col } from 'antd';
import Card from '@/pages/transaction/components/card';
import UploadFiles from '@/components/UploadFiles/UploadFiles';
import UploadFiles from '@/pages/transaction/components/UploadFiles';
interface AttachLayoutProps {
/** 附件列表 */
enclosureUrls?: any[],
/** 获取上传 */
getEnclosureUrls?: (e?: any) => void,
/** 删除 */
removeEnclosureUrls?: (e?: number) => void,
}
const AttachLayout: React.FC<AttachLayoutProps> = (props: any) => {
const { enclosureUrls, getEnclosureUrls, removeEnclosureUrls } = props;
const AttachLayout = () => {
const customizeItemRender = (file) => {
console.log(file)
}
return (
<Card
id="attachLayout"
......@@ -15,7 +23,13 @@ const AttachLayout = () => {
<Row gutter={[48, 24]}>
<Col span={12}>
<Form.Item label="附件" name="enclosureUrls">
<UploadFiles beforeUpload={customizeItemRender} />
<UploadFiles
accept=".doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx"
size={20}
fileList={enclosureUrls}
onChange={(e: any) => getEnclosureUrls(e)}
onRemove={(e: number) => removeEnclosureUrls(e)}
/>
</Form.Item>
</Col>
</Row>
......
import React, { useState, useEffect } from 'react';
import { Form, Button, Upload, message } from 'antd';
import { UPLOAD_TYPE } from '@/constants'
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface';
import styles from './index.less';
import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
};
export interface parmas {
handleGetEnclosureUrls?: Function,
editData?: any
}
const Attached: React.FC<parmas> = (props) => {
const { handleGetEnclosureUrls, editData } = props;
const [files, setFiles] = useState<Array<any>>([]);
const [loading, setloading] = useState(false);
/**判断文件类型和大小 */
const beforeDocUpload = (file: UploadFile) => {
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
}
return isLt20M;
}
// 上传回调
const handleChange = ({ file }) => {
const arr: any = files;
setloading(true);
if (file.response) {
if (file.response.code === 1000) {
arr.push({
name: file.name,
url: file.response.data
})
setloading(false);
}
}
setFiles([...arr])
handleGetEnclosureUrls(arr);
}
// 删除附件
const removeFiles = (index: any) => {
const arr = [...files];
arr.splice(index, 1);
setFiles(arr);
handleGetEnclosureUrls(arr);
}
useEffect(() => {
if (Object.keys(editData).length > 0) {
setFiles(editData.enclosureUrls)
}
}, [editData])
return (
<Form
{...layout}
className={styles.revise_style}
>
<Form.Item label='附件' name='upload'>
<div className={styles.upload_data}>
{(files && files.length > 0) && files.map((v, index) => (
<div key={index} className={styles.upload_item}>
<div className={styles.upload_left}>
<LinkOutlined />
<span>{v.name}</span>
</div>
<div className={styles.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
</div>
</div>
))}
</div>
<Upload
action="/api/file/file/upload"
data={{ fileType: UPLOAD_TYPE }}
showUploadList={false}
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
</Upload>
</Form.Item>
</Form>
)
}
export default Attached;
import React, { useState, useEffect, ReactNode } from 'react';
import styles from './index.less';
import { Input, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
interface queryProps {
inquiryNo?: any,
getGoodsList: Function,
editData: any,
type?: any
}
const EnquiryGoods: React.FC<queryProps> = (props) => {
const { inquiryNo, getGoodsList, editData, type } = props
// 会员添加弹窗控制
const [goodsList, setgoodsList] = useState([]);
// 计算金额
const countMoney = (num: any, money: any) => {
let price: ReactNode = null;
price = (Number(money) * 1) / Number(num);
return Number(price).toFixed(2);
}
/**输入框输入 */
const inputOnchange = (id, e) => {
const { value } = e.target
goodsList.forEach(v => {
if (v.productId === id) {
v.money = value
v.price = countMoney(v.purchaseCount, value);
}
})
getGoodsList([...goodsList]) // 返回给父级
setgoodsList([...goodsList])
}
const columns: ColumnType<any>[] = [{
title: '商品ID',
dataIndex: 'productId',
}, {
title: '商品名称',
dataIndex: 'productName',
}, {
title: '品类',
dataIndex: 'category',
}, {
title: '品牌',
dataIndex: 'brand',
}, {
title: '单位',
dataIndex: 'unit',
}, {
title: '采购数量',
dataIndex: 'purchaseCount',
}, {
title: '报价单价',
dataIndex: 'price',
}, {
title: '金额',
dataIndex: 'money',
render: (text: any, record: any) => (
<Form.Item name={record.productId} noStyle initialValue={record.money}>
<Input
addonBefore="¥"
onBlur={(e) => inputOnchange(record.productId, e)}
type='number'
maxLength={25}
/>
</Form.Item>
)
}]
useEffect(() => {
if (Object.keys(inquiryNo).length > 0 && inquiryNo.orderId) {
console.log(inquiryNo)
PublicApi.getTransactionProductInquiryDetails({ id: inquiryNo.orderId }).then(res => {
if (res.code === 1000) {
const data = res.data.inquiryListProductRequests;
data.forEach((item: any) => {
item.money = item.purchaseCount * item.price
})
getGoodsList(data)
setgoodsList(data)
}
})
}
}, [inquiryNo])
// 编辑时回显的数据
useEffect(() => {
if (Object.keys(editData).length > 0) {
setgoodsList(editData.inquiryListProductRequests);
}
}, [])
return (
<div className={styles.revise_style}>
<Form>
<Table rowKey={'productId'} style={{ marginTop: '16px' }} columns={columns} dataSource={goodsList} pagination={false} />
</Form>
</div>
)
}
export default EnquiryGoods
import React, { useState } from 'react';
import styles from './index.less';
import { Radio, Tag } from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import moment from 'moment';
import { EXTERNALSTATE_COLOR, INTERNALSTATE_COLOR } from '@/pages/transaction/components/stateColor';
export interface parmas {
editData?: any
}
const FlowRecord: React.FC<parmas> = (props) => {
const { editData } = props;
const [radio, setRadio] = useState<string>('outer'); //切换单据
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
const outerColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'id',
}, {
title: '操作角色',
dataIndex: 'roleName',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <Tag color={EXTERNALSTATE_COLOR[text]}>{record.stateName}</Tag>
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const insideColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'id',
}, {
title: '操作人',
dataIndex: 'roleName',
}, {
title: '部门',
dataIndex: 'department',
}, {
title: '职位',
dataIndex: 'position',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <Tag color={INTERNALSTATE_COLOR[text]}>{record.stateName}</Tag>
}, {
title: '操作',
dataIndex: 'operation',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const onChange = (e: any) => {
setRadio(e.target.value)
}
return (
<div className={styles.revise_style}>
<Radio.Group defaultValue="outer" buttonStyle="solid" onChange={onChange}>
<Radio.Button value="outer">外部单据</Radio.Button>
<Radio.Button value="inside">内部单据</Radio.Button>
</Radio.Group>
{radio === 'outer' ?
<PolymericTable
dataSource={editData.externalRequisitionFormResponses}
columns={outerColumns}
loading={false}
pagination={null}
/>
:
<PolymericTable
dataSource={editData.interiorQuotationLogResponses}
columns={insideColumns}
loading={false}
pagination={null}
/>
}
</div>
)
}
export default FlowRecord
......@@ -51,7 +51,7 @@
:global {
.anticon-file-word {
color: #4279df;
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
......@@ -70,4 +70,11 @@
}
}
}
}
\ No newline at end of file
}
.searchColor {
:global {
.ant-input-group > .ant-input:first-child, .ant-input-group-addon:first-child {
color: @main-color,
}
}
}
import React, { useEffect } from 'react';
import styles from './index.less';
import { Form, Input, Row, Col, InputNumber } from 'antd';
interface queryProps {
currentRef?: any,
editData: any
}
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 24 },
labelAlign: "left"
};
const TradingConditions: React.FC<queryProps> = (props) => {
const { currentRef, editData } = props;
const [TradingConditionsForm] = Form.useForm();
const hadnleValidateFields = () => {
return new Promise((resolve) => {
TradingConditionsForm.validateFields().then(values => {
resolve({
state: true,
data: {
minimumOrder: values.minimumOrder,
deliveryInstructions: values.deliveryInstructions,
paymentType: values.paymentType,
taxes: values.taxes,
logistics: values.logistics,
packRequire: values.logistics,
otherRequire: values.logistics,
}
})
}).catch(errorInfo => {
console.log(errorInfo)
})
})
}
useEffect(() => {
if (currentRef) {
const userAction = {
validateFields: () => hadnleValidateFields()
}
if (currentRef && typeof currentRef === 'function') {
currentRef(userAction);
}
if (currentRef && typeof currentRef !== 'function') {
currentRef.current = userAction;
}
}
}, [])
useEffect(() => {
// 编辑时回显的数据
if(Object.keys(editData).length > 0) {
console.log(editData, 10086)
TradingConditionsForm.setFieldsValue({
paymentType: editData.paymentType,
taxes: editData.taxes,
logistics: editData.logistics,
packRequire: editData.packRequire,
otherRequire: editData.otherRequire,
deliveryInstructions: editData.deliveryInstructions,
minimumOrder: editData.minimumOrder
})
}
}, [editData])
return (
<Form
{...layout}
form={TradingConditionsForm}
className={styles.revise_style}
>
<Row gutter={70}>
<Col span={12}>
<Form.Item label='最小起订' name='minimumOrder' rules={[{ required: true, message: '请输入最小起订' }]}>
<InputNumber style={{ width: '100%' }} min={1} placeholder='请输入数量' />
</Form.Item>
<Form.Item label='交付说明' name='deliveryInstructions'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='付款说明' name='paymentType'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='税费说明' name='taxes'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='物流说明' name='logistics'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='包装说明' name='packRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label='其他说明' name='otherRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
</Row>
</Form>
)
}
export default TradingConditions
import React from 'react';
import AddQuoteForm from './addForm';
import {history} from 'umi';
const EditQuote: React.FC<{}> = () => {
import { history } from 'umi';
import { PublicApi } from '@/services/api';
const EditQuote = (props: any) => {
const { id } = history.location.query;
return(
return (
<AddQuoteForm
id={id}
type={2}
isEdit
title={props.route.name}
fetchRequest={PublicApi.postTransactionProductQuotationUpdate}
/>
)
}
......
import React from 'react';
import AddQuoteForm from './addForm';
import {history} from 'umi';
const Quote: React.FC<{}> = () => {
import { history } from 'umi';
import { PublicApi } from '@/services/api';
const Quote = (props: any) => {
const { id } = history.location.query;
return(
return (
<AddQuoteForm
id={id}
type={3}
isEdit
title={props.route.name}
fetchRequest={PublicApi.postTransactionProductQuotationAdd}
spam
/>
)
}
......
......@@ -65,14 +65,13 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
id && (params.id = id);
fetchRequest({ ...params }).then(res => {
if (res.code !== 1000) {
setLoading(false)
return
}
setUnsaved(false);
setLoading(false);
history.goBack();
})
}).finally(() => {
setLoading(false)
})
}
......
......@@ -18,19 +18,23 @@ const WaitAddInquiry = () => {
}
const [rowkeys, setRowKeys] = useState<any>([]);
console.log(rowkeys)
const [loading, setLoading] = useState<boolean>(false)
/** 批量审核 */
const fetchSubmitBatch = async (id?: number) => {
setLoading(true)
let res = null;
if (id) {
res = await PublicApi.postTransactionInquiryListSubmit({ id: Number(id) })
} else {
res = await PublicApi.postTransactionInquiryListSubmitAll({ ids: rowkeys });
}
if (res.code === 1000) {
reload.current.reload();
setRowKeys([])
if (res.code !== 1000) {
setLoading(false)
return
}
reload.current.reload();
setRowKeys([])
setLoading(false)
}
/**
......@@ -159,6 +163,7 @@ const WaitAddInquiry = () => {
新建
</Button>
<Button
loading={loading}
onClick={() => fetchSubmitBatch()}
disabled={rowkeys.length === 0}
>
......
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