Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cdsf-wx-app
Project
Overview
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
姜雷
cdsf-wx-app
Commits
3828a0ec
Commit
3828a0ec
authored
Oct 09, 2018
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改列表请求
parent
6508463b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
157 additions
and
227 deletions
+157
-227
PublicCarApply.js
src/containers/PublicCar/PublicCarApply.js
+15
-12
PublicCarList.js
src/containers/PublicCar/PublicCarList.js
+28
-43
PublicCarItem.js
src/containers/PublicCar/components/PublicCarItem.js
+4
-13
index.js
src/containers/PublicCarDeal/index.js
+46
-67
RepairList.js
src/containers/Repair/RepairList.js
+37
-39
index.js
src/containers/RepairDeal/index.js
+27
-53
No files found.
src/containers/PublicCar/PublicCarApply.js
View file @
3828a0ec
...
@@ -69,6 +69,17 @@ class PublicCarApply extends Component {
...
@@ -69,6 +69,17 @@ class PublicCarApply extends Component {
}
}
return
true
;
return
true
;
};
};
resetForm
=
()
=>
{
this
.
setState
({
createDate
:
formatDate
(
new
Date
(),
'yyyy-MM-dd'
),
categoryId
:
''
,
userCount
:
''
,
beginDate
:
''
,
endDate
:
''
,
lineDescription
:
''
,
showAllCategory
:
false
,
});
};
onSubmit
=
()
=>
{
onSubmit
=
()
=>
{
if
(
!
this
.
validateForm
())
{
if
(
!
this
.
validateForm
())
{
return
;
return
;
...
@@ -84,8 +95,8 @@ class PublicCarApply extends Component {
...
@@ -84,8 +95,8 @@ class PublicCarApply extends Component {
department
:
this
.
state
.
department
,
department
:
this
.
state
.
department
,
name
:
this
.
state
.
name
,
name
:
this
.
state
.
name
,
categoryName
:
categoryName
,
categoryName
:
categoryName
,
beginDate
:
this
.
state
.
beginDate
,
beginDate
:
formatDate
(
this
.
state
.
beginDate
,
'yyyy-MM-dd hh:mm:ss'
)
,
endDate
:
this
.
state
.
endDate
,
endDate
:
formatDate
(
this
.
state
.
endDate
,
'yyyy-MM-dd hh:mm:ss'
)
,
lineDescription
:
this
.
state
.
lineDescription
,
lineDescription
:
this
.
state
.
lineDescription
,
userCount
:
this
.
state
.
userCount
,
userCount
:
this
.
state
.
userCount
,
};
};
...
@@ -93,20 +104,12 @@ class PublicCarApply extends Component {
...
@@ -93,20 +104,12 @@ class PublicCarApply extends Component {
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
'res: '
+
res
);
console
.
log
(
'res: '
+
res
);
Toast
.
success
(
res
.
msg
);
Toast
.
success
(
res
.
msg
);
this
.
resetForm
();
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
'err: '
+
err
);
console
.
log
(
'err: '
+
err
);
Toast
.
fail
(
err
.
msg
||
'提交失败!'
);
});
});
// sendMsg({
// cellphone: '18108096099',
// })
// .then(res => {
// console.log(res);
// Toast.success('发送成功!');
// })
// .catch(err => {
// console.log(err);
// });
};
};
render
()
{
render
()
{
const
{
const
{
...
...
src/containers/PublicCar/PublicCarList.js
View file @
3828a0ec
...
@@ -30,65 +30,47 @@ class PublicCarList extends Component {
...
@@ -30,65 +30,47 @@ class PublicCarList extends Component {
}),
}),
0
0
);
);
this
.
fetchList
();
}
fetchList
=
fetchMore
=>
{
const
{
pagination
}
=
this
.
state
;
const
{
pagination
}
=
this
.
state
;
const
nowDate
=
new
Date
().
toISOString
();
const
nowDate
=
new
Date
().
toISOString
();
fetchPublicCarList
({
const
entity
=
fetchMore
?
{
...
pagination
,
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
}
:
{
...
pagination
,
pageNum
:
1
,
nowDate
,
nowDate
,
})
};
fetchPublicCarList
(
entity
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
res
);
this
.
setState
(
this
.
setState
(({
pagination
})
=>
({
({
list
,
pagination
})
=>
list
:
res
.
data
,
fetchMore
?
res
.
data
.
length
?
{
list
:
[...
list
,
...
res
.
data
],
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
nowDate
,
pageNum
:
pagination
.
pageNum
+
1
,
},
},
refreshing
:
false
,
refreshing
:
false
,
}));
})
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
this
.
setState
({
refreshing
:
false
,
});
});
}
}
fetchList
=
()
=>
{
:
{
const
{
pagination
}
=
this
.
state
;
refreshing
:
false
,
return
fetchPublicCarList
({
...
pagination
})
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
)
{
this
.
setState
(({
pagination
})
=>
({
list
:
res
.
data
,
pagination
:
{
...
pagination
,
},
}));
}
}
})
:
{
.
catch
(
err
=>
{
console
.
log
(
err
);
});
};
refreshHandle
=
()
=>
{
this
.
setState
({
refreshing
:
true
});
const
{
pagination
}
=
this
.
state
;
fetchPublicCarList
({
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
})
.
then
(
res
=>
{
console
.
log
(
res
);
this
.
setState
(({
pagination
})
=>
({
list
:
res
.
data
,
list
:
res
.
data
,
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
nowDate
,
},
},
refreshing
:
false
,
refreshing
:
false
,
}));
}
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
...
@@ -97,6 +79,9 @@ class PublicCarList extends Component {
...
@@ -97,6 +79,9 @@ class PublicCarList extends Component {
});
});
});
});
};
};
refreshHandle
=
()
=>
{
this
.
fetchList
(
true
);
};
render
()
{
render
()
{
return
(
return
(
<
div
className
=
{
styles
.
publicCarList
}
>
<
div
className
=
{
styles
.
publicCarList
}
>
...
...
src/containers/PublicCar/components/PublicCarItem.js
View file @
3828a0ec
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
styles
from
'./style.css'
;
import
styles
from
'./style.css'
;
import
titleIcon
from
'../../Repair/images/dropdown_icon@2x.png'
;
import
titleIcon
from
'../../Repair/images/dropdown_icon@2x.png'
;
import
{
formatDate
}
from
'../../../utils/index'
;
class
PublicCarItem
extends
Component
{
class
PublicCarItem
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -58,9 +57,7 @@ class PublicCarItem extends Component {
...
@@ -58,9 +57,7 @@ class PublicCarItem extends Component {
?
[
?
[
<
div
key
=
"time"
className
=
{
styles
.
listLine
}
>
<
div
key
=
"time"
className
=
{
styles
.
listLine
}
>
<
div
className
=
{
styles
.
listLabel
}
>
用车时间:
<
/div
>
<
div
className
=
{
styles
.
listLabel
}
>
用车时间:
<
/div
>
<
div
className
=
{
styles
.
listValue
}
>
<
div
className
=
{
styles
.
listValue
}
>
{
data
.
createDate
}
<
/div
>
{
formatDate
(
new
Date
(
data
.
createDate
),
'yyyy-MM-dd'
)}
<
/div
>
<
/div>
,
<
/div>
,
<
div
key
=
"type"
className
=
{
styles
.
listLine
}
>
<
div
key
=
"type"
className
=
{
styles
.
listLine
}
>
<
div
className
=
{
styles
.
listLabel
}
>
用车类型:
<
/div
>
<
div
className
=
{
styles
.
listLabel
}
>
用车类型:
<
/div
>
...
@@ -84,15 +81,11 @@ class PublicCarItem extends Component {
...
@@ -84,15 +81,11 @@ class PublicCarItem extends Component {
<
/div>
,
<
/div>
,
<
div
key
=
"beginDate"
className
=
{
styles
.
listLine
}
>
<
div
key
=
"beginDate"
className
=
{
styles
.
listLine
}
>
<
div
className
=
{
styles
.
listLabel
}
>
开始时间:
<
/div
>
<
div
className
=
{
styles
.
listLabel
}
>
开始时间:
<
/div
>
<
div
className
=
{
styles
.
listValue
}
>
<
div
className
=
{
styles
.
listValue
}
>
{
data
.
beginDate
}
<
/div
>
{
formatDate
(
new
Date
(
data
.
beginDate
),
'yyyy-MM-dd hh:mm'
)}
<
/div
>
<
/div>
,
<
/div>
,
<
div
key
=
"endDate"
className
=
{
styles
.
listLine
}
>
<
div
key
=
"endDate"
className
=
{
styles
.
listLine
}
>
<
div
className
=
{
styles
.
listLabel
}
>
结束时间:
<
/div
>
<
div
className
=
{
styles
.
listLabel
}
>
结束时间:
<
/div
>
<
div
className
=
{
styles
.
listValue
}
>
<
div
className
=
{
styles
.
listValue
}
>
{
data
.
endDate
}
<
/div
>
{
formatDate
(
new
Date
(
data
.
endDate
),
'yyyy-MM-dd hh:mm'
)}
<
/div
>
<
/div>
,
<
/div>
,
<
div
<
div
key
=
"dealName"
key
=
"dealName"
...
@@ -146,9 +139,7 @@ class PublicCarItem extends Component {
...
@@ -146,9 +139,7 @@ class PublicCarItem extends Component {
:
[
:
[
<
div
key
=
"time"
className
=
{
styles
.
listLine
}
>
<
div
key
=
"time"
className
=
{
styles
.
listLine
}
>
<
div
className
=
{
styles
.
listLabel
}
>
用车时间:
<
/div
>
<
div
className
=
{
styles
.
listLabel
}
>
用车时间:
<
/div
>
<
div
className
=
{
styles
.
listValue
}
>
<
div
className
=
{
styles
.
listValue
}
>
{
data
.
createDate
}
<
/div
>
{
formatDate
(
new
Date
(
data
.
createDate
),
'yyyy-MM-dd'
)}
<
/div
>
<
/div>
,
<
/div>
,
<
div
key
=
"type"
className
=
{
styles
.
listLine
}
>
<
div
key
=
"type"
className
=
{
styles
.
listLine
}
>
<
div
className
=
{
styles
.
listLabel
}
>
用车类型:
<
/div
>
<
div
className
=
{
styles
.
listLabel
}
>
用车类型:
<
/div
>
...
...
src/containers/PublicCarDeal/index.js
View file @
3828a0ec
...
@@ -11,6 +11,7 @@ import {
...
@@ -11,6 +11,7 @@ import {
import
SelectIcon
from
'./images/more_item_btn@2x.png'
;
import
SelectIcon
from
'./images/more_item_btn@2x.png'
;
import
offCheckIcon
from
'../../images/Check/radio_off_btn@2x.png'
;
import
offCheckIcon
from
'../../images/Check/radio_off_btn@2x.png'
;
import
onCheckIcon
from
'../../images/Check/radio_on_btn@2x.png'
;
import
onCheckIcon
from
'../../images/Check/radio_on_btn@2x.png'
;
import
UserInfoContext
from
'../../context/userinfo-context'
;
class
PublicCarDeal
extends
Component
{
class
PublicCarDeal
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -35,69 +36,48 @@ class PublicCarDeal extends Component {
...
@@ -35,69 +36,48 @@ class PublicCarDeal extends Component {
};
};
}
}
componentDidMount
()
{
componentDidMount
()
{
const
{
pagination
}
=
this
.
state
;
this
.
fetchList
();
const
nowDate
=
new
Date
().
toISOString
();
fetchApplyPublicCarList
({
...
pagination
,
nowDate
,
})
.
then
(
res
=>
{
this
.
setState
(({
pagination
})
=>
({
list
:
res
.
data
,
pagination
:
{
...
pagination
,
nowDate
,
},
refreshing
:
false
,
}));
})
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
this
.
setState
({
refreshing
:
false
,
});
});
}
}
fetchList
=
fetchMore
=>
{
fetchList
=
fetchMore
=>
{
this
.
setState
({
refreshing
:
true
});
this
.
setState
({
refreshing
:
true
});
const
{
pagination
}
=
this
.
state
;
const
{
pagination
}
=
this
.
state
;
fetchApplyPublicCarList
({
const
nowDate
=
new
Date
().
toISOString
();
const
entity
=
fetchMore
?
{
...
pagination
,
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
pageNum
:
pagination
.
pageNum
+
1
,
})
}
:
{
...
pagination
,
pageNum
:
1
,
nowDate
,
};
fetchApplyPublicCarList
(
entity
)
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
setState
(({
pagination
})
=>
({
this
.
setState
(
list
:
res
.
data
,
({
list
,
pagination
})
=>
fetchMore
?
res
.
data
.
length
?
{
list
:
[...
list
,
...
res
.
data
],
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
pageNum
:
pagination
.
pageNum
+
1
,
},
},
refreshing
:
false
,
refreshing
:
false
,
}));
}
})
:
{
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
this
.
setState
({
refreshing
:
false
,
refreshing
:
false
,
});
}
});
:
{
};
list
:
res
.
data
,
refreshHandle
=
()
=>
{
this
.
setState
({
refreshing
:
true
});
const
{
pagination
}
=
this
.
state
;
fetchApplyPublicCarList
({
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
})
.
then
(
res
=>
{
this
.
setState
(({
list
,
pagination
})
=>
({
list
:
[...
list
,
...
res
.
data
],
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
nowDate
,
},
},
refreshing
:
false
,
refreshing
:
false
,
}));
}
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
...
@@ -106,10 +86,8 @@ class PublicCarDeal extends Component {
...
@@ -106,10 +86,8 @@ class PublicCarDeal extends Component {
});
});
});
});
};
};
toggleSelectedState
=
val
=>
{
refreshHandle
=
()
=>
{
this
.
setState
({
this
.
fetchList
(
true
);
selected
:
val
,
});
};
};
dealHandle
=
id
=>
{
dealHandle
=
id
=>
{
if
(
this
.
state
.
carPlateList
.
length
===
0
)
{
if
(
this
.
state
.
carPlateList
.
length
===
0
)
{
...
@@ -161,7 +139,7 @@ class PublicCarDeal extends Component {
...
@@ -161,7 +139,7 @@ class PublicCarDeal extends Component {
Toast
.
fail
(
'请选择处理结果!'
);
Toast
.
fail
(
'请选择处理结果!'
);
return
false
;
return
false
;
}
}
if
(
value
===
1
)
{
if
(
value
===
2
)
{
if
(
!
carPlate
)
{
if
(
!
carPlate
)
{
Toast
.
fail
(
'请选择派车!'
);
Toast
.
fail
(
'请选择派车!'
);
return
false
;
return
false
;
...
@@ -176,15 +154,18 @@ class PublicCarDeal extends Component {
...
@@ -176,15 +154,18 @@ class PublicCarDeal extends Component {
const
{
const
{
selected
:
{
id
,
value
,
carPlate
,
dealOpinion
},
selected
:
{
id
,
value
,
carPlate
,
dealOpinion
},
}
=
this
.
state
;
}
=
this
.
state
;
const
{
userinfo
}
=
this
.
props
;
const
entity
=
const
entity
=
value
===
1
value
===
2
?
{
?
{
id
:
id
,
id
:
id
,
dealName
:
userinfo
.
name
,
dealResult
:
value
,
dealResult
:
value
,
carPlate
:
carPlate
,
carPlate
:
carPlate
,
}
}
:
{
:
{
id
:
id
,
id
:
id
,
dealName
:
userinfo
.
name
,
dealResult
:
value
,
dealResult
:
value
,
dealOpinion
:
dealOpinion
dealOpinion
:
dealOpinion
?
`不同意 -
${
dealOpinion
}
`
?
`不同意 -
${
dealOpinion
}
`
...
@@ -193,6 +174,7 @@ class PublicCarDeal extends Component {
...
@@ -193,6 +174,7 @@ class PublicCarDeal extends Component {
dealPublicCar
(
entity
)
dealPublicCar
(
entity
)
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
resetDialog
();
this
.
resetDialog
();
this
.
fetchList
();
Toast
.
success
(
res
.
msg
||
'处理成功!'
);
Toast
.
success
(
res
.
msg
||
'处理成功!'
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -263,10 +245,10 @@ class PublicCarDeal extends Component {
...
@@ -263,10 +245,10 @@ class PublicCarDeal extends Component {
<
div
key
=
"radio"
className
=
{
styles
.
alertInfo
}
>
<
div
key
=
"radio"
className
=
{
styles
.
alertInfo
}
>
<
div
<
div
className
=
{
styles
.
radioBox
}
className
=
{
styles
.
radioBox
}
onClick
=
{()
=>
this
.
toggleSelectedState
(
1
)}
onClick
=
{()
=>
this
.
toggleSelectedState
(
2
)}
>
>
<
span
className
=
{
styles
.
checkLabel
}
>
<
span
className
=
{
styles
.
checkLabel
}
>
{
value
===
1
?
(
{
value
===
2
?
(
<
img
src
=
{
onCheckIcon
}
alt
=
""
/>
<
img
src
=
{
onCheckIcon
}
alt
=
""
/>
)
:
(
)
:
(
<
img
src
=
{
offCheckIcon
}
alt
=
""
/>
<
img
src
=
{
offCheckIcon
}
alt
=
""
/>
...
@@ -276,10 +258,10 @@ class PublicCarDeal extends Component {
...
@@ -276,10 +258,10 @@ class PublicCarDeal extends Component {
<
/div
>
<
/div
>
<
div
<
div
className
=
{
styles
.
radioBox
}
className
=
{
styles
.
radioBox
}
onClick
=
{()
=>
this
.
toggleSelectedState
(
2
)}
onClick
=
{()
=>
this
.
toggleSelectedState
(
3
)}
>
>
<
span
className
=
{
styles
.
checkLabel
}
>
<
span
className
=
{
styles
.
checkLabel
}
>
{
value
===
2
?
(
{
value
===
3
?
(
<
img
src
=
{
onCheckIcon
}
alt
=
""
/>
<
img
src
=
{
onCheckIcon
}
alt
=
""
/>
)
:
(
)
:
(
<
img
src
=
{
offCheckIcon
}
alt
=
""
/>
<
img
src
=
{
offCheckIcon
}
alt
=
""
/>
...
@@ -288,7 +270,7 @@ class PublicCarDeal extends Component {
...
@@ -288,7 +270,7 @@ class PublicCarDeal extends Component {
<
span
>
不同意
<
/span
>
<
span
>
不同意
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
value
===
1
?
(
{
value
===
2
?
(
<
div
key
=
"agree"
className
=
{
styles
.
agree
}
>
<
div
key
=
"agree"
className
=
{
styles
.
agree
}
>
<
span
className
=
{
styles
.
dialogAgreeLabel
}
>
派车车牌
<
/span
>
<
span
className
=
{
styles
.
dialogAgreeLabel
}
>
派车车牌
<
/span
>
<
div
className
=
{
styles
.
selectWrap
}
>
<
div
className
=
{
styles
.
selectWrap
}
>
...
@@ -301,21 +283,14 @@ class PublicCarDeal extends Component {
...
@@ -301,21 +283,14 @@ class PublicCarDeal extends Component {
onChange
=
{
this
.
onSelectHandle
}
onChange
=
{
this
.
onSelectHandle
}
>
>
{
carPlateList
.
map
(
i
=>
(
{
carPlateList
.
map
(
i
=>
(
<
option
key
=
{
i
.
value
}
value
=
{
i
.
valu
e
}
>
<
option
key
=
{
i
.
value
}
value
=
{
i
.
labl
e
}
>
{
i
.
lable
}
{
i
.
lable
}
<
/option
>
<
/option
>
))}
))}
<
/select
>
<
/select
>
<
/div
>
<
/div
>
{
/* <Select
placeholder="请选择"
data={carPlateList}
cols={1}
onChange={this.onSelectHandle}
/> */
}
<
/div
>
<
/div
>
)
:
value
===
2
?
(
)
:
value
===
3
?
(
<
div
key
=
"notAgree"
className
=
{
styles
.
notAgree
}
>
<
div
key
=
"notAgree"
className
=
{
styles
.
notAgree
}
>
<
span
className
=
{
styles
.
dialogLabel
}
>
处理结果
<
/span
>
<
span
className
=
{
styles
.
dialogLabel
}
>
处理结果
<
/span
>
<
TextareaItem
<
TextareaItem
...
@@ -335,4 +310,8 @@ class PublicCarDeal extends Component {
...
@@ -335,4 +310,8 @@ class PublicCarDeal extends Component {
}
}
}
}
export
default
PublicCarDeal
;
export
default
props
=>
(
<
UserInfoContext
.
Consumer
>
{({
userinfo
})
=>
<
PublicCarDeal
userinfo
=
{
userinfo
}
{...
props
}
/>
}
<
/UserInfoContext.Consumer
>
);
src/containers/Repair/RepairList.js
View file @
3828a0ec
...
@@ -8,14 +8,14 @@ import Perview from '../../components/Perview/Perview';
...
@@ -8,14 +8,14 @@ import Perview from '../../components/Perview/Perview';
class
RepairList
extends
Component
{
class
RepairList
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
const
getSectionData
=
(
dataBlob
,
sectionID
)
=>
dataBlob
[
sectionID
];
//
const getSectionData = (dataBlob, sectionID) => dataBlob[sectionID];
const
getRowData
=
(
dataBlob
,
sectionID
,
rowID
)
=>
dataBlob
[
rowID
];
//
const getRowData = (dataBlob, sectionID, rowID) => dataBlob[rowID];
const
list
=
new
ListView
.
DataSource
({
//
const list = new ListView.DataSource({
getRowData
,
//
getRowData,
getSectionHeaderData
:
getSectionData
,
//
getSectionHeaderData: getSectionData,
rowHasChanged
:
(
row1
,
row2
)
=>
row1
!==
row2
,
//
rowHasChanged: (row1, row2) => row1 !== row2,
sectionHeaderHasChanged
:
(
s1
,
s2
)
=>
s1
!==
s2
,
//
sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
});
//
});
this
.
state
=
{
this
.
state
=
{
refreshing
:
false
,
refreshing
:
false
,
down
:
true
,
down
:
true
,
...
@@ -25,7 +25,7 @@ class RepairList extends Component {
...
@@ -25,7 +25,7 @@ class RepairList extends Component {
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
50
,
pageSize
:
50
,
},
},
list
:
list
,
list
:
[]
,
perviewVisibility
:
false
,
perviewVisibility
:
false
,
selectedImgList
:
[],
selectedImgList
:
[],
perviewIndex
:
0
,
perviewIndex
:
0
,
...
@@ -41,52 +41,47 @@ class RepairList extends Component {
...
@@ -41,52 +41,47 @@ class RepairList extends Component {
}),
}),
0
0
);
);
this
.
fetchList
();
}
fetchList
=
fetchMore
=>
{
const
{
pagination
}
=
this
.
state
;
const
{
pagination
}
=
this
.
state
;
const
nowDate
=
new
Date
().
toISOString
();
const
nowDate
=
new
Date
().
toISOString
();
fetchRepairList
({
const
entity
=
fetchMore
?
{
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
}
:
{
...
pagination
,
...
pagination
,
pageNum
:
1
,
nowDate
,
nowDate
,
})
};
fetchRepairList
(
entity
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
res
);
this
.
setState
(
this
.
setState
(({
pagination
})
=>
({
({
list
,
pagination
})
=>
list
:
res
.
data
,
fetchMore
?
res
.
data
.
length
?
{
list
:
[...
list
,
...
res
.
data
],
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
nowDate
,
pageNum
:
pagination
.
pageNum
+
1
,
},
},
}));
})
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
this
.
setState
({
refreshing
:
false
,
refreshing
:
false
,
});
});
}
}
refreshHandle
=
()
=>
{
:
{
this
.
setState
({
refreshing
:
true
});
const
{
pagination
}
=
this
.
state
;
fetchRepairList
({
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
})
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
length
)
{
this
.
setState
(({
list
,
pagination
})
=>
({
refreshing
:
false
,
refreshing
:
false
,
list
:
[...
list
,
...
res
.
data
],
}
:
{
list
:
res
.
data
,
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
nowDate
,
},
},
}));
}
else
{
this
.
setState
({
refreshing
:
false
,
refreshing
:
false
,
});
}
}
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
...
@@ -95,6 +90,9 @@ class RepairList extends Component {
...
@@ -95,6 +90,9 @@ class RepairList extends Component {
});
});
});
});
};
};
refreshHandle
=
()
=>
{
this
.
fetchList
(
true
);
};
showViewHandle
=
(
list
,
index
)
=>
{
showViewHandle
=
(
list
,
index
)
=>
{
this
.
setState
({
this
.
setState
({
perviewVisibility
:
true
,
perviewVisibility
:
true
,
...
...
src/containers/RepairDeal/index.js
View file @
3828a0ec
...
@@ -22,47 +22,48 @@ class RepairDeal extends Component {
...
@@ -22,47 +22,48 @@ class RepairDeal extends Component {
};
};
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
fetchList
();
}
fetchList
=
fetchMore
=>
{
this
.
setState
({
refreshing
:
true
});
const
{
pagination
}
=
this
.
state
;
const
{
pagination
}
=
this
.
state
;
const
nowDate
=
new
Date
().
toISOString
();
const
nowDate
=
new
Date
().
toISOString
();
fetchReportRepairList
({
const
entity
=
fetchMore
?
{
...
pagination
,
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
}
:
{
...
pagination
,
pageNum
:
1
,
nowDate
,
nowDate
,
})
};
fetchReportRepairList
(
entity
)
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
res
);
this
.
setState
(
this
.
setState
(({
pagination
})
=>
({
({
list
,
pagination
})
=>
list
:
res
.
data
,
fetchMore
?
res
.
data
.
length
?
{
list
:
[...
list
,
...
res
.
data
],
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
nowDate
,
pageNum
:
pagination
.
pageNum
+
1
,
},
},
refreshing
:
false
,
refreshing
:
false
,
}));
}
})
:
{
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
this
.
setState
({
refreshing
:
false
,
refreshing
:
false
,
});
});
}
}
fetchList
=
()
=>
{
:
{
const
{
pagination
}
=
this
.
state
;
const
nowDate
=
new
Date
().
toISOString
();
fetchReportRepairList
({
...
pagination
,
nowDate
,
})
.
then
(
res
=>
{
console
.
log
(
res
);
this
.
setState
(({
pagination
})
=>
({
list
:
res
.
data
,
list
:
res
.
data
,
pagination
:
{
pagination
:
{
...
pagination
,
...
pagination
,
nowDate
,
nowDate
,
},
},
refreshing
:
false
,
refreshing
:
false
,
}));
}
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
...
@@ -72,35 +73,7 @@ class RepairDeal extends Component {
...
@@ -72,35 +73,7 @@ class RepairDeal extends Component {
});
});
};
};
refreshHandle
=
()
=>
{
refreshHandle
=
()
=>
{
this
.
setState
({
refreshing
:
true
});
this
.
fetchList
(
true
);
const
{
pagination
}
=
this
.
state
;
fetchReportRepairList
({
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
})
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
length
)
{
this
.
setState
(({
list
,
pagination
})
=>
({
refreshing
:
false
,
list
:
[...
list
,
...
res
.
data
],
pagination
:
{
...
pagination
,
pageNum
:
pagination
.
pageNum
+
1
,
},
}));
}
else
{
this
.
setState
({
refreshing
:
false
,
});
}
})
.
catch
(
err
=>
{
Toast
.
fail
(
err
.
msg
||
'请求失败!'
);
this
.
setState
({
refreshing
:
false
,
});
});
};
};
dealHandle
=
id
=>
{
dealHandle
=
id
=>
{
console
.
log
(
'in date'
);
console
.
log
(
'in date'
);
...
@@ -121,6 +94,7 @@ class RepairDeal extends Component {
...
@@ -121,6 +94,7 @@ class RepairDeal extends Component {
id
:
id
,
id
:
id
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
fetchList
();
Toast
.
fail
(
res
.
msg
||
'处理成功!'
);
Toast
.
fail
(
res
.
msg
||
'处理成功!'
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
...
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