diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index cfce0c02..eb9d6e83 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -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 = () => { 线路编码: { setRoadCodeHead(e.detail.value[0]); - setProjectType(e.detail.value[0] === 'X' ? '县道' : e.detail.value[0] === 'Y' ? '乡道' : '村道'); }}> X Y C { { }} 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 !== '巡查结果无异常' &&