diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx
index 859da3ab..afefeb99 100644
--- a/weapp/src/packages/patrol/index.jsx
+++ b/weapp/src/packages/patrol/index.jsx
@@ -19,9 +19,8 @@ const Index = () => {
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
const router = useRouter()
- const { params: { type, kind, wait } } = router
+ const { params: { type, kind, wait, handle } } = router
const isView = type === 'view' ? true : false
-
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false
const isRoad = kind === 'road' ? true : false
const isAnomaly = kind === 'anomaly' ? true : false
@@ -57,6 +56,7 @@ const Index = () => {
const [handleCenter, setHandleCenter] = useState('')
const [handlePic, setHandlePic] = useState([])
const [handlePicPn, setHandlePicPn] = useState([])
+ const [handleId, setHandleId] = useState([])
const prjType =
isAnomaly ?
@@ -101,11 +101,10 @@ const Index = () => {
checked: false
}
])
-
useEffect(() => {
if (isRoad) {
Taro.setNavigationBarTitle({ title: '在建项目' })
- } else if (wait == 'wait') {
+ } else if (wait == 'wait' || handle == 'handle') {
Taro.setNavigationBarTitle({ title: '待办事项' })
} else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' })
@@ -141,6 +140,13 @@ const Index = () => {
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)
+ if (data.handleContent) {
+ setHandleCenter(data.handleContent)
+ }
+ if (data.handlePic.length) {
+ setHandlePic(data.handlePic)
+ }
} else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
@@ -483,6 +489,11 @@ const Index = () => {
urls: [file.url] // 需要预览的图片http链接列表
})
}
+ function handleImgClicks(index, file) {
+ Taro.previewImage({
+ urls: [file] // 需要预览的图片http链接列表
+ })
+ }
useEffect(() => {
if (!isView) {
let newRoadList = roadList.filter(e => e.routeName.match(road))
@@ -512,15 +523,15 @@ const Index = () => {
return
}
let handlePicList = []
- if(handlePic.length){
- handlePic.forEach(e=>{
+ if (handlePic.length) {
+ handlePic.forEach(e => {
handlePicList.push(e.url)
})
}
let data = {
handleContent: str,
handlePic: handlePicList,
- handleState:'已处理'
+ handleState: '已处理'
}
Taro.showModal({
title: '提示',
@@ -534,7 +545,7 @@ const Index = () => {
Taro.showLoading({
title: '提交中'
})
- request.post(postHandle(userInfo.id), data).then(res => {
+ request.post(postHandle(handleId), data).then(res => {
Taro.hideLoading()
if (res.statusCode == 200 || res.statusCode == 204) {
Taro.showToast({ title: '提交成功', icon: 'none', duration: 1500 })
@@ -545,8 +556,7 @@ const Index = () => {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
}, err => {
- console.log(err);
- Taro.showToast({ title: err.message || '请求出错123', icon: 'none' })
+ Taro.showToast({ title: err.message || '请求出错', icon: 'none' })
})
}
}
@@ -856,36 +866,35 @@ const Index = () => {
上报
}
{
- wait == 'wait' ?
+ wait == 'wait' || handle == 'handle' ?
*处理内容:
handleInput(e, 'wait')}
- // disabled={isView}
+ disabled={handle == 'handle' ? true : false}
maxLength={50}
/>
处理图片:
{
- // isView ?
- //
- // {scenePic.map(item => (
- // handleImgClick(undefined, item)} />
- // ))}
- // :
- = 3 ? false : true}
- files={handlePic}
- onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')}
- onImageClick={handleImgClick}
- />
+ handle == 'handle' ?
+
+ {handlePic.map(item => (
+ handleImgClicks(undefined, item)} />
+ ))}
+ :
+ = 3 ? false : true}
+ files={handlePic}
+ onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'wait')}
+ onImageClick={handleImgClick}
+ />
}
- 提交
+ {handle != 'handle' ? 提交 : ''}
: ''
}
diff --git a/weapp/src/packages/patrolView/index.jsx b/weapp/src/packages/patrolView/index.jsx
index 46efa25a..86cb0b8f 100644
--- a/weapp/src/packages/patrolView/index.jsx
+++ b/weapp/src/packages/patrolView/index.jsx
@@ -17,12 +17,13 @@ import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg'
function Index() {
const userInfo = Taro.getStorageSync('userInfo') || {};
const router = useRouter()
- const { params: { filter, kind } } = router
+ const { params: { filter, kind, } } = router
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false
const isRoad = kind === 'road' ? true : false
const isAnomaly = kind === 'anomaly' ? true : false
const isWait = kind === 'wait' ? true : false
+ const ishandle = kind == 'handle' ? true : false
const [reportType, setReportType] = useState(kind || 'patrol')
const [datePicker, setDatePicker] = useState('')
@@ -73,9 +74,9 @@ function Index() {
startTime: datePicker ? datePicker + ' 00:00:00' : '',
endTime: datePicker ? datePicker + ' 23:59:59' : '',
keyword: filterText,
- reportType: isWait ? 'anomaly' : reportType,
+ reportType: isWait || ishandle ? 'anomaly' : reportType,
userId: filter === 'my' ? userInfo.id : '',
- handleState: isWait ? '待处理' : '',
+ handleState: isWait ? '待处理' : ishandle ? '已处理' : '',
}
request.get(getReportList(), data).then(res => {
Taro.hideLoading()
@@ -137,7 +138,7 @@ function 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 (
diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx
index 48d397d5..6d62fd8a 100644
--- a/weapp/src/pages/home/index.jsx
+++ b/weapp/src/pages/home/index.jsx
@@ -103,15 +103,13 @@ const Index = () => {
: ''
}
{
- isSuperAdmin || isAdmin ?
+ judgeRight('WXTODOLIST') ?
待 办 事 项
toPatrolView('wait')
- : () => toPatrol('wait')
}>
- {isSuperAdmin || isAdmin ? '查看' : '填报'}
+ 查看
: ''
}
diff --git a/weapp/src/pages/user/index.jsx b/weapp/src/pages/user/index.jsx
index 6df2873c..f3e80b0d 100644
--- a/weapp/src/pages/user/index.jsx
+++ b/weapp/src/pages/user/index.jsx
@@ -112,11 +112,11 @@ const Index = ({ ...props }) => {
: ''
}
{
- judgeRight('WXFEEDBACKMANAGE') ?
+ judgeRight('WXDONELIST') ?
toMyReport('handle')}>
- {isSuperAdmin || isAdmin ? '已办事项' : '已办事项'}
+ 已办事项