Browse Source

养护上报增加其他养护内容

dev
liujiangyong 2 years ago
parent
commit
828e101103
  1. 19
      weapp/src/packages/patrol/index.jsx

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

@ -198,6 +198,7 @@ const Index = () => {
unit: '块',
},
})
const [otherDescription, setOtherDescription] = useState('') //
const [isBeforeReport, setIsBeforeReport] = useState(false) // V1.1.0
const prjType =
@ -312,6 +313,7 @@ const Index = () => {
if (data[key]) nextContent[key].value = data[key]
})
setConserveContent(nextContent)
setOtherDescription(data.otherDescription)
}
if (data.handleContent) {
setHandleCenter(data.handleContent)
@ -425,7 +427,7 @@ const Index = () => {
|| (kind === 'patrol' && Object.values(patrolContent).every(c => c.value.trim() === '') && !patrolContent.巡查结果无异常.selected)
|| (kind === 'conserve'
&& (Object.values(conserveInfo).every(c => c.value.trim() === '')
|| Object.values(conserveContent).every(c => c.value.trim() === '')))
|| (Object.values(conserveContent).every(c => c.value.trim() === '') && !otherDescription)))
) {
Taro.showToast({ title: '请完善必填信息', icon: 'none' })
return
@ -482,6 +484,7 @@ const Index = () => {
Object.keys(conserveContent).forEach(key => {
data[key] = Number(conserveContent[key].value)
})
data.otherDescription = otherDescription
}
}
@ -627,6 +630,9 @@ const Index = () => {
nextContent[key].value = value
setConserveContent(nextContent)
break;
case "otherDescription":
setOtherDescription(value)
break;
case "contentCheck":
let nextCheck = { ...patrolContent }
Object.keys(patrolContent).forEach(key => {
@ -1164,6 +1170,17 @@ const Index = () => {
<Text>{conserveContent[key].unit}</Text>
</View>)
}
<View className='item'>
<Text>其他</Text>
<Input
style={{ width: '80%' }}
type='text'
placeholder={'其他养护内容'}
value={otherDescription}
onInput={e => handleInput(e, 'otherDescription')}
disabled={isView}
/>
</View>
</View>
</View>
</View>

Loading…
Cancel
Save