Commit c5714a56 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

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

parents 9c84a1f3 27c5c89c
......@@ -17,35 +17,83 @@ export const offterRoute = [
component: '@/pages/transaction/purchaseAbility/offter/inquiry'
},
{
// 采购需求单详情
path: '/memberCenter/procurementAbility/offter/inquiry/preview',
name: '采购需求单详情',
component: '@/pages/transaction/purchaseAbility/offter/demand',
hideInMenu: true,
noMargin: true,
},
{
// 报价单查询
path: '/memberCenter/procurementAbility/offter/offter',
name: '报价单查询',
component: '@/pages/transaction/purchaseAbility/offter/offter'
},
{
// 采购需求单详情
path: '/memberCenter/procurementAbility/offter/offter/preview',
name: '采购需求单详情',
component: '@/pages/transaction/purchaseAbility/offter/demand',
hideInMenu: true,
noMargin: true,
},
{
// 待新增报价单
path: '/memberCenter/procurementAbility/offter/addOffter',
name: '待新增报价单',
component: '@/pages/transaction/purchaseAbility/offter/addOffter'
},
{
// 采购需求单详情
path: '/memberCenter/procurementAbility/offter/addOffter/preview',
name: '采购需求单详情',
component: '@/pages/transaction/purchaseAbility/offter/demand',
hideInMenu: true,
noMargin: true,
},
{
// 待审核报价单(一级)
path: '/memberCenter/procurementAbility/offter/auditOffterOne',
name: '待审核报价单(一级)',
component: '@/pages/transaction/purchaseAbility/offter/auditOffterOne'
},
{
// 采购需求单详情
path: '/memberCenter/procurementAbility/offter/auditOffterOne/preview',
name: '采购需求单详情',
component: '@/pages/transaction/purchaseAbility/offter/demand',
hideInMenu: true,
noMargin: true,
},
{
// 待审核报价单(二级)
path: '/memberCenter/procurementAbility/offter/auditOffterTwo',
name: '待审核报价单(二级)',
component: '@/pages/transaction/purchaseAbility/offter/auditOffterTwo'
},
{
// 采购需求单详情
path: '/memberCenter/procurementAbility/offter/auditOffterTwo/preview',
name: '采购需求单详情',
component: '@/pages/transaction/purchaseAbility/offter/demand',
hideInMenu: true,
noMargin: true,
},
{
// 待提交报价单
path: '/memberCenter/procurementAbility/offter/submitOffter',
name: '待提交报价单',
component: '@/pages/transaction/purchaseAbility/offter/submitOffter'
},
{
// 采购需求单详情
path: '/memberCenter/procurementAbility/offter/submitOffter/preview',
name: '采购需求单详情',
component: '@/pages/transaction/purchaseAbility/offter/demand',
hideInMenu: true,
noMargin: true,
},
]
},
]
......@@ -42,7 +42,7 @@ export const purchaseInquiryRoute = [
// 新增采购需求单
path: '/memberCenter/procurementAbility/purchaseInquiry/add',
name: '新增采购需求单',
component: '@/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/addForm',
component: '@/pages/transaction/purchaseAbility/purchaseInquiry/addInquiry/add',
hideInMenu: true,
},
{
......
......@@ -9,7 +9,7 @@ const { Step } = Steps;
const activeAnchorClassName = 'ant-anchor-link-active'
const Detail = () => {
const Detail = (props:any) => {
const ref = useRef({});
const [currLink, setCurrLink] = useState(activeAnchorClassName)
const [tabPane] = useState([
......
......@@ -36,7 +36,9 @@ const AddOffter = () => {
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<>
<EyePreview url={`/1`}>{text}</EyePreview>
<EyePreview
url={`/memberCenter/procurementAbility/offter/addOffter/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview>
<div>{record.memberName}</div>
</>
)
......
......@@ -32,7 +32,9 @@ const AuditOffterOne = () => {
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<>
<EyePreview url={`/1`}>{text}</EyePreview>
<EyePreview
url={`/memberCenter/procurementAbility/offter/auditOffterOne/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview>
<div>{record.memberName}</div>
</>
)
......
......@@ -33,7 +33,9 @@ const AuditOffterTwo = () => {
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<>
<EyePreview url={`/1`}>{text}</EyePreview>
<EyePreview
url={`/memberCenter/procurementAbility/offter/auditOffterTwo/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview>
<div>{record.memberName}</div>
</>
)
......
......@@ -55,7 +55,7 @@ const Detail: React.FC<{}> = () => {
current: '1',
pageSize: '1',
}
PublicApi.getPurchasePurchaseInquiryDetails(parmas).then(res => {
PublicApi.getPurchaseQuotedPricePurchaseInquiryDetails(parmas).then(res => {
if (res.code === 1000) {
setData(res.data)
}
......
......@@ -33,7 +33,9 @@ const Offter = () => {
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<>
<EyePreview url={`/1`}>{text}</EyePreview>
<EyePreview
url={`/memberCenter/procurementAbility/offter/offter/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview>
<div>{record.memberName}</div>
</>
)
......
......@@ -33,7 +33,9 @@ const SubmitOffter = () => {
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<>
<EyePreview url={`/1`}>{text}</EyePreview>
<EyePreview
url={`/memberCenter/procurementAbility/offter/submitOffter/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview>
<div>{record.memberName}</div>
</>
)
......
import React from 'react';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Tabs, Card, Form } from 'antd';
import Basic from './components/basic';
const { TabPane } = Tabs;
const AddForm = () => {
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
>
<Card>
<Form>
<Tabs type='card'>
{/* 基本信息 */}
<TabPane key='1' tab='基本信息'>
<Basic />
</TabPane>
{/* 添加采购物料 */}
<TabPane key='2' tab='添加采购物料'></TabPane>
{/* 交易条件 */}
<TabPane key='3' tab='交易条件'></TabPane>
{/* 需求对接 */}
<TabPane key='4' tab='需求对接'></TabPane>
</Tabs>
</Form>
</Card>
</PageHeaderWrapper>
)
}
export default AddForm
import React, { useState, useRef, useEffect } from 'react';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle'
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Button, Card, Tabs, Badge } from 'antd';
import BasicInfo from './components/basicInfo';
import TradingConditions from './components/tradingConditions'
import FlowRecord from './components/flowRecord';
import AddGoods from './components/addGoods';
import DemandDbutted from './components/demandDbutted';
import { PublicApi } from '@/services/api';
const { TabPane } = Tabs;
const TabFormErrors = (props) => {
return (
<Badge size="small" count={props.dot} offset={[6, -5]}>
{props.children}
</Badge>
)
}
const AddDemandOrder: React.FC<{}> = () => {
const { id } = history.location.query;
const [fetchdata, setfetchdata] = useState<any>({});
const [goodsInfo, setGoodsInfo] = useState<any>({}); /**0选择系统所需要的参数 */
const [attribute, setattribute] = useState<Array<any>>([]);
const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]);
const [badge, setbadge] = useState<any>([0, 0, 0, 0]);
// useEffect(() => {
// const external = new Promise(resolve => {
// //查询需求单外部状态枚举列表
// PublicApi.getOrderRequisitionFormExternalStateEnum().then((res: any) => {
// if (res.code === 1000) {
// resolve(res.data)
// }
// })
// })
// const interior = new Promise(resolve => {
// // 查询需求单内部状态枚举列表
// PublicApi.getOrderRequisitionFormInteriorStateEnum().then((res: any) => {
// if (res.code === 1000) {
// resolve(res.data)
// }
// })
// })
// Promise.all([external, interior]).then(res => {
// setExternalState(res[0])
// setInteriorState(res[1])
// })
// }, [])
const basic = useRef<any>();
const goods = useRef<any>();
const trading = useRef<any>();
const dbutted = useRef<any>();
/**get子组件的数据 */
/**提交数据 */
const onSubmit = async () => {
const basicRef = await basic.current.get();
const goodsRef = await goods.current.get();
const tradingRef = await trading.current.get();
const dbuttedRef = await dbutted.current.get();
if (basicRef.state && tradingRef.state && goodsRef.state && dbuttedRef.state) {
const data = {
...basicRef.data,
...tradingRef.data,
...goodsRef.data,
...dbuttedRef.data
}
if (basicRef.data.requisitionFormAddress.length > 0) {
data.defaultAddres = 0
} else {
data.defaultAddres = 1
}
if (id) {
data.id = fetchdata.id;
PublicApi.postOrderRequisitionFormUpdate(data).then(res => {
if (res.code === 1000) {
history.goBack()
}
})
} else {
PublicApi.postOrderRequisitionFormAdd(data).then(res => {
if (res.code === 1000) {
history.goBack()
}
})
}
}
}
useEffect(() => {
if (id) {
new Promise(resolve => {
PublicApi.getOrderRequisitionFormDetails({ id, current: '1', pageSize: '10' }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
}).then((res: any) => {
setfetchdata(res)
})
}
}, [id])
/**获取所有地址 */
const getAreaCode = (record: any) => {
setGoodsInfo({ ...goodsInfo, record })
}
/**获取添加的商品品类id */
const getCategoryIds = (data: any, index: number, record?: any) => {
if (index === 1) {
const categoryIds: Array<any>[] = []
data.forEach((item: any) => {
categoryIds.push(...item.ids)
})
setGoodsInfo({ ...goodsInfo, categoryIds })
if (record) {
setattribute([...attribute, ...record])
}
} else if(index === 2) {
console.log(data, 10086)
}
}
/**必填没填写出现角标 */
const getError = (num: number, idx: number) => {
const data = [...badge];
data[idx] = num;
setbadge(data);
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
extra={
<Button type="primary" onClick={onSubmit}> 保存</Button>
}
>
<Card>
<Tabs type='card'>
<TabPane forceRender tab={<TabFormErrors dot={badge[0]}>基本信息</TabFormErrors>} key='1'>
<BasicInfo
set={fetchdata}
onBadge={getError}
onGet={getAreaCode}
currentRef={basic}
externalState={externalState}
interiorState={interiorState}
/>
</TabPane>
<TabPane forceRender tab={<TabFormErrors dot={badge[1]}>添加商品</TabFormErrors>} key='2'>
<AddGoods
set={fetchdata}
onBadge={getError}
onGet={getCategoryIds}
currentRef={goods}
/>
</TabPane>
<TabPane forceRender tab={<TabFormErrors dot={badge[2]}>交易条件</TabFormErrors>} key='3'>
<TradingConditions
set={fetchdata}
onBadge={getError}
currentRef={trading}
/>
</TabPane>
<TabPane forceRender tab={<TabFormErrors dot={badge[3]}>需求对接</TabFormErrors>} key='4'>
<DemandDbutted
set={fetchdata}
onBadge={getError}
goodsInfo={goodsInfo}
attribute={attribute}
currentRef={dbutted}
/>
</TabPane>
<TabPane forceRender tab='流转记录' key='5'>
<FlowRecord
set={fetchdata}
externalState={externalState}
interiorState={interiorState}
/>
</TabPane>
</Tabs>
</Card>
</PageHeaderWrapper>
)
}
export default AddDemandOrder;
import React, { useState, ReactNode, useEffect } from 'react';
import { Form, Radio, Button, Table } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import ModalAnchor from './Modal/modalAnchor';
import ModalGoods from './Modal/modalGoods';
import { PlusOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
};
export interface faceSetData {
set?: any,
onGet?: Function,
currentRef: any,
onBadge?: Function
}
const AddGoods: React.FC<faceSetData> = (props) => {
const { set, currentRef, onGet, onBadge } = props
const [form] = Form.useForm();
const [addMode, setaddMode] = useState<number>(0);
const btnname: Array<string> = ['添加商品', '选择货品', '导入货品']
const [visible, setvisible] = useState<Array<boolean>>([false, false, false, false]);
const [tabledata, settabledata] = useState<any>([]);
/**存放编辑的商品数据 */
const [editdata, seteditdata] = useState<any>({});
/**是否编辑 */
const [isEdit, setisEdit] = useState<boolean>(false);
/**编辑的下标 */
const [idx, setidx] = useState<number>(-1);
/** 平台属性添加表头 */
const columns: ColumnType<Object>[] = [
{
title: '商品编号',
key: 'goodsNo',
dataIndex: 'goodsNo',
},
{
title: '商品名称',
key: 'name',
dataIndex: 'name',
},
{
title: '规格型号',
key: 'model',
dataIndex: 'model',
},
{
title: '品类',
key: 'category',
dataIndex: 'category',
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
},
{
title: '采购数量',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
},
{
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any, index: number) =>
<>
<Button type='link' onClick={() => handleEdit(record, index)}>编辑</Button>
<Button type='link' onClick={() => handleDel(record, index)}>删除</Button>
</>
}
]
/** 切换添加方式 */
const changeRadio = (e: any) => {
const { value } = e.target;
setaddMode(value);
settabledata([]);
}
/** 按钮的文字 */
const handleText = (num: any) => {
let text: ReactNode = null;
text = btnname[num - 1];
return text
}
/**
* @name: 操作弹窗
* @arg: 1.通过平台属性添加 2.选择货品添加 3.导入货品生成
* */
const handleModal = (arg: number) => {
visible[arg] = !visible[arg]
setvisible([...visible])
}
/** 商品添加确定 */
const handleSubmit = (data: any, record?: any) => {
if (idx === -1) {
settabledata([...tabledata, data])
onGet([...tabledata, data], 1, record)
} else {
const newdata = [...tabledata]
newdata[idx] = data
settabledata([...newdata]);
setidx(-1);
onGet([...tabledata, data], 2)
}
handleModal(addMode);
}
/** 编辑商品 */
const handleEdit = (record: any, index: number) => {
setidx(index);
seteditdata(record)
setisEdit(true)
handleModal(addMode)
}
/** 删除商品 */
const handleDel = (record: any, index: number) => {
const list = [...tabledata];
list.splice(index, 1);
settabledata(list)
}
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
form.validateFields().then(res => {
resolve({
state: true,
name: 'addGoods',
data: {
addMode,
requisitionFormProducts: tabledata,
}
})
onBadge(0, 1)
}).catch(error => {
if (error && error.errorFields) {
onBadge(error.errorFields.length, 1)
}
})
})
}
}, [tabledata])
useEffect(() => {
/**编辑回显数据 */
if (Object.keys(set).length > 0) {
form.setFieldsValue({
addMode: set.addMode
})
setaddMode(set.addMode)
settabledata(set.requisitionFormProducts)
}
}, [set])
return (
<Form
{...layout}
form={form}
>
<Form.Item label='添加方式' name='addMode' rules={[{ required: true, message: '请选择添加方式' }]}>
<Radio.Group onChange={changeRadio}>
{/* <Radio value={1}>通过平台属性添加</Radio> */}
<Radio value={2}>选择货品添加</Radio>
<Radio value={3}>导入货品生成</Radio>
</Radio.Group>
</Form.Item>
{addMode > 0 &&
<Form.Item noStyle>
<Button onClick={() => { handleModal(addMode); setisEdit(false) }} type='dashed' block style={{ marginBottom: '24px' }}><PlusOutlined />{handleText(addMode)}</Button>
<Table columns={columns} dataSource={tabledata} rowKey={(record: any, index: number) => record.id ? record.id : index} />
</Form.Item>
}
<ModalAnchor
fetchdata={editdata}
isEdit={isEdit}
visible={visible[1]}
onOk={handleSubmit}
onCancel={() => handleModal(addMode)}
/>
<ModalGoods
fetchdata={editdata}
isEdit={isEdit}
visible={visible[2]}
onOk={handleSubmit}
onCancel={() => handleModal(addMode)}
/>
</Form>
)
}
export default AddGoods;
import React from 'react';
import { Form, Input, Select, Tooltip, Row, Col } from 'antd';
import style from './index.less';
import { QuestionCircleOutlined } from '@ant-design/icons';
const { Option } = Select;
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
}
const iconStyle: any = {
color: '#C0C4CC',
fontSize: '20px',
position: 'absolute',
right: '-30px',
top: '6px',
}
const PURCHASETYPE = [
{
type: 1,
name: '单次采购'
},
{
type: 2,
name: '协议采购'
}
]
const PRICECONTRAST = [
{
type: 1,
name: '密封比价'
},
{
type: 2,
name: '非密封比价'
},
]
const BasicInfo = () => {
return (
<Form
{...layout}
className={style.form}
>
<Form.Item
label='需求摘要'
name='details'
rules={[{ required: true, message: '请输入需求单摘要' }]}
>
<Input />
</Form.Item>
<Form.Item
label='采购类型'
required
>
<Form.Item
name='purchaseType'
noStyle
rules={[{ required: true, message: '请选择采购类型' }]}
>
<Select>
{PURCHASETYPE.map(item => (
<Option key={item.type} value={item.type}>{item.name}</Option>
))}
</Select>
</Form.Item>
<Tooltip placement="top" title='有固定采购金额:采购金额固定,合同期内不可超过采购金额,无固定采购金额:采购金额不固定,可在合同期内按需采购'>
<QuestionCircleOutlined style={iconStyle} />
</Tooltip>
</Form.Item>
<Form.Item
label='比价方式'
required
>
<Form.Item
name='priceContrast'
noStyle
rules={[{ required: true, message: '请选择比价方式' }]}
>
<Select>
{PRICECONTRAST.map(item => (
<Option key={item.type} value={item.type}>{item.name}</Option>
))}
</Select>
</Form.Item>
<Tooltip placement="top" title='密封比价:只能看到供应商是否有报价,不能看到供应商的报价明细,只能解封后才能看到报价明细,非密封比价:可以在供应商报完价后立即看到报价明细,无须解封'>
<QuestionCircleOutlined style={iconStyle} />
</Tooltip>
</Form.Item>
<Form.Item
label={<Tooltip placement="right" title='设置了归属地市后,此商品可根据地市进行筛选,未设置时默认为所有地市'>适用地市<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
>
<Row gutter={10}>
<Col span={12}>1</Col>
<Col span={12}>2</Col>
</Row>
</Form.Item>
</Form>
)
}
export default BasicInfo
import React, { useEffect, useRef, useState } from 'react';
import { Form, Radio, Tooltip, Row, Col, Checkbox, Avatar, Space, Button, Table, message } from 'antd';
import { QuestionCircleOutlined, PlusOutlined } from '@ant-design/icons';
import style from './index.less';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api';
import ModalTable from '@/components/ModalTable';
import { ISchema } from '@formily/antd';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
};
export interface faceSetData {
set?: any,
get?: Function,
goodsInfo?: any,
attribute?:any,
currentRef?: any,
onBadge?: Function
}
const DemandDbutted: React.FC<faceSetData> = (props) => {
const { set, get, currentRef, goodsInfo, attribute, onBadge } = props;
const [form] = Form.useForm();
const [type, setType] = useState<Number>(0);
const ref = useRef<any>({});
const [visible, setvisible] = useState<boolean>(false);
const [memberRowSelection, memberRowCtl] = useRowSelectionTable({ customKey: 'memberId' });
const [memberIds, setmemberIds] = useState<Array<any>>([])
const [memberList, setmemberList] = useState([]);
const [goodAllIds, setgoodAllIds] = useState<Array<any>>([]);
// 系统匹配表头
const columns: ColumnType<any>[] = [
{
title: '序号',
key: 'memberId',
dataIndex: 'memberId',
},
{
title: '会员名称',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '会员类型',
key: 'memberTypeName',
dataIndex: 'memberTypeName',
},
{
title: '会员角色',
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '会员等级',
key: 'levelTag',
dataIndex: 'levelTag',
},
{
title: '是否归属会员',
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
},
{
title: '状态',
key: 'state',
dataIndex: 'state',
},
]
// 指定会员表头
const memberColumns: ColumnType<any>[] = [
{
title: '序号',
key: 'memberId',
dataIndex: 'memberId',
},
{
title: '会员名称',
key: 'name',
dataIndex: 'name',
},
{
title: '会员类型',
key: 'memberTypeName',
dataIndex: 'memberTypeName',
},
{
title: '会员角色',
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '会员等级',
key: 'levelTag',
dataIndex: 'levelTag',
}
]
// 选择系统匹配的列表数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<any>>([]);
const rowSelection = {
selectedRowKeys,
onChange: setSelectedRowKeys
};
// 切换添加方式
const changeRadio = (e: any) => {
const { value } = e.target;
if(value === 1) {
let shopList = GlobalConfig.web.shopInfo.filter(v => v.type == 1).map(
v => v
)
setgoodAllIds(shopList)
setType(value)
}
setType(value)
}
// 请求系统匹配列表数据
const fetchSystemMateData = (params: any, index: number) => {
if (index === 1) {
// console.log(params, index)
} else if (index === 2) {
return new Promise(resolve => {
PublicApi.postOrderSystemMatchingMemberInitializeList({ categoryIds: goodsInfo.categoryIds, areaRequestList: goodsInfo.record, attributeList: attribute, ...params }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
} else {
return new Promise(resolve => {
PublicApi.getMemberManageUpperProviderPage({ ...params }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
}
const formSearch: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
}
}
}
const onConfirm = () => {
const demandDockings: any[] =[];
memberRowCtl.selectRow.forEach((v) => {
demandDockings.push({
memberId: v.memberId,
memberName: v.name,
memberTypeName: v.memberTypeName,
roleId: v.roleId,
roleName: v.roleName,
levelTag: v.levelTag,
type
})
})
setvisible(false);
setmemberIds(memberRowCtl.selectedRowKeys)
setmemberList(demandDockings)
}
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
form.validateFields().then(res => {
let buttedObj: any = {}
if(type === 1) {
buttedObj = {
shopIds: res.shopIds,
}
} else if (type === 2) {
buttedObj = {}
} else {
buttedObj = {
memberIds,
demandDockings: memberList
}
}
console.log(buttedObj)
resolve({
state: true,
name: 'demandDbutted',
data: {
type,
...buttedObj
}
})
onBadge(0, 3)
}).catch(error => {
if (error && error.errorFields) {
onBadge(error.errorFields.length, 3)
}
})
})
}
console.log(attribute.length)
},[type, memberIds, memberList])
/** 数据回显 */
useEffect(() => {
if (Object.keys(set).length > 0) {
if(set.type === 1) {
form.setFieldsValue({
type: set.type,
shopIds: set.shopIds
})
let shopList = GlobalConfig.web.shopInfo.filter(v => v.type == 1).map(
v => v
)
setgoodAllIds(shopList)
} else if(type === 3) {
PublicApi.getOrderRequisitionFormProductAll({id: set.id, current: '1', pageSize: '100'}).then(res => {
if(res.code === 1000) {
setmemberList(res.data);
}
})
}
setType(set.type)
}
}, [set])
return (
<Form
{...layout}
form={form}
>
<Form.Item label='添加方式' required name='type'>
<Radio.Group onChange={changeRadio}>
<Radio value={1}><Tooltip placement="topLeft" title={<>需求发布至企业商城求购频道</>}>发布类型<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip></Radio>
<Radio value={2} disabled={attribute.length === 0}><Tooltip placement="topLeft" title={<>系统通过需求单品类、商品属性、适用地市与平台会员发布的商品品类、商品属性、归属地区进行匹配,推荐满足条件的平台会员</>}>系统匹配<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip></Radio>
<Radio value={3}><Tooltip placement="topLeft" title={<>选择与当前会员有归属关系的会员且角色类型为服务提供的会员(供应商),需求只发送给指定会员</>}>指定会员<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip></Radio>
</Radio.Group>
</Form.Item>
{type === 1 &&
// 发布至平台
<Form.Item label='发布至平台' name='shopIds' wrapperCol={{ span: 24 }}>
<Checkbox.Group className={style.checkbox_wrap_style} onChange={(e) => fetchSystemMateData(e, 1)}>
<Row>
{
goodAllIds.map((v: any, i: number) => {
return (
<Col span={6} key={`col_${i}`}>
<Checkbox value={v.id}>
<Space>
<Avatar src={v.logoUrl}>LOGO</Avatar>
<span>{v.name}</span>
</Space>
</Checkbox>
</Col>
)
})
}
</Row>
</Checkbox.Group>
</Form.Item>
}
{
type === 2 &&
// 系统匹配
<Form.Item noStyle>
<StandardTable
rowSelection={rowSelection}
columns={columns}
fetchTableData={(params) => fetchSystemMateData(params, 2)}
/>
</Form.Item>
}
{
type === 3 &&
// 指定会员
<Form.Item noStyle>
<Button type='dashed' block style={{ marginBottom: '24px' }} onClick={() => setvisible(true)}><PlusOutlined />选择会员</Button>
<Table columns={columns} dataSource={memberList} rowKey={record => record.memberId} />
</Form.Item>
}
<ModalTable
modalTitle='选择会员'
confirm={onConfirm}
cancel={() => setvisible(false)}
visible={visible}
forceRender={true}
columns={memberColumns}
rowSelection={memberRowSelection}
fetchTableData={(params) => fetchSystemMateData(params, 3)}
formilyProps={
{
ctx: { schema: formSearch }
}
}
tableProps={{
rowKey: 'memberId'
}}
/>
</Form>
)
}
export default DemandDbutted;
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Radio } from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import GeneralExternalState from '@/pages/transaction/common/externalState';
import GeneralInteriorState from '@/pages/transaction/common/interiorState';
import moment from 'moment';
import { PublicApi } from '@/services/api';
export interface faceSetData {
set?: any,
get?: Function,
externalState?:any,
interiorState?: any
}
const FlowRecord: React.FC<faceSetData> = (props) => {
const { set, get, externalState, interiorState } = props
const [radio, setRadio] = useState<string>('outer'); //切换单据
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const outerColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'inquiryListId',
render: (texr: any, record: any, index: number) => <span>{index + 1}</span>
}, {
title: '操作角色',
dataIndex: 'roleName',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <GeneralExternalState colorType={1} state={text} data={externalState} />
}, {
title: '操作',
dataIndex: 'operationalProcess',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const insideColumns: EditableColumns[] = [{
title: '序号',
dataIndex: 'inquiryListId',
render: (texr: any, record: any, index: number) => <span>{index + 1}</span>
}, {
title: '操作人',
dataIndex: 'roleName',
}, {
title: '部门',
dataIndex: 'department',
}, {
title: '职位',
dataIndex: 'position',
}, {
title: '状态',
dataIndex: 'state',
render: (text: any, record: any) => <GeneralInteriorState colorType={1} state={text} data={interiorState} />
}, {
title: '操作',
dataIndex: 'operationalProcess',
}, {
title: '操作时间',
dataIndex: 'operationTime',
render: (text: any, record: any) => format(text)
}, {
title: '审核意见',
dataIndex: 'auditOpinion',
}]
const onChange = (e: any) => {
setRadio(e.target.value)
}
return (
<div>
<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
columns={outerColumns}
loading={false}
pagination={null}
dataSource={Object.keys(set).length > 0 && set.externalRequisitionFormStateResponses}
/>
:
<PolymericTable
columns={insideColumns}
loading={false}
pagination={null}
dataSource={Object.keys(set).length > 0 && set.interiorRequisitionFormStateResponses}
/>
}
</div>
)
}
export default FlowRecord
.formwrap {
position: relative;
.formbutton {
position: absolute;
right: -95px;
display: flex;
width: 90px;
:global {
.ant-form-item {
width: 32px;
margin-right: 10px;
.ant-btn {
width: 32px;
padding: 0;
margin-right: 10px;
}
}
}
}
}
.modal_wrap_className {
.site_layout_background {
background-color: #fff;
border-right: 1px solid #EEF0F3;
}
.site_content_style {
background-color: #fff;
padding: 24px;
height: 600px;
overflow-y: scroll;
.affix_title {
font-size: 14px;
margin-bottom: 24px;
.divider_style {
width: 2px;
height: 16px;
margin: 0px 5px 0px 0px ;
background-color: #00B37A;
}
}
.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;
}
}
}
}
}
:global {
.ant-anchor-wrapper {
margin-left: 0 !important;
padding-left: 0 !important;
}
.ant-menu-item {
margin-top: 0 !important;
margin-bottom: 0 !important;
&:after {
left: 0;
border-right: none;
border-left: 2px solid #00B37A;
height: 80%;
margin: auto;
}
.ant-anchor-link {
padding: 0px !important;
line-height: 40px !important;
}
}
.ant-menu-item-selected {
color: #303133;
font-weight: 600;
background-color: transparent !important;
}
}
}
.checkbox_wrap_style {
width: 100%;
:global {
.ant-checkbox-wrapper {
width: 100%;
border: 1px solid #ccc;
padding: 8px 18px;
.ant-checkbox {
display: none;
}
> span {
display: flex;
align-items: center;
padding: 0px 0px;
.checkbox_avatar {
width: 32px;
height: 32px;
margin-right: 8px;
}
}
}
.ant-checkbox-wrapper-checked {
border-color: #00b37a!important;
color: #00b37a;
position: relative;
&:after {
content: "";
position: absolute;
width: 12px;
height: 11px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAALCAYAAABLcGxfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADKADAAQAAAABAAAACwAAAAChLCZNAAAA6klEQVQoFWNgIAVsruliJkr9/1XMDCZqcxkY/mczEtSwv4GD4euvlQz/GfxAavFr2N3Bz/Dz8yaG///tYAbj1rC1QYLh/+8dQMX6MMW4bdjSoMTA8Gs30BlAGhUwoXKBvM21QBN/H0VWbMovzXDSOgOsFFXD1mo7Bsa/B5U5BSVgBoEUrzaOZMi5shkshAjWLTWgUNgINJlnh1k8AysTEzhEQIpDzy5nOP3xKVgDxNNbqxIY/jHMAYqADRBi5WTYY5HEIMbGzRB4ZilcMUgHI8PWqlKg4i6wdiRCgIWDQYSNi+HOt3dIogwMANgLQif9hMeFAAAAAElFTkSuQmCC);
right: 0;
bottom: 0;
}
}
}
}
\ No newline at end of file
.form {
:global {
.ant-col {
position: relative;
}
}
}
import React, { useState, useEffect } from 'react';
import moment from 'moment';
import { Form, Input, Select, Row, Col, DatePicker, message } from 'antd';
import { PublicApi } from '@/services/api';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 24 },
labelAlign: "left"
};
export interface faceSetData {
set?: any,
get?: Function,
currentRef?: any,
onBadge?: Function
}
const TradingConditions: React.FC<faceSetData> = (props) => {
const { set, get, currentRef,onBadge } = props
const [TradingConditionsForm] = Form.useForm();
const [address, setAddress] = useState([]);
const [selectAddress, setselectAddress] = useState<any>({});
useEffect(() => {
// 获取交付地址
PublicApi.getLogisticsSelectListReceiverAddress().then(res => {
setAddress(res.data)
})
}, [])
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
TradingConditionsForm.validateFields().then(res => {
console.log(res, selectAddress)
resolve({
state: true,
name: 'tradingConditions',
data: {
deliveryTime: moment(res.deliveryTime).format('x'),
quotationAsTime: moment(res.quotationAsTime).format('x'),
addresId: res.addresId,
addres: selectAddress.children,
logistics: res.logistics,
offer: res.offer,
otherRequire: res.otherRequire,
packRequire: res.packRequire,
paymentType: res.paymentType,
taxes: res.taxes,
}
})
onBadge(0, 2)
}).catch(error => {
if (error && error.errorFields) {
onBadge(error.errorFields.length, 2)
}
})
})
}
}, [selectAddress])
const disabledDate = (current) => {
return current && current < moment().endOf('day');
}
const onSelect = (val: any, option: any) => {
console.log(option)
setselectAddress(option)
}
useEffect(() => {
if(Object.keys(set).length > 0) {
TradingConditionsForm.setFieldsValue({
deliveryTime: moment(set.deliveryTime),
addresId: set.addresId,
quotationAsTime: moment(set.quotationAsTime),
offer: set.offer,
paymentType: set.paymentType,
taxes: set.taxes,
logistics: set.logistics,
packRequire: set.packRequire,
otherRequire: set.otherRequire
})
setselectAddress({children: set.addres});
}
}, [set])
return (
<Form
{...layout}
form={TradingConditionsForm}
>
<Row gutter={70}>
<Col span={12}>
<Form.Item label='交付日期' name='deliveryTime' rules={[{ required: true, message: '请选择交付日期' }]}>
<DatePicker
style={{ width: '100%' }}
disabledDate={disabledDate}
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>
<Form.Item label='交付地址' name='addresId' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select onSelect={onSelect}>
{address.map(v => (
<Select.Option key={v.id} value={v.id}>{v.fullAddress}</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item label='报价截止时间' name='quotationAsTime' rules={[{ required: true, message: '请选择报价截止时间' }]}>
<DatePicker
style={{ width: '100%' }}
format="YYYY-MM-DD HH:mm:ss"
disabledDate={disabledDate}
/>
</Form.Item>
<Form.Item label='报价要求' name='offer'>
<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>
</Col>
<Col span={12}>
<Form.Item label='包装要求' name='packRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='其他要求' name='otherRequire'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
</Row>
</Form>
)
}
export default TradingConditions
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