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

修改物流能力 物流单提交的BUG,需求对接 指定会员的BUG

parent 7dadaf2f
......@@ -5,9 +5,9 @@ import {
createFormActions,
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { Input, Radio, FormMegaLayout, NumberPicker } from '@formily/antd-components'
import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
import { PATTERN_MAPS } from '@/constants/regExp'
export interface Params {
id: number | string;
dialogVisible: boolean;
......@@ -46,6 +46,13 @@ const comfirmDialog: React.FC<Params> = (props) => {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value != 4) {
state.visible = false
} else {
state.visible = true
}
})
})
}
......@@ -65,7 +72,7 @@ const comfirmDialog: React.FC<Params> = (props) => {
<SchemaForm
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
Input, Radio: Radio.Group, TextArea: Input.TextArea, NumberPicker
}}
actions={actions}
effects={() => useFormEffects()}
......@@ -74,6 +81,19 @@ const comfirmDialog: React.FC<Params> = (props) => {
status: 4
}}
>
{props.dontReceive &&
<>
<Field
title='运费'
name='freightPrice'
x-component="numberpicker"
x-mega-prop={{
wrapperWidth: 300,
labelAlign: 'left'
}}
/>
</>
}
<Field
enum={
[
......@@ -96,10 +116,13 @@ const comfirmDialog: React.FC<Params> = (props) => {
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules ={{
max:60,
x-mega-prop={{
labelAlign: 'left'
}}
x-rules={{
max: 60,
// maximum:10,//最大数值
message:'原因最多60个汉字'
message: '原因最多60个汉字'
}}
/>
......
import { ISchema } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { FORM_FILTER_PATH } from '@/formSchema/const';
// 选择发货单
export const deliveryNumberSchema: ISchema = {
type: 'object',
properties: {
invoicesNo: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '发货单号',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
orderNo: {
type: 'string',
"x-component-props": {
placeholder: '对应订单号',
}
},
invoicesAbstract: {
type: 'string',
"x-component-props": {
placeholder: '单据摘要',
}
},
invoicesType: {
type: 'string',
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择单据类型',
className: 'fixed-ant-selected-down',
fetchSearch: PublicApi.getWarehouseInvoicesTypeAll,
style: {
width: 160
}
}
},
"[startTransactionTime,endTransactionTime]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: '单据时间(全部)',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
// 选择订货单
export const orderNumberSchema: ISchema = {
type: 'object',
properties: {
orderNo: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '单据号',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
supplyMembersName: {
type: 'string',
"x-component-props": {
placeholder: '会员名称',
}
},
orderThe: {
type: 'string',
"x-component-props": {
placeholder: '单据摘要',
}
},
voucherTime: {
type: 'string',
"x-component-props": {
placeholder: '单据选择'
},
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},
]
},
"[startCreateTime,endCreateTime]": {
type: 'string',
"x-component": "dateSelect",
"x-component-props": {
placeholder: '单据时间(全部)',
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
\ No newline at end of file
......@@ -6,6 +6,13 @@ import { ColumnType, TableRowSelection } from 'antd/lib/table/interface'
import style from '../components/index.less'
import { PublicApi } from '@/services/api'
import { values } from 'lodash';
import Search from '@/components/NiceForm/components/Search'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import Submit from '@/components/NiceForm/components/Submit'
import DateSelect from '@/components/NiceForm/components/DateSelect'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { deliveryNumberSchema, orderNumberSchema } from './schema'
let { Option } = Select
export interface Params {
title: string;
......@@ -127,20 +134,8 @@ const listDialog: React.FC<Params> = (props) => {
})
}
// return new Promise((resolve, reject) => {
// const queryResult = data.find(v => v.key === params.keywords)
// setTimeout(() => {
// resolve({
// code: 200,
// message: '',
// data: queryResult ? [queryResult] : data
// })
// }, 1000)
// })
}
useEffect(() => {
return () => {
}
}, [])
......@@ -164,13 +159,35 @@ const listDialog: React.FC<Params> = (props) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
}
}
const orderNoType = [
{ label: '所有', value: '' },
{ label: '采购入库单', value: 1 },
{ label: '销售发货单', value: 2 },
{ label: '换货发货单', value: 3 },
{ label: '退货发货单', value: 4 }
]
const modelSchemaRender = () => {
switch (props.type) {
case 1: {
return orderNumberSchema
}
case 2: {
return deliveryNumberSchema
}
default: {
return
}
}
}
const modelSchemaName = () => {
switch (props.type) {
case 1: {
return 'orderNo'
}
case 2: {
return 'invoicesNo'
}
default: {
return
}
}
}
return (
<>
<Modal
......@@ -178,7 +195,7 @@ const listDialog: React.FC<Params> = (props) => {
width={960}
visible={props.dialogVisible}
onOk={() => handletOk()}
onCancel={() => props.onCancel()}
onCancel={() => {props.onCancel();console.log(props.type)}}
destroyOnClose
afterClose={() => Reset()}
okText='确定'
......@@ -193,190 +210,208 @@ const listDialog: React.FC<Params> = (props) => {
...rowSelection
}}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<>
<Row>
<Col span={24}>
{
//选择订单
props.type === 1 &&
<>
<Select
style={{
marginRight: '16px'
}}
value={searchForm.orderType}
onChange={(val) => setSearchForm({ ...searchForm, orderType: val })}
>
<Option value=''>单据来源:订单</Option>
<Option value='1'>订单</Option>
<Option value='2'>换货时申请单(退货发货)</Option>
<Option value='3'>换货申请单(换货发货)</Option>
<Option value='4'>退货申请单</Option>
</Select>
<Tooltip trigger={['focus']} placement='top'
title='输入单据号进行搜索'>
<Input.Search
style={{ width: '232px' }}
value={searchForm.orderNo}
placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, orderNo: e.target.value })}
onSearch={() => handleSearch}
/>
</Tooltip>
</>
formilyProps={{
ctx: {
schema: modelSchemaRender(),
components: {
ModalSearch: Search,
SearchSelect,
Submit,
DateSelect,
},
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
modelSchemaName(),
FORM_FILTER_PATH,
);
}
{
props.type === 2 &&
<>
<Tooltip trigger={['focus']} placement='top'
title='输入发货单号进行搜索'>
<Input.Search
style={{ width: '232px' }}
value={searchForm.searName}
placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
onSearch={() => handleSearch}
/>
</Tooltip>
</>
}
{
//选择商品
props.type === 3 &&
<>
<Select
style={{
marginRight: '16px'
}}
value={searchForm.buyer}
onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
>
<Option value=''>来源:发货单</Option>
<Option value='1'>发货单</Option>
<Option value='2'>订单/售后单</Option>
</Select>
<Tooltip trigger={['focus']} placement='top'
title='输入商品名称进行搜索'>
<Input.Search
style={{ width: '232px' }}
value={searchForm.searName}
placeholder='搜索'
onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
onSearch={() => handleSearch}
/>
</Tooltip>
</>
}
<Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch)}>
高级筛选{isSearch ? <UpOutlined /> : <DownOutlined />}
</Button>
<Button className={style.selectBtn} onClick={() => handleReset()}>重置</Button>
</Col>
</Row>
<Row style={{ margin: '16px 0' }}>
{
isSearch &&
<Col>
<Space size={16}>
{
props.type === 1 ?
<>
// controlRender={
// <>
// <Row>
// <Col span={24}>
// {
// //选择订单
// props.type === 1 &&
// <>
// <Select
// style={{
// marginRight: '16px'
// }}
// value={searchForm.orderType}
// onChange={(val) => setSearchForm({ ...searchForm, orderType: val })}
// >
// <Option value=''>单据来源:订单</Option>
// <Option value='1'>订单</Option>
// <Option value='2'>换货时申请单(退货发货)</Option>
// <Option value='3'>换货申请单(换货发货)</Option>
// <Option value='4'>退货申请单</Option>
// </Select>
// <Tooltip trigger={['focus']} placement='top'
// title='输入单据号进行搜索'>
// <Input.Search
// style={{ width: '232px' }}
// value={searchForm.orderNo}
// placeholder='搜索'
// onChange={(e) => setSearchForm({ ...searchForm, orderNo: e.target.value })}
// onSearch={() => handleSearch}
// />
// </Tooltip>
<Input.Search
style={{ width: '232px' }}
value={searchForm.orderThe}
placeholder='搜索单据摘要'
onChange={(e) => setSearchForm({ ...searchForm, orderThe: e.target.value })}
onSearch={() => handleSearch}
/>
<Select
className={style.select}
value={searchForm.supplyMembersName}
onChange={(val) => setSearchForm({ ...searchForm, supplyMembersName: val })}
>
<Option value=''>会员名称(全部)</Option>
</Select>
</>
: props.type === 2 ?
//发货单
<>
<Input.Search
style={{ width: '232px' }}
value={searchForm.searName}
placeholder='对应订单号'
onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
onSearch={() => handleSearch}
/>
<Input.Search
style={{ width: '232px' }}
value={searchForm.searName}
placeholder='搜索单据摘要'
onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
onSearch={() => handleSearch}
/>
<Select
className={style.select}
value={searchForm.buyer}
onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
>
{
orderNoType.map((item, index) => {
return <Option value={item.value}>{item.label}</Option>
})
}
</Select>
</>
:
<>
<Select
className={style.select}
value={searchForm.buyer}
placeholder='商品品类'
onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
>
{
categoryList.map((item, index) => {
return <Option value={item.value}>{item.label}</Option>
})
}
</Select>
<Select
className={style.select}
value={searchForm.buyer}
placeholder='商品品牌'
onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
>
{
brandList.map((item, index) => {
return <Option value={item.value}>{item.label}</Option>
})
}
</Select>
</>
}
{
props.type !== 3 &&
<Select
className={style.select}
value={searchForm.TimeRange}
onChange={(val) => setSearchForm({ ...searchForm, TimeRange: val })}
>
{
TimeList.map((item) => {
return <Option value={item.value}>{item.label}</Option>
})
}
</Select>
}
</Space>
</Col>
}
</Row>
</>
// </>
// }
// {
// props.type === 2 &&
// <>
// <Tooltip trigger={['focus']} placement='top'
// title='输入发货单号进行搜索'>
// <Input.Search
// style={{ width: '232px' }}
// value={searchForm.searName}
// placeholder='搜索'
// onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
// onSearch={() => handleSearch}
// />
// </Tooltip>
// </>
// }
// {
// //选择商品
// props.type === 3 &&
// <>
// <Select
// style={{
// marginRight: '16px'
// }}
// value={searchForm.buyer}
// onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
// >
// <Option value=''>来源:发货单</Option>
// <Option value='1'>发货单</Option>
// <Option value='2'>订单/售后单</Option>
// </Select>
// <Tooltip trigger={['focus']} placement='top'
// title='输入商品名称进行搜索'>
// <Input.Search
// style={{ width: '232px' }}
// value={searchForm.searName}
// placeholder='搜索'
// onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
// onSearch={() => handleSearch}
// />
// </Tooltip>
// </>
// }
// <Button className={style['filter-btn']} onClick={() => setIsSearch(isSearch = !isSearch)}>
// 高级筛选{isSearch ? <UpOutlined /> : <DownOutlined />}
// </Button>
// <Button className={style.selectBtn} onClick={() => handleReset()}>重置</Button>
// </Col>
// </Row>
// <Row style={{ margin: '16px 0' }}>
// {
// isSearch &&
// <Col>
// <Space size={16}>
// {
// props.type === 1 ?
// <>
}
// <Input.Search
// style={{ width: '232px' }}
// value={searchForm.orderThe}
// placeholder='搜索单据摘要'
// onChange={(e) => setSearchForm({ ...searchForm, orderThe: e.target.value })}
// onSearch={() => handleSearch}
// />
// <Select
// className={style.select}
// value={searchForm.supplyMembersName}
// onChange={(val) => setSearchForm({ ...searchForm, supplyMembersName: val })}
// >
// <Option value=''>会员名称(全部)</Option>
// </Select>
// </>
// : props.type === 2 ?
// //发货单
// <>
// <Input.Search
// style={{ width: '232px' }}
// value={searchForm.searName}
// placeholder='对应订单号'
// onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
// onSearch={() => handleSearch}
// />
// <Input.Search
// style={{ width: '232px' }}
// value={searchForm.searName}
// placeholder='搜索单据摘要'
// onChange={(e) => setSearchForm({ ...searchForm, searName: e.target.value })}
// onSearch={() => handleSearch}
// />
// <Select
// className={style.select}
// value={searchForm.buyer}
// onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
// >
// {
// orderNoType.map((item, index) => {
// return <Option value={item.value}>{item.label}</Option>
// })
// }
// </Select>
// </>
// :
// <>
// <Select
// className={style.select}
// value={searchForm.buyer}
// placeholder='商品品类'
// onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
// >
// {
// categoryList.map((item, index) => {
// return <Option value={item.value}>{item.label}</Option>
// })
// }
// </Select>
// <Select
// className={style.select}
// value={searchForm.buyer}
// placeholder='商品品牌'
// onChange={(val) => setSearchForm({ ...searchForm, buyer: val })}
// >
// {
// brandList.map((item, index) => {
// return <Option value={item.value}>{item.label}</Option>
// })
// }
// </Select>
// </>
// }
// {
// props.type !== 3 &&
// <Select
// className={style.select}
// value={searchForm.TimeRange}
// onChange={(val) => setSearchForm({ ...searchForm, TimeRange: val })}
// >
// {
// TimeList.map((item) => {
// return <Option value={item.value}>{item.label}</Option>
// })
// }
// </Select>
// }
// </Space>
// </Col>
// }
// </Row>
// </>
// }
/>
</Modal>
</>
......
......@@ -195,14 +195,14 @@ const Deatail: React.FC<{}> = () => {
{
title: '发货单号',
align: 'left',
dataIndex: 'orderNo',
key: 'orderNo',
dataIndex: 'invoicesNo',
key: 'invoicesNo',
},
{
title: '对应订单号',
align: 'center',
dataIndex: 'invoicesNo',
key: 'invoicesNo',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '单据摘要',
......
......@@ -21,14 +21,17 @@ const AddContract: React.FC<parmas> = (props) => {
const [fileExampleUrl, setFileExampleUrl] = useState<any>({});
const [uploadFile, setUploadFile] = useState<any>({});
const [fileUrl, setFileUrl] = useState<string>('');
const [loading, setloading] = useState(false);
const [data, setData] = useState<any>({});
/**判断文件类型和大小 */
const beforeDocUpload = (file: UploadFile) => {
const isJpgOrPng = file.type === 'application/msword' || file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
const name = file.name.split('.');
const type = name[name.length - 1];
const isJpgOrPng = type === 'doc' || type === 'docx';
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isJpgOrPng) {
message.error('doc/docx文件!');
message.error('不是doc/docx文件!');
}
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isLt20M) {
message.error('上传文件大小不超过 20M!');
}
......@@ -37,13 +40,15 @@ const AddContract: React.FC<parmas> = (props) => {
/**上传回调 */
const handleChange = ({ fileList }) => {
setloading(true);
if (fileList[0].response) {
const file = {
name: fileList[0].name,
file: fileList[0].response.data
}
setFileUrl(fileList[0].response.data)
setUploadFile(file)
setloading(false);
setFileUrl(fileList[0].response.data);
setUploadFile(file);
}
}
......@@ -129,7 +134,7 @@ const AddContract: React.FC<parmas> = (props) => {
contractName: file.name,
contractUrl: file.file
}).then(res => {
if(res.code === 1000) {
if (res.code === 1000) {
window.open(res.data.contractUrl)
}
})
......@@ -178,7 +183,7 @@ const AddContract: React.FC<parmas> = (props) => {
<span>{uploadFile.name}</span>
</div>
<div className={styles.upload_right}>
<span onClick={()=> onView(uploadFile)}>预览</span>
<span onClick={() => onView(uploadFile)}>预览</span>
{page_type && <DeleteOutlined onClick={delectContract} />}
</div>
</div>
......@@ -194,7 +199,7 @@ const AddContract: React.FC<parmas> = (props) => {
onChange={handleChange}
accept='.doc,.docx'
>
<Button icon={<UploadOutlined />}>上传文件</Button>
<Button loading={loading} disabled={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>支持扩展名:.doc,文件大小不超过 20M</div>
</Upload>
}
......
......@@ -142,7 +142,7 @@ interface AreaParams {
}
const fetchMemberList = async (params) => {
const res = await PublicApi.getMemberManageLowerProviderPage(params)
const res = await PublicApi.getMemberManageUpperProviderPage(params)
return res.data
}
......@@ -1331,16 +1331,8 @@ const Detail: React.FC<{}> = () => {
(platType != 1 && platType != 3) &&
<Table rowKey={"id"} dataSource={dockingList} columns={dockingColumn} pagination={pagination} />
}
</TabPane>
<TabPane tab="流转记录" key='5' forceRender>
{/* <Radio.Group value={memberType} optionType="button" buttonStyle="solid" onChange={(e) => handleMemberTypeChange(e)}>
<Radio value={0}>外部单据(0)</Radio>
<Radio value={1}>内部单据</Radio>
</Radio.Group> */}
<Tabs type="card" size="small" defaultActiveKey='1'>
<TabPane tab='外部单据' key="1">
<Table rowKey={'id'} dataSource={dataInfo.externalRequisitionForms || []} columns={externalColumn(formTime, externalTextState)} />
......
......@@ -76,7 +76,7 @@ const BasicInfo: React.FC<queryProps> = (props) => {
// 模拟数据
const fetchMemberList = async (params) => {
return new Promise((resolve, reject) => {
PublicApi.postOrderCorrespondingInquiryNumber({...params}).then(res => {
PublicApi.getOrderCorrespondingInquiryNumber({...params}).then(res => {
resolve(res.data)
})
});
......
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