Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
b874206d
Commit
b874206d
authored
Aug 06, 2020
by
tjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接单据类型
parent
ae8bf705
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
348 additions
and
200 deletions
+348
-200
addBills.tsx
src/pages/transaction/stockSellStorage/bills/addBills.tsx
+44
-23
index.tsx
src/pages/transaction/stockSellStorage/bills/index.tsx
+24
-21
index.tsx
...pages/transaction/stockSellStorage/bills/schema/index.tsx
+3
-12
addBillsType.tsx
...s/transaction/stockSellStorage/billsType/addBillsType.tsx
+25
-13
index.tsx
src/pages/transaction/stockSellStorage/billsType/index.tsx
+81
-48
addWarehouse.tsx
...s/transaction/stockSellStorage/warehouse/addWarehouse.tsx
+92
-40
index.tsx
src/pages/transaction/stockSellStorage/warehouse/index.tsx
+79
-43
index.ts
src/services/index.ts
+0
-0
No files found.
src/pages/transaction/stockSellStorage/bills/addBills.tsx
View file @
b874206d
...
...
@@ -2,7 +2,7 @@ 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
{
SaveOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
Button
,
Card
}
from
'antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
...
...
@@ -16,7 +16,9 @@ const { onFieldValueChange$ } = FormEffectHooks;
const
AddBills
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
ref
=
useRef
({});
const
{
pageStatus
,
preview
,
id
}
=
usePageStatus
();
const
[
warehouseList
,
setWarehouseList
]
=
useState
<
any
>
([]);
const
[
invoicesTypeList
,
setInvoicesTypeList
]
=
useState
<
any
>
([]);
const
[
relevance
,
setRelevance
]
=
useState
(
1
);
// 订单
...
...
@@ -156,36 +158,53 @@ const AddBills: React.FC<{}> = (props: 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
handleAddMemberBtn
=
()
=>
{};
// 删除选中单据明细
const
handleDeleteTable
=
id
=>
{};
const
tableAddButton
=
(
<
Button
style=
{
{
marginBottom
:
16
}
}
block
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAddMemberBtn
}
type=
"dashed"
>
添加单据明细
</
Button
>
);
useEffect
(()
=>
{
PublicApi
.
getWarehouseInvoicesTypeAll
().
then
(
res
=>
{
setInvoicesTypeList
(
getList
(
res
.
data
));
});
PublicApi
.
getWarehouseWarehouseAll
().
then
(
res
=>
{
setWarehouseList
(
getList
(
res
.
data
));
});
},
[]);
// 重组(单据类型、对应仓库)列表数据
const
getList
=
list
=>
{
let
newList
=
[];
for
(
let
item
of
list
)
{
newList
.
push
({
label
:
item
.
name
,
value
:
item
.
id
});
}
return
newList
;
};
const
handleSubmit
=
value
=>
{
if
(
usePageStatus
().
pageStatus
===
0
)
if
(
pageStatus
===
0
)
return
PublicApi
.
postWarehouseInvoicesAdd
({
...
value
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
1000
)
{
history
.
goBack
();
}
if
(
res
.
code
===
1000
)
return
history
.
goBack
();
});
else
return
PublicApi
.
postWarehouseInvoicesUpdata
({
id
:
usePageStatus
().
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
1000
)
{
history
.
goBack
();
}
if
(
res
.
code
===
1000
)
return
history
.
goBack
();
});
};
return
(
...
...
@@ -193,14 +212,14 @@ const AddBills: React.FC<{}> = (props: any) => {
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
usePageStatus
().
pageStatus
===
0
pageStatus
===
0
?
'新建单据'
:
usePageStatus
().
pageStatus
===
1
:
pageStatus
===
1
?
'编辑单据'
:
'查看单据'
}
extra=
{
usePageStatus
().
preview
!=
'1'
preview
!=
'1'
?
[
<
Button
key=
"1"
...
...
@@ -218,6 +237,7 @@ const AddBills: React.FC<{}> = (props: any) => {
<
NiceForm
expressionScope=
{
{
tableColumns
,
tableAddButton
,
}
}
effects=
{
$
=>
{
$
(
'onFieldValueChange'
,
'relevanceInvoices'
).
subscribe
(
state
=>
{
...
...
@@ -234,6 +254,7 @@ const AddBills: React.FC<{}> = (props: any) => {
onSubmit=
{
handleSubmit
}
actions=
{
addSchemaAction
}
schema=
{
getBillsDetailSchema
({
invoicesTypeList
,
warehouseList
,
relevance
,
modalColumns
,
...
...
src/pages/transaction/stockSellStorage/bills/index.tsx
View file @
b874206d
...
...
@@ -16,32 +16,22 @@ import { PublicApi } from '@/services/api';
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
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({});
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
string
>>
([]);
const
[
visibleModal
,
setVisibleModal
]
=
useState
(
false
);
const
[
moreVisible
,
setMoreVisible
]
=
useState
(
false
);
const
[
searchKey
,
setSearchKey
]
=
useState
({
invoicesNo
:
''
,
invoicesType
:
''
,
invoicesAbstract
:
''
,
memberName
:
''
,
inventoryId
:
''
,
startTransactionTime
:
''
,
endTransactionTime
:
''
,
orderNo
:
''
,
state
:
''
,
});
const
menu
=
(
<
Menu
onClick=
{
e
=>
handleBatchDel
(
e
)
}
>
...
...
@@ -159,6 +149,19 @@ const Bills: React.FC<{}> = () => {
},
];
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getWarehouseInvoicesList
({
...
searchKey
,
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
const
handleAdd
=
()
=>
{};
const
rowSelection
=
{
...
...
src/pages/transaction/stockSellStorage/bills/schema/index.tsx
View file @
b874206d
...
...
@@ -304,8 +304,6 @@ export const getBillsDetailSchema = params => {
},
}
:
{};
console
.
log
(
'params'
,
params
);
const
billsDetailSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
...
...
@@ -335,16 +333,7 @@ export const getBillsDetailSchema = params => {
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'
},
],
enum
:
params
.
invoicesTypeList
,
'x-component-props'
:
{
placeholder
:
'请选择'
,
},
...
...
@@ -414,7 +403,9 @@ export const getBillsDetailSchema = params => {
type
:
'array:number'
,
'x-component'
:
'MultTable'
,
'x-component-props'
:
{
rowKey
:
'memberId'
,
columns
:
'{{tableColumns}}'
,
prefix
:
'{{tableAddButton}}'
,
},
default
:
[
{
id
:
1
,
name
:
'名称'
,
type
:
'类型'
},
...
...
src/pages/transaction/stockSellStorage/billsType/addBillsType.tsx
View file @
b874206d
...
...
@@ -16,37 +16,48 @@ import { PublicApi } from '@/services/api';
const
addSchemaAction
=
createFormActions
();
const
AddWarehouse
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
ref
=
useRef
({});
const
AddWarehouse
:
React
.
FC
<
{}
>
=
props
=>
{
const
ref
=
useRef
<
any
>
({});
const
{
pageStatus
,
preview
,
id
}
=
usePageStatus
();
const
[
formValue
,
setFormValue
]
=
useState
<
any
>
({});
useEffect
(()
=>
{
console
.
log
(
usePageStatus
());
});
if
(
pageStatus
!=
0
)
{
PublicApi
.
getWarehouseInvoicesTypeDetails
({
id
:
id
,
}).
then
(
res
=>
{
setFormValue
(
res
.
data
);
});
}
},
[]);
const
handleSubmit
=
value
=>
{
if
(
usePageStatus
().
pageStatus
===
0
)
{
PublicApi
.
postWarehouseInvoicesTypeAdd
({
...
value
});
if
(
pageStatus
===
0
)
{
PublicApi
.
postWarehouseInvoicesTypeAdd
({
...
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
history
.
goBack
();
});
}
else
{
PublicApi
.
postWarehouseInvoicesTypeUpdate
({
id
:
usePageStatus
().
id
,
id
:
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
history
.
goBack
();
});
}
history
.
goBack
();
};
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
usePageStatus
().
pageStatus
===
0
pageStatus
===
0
?
'新建单据类型'
:
usePageStatus
().
pageStatus
===
1
:
pageStatus
===
1
?
'编辑单据类型'
:
'查看单据类型'
}
extra=
{
usePageStatus
().
preview
!=
'1'
preview
!=
'1'
?
[
<
Button
key=
"1"
...
...
@@ -62,7 +73,8 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
>
<
Card
>
<
SchemaForm
editable=
{
usePageStatus
().
preview
!=
'1'
}
value=
{
formValue
}
editable=
{
preview
!=
'1'
}
actions=
{
addSchemaAction
}
components=
{
{
Input
,
Select
}
}
onSubmit=
{
value
=>
handleSubmit
(
value
)
}
...
...
@@ -74,7 +86,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
x
-
component=
"Input"
x
-
component
-
props=
{
{
placeholder
:
'最长10个字符'
,
maxLength
:
10
,
maxLength
:
5
,
}
}
required
/>
...
...
src/pages/transaction/stockSellStorage/billsType/index.tsx
View file @
b874206d
...
...
@@ -11,33 +11,19 @@ import {
Space
,
Popconfirm
,
}
from
'antd'
;
import
{
PlusOutlined
,
PlayCircleOutlined
,
PauseCircleOutlined
,
}
from
'@ant-design/icons'
;
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
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
({});
const
[
searchName
,
setSearchName
]
=
useState
(
''
);
const
ref
=
useRef
<
any
>
({});
const
[
searchKey
,
setSearchKey
]
=
useState
<
any
>
({
name
:
''
,
state
:
''
,
});
const
columns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -97,48 +83,82 @@ const billsType: React.FC<{}> = () => {
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<>
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/addBillsType?id=${record.id}`
,
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handleDelete
(
record
)
}
onCancel=
{
()
=>
console
.
log
(
'...'
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
>
删除
</
Button
>
</
Popconfirm
>
{
record
.
state
!=
1
?
(
<>
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/addBillsType?id=${record.id}`
,
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handleDelete
(
record
)
}
onCancel=
{
()
=>
console
.
log
(
'...'
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
>
删除
</
Button
>
</
Popconfirm
>
</>
)
:
(
''
)
}
</>
),
},
];
const
handleReset
=
()
=>
{};
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getWarehouseInvoicesTypeList
({
...
searchKey
,
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
const
handleModify
=
(
record
:
object
)
=>
{
// 通过传入的params字符串判断是修改那种类型的数据
console
.
log
(
'执行状态修改'
,
record
);
const
handleModify
=
(
record
:
any
)
=>
{
PublicApi
.
postWarehouseInvoicesTypeStateUpdate
({
id
:
record
.
id
,
state
:
record
.
state
===
1
?
0
:
1
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
ref
.
current
.
reload
();
});
};
const
handleDelete
=
record
=>
{
PublicApi
.
postWarehouseInvoicesTypeDelete
({
id
:
record
.
id
,
}).
then
(
res
=>
{});
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
ref
.
current
.
reload
();
});
};
return
(
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
}
}
tableProps=
{
{
rowKey
:
'id'
,
onChange
:
(
pagination
,
filters
,
sorter
)
=>
{
let
state
=
sorter
.
order
===
'ascend'
?
1
:
sorter
.
order
===
'descend'
?
0
:
''
;
setSearchKey
({
...
searchKey
,
state
:
state
});
},
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
...
...
@@ -168,12 +188,25 @@ const billsType: React.FC<{}> = () => {
>
<
Input
.
Search
style=
{
{
width
:
'232px'
}
}
value=
{
search
N
ame
}
value=
{
search
Key
.
n
ame
}
placeholder=
"搜索"
onChange=
{
e
=>
setSearchName
(
e
.
target
.
value
)
}
onChange=
{
e
=>
setSearchKey
({
...
searchKey
,
name
:
e
.
target
.
value
})
}
onSearch=
{
(
val
,
e
)
=>
{
e
.
preventDefault
();
ref
.
current
.
reload
();
}
}
/>
</
Tooltip
>
<
Button
onClick=
{
()
=>
handleReset
()
}
>
重置
</
Button
>
<
Button
onClick=
{
()
=>
{
setSearchKey
({
name
:
''
,
state
:
''
});
ref
.
current
.
reload
();
}
}
>
重置
</
Button
>
</
Space
>
</
Col
>
</
Row
>
...
...
src/pages/transaction/stockSellStorage/warehouse/addWarehouse.tsx
View file @
b874206d
...
...
@@ -3,7 +3,7 @@ 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
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
Button
,
Card
}
from
'antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
...
...
@@ -16,73 +16,112 @@ import { PublicApi } from '@/services/api';
const
addSchemaAction
=
createFormActions
();
const
{
onFormMount$
}
=
FormEffectHooks
;
const
AddWarehouse
:
React
.
FC
<
{}
>
=
(
props
:
any
)
=>
{
const
ref
=
useRef
({});
const
{
pageStatus
,
preview
,
id
}
=
usePageStatus
();
const
[
provinceList
,
setProvinceList
]
=
useState
([]);
const
[
cityList
,
setCityList
]
=
useState
([]);
const
[
areaList
,
setAreaList
]
=
useState
([]);
const
[
telCodeList
,
setTelCodeList
]
=
useState
<
any
>
([]);
const
[
formValue
,
setFormValue
]
=
useState
<
any
>
({});
// 初始获取各省选项
useEffect
(()
=>
{
getAddressList
(
'province'
);
let
formValues
;
// 获取详情
if
(
pageStatus
!=
0
)
{
PublicApi
.
getWarehouseWarehouseDetails
({
id
:
usePageStatus
().
id
,
}).
then
(
res
=>
{
formValues
=
res
.
data
;
setFormValue
(
res
.
data
);
});
}
// 获取省市区
PublicApi
.
getManageAreaAll
().
then
(
res
=>
{
let
provinceOptions
=
[];
for
(
let
item
of
res
.
data
)
{
provinceOptions
.
push
({
label
:
item
.
name
,
value
:
item
.
id
,
areaResponses
:
item
.
areaResponses
,
});
}
setProvinceList
(
provinceOptions
);
if
(
pageStatus
!=
0
)
{
getSubAddressList
(
'province'
,
provinceOptions
,
formValues
.
provinceId
);
getSubAddressList
(
'city'
,
cityList
,
formValues
.
cityId
);
}
});
// 获取手机code
PublicApi
.
getManageGetTelCode
().
then
(
res
=>
{
setTelCodeList
(
res
.
data
);
});
},
[]);
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'
)
{
let
options
=
[];
if
(
type
===
'province'
)
{
provinceList
.
find
(
target
=>
{
if
(
target
.
value
===
id
)
{
code
=
target
.
code
;
for
(
let
item
of
target
.
areaResponses
)
{
options
.
push
({
label
:
item
.
name
,
value
:
item
.
id
});
}
setCityList
(
options
);
}
});
}
else
{
cityList
.
find
(
target
=>
{
if
(
target
.
value
===
id
)
{
code
=
target
.
code
;
for
(
let
item
of
target
.
areaResponses
)
{
options
.
push
({
label
:
item
.
name
,
value
:
item
.
id
});
}
setAreaList
(
options
);
}
});
}
return
code
;
};
const
getSubAddressList
=
(
type
,
list
,
id
)
=>
{
let
options
=
[];
list
.
find
(
target
=>
{
if
(
target
.
value
===
id
)
{
for
(
let
item
of
target
.
areaResponses
)
{
options
.
push
({
label
:
item
.
name
,
value
:
item
.
id
});
}
if
(
type
===
'province'
)
return
setCityList
(
options
);
if
(
type
===
'city'
)
return
setAreaList
(
options
);
}
});
};
const
handleSubmit
=
value
=>
{
console
.
log
(
value
);
PublicApi
.
postWarehouseWarehouseAdd
({
...
value
}).
then
(
res
=>
{});
if
(
pageStatus
===
0
)
return
PublicApi
.
postWarehouseWarehouseAdd
({
...
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
history
.
goBack
();
});
else
return
PublicApi
.
postWarehouseWarehouseUpdate
({
id
:
id
,
...
value
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
history
.
goBack
();
});
};
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
usePageStatus
().
pageStatus
===
0
pageStatus
===
0
?
'新建仓库'
:
usePageStatus
().
pageStatus
===
1
:
pageStatus
===
1
?
'编辑仓库'
:
'查看仓库'
}
extra=
{
usePageStatus
().
preview
!=
'1'
preview
!=
'1'
?
[
<
Button
key=
"1"
...
...
@@ -98,8 +137,18 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
>
<
Card
>
<
SchemaForm
editable=
{
usePageStatus
().
preview
!=
'1'
}
value=
{
formValue
}
editable=
{
preview
!=
'1'
}
actions=
{
addSchemaAction
}
effects=
{
(
$
,
{
setFieldState
})
=>
{
$
(
'onFormMount'
).
subscribe
(
state
=>
{});
// $('onFieldValueChange', 'provinceId').subscribe(state =>
{
// const origin = areaData.current.find(v => v.id === state.value)?.areaResponses
// console.log(origin)
// useLinkageUtils().enum('cityId', origin)
//
})
}
}
components=
{
{
Input
,
Select
,
Textarea
:
Input
.
TextArea
}
}
onSubmit=
{
value
=>
handleSubmit
(
value
)
}
>
...
...
@@ -113,7 +162,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'- 省 -'
,
onChange
:
val
=>
getAddressList
(
'
city
'
,
val
),
onChange
:
val
=>
getAddressList
(
'
province
'
,
val
),
}
}
required
/>
...
...
@@ -123,7 +172,7 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'- 市 -'
,
onChange
:
val
=>
getAddressList
(
'
area
'
,
val
),
onChange
:
val
=>
getAddressList
(
'
city
'
,
val
),
}
}
required
/>
...
...
@@ -150,8 +199,8 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
<
Field
name=
"principal"
title=
"仓库负责人"
x
-
component=
"Input"
/>
<
FormMegaLayout
label=
"联系电话"
grid
full
wrapperCol=
{
24
}
>
<
Field
name=
"
country
Code"
enum=
{
[
'1'
,
'2'
,
'3'
,
'4'
]
}
name=
"
tel
Code"
enum=
{
telCodeList
}
x
-
component=
"Select"
x
-
component
-
props=
{
{
placeholder
:
'请选择'
}
}
/>
...
...
@@ -159,7 +208,10 @@ const AddWarehouse: React.FC<{}> = (props: any) => {
x
-
mega
-
props=
{
{
span
:
3
}
}
name=
"tel"
x
-
component=
"Input"
x
-
component
-
props=
{
{
placeholder
:
'请输入你的手机号码'
}
}
x
-
component
-
props=
{
{
placeholder
:
'请输入你的手机号码'
,
maxLength
:
11
,
}
}
/>
</
FormMegaLayout
>
</
FormMegaLayout
>
...
...
src/pages/transaction/stockSellStorage/warehouse/index.tsx
View file @
b874206d
...
...
@@ -19,21 +19,12 @@ import { ColumnType } from 'antd/lib/table/interface';
import
style
from
'./index.less'
;
import
{
PublicApi
}
from
'@/services/api'
;
// 模拟请求
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
({});
const
[
searchName
,
setSearchName
]
=
useState
(
''
);
const
ref
=
useRef
<
any
>
({});
const
[
searchKey
,
setSearchKey
]
=
useState
<
any
>
({
name
:
''
,
state
:
''
,
});
const
columns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -96,41 +87,62 @@ const WareHouse: React.FC<{}> = () => {
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<>
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/addWarehouse?id=${record.id}`
,
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handleDelete
(
record
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
>
删除
</
Button
>
</
Popconfirm
>
{
record
.
state
!=
1
?
(
<>
<
Button
type=
"link"
onClick=
{
()
=>
history
.
push
(
`/memberCenter/tranactionAbility/stockSellStorage/addWarehouse?id=${record.id}`
,
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handleDelete
(
record
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
"link"
>
删除
</
Button
>
</
Popconfirm
>
</>
)
:
(
''
)
}
</>
),
},
];
const
handleReset
=
()
=>
{};
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getWarehouseWarehouseList
({
...
searchKey
,
current
:
params
.
current
,
pageSize
:
params
.
pageSize
,
}).
then
(
res
=>
{
resolve
(
res
.
data
);
});
});
};
const
handleModify
=
(
record
:
object
)
=>
{
// 通过传入的params字符串判断是修改那种类型的数据
console
.
log
(
'执行状态修改'
,
record
);
const
handleModify
=
record
=>
{
PublicApi
.
postWarehouseWarehouseStartRoStop
({
id
:
record
.
id
,
state
:
record
.
state
===
1
?
0
:
1
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
return
ref
.
current
.
reload
();
});
};
const
handleDelete
=
record
=>
{
PublicApi
.
getWarehouseInvoicesDetailsList
({
i
nvoicesI
d
:
record
.
id
,
PublicApi
.
postWarehouseWarehouseDelete
({
id
:
record
.
id
,
}).
then
(
res
=>
{
// if(res.data.)
if
(
res
.
code
===
1000
)
return
ref
.
current
.
reload
();
});
};
...
...
@@ -138,7 +150,18 @@ const WareHouse: React.FC<{}> = () => {
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
}
}
tableProps=
{
{
rowKey
:
'id'
,
onChange
:
(
pagination
,
filters
,
sorter
)
=>
{
let
state
=
sorter
.
order
===
'ascend'
?
1
:
sorter
.
order
===
'descend'
?
0
:
''
;
setSearchKey
({
...
searchKey
,
state
:
state
});
},
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
...
...
@@ -171,12 +194,25 @@ const WareHouse: React.FC<{}> = () => {
title=
{
<
span
>
输入仓库名称进行搜索
</
span
>
}
>
<
Input
.
Search
value=
{
search
N
ame
}
value=
{
search
Key
.
n
ame
}
placeholder=
"搜索"
onChange=
{
e
=>
setSearchName
(
e
.
target
.
value
)
}
onChange=
{
e
=>
setSearchKey
({
...
searchKey
,
name
:
e
.
target
.
value
})
}
onSearch=
{
(
val
,
e
)
=>
{
e
.
preventDefault
();
ref
.
current
.
reload
();
}
}
/>
</
Tooltip
>
<
Button
onClick=
{
()
=>
handleReset
()
}
>
重置
</
Button
>
<
Button
onClick=
{
()
=>
{
setSearchKey
({
name
:
''
,
state
:
''
});
ref
.
current
.
reload
();
}
}
>
重置
</
Button
>
</
Space
>
</
Col
>
</
Row
>
...
...
src/services/index.ts
View file @
b874206d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment