Commit 3c97377c authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 采购询价新增完善

parent 6c64bb38
......@@ -5,7 +5,7 @@ import style from './index.less';
const { Link } = Anchor;
interface IProps {
dataSource: [],
dataSource: any,
visible: boolean,
title?: string,
onOk?: () => void,
......
import React, { useRef } from 'react';
import React, { useRef, useState } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card } from 'antd';
import { StandardTable } from 'god';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import NiceForm from '@/components/NiceForm'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { searchSelectGetSelectCategoryOptionEffect } from '../../../effect/index'
import { searchSelectGetSelectCategoryOptionEffect } from '@/pages/transaction/effect/index';
import {
PurchaseDemandSchema,
PurchaseDemandPublicSchema,
......@@ -18,6 +19,7 @@ interface Iprops {
schemaType?: 'PurchaseDemand' | 'PurchaseDemandPublic',
columns: ColumnType<any>[],
effects?: string,
selectedRow?: boolean,
}
const formActions = createFormActions();
const Table: React.FC<Iprops> = (props: any) => {
......@@ -27,6 +29,7 @@ const Table: React.FC<Iprops> = (props: any) => {
effects,
fetch,
controllerBtns,
selectedRow,
} = props;
const ref = useRef<any>({});
/** Schema */
......@@ -47,6 +50,18 @@ const Table: React.FC<Iprops> = (props: any) => {
})
}
/**多选 */
const [selectRow, setSelectRow] = useState([])
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<number>>([]);
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(selectedRowKeys) // 返回给父级
},
}
return (
<PageHeaderWrapper>
<Card>
......@@ -54,6 +69,7 @@ const Table: React.FC<Iprops> = (props: any) => {
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={ selectedRow && rowSelection }
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
......
import React from 'react';
import React, { useState, useRef } from 'react';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Tabs, Card, Form } from 'antd';
import { Tabs, Card, Form, Button } from 'antd';
import Basic from './components/basic';
import Material from './components/material';
import Condition from './components/condition';
import Demand from './components/demand';
import ReutrnEle from '@/components/ReturnEle';
const { TabPane } = Tabs;
const AddForm = () => {
/** 基本信息 */
const [basic, setBasic] = useState<{[key: string]: any}>({});
/** 添加采购物料 */
const [material, setMaterial] = useState<{[key: string]: any}>({});
/** 交易条件 */
const [condition, setCondition] = useState<{[key: string]: any}>({});
/** 需求对接 */
const [demand, setDemand] = useState<{[key: string]: any}>({});
/** 拿表单数据的 */
const currentBasic = useRef<any>({});
const currentMaterial = useRef<any>({});
/** 提交&修改 */
const handleSubmit = async () => {
const basicRef = await currentBasic.current.get()
console.log('提交')
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
extra={
<Button type="primary" onClick={handleSubmit}> 保存</Button>
}
>
<Card>
<Form>
<Tabs type='card'>
{/* 基本信息 */}
<TabPane key='1' tab='基本信息'>
<Basic />
<Basic
currentRef={currentBasic}
/>
</TabPane>
{/* 添加采购物料 */}
<TabPane key='2' tab='添加采购物料'>
<Material />
<Material
currentRef={currentBasic}
/>
</TabPane>
{/* 交易条件 */}
<TabPane key='3' tab='交易条件'></TabPane>
<TabPane key='3' tab='交易条件'>
<Condition />
</TabPane>
{/* 需求对接 */}
<TabPane key='4' tab='需求对接'></TabPane>
<TabPane key='4' tab='需求对接'>
<Demand />
</TabPane>
</Tabs>
</Form>
</Card>
......
......@@ -48,7 +48,12 @@ const PRICECONTRAST = [
},
]
const BasicInfo = () => {
interface Iprops {
currentRef: any,
}
const BasicInfo: React.FC<Iprops> = (props: any) => {
const { currentRef } = props;
const [form] = Form.useForm();
/** 省列表 */
const [province, setprovince] = useState<any>([]);
......@@ -169,6 +174,24 @@ const BasicInfo = () => {
manageProvince().then(data => {
setprovince(data)
})
currentRef.current = {
get: () => new Promise((resolve: any) => {
form.validateFields().then(res => {
resolve({
state: true,
name: 'basicInfo',
data: {
details: res.details,
requisitionFormAddress,
}
})
}).catch(error => {
if (error && error.errorFields) {
console.log(1)
}
})
})
}
}, [])
return (
<Form
......
import React, { useState, useEffect } from 'react';
import { Form, Row, Col, Input, DatePicker, Select } from 'antd';
import { PublicApi } from '@/services/api';
const { TextArea } = Input;
const { Option } = Select;
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
labelAlign: "left"
}
const Condition = () => {
const [address, setAddress] = useState<Array<any>>([]);
/** 获取交付地址 */
const handleGetLogistics = async () => {
const service = PublicApi.getLogisticsSelectListReceiverAddress;
const res = await service();
if (res.code === 1000) {
setAddress(res.data);
}
}
useEffect(() => {
handleGetLogistics();
},[])
return (
<Form
{...layout}
>
<Row gutter={[24, 24]}>
<Col span={12}>
<Form.Item
label="交付日期"
name="deliveryTime"
rules={[{ required: true, message: '请选择支付日期' }]}
>
<DatePicker style={{ width: '100%' }} />
</Form.Item>
<Form.Item
label="交付地址"
name='addresId'
rules={[{ required: true, message: '请选择支付日期' }]}
>
<Select>
{address.map(v => (
<Option key={v.id} value={v.id}>{v.fullAddress}</Option>
))}
</Select>
</Form.Item>
<Form.Item
label="报价截日期"
name="offerEndTime"
rules={[{ required: true, message: '请选择交付日期' }]}
>
<DatePicker style={{ width: '100%' }} />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="报价要求"
>
<TextArea rows={3} />
</Form.Item>
<Form.Item
label="付款要求"
>
<TextArea rows={3} />
</Form.Item>
<Form.Item
label="税费要求"
>
<TextArea rows={3} />
</Form.Item>
<Form.Item
label="物流要求"
>
<TextArea rows={3} />
</Form.Item>
<Form.Item
label="包装要求"
>
<TextArea rows={3} />
</Form.Item>
<Form.Item
label="其他要求"
>
<TextArea rows={3} />
</Form.Item>
</Col>
</Row>
</Form>
)
}
export default Condition
import React, { useState } from 'react';
import { Form, Radio, Tooltip, Row, Col, Checkbox, Avatar, Space, Button, Table } 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 ModalTable from '@/components/ModalTable';
const layout: any = {
colon: false,
labelCol: { style: { width: '174px' } },
wrapperCol: { span: 9 },
labelAlign: "left"
};
const Demand: React.FC<{}> = () => {
const [type] = useState<number>(1);
const [goodAllIds, setgoodAllIds] = useState([]);
// 系统匹配表头
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',
},
]
return (
<Form
{...layout}
>
<Form.Item label='添加方式' required name='type'>
<Radio.Group>
<Radio value={1}><Tooltip placement="topLeft" title={<>需求发布至企业商城求购频道</>}>发布类型<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip></Radio>
<Radio value={2}><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}>
<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
columns={columns}
/>
</Form.Item>
}
{
type === 3 &&
// 指定会员
<Form.Item noStyle>
<Button type='dashed' block style={{ marginBottom: '24px' }}><PlusOutlined />选择会员</Button>
<Table columns={columns} rowKey={record => record.memberId} />
</Form.Item>
}
</Form>
)
}
export default Demand;
import React from 'react';
import React, { useEffect, useState } from 'react';
import {
Form,
Radio,
Button,
Table
Table,
Input,
InputNumber,
Cascader,
Spin
} from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PlusOutlined } from '@ant-design/icons';
import DrawerWrite from '../modal/drawerWrite';
import Import from '../modal/import';
import { PublicApi } from '@/services/api';
const layout: any = {
colon: false,
......@@ -16,8 +22,54 @@ const layout: any = {
labelAlign: "left"
}
const Material = () => {
interface Iprops {
currentRef: any,
}
const BUTTONTEXT = {
1: '选择货品添加',
2: '导入货品生成',
}
const Material: React.FC<Iprops> = (props: any) => {
const { currentRef } = props;
/** 表单表头 */
const [flag, setFlag] = useState<boolean>(false)
const [dataSource, setDataSource] = useState<any>([])
const [category, setcategory] = useState([]);
/**查询品类树 */
const searchCategoryTree = (id: any) => {
return new Promise(resolve => {
PublicApi.getProductPlatformGetCategoryTree({ rootNodeId: id }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
}).then((data: any) => {
console.log(data)
setcategory(data)
})
}
/** 修改列表表单 */
const handleEdit = (e: any, name: string, index: number, flag?: boolean) => {
const params = [...dataSource];
Object.keys(params[index]).map(key => {
if (key === name) {
if (flag) {
params[index][key] = e
} else {
params[index][key] = e.target.value
}
}
})
setDataSource(params)
}
/** 删除列表 */
const handleRemove = (index: number) => {
const data = [...dataSource];
data.splice(index, 1);
setDataSource(data)
}
const columns: ColumnType<Object>[] = [
{
title: '物料编号',
......@@ -27,39 +79,88 @@ const Material = () => {
{
title: '物料名称',
key: 'name',
dataIndex: 'name'
dataIndex: 'name',
render: (text: any, record: any, index: number) => (
<Input onChange={(e) => handleEdit( e , 'name', index)} value={text} />
)
},
{
title: '规格型号',
key: 'model',
dataIndex: 'model'
dataIndex: 'model',
render: (text: any, record: any, index: number) => (
<Input onChange={(e) => handleEdit(e, 'model', index)} value={text} />
)
},
{
title: '品类',
key: 'category',
dataIndex: 'category'
dataIndex: 'category',
render: (text: any, record: any) => (
<Cascader
options={category}
fieldNames={{ label: 'title', value: 'id', children: 'children' }}
placeholder="请选择品类"
notFoundContent={<Spin size="small" />}
value={record.ids}
/>
),
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand'
dataIndex: 'brand',
render: (text: any, record: any, index: number) => (
<Input onChange={(e) => handleEdit(e, 'brand', index)} value={text} />
)
},
{
title: '单位',
key: 'unit',
dataIndex: 'unit'
dataIndex: 'unit',
render: (text: any, record: any, index: number) => (
<Input onChange={(e) => handleEdit(e, 'unit', index)} value={text} />
)
},
{
title: '采购数量',
key: 'purchaseCount',
dataIndex: 'purchaseCount'
dataIndex: 'purchaseCount',
render: (text: any, record: any, index: number) => (
<InputNumber onChange={(e) => handleEdit(e, 'purchaseCount', index, true)} value={text} />
)
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate'
dataIndex: 'operate',
render: (text:any, record: any, index: number) => (
<Button onClick={() => handleRemove(index)} type='link'>删除</Button>
)
}
]
/** RADIO选择 1: 选择货品添加,2: 导入货品生成 */
const [materielMode, setMaterielMode] = useState<number>(0)
const checkRadio = (e) => {
const { value } = e.target;
setFlag(false);
setMaterielMode(value);
}
/** 打开添加方式 */
const handleAddmode = () => {
setFlag(true)
}
/** 添加列表 */
const fetchTableList = (data: any) => {
if (Object.keys(data).length > 0) {
console.log(data, 1000)
setDataSource([...dataSource, data]);
setFlag(false);
}
}
useEffect(() => {
searchCategoryTree('0');
}, [])
return (
<Form
{...layout}
......@@ -69,25 +170,45 @@ const Material = () => {
name='materielMode'
rules={[{ required: true, message: '请选择添加方式' }]}
>
<Radio.Group>
<Radio.Group onChange={checkRadio}>
<Radio value={1}>选择货品添加</Radio>
<Radio value={2}>导入货品生成</Radio>
</Radio.Group>
</Form.Item>
<Button
type='dashed'
block
style={{
marginBottom: '24px',
}}
>
<PlusOutlined />
添加
</Button>
<Table
columns={columns}
/>
<DrawerWrite />
{ materielMode >= 1
&& (
<>
<Button
type='dashed'
block
onClick={handleAddmode}
style={{
marginBottom: '24px',
}}
>
<PlusOutlined />
{BUTTONTEXT[materielMode]}
</Button>
<Table
columns={columns}
dataSource={dataSource}
/>
</>
)}
{ materielMode === 1
&& (
<DrawerWrite
flag={flag}
onClose={() => setFlag(false)}
onConfirm={fetchTableList}
/>
)}
{ materielMode === 2
&& (
<Import
flag={flag}
/>
)}
</Form>
)
}
......
......@@ -5,8 +5,14 @@ import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment'
import { PublicApi } from '@/services/api';
import { Row, Col, Space, Button, Dropdown, Menu } from 'antd';
import { Row, Col, Space, Button, Dropdown, Menu, Tag, Badge } from 'antd';
import { DeleteOutlined, DownOutlined, PlusOutlined } from '@ant-design/icons';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
const AddInquiry = () => {
console.log('待新增采购需求单');
......@@ -42,10 +48,12 @@ const AddInquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......@@ -60,6 +68,7 @@ const AddInquiry = () => {
}];
return (
<Table
selectedRow
schemaType="PurchaseDemandPublic"
columns={columns}
effects="requisitionFormNo"
......
import React from 'react';
import {
Modal,
Row,
Col,
Image,
Badge,
Button
} from 'antd';
import style from './index.less';
import excelIcon from '@/assets/imgs/excel.png'
interface Iprops {
flag: boolean,
}
const Import: React.FC<Iprops> = (props: any) => {
const { flag } = props;
return (
<Modal
width={400}
title='导入'
visible={flag}
footer={
<Button type='primary'>导入</Button>
}
>
<Row
style={{
flexDirection: 'column',
}}
>
<Col
style={{
display: 'flex',
justifyContent: 'center',
}}
>
<Image
width={72}
height={72}
preview={false}
src={excelIcon}
/>
</Col>
<Col
span={24}
className={style.colStyle}
>
<span className={style.badgeStyle}>1</span>
<span className={style.textStyle}>点击下载 EXCEL文件模板</span>
<Button style={{ fontSize: '14px' }} type='link'>下载</Button>
</Col>
<Col
span={24}
className={style.colStyle}
>
<span className={style.badgeStyle}>2</span>
<span className={style.textStyle}>按照模板整理货品资料</span>
</Col>
<Col
span={24}
className={style.colStyle}
>
<span className={style.badgeStyle}>3</span>
<span className={style.textStyle}>点击导入按钮,导入整理好的货品资料</span>
</Col>
</Row>
</Modal>
)
}
export default Import
......@@ -19,6 +19,10 @@
}
}
}
.ant-anchor-wrapper {
margin-left: 0;
padding-left: 0;
}
}
.upload_item {
padding: 5px 8px;
......@@ -55,3 +59,23 @@
}
}
}
/** 导入样式 */
.badgeStyle {
width: 16px;
height: 16px;
display: inline-block;
border-radius: 50%;
background-color: #6198FF;
text-align: center;
color:#FFFFFF;
font-weight: 500;
margin-right: 5px;
}
.textStyle {
font-size: 14px;
color: #909399;
}
.colStyle {
padding-left: 40px;
}
import React, { useRef } from 'react';
import {
Drawer,
Button
} from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
import NiceForm from '@/components/NiceForm';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { searchSelectGetSelectCategoryOptionEffect } from '@/pages/transaction/effect/index';
import {
SelectProductSchema,
} from '../../../schema';
const formActions = createFormActions();
interface Iprops {
visible: boolean,
onclose?(),
confirm?(e:any),
}
const SelectProduct: React.FC<Iprops> = (props: any) => {
const ref = useRef({});
const { visible, onclose, confirm } = props;
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const columns: ColumnType<any>[] = [
{
title: '货号',
key: 'code',
dataIndex: 'code'
},
{
title: '货品名称',
key: 'name',
dataIndex: 'name'
},
{
title: '规格型号',
key: 'type',
dataIndex: 'type'
},
{
title: '品类',
key: 'customerCategory',
dataIndex: 'customerCategory',
render: (text: any) => <span>{(text && Object.keys(text).length > 0) && text.name}</span>
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand',
render: (text: any) => <span>{(text && Object.keys(text).length > 0) && text.name}</span>
},
{
title: '单位',
key: 'unitName',
dataIndex: 'unitName'
},
]
const fetchGoodsData = (params: any) => {
return new Promise(resolve => {
PublicApi.getProductGoodsGetGoodsList(params).then(res => {
const { data } = res
resolve(data)
})
})
}
return (
<Drawer
visible={visible}
onClose={onclose}
title='选择货品'
width={900}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button onClick={onclose} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={() => confirm(RowCtl)} type="primary">
确定
</Button>
</div>
}
>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
rowSelection={rowSelection}
fetchTableData={(params) => fetchGoodsData(params)}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH)
FormEffectHooks.onFieldChange$('category').subscribe(state => {
searchSelectGetSelectCategoryOptionEffect(actions, 'category')
})
}}
schema={SelectProductSchema}
>
</NiceForm>
}
/>
</Drawer>
)
}
export default SelectProduct
......@@ -4,7 +4,13 @@ import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button } from 'antd';
import { Row, Col, Button, Tag, Badge } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
const AuditInquiryOne = () => {
console.log('待新增采购需求单');
......@@ -40,10 +46,12 @@ const AuditInquiryOne = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -4,7 +4,13 @@ import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button } from 'antd';
import { Row, Col, Button, Tag, Badge } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
const AuditInquiryTwo = () => {
console.log('待新增采购需求单');
......@@ -40,10 +46,12 @@ const AuditInquiryTwo = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -46,7 +46,7 @@ const Detail: React.FC<{}> = () => {
const [logStatesStatus, setLogStatesStatus] = useState<number>(LogStatesType.externalLogStates);
const [logStatus, setLogStatus] = useState<number>(LogType.externalLogs);
const [visible, setVisible] = useState<boolean>(false);
const [dataSource, setDataSource] = useState([])
const [dataSource, setDataSource] = useState<any>([])
useEffect(() => {
setTargetOffset(window.innerHeight / 8);
const parmas = {
......
import React from 'react';
import Table from '../../components/table'
import { Button } from 'antd';
import { Button, Tag, Badge } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
const Inquiry = () => {
console.log('采购需求单查询');
......@@ -40,10 +46,12 @@ const Inquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -4,7 +4,13 @@ import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button } from 'antd';
import { Row, Col, Button, Tag, Badge } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
const SubmitInquiry = () => {
console.log('待新增采购需求单');
......@@ -40,10 +46,12 @@ const SubmitInquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -182,3 +182,87 @@ export const PurchaseDemandPublicSchema: ISchema = {
}
}
}
/** 选择货品 */
export const SelectProductSchema: ISchema = {
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
properties: {
name: {
type: 'string',
"x-component": "Search",
"x-mega-props": {
},
"x-component-props": {
placeholder: '货品名称',
align: 'flex-left',
}
}
}
},
[FORM_FILTER_PATH]: {
type: 'object',
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'flex-start',
flexWrap: 'nowrap'
},
colStyle: {//改变间隔
marginRight: 20
}
},
properties: {
PRO_LAYOUT: {
type: 'object',
"x-component": 'mega-layout',
"x-mega-props": {
span: 5
},
"x-component-props": {
inline: true
},
properties: {
code: {
type: 'string',
"x-component-props": {
placeholder: '货号'
}
},
customerCategory: {
type: 'string',
"x-component-props": {
placeholder: '品类'
}
},
brand: {
type: 'string',
"x-component-props": {
placeholder: '品牌'
}
},
type: {
type: 'string',
"x-component-props": {
placeholder: '规格型号'
}
},
}
},
sumbit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
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