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
Expand all
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
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
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