Commit 14174428 authored by 前端-许佳敏's avatar 前端-许佳敏

merge

parents 6b964f12 c78310de
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":2,"typeName":"企业个人会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":2,"typeName":"商品销售"},{"id":3,"typeName":"加工服务"},{"id":4,"typeName":"物流服务"},{"id":5,"typeName":"金融服务"},{"id":6,"typeName":"保险服务"},{"id":7,"typeName":"1"},{"id":8,"typeName":"2"},{"id":9,"typeName":"3"},{"id":10,"typeName":"4"},{"id":11,"typeName":"23"},{"id":12,"typeName":"6"},{"id":13,"typeName":"5"},{"id":14,"typeName":"11111111111111111111111111"},{"id":16,"typeName":"44"},{"id":17,"typeName":"33"},{"id":18,"typeName":"32"},{"id":19,"typeName":"33333"},{"id":20,"typeName":"4432"},{"id":21,"typeName":"11111111111"},{"id":22,"typeName":"别删"},{"id":23,"typeName":"测试"}]},"useDetail":[{"groupName":"联系信息","elements":[{"id":26,"fieldName":"contact","fieldCNName":"联系人","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":27,"fieldName":"fixed_contact_number","fieldCNName":"固定联系电话","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":28,"fieldName":"phone_number","fieldCNName":"手机号码","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":29,"fieldName":"fax_number","fieldCNName":"传真号码","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":30,"fieldName":"address","fieldCNName":"地址","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":31,"fieldName":"zip_code","fieldCNName":"邮编","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":32,"fieldName":"url","fieldCNName":"网址","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":33,"fieldName":"email","fieldCNName":"邮箱","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"营业执照信息","elements":[{"id":10,"fieldName":"company_name","fieldCNName":"公司名称","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":11,"fieldName":"enterprise_type","fieldCNName":"企业类型","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":12,"fieldName":"residence","fieldCNName":"住所","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":13,"fieldName":"legal_representative","fieldCNName":"法定代表人","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":14,"fieldName":"register_capital","fieldCNName":"注册资本","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":15,"fieldName":"establish_date","fieldCNName":"成立日期","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":16,"fieldName":"business_term","fieldCNName":"营业期限","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":17,"fieldName":"business_scope","fieldCNName":"经营范围","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":18,"fieldName":"registration_authority","fieldCNName":"登记机关","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":19,"fieldName":"registration_time","fieldCNName":"登记时间","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":20,"fieldName":"unified_social_credit_code","fieldCNName":"统一社会信用代码","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":21,"fieldName":"business_license","fieldCNName":"营业执照","fieldType":"upload","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":35,"fieldName":" C_COMPANY_KIND","fieldCNName":"企业类型1","fieldType":"upload","fieldLength":66,"fieldEmpty":1,"fieldOrder":2,"fieldRemark":"","checkRules":[]}]},{"groupName":"填写会员基本信息","elements":[{"id":1,"fieldName":"member_type","fieldCNName":"会员类型","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":2,"fieldName":"MEMBER_ROLE","fieldCNName":"会员角色","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":3,"fieldName":"member_level","fieldCNName":"会员等级","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":4,"fieldName":"REGISTER_PHONE","fieldCNName":"注册手机号","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":5,"fieldName":"register_email","fieldCNName":"注册邮箱","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"法定代表人信息","elements":[{"id":22,"fieldName":"legal_name","fieldCNName":"法人姓名","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":23,"fieldName":"legal_phone","fieldCNName":"法人手机号","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":24,"fieldName":"legal_id_card","fieldCNName":"法人身份证号","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":25,"fieldName":"legal_id_card_information","fieldCNName":"法人身份证信息","fieldType":"upload","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写渠道信息","elements":[{"id":6,"fieldName":"channel_level","fieldCNName":"渠道级别","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":7,"fieldName":"channel_type","fieldCNName":"渠道类型","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":8,"fieldName":"agent_city","fieldCNName":"代理地市","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":9,"fieldName":"channel_describe","fieldCNName":"渠道描述","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]}]},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}],"menuList":[{"code":"/memberCenter/commodityAbility","children":[{"code":"/mem"}]},{"code":"/memberCenter/commodityAbility/classAndProperty/class"}]}}
......@@ -17,18 +17,39 @@ const TranactionRoute = {
component: '@/pages/transaction/stockSellStorage/warehouse/index',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/addWarehouse',
name: 'addWarehouse',
key: 'addWarehouse',
hideInMenu: true,
component: '@/pages/transaction/stockSellStorage/warehouse/addWarehouse',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/billsType',
name: 'billsType',
key: 'billsType',
component: '@/pages/transaction/stockSellStorage/billsType/index',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/addBillsType',
name: 'addBillsType',
key: 'addBillsType',
hideInMenu: true,
component: '@/pages/transaction/stockSellStorage/billsType/addBillsType',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/bills',
name: 'bills',
key: 'bills',
component: '@/pages/transaction/stockSellStorage/bills/index',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/addBills',
name: 'addBills',
key: 'addBills',
hideInMenu: true,
component: '@/pages/transaction/stockSellStorage/bills/addBills',
},
{
path: '/memberCenter/tranactionAbility/stockSellStorage/inventory',
name: 'inventory',
key: 'inventory',
......
import React from 'react';
import { Row, Col, Select, Input } from 'antd';
import styled from 'styled-components';
import { findItemAndDelete } from '@/utils';
import cx from 'classnames';
const { Option } = Select;
const RowStyleLayout = styled(props => <div {...props} />)``;
const registryPhone = (props: any) => {
const { dataSource = [], selectPh, inputPh } = props.props[
'x-component-props'
];
const defaultValue: any = props.props.default || {};
const value: any = props.value || {};
const handleChange = (type, e) => {
if (type === 'select') {
props.mutators.change({ ...value, phone: e });
} else {
e.persist();
props.mutators.change({ ...value, countryCode: e.target.value });
}
};
return (
<Row>
<Col span={8}>
<Select
value={defaultValue.countryCode}
onChange={val => handleChange('select', val)}
placeholder={selectPh}
>
{dataSource.map((v, i) => {
return (
<Option key={v.text} value={v.id}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<img
style={{
width: '24px',
height: '17px',
marginRight: '8px',
}}
src={v.url}
/>
{v.text}
</div>
</Option>
);
})}
</Select>
</Col>
<Col span={15} offset={1}>
<Input
defaultValue={defaultValue.phone}
placeholder={inputPh}
maxLength={11}
onChange={e => handleChange('input', e)}
/>
</Col>
</Row>
);
};
registryPhone.defaultProps = {};
registryPhone.isFieldComponent = true;
export default registryPhone;
import React from 'react';
import { Row, Col, Input } from 'antd';
import styled from 'styled-components';
import cx from 'classnames';
const RowStyleLayout = styled(props => <div {...props} />)`
width: 100%;
`;
const Relevance = props => {
return (
<RowStyleLayout>
<Row>
<Col span={16}>123</Col>
<Col span={8}>456</Col>
</Row>
</RowStyleLayout>
);
};
Relevance.defaultProps = {};
Relevance.isFieldComponent = true;
export default Relevance;
import React from 'react'
import { Space } from 'antd'
import React from 'react';
import { Space } from 'antd';
const CustomStatus = (props) => {
const CustomStatus = props => {
console.log(props);
return (
<>
<Space>
<span className={ props.value === 1 ? 'commonStatusValid' : 'commonStatusInvalid' }></span>
<span>
{ props.value === 1 ? '有效' : '无效' }
</span>
</Space>
<Space>
<span
className={
props.value === 1 ? 'commonStatusValid' : 'commonStatusInvalid'
}
></span>
<span>{props.value === 1 ? '有效' : '无效'}</span>
</Space>
</>
)
}
);
};
export default CustomStatus
\ No newline at end of file
export default CustomStatus;
import React, { useState } from 'react'
import { Input, Space, Button } from 'antd'
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons'
import { useFieldState, FormPath } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import React, { useState } from 'react';
import { Input, Space, Button } from 'antd';
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons';
import { useFieldState, FormPath } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export interface SearchProps {
value: string,
mutators: any,
props: any
value: string;
mutators: any;
props: any;
}
const Search = (props) => {
const Search = props => {
// console.log(props);
const [state, setState] = useFieldState({
filterSearch: false
})
filterSearch: false,
});
const justifyAlign = props.props['x-component-props'].align || 'flex-end';
const changeFilterVisible = () => {
if (state.filterSearch) {
props.form.reset({
// 清除FILTER_PARAMS下所有字段
selector: `*.${FORM_FILTER_PATH}.*`
})
selector: `*.${FORM_FILTER_PATH}.*`,
});
}
setState({
filterSearch: !state.filterSearch
})
}
filterSearch: !state.filterSearch,
});
};
return (
<Space size={20} style={{justifyContent: 'flex-end', width: '100%'}}>
<Space size={20} style={{ justifyContent: justifyAlign, width: '100%' }}>
<Input.Search
value={props.value || ''}
onChange={e => props.mutators.change(e.target.value)}
onSearch={(_,e) => {
e.preventDefault()
props.form.submit()
onSearch={(_, e) => {
e.preventDefault();
props.form.submit();
}}
{...props.props['x-component-props']}
/>
<Button onClick={changeFilterVisible}>高级筛选{state.filterSearch ? <CaretUpOutlined /> : <CaretDownOutlined />}</Button>
<Button onClick={() => props.form.reset()}>重置</Button>
<Button onClick={changeFilterVisible}>
高级筛选
{state.filterSearch ? <CaretUpOutlined /> : <CaretDownOutlined />}
</Button>
<Button
onClick={() => {
props.form.reset();
}}
>
重置
</Button>
</Space>
)
}
);
};
Search.defaultProps = {}
Search.defaultProps = {};
Search.isFieldComponent = true;
export default Search
\ No newline at end of file
export default Search;
import React from 'react'
import SchemaForm, { IAntdSchemaFormProps } from '@formily/antd'
import React from 'react';
import SchemaForm, {
IAntdSchemaFormProps,
} from '@formily/antd';
import { Button, Space } from 'antd';
import CustomUpload from './components/CustomUpload';
import CustomStatus from './components/CustomStatus';
......@@ -10,12 +12,13 @@ import Submit from './components/Submit';
import Text from './components/Text';
import CardCheckBox from './components/CardCheckBox';
import MultTable from './components/MultTable';
import { setup, FormTab } from '@formily/antd-components';
export interface NiceFormProps extends IAntdSchemaFormProps {
}
import CustomRegistryPhone from './components/CustomRegistryPhone';
import CustomRelevance from './components/CustomRelevance';
const NiceForm:React.FC<NiceFormProps> = (props) => {
const { children, components, ...reset } = props
export interface NiceFormProps extends IAntdSchemaFormProps {}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, ...reset } = props;
const customComponents = {
CustomUpload,
CustomStatus,
......@@ -26,22 +29,19 @@ const NiceForm:React.FC<NiceFormProps> = (props) => {
Text,
CardCheckBox,
MultTable,
}
CustomRegistryPhone,
CustomRelevance,
};
const defineComponents = Object.assign(customComponents, components)
const defineComponents = Object.assign(customComponents, components);
return (
<SchemaForm
colon={false}
components={defineComponents}
{...reset}
>
<SchemaForm colon={false} components={defineComponents} {...reset}>
{children}
</SchemaForm>
)
}
);
};
NiceForm.defaultProps = {}
NiceForm.defaultProps = {};
export default NiceForm
\ No newline at end of file
export default NiceForm;
......@@ -142,4 +142,11 @@ h6 {
border: none;
background: none;
}
}
\ No newline at end of file
}
//addonAfter 有选择弹窗时
.input_addonAfter{
.ant-input-group-addon{
padding: 0 !important;
}
}
......@@ -69,8 +69,11 @@ export default {
'menu.tranactionAbility': '交易',
'menu.tranactionAbility.stockSellStorage': '进销存',
'menu.tranactionAbility.stockSellStorage.warehouse': '仓库',
'menu.tranactionAbility.stockSellStorage.addWarehouse': '新增仓库',
'menu.tranactionAbility.stockSellStorage.billsType': '单据类型',
'menu.tranactionAbility.stockSellStorage.addBillsType': '新增单据类型',
'menu.tranactionAbility.stockSellStorage.bills': '单据',
'menu.tranactionAbility.stockSellStorage.addBills': '新增单据',
'menu.tranactionAbility.stockSellStorage.inventory': '库存',
//物流能力
......
......@@ -6,9 +6,9 @@ import {
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { values } from 'mobx';
import {PublicApi} from '@/services/api'
export interface Params {
import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
......@@ -16,33 +16,40 @@ export interface Params {
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const {onFieldChange$} = FormEffectHooks
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
console.log(props.dialogVisible)
const handleCancel = () => {
}
const handletOk = (values:any) => {
let value = {...values}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
console.log(values)
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if(res.code === 1000){
if (res.code === 1000) {
props.onOK()
}
})
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({value}) => {
setFieldState('remarkOption',state => {
if(value == 3){
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 3) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value == 3) {
state.visible = false
}else{
} else {
state.visible = true
}
})
......@@ -62,21 +69,23 @@ const comfirmDialog: React.FC<Params> = (props) => {
okText='确定'
cancelText='取消'
>
<SchemaForm components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values) }
initialValues={{
status: 3
}}
<SchemaForm
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 3
}}
>
<Field
enum={
[
{ label: '接受物流单', value:3},
{ label: '不接受物流单', value:4 }
{ label: '接受物流单', value: 3 },
{ label: '不接受物流单', value: 4 }
]}
name='status'
required
......@@ -84,27 +93,41 @@ const comfirmDialog: React.FC<Params> = (props) => {
/>
{props.dontReceive &&
<FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top">
<Field
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules={value => {
if (value.length > 60) {
return {
type: 'warning',
message: '原因最多60个汉字'
}
}
}
}
/>
<>
<Field
title='运费'
name="freightPrice"
x-component="Input"
required
x-component-props={{
placeholder:'运费',
// addonBefore: ' '
}}
x-rules ={{
pattern: PATTERN_MAPS.money,
message:'数字类型,币制为当前站点对应的币制,保留2位小数'
}}
/>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules ={{
max:60,
// maximum:10,//最大数值
message:'原因最多60个汉字'
}}
/>
</FormMegaLayout>
</>
}
</SchemaForm>
</Modal>
......
......@@ -275,14 +275,6 @@ const detailInfo: React.FC<{}> = () => {
resolve(res.data)
}
})
// const queryResult = data.find(v => v.key === params.keywords);
// setTimeout(() => {
// resolve({
// code: 200,
// message: '',
// data: dataInfo.detailList//dataInfo.logList
// });
// }, 1000);
});
};
......@@ -483,9 +475,8 @@ const detailInfo: React.FC<{}> = () => {
{
item.key === 'freight' ?
<div className={style['cols-main-options']}>
{item.value}
{/* <Input addonBefore=" ¥ " defaultValue={100} /> */}
{dataInfo.status < 3 ?'未报价':item.value}
</div>
: <div className={style['cols-main-options']}>
{item.value}
......
......@@ -224,7 +224,7 @@ const company: React.FC<{}> = () => {
}
]}
>
<Input className={style['selectBtn']} disabled maxLength={20} addonAfter={selectBtn}/>
<Input className="input_addonAfter" disabled maxLength={20} addonAfter={selectBtn}/>
</Form.Item>
:
<Form.Item
......@@ -299,7 +299,10 @@ const company: React.FC<{}> = () => {
<StandardTable
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
rowSelection={{
type:'radio',
...rowSelection
}}
fetchTableData={(params: any) => fetchData(params)}
/>
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-03 16:48:12
* @LastEditTime: 2020-08-03 18:28:38
*/
import React, { Component, useEffect, useRef, useState,ReactNode } from 'react'
import { Card, Row, Col, Tabs, Button, Input as SelectInput, Badge } from 'antd'
......@@ -357,12 +357,12 @@ const Deatail: React.FC<{}> = () => {
<FormItem name="digest" label="单据摘要" required component={Input} />
<FormItem name="shipmentOrderCode" label='对应发货单号'>
<>
<SelectInput className={style['btn-wrap']} addonAfter={selectBtn2} />
<SelectInput className='input_addonAfter' addonAfter={selectBtn2} />
</>
</FormItem>
<FormItem name="invoicesNo" label='对应订单号/售后单'>
<>
<SelectInput className={style['btn-wrap']} addonAfter={selectBtn1} />
<SelectInput className='input_addonAfter' addonAfter={selectBtn1} />
</>
</FormItem>
......
This diff is collapsed.
import React, { useState, useEffect, useRef, ReactNode } from 'react';
import { history } from 'umi';
import { Tabs, Badge, Button, Card, Row, Col, message } from 'antd';
import { Tabs, Badge, Button, Card, Row, Col, message, Upload } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { ContainerOutlined } from '@ant-design/icons';
import { Form, FormItem, createFormActions } from '@formily/antd';
import { Select, Input, Upload } from '@formily/antd-components';
import {
ContainerOutlined,
PlusOutlined,
SaveOutlined,
} from '@ant-design/icons';
import { createFormActions } from '@formily/antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import {
IFormFilter,
IButtonFilter,
} from 'god/dist/src/standard-table/TableController';
import ReutrnEle from '@/components/ReturnEle';
import styles from './index.less';
import NiceForm from '@/components/NiceForm';
import { initDetailSchema } from './schema';
import style from './index.less';
import { PublicApi } from '@/services/api';
const { TabPane } = Tabs;
const actions = createFormActions();
const addSchemaAction = createFormActions();
const addMember: React.FC<any> = props => {
const ref = useRef({});
const [actived, setActived] = useState('-1');
const [editable, setEditable] = useState(
props.location.query.type != 'check',
);
const selectList: any = [
{
label: '',
......@@ -30,15 +38,10 @@ const addMember: React.FC<any> = props => {
// )
value: '1',
},
{ label: '', value: '2' },
{ label: '', value: '3' },
{ label: '', value: '4' },
{ label: '', value: '5' },
];
/* 会员类型、会员角色、会员等级、注册手机号选项 */
const [memberItems, setMemberItems] = useState<any>({});
const [loading, setLoading] = useState(false);
const data = [
{
......@@ -146,181 +149,34 @@ const addMember: React.FC<any> = props => {
return isJpgOrPng && isLt2M;
};
const handleChange = (items: any, file: any) => {
for (let elem of file) {
elem.url = elem.data;
}
};
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={
<>
<div className={style.headerTop}>
<span>返回</span>
<span>
{props.location.query.type === 'add'
? '新建会员'
: props.location.query.type === 'change'
? '编辑会员'
: '查看会员'}
</span>
</div>
</>
}
extra={
<>
<Button
className={style.saveBtn}
icon={<ContainerOutlined />}
onClick={() => actions.submit()}
>
保存
</Button>
</>
props.location.query.type === 'add'
? '新建会员'
: props.location.query.type === 'change'
? '编辑会员'
: '查看会员'
}
extra={[
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
onClick={() => addSchemaAction.submit()}
>
保存
</Button>,
]}
>
<Card>
<Form
editable={editable}
labelCol={3}
wrapperCol={10}
labelAlign="left"
actions={actions}
>
<Tabs
tabBarGutter={30}
activeKey={actived}
onChange={activeKey => setActived(activeKey)}
>
<TabPane
tab={
// <Badge count={tabCount['1']} offset={[10, 0]}>
'基本信息'
// </Badge>
}
key="-1"
>
<FormItem
label="会员类型"
name="memberTypes"
dataSource={memberItems.memberTypes}
rules={[{ required: true, message: '请选择会员类型!' }]}
component={Select}
/>
<FormItem
label="会员角色"
name="memberRoles"
dataSource={memberItems.memberRoles}
rules={[{ required: true, message: '请选择会员角色!' }]}
component={Select}
/>
<FormItem
label="会员等级"
name="memberLevels"
dataSource={memberItems.memberLevels}
rules={[{ required: true, message: '请选择会员等级!' }]}
component={Select}
/>
<FormItem
label={
<>
<span className={style.required}>*</span>
注册手机号
</>
}
name="registry"
>
<Row gutter={10}>
<Col span={6}>
<FormItem
itemStyle={{ marginBottom: 0 }}
name="country"
dataSource={memberItems.countryCodes}
rules={[{ required: true, message: '请选择会员角色!' }]}
component={Select}
/>
</Col>
<Col span={18}>
<FormItem
name="phoneMobile"
itemStyle={{ marginBottom: 0 }}
rules={[{ required: true, message: '请选择会员角色!' }]}
component={Input}
/>
</Col>
</Row>
</FormItem>
<FormItem
label="注册邮箱"
name="memberEmail"
itemStyle={{ marginBottom: 0 }}
component={Input}
/>
</TabPane>
{memberItems.groups &&
memberItems.groups.map((item: any, index: number) => {
return (
<TabPane
tab={
// <Badge count={tabCount['1']} offset={[10, 0]}>
item.groupName
// </Badge>
}
key={index}
>
{item.elements.map((items: any, indexs: number) => {
return (
<div key={indexs}>
{items.fieldType === 'String' ? (
<FormItem
itemStyle={
item.elements.length - 1 === indexs
? { marginBottom: 0 }
: {}
}
label={items.fieldCNName}
name={items.fieldName}
required={items.fieldEmpty === 0}
// rules={items.checkRules}
component={Input}
key={indexs}
/>
) : (
<FormItem
itemStyle={
item.elements.length - 1 === indexs
? { marginBottom: 0 }
: {}
}
label={items.fieldCNName}
name={items.fieldName}
action="/api/file/file/upload"
listType="picture-card"
required={items.fieldEmpty === 0}
// rules={items.checkRules}
data={{ fileType: 2 }}
beforeUpload={beforeUpload}
onChange={(file: any) =>
handleChange(items, file)
}
showUploadList={{
showRemoveIcon:
items.value && items.value.length > 0,
}}
key={indexs}
component={Upload}
/>
)}
</div>
);
})}
</TabPane>
);
})}
</Tabs>
</Form>
<NiceForm
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={initDetailSchema(memberItems)}
/>
</Card>
</PageHeaderWrapper>
);
......
import React from 'react';
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const maintianSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '请输入仓位名称',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
visible: false,
'x-component-props': {
inline: true,
},
properties: {
productName: {
type: 'string',
'x-component-props': {
placeholder: '商品名称',
},
},
productId: {
type: 'string',
'x-component-props': {
placeholder: '商品ID',
},
},
category: {
type: 'string',
'x-component-props': {
placeholder: '请选择品类',
},
enum: [],
},
brand: {
type: 'string',
'x-component-props': {
placeholder: '请选择品牌',
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
const registryPhone = <></>;
const getCompnentValue = (elements: any) => {
let components = {};
for (let item of elements) {
let xComponentProps =
item.fieldType === 'string'
? {
placeholder: item.fieldRemark,
}
: {
listType: 'card',
action: '/api/file/file/upload',
data: { fileType: 2 },
};
components[item.fieldName] = {
type: item.fieldType,
required: item.fieldEmpty === 0,
title: item.fieldCNName,
'x-component-props': xComponentProps,
};
}
return components;
};
export const initDetailSchema = (props: any) => {
let tabSchema = {
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: {
memberTypes: {
type: 'string',
required: true,
title: '会员类型',
enum: props.memberTypes,
'x-component-props': {
placeholder: '请选择',
},
},
memberRoles: {
type: 'string',
required: true,
title: '会员角色',
enum: props.memberRoles,
'x-component-props': {
placeholder: '请选择',
},
},
memberLevels: {
type: 'string',
required: true,
title: '会员等级',
enum: [{ label: '1', value: 1 }],
// enum: props.memberLevels,
'x-component-props': {
placeholder: '请选择',
},
},
memberPhone: {
type: 'object',
required: true,
title: '注册手机',
'x-component': 'CustomRegistryPhone',
'x-component-props': {
dataSource: [
{
text: '+86',
id: 1,
url: require('../../../../../public/static/imgs/level1@2x.png'),
},
{
text: '+126',
id: 2,
url: require('../../../../../public/static/imgs/level2@2x.png'),
},
],
selectPh: '请选择',
inputPh: '请输入你的手机号码',
},
},
memberEmail: {
type: 'string',
title: '邮箱',
'x-component-props': {},
},
},
},
},
},
},
};
if (Object.keys(props).length > 0) {
for (let [index, item] of props.groups.entries()) {
tabSchema.properties[`tab-${index + 2}`] = {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: item.groupName,
},
properties: {
[`MEGA_LAYOUT${index + 2}`]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: getCompnentValue(item.elements),
},
},
};
}
}
let detailSchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {},
...tabSchema,
},
},
};
const maintianDetailSchema: ISchema = detailSchema;
return maintianDetailSchema;
};
import React, { ReactNode, useRef, useState } from 'react'
import { history } from 'umi'
import { Button, Popconfirm, Card, Row, Col, Dropdown, Input, Select, Space } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import React, { ReactNode, useRef, useState } from 'react';
import { history } from 'umi';
import {
Button,
Popconfirm,
Card,
Row,
Col,
Dropdown,
Input,
Select,
Space,
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined,
PlayCircleOutlined,
......@@ -9,29 +19,32 @@ import {
DownOutlined,
CaretUpOutlined,
CaretDownOutlined,
} from '@ant-design/icons'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import EyePreview from '@/components/EyePreview'
import StatusSwitch from '@/components/StatusSwitch'
import NiceForm from '@/components/NiceForm'
import { createFormActions, FormEffectHooks } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { repositSchema } from './schema'
import { PublicApi } from '@/services/api'
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import {
IFormFilter,
IButtonFilter,
} from 'god/dist/src/standard-table/TableController';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { repositSchema } from './schema';
import { PublicApi } from '@/services/api';
const formActions = createFormActions()
const formActions = createFormActions();
// 模拟请求
const fetchData = async (params:any) => {
const res = await PublicApi.getWarehouseFreightSpaceList(params)
return res.data
}
const fetchData = async (params: any) => {
const res = await PublicApi.getWarehouseFreightSpaceList(params);
return res.data;
};
const Repositories: React.FC<{}> = () => {
const ref = useRef<any>({})
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [
{
......@@ -45,7 +58,13 @@ const Repositories: React.FC<{}> = () => {
dataIndex: 'reposName',
align: 'center',
key: 'reposName',
render: (text:any, record:any) => <EyePreview url={`/repositories/viewRepository?id=${record.key}&preview=1`}>{text}</EyePreview>
render: (text: any, record: any) => (
<EyePreview
url={`/repositories/viewRepository?id=${record.key}&preview=1`}
>
{text}
</EyePreview>
),
},
{
title: '商品名称',
......@@ -82,59 +101,76 @@ const Repositories: React.FC<{}> = () => {
align: 'center',
dataIndex: 'status',
key: 'status',
render: (text: any, record:any) => <StatusSwitch handleConfirm={()=>handleModify(record)} record={record}/>
render: (text: any, record: any) => (
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
/>
),
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text:any, record:any) => {
render: (text: any, record: any) => {
return (
<>
{
record.state === 1 ? <Button type='link' onClick={()=>handleAdjust(record)}>库存调拨</Button> : ''
}
{record.state === 1 ? (
<Button type="link" onClick={() => handleAdjust(record)}>
库存调拨
</Button>
) : (
''
)}
</>
)
}
}
);
},
},
];
const handleSee = (record:any) => {
console.log('see')
history.push(`/repositories/viewRepository?id=${record.key}`)
}
const handleSee = (record: any) => {
console.log('see');
history.push(`/repositories/viewRepository?id=${record.key}`);
};
const confirm = () => {
console.log('confirm')
}
console.log('confirm');
};
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record)
}
console.log('执行状态修改', record);
};
const handleAdjust = (record: any) => {
history.push(`/memberCenter/commodityAbility/repositories/adjustRepository?id=${record.key}`)
}
history.push(
`/memberCenter/commodityAbility/repositories/adjustRepository?id=${record.key}`,
);
};
const handleToAdd = () => {
history.push(`/memberCenter/commodityAbility/repositories/addRepository`)
}
history.push(`/memberCenter/commodityAbility/repositories/addRepository`);
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{rowKey: "key"}}
tableProps={{ rowKey: 'key' }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row justify='space-between'>
<Row justify="space-between">
<Col>
<Space>
<Button type='primary' onClick={handleToAdd} icon={<PlusOutlined />}>新建</Button>
<Button
type="primary"
onClick={handleToAdd}
icon={<PlusOutlined />}
>
新建
</Button>
</Space>
</Col>
<Col>
......@@ -142,7 +178,12 @@ const Repositories: React.FC<{}> = () => {
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'search', FORM_FILTER_PATH)
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}}
schema={repositSchema}
/>
......@@ -152,7 +193,7 @@ const Repositories: React.FC<{}> = () => {
/>
</Card>
</PageHeaderWrapper>
)
}
);
};
export default Repositories
export default Repositories;
......@@ -62,7 +62,6 @@ export const repositSchema: ISchema = {
}
},
},
}
}
}
......
import React, { useState, useEffect, useRef } from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions } from '@formily/antd';
import { Button, Card } from 'antd';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import { getBillsDetailSchema } from './schema';
import { PublicApi } from '@/services/api';
const addSchemaAction = createFormActions();
const AddBills: React.FC<{}> = (props: any) => {
const ref = useRef({});
const [warehouseList, setWarehouseList] = useState<any>([]);
// useEffect(() => {
// PublicApi.getWarehouseWarehouseList({
// current: '1',
// pageSize: '10000',
// }).then((res: any) => {
// let list = [];
// for (let item of res.data) {
// list.push({ label: item.name, value: item.id });
// }
// setWarehouseList(list);
// });
// }, []);
const handleSubmit = value => {
if (usePageStatus().pageStatus === 0)
return PublicApi.postWarehouseInvoicesAdd({ ...value }).then(res => {
if (res.data.code === 1000) {
history.goBack();
}
});
else
return PublicApi.postWarehouseInvoicesUpdata({
id: usePageStatus().id,
...value,
}).then(res => {
if (res.data.code === 1000) {
history.goBack();
}
});
};
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={
usePageStatus().pageStatus === 0
? '新建单据'
: usePageStatus().pageStatus === 1
? '编辑单据'
: '查看单据'
}
extra={
usePageStatus().preview != '1'
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
onClick={() => addSchemaAction.submit()}
>
保存
</Button>,
]
: []
}
>
<Card>
<NiceForm
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={getBillsDetailSchema(warehouseList)}
/>
</Card>
</PageHeaderWrapper>
);
};
export default AddBills;
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import {
Tooltip,
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import {
PlusOutlined,
EyeOutlined,
UpOutlined,
DeleteOutlined,
DownOutlined,
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Button, Card, Dropdown, Menu, Row, Col, Space, Badge } from 'antd';
import { PlusOutlined, DownOutlined, DeleteOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { billsSchema } from './schema';
import UploadModal from '@/components/UploadModal';
import { PublicApi } from '@/services/api';
import style from './index.less';
const formActions = createFormActions();
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getWarehouseInvoicesList({
invoicesNo: '',
invoicesType: '',
invoicesAbstract: '',
memberName: '',
inventoryId: '',
startTransactionTime: '',
endTransactionTime: '',
orderNo: '',
state: '',
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
});
};
const Bills: React.FC<{}> = () => {
return <div>Bills</div>;
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [visibleModal, setVisibleModal] = useState(false);
const [moreVisible, setMoreVisible] = useState(false);
const menu = (
<Menu onClick={e => handleBatchDel(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}>
删除导入批次
</Menu.Item>
</Menu>
);
const handleBatchDel = (e: any) => {};
const handleMoreMenu = (e: any, record: any) => {
if (e.key != '3') {
history.push(
`/memberCenter/tranactionAbility/stockSellStorage/addBills?id=${record.id}`,
);
} else {
}
};
const columns: ColumnType<any>[] = [
{
title: '单据号',
dataIndex: 'invoicesNo',
align: 'center',
key: 'invoicesNo',
render: (text: any, record: any) => (
<EyePreview
url={`/memberCenter/tranactionAbility/stockSellStorage/addBills?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
),
},
{
title: '单据类型',
align: 'center',
dataIndex: 'invoicesType',
key: 'invoicesType',
},
{
title: '单据摘要',
align: 'center',
dataIndex: 'invoicesAbstract',
key: 'invoicesAbstract',
},
{
title: '会员名称',
align: 'center',
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '对应仓库',
align: 'center',
dataIndex: 'inventory',
key: 'inventory',
},
{
title: '交易时间',
align: 'center',
dataIndex: 'transactionTime',
key: 'transactionTime',
},
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '单据状态',
align: 'center',
dataIndex: 'state',
key: 'state',
filters: [
{ text: 'Male', value: 'male' },
{ text: 'Female', value: 'female' },
],
filterMultiple: false,
render: (text: any, record: any) => (
<Badge
color={record.status === 1 ? '#C1C7D0' : '#41CC9E'}
text={record.status === 1 ? '未审核' : '已审核'}
/>
),
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (text: any, record: any) => {
return (
<>
<Button type="link">审核</Button>
<Dropdown
visible={moreVisible}
overlay={
<Menu onClick={e => handleMoreMenu(e, record)}>
<Menu.Item key="1">修改</Menu.Item>
<Menu.Item key="2">反审</Menu.Item>
<Menu.Item key="3">删除</Menu.Item>
</Menu>
}
trigger={['click']}
>
<Button type="link" onClick={() => setMoreVisible(!moreVisible)}>
更多
<DownOutlined />
</Button>
</Dropdown>
</>
);
},
},
];
const handleAdd = () => {};
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {},
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: 'key' }}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row justify="space-between">
<Col>
<Space>
<Button
type="primary"
icon={<PlusOutlined />}
onClick={() =>
history.push(
'/memberCenter/tranactionAbility/stockSellStorage/addBills',
)
}
>
新建
</Button>
<Button
style={{ margin: '12px' }}
onClick={() => setVisibleModal(true)}
>
导入
</Button>
<Dropdown.Button
overlay={menu}
trigger={['click']}
icon={<DownOutlined />}
>
更多
</Dropdown.Button>
</Space>
</Col>
<Col>
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}}
schema={billsSchema}
/>
</Col>
</Row>
}
/>
<UploadModal
visibleModal={visibleModal}
fileText="会员资料"
onCancel={() => setVisibleModal(false)}
/>
</Card>
</PageHeaderWrapper>
);
};
export default Bills;
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const billsSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
visible: false,
'x-component-props': {
inline: true,
},
properties: {
invoicesNo: {
type: 'string',
'x-component-props': {
placeholder: '单据号',
},
},
invoicesAbstract: {
type: 'string',
'x-component-props': {
placeholder: '单据摘要',
},
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: '会员名称',
},
},
orderNo: {
type: 'string',
'x-component-props': {
placeholder: '订单号',
},
},
invoicesType: {
type: 'string',
'x-component-props': {
placeholder: '请选择单据类型',
},
enum: [],
},
inventory: {
type: 'string',
'x-component-props': {
placeholder: '请选择对应仓库',
},
enum: [],
},
state: {
type: 'string',
'x-component-props': {
placeholder: '请选择单据状态',
},
enum: [],
},
time: {
type: 'string',
'x-component-props': {
placeholder: '请选择交易时间',
},
enum: [],
},
},
},
},
},
},
};
export const getBillsDetailSchema = warehouseList => {
const billsDetailSchema: ISchema = {
type: 'object',
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {
type: 'card',
},
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
},
properties: {
name: {
type: 'string',
title: '单据类型',
enum: [
{ label: '采购入库单', value: '1' },
{ label: '销售发货单', value: '2' },
{ label: '加工入库单', value: '3' },
{ label: '加工发货单', value: '4' },
{ label: '退货发货单', value: '5' },
{ label: '退货入库单', value: '6' },
{ label: '换货发货单', value: '7' },
{ label: '换货入库单', value: '8' },
],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
inventory: {
type: 'string',
title: '对应仓库',
enum: warehouseList,
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
invoicesAbstract: {
type: 'string',
title: '单据摘要',
required: true,
},
person: {
type: 'string',
title: '仓库人员',
required: true,
},
time: {
type: 'date',
title: '单据时间',
'x-component-props': {
format: 'YYYY-MM-DD HH:mm:ss',
},
required: true,
},
relevanceInvoices: {
type: 'radio',
title: '对应单据',
required: true,
enum: [
{ label: '订单', value: 1 },
{ label: '换货申请单', value: 2 },
{ label: '退货申请单', value: 3 },
{ label: '生产通知单', value: 4 },
{ label: '内部单据', value: 5 },
],
default: 1,
},
itemNo: {
type: 'string',
'x-component': 'Text',
title: '对应货品',
default: '暂无',
},
memberName: {
type: 'string',
'x-component': 'Text',
title: '会员名称',
default: '暂无',
},
relevanceInvoicesId: {
type: 'string',
'x-component': 'CustomRelevance',
title: '关联单据',
},
// itemNo: {
// type: 'string',
// 'x-component': 'Text',
// title: '单据时间',
// default: '暂无',
// },
// itemNo: {
// type: 'string',
// 'x-component': 'Text',
// title: '对应货品',
// default: '暂无',
// },
// warehouseId: {
// type: 'string',
// title: '仓库名称',
// enum: [],
// },
// itemNo: {
// type: 'string',
// 'x-component': 'Text',
// title: '对应货品',
// default: '暂无',
// },
// inventory: {
// type: 'number',
// 'x-component': 'CustomSlider',
// required: true,
// 'x-component-props': {
// min: 0,
// max: 200,
// },
// title: '分配仓位库存',
// },
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'tabpane',
'x-component-props': {
tab: '单据明细',
},
properties: {
MEGA_LAYOUT2: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
labelCol: 4,
labelAlign: 'left',
},
properties: {
shopIds: {
type: 'array:number',
'x-component': 'CardCheckBox',
'x-component-props': {
dataSource: [
{ logo: '', title: '会员', id: 1 },
{ logo: '', title: '小程序', id: 2 },
{ logo: '', title: 'H5', id: 3 },
{ logo: '', title: '渠道', id: 4 },
],
},
title: '适用商城',
required: true,
},
},
},
},
},
},
},
},
};
return billsDetailSchema;
};
import React, { useState, useEffect, useRef } from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions } from '@formily/antd';
import { Button, Card } from 'antd';
import ReutrnEle from '@/components/ReturnEle';
import {
SchemaForm,
SchemaMarkupField as Field,
FormMegaLayout,
} from '@formily/antd';
import { Input, Select } from '@formily/antd-components';
import { PublicApi } from '@/services/api';
const addSchemaAction = createFormActions();
const AddWarehouse: React.FC<{}> = (props: any) => {
const ref = useRef({});
useEffect(() => {
console.log(usePageStatus());
});
const handleSubmit = value => {
if (usePageStatus().pageStatus === 0) {
PublicApi.postWarehouseInvoicesTypeAdd({ ...value });
} else {
PublicApi.postWarehouseInvoicesTypeUpdate({
id: usePageStatus().id,
...value,
});
}
history.goBack();
};
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={
usePageStatus().pageStatus === 0
? '新建单据类型'
: usePageStatus().pageStatus === 1
? '编辑单据类型'
: '查看单据类型'
}
extra={
usePageStatus().preview != '1'
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
onClick={() => addSchemaAction.submit()}
>
保存
</Button>,
]
: []
}
>
<Card>
<SchemaForm
editable={usePageStatus().preview != '1'}
actions={addSchemaAction}
components={{ Input, Select }}
onSubmit={value => handleSubmit(value)}
>
<FormMegaLayout labelCol={4} labelAlign="left" wrapperCol={12}>
<Field
name="number"
title="单据类型编号"
x-component="Input"
x-component-props={{
placeholder: '最长10个字符',
maxLength: 10,
}}
required
/>
<Field
name="name"
title="单据类型名称"
x-component="Input"
x-component-props={{
placeholder: '最长20个字符,10个汉字',
maxLength: 10,
}}
required
/>
<Field
name="direction"
title="仓库负责人"
enum={[
{ label: '入库', value: 1 },
{ label: '出库', value: 2 },
]}
x-component="Select"
x-component-props={{ placeholder: '请选择' }}
required
/>
</FormMegaLayout>
</SchemaForm>
</Card>
</PageHeaderWrapper>
);
};
export default AddWarehouse;
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Tooltip, Input, Button, Card, Row, Col, Popconfirm } from 'antd';
import {
Tooltip,
Input,
Button,
Card,
Row,
Col,
Space,
Popconfirm,
} from 'antd';
import {
PlusOutlined,
EyeOutlined,
PlayCircleOutlined,
PauseCircleOutlined,
} from '@ant-design/icons';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
import { PublicApi } from '@/services/api';
const data = [
{
key: '1',
id: '1',
no: 'DJ001',
name: '进货入库单',
direction: 1,
status: 1,
},
{
key: '2',
id: '2',
no: 'DJ002',
name: '退货入库单',
direction: 2,
status: 2,
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getWarehouseInvoicesTypeList({
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
});
};
const billsType: React.FC<{}> = () => {
const ref = useRef({});
......@@ -44,9 +48,9 @@ const billsType: React.FC<{}> = () => {
},
{
title: '单据类型编号',
dataIndex: 'no',
dataIndex: 'number',
align: 'center',
key: 'no',
key: 'number',
},
{
title: '单据名称',
......@@ -55,10 +59,11 @@ const billsType: React.FC<{}> = () => {
key: 'name',
render: (text: any, record: any) => {
return (
<span className="commonPickColor" onClick={() => history.push('')}>
{text}&nbsp;
<EyeOutlined />
</span>
<EyePreview
url={`/memberCenter/tranactionAbility/stockSellStorage/addBillsType?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
);
},
},
......@@ -68,12 +73,7 @@ const billsType: React.FC<{}> = () => {
align: 'center',
key: 'direction',
render: (text: any, record: any) => {
return (
<span>
{text}
{record.direction === 1 ? ' +' : ' -'}
</span>
);
return <span>{record.direction === 1 ? '入库 +' : '出库 -'}</span>;
},
},
{
......@@ -84,31 +84,10 @@ const billsType: React.FC<{}> = () => {
sorter: true,
render: (text: any, record: any) => {
return (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => console.log('...')}
onCancel={() => console.log('...')}
okText="是"
cancelText="否"
>
<Button
type="link"
onClick={() => console.log('???')}
style={
record.status === 1 ? { color: '#00B37A' } : { color: 'red' }
}
>
{record.status === 1 ? (
<>
有效 <PlayCircleOutlined />
</>
) : (
<>
无效 <PauseCircleOutlined />
</>
)}
</Button>
</Popconfirm>
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
/>
);
},
},
......@@ -116,9 +95,16 @@ const billsType: React.FC<{}> = () => {
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => (
render: (text: any, record: any) => (
<>
<Button type="link" onClick={record => history.push('')}>
<Button
type="link"
onClick={() =>
history.push(
`/memberCenter/tranactionAbility/stockSellStorage/addBillsType?id=${record.id}`,
)
}
>
编辑
</Button>
<Popconfirm
......@@ -135,22 +121,13 @@ const billsType: React.FC<{}> = () => {
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
});
};
const handleReset = () => {};
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record);
};
return (
<PageHeaderWrapper>
<Card>
......@@ -160,39 +137,38 @@ const billsType: React.FC<{}> = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row>
<Col span={12}>
<Button
type="primary"
onClick={() =>
history.push(
'/memberCenter/memberAbility/manage/addMember?type=add',
)
}
>
<PlusOutlined />
新建
</Button>
<Row justify="space-between" style={{ marginBottom: '16px' }}>
<Col>
<Space>
<Button
type="primary"
onClick={() =>
history.push(
'/memberCenter/tranactionAbility/stockSellStorage/addBillsType',
)
}
>
<PlusOutlined />
新建
</Button>
</Space>
</Col>
<Col span={12} style={{ textAlign: 'right' }}>
<Tooltip
trigger={['focus']}
placement="top"
title={<span>输入单据名称进行搜索</span>}
>
<Input.Search
style={{ width: '232px' }}
value={searchName}
placeholder="搜索"
onChange={e => setSearchName(e.target.value)}
/>
</Tooltip>
<Button
style={{ marginLeft: '16px' }}
onClick={() => handleReset()}
>
重置
</Button>
<Col>
<Space style={{ justifyContent: 'flex-end', width: '100%' }}>
<Tooltip
trigger={['focus']}
placement="top"
title={<span>输入单据名称进行搜索</span>}
>
<Input.Search
style={{ width: '232px' }}
value={searchName}
placeholder="搜索"
onChange={e => setSearchName(e.target.value)}
/>
</Tooltip>
<Button onClick={() => handleReset()}>重置</Button>
</Space>
</Col>
</Row>
}
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import {
Tooltip,
Input,
Select,
Button,
Card,
Dropdown,
Menu,
Row,
Col,
Popconfirm,
} from 'antd';
import {
PlusOutlined,
EyeOutlined,
UpOutlined,
DeleteOutlined,
DownOutlined,
} from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Input, Card } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { inventorySchema } from './schema';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getWarehouseInventoryList({
itemNo: '',
goodsName: '',
specifications: '',
category: '',
brand: '',
warehouseId: '',
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
});
};
const Inventory: React.FC<{}> = () => {
return <div>Inventory</div>;
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [
{
title: 'ID',
align: 'center',
dataIndex: 'id',
key: 'id',
},
{
title: '商品名称',
dataIndex: 'goodsName',
align: 'center',
key: 'goodsName',
render: (text: any, record: any) => (
<EyePreview
url={`/repositories/viewRepository?id=${record.key}&preview=1`}
>
{text}
</EyePreview>
),
},
{
title: '规格型号',
align: 'center',
dataIndex: 'specifications',
key: 'specifications',
},
{
title: '品类',
align: 'center',
dataIndex: 'category',
key: 'category',
},
{
title: '品牌',
align: 'center',
dataIndex: 'brand',
key: 'brand',
},
{
title: '单位',
align: 'center',
dataIndex: 'unit',
key: 'unit',
},
{
title: '价格',
align: 'center',
dataIndex: 'price',
key: 'price',
},
{
title: '仓库',
align: 'center',
dataIndex: 'warehouse',
key: 'warehouse',
},
{
title: '库存',
align: 'center',
dataIndex: 'inventory',
key: 'inventory',
},
{
title: '安全库存',
align: 'center',
dataIndex: 'safeStock',
key: 'safeStock',
render: (text: any, record: any) => {
return (
<Input
value={record.safeInventory}
allowClear
onChange={e => handleChange(e)}
></Input>
);
},
},
];
const handleChange = (e: any) => {
console.log(e);
};
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: 'key' }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}}
schema={inventorySchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
);
};
export default Inventory;
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const inventorySchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
visible: false,
'x-component-props': {
inline: true,
},
properties: {
specifications: {
type: 'string',
'x-component-props': {
placeholder: '请选择',
},
enum: [],
},
category: {
type: 'string',
'x-component-props': {
placeholder: '请选择品类',
},
enum: [],
},
brand: {
type: 'string',
'x-component-props': {
placeholder: '请选择品牌',
},
enum: [],
},
warehouse: {
type: 'string',
'x-component-props': {
placeholder: '请选择仓库',
},
enum: [],
},
},
},
},
},
},
};
import React, { useState, useEffect, useRef } from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions } from '@formily/antd';
import { Button, Card } from 'antd';
import ReutrnEle from '@/components/ReturnEle';
import {
SchemaForm,
SchemaMarkupField as Field,
FormMegaLayout,
} from '@formily/antd';
import { Input, Select } from '@formily/antd-components';
import { PublicApi } from '@/services/api';
const addSchemaAction = createFormActions();
const AddWarehouse: React.FC<{}> = (props: any) => {
const ref = useRef({});
const [provinceList, setProvinceList] = useState([]);
const [cityList, setCityList] = useState([]);
const [areaList, setAreaList] = useState([]);
// 初始获取各省选项
useEffect(() => {
getAddressList('province');
}, []);
const getAddressList = (type, id?) => {
PublicApi.getManageAreaByPcodeAll({ pcode: getCode(type, id) }).then(
res => {
let options = [];
for (let item of res.data) {
options.push({ label: item.name, value: item.id, code: item.code });
}
if (type === 'province') {
setProvinceList(options);
} else if (type === 'city') {
setCityList(options);
setAreaList([]);
} else {
setAreaList(options);
}
},
);
};
// 获取地区code,用于请求下级地区
const getCode = (type, id) => {
let code = '';
if (type === 'province') return '100000';
if (type === 'city') {
provinceList.find(target => {
if (target.value === id) {
code = target.code;
}
});
} else {
cityList.find(target => {
if (target.value === id) {
code = target.code;
}
});
}
return code;
};
const handleSubmit = value => {
console.log(value);
PublicApi.postWarehouseWarehouseAdd({ ...value }).then(res => {});
};
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={
usePageStatus().pageStatus === 0
? '新建仓库'
: usePageStatus().pageStatus === 1
? '编辑仓库'
: '查看仓库'
}
extra={
usePageStatus().preview != '1'
? [
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
onClick={() => addSchemaAction.submit()}
>
保存
</Button>,
]
: []
}
>
<Card>
<SchemaForm
editable={usePageStatus().preview != '1'}
actions={addSchemaAction}
components={{ Input, Select, Textarea: Input.TextArea }}
onSubmit={value => handleSubmit(value)}
>
<FormMegaLayout labelCol={4} labelAlign="left" wrapperCol={12}>
<Field name="name" title="仓库名称" x-component="Input" required />
<FormMegaLayout label="仓库地址" wrapperCol={24} required>
<FormMegaLayout grid full autoRow columns={3}>
<Field
name="provinceId"
enum={provinceList}
x-component="Select"
x-component-props={{
placeholder: '- 省 -',
onChange: val => getAddressList('city', val),
}}
required
/>
<Field
name="cityId"
enum={cityList}
x-component="Select"
x-component-props={{
placeholder: '- 市 -',
onChange: val => getAddressList('area', val),
}}
required
/>
<Field
name="areaId"
enum={areaList}
x-component="Select"
x-component-props={{
placeholder: '- 县/区 -',
}}
required
/>
</FormMegaLayout>
<Field
name="address"
x-component="Textarea"
x-component-props={{
placeholder: '请输入详细地址(最长50个字符,25个汉字)',
rules: [{ message: '请输入详细地址' }],
}}
required
/>
</FormMegaLayout>
<Field name="principal" title="仓库负责人" x-component="Input" />
<FormMegaLayout label="联系电话" grid full wrapperCol={24}>
<Field
name="countryCode"
enum={['1', '2', '3', '4']}
x-component="Select"
x-component-props={{ placeholder: '请选择' }}
/>
<Field
x-mega-props={{ span: 3 }}
name="tel"
x-component="Input"
x-component-props={{ placeholder: '请输入你的手机号码' }}
/>
</FormMegaLayout>
</FormMegaLayout>
</SchemaForm>
</Card>
</PageHeaderWrapper>
);
};
export default AddWarehouse;
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Tooltip, Input, Button, Card, Row, Col, Popconfirm } from 'antd';
import {
PlusOutlined,
EyeOutlined,
PlayCircleOutlined,
PauseCircleOutlined,
} from '@ant-design/icons';
Tooltip,
Input,
Button,
Card,
Row,
Col,
Space,
Popconfirm,
} from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
import { PublicApi } from '@/services/api';
const data = [
{
key: '1',
id: '1',
name: '广州成品仓',
address: '广东省广州市海珠区新港东路1068号中洲中心北塔6楼',
person: '蒯美政',
phoneMobile: '185 2929 5432',
status: 1,
},
{
key: '2',
id: '2',
name: '广州成品仓',
address: '广东省广州市海珠区新港东路1068号中洲中心北塔6楼',
person: '蒯美政',
phoneMobile: '185 2929 5432',
status: 2,
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getWarehouseWarehouseList({
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
});
};
const WareHouse: React.FC<{}> = () => {
const ref = useRef({});
......@@ -51,10 +49,11 @@ const WareHouse: React.FC<{}> = () => {
key: 'name',
render: (text: any, record: any) => {
return (
<span className="commonPickColor" onClick={() => history.push('')}>
{text}&nbsp;
<EyeOutlined />
</span>
<EyePreview
url={`/memberCenter/tranactionAbility/stockSellStorage/addWarehouse?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
);
},
},
......@@ -66,49 +65,28 @@ const WareHouse: React.FC<{}> = () => {
},
{
title: '仓库负责人',
dataIndex: 'person',
dataIndex: 'principal',
align: 'center',
key: 'person',
key: 'principal',
},
{
title: '联系电话',
dataIndex: 'phoneMobile',
dataIndex: 'tel',
align: 'center',
key: 'phoneMobile',
key: 'tel',
},
{
title: '状态',
dataIndex: 'status',
dataIndex: 'state',
align: 'center',
key: 'status',
key: 'state',
sorter: true,
render: (text: any, record: any) => {
return (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => console.log('...')}
onCancel={() => console.log('...')}
okText="是"
cancelText="否"
>
<Button
type="link"
onClick={() => console.log('???')}
style={
record.status === 1 ? { color: '#00B37A' } : { color: 'red' }
}
>
{record.status === 1 ? (
<>
有效 <PlayCircleOutlined />
</>
) : (
<>
无效 <PauseCircleOutlined />
</>
)}
</Button>
</Popconfirm>
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
/>
);
},
},
......@@ -116,9 +94,16 @@ const WareHouse: React.FC<{}> = () => {
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => (
render: (text: any, record: any) => (
<>
<Button type="link" onClick={record => history.push('')}>
<Button
type="link"
onClick={() =>
history.push(
`/memberCenter/tranactionAbility/stockSellStorage/addWarehouse?id=${record.id}`,
)
}
>
编辑
</Button>
<Popconfirm
......@@ -135,22 +120,13 @@ const WareHouse: React.FC<{}> = () => {
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
});
};
const handleReset = () => {};
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record);
};
return (
<PageHeaderWrapper>
<Card>
......@@ -160,39 +136,41 @@ const WareHouse: React.FC<{}> = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row>
<Col span={12}>
<Button
type="primary"
onClick={() =>
history.push(
'/memberCenter/memberAbility/manage/addMember?type=add',
)
}
>
<PlusOutlined />
新建
</Button>
<Row justify="space-between" style={{ marginBottom: '16px' }}>
<Col>
<Space>
<Button
type="primary"
onClick={() =>
history.push({
pathname:
'/memberCenter/tranactionAbility/stockSellStorage/addWarehouse',
query: {
type: 'add',
},
})
}
>
<PlusOutlined />
新建
</Button>
</Space>
</Col>
<Col span={12} style={{ textAlign: 'right' }}>
<Tooltip
trigger={['focus']}
placement="top"
title={<span>输入仓库名称进行搜索</span>}
>
<Input.Search
style={{ width: '232px' }}
value={searchName}
placeholder="搜索"
onChange={e => setSearchName(e.target.value)}
/>
</Tooltip>
<Button
style={{ marginLeft: '16px' }}
onClick={() => handleReset()}
>
重置
</Button>
<Col>
<Space style={{ justifyContent: 'flex-end', width: '100%' }}>
<Tooltip
trigger={['focus']}
placement="top"
title={<span>输入仓库名称进行搜索</span>}
>
<Input.Search
value={searchName}
placeholder="搜索"
onChange={e => setSearchName(e.target.value)}
/>
</Tooltip>
<Button onClick={() => handleReset()}>重置</Button>
</Space>
</Col>
</Row>
}
......
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