Commit d959bffa authored by alwayOnlie's avatar alwayOnlie

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

parents 3d71db09 10a6ce93
......@@ -58,11 +58,11 @@ const memberCenterRoute = {
// ShopRoute,
// CommodityRoute,
// srm开发临时使用...
// ProcurementRoute,
ProcurementRoute,
// // 合同能力
// contracRoute,
//...
...asyncRoutes,
// ...asyncRoutes,
{
path: '/memberCenter/noAuth',
auth: false,
......
......@@ -64,6 +64,7 @@ const BidTable: React.FC<ReduxProps> = (props: any) => {
}
const bidDetailContext = useContext(BidDetailContext);
console.log(bidDetailContext, 10086)
const onChangeInput = (v, index, idx) => {
setAwardTaxProbability(v, index, idx)
......@@ -113,7 +114,7 @@ const BidTable: React.FC<ReduxProps> = (props: any) => {
))}
</Row>
{bidDetailContext.map((item: any, index: number) => (
<Row key={`row${index + 1}`} wrap={false} gutter={[0, 4]}>
<Row key={`row${index + 1}`} wrap={false} gutter={[0, 4]} style={{ backgroundColor: '#FFFFFF', marginBottom: '4px' }}>
<Col span={4}>
<div className={style.materialInfo}>
<span className={style.rankNumber}>{index + 1}</span>
......@@ -228,12 +229,12 @@ const BidTable: React.FC<ReduxProps> = (props: any) => {
))}
</Row>
))}
<Row wrap={false} gutter={[0, 4]}>
<Row wrap={false} gutter={[0, 4]} style={{ backgroundColor: '#FFFFFF' }}>
<Col span={4} />
<Col span={4} />
{bidDetailContext[0].company.map((it: any, idx: number) => (
<Col span={4} key={`company${idx + 1}`}>
<div className={style.throwBidInfo}>
<div className={style.throwBidInfo} style={{ height: 'auto', paddingBottom: '0' }}>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>报价小计:</p></Col>
......@@ -252,7 +253,16 @@ const BidTable: React.FC<ReduxProps> = (props: any) => {
<Col><p>{it.minimum}</p></Col>
</Row>
</div>
<Divider dashed={true} style={{ margin: 0, marginBottom: 8 }} />
</div>
</Col>
))}
</Row>
<Row wrap={false} gutter={[0, 4]} style={{ backgroundColor: '#FFFFFF', borderTop: '1px dashed #F4F5F7' }}>
<Col span={4} />
<Col span={4} />
{bidDetailContext[0].company.map((it: any, idx: number) => (
<Col span={4} key={`company${idx + 1}`}>
<div className={style.throwBidInfo} style={{ height: 'auto', paddingTop: '5px' }}>
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>授标数量:</p></Col>
......
......@@ -150,7 +150,9 @@ const ContrastLyout: React.FC<ContrastProps> = (props: any) => {
}
companyArr.push(cItem)
})
item.company = companyArr;
/** 排名排序 */
const companySort = companyArr.sort((a, b) => a.ranking - b.ranking)
item.company = companySort;
params.push(item);
})
setDataSource(params);
......
import React, { useContext } from 'react';
import { Row, Col, Image, Table, Tooltip } from 'antd';
import { Row, Col, Image, Table, Tooltip, Switch, Typography } from 'antd';
import Card from '../../../card';
import { Context } from '../context';
import style from './index.less';
......@@ -63,6 +63,12 @@ const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
title: '是否归属会员',
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (text: any) => (
<>
{Number(text) === 1 && <Typography.Text type='success'></Typography.Text>}
{Number(text) === 0 && <Typography.Text type='warning'></Typography.Text>}
</>
)
},
{
title: (
......@@ -81,11 +87,19 @@ const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
),
key: 'state',
dataIndex: 'state',
render: (text: any) => (
<Switch checked={text} disabled={true} />
)
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (_text: any, _record: any) => (
<Typography.Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank">
进入店铺
</Typography.Link>
)
},
]
......
import React, { useRef } from 'react';
import React, { useRef, useState } from 'react';
import { StandardTable } from 'god';
import Card from '../../../card';
import EyePreview from '@/components/EyePreview';
import DetailDrawer from '../../../detailDrawer';
export interface IPROPS {
id?: number,
......@@ -11,7 +12,64 @@ export interface IPROPS {
const MaterialLayout: React.FC<IPROPS> = (props: any) => {
const { id, number, fetch } = props;
const [visible, setVisible] = useState<boolean>(false)
const currentRef = useRef({});
const [dataSource, setDataSource] = useState<any>([])
const handleClick = (item: any) => {
setDataSource([
{
linkTitle: '基本信息',
linkContent: [
{
label: '物料编号',
content: item.number
},
{
label: '物料名称',
content: item.name
},
{
label: '规格型号',
content: item.model
},
{
label: '品类',
content: item.category
},
{
label: '品牌',
content: item.brand
},
]
},
{
linkTitle: '采购数量',
linkContent: [
{
label: '单位',
content: item.unit
},
{
label: '采购数量',
content: item.purchaseCount
},
]
},
{
linkTitle: '附件',
linkContent: [
{
label: '附件',
file: item.urls ? true : false,
content: item.urls
},
]
}
])
setVisible(true);
}
const columns = [
{
title: '物料编号',
......@@ -22,7 +80,7 @@ const MaterialLayout: React.FC<IPROPS> = (props: any) => {
title: '物料名称',
key: 'name',
dataIndex: 'name',
render: (text: any, record: any) => <EyePreview type='button'>{text}</EyePreview>
render: (text: any, record: any) => <EyePreview type='button' handleClick={() => handleClick(record)}>{text}</EyePreview>
},
{
title: '规格型号',
......@@ -53,7 +111,7 @@ const MaterialLayout: React.FC<IPROPS> = (props: any) => {
const productlist = (params: any) => {
return new Promise(resolve => {
fetch({id, number, ...params}).then((res: any) => {
fetch({ id, number, ...params }).then((res: any) => {
resolve(res.data)
})
})
......@@ -70,6 +128,12 @@ const MaterialLayout: React.FC<IPROPS> = (props: any) => {
tableProps={{ rowKew: 'id' }}
fetchTableData={(params: any) => productlist(params)}
/>
<DetailDrawer
title='物料信息'
visible={visible}
dataSource={dataSource}
onCalcel={() => setVisible(false)}
/>
</Card>
)
}
......
......@@ -76,4 +76,77 @@
}
}
}
.revise_style {
:global {
.ant-form-item-label {
width: 174px;
label {
color:#6B778C
}
}
.ant-form-item-control {
width: 500px;
.ant-form-item-control-input-content {
position: relative;
.ant-btn-link {
position: absolute;
right: -120px;
}
.ant-picker {
width: 100%;
}
}
.ant-input-group-addon {
.ant-input-search-button {
background-color: #6B778C;
border-color: #6B778C;
}
}
}
.ant-radio-group-solid {
.ant-radio-button-wrapper-checked {
background: #6B778C;
border-color: #6B778C;
&:hover {
background: #6B778C;
border-color: #6B778C;
}
}
}
}
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
......@@ -8,12 +8,15 @@ import {
Form,
Divider,
Typography,
Upload,
message
} from 'antd';
import cx from 'classnames'
import style from './index.less';
import { PlusSquareOutlined } from '@ant-design/icons';
import { DeleteOutlined, LinkOutlined, PlusSquareOutlined, UploadOutlined } from '@ant-design/icons';
import SelectProduct from './selectProduct';
import { PublicApi } from '@/services/api';
import { UPLOAD_TYPE } from '@/constants'
const { Sider, Content } = Layout;
const { Text } = Typography;
......@@ -43,6 +46,8 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
const [flag, setFlag] = useState<boolean>(false);
const [product, setProduct] = useState<any>({});
const [attribute, setAttribute] = useState<any>([]);
const [files, setFiles] = useState([]);
const [loading, setloading] = useState(false);
const handleAnchorClick = (e) => {
e.preventDefault()
};
......@@ -75,6 +80,32 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
attribute
})
}
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
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])
}
return (
<>
<Drawer
......@@ -273,6 +304,35 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
</>
}
/>
<Form.Item
label='附件'
name='upload'
>
<div className={style.upload_data}>
{files.length > 0 && files.map((v, index) => (
<div key={index} className={style.upload_item}>
<div className={style.upload_left}>
<LinkOutlined />
<span>{v.name}</span>
</div>
<div className={style.upload_right}>
<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>
</div>
</Form>
</Content>
......
......@@ -39,6 +39,40 @@
}
}
}
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
.box {
width: 100%;
......
......@@ -6,6 +6,7 @@ import Basic from './components/basic';
import Material from './components/material';
import Condition from './components/condition';
import Demand from './components/demand';
import File from './components/file';
import ReutrnEle from '@/components/ReturnEle';
import {
PostPurchasePurchaseInquiryAddRequest,
......@@ -34,6 +35,8 @@ const AddForm = () => {
const [condition, setCondition] = useState<any>({});
/** 需求对接 */
const [demand, setDemand] = useState<any>({});
/** 附件 */
const [file, setfile] = useState<any>([]);
const [badge, setbadge] = useState<any>([0, 0, 0, 0]);
const [loading, setLoading] = useState<boolean>(false);
......@@ -42,6 +45,7 @@ const AddForm = () => {
const currentMaterial = useRef<any>({});
const currentCondition = useRef<any>({});
const currentDemand = useRef<any>({});
const currentFile = useRef<any>({});
/** 提交&修改 */
const handleSubmit = async () => {
......@@ -50,7 +54,8 @@ const AddForm = () => {
const materialRef = await currentMaterial.current.get();
const conditionRef = await currentCondition.current.get();
const demandRef = await currentDemand.current.get();
if (basicRef.state && materialRef.state && conditionRef.state && demandRef.state) {
const fileRef = await currentFile.current.get();
if (basicRef.state && materialRef.state && conditionRef.state && demandRef.state && fileRef.state) {
const params: PostPurchasePurchaseInquiryAddRequest = {
memberId,
memberRoleId,
......@@ -62,6 +67,7 @@ const AddForm = () => {
...materialRef.data,
...conditionRef.data,
...demandRef.data,
transactionUurls: fileRef.data,
}
let res: {
code: number,
......@@ -187,6 +193,12 @@ const AddForm = () => {
onBadge={getError}
/>
</TabPane>
<TabPane key='5' tab='附件' forceRender>
<File
fetchdata={file}
currentRef={currentFile}
/>
</TabPane>
</Tabs>
</Card>
</PageHeaderWrapper>
......
......@@ -194,10 +194,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
}, [])
useEffect(() => {
if (Object.keys(fetchdata).length > 0) {
if (flag) {
setrequisitionFormAddress([...fetchdata.areas]);
flag = false;
}
setrequisitionFormAddress([...fetchdata.areas]);
fetchdata.areas.forEach((item: any, index: number) => {
PublicApi.getManageAreaByPcodeAll({ pcode: item.provinceCode }).then((res: any) => {
if (res.code === 1000) {
......@@ -205,14 +202,18 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
citydata: res.data
}
city[index] = { ...citydata }
setcity([...city])
setcode([...code, item.cityCode])
form.setFieldsValue({
details: fetchdata.details,
purchaseType: fetchdata.purchaseType,
priceContrast: fetchdata.priceContrast,
['province_' + index]: item.provinceCode,
['city_' + index]: item.cityCode,
Promise.resolve().then(() => {
setTimeout(() => {
setcity([...city])
setcode([...code, item.cityCode])
form.setFieldsValue({
details: fetchdata.details,
purchaseType: fetchdata.purchaseType,
priceContrast: fetchdata.priceContrast,
['province_' + index]: item.provinceCode,
['city_' + index]: item.cityCode,
});
}, 350);
});
}
})
......
import React, { useState, useEffect } from 'react';
import { Form, Button, Upload, message } from 'antd';
import { UPLOAD_TYPE } from '@/constants'
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 IProps {
fetchdata: any,
currentRef: any
}
const File: React.FC<IProps> = (props) => {
const { fetchdata, currentRef } = props;
const [form] = Form.useForm();
const [files, setFiles] = useState([]);
const [loading, setloading] = useState(false);
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
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])
}
// 删除附件
const removeFiles = (index: any) => {
const arr = [...files];
arr.splice(index, 1);
setFiles(arr);
}
// useEffect(() => {
// if (Object.keys(editData).length > 0) {
// setFiles(editData.enclosureUrls)
// }
// }, [editData])
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
form.validateFields().then(res => {
resolve({
state: true,
name: 'explain',
data: files,
})
}).catch(error => {
if (error && error.errorFields) {
}
})
})
}
})
return (
<Form
form={form}
{...layout}
className={styles.revise_style}
>
<Form.Item label='附件' name='upload'>
<div className={styles.upload_data}>
{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 File;
......@@ -31,3 +31,76 @@
}
}
}
.revise_style {
:global {
.ant-form-item-label {
width: 174px;
label {
color:#6B778C
}
}
.ant-form-item-control {
width: 500px;
.ant-form-item-control-input-content {
position: relative;
.ant-btn-link {
position: absolute;
right: -120px;
}
.ant-picker {
width: 100%;
}
}
.ant-input-group-addon {
.ant-input-search-button {
background-color: #6B778C;
border-color: #6B778C;
}
}
}
.ant-radio-group-solid {
.ant-radio-button-wrapper-checked {
background: #6B778C;
border-color: #6B778C;
&:hover {
background: #6B778C;
border-color: #6B778C;
}
}
}
}
.upload_item {
padding: 5px 8px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FAFBFC;
.upload_left {
display: flex;
align-items: center;
color: #303133;
:global {
.anticon-file-word {
color: #4279df;
font-size: 20px;
margin-right: 8px;
}
}
}
.upload_right {
color: #00B37A;
cursor: pointer;
:global {
.anticon-delete {
margin-left: 19px;
color: #C0C4CC;
}
}
}
}
}
......@@ -54,7 +54,6 @@ const DemandDetailed = () => {
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [conditionEffect, setConditionEffect] = useState<any>([]);
const [areas, setAreas] = useState<any>([]);
const [storeList, setStoreList] = useState<Array<any>>([]);
const handleBasicEffect = (data: any) => {
setBasicEffect([
......@@ -91,8 +90,8 @@ const DemandDetailed = () => {
{
label: '适用地市', extra: (
<div>
{areas.map((item: any, index: number) => (
<p key={`areas${index + 1}`}>{item}</p>
{data.areas.map((it: any, idx: number) => (
<p key={`areas${idx + 1}`}>{`${it.province}/${it.city}`}</p>
))}
</div>
)
......@@ -144,13 +143,6 @@ const DemandDetailed = () => {
return;
}
const { data } = res;
const areas: string[] = [];
if (data.areas) {
data.areas.forEach(item => {
areas.push(`${item.province}/${item.city}`)
})
setAreas(areas);
}
if (data.shopIds) {
const ids = data.shopIds;
const filterStore = shopList.filter(item => ids.indexOf(item.id) !== -1);
......
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