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
79d6f580
Commit
79d6f580
authored
Sep 19, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
6bf879ab
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
316 additions
and
250 deletions
+316
-250
config.js
config/config.js
+11
-1
proxy.js
config/proxy.js
+11
-1
index.jsx
src/components/TagView/index.jsx
+5
-3
index.jsx
src/pages/lease/costanalysis/index.jsx
+289
-245
No files found.
config/config.js
View file @
79d6f580
/*
* @Author: wuhao930406 1148547900@qq.com
* @Date: 2023-09-19 08:36:54
* @LastEditors: wuhao930406 1148547900@qq.com
* @LastEditTime: 2023-09-19 08:54:01
* @FilePath: /ems3.3/config/config.js
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
// https://umijs.org/config/
import
{
defineConfig
}
from
'@umijs/max'
;
import
{
join
}
from
'path'
;
...
...
@@ -42,7 +52,7 @@ export default defineConfig({
publicPath
:
process
.
env
.
NODE_ENV
===
'production'
?
'./'
:
'/'
,
initialState
:
{},
model
:
{},
//
keepalive: keepalive,
keepalive
:
keepalive
,
layout
:
{
// https://umijs.org/zh-CN/plugins/plugin-layout
locale
:
false
,
...
...
config/proxy.js
View file @
79d6f580
/*
* @Author: wuhao930406 1148547900@qq.com
* @Date: 2023-09-19 08:36:54
* @LastEditors: wuhao930406 1148547900@qq.com
* @LastEditTime: 2023-09-19 08:41:04
* @FilePath: /ems3.3/config/proxy.js
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
/**
* 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* -------------------------------
...
...
@@ -13,7 +23,7 @@ export default {
dev
:
{
[
defaultSetting
.
proxypath
]:
{
// 要代理的地址
target
:
'http://192.168.40.11
0
:8000'
,
//jf哥
target
:
'http://192.168.40.11
1
:8000'
,
//jf哥
// target: 'http://192.168.40.248:8080', //jf哥
// target: 'http://192.168.40.64:28000', //gc哥
// target: 'http://192.168.40.203:8000', //dj哥
...
...
src/components/TagView/index.jsx
View file @
79d6f580
...
...
@@ -54,7 +54,7 @@ const TagView = ({ children, home }) => {
};
// 监听路由改变
const
handleOnChange
=
(
routeContext
)
=>
{
const
handleOnChange
=
async
(
routeContext
)
=>
{
const
{
currentMenu
}
=
routeContext
;
// console.log(tagList);
// tags初始化
...
...
@@ -64,7 +64,7 @@ const TagView = ({ children, home }) => {
// 判断是否已打开过该页面
let
hasOpen
=
false
;
if
(
currentMenu
.
path
)
{
cons
t
tagsCopy
=
tagList
.
map
((
item
)
=>
{
le
t
tagsCopy
=
tagList
.
map
((
item
)
=>
{
if
(
currentMenu
?.
path
===
item
.
path
)
{
//console.log(item);
hasOpen
=
true
;
...
...
@@ -87,6 +87,8 @@ const TagView = ({ children, home }) => {
refresh
:
0
,
active
:
true
,
});
await
setrefresh
(
false
);
setrefresh
(
true
);
}
return
setTagList
(
tagsCopy
);
...
...
@@ -162,7 +164,7 @@ const TagView = ({ children, home }) => {
</
div
>
<
div
className=
{
styles
.
child
}
>
<
div
className=
{
styles
.
contianbox
}
>
<
div
style=
{
{
width
:
"100%"
,
height
:
"100%"
}
}
>
{
refresh
&&
children
}
</
div
>
<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
}
}
>
{
refresh
&&
children
}
</
div
>
</
div
>
</
div
>
</>
...
...
src/pages/lease/costanalysis/index.jsx
View file @
79d6f580
...
...
@@ -4,14 +4,16 @@ import AutoTable from '@/components/AutoTable';
import
PremButton
from
'@/components/PremButton'
;
import
getcolumns
from
'./columns'
;
import
{
doFetch
,
exportFetch
}
from
'@/utils/doFetch'
;
import
{
useRequest
}
from
"ahooks"
;
import
{
Divider
,
Tabs
,
ProDescriptions
,
message
}
from
"antd"
;
import
{
useRequest
}
from
'ahooks'
;
import
{
Divider
,
Tabs
,
ProDescriptions
,
message
}
from
'antd'
;
import
dayjs
from
'dayjs'
;
import
Leaseterminformation
from
"./Leaseterminformation"
;
import
Leaseterminformation
from
'./Leaseterminformation'
;
import
{
useLocation
}
from
'@umijs/max'
;
const
Costanalysis
=
()
=>
{
const
{
pathname
,
state
}
=
useLocation
();
let
actionRef
=
useRef
(),
formRef
=
useRef
(),
boxRef
=
useRef
();
let
actionRef
=
useRef
(),
formRef
=
useRef
(),
boxRef
=
useRef
();
const
[
drawer
,
setdrawer
]
=
useState
({
open
:
false
,
}),
...
...
@@ -21,7 +23,7 @@ const Costanalysis = () => {
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
?.
code
==
"0000"
)
{
if
(
res
?.
code
==
'0000'
)
{
actionRef
?.
current
?.
reload
();
setdrawer
((
s
)
=>
({
...
s
,
...
...
@@ -32,7 +34,8 @@ const Costanalysis = () => {
});
const
columns
=
useMemo
(()
=>
{
csearch
({});
let
defcolumn
=
getcolumns
(
setdrawer
,
activeKey
)?.
filter
(
it
=>
it
.
key
==
activeKey
)?.[
0
]?.
columns
??
[];
let
defcolumn
=
getcolumns
(
setdrawer
,
activeKey
)?.
filter
((
it
)
=>
it
.
key
==
activeKey
)?.[
0
]?.
columns
??
[];
return
defcolumn
.
concat
({
title
:
'操作'
,
valueType
:
'option'
,
...
...
@@ -45,19 +48,27 @@ const Costanalysis = () => {
},
[
activeKey
]);
const
rightExtra
=
(
text
,
row
,
_
,
action
)
=>
{
return
[
activeKey
==
'item-1'
&&
<
PremButton
key=
'confirm'
activeKey
==
'item-1'
&&
(
<
PremButton
key=
"confirm"
btn=
{
{
size
:
'small'
,
onClick
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
'/lease/umContractEquipment/queryBeforeCollection'
,
params
:
{
id
:
row
.
id
}
});
let
res
=
await
doFetch
({
url
:
'/lease/umContractEquipment/queryBeforeCollection'
,
params
:
{
id
:
row
.
id
},
});
if
(
res
?.
data
?.
data
?.
waitNum
==
0
)
{
message
.
warning
(
'该设备需回款的租期已全部回款,无需再次回款!'
)
message
.
warning
(
'该设备需回款的租期已全部回款,无需再次回款!'
);
}
else
{
setdrawer
((
s
)
=>
({
...
s
,
open
:
true
,
item
:
{
...
row
,
waitNum
:
res
?.
data
?.
data
?.
waitNum
,
isColl
:
res
?.
data
?.
data
?.
isColl
},
item
:
{
...
row
,
waitNum
:
res
?.
data
?.
data
?.
waitNum
,
isColl
:
res
?.
data
?.
data
?.
isColl
,
},
val
:
'confirm'
,
title
:
'回款确认'
,
fields
:
[
...
...
@@ -66,7 +77,7 @@ const Costanalysis = () => {
dataIndex
:
'isColl'
,
key
:
'isColl'
,
fieldProps
:
{
disabled
:
true
disabled
:
true
,
},
colProps
:
{
span
:
8
},
},
...
...
@@ -75,7 +86,7 @@ const Costanalysis = () => {
dataIndex
:
'waitNum'
,
key
:
'waitNum'
,
fieldProps
:
{
disabled
:
true
disabled
:
true
,
},
valueType
:
'digit'
,
colProps
:
{
span
:
8
},
...
...
@@ -87,7 +98,7 @@ const Costanalysis = () => {
valueType
:
'digit'
,
colProps
:
{
span
:
8
},
precision
:
0
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
}
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'回款形式'
,
...
...
@@ -101,16 +112,18 @@ const Costanalysis = () => {
colProps
:
{
span
:
8
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
]
],
}));
}
},
}
}
>
回款确认
</
PremButton
>,
activeKey
==
'item-1'
&&
<
PremButton
key=
'reduction'
</
PremButton
>
),
activeKey
==
'item-1'
&&
(
<
PremButton
key=
"reduction"
btn=
{
{
size
:
'small'
,
onClick
:
()
=>
{
...
...
@@ -128,7 +141,7 @@ const Costanalysis = () => {
valueType
:
'digit'
,
colProps
:
{
span
:
8
},
precision
:
0
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
}
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
{
title
:
'减免情况说明'
,
...
...
@@ -145,23 +158,27 @@ const Costanalysis = () => {
fieldProps
:
{
limit
:
1
,
},
colProps
:
{
span
:
24
}
}
]
colProps
:
{
span
:
24
},
},
],
}));
},
}
}
>
租金减免
</
PremButton
>,
</
PremButton
>
),
<
PremButton
key=
'invoicing'
key=
"invoicing"
btn=
{
{
size
:
'small'
,
onClick
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
'/lease/umContractEquipment/queryBeforeInvoicing'
,
params
:
{
id
:
row
.
id
}
});
let
res
=
await
doFetch
({
url
:
'/lease/umContractEquipment/queryBeforeInvoicing'
,
params
:
{
id
:
row
.
id
},
});
if
(
res
?.
data
?.
data
?.
openNum
==
0
)
{
message
.
warning
(
'该设备已无需要开票的租期,无需开票记录!'
)
message
.
warning
(
'该设备已无需要开票的租期,无需开票记录!'
);
}
else
{
setdrawer
((
s
)
=>
({
...
s
,
...
...
@@ -177,17 +194,17 @@ const Costanalysis = () => {
valueType
:
'digit'
,
colProps
:
{
span
:
8
},
precision
:
0
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
}
}
]
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
],
}));
}
},
}
}
>
开票记录
</
PremButton
>
]
</
PremButton
>,
];
};
useEffect
(()
=>
{
if
(
state
)
{
...
...
@@ -197,12 +214,22 @@ const Costanalysis = () => {
catk
(
'item-1'
);
}
},
[
state
]);
return
<
div
ref=
{
boxRef
}
>
console
.
log
(
'===================================='
);
console
.
log
(
extraparams
);
console
.
log
(
'===================================='
);
return
(
<
div
ref=
{
boxRef
}
>
<
AutoTable
pagetitle=
{
<
h3
className=
"page-title"
>
费用分析
</
h3
>
}
columns=
{
columns
}
extraparams=
{
extraparams
}
path=
{
activeKey
==
'item-1'
?
'/lease/umContractEquipment/queryNoAnalysis'
:
'/lease/umContractEquipment/queryYesAnalysis'
}
path=
{
activeKey
==
'item-1'
?
'/lease/umContractEquipment/queryNoAnalysis'
:
'/lease/umContractEquipment/queryYesAnalysis'
}
actionRef=
{
actionRef
}
resizeable=
{
false
}
bordered=
{
false
}
...
...
@@ -216,20 +243,25 @@ const Costanalysis = () => {
pageextra=
{
'export'
}
formRef=
{
formRef
}
dataSourceFieldsChange=
{
(
vals
)
=>
{
csearch
(
vals
)
csearch
(
vals
);
}
}
exportconfig=
{
{
btn
:
{
type
:
'primary'
,
onClick
:
async
()
=>
{
message
.
warning
(
'导出中,请稍后'
);
await
exportFetch
({
url
:
activeKey
==
'item-1'
?
'/lease/umContractEquipment/exportExcelNoAnalysis'
:
'/lease/umContractEquipment/exportExcelYesAnalysis'
,
params
:
{
...
extraparams
,
...
searchParams
}
});
}
}
await
exportFetch
({
url
:
activeKey
==
'item-1'
?
'/lease/umContractEquipment/exportExcelNoAnalysis'
:
'/lease/umContractEquipment/exportExcelYesAnalysis'
,
params
:
{
...
extraparams
,
...
searchParams
},
});
},
},
}
}
/>
<
DrawerPro
{
...
drawer
}
fields=
{
drawer
.
fields
}
...
...
@@ -242,22 +274,34 @@ const Costanalysis = () => {
open
:
false
,
}));
}
}
onValuesChange=
{
(
changedValues
,
allValues
)
=>
{
}
}
onValuesChange=
{
(
changedValues
,
allValues
)
=>
{}
}
onFinish=
{
async
(
vals
)
=>
{
let
newVals
=
JSON
.
parse
(
JSON
.
stringify
(
vals
));
if
(
drawer
?.
val
==
'confirm'
)
{
await
runAsync
({
url
:
'/lease/umContractEquipment/collection'
,
params
:
{
collNum
:
newVals
.
collNum
,
collType
:
newVals
.
collType
,
id
:
drawer
?.
item
?.
id
}
});
await
runAsync
({
url
:
'/lease/umContractEquipment/collection'
,
params
:
{
collNum
:
newVals
.
collNum
,
collType
:
newVals
.
collType
,
id
:
drawer
?.
item
?.
id
,
},
});
}
else
if
(
drawer
?.
val
==
'reduction'
)
{
await
runAsync
({
url
:
'/lease/umContractEquipment/exemption'
,
params
:
{
...
newVals
,
id
:
drawer
?.
item
?.
id
}
});
await
runAsync
({
url
:
'/lease/umContractEquipment/exemption'
,
params
:
{
...
newVals
,
id
:
drawer
?.
item
?.
id
},
});
}
else
if
(
drawer
?.
val
==
'invoicing'
)
{
await
runAsync
({
url
:
'/lease/umContractEquipment/invoicing'
,
params
:
{
...
newVals
,
id
:
drawer
?.
item
?.
id
}
});
await
runAsync
({
url
:
'/lease/umContractEquipment/invoicing'
,
params
:
{
...
newVals
,
id
:
drawer
?.
item
?.
id
},
});
}
}
}
>
<
Leaseterminformation
drawer=
{
drawer
}
boxRef=
{
boxRef
}
/>
</
DrawerPro
>
</
div
>
}
);
};
export
default
Costanalysis
;
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