巴林闲侠 1 year ago
parent
commit
4a548a4c8d
  1. 46
      weapp/src/packages/patrol/index.jsx
  2. 31
      weapp/src/packages/patrolView/index.jsx
  3. 8
      weapp/src/packages/patrolView/index.scss
  4. 6
      web/client/src/sections/fillion/components/patrolTable.js

46
weapp/src/packages/patrol/index.jsx

@ -59,6 +59,7 @@ const Index = () => {
const [handleId, setHandleId] = useState([])
const [video, setVideo] = useState('')
const [videoqn, setVideoqn] = useState([])
const [handleType, setHandleType] = useState('')
const prjType =
isAnomaly ?
@ -140,13 +141,14 @@ const Index = () => {
setRoadSectionEnd(data.roadSectionEnd)
setAddress(data.address)
setContent(data.content)
setHandleType(data.handleState)
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: imgUrl + item })) : [])
setHandlePic(data.handlePic ? data.handlePic.map(item => ({ url: imgUrl + item })) : [])
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : [])
setHandleId(data.id)
setVideo(imgUrl + data.videoUrl[0])
setVideo(data.videoUrl[0] ? imgUrl + data.videoUrl[0] : '')
if (data.handleContent) {
setHandleCenter(data.handleContent)
}
@ -249,7 +251,7 @@ const Index = () => {
])
}, [reportType])
function report () {
function report() {
if (!canReport) { return }
if (
(isPatrol && (!projectType || !road))
@ -326,7 +328,7 @@ const Index = () => {
})
}
function deleteReport () {
function deleteReport() {
Taro.showModal({
title: '提示',
content: '确定删除吗?',
@ -353,7 +355,7 @@ const Index = () => {
})
}
function handleInput ({ detail: { value } }, type) {
function handleInput({ detail: { value } }, type) {
switch (type) {
case 'roadSectionStart':
setRoadSectionStart(value)
@ -388,15 +390,15 @@ const Index = () => {
}
}
function handleTypeChange (e) {
function handleTypeChange(e) {
setReportType(e.detail.value)
}
function handleImgChange (files, operationType, index, type) {
function handleImgChange(files, operationType, index, type) {
if (operationType === 'remove') {
setImg(false)
}
function setImg (isAdd, url) {
function setImg(isAdd, url) {
switch (type) {
case 'scenePic':
let nextImg = sceneImg
@ -496,12 +498,12 @@ const Index = () => {
}
}
function handleImgClick (index, file) {
function handleImgClick(index, file) {
Taro.previewImage({
urls: [file.url] // http
})
}
function handleImgClicks (index, file) {
function handleImgClicks(index, file) {
Taro.previewImage({
urls: [file] // http
})
@ -523,7 +525,7 @@ const Index = () => {
}
}
}, [road])
function handleOk () {
function handleOk() {
if (!canReport) { return }
let str = handleCenter.trim()
if (!str) {
@ -568,7 +570,7 @@ const Index = () => {
}
})
}
function addVideo () {
function addVideo() {
wx.chooseMedia({
count: 1,
mediaType: ['video'],
@ -611,6 +613,7 @@ const Index = () => {
}
})
}
console.log(handleType,'handleType');
return (
<View className='patrol'>
{/* {
@ -941,11 +944,10 @@ const Index = () => {
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton>
}
{
wait == 'wait' || handle == 'handle' ? <view>
handleType == '已处理' || wait == 'wait' || handle == 'handle' ? <view>
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容</view>
<AtTextarea
title='处理内容:'
placeholder='请输入处理内容'
value={handleCenter}
onChange={(v, e) => handleInput(e, 'wait')}
disabled={handle == 'handle' ? true : false}
@ -959,15 +961,15 @@ const Index = () => {
{handlePic.map(item => (
<Image className='img' src={item.url} onClick={() => handleImgClicks(undefined, item)} />
))}
</View> :
<AtImagePicker
className='img-picker'
count={3 - handlePic.length}
showAddBtn={handlePic.length >= 3 ? false : true}
files={handlePic}
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')}
onImageClick={handleImgClick}
/>
</View> : handleType != '已处理' ?
<AtImagePicker
className='img-picker'
count={3 - handlePic.length}
showAddBtn={handlePic.length >= 3 ? false : true}
files={handlePic}
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')}
onImageClick={handleImgClick}
/> : ''
}
{handle != 'handle' ? <AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton> : ''}
</View>

31
weapp/src/packages/patrolView/index.jsx

@ -14,7 +14,7 @@ import patrolActiveIcon from '../../static/img/patrolView/patrol-active.svg'
import conserveIcon from '../../static/img/patrolView/conserve.svg'
import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg'
function Index () {
function Index() {
const userInfo = Taro.getStorageSync('userInfo') || {};
const router = useRouter()
const { params: { filter, kind, } } = router
@ -32,6 +32,8 @@ function Index () {
const [systemInfo, setSystemInfo] = useState('')
const [page, setPage] = useState(0)
const [num, setNum] = useState(Math.random())
const [typeSearchList, setTypeSearchList] = useState(['全部', '待处理', '不处理', '已处理'])
const [typeSearch, setTypeSearch] = useState('全部')
const limit = 10
@ -54,13 +56,13 @@ function Index () {
useEffect(() => {
setPage(0)
setNum(Math.random())
}, [reportType, datePicker])
}, [reportType, datePicker, typeSearch])
useEffect(() => {
getList(page == 0 ? true : false)
}, [num])
function dealError (error) {
function dealError(error) {
Taro.showToast({
title: error,
icon: 'none',
@ -70,6 +72,12 @@ function Index () {
}
const getList = (isInit) => {
Taro.showLoading({ title: '加载中' })
let handleState = ''
if (typeSearch != '全部') {
handleState = typeSearch
} else {
handleState = isWait ? '待处理' : ishandle ? '已处理' : ''
}
const data = {
limit,
page,
@ -78,7 +86,7 @@ function Index () {
keyword: filterText,
reportType: isWait || ishandle ? 'anomaly' : reportType,
userId: filter === 'my' && !ishandle ? userInfo.id : '',
handleState: isWait ? '待处理' : ishandle ? '已处理' : '',
handleState: handleState,
performerId: isWait || ishandle ? userInfo.id : ''
}
request.get(getReportList(), data).then(res => {
@ -143,7 +151,9 @@ function Index () {
const handleDetail = index => {
Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' || kind == 'handle' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}&handle=${kind == 'handle' ? 'handle' : ''}&videoShow=${kind == 'wait' || kind == 'handle' ? 'videoShow' : ''}` })
}
const setType = (e) => {
setTypeSearch(e.detail.value == 1 ? '待处理' : e.detail.value == 2 ? '不处理' : e.detail.value == 3 ? '已处理' : '全部')
}
return (
<View>
{/* {
@ -163,7 +173,7 @@ function Index () {
} */}
<View className='filter-box' style={{ top: isPatrol && false ? "40px" : '0' }}>
<View className='filter-item'>
<View className='filter-item' style={{ width: '270rpx' }}>
<View style={{ float: 'left', marginLeft: '20rpx', color: '#333' }}>日期</View>
<Picker
className='picker'
@ -177,6 +187,15 @@ function Index () {
<Image className='filter-img' src={chevronDown} />
</Picker>
</View>
{
kind == 'anomaly' ? <View style={{ display: 'flex', lineHeight: '98rpx', marginRight: '20rpx' }}>
<View style={{ color: '#333' }}>状态</View>
<Picker range={typeSearchList} onChange={setType}>
<View style={{ float: 'left' }}>{typeSearch}</View>
<Image style={{ display: 'block', width: '14rpx', height: '8rpx', float: 'left', marginTop: '44rpx', marginLeft: '10rpx' }} src={chevronDown} />
</Picker>
</View> : ''
}
<View class='head-search'>
<Image className='search-img' src={searchIcon} />
<Input class='heard-search-input' value={filterText} placeholder={

8
weapp/src/packages/patrolView/index.scss

@ -63,7 +63,7 @@ page {
}
.head-search {
width: 400rpx;
width: 300rpx;
display: flex;
background: #fff;
padding: 10rpx 26rpx 15rpx;
@ -73,16 +73,16 @@ page {
border: 2rpx solid #00000011;
height: 68rpx;
line-height: 68rpx;
margin: 14rpx 30rpx 14rpx 0;
margin: 14rpx 14rpx 14rpx 0;
.search-img {
width: 36rpx;
width: 44rpx;
height: 36rpx;
margin-top: 5rpx;
}
.heard-search-input {
margin-left: 26rpx;
margin-left: 10rpx;
font-size: 28rpx;
width: 100%;
color: #333;

6
web/client/src/sections/fillion/components/patrolTable.js

@ -254,16 +254,16 @@ const DetailList = (props) => {
<Button
onClick={() => { checkDetail(record); handleOpen(); }}
style={{ marginRight: 10 }}>查看</Button>,
isAnomaly && record.handleState != '处理' && record.performerId === null && user?.username === 'SuperAdmin' ?
isAnomaly && record.handleState != '处理' && record.performerId === null && user?.username === 'SuperAdmin' ?
<Button disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'FEEDBACKMANAGE' || 'FEEDBACKMANAGE')[0].isshow === "true" ? true : ''}
onClick={() => { setVis(true); setRecordId(record.id) }}>指派</Button> : null,
isAnomaly && record.handleState != '处理' && record.performerId === null && user?.username === 'SuperAdmin' ?
isAnomaly && record.handleState != '处理' && record.performerId === null && user?.username === 'SuperAdmin' ?
< Popover
content={
[
<div style={{ width: '100%', height: 30 }}>
<Button onClick={() => setNoProcessingPopVisible(false)} style={{ float: "right" }} ></Button>
<Button type="primary" onClick={() => dispatch(handleReport(record.id, { handleState: '处理' })).then(res => {
<Button type="primary" onClick={() => dispatch(handleReport(record.id, { handleState: '处理' })).then(res => {
if (res.success) {
setNoProcessingPopVisible(false)
setNoProcessingSelectRecord(null)

Loading…
Cancel
Save