diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index 5451b8e6..e677d2a3 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -154,7 +154,6 @@ const Index = () => { + res.data.result.address_component.district + res.data.result.address_component.street_number // addresscity = res.data.result.formatted_addresses.standard_address - console.log(res, 'res') let street = res.data.result.address_component.street setRoad(street) setAddress(addresscity) @@ -190,7 +189,6 @@ const Index = () => { setRoadStartSel(sourceRoadStartSel) setRoadEndSel(sourceRoadEndSel) }, [sourceRoadStartSel, sourceRoadEndSel]) - useEffect(() => { setTypeList([ { @@ -217,7 +215,7 @@ const Index = () => { } if (isPatrol && prjTypeSelector.indexOf(projectType) === -1) { - Taro.showToast({ title: '工程类型错误', icon: 'none' }) + Taro.showToast({ title: isAnomaly ? '反馈类型错误' : '工程类型错误', icon: 'none' }) return } if (content.length > 50) { @@ -228,7 +226,8 @@ const Index = () => { Taro.showToast({ title: '请完善项目名称', icon: 'none' }) return } - const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)]?.value || '' + const reportProjectType = prjType.find(p => p.text == projectType)?.value || '' + let data = { reportType: isPatrol ? reportType : kind, @@ -243,14 +242,13 @@ const Index = () => { projectName, handleState: isAnomaly ? '待处理' : undefined, } - if (reportType === 'patrol') { + if (reportType === 'patrol' || isAnomaly || isRoad) { data['scenePic'] = sceneImg } else { data['conserveBeforePic'] = conserveBeforeImg data['conserveUnderwayPic'] = conserveUnderwayImg data['conserveAfterPic'] = conserveAfterImg } - Taro.showModal({ title: '提示', content: '您要进行信息上报么?', @@ -625,7 +623,6 @@ const Index = () => { sourceType: ['album', 'camera'], mediaType: ['image', 'video'], camera: 'back', success: function (res) { - console.log(res.tempFilePath) Taro.showLoading({ title: '上传中' }) const tempFilePaths = res.tempFilePath let token = getState('token') || Taro.getStorageSync('token') @@ -634,7 +631,6 @@ const Index = () => { filePath: tempFilePaths, name: 'file', success: (res) => { - console.log(res); Taro.hideLoading(); if (res.statusCode == 200) { // setImg(true, JSON.parse(res.data).key) diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index 1d9a79ab..f6b5c20f 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -11,6 +11,25 @@ import PatrolGis from './gis/patrolGis'; import styles from './protable.less'; import moment from 'moment'; +const reportTypeText = (text) => { + switch (text) { + case 'road': return '道路'; + // + case 'countyRoad': return '县道'; + case 'villageRoad': return '乡道'; + case 'rusticRoad': return '村道'; + // + case 'bridge': return '桥梁'; + case 'culvert': return '涵洞'; + case 'other': return '其他'; + // + case 'conserve': return '养护'; + case 'patrol': return '巡查'; + case 'construction': return '在建'; + default: return text; + } +} + const DetailForm = (props) => { const { visible, data, handleClose, loading, isAnomaly, isRoad, isPatrol } = props; @@ -38,8 +57,21 @@ const DetailForm = (props) => {
{obj.key} { + + obj.name != 'scenePic' ? - + :
{ @@ -510,7 +542,7 @@ const PatrolTable = (props) => { ); }; -function mapStateToProps(state) { +function mapStateToProps (state) { const { auth, depMessage, userList, reportList, reportDetail } = state; const pakData = (dep) => { return dep.map((d) => {