|
|
@ -326,7 +326,6 @@ const Index = () => { |
|
|
|
Taro.showToast({ title: err.message || '请求出错', icon: 'none' }) |
|
|
|
}) |
|
|
|
} else { // 填报 |
|
|
|
if (isPatrol) setProjectType('县道') |
|
|
|
Taro.showLoading({ title: '加载中' }) |
|
|
|
let key = 'ODQBZ-3FZAU-6VIVL-2XXNM-F7CP7-WVFCY' // 写自己申请的key |
|
|
|
Taro.getLocation({ |
|
|
@ -422,11 +421,11 @@ const Index = () => { |
|
|
|
function report() { |
|
|
|
if (!canReport) { return } |
|
|
|
if ( |
|
|
|
(isPatrol && (!projectType || !road || !roadCodeEnd)) |
|
|
|
(isPatrol && (!road || !roadCodeEnd)) |
|
|
|
|| (isAnomaly && !road) |
|
|
|
|| (kind === 'patrol' |
|
|
|
&& (Object.values(patrolContent).every(c => c.value === '') && !patrolContent.inspectionNoException.selected |
|
|
|
|| Object.values(patrolContent).some(c => c.selected && c.value === ''))) |
|
|
|
|| Object.values(patrolContent).some(c => c.label !== '巡查结果无异常' && c.selected && c.value === ''))) |
|
|
|
|| (kind === 'conserve' |
|
|
|
&& (Object.values(conserveInfo).every(c => c.value === '') |
|
|
|
|| (Object.values(conserveContent).every(c => c.value === '') && !otherDescription))) |
|
|
@ -473,7 +472,6 @@ const Index = () => { |
|
|
|
} |
|
|
|
if (isPatrol) { |
|
|
|
data.codeRoad = roadCodeHead + roadCodeEnd |
|
|
|
if (otherType) data.projectType = otherType |
|
|
|
if (kind === 'patrol') { |
|
|
|
Object.keys(patrolContent).forEach(key => { |
|
|
|
data[key] = patrolContent[key].value |
|
|
@ -938,14 +936,13 @@ const Index = () => { |
|
|
|
<Text style={{ color: 'red' }}>* </Text>线路编码: |
|
|
|
<RadioGroup onChange={(e) => { |
|
|
|
setRoadCodeHead(e.detail.value[0]); |
|
|
|
setProjectType(e.detail.value[0] === 'X' ? '县道' : e.detail.value[0] === 'Y' ? '乡道' : '村道'); |
|
|
|
}}> |
|
|
|
<Radio value='X' checked={roadCodeHead === 'X'} color='#0080EE' className='radio' disabled={isView}>X</Radio> |
|
|
|
<Radio value='Y' checked={roadCodeHead === 'Y'} color='#0080EE' className='radio' disabled={isView}>Y</Radio> |
|
|
|
<Radio value='C' checked={roadCodeHead === 'C'} color='#0080EE' className='radio' disabled={isView}>C</Radio> |
|
|
|
</RadioGroup> |
|
|
|
<Input |
|
|
|
className='input' |
|
|
|
style={{ width: 120 }} |
|
|
|
type='text' |
|
|
|
placeholder={isView ? '' : '输入后9位线路编码'} |
|
|
|
value={roadCodeEnd} |
|
|
@ -959,13 +956,7 @@ const Index = () => { |
|
|
|
<Input |
|
|
|
style={{ width: '30%' }} |
|
|
|
type='text' |
|
|
|
value={isView |
|
|
|
? projectType |
|
|
|
: roadCodeHead === 'X' |
|
|
|
? '县道' |
|
|
|
: roadCodeHead === 'Y' |
|
|
|
? '乡道' |
|
|
|
: '村道'} |
|
|
|
value={roadCodeHead === 'X' ? '县道' : roadCodeHead === 'Y' ? '乡道' : '村道'} |
|
|
|
onInput={() => { }} |
|
|
|
disabled={true} |
|
|
|
/> |
|
|
@ -976,8 +967,8 @@ const Index = () => { |
|
|
|
onlySelect |
|
|
|
title='' |
|
|
|
placeholder='' |
|
|
|
value={otherType} |
|
|
|
onInput={(value) => setOtherType(value === '无' ? '' : value)} |
|
|
|
value={projectType} |
|
|
|
onInput={(value) => setProjectType(value === '无' ? '' : value)} |
|
|
|
selector={prjTypeSelector} |
|
|
|
isView={isView} |
|
|
|
/> |
|
|
@ -1128,7 +1119,7 @@ const Index = () => { |
|
|
|
{patrolContent[key].label !== '巡查结果无异常' && <Textarea |
|
|
|
autoHeight |
|
|
|
className='input' |
|
|
|
placeholder={'具体内容'} |
|
|
|
placeholder={!isView ? '具体内容' : ''} |
|
|
|
value={patrolContent[key].value} |
|
|
|
onInput={e => handleInput(e, 'patrolContent', key)} |
|
|
|
disabled={isView} |
|
|
@ -1167,7 +1158,7 @@ const Index = () => { |
|
|
|
<Input |
|
|
|
className='input' |
|
|
|
type={key === 'roadType' ? 'text' : 'digit'} |
|
|
|
placeholder={patrolContentEdit ? '请输入' : ''} |
|
|
|
placeholder={patrolContentEdit && !isView ? '请输入' : ''} |
|
|
|
value={conserveInfo[key].value} |
|
|
|
onInput={e => handleInput(e, 'conserveInfo', key)} |
|
|
|
disabled={isView || !patrolContentEdit} |
|
|
@ -1189,7 +1180,7 @@ const Index = () => { |
|
|
|
<Input |
|
|
|
className='input' |
|
|
|
type='digit' |
|
|
|
placeholder={'请输入'} |
|
|
|
placeholder={!isView ? '请输入' : ''} |
|
|
|
value={conserveContent[key].value} |
|
|
|
onInput={e => handleInput(e, 'conserveContent', key)} |
|
|
|
disabled={isView} |
|
|
@ -1382,7 +1373,7 @@ const Index = () => { |
|
|
|
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton> |
|
|
|
} |
|
|
|
{ |
|
|
|
handleType == '已处理' || wait == 'wait' || handle == 'handle' ? <view> |
|
|
|
!isPatrol && (handleType == '已处理' || wait == 'wait' || handle == 'handle') ? <view> |
|
|
|
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容:</view> |
|
|
|
<AtTextarea |
|
|
|
title='处理内容:' |
|
|
|