Browse Source

(*)已办事项

dev
ww664853070 2 years ago
parent
commit
a8ce30ce74
  1. 49
      weapp/src/packages/patrol/index.jsx
  2. 9
      weapp/src/packages/patrolView/index.jsx
  3. 6
      weapp/src/pages/home/index.jsx
  4. 4
      weapp/src/pages/user/index.jsx

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

@ -19,9 +19,8 @@ const Index = () => {
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
const router = useRouter() const router = useRouter()
const { params: { type, kind, wait } } = router const { params: { type, kind, wait, handle } } = router
const isView = type === 'view' ? true : false const isView = type === 'view' ? true : false
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false
const isRoad = kind === 'road' ? true : false const isRoad = kind === 'road' ? true : false
const isAnomaly = kind === 'anomaly' ? true : false const isAnomaly = kind === 'anomaly' ? true : false
@ -57,6 +56,7 @@ const Index = () => {
const [handleCenter, setHandleCenter] = useState('') const [handleCenter, setHandleCenter] = useState('')
const [handlePic, setHandlePic] = useState([]) const [handlePic, setHandlePic] = useState([])
const [handlePicPn, setHandlePicPn] = useState([]) const [handlePicPn, setHandlePicPn] = useState([])
const [handleId, setHandleId] = useState([])
const prjType = const prjType =
isAnomaly ? isAnomaly ?
@ -101,11 +101,10 @@ const Index = () => {
checked: false checked: false
} }
]) ])
useEffect(() => { useEffect(() => {
if (isRoad) { if (isRoad) {
Taro.setNavigationBarTitle({ title: '在建项目' }) Taro.setNavigationBarTitle({ title: '在建项目' })
} else if (wait == 'wait') { } else if (wait == 'wait' || handle == 'handle') {
Taro.setNavigationBarTitle({ title: '待办事项' }) Taro.setNavigationBarTitle({ title: '待办事项' })
} else if (isAnomaly) { } else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' }) Taro.setNavigationBarTitle({ title: '异常反馈' })
@ -141,6 +140,13 @@ const Index = () => {
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.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 })) : []) setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : []) setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : [])
setHandleId(data.id)
if (data.handleContent) {
setHandleCenter(data.handleContent)
}
if (data.handlePic.length) {
setHandlePic(data.handlePic)
}
} else { } else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
} }
@ -483,6 +489,11 @@ const Index = () => {
urls: [file.url] // http urls: [file.url] // http
}) })
} }
function handleImgClicks(index, file) {
Taro.previewImage({
urls: [file] // http
})
}
useEffect(() => { useEffect(() => {
if (!isView) { if (!isView) {
let newRoadList = roadList.filter(e => e.routeName.match(road)) let newRoadList = roadList.filter(e => e.routeName.match(road))
@ -512,15 +523,15 @@ const Index = () => {
return return
} }
let handlePicList = [] let handlePicList = []
if(handlePic.length){ if (handlePic.length) {
handlePic.forEach(e=>{ handlePic.forEach(e => {
handlePicList.push(e.url) handlePicList.push(e.url)
}) })
} }
let data = { let data = {
handleContent: str, handleContent: str,
handlePic: handlePicList, handlePic: handlePicList,
handleState:'已处理' handleState: '已处理'
} }
Taro.showModal({ Taro.showModal({
title: '提示', title: '提示',
@ -534,7 +545,7 @@ const Index = () => {
Taro.showLoading({ Taro.showLoading({
title: '提交中' title: '提交中'
}) })
request.post(postHandle(userInfo.id), data).then(res => { request.post(postHandle(handleId), data).then(res => {
Taro.hideLoading() Taro.hideLoading()
if (res.statusCode == 200 || res.statusCode == 204) { if (res.statusCode == 200 || res.statusCode == 204) {
Taro.showToast({ title: '提交成功', icon: 'none', duration: 1500 }) Taro.showToast({ title: '提交成功', icon: 'none', duration: 1500 })
@ -545,8 +556,7 @@ const Index = () => {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
} }
}, err => { }, err => {
console.log(err); Taro.showToast({ title: err.message || '请求出错', icon: 'none' })
Taro.showToast({ title: err.message || '请求出错123', icon: 'none' })
}) })
} }
} }
@ -856,26 +866,25 @@ const Index = () => {
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton> <AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton>
} }
{ {
wait == 'wait' ? <view> wait == 'wait' || handle == 'handle' ? <view>
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容</view> <view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容</view>
<AtTextarea <AtTextarea
title='处理内容:' title='处理内容:'
// placeholder={isView ? '' : ''}
placeholder='请输入处理内容' placeholder='请输入处理内容'
value={handleCenter} value={handleCenter}
onChange={(v, e) => handleInput(e, 'wait')} onChange={(v, e) => handleInput(e, 'wait')}
// disabled={isView} disabled={handle == 'handle' ? true : false}
maxLength={50} maxLength={50}
/> />
<View className='patrol-img'> <View className='patrol-img'>
处理图片 处理图片
{ {
// isView ? handle == 'handle' ?
// <View className='img-box'> <View className='img-box'>
// {scenePic.map(item => ( {handlePic.map(item => (
// <Image className='img' src={item.url} onClick={() => handleImgClick(undefined, item)} /> <Image className='img' src={item} onClick={() => handleImgClicks(undefined, item)} />
// ))} ))}
// </View> : </View> :
<AtImagePicker <AtImagePicker
className='img-picker' className='img-picker'
count={3 - handlePic.length} count={3 - handlePic.length}
@ -885,7 +894,7 @@ const Index = () => {
onImageClick={handleImgClick} onImageClick={handleImgClick}
/> />
} }
<AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton> {handle != 'handle' ? <AtButton type='primary' className='sub-btn' onClick={handleOk}>提交</AtButton> : ''}
</View> </View>
</view> : '' </view> : ''
} }

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

@ -17,12 +17,13 @@ import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg'
function Index() { function Index() {
const userInfo = Taro.getStorageSync('userInfo') || {}; const userInfo = Taro.getStorageSync('userInfo') || {};
const router = useRouter() const router = useRouter()
const { params: { filter, kind } } = router const { params: { filter, kind, } } = router
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false
const isRoad = kind === 'road' ? true : false const isRoad = kind === 'road' ? true : false
const isAnomaly = kind === 'anomaly' ? true : false const isAnomaly = kind === 'anomaly' ? true : false
const isWait = kind === 'wait' ? true : false const isWait = kind === 'wait' ? true : false
const ishandle = kind == 'handle' ? true : false
const [reportType, setReportType] = useState(kind || 'patrol') const [reportType, setReportType] = useState(kind || 'patrol')
const [datePicker, setDatePicker] = useState('') const [datePicker, setDatePicker] = useState('')
@ -73,9 +74,9 @@ function Index() {
startTime: datePicker ? datePicker + ' 00:00:00' : '', startTime: datePicker ? datePicker + ' 00:00:00' : '',
endTime: datePicker ? datePicker + ' 23:59:59' : '', endTime: datePicker ? datePicker + ' 23:59:59' : '',
keyword: filterText, keyword: filterText,
reportType: isWait ? 'anomaly' : reportType, reportType: isWait || ishandle ? 'anomaly' : reportType,
userId: filter === 'my' ? userInfo.id : '', userId: filter === 'my' ? userInfo.id : '',
handleState: isWait ? '待处理' : '', handleState: isWait ? '待处理' : ishandle ? '已处理' : '',
} }
request.get(getReportList(), data).then(res => { request.get(getReportList(), data).then(res => {
Taro.hideLoading() Taro.hideLoading()
@ -137,7 +138,7 @@ function Index() {
} }
const handleDetail = index => { const handleDetail = index => {
Taro.navigateTo({ url: `/packages/patrol/index?type=view&id=${listData[index].id}&kind=${kind == 'wait' ? 'anomaly' : kind}&wait=${kind == 'wait' ? 'wait' : ''}` }) 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' : ''}` })
} }
return ( return (

6
weapp/src/pages/home/index.jsx

@ -103,15 +103,13 @@ const Index = () => {
</View> : '' </View> : ''
} }
{ {
isSuperAdmin || isAdmin ? judgeRight('WXTODOLIST') ?
<View className='card fill_wait'> <View className='card fill_wait'>
<View className='title'> </View> <View className='title'> </View>
<View className='btn' onClick={ <View className='btn' onClick={
isSuperAdmin || isAdmin ?
() => toPatrolView('wait') () => toPatrolView('wait')
: () => toPatrol('wait')
}> }>
{isSuperAdmin || isAdmin ? '查看' : '填报'} 查看
</View> </View>
</View> : '' </View> : ''
} }

4
weapp/src/pages/user/index.jsx

@ -112,11 +112,11 @@ const Index = ({ ...props }) => {
: '' : ''
} }
{ {
judgeRight('WXFEEDBACKMANAGE') ? judgeRight('WXDONELIST') ?
<View className='box' onClick={() => toMyReport('handle')}> <View className='box' onClick={() => toMyReport('handle')}>
<Image className='box-img' src={reportImg} /> <Image className='box-img' src={reportImg} />
<View className='box-txt'> <View className='box-txt'>
{isSuperAdmin || isAdmin ? '已办事项' : '已办事项'} 已办事项
</View> </View>
<Image className='img' src={moreImg} /> <Image className='img' src={moreImg} />
</View> </View>

Loading…
Cancel
Save