Browse Source

故障修复

dev
liujiangyong 1 year ago
parent
commit
7d890c1881
  1. 29
      weapp/src/packages/patrol/index.jsx
  2. 4
      weapp/src/packages/patrol/index.scss

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

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

4
weapp/src/packages/patrol/index.scss

@ -180,10 +180,6 @@ page {
.radio { .radio {
margin-right: 10px; margin-right: 10px;
} }
.input {
width: 240px;
}
} }
.patrol-content { .patrol-content {

Loading…
Cancel
Save