Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
b9301c04
Commit
b9301c04
authored
Sep 06, 2023
by
左玲玲
😬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1722
parent
d1d0c1d5
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1051 additions
and
472 deletions
+1051
-472
authRoutes.js
config/authRoutes.js
+6
-0
mtable.jsx
src/components/AutoTable/mtable.jsx
+4
-1
index.jsx
src/components/DetailPro/index.jsx
+1
-1
index.less
src/components/DetailPro/index.less
+7
-2
FormItems.jsx
src/components/InitForm/FormItems.jsx
+2
-2
index.jsx
src/components/InitForm/index.jsx
+1
-1
global.less
src/global.less
+10
-0
index.jsx
src/pages/device/account/index.jsx
+19
-19
columns.js
src/pages/lease/contract/columns.js
+383
-0
index.jsx
src/pages/lease/contract/index.jsx
+167
-0
columns.js
src/pages/lease/custom/columns.js
+1
-1
index.jsx
src/pages/lease/custom/index.jsx
+5
-5
Account.jsx
src/pages/lease/devicedata/Account.jsx
+25
-38
Basemsg.jsx
src/pages/lease/devicedata/Basemsg.jsx
+5
-6
columns.js
src/pages/lease/devicedata/columns.js
+74
-11
index.jsx
src/pages/lease/devicedata/index.jsx
+15
-56
index.less
src/pages/lease/devicedata/index.less
+1
-0
columns.js
src/pages/lease/ledger/columns.js
+83
-69
index.jsx
src/pages/lease/ledger/index.jsx
+57
-34
index.jsx
src/pages/lease/supplier/index.jsx
+185
-226
No files found.
config/authRoutes.js
View file @
b9301c04
...
...
@@ -331,6 +331,12 @@ export default [
icon
:
''
,
component
:
'./lease/devicedata'
,
},
{
name
:
'租赁合同'
,
path
:
'/lease/contract'
,
icon
:
''
,
component
:
'./lease/contract'
,
},
],
},
];
src/components/AutoTable/mtable.jsx
View file @
b9301c04
...
...
@@ -43,6 +43,8 @@ const Mtable = (props) => {
resizeable
=
false
,
dataSource
,
iscurrent
=
true
,
toolBarRender
=
false
,
dataSourceFieldsChange
}
=
props
;
const
actionRefs
=
actionRef
??
useRef
(),
formRefs
=
formRef
??
useRef
(),
...
...
@@ -358,7 +360,7 @@ const Mtable = (props) => {
}
:
{};
const
datas
=
dataSource
?
{
dataSource
,
toolBarRender
:
false
}
:
{
request
};
const
datas
=
dataSource
?
{
dataSource
,
toolBarRender
:
toolBarRender
==
false
?
false
:
()
=>
{
}
}
:
{
request
};
return
(
<
ProTable
{
...
props
}
...
...
@@ -385,6 +387,7 @@ const Mtable = (props) => {
...
newparams
,
}));
}
dataSourceFieldsChange
&&
dataSourceFieldsChange
(
params
)
}
}
onSizeChange=
{
(
size
)
=>
{
localStorage
.
setItem
(
'size'
,
size
);
//设置全局表格规格缓存
...
...
src/components/DetailPro/index.jsx
View file @
b9301c04
...
...
@@ -74,7 +74,7 @@ function DetailPro(props) {
return
(
<>
<
Col
span=
{
24
}
>
<
div
className=
{
styles
.
title
}
style=
{
{
borderWidth
:
i
==
0
?
0
:
1
}
}
>
<
div
className=
{
styles
.
title
}
style=
{
{
borderWidth
:
i
==
0
?
0
:
1
,
'--before'
:
!
(
it
.
title
||
it
?.
render
)
?
'none'
:
'block'
,
'--after'
:
!
(
it
.
title
||
it
?.
render
)
?
'100%'
:
'calc(100% - 160px)'
,
'--padb'
:
!
(
it
.
title
||
it
?.
render
)
?
'20px'
:
'0'
}
}
>
{
it
?.
render
?
it
?.
render
?.(
curitem
[
it
.
dataIndex
],
curitem
)
:
it
.
title
}
</
div
>
</
Col
>
...
...
src/components/DetailPro/index.less
View file @
b9301c04
@import '~antd/es/style/variable.less';
.title {
position: relative;
width: 100%;
padding-top: 8px;
padding-left: 12px;
font-weight: bolder;
padding-bottom: var(--padb);
&::before {
position: absolute;
top: 11px;
...
...
@@ -14,12 +17,14 @@
background-color: @primary-color;
border-radius: 4px;
content: '';
display: var(--before);
}
&::after {
position: absolute;
top: 18px;
right: 0px;
width:
calc(100% - 160px
);
width:
var(--after
);
height: 1px;
border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
border-radius: 4px;
...
...
src/components/InitForm/FormItems.jsx
View file @
b9301c04
...
...
@@ -336,14 +336,14 @@ function Textarea({ item, colProps }) {
}
//digit
function Digit({ item, colProps }) {
function Digit({ item, colProps
, curindex = 0
}) {
return (
<>
<ProFormDigit
formItemProps={item.formItemProps}
name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps}
label={
item.title
}
label={
curindex == 0 ? item.title : ""
}
placeholder={`
请输入
$
{
item
.
title
}
`}
min={item.min}
max={item.max}
...
...
src/components/InitForm/index.jsx
View file @
b9301c04
...
...
@@ -115,7 +115,7 @@ function InitForm(props) {
function
formartData
(
item
,
val
)
{
let
formartValue
=
val
;
if
(
item
.
valueType
==
'uploadBtn'
||
item
.
valueType
==
"uploadImage"
||
item
.
valueType
==
"uploadDragger"
)
{
if
(
item
?.
valueType
==
'uploadBtn'
||
item
?.
valueType
==
"uploadImage"
||
item
?
.
valueType
==
"uploadDragger"
)
{
let
stepval
=
val
?.
filter
(
it
=>
{
if
(
!
it
?.
response
)
{
return
it
;
...
...
src/global.less
View file @
b9301c04
...
...
@@ -567,3 +567,13 @@ ol {
}
}
}
.ledgerf {
.ant-card-head {
display: none !important;
}
.ant-card-body {
padding: 0 !important;
}
}
\ No newline at end of file
src/pages/device/account/index.jsx
View file @
b9301c04
...
...
@@ -712,7 +712,7 @@ function Model(props) {
render
:
(
text
,
row
)
=>
<
Image
width=
{
70
}
src=
{
row
.
qrCodeUrl
}
/>,
},
];
const
[
newfieldscolumns
,
setnewfieldscolumns
]
=
useState
(
columns
);
const
[
newfieldscolumns
,
setnewfieldscolumns
]
=
useState
(
[]
);
const
selectValueType
=
(
type
,
options
)
=>
{
switch
(
type
)
{
case
1
:
...
...
src/pages/lease/contract/columns.js
0 → 100644
View file @
b9301c04
import
{
Tooltip
,
Image
}
from
'antd'
;
import
Filedetail
from
"@/components/Filedetail"
;
function
getcolumns
(
setdrawer
,
drawer
)
{
let
common
=
[
{
title
:
'合同单号'
,
dataIndex
:
'contractNo'
,
key
:
'contractNo'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
colProps
:
{
span
:
8
},
},
{
title
:
'客户'
,
dataIndex
:
'customerName'
,
key
:
'customerId'
,
colProps
:
{
span
:
8
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'select'
,
options
:
{
path
:
'/lease/umLeaseCustomer/getSelection'
,
params
:
{}
},
fieldProps
:
{
showSearch
:
true
},
},
{
title
:
'合同金额(元)'
,
dataIndex
:
'amount'
,
key
:
'amount'
,
hideInSearch
:
true
,
hideInForm
:
true
,
},
{
title
:
'合同起租日'
,
dataIndex
:
'startLeaseDate'
,
key
:
'startLeaseDateList'
,
hideInForm
:
true
,
valueType
:
'dateRange'
},
{
title
:
'本期应收回款'
,
dataIndex
:
'amount'
,
key
:
'amount'
,
hideInSearch
:
true
,
hideInForm
:
true
,
},
{
title
:
'设备台数'
,
dataIndex
:
'amount'
,
key
:
'amount'
,
hideInSearch
:
true
,
hideInForm
:
true
,
render
:
(
_
,
row
)
=>
{
return
(
<
a
className
=
"table-cell"
onClick
=
{()
=>
{
// setdrawer && setdrawer((s) => ({
// ...s,
// open: true,
// item: row,
// val: 'only',
// title: '租赁设备'
// }));
}}
>
{
row
.
amount
}
<
/a
>
);
}
},
{
title
:
'去程运费'
,
dataIndex
:
'tripFreight'
,
key
:
'tripFreight'
,
colProps
:
{
span
:
8
},
valueType
:
'digit'
,
hideInSearch
:
true
,
hideInTable
:
true
,
precision
:
2
},
{
title
:
'去程运费承担方'
,
dataIndex
:
'tripBear'
,
key
:
'tripBear'
,
hideInSearch
:
true
,
valueType
:
'select'
,
options
:
[
{
label
:
'客户'
,
value
:
'1'
},
{
label
:
'平台'
,
value
:
'2'
},
],
colProps
:
{
span
:
8
},
hideInTable
:
true
,
},
{
title
:
'回款设置'
,
dataIndex
:
'collectionSet'
,
key
:
'collectionSet'
,
valueType
:
'digit'
,
hideInSearch
:
true
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
colProps
:
{
span
:
8
},
hideInTable
:
true
},
{
title
:
'预警设置'
,
dataIndex
:
'warnSet'
,
key
:
'warnSet'
,
hideInSearch
:
true
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
colProps
:
{
span
:
8
},
valueType
:
'digit'
,
hideInTable
:
true
},
{
title
:
'合同租期(月)'
,
dataIndex
:
'tenancy'
,
key
:
'tenancy'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
colProps
:
{
span
:
8
},
hideInSearch
:
true
,
valueType
:
'digit'
,
hideInTable
:
true
,
},
{
title
:
'租赁设备'
,
dataIndex
:
'contractEquipmentList'
,
key
:
'contractEquipmentList'
,
hideInSearch
:
true
,
valueType
:
'formList'
,
hideInTable
:
true
,
initialValue
:
[
{
state
:
'all'
,
title
:
'标题'
,
},
],
colProps
:
{
xs
:
24
,
sm
:
24
,
},
columns
:
[
{
title
:
'设备'
,
dataIndex
:
'equipmentName'
,
key
:
'equipmentId'
,
valueType
:
'select'
,
fieldProps
:
{
placeholder
:
'请选择'
,
showSearch
:
true
},
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
colProps
:
{
sm
:
6
,
},
options
:
{
path
:
'/'
,
params
:
{},
},
},
{
title
:
'每期单价(元)'
,
dataIndex
:
'unitPrice'
,
key
:
'unitPrice'
,
valueType
:
'digit'
,
precision
:
2
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
colProps
:
{
sm
:
3
,
},
},
{
title
:
'智享价(元)'
,
dataIndex
:
'zxPrice'
,
key
:
'zxPrice'
,
valueType
:
'digit'
,
precision
:
2
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
colProps
:
{
sm
:
3
,
},
},
{
title
:
'返利金额(元)'
,
dataIndex
:
'rebatePrice'
,
key
:
'rebatePrice'
,
valueType
:
'digit'
,
precision
:
2
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
colProps
:
{
sm
:
3
,
},
},
{
title
:
'押金(元)'
,
dataIndex
:
'deposit'
,
key
:
'deposit'
,
valueType
:
'digit'
,
precision
:
2
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'此项为必填项'
,
},
],
},
colProps
:
{
sm
:
3
,
},
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
key
:
'remark'
,
colProps
:
{
sm
:
6
,
},
}
],
},
{
title
:
'营销区域'
,
dataIndex
:
'marketRegion'
,
key
:
'marketRegion'
,
hideInSearch
:
true
,
colProps
:
{
span
:
8
},
hideInTable
:
true
,
},
{
title
:
'智享店'
,
dataIndex
:
'zxstore'
,
key
:
'zxstore'
,
colProps
:
{
span
:
8
},
hideInSearch
:
true
,
hideInTable
:
true
,
},
{
title
:
'登记日期'
,
dataIndex
:
'registrationDate'
,
key
:
'registrationDate'
,
colProps
:
{
span
:
8
},
hideInSearch
:
true
,
hideInTable
:
true
,
valueType
:
'date'
,
},
{
title
:
'承接合同编号'
,
dataIndex
:
'undertakingNo'
,
key
:
'undertakingNo'
,
colProps
:
{
span
:
8
},
hideInSearch
:
true
,
hideInTable
:
true
,
valueType
:
'select'
,
options
:
{
path
:
'/'
,
params
:
{}
},
},
{
title
:
'合同负责人'
,
dataIndex
:
'head'
,
key
:
'head'
,
hideInSearch
:
true
,
hideInTable
:
true
,
colProps
:
{
span
:
8
},
},
{
title
:
'合同上传(最多5个)'
,
dataIndex
:
'contractFileList'
,
key
:
'contractFileList'
,
hideInSearch
:
true
,
hideInTable
:
false
,
valueType
:
'uploadBtn'
,
span
:
3
,
fieldProps
:
{
limit
:
5
,
},
render
:
(
_
,
row
)
=>
{
return
<
Filedetail
files
=
{
drawer
?.
val
==
'only'
?
row
?.[
'contractFileList'
]
:
(
row
?.[
'contractFileList'
]?.[
0
]
??
[])}
/
>
}
},
];
return
[
{
tab
:
'未完成'
,
key
:
'1'
,
columns
:
[
...
common
,
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
options
:
[
{
label
:
'未开始'
,
value
:
1
},
{
label
:
'进行中'
,
value
:
2
},
{
label
:
'已到期'
,
value
:
3
},
{
label
:
'待押金退还'
,
value
:
4
},
],
fieldProps
:
{
dropdownMatchSelectWidth
:
150
,
},
valueType
:
'select'
,
hideInForm
:
true
},
],
pathconfig
:
{
enableadd
:
true
,
add
:
'/lease/umContract/save'
,
edit
:
'/lease/umContract/save'
,
list
:
'/lease/umContract/queryIncomplete'
,
delete
:
'/lease/umContract/deleteById'
,
detail
:
'/lease/umContract/queryDetail'
,
},
},
{
tab
:
'已完成'
,
key
:
'2'
,
columns
:
[
...
common
,
{
title
:
'状态'
,
dataIndex
:
'statusName'
,
key
:
'status'
,
options
:
[
{
label
:
'正常完成'
,
value
:
5
},
{
label
:
'提前退租'
,
value
:
6
},
],
fieldProps
:
{
dropdownMatchSelectWidth
:
150
,
},
valueType
:
'select'
,
hideInForm
:
true
},
],
pathconfig
:
{
add
:
''
,
edit
:
''
,
list
:
'/lease/umContract/queryComplete'
,
delete
:
''
,
detail
:
'/lease/umContract/queryDetail'
,
},
},
];
}
export
default
getcolumns
;
src/pages/lease/contract/index.jsx
0 → 100644
View file @
b9301c04
/* 故障报修
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-10 17:58:21
*/
import
*
as
React
from
'react'
;
import
{
useState
,
useMemo
,
useRef
}
from
'react'
;
import
DrawerPro
from
'@/components/DrawerPro'
;
import
AutoTable
from
'@/components/AutoTable'
;
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
useRequest
}
from
'ahooks'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
Addform
from
'@/components/Addform'
;
import
Detail
from
'@/components/RepaireDetail/Detail'
;
function
Contract
(
props
)
{
let
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
}),
[
activeTabKey
,
setactiveTabKey
]
=
useState
(
'1'
);
const
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
},
});
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
row
,
title
:
'编辑'
,
val
:
'edit'
,
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
if
(
row
?.
status
==
1
)
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
()
=>
{
run
({
url
:
pathconfig
?.
delete
||
'/delete'
,
params
:
{
id
:
row
?.
id
}
});
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
}
else
{
return
<></>;
}
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
columns
;
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
if
(
activeTabKey
==
1
)
{
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
width
:
150
,
render
:
(
text
,
row
,
_
,
action
)
=>
[],
});
}
else
{
return
defcolumn
;
}
},
[
activeTabKey
]);
const
pathconfig
=
useMemo
(()
=>
{
let
defpath
=
getcolumns
(
setdrawer
).
filter
((
it
)
=>
it
.
key
==
activeTabKey
)[
0
]?.
pathconfig
??
{};
return
defpath
;
},
[
activeTabKey
]);
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
租赁合同
</
h3
>
}
columns=
{
columns
}
path=
{
pathconfig
?.
list
}
actionRef=
{
actionRef
}
pageextra=
{
pathconfig
?.
enableadd
?
'add'
:
null
}
resizeable=
{
false
}
addconfig=
{
{
// access: 'sysDepartment_save',
name
:
'新增'
,
btn
:
{
disabled
:
false
,
type
:
'primary'
,
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
{},
title
:
'新增'
,
val
:
'add'
}));
},
},
}
}
tabList=
{
getcolumns
()
}
activeTabKey=
{
activeTabKey
}
onTabChange=
{
(
key
)
=>
{
setactiveTabKey
(
key
);
}
}
/>
<
DrawerPro
fields=
{
columns
}
detailpath=
{
pathconfig
?.
detail
||
null
}
detailData=
{
drawer
?.
item
}
defaultFormValue=
{
drawer
?.
item
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
formRef=
{
formRef
}
placement=
"right"
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
false
,
}));
}
}
{
...
drawer
}
onFinish=
{
(
vals
)
=>
{
if
(
drawer
?.
val
==
'add'
)
{
run
({
url
:
pathconfig
?.
add
||
'/add'
,
params
:
{
...
vals
}
});
}
else
if
(
drawer
?.
val
==
'edit'
)
{
run
({
url
:
pathconfig
?.
edit
||
'/edit'
,
params
:
{
...
vals
,
id
:
drawer
?.
item
?.
id
}
});
}
}
}
>
{
/* {selectType(drawer?.val)} */
}
</
DrawerPro
>
</
div
>
);
}
export
default
Contract
;
src/pages/lease/custom/columns.js
View file @
b9301c04
...
...
@@ -24,7 +24,7 @@ function getcolumns(setdrawer) {
onClick
=
{()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
val
:
'detailaddon'
,
title
:
'客户信息'
...
...
src/pages/lease/custom/index.jsx
View file @
b9301c04
...
...
@@ -8,7 +8,7 @@ import { useRequest } from "ahooks";
const
Custom
=
()
=>
{
let
actionRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
open
:
false
,
});
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
...
...
@@ -17,7 +17,7 @@ const Custom = () => {
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
{}
}));
}
...
...
@@ -33,7 +33,7 @@ const Custom = () => {
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
val
:
'edit'
,
title
:
'编辑'
...
...
@@ -106,7 +106,7 @@ const Custom = () => {
// let res = await doFetch(
{
url
:})
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
{},
params
:
{},
title
:
'新增'
,
...
...
@@ -126,7 +126,7 @@ const Custom = () => {
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
}));
}
}
onFinish=
{
async
(
vals
)
=>
{
...
...
src/pages/lease/devicedata/Account.jsx
View file @
b9301c04
...
...
@@ -31,7 +31,7 @@ import dayjs from 'dayjs';
const
{
Sider
,
Content
}
=
Layout
;
function
Account
(
props
)
{
function
Account
(
{
boxRef
}
)
{
const
disabledDateOfDay
=
(
current
)
=>
{
// Can not select days before today and today
return
current
&&
current
>
dayjs
().
endOf
(
'day'
);
...
...
@@ -40,11 +40,11 @@ function Account(props) {
let
actionRef
=
useRef
(),
formRef
=
useRef
(),
[
drawer
,
setDrawer
]
=
useState
({
visible
:
false
,
open
:
false
,
}),
[
extraparams
,
setextraparams
]
=
useState
({}),
[
currDrawer
,
setCurrDrawer
]
=
useState
({
visible
:
false
,
open
:
false
,
}),
[
resumeTab
,
setresumeTab
]
=
useState
(
null
),
currfields
=
{
...
...
@@ -112,9 +112,9 @@ function Account(props) {
render
:
(
text
,
row
)
=>
{
return
(
<
div
>
{
row
?.
urlIds
.
map
((
it
)
=>
(
{
row
?.
urlIds
.
map
((
it
,
i
)
=>
(
// eslint-disable-next-line react/jsx-key
<
div
style=
{
{
marginBottom
:
'8px'
}
}
>
<
div
style=
{
{
marginBottom
:
'8px'
}
}
key=
{
i
}
>
<
a
href=
{
it
?.
url
}
download
target=
"_blank"
rel=
"noopener noreferrer"
>
{
it
?.
name
}
</
a
>
...
...
@@ -169,9 +169,9 @@ function Account(props) {
render
:
(
text
,
row
)
=>
{
return
(
<
div
>
{
row
?.
urlIds
.
map
((
it
)
=>
(
{
row
?.
urlIds
.
map
((
it
,
i
)
=>
(
// eslint-disable-next-line react/jsx-key
<
div
style=
{
{
marginBottom
:
'8px'
}
}
>
<
div
style=
{
{
marginBottom
:
'8px'
}
}
key=
{
i
}
>
<
a
href=
{
it
?.
url
}
download
target=
"_blank"
rel=
"noopener noreferrer"
>
{
it
?.
name
}
</
a
>
...
...
@@ -580,7 +580,7 @@ function Account(props) {
render
:
(
text
,
row
)
=>
<
Image
width=
{
70
}
src=
{
row
.
qrCodeUrl
}
/>,
},
];
const
[
newfieldscolumns
,
setnewfieldscolumns
]
=
useState
(
columns
);
const
[
newfieldscolumns
,
setnewfieldscolumns
]
=
useState
(
[]
);
const
selectValueType
=
(
type
,
options
)
=>
{
switch
(
type
)
{
case
1
:
...
...
@@ -637,10 +637,6 @@ function Account(props) {
res
?.
data
?.
data
[
'equipmentCharList'
]?.
forEach
?.((
it
)
=>
{
obj
[
it
?.
fieldId
]
=
it
?.
fieldRealValue
;
});
console
.
log
(
'drawerpro:'
,
{
...(
res
?.
data
?.
data
??
{}),
...
obj
,
});
setrequest
(
{
...(
res
?.
data
?.
data
??
{}),
...
...
@@ -1010,7 +1006,7 @@ function Account(props) {
onClick=
{
()
=>
{
setCurrDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
val
:
'only'
,
title
:
`${row.logTypeName}详情`
,
...
...
@@ -1067,7 +1063,6 @@ function Account(props) {
url
:
'/asset/equipment/children/selected/queryList'
,
params
:
{
id
:
drawer
?.
item
?.
id
},
});
// //console.log(result);
if
(
!
result
?.
data
?.
dataList
.
length
==
0
)
{
setSelectArr
(
result
?.
data
?.
dataList
.
map
((
it
)
=>
it
.
id
));
}
...
...
@@ -1320,13 +1315,11 @@ function Account(props) {
selectedRowKeys
:
selectArr
,
// defaultSelectedRowKeys: ,
onSelect
:
(
record
,
selected
,
selectedRows
,
nativeEvent
)
=>
{
//console.log('selectedRowKeys changed: ', record, selected, selectedRows);
setSelectArr
(()
=>
{
return
selectedRows
.
map
((
it
)
=>
it
.
id
);
});
},
onSelectAll
:
(
selected
,
selectedRows
,
changeRows
)
=>
{
//console.log(selected, selectedRows, changeRows);
if
(
selected
)
{
let
arr
=
selectArr
.
concat
(
changeRows
.
map
((
it
)
=>
it
.
id
));
setSelectArr
(
arr
);
...
...
@@ -1335,7 +1328,6 @@ function Account(props) {
}
},
onSelectNone
:
()
=>
{
//console.log(11);
setSelectArr
([]);
},
}
}
...
...
@@ -1343,10 +1335,9 @@ function Account(props) {
<
Space
style=
{
{
marginTop
:
16
}
}
>
<
Button
onClick=
{
()
=>
{
//console.log(drawer);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
detailpath
:
null
,
params
:
null
,
...
...
@@ -1361,7 +1352,6 @@ function Account(props) {
<
Button
type=
"primary"
onClick=
{
async
()
=>
{
//console.log(selectArr);
let
res
=
await
doFetch
({
url
:
urlParams_childEquipment
.
save
,
params
:
{
...
...
@@ -1373,7 +1363,7 @@ function Account(props) {
message
.
success
(
'新增成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
}));
setSelectArr
([]);
...
...
@@ -1398,7 +1388,6 @@ function Account(props) {
url
:
'/asset/equipment/children/selected/queryList'
,
params
:
{
id
:
drawer
?.
item
?.
id
},
});
// //console.log(result);
if
(
!
result
?.
data
?.
dataList
.
length
==
0
)
{
setSelectArr
(
result
?.
data
?.
dataList
.
map
((
it
)
=>
it
.
id
));
}
...
...
@@ -1415,7 +1404,6 @@ function Account(props) {
},
[]);
const
menulist
=
useMemo
(()
=>
{
console
.
log
(
activeTab
);
const
fields
=
{
1
:
[
{
...
...
@@ -1795,7 +1783,6 @@ function Account(props) {
fields=
{
fields
[
activeTab
]
}
defaultFormValue=
{
drawer
?.
item
}
onFinish=
{
async
(
vals
)
=>
{
//console.log(vals);
let
res
=
await
doFetch
({
url
:
urlParams_resume
.
save
,
params
:
{
...
vals
,
type
:
'1'
,
equipmentId
:
drawer
?.
item
?.
id
},
...
...
@@ -1804,7 +1791,7 @@ function Account(props) {
message
.
success
(
'登记成功!'
);
await
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
}));
actionRef
.
current
.
reload
();
...
...
@@ -1829,7 +1816,7 @@ function Account(props) {
message
.
success
(
'登记成功!'
);
await
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
}));
actionRef
.
current
.
reload
();
...
...
@@ -1846,7 +1833,6 @@ function Account(props) {
fields=
{
fields
[
activeTab
]
}
defaultFormValue=
{
drawer
?.
item
}
onFinish=
{
async
(
vals
)
=>
{
//console.log(vals);
let
res
=
await
doFetch
({
url
:
urlParams_resume
.
save
,
params
:
{
...
vals
,
type
:
'3'
,
equipmentId
:
drawer
?.
item
?.
id
},
...
...
@@ -1855,7 +1841,7 @@ function Account(props) {
message
.
success
(
'登记成功!'
);
await
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
}));
actionRef
.
current
.
reload
();
...
...
@@ -1872,7 +1858,6 @@ function Account(props) {
defaultFormValue=
{
drawer
?.
item
}
fields=
{
fields
[
activeTab
]
}
onFinish=
{
async
(
vals
)
=>
{
//console.log(vals);
let
res
=
await
doFetch
({
url
:
urlParams_resume
.
save
,
params
:
{
...
vals
,
type
:
'4'
,
equipmentId
:
drawer
?.
item
?.
id
},
...
...
@@ -1881,7 +1866,7 @@ function Account(props) {
message
.
success
(
'登记成功!'
);
await
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
}));
actionRef
.
current
.
reload
();
...
...
@@ -1898,7 +1883,6 @@ function Account(props) {
fields=
{
fields
[
activeTab
]
}
defaultFormValue=
{
drawer
?.
item
}
onFinish=
{
async
(
vals
)
=>
{
//console.log(vals);
let
res
=
await
doFetch
({
url
:
urlParams_resume
.
save
,
params
:
{
...
vals
,
type
:
'5'
,
equipmentId
:
drawer
?.
item
?.
id
},
...
...
@@ -1907,7 +1891,7 @@ function Account(props) {
message
.
success
(
'登记成功!'
);
await
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
}));
actionRef
.
current
.
reload
();
...
...
@@ -2012,14 +1996,14 @@ function Account(props) {
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setDrawer
);
let
defcolumn
=
getcolumns
(
setDrawer
)
?.
columns
;
defcolumn
[
1
].
render
=
(
text
,
row
)
=>
{
return
(
<
a
onClick=
{
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
type
:
'detail'
,
item
:
row
,
val
:
'only'
,
...
...
@@ -2045,7 +2029,7 @@ function Account(props) {
const
containderef
=
useRef
();
return
(
<
div
style=
{
{
position
:
'relative'
}
}
>
<
div
>
<
AutoTable
columns=
{
columns
}
path=
{
urlParams
.
list
}
...
...
@@ -2053,6 +2037,7 @@ function Account(props) {
resizeable=
{
false
}
x=
{
1500
}
extraparams=
{
extraparams
}
bordered=
{
false
}
/>
<
DrawerPro
fields=
{
columns
}
...
...
@@ -2061,15 +2046,16 @@ function Account(props) {
onClose=
{
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
}));
}
}
{
...
drawer
}
colProps=
{
{
span
:
8
,
}
}
getContainer=
{
()
=>
boxRef
.
current
}
>
{
drawer
?.
visible
&&
selectMoreDrawerType
(
drawer
?.
type
)
}
{
drawer
?.
open
&&
selectMoreDrawerType
(
drawer
?.
type
)
}
</
DrawerPro
>
<
DrawerPro
...
...
@@ -2078,7 +2064,7 @@ function Account(props) {
await
setactiveTab
(
3
);
await
setCurrDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
item
:
null
,
}));
}
}
...
...
@@ -2086,6 +2072,7 @@ function Account(props) {
colProps=
{
{
span
:
8
,
}
}
getContainer=
{
()
=>
boxRef
.
current
}
>
<
ProDescriptions
title=
"设备信息"
...
...
src/pages/lease/devicedata/Basemsg.jsx
View file @
b9301c04
import
React
,
{
useMemo
}
from
'react'
;
import
DetailPro
from
'@/components/DetailPro'
;
import
getcolumns
from
'./columns'
;
const
Basemsg
=
({
drawer
,
activeKey
})
=>
{
import
{
doFetch
}
from
'@/utils/doFetch'
;
const
Basemsg
=
({
drawer
,
activeKey
,
setdrawer
})
=>
{
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
[];
if
(
activeKey
==
'item-1'
)
{
...
...
@@ -29,14 +29,13 @@ const Basemsg = ({ drawer, activeKey }) => {
const
detailData
=
useMemo
(()
=>
{
let
data
=
{};
if
(
activeKey
==
'item-1'
)
{
doFetch
({
url
:
'/asset/equipment/detail'
,
params
:
{
id
:
row
.
id
}
}).
then
(
res
=>
{
doFetch
({
url
:
'/asset/equipment/detail'
,
params
:
{
id
:
drawer
?.
item
?
.
id
}
}).
then
(
res
=>
{
if
(
res
.
code
==
'0000'
)
{
data
=
res
?.
data
?.
data
??
{};
}
})
}
else
{
doFetch
({
url
:
'/asset/equipment/detail'
,
params
:
{
id
:
row
.
id
}
}).
then
(
res
=>
{
doFetch
({
url
:
'/asset/equipment/detail'
,
params
:
{
id
:
drawer
?.
item
?.
id
}
}).
then
(
res
=>
{
if
(
res
.
code
==
'0000'
)
{
let
obj
=
{};
res
?.
data
?.
data
[
'equipmentCharList'
]?.
forEach
?.((
it
)
=>
{
...
...
@@ -51,7 +50,7 @@ const Basemsg = ({ drawer, activeKey }) => {
},
[
activeKey
]);
return
<
DetailPro
fields=
{
columns
}
detail
path=
"/"
detail
Data=
{
detailData
}
params=
{
{
id
:
drawer
?.
item
?.
id
}
}
/>
}
...
...
src/pages/lease/devicedata/columns.js
View file @
b9301c04
...
...
@@ -3,6 +3,10 @@ import { doFetch } from '@/utils/doFetch';
function
getcolumns
(
setdrawer
,
activeKey
)
{
return
activeKey
==
'item-1'
?
{
columns
:
[
{
title
:
'设备信息'
,
valueType
:
'split'
},
{
title
:
'设备编号'
,
dataIndex
:
'f1'
,
...
...
@@ -21,10 +25,10 @@ function getcolumns(setdrawer, activeKey) {
<
Tooltip
title
=
{
row
.
f2
}
>
<
a
className
=
"table-cell"
onClick
=
{
async
()
=>
{
onClick
=
{()
=>
{
setdrawer
&&
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
val
:
'only'
,
title
:
'设备详情'
...
...
@@ -43,12 +47,40 @@ function getcolumns(setdrawer, activeKey) {
key
:
'f3'
,
colProps
:
{
span
:
8
}
},
{
title
:
'关联设备'
,
dataIndex
:
'f18'
,
key
:
'f18'
,
hideInForm
:
true
,
colProps
:
{
span
:
8
}
},
{
title
:
'设备品牌'
,
dataIndex
:
'f4'
,
key
:
'f4'
,
colProps
:
{
span
:
8
}
},
{
title
:
'开始租赁日期'
,
dataIndex
:
'f3'
,
key
:
'f3'
,
valueType
:
'dateRange'
,
hideInDescriptions
:
true
,
},
{
title
:
'结束租赁日期'
,
dataIndex
:
'f4'
,
key
:
'f4'
,
valueType
:
'dateRange'
,
hideInDescriptions
:
true
,
},
{
title
:
'租赁合同单号'
,
dataIndex
:
'f5'
,
key
:
'f5'
,
valueType
:
'dateRange'
,
hideInDescriptions
:
true
,
},
{
title
:
'设备型号'
,
dataIndex
:
'f5'
,
...
...
@@ -58,6 +90,23 @@ function getcolumns(setdrawer, activeKey) {
options
:
{
path
:
'/'
,
params
:
{}
},
colProps
:
{
span
:
8
}
},
{
title
:
'设备类型'
,
dataIndex
:
'f12'
,
key
:
'f12'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
hideInSearch
:
false
,
valueType
:
'select'
,
options
:
[
{
label
:
'设备'
,
value
:
'1'
},
{
label
:
'智能单元'
,
value
:
'2'
},
],
colProps
:
{
span
:
8
}
},
{
title
:
'所属信息'
,
valueType
:
'split'
},
{
title
:
'公司名称'
,
dataIndex
:
'f6'
,
...
...
@@ -139,6 +188,22 @@ function getcolumns(setdrawer, activeKey) {
},
colProps
:
{
span
:
8
}
},
{
title
:
'关联客户'
,
dataIndex
:
'f19'
,
key
:
'f19'
,
hideInSearch
:
false
,
hideInTable
:
false
,
hideInForm
:
true
,
valueType
:
'select'
,
options
:
{
path
:
'/'
,
params
:
{}
},
colProps
:
{
span
:
8
},
span
:
3
},
{
title
:
'其他信息'
,
valueType
:
'split'
},
{
title
:
'供应商'
,
dataIndex
:
'f13'
,
...
...
@@ -176,6 +241,7 @@ function getcolumns(setdrawer, activeKey) {
dataIndex
:
'f21'
,
key
:
'f21'
,
hideInSearch
:
true
,
hideInForm
:
true
,
render
:
(
_
,
row
)
=>
{
return
row
.
f21
?.
length
&&
<
Image
src
=
{
row
?.
f21
?.[
0
]?.
url
}
/
>
}
...
...
@@ -185,25 +251,22 @@ function getcolumns(setdrawer, activeKey) {
dataIndex
:
'f22'
,
key
:
'f22'
,
hideInSearch
:
true
,
hideInForm
:
true
,
render
:
(
_
,
row
)
=>
{
return
row
.
f22
?.
length
&&
<
Image
src
=
{
row
?.
f22
?.[
0
]?.
url
}
/
>
}
},
{
title
:
'
经营
状态'
,
title
:
'
采集
状态'
,
dataIndex
:
'f20'
,
key
:
'f20'
,
hideInForm
:
true
,
valueType
:
'select'
,
options
:
[
{
label
:
'闲置'
,
value
:
'1'
},
{
label
:
'预占'
,
value
:
'2'
},
{
label
:
'租赁'
,
value
:
'3'
},
{
label
:
'待复检'
,
value
:
'4'
},
{
label
:
'报废'
,
value
:
'5'
},
{
label
:
'未绑定'
,
value
:
'6'
},
{
label
:
'绑定'
,
value
:
'7'
},
{
label
:
'销售'
,
value
:
'8'
},
{
label
:
'工作'
,
value
:
'1'
},
{
label
:
'待机'
,
value
:
'2'
},
{
label
:
'报警'
,
value
:
'3'
},
{
label
:
'关机'
,
value
:
'4'
}
],
fixed
:
'right'
},
...
...
src/pages/lease/devicedata/index.jsx
View file @
b9301c04
...
...
@@ -11,13 +11,13 @@ import { Divider, Tabs, ProDescriptions } from "antd";
import
Account
from
"./Account"
;
import
Basemsg
from
"./Basemsg"
;
const
Devicedata
=
()
=>
{
let
actionRef
=
useRef
();
let
actionRef
=
useRef
()
,
formRef
=
useRef
(),
boxRef
=
useRef
()
;
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
open
:
false
,
}),
[
activeKey
,
catk
]
=
useState
(
'item-1'
),
[
currDrawer
,
setCurrDrawer
]
=
useState
({
visible
:
false
,
open
:
false
,
});
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
...
...
@@ -26,7 +26,7 @@ const Devicedata = () => {
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
}));
}
},
...
...
@@ -41,7 +41,7 @@ const Devicedata = () => {
if
(
drawer
.
val
==
'only'
)
{
if
(
activeKey
==
'item-1'
)
{
return
[
{
label
:
'基础信息'
,
key
:
'item-1'
,
children
:
<
Basemsg
drawer=
{
drawer
}
activeKey=
{
activeKey
}
/>
}
{
label
:
'基础信息'
,
key
:
'item-1'
,
children
:
<
Basemsg
drawer=
{
drawer
}
activeKey=
{
activeKey
}
setdrawer=
{
setdrawer
}
/>
}
]
}
}
...
...
@@ -52,7 +52,6 @@ const Devicedata = () => {
label
:
'租赁设备'
,
key
:
'item-1'
,
children
:
<
AutoTable
pagetitle=
{
'设备列表'
}
columns=
{
columns
}
path=
''
actionRef=
{
actionRef
}
...
...
@@ -60,15 +59,20 @@ const Devicedata = () => {
dataSource=
{
[{
'f1'
:
'111'
,
'f2'
:
'222'
,
id
:
1
,
status
:
1
,
f12
:
1
,
intelligentUnit
:
'11'
}]
}
bordered=
{
false
}
x=
{
1500
}
toolBarRender=
{
true
}
formRef=
{
formRef
}
dataSourceFieldsChange=
{
(
val
)
=>
{
console
.
log
(
val
);
}
}
/>
},
{
label
:
'自主设备'
,
key
:
'item-2'
,
children
:
<
Account
/>
children
:
<
Account
boxRef=
{
boxRef
}
/>
}
]
},
[
columns
]);
},
[]);
const
onselecteTree
=
async
(
selectedKeys
,
e
,
alldata
)
=>
{
// let params = {
// treeNodeType: e.node.type,
...
...
@@ -76,54 +80,9 @@ const Devicedata = () => {
// };
// setextraparams(params);
};
const
selectValueType
=
(
type
,
options
)
=>
{
switch
(
type
)
{
case
1
:
return
{
valueType
:
'input'
,
};
case
2
:
return
{
valueType
:
'select'
,
options
,
};
case
3
:
return
{
valueType
:
'radio'
,
options
,
};
case
4
:
return
{
valueType
:
'select'
,
options
,
};
default
:
break
;
}
};
const
fn2
=
async
()
=>
{
const
res
=
await
doFetch
({
url
:
urlParams
.
detail
,
params
:
{
id
:
drawer
?.
item
?.
id
},
});
let
obj
=
{};
res
?.
data
?.
data
[
'equipmentCharList'
]?.
forEach
?.((
it
)
=>
{
obj
[
it
?.
fieldId
]
=
it
?.
fieldRealValue
;
});
console
.
log
(
'drawerpro:'
,
{
...(
res
?.
data
?.
data
??
{}),
...
obj
,
});
setrequest
(
{
...(
res
?.
data
?.
data
??
{}),
...
obj
,
}
??
{},
);
};
return
<
div
className=
{
styles
.
ledgerbox
}
>
return
<
div
className=
{
styles
.
ledgerbox
}
ref=
{
boxRef
}
>
<
div
className=
{
styles
.
ledgerheader
}
>
<
div
className=
"ant-card-head"
style=
{
{
backgroundColor
:
'white'
}
}
>
<
div
className=
"ant-card-head-wrapper"
>
...
...
@@ -137,7 +96,7 @@ const Devicedata = () => {
<
div
className=
{
styles
.
ledgerleft
}
>
<
TreeRender
url=
"/auth/sysFactory/getTree"
onselected=
{
onselecteTree
}
noaction=
{
true
}
/>
</
div
>
<
div
className=
{
styles
.
ledgerright
}
>
<
div
className=
{
`${styles.ledgerright} ledgerf`
}
>
<
Tabs
activeKey=
{
activeKey
}
onChange=
{
(
key
)
=>
{
catk
(
key
);
}
}
items=
{
tableItems
}
/>
...
...
@@ -154,7 +113,7 @@ const Devicedata = () => {
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
}));
}
}
>
...
...
src/pages/lease/devicedata/index.less
View file @
b9301c04
...
...
@@ -31,6 +31,7 @@
}
.ledgerright {
padding: 0 16px;
flex: 1;
border-left: 1px solid #f0f0f0;
overflow: hidden;
...
...
src/pages/lease/ledger/columns.js
View file @
b9301c04
...
...
@@ -2,35 +2,39 @@ import { Tooltip, Image } from 'antd';
function
getcolumns
(
setdrawer
)
{
return
{
columns
:
[
{
title
:
'设备信息'
,
valueType
:
'split'
},
{
title
:
'设备编号'
,
dataIndex
:
'
f1
'
,
key
:
'
f1
'
,
dataIndex
:
'
equipmentNo
'
,
key
:
'
equipmentNo
'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
colProps
:
{
span
:
8
},
},
{
title
:
'设备名称'
,
dataIndex
:
'
f2
'
,
key
:
'
f2
'
,
dataIndex
:
'
equipmentName
'
,
key
:
'
equipmentName
'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
colProps
:
{
span
:
8
},
render
:
(
_
,
row
)
=>
{
return
(
<
Tooltip
title
=
{
row
.
f2
}
>
<
Tooltip
title
=
{
row
.
equipmentName
}
>
<
a
className
=
"table-cell"
onClick
=
{()
=>
{
setdrawer
&&
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
val
:
'only'
,
title
:
'设备详情'
}));
}}
>
{
row
.
f2
}
{
row
.
equipmentName
}
<
/a
>
<
/Tooltip
>
);
...
...
@@ -38,52 +42,68 @@ function getcolumns(setdrawer) {
},
{
title
:
'资产编号'
,
dataIndex
:
'
f3
'
,
key
:
'
f3
'
,
dataIndex
:
'
assetNumber
'
,
key
:
'
assetNumber
'
,
colProps
:
{
span
:
8
}
},
{
title
:
'关联设备'
,
dataIndex
:
'
f18
'
,
key
:
'
f18
'
,
dataIndex
:
'
ledgerEquipment
'
,
key
:
'
ledgerEquipment
'
,
hideInForm
:
true
,
hideInDescriptions
:
true
,
colProps
:
{
span
:
8
}
},
{
title
:
'设备品牌'
,
dataIndex
:
'
f4
'
,
key
:
'
f4
'
,
dataIndex
:
'
brand
'
,
key
:
'
brand
'
,
colProps
:
{
span
:
8
}
},
{
title
:
'设备型号'
,
dataIndex
:
'f5'
,
key
:
'f5'
,
dataIndex
:
'equipmentModelName'
,
key
:
'equipmentModelId'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
valueType
:
'select'
,
options
:
{
path
:
'/asset/equipmentModel/query/selection'
,
params
:
{}
},
colProps
:
{
span
:
8
}
},
{
title
:
'设备类型'
,
dataIndex
:
'equipmentTypeName'
,
key
:
'equipmentType'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
hideInSearch
:
false
,
valueType
:
'select'
,
options
:
{
path
:
'/'
,
params
:
{}
},
options
:
[
{
label
:
'设备'
,
value
:
'1'
},
{
label
:
'智能单元'
,
value
:
'2'
},
],
colProps
:
{
span
:
8
}
},
{
title
:
'所属信息'
,
valueType
:
'split'
},
{
title
:
'公司名称'
,
dataIndex
:
'
f6
'
,
key
:
'
f6
'
,
dataIndex
:
'
organizationName
'
,
key
:
'
organizationId
'
,
hideInSearch
:
true
,
hideInTable
:
true
,
valueType
:
'select'
,
options
:
{
path
:
'/'
,
params
:
{}
},
options
:
{
path
:
'/
auth/sysDepartment/query/organization/selectbox
'
,
params
:
{}
},
colProps
:
{
span
:
8
}
},
{
title
:
'部门名称'
,
dataIndex
:
'
f7
'
,
key
:
'
f7
'
,
dataIndex
:
'
departmentName
'
,
key
:
'
departmentId
'
,
formItemProps
:
{
rules
:
[{
required
:
false
,
message
:
'此项为必填项'
}]
},
hideInSearch
:
true
,
hideInTable
:
true
,
valueType
:
'
s
elect'
,
options
:
{
path
:
'/
'
,
linkParams
:
{
f6
:
''
}
},
valueType
:
'
treeS
elect'
,
options
:
{
path
:
'/
auth/sysDepartment/query/children/tree'
,
linkParams
:
{
organizationId
:
''
}
},
colProps
:
{
span
:
8
}
},
{
...
...
@@ -146,55 +166,46 @@ function getcolumns(setdrawer) {
},
colProps
:
{
span
:
8
}
},
{
title
:
'设备类型'
,
dataIndex
:
'f12'
,
key
:
'f12'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
hideInSearch
:
false
,
valueType
:
'select'
,
options
:
[
{
label
:
'设备'
,
value
:
'1'
},
{
label
:
'智能单元'
,
value
:
'2'
},
],
colProps
:
{
span
:
8
}
},
{
title
:
'关联客户'
,
dataIndex
:
'
f19
'
,
key
:
'
f19
'
,
dataIndex
:
'
ledgerCustomer
'
,
key
:
'
ledgerCustomer
'
,
hideInSearch
:
false
,
hideInTable
:
false
,
hideInForm
:
true
,
hideInDescriptions
:
true
,
valueType
:
'select'
,
options
:
{
path
:
'/'
,
params
:
{}
},
colProps
:
{
span
:
8
}
options
:
{
path
:
'/lease/umLeaseCustomer/getSelection'
,
params
:
{}
},
colProps
:
{
span
:
8
},
span
:
3
},
{
title
:
'其他信息'
,
valueType
:
'split'
},
{
title
:
'供应商'
,
dataIndex
:
'
f13
'
,
key
:
'
f13
'
,
dataIndex
:
'
supplierName
'
,
key
:
'
supplierId
'
,
valueType
:
'select'
,
options
:
{
path
:
'/'
,
params
:
{}
},
options
:
{
path
:
'/
lease/umEquipmentSupplier/getSelection
'
,
params
:
{}
},
colProps
:
{
span
:
8
}
},
{
title
:
'保管单位'
,
dataIndex
:
'
f14
'
,
key
:
'
f14
'
,
dataIndex
:
'
custodyUnit
'
,
key
:
'
custodyUnit
'
,
colProps
:
{
span
:
8
}
},
{
title
:
'产权单位'
,
dataIndex
:
'
f15
'
,
key
:
'
f15
'
,
dataIndex
:
'
propertyUnit
'
,
key
:
'
propertyUnit
'
,
colProps
:
{
span
:
8
}
},
{
title
:
'上传图片'
,
dataIndex
:
'
f16
'
,
key
:
'
f16
'
,
dataIndex
:
'
picList
'
,
key
:
'
picList
'
,
hideInSearch
:
true
,
hideInTable
:
true
,
hideInDescriptions
:
true
,
...
...
@@ -205,46 +216,49 @@ function getcolumns(setdrawer) {
},
{
title
:
'图片'
,
dataIndex
:
'
f21
'
,
key
:
'
f21
'
,
dataIndex
:
'
imageUrl
'
,
key
:
'
imageUrl
'
,
hideInSearch
:
true
,
hideInForm
:
true
,
render
:
(
_
,
row
)
=>
{
return
row
.
f21
?.
length
&&
<
Image
src
=
{
row
?.
f21
?.[
0
]?.
u
rl
}
/
>
return
<
Image
src
=
{
row
?.
imageU
rl
}
/
>
}
},
{
title
:
'二维码'
,
dataIndex
:
'
f22
'
,
key
:
'
f22
'
,
dataIndex
:
'
qrCodeUrl
'
,
key
:
'
qrCodeUrl
'
,
hideInSearch
:
true
,
hideInForm
:
true
,
render
:
(
_
,
row
)
=>
{
return
row
.
f22
?.
length
&&
<
Image
src
=
{
row
?.
f22
?.[
0
]?.
u
rl
}
/
>
return
<
Image
src
=
{
row
?.
qrCodeU
rl
}
/
>
}
},
{
title
:
'经营状态'
,
dataIndex
:
'
f20
'
,
key
:
'
f20
'
,
dataIndex
:
'
statusName
'
,
key
:
'
status
'
,
hideInForm
:
true
,
valueType
:
'select'
,
options
:
[
{
label
:
'闲置'
,
value
:
'1'
},
{
label
:
'预占'
,
value
:
'2'
},
{
label
:
'租赁'
,
value
:
'3'
},
{
label
:
'待复检'
,
value
:
'4'
},
{
label
:
'报废'
,
value
:
'5'
},
{
label
:
'报废'
,
value
:
'0'
},
{
label
:
'预占'
,
value
:
'1'
},
{
label
:
'租赁'
,
value
:
'2'
},
{
label
:
'销售'
,
value
:
'3'
},
{
label
:
'闲置'
,
value
:
'4'
},
{
label
:
'待复检'
,
value
:
'5'
},
{
label
:
'未绑定'
,
value
:
'6'
},
{
label
:
'绑定'
,
value
:
'7'
},
{
label
:
'销售'
,
value
:
'8'
},
],
fixed
:
'right'
},
],
pathconfig
:
{
add
:
''
,
edit
:
''
,
list
:
''
,
delete
:
''
,
add
:
'/lease/umLeaseLedger/save'
,
edit
:
'/lease/umLeaseLedger/save'
,
list
:
'/lease/umLeaseLedger/queryList'
,
delete
:
'/lease/umLeaseLedger/deleteById'
,
detail
:
'/lease/umLeaseLedger/queryById'
},
};
}
...
...
src/pages/lease/ledger/index.jsx
View file @
b9301c04
...
...
@@ -4,7 +4,7 @@ import AutoTable from '@/components/AutoTable';
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
useRequest
}
from
"ahooks"
;
import
{
useRequest
,
useAsyncEffect
}
from
"ahooks"
;
import
styles
from
"./index.less"
;
import
TreeRender
from
'@/components/TreeRender'
;
import
{
Divider
,
Tabs
}
from
"antd"
;
...
...
@@ -15,8 +15,14 @@ import Basemsg from "./Basemsg";
const
Ledger
=
()
=>
{
let
actionRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
visible
:
false
,
});
open
:
false
,
}),
[
defaultmsg
,
cds
]
=
useState
({
supplier
:
{},
factory
:
{}
}),
[
node
,
cnode
]
=
useState
({}),
[
extraparams
,
setextraparams
]
=
useState
({});
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
...
...
@@ -24,7 +30,7 @@ const Ledger = () => {
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
}));
}
},
...
...
@@ -45,36 +51,49 @@ const Ledger = () => {
let
pathconf
=
getcolumns
(
setdrawer
)?.
pathconfig
??
{};
return
pathconf
;
},
[]);
useAsyncEffect
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/lease/umEquipmentSupplier/queryByDefault"
,
params
:
{}
}),
res2
=
await
doFetch
({
url
:
"/auth/sysFactory/queryByDefault"
,
params
:
{}
});
cds
({
supplier
:
res
?.
data
?.
data
??
{},
factory
:
res2
?.
data
?.
data
??
{}
});
},
[])
const
onselecteTree
=
async
(
selectedKeys
,
e
,
alldata
)
=>
{
// let params = {
// treeNodeType: e.node.type,
// treeNodeKey: e.node.key,
// };
// setextraparams(params);
let
params
=
{};
switch
(
e
.
node
.
type
)
{
case
1
:
params
=
{
factoryId
:
e
.
node
.
key
}
break
;
case
2
:
params
=
{
shopId
:
e
.
node
.
key
}
break
;
case
3
:
params
=
{
sectionId
:
e
.
node
.
key
}
break
;
case
4
:
params
=
{
productionLineId
:
e
.
node
.
key
}
break
;
default
:
params
=
{};
}
setextraparams
(
params
);
};
const
getExtra
=
(
text
,
row
,
_
,
action
)
=>
{
/**
* 1:闲置
* 2:预占
* 3:租赁
* 4:待复检
* 5:报废
* 6:未绑定
* 7:绑定
* 8:销售
*/
let
ifs
=
row
.
status
==
1
,
ifsa
=
row
.
status
==
2
,
ifsb
=
row
.
status
==
3
,
ifsc
=
row
.
status
==
4
,
ifsd
=
row
.
status
==
5
,
//0: 报废 1: 预占 2: 租赁 3: 销售 4: 闲置 5:待复检 6: 未绑定 7: 绑定
let
ifsd
=
row
.
status
==
0
,
ifsa
=
row
.
status
==
1
,
ifsb
=
row
.
status
==
2
,
ifsg
=
row
.
status
==
3
,
ifs
=
row
.
status
==
4
,
ifsc
=
row
.
status
==
5
,
ifse
=
row
.
status
==
6
,
ifsf
=
row
.
status
==
7
,
ifsg
=
row
.
status
==
8
,
devicetype1
=
row
.
f12
==
1
,
devicetype2
=
row
.
f12
==
2
,
intelligentUnit
=
row
.
intelligentUnit
;
devicetype1
=
row
.
equipmentType
==
1
,
devicetype2
=
row
.
equipmentType
==
2
,
intelligentUnit
=
row
.
ledgerEquipment
;
return
[
(
ifs
||
ifse
||
ifsd
)
&&
<
PremButton
...
...
@@ -84,7 +103,7 @@ const Ledger = () => {
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
item
:
row
,
val
:
'edit'
,
title
:
'编辑'
...
...
@@ -197,7 +216,7 @@ const Ledger = () => {
}
const
items
=
useMemo
(()
=>
{
if
(
drawer
.
val
==
'only'
)
{
if
(
drawer
.
item
.
f12
==
1
)
{
if
(
drawer
.
item
.
equipmentType
==
1
)
{
return
[
{
label
:
'基础信息'
,
key
:
'item-1'
,
children
:
<
Basemsg
drawer=
{
drawer
}
/>
},
{
label
:
'绑定履历'
,
key
:
'item-2'
,
children
:
<
Resume
drawer=
{
drawer
}
/>
},
...
...
@@ -222,9 +241,13 @@ const Ledger = () => {
onClick
:
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
open
:
true
,
val
:
'add'
,
title
:
'新增'
title
:
'新增'
,
item
:
{
factoryName
:
defaultmsg
?.
factory
?.
factoryName
,
supplierId
:
defaultmsg
?.
supplier
?.
id
}
}));
}
}
}
...
...
@@ -291,10 +314,10 @@ const Ledger = () => {
path=
{
pathconfig
?.
list
}
actionRef=
{
actionRef
}
resizeable=
{
false
}
dataSource=
{
[{
'f1'
:
'111'
,
'f2'
:
'222'
,
id
:
1
,
status
:
1
,
f12
:
1
,
intelligentUnit
:
'11'
}]
}
pageextra=
{
rightExtra
}
bordered=
{
false
}
x=
{
1500
}
extraparams=
{
extraparams
}
/>
</
div
>
</
div
>
...
...
@@ -310,7 +333,7 @@ const Ledger = () => {
onClose=
{
()
=>
{
setdrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
open
:
false
,
}));
}
}
onFinish=
{
async
(
vals
)
=>
{
...
...
src/pages/lease/supplier/index.jsx
View file @
b9301c04
...
...
@@ -22,99 +22,7 @@ const urlParams = {
list
:
'/lease/umEquipmentSupplier/queryList'
,
detail
:
'/lease/umEquipmentSupplier/queryById'
};
function
Supplier
(
props
)
{
let
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setDrawer
]
=
useState
({
visible
:
false
,
});
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
// detailpath: urlParams.detail,
// params:
{
id
:
row
?.
id
},
title
:
'编辑'
,
val
:
'only'
,
type
:
'edit'
,
item
:
row
,
// onFinish: async (vals) =>
{
// let equipmentSupplierCharReqList = [];
// //console.log('id:', row.id);
// for (let i in vals)
{
// if (!isNaN(Number(i)))
{
// equipmentSupplierCharReqList.push(
{
// fieldId: i,
// fieldRealValue: vals[i],
//
});
// delete vals[i];
//
}
//
}
// let params =
{
// ...vals,
// id: row?.id,
// shopIdList: vals.shopId,
// equipmentSupplierCharReqList,
//
};
// delete params.shopId;
// let res = await doFetch(
{
// url: urlParams.save,
// params,
//
});
// if (res.code === '0000')
{
// message.success('编辑成功!');
// setDrawer((s) => (
{
// ...s,
// visible: false,
//
}));
// actionRef.current.reload();
//
}
//
},
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
pop=
{
{
title
:
'是否删除该供应商?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
if
(
res
.
code
===
'0000'
)
{
message
.
success
(
'删除成功!'
);
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
Details
=
()
=>
{
const
columns
=
[
const
detailcolumns
=
[
{
title
:
'供应商编号'
,
dataIndex
:
'supplierNo'
,
...
...
@@ -138,8 +46,8 @@ function Supplier(props) {
},
{
title
:
'公司邮箱'
,
dataIndex
:
'e
mail'
,
key
:
'e
mail'
,
dataIndex
:
'companyE
mail'
,
key
:
'companyE
mail'
,
},
{
title
:
'地址'
,
...
...
@@ -161,9 +69,12 @@ function Supplier(props) {
dataIndex
:
'remark'
,
key
:
'remark'
,
},
];
];
const
Details
=
({
drawer
})
=>
{
const
[
newfieldscolumns
,
setnewfieldscolumns
]
=
useState
([]);
const
[
request
,
setrequest
]
=
useState
();
const
selectValueType
=
(
type
,
options
)
=>
{
switch
(
type
)
{
case
1
:
...
...
@@ -189,7 +100,7 @@ function Supplier(props) {
break
;
}
};
const
[
request
,
setrequest
]
=
useState
();
useEffect
(()
=>
{
fn
();
fn2
();
...
...
@@ -223,7 +134,6 @@ function Supplier(props) {
res
?.
data
?.
data
[
'equipmentSupplierCharList'
]?.
forEach
?.((
it
)
=>
{
obj
[
it
?.
fieldId
]
=
it
?.
fieldRealValue
;
});
setrequest
(
{
...(
res
?.
data
?.
data
??
{}),
...
...
@@ -233,7 +143,7 @@ function Supplier(props) {
};
return
(
<>
<
ProDescriptions
dataSource=
{
request
}
columns=
{
columns
}
/>
<
ProDescriptions
dataSource=
{
request
}
columns=
{
detail
columns
}
/>
<
AutoTable
pagetitle=
"联系信息"
columns=
{
[
...
...
@@ -292,6 +202,65 @@ function Supplier(props) {
<
ProDescriptions
dataSource=
{
request
}
columns=
{
newfieldscolumns
}
/>
</>
);
};
function
Supplier
(
props
)
{
let
actionRef
=
useRef
(),
formRef
=
useRef
();
const
[
drawer
,
setDrawer
]
=
useState
({
visible
:
false
,
});
const
edit
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
key=
'edit'
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
true
,
// detailpath: urlParams.detail,
// params:
{
id
:
row
?.
id
},
title
:
'编辑'
,
val
:
'only'
,
type
:
'edit'
,
item
:
row
}));
},
}
}
>
编辑
</
PremButton
>
);
};
const
remove
=
(
text
,
row
,
_
,
action
)
=>
{
return
(
<
PremButton
key=
'remove'
pop=
{
{
title
:
'是否删除该供应商?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onConfirm
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
urlParams
.
remove
,
params
:
{
id
:
row
.
id
}
});
if
(
res
.
code
===
'0000'
)
{
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
}));
actionRef
.
current
.
reload
();
}
},
}
}
btn=
{
{
size
:
'small'
,
type
:
'danger'
,
}
}
>
删除
</
PremButton
>
);
};
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
false
,
actionRef
);
...
...
@@ -324,7 +293,7 @@ function Supplier(props) {
const
selectMoreDrawerType
=
(
type
)
=>
{
switch
(
type
)
{
case
'detail'
:
return
<
Details
/>;
return
<
Details
drawer=
{
drawer
}
/>;
case
'add'
:
return
(
<
ExtendField
...
...
@@ -357,11 +326,6 @@ function Supplier(props) {
params
,
});
if
(
res
.
code
===
'0000'
)
{
if
(
drawer
?.
title
==
'编辑'
)
{
message
.
success
(
'编辑成功!'
);
}
else
{
message
.
success
(
'新增成功!'
);
}
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
@@ -402,11 +366,6 @@ function Supplier(props) {
params
,
});
if
(
res
.
code
===
'0000'
)
{
if
(
drawer
?.
title
==
'编辑'
)
{
message
.
success
(
'编辑成功!'
);
}
else
{
message
.
success
(
'新增成功!'
);
}
setDrawer
((
s
)
=>
({
...
s
,
visible
:
false
,
...
...
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