Browse Source

小程序1.1.2功能

dev
liujiangyong 2 years ago
parent
commit
6f84f85bc4
  1. 2
      weapp/src/packages/components/inputPicker/index.jsx
  2. 28
      weapp/src/packages/patrol/index.jsx

2
weapp/src/packages/components/inputPicker/index.jsx

@ -12,7 +12,7 @@ export default function InputPicker(props) {
useEffect(() => { useEffect(() => {
setCurSelector(selector) setCurSelector(selector)
}, []) }, [selector])
useEffect(() => { useEffect(() => {
handleInput({ detail: { value: value } }) handleInput({ detail: { value: value } })

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

@ -419,7 +419,7 @@ const Index = () => {
}) })
request.get(getUsers()).then(res => { request.get(getUsers()).then(res => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
const users = res.data.filter(u => u.phone !== 'SuperAdmin' && u.isAdmin) const users = res.data.filter(u => u.phone !== 'SuperAdmin')
setUserList(users) setUserList(users)
} }
}) })
@ -451,7 +451,9 @@ const Index = () => {
|| Object.values(patrolContent).some(c => c.label !== '巡查结果无异常' && 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)
|| !conserveBeforeImg.length || !conserveUnderwayImg.length || !conserveAfterImg.length))
|| ((kind === 'patrol' || kind === 'road' || kind === 'anomaly') && !sceneImg.length)
) { ) {
Taro.showToast({ title: '请完善必填信息', icon: 'none' }) Taro.showToast({ title: '请完善必填信息', icon: 'none' })
return return
@ -861,6 +863,10 @@ const Index = () => {
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' }) Taro.showToast({ title: '内容字数不能超过50', icon: 'none' })
return return
} }
if (!handlePicPn.length) {
Taro.showToast({ title: '请上传处理图片', icon: 'none' })
return
}
} else { } else {
if (isAppoint && appointUser === null) { if (isAppoint && appointUser === null) {
Taro.showToast({ title: '请选择责任人', icon: 'none' }) Taro.showToast({ title: '请选择责任人', icon: 'none' })
@ -1087,14 +1093,14 @@ const Index = () => {
} */} } */}
{ {
isRoad ? isRoad ?
<InputPickers <InputPicker
key={789} // keyselector
title='项目名称:' title='项目名称:'
value={projectName} value={projectName}
placeholder='请选择或输入项目名称' placeholder='请选择项目'
onInput={setProjectName} onInput={setProjectName}
selector={projectList} selector={projectList}
isView={isView} isView={isView}
onlySelect={true}
/> : '' /> : ''
} }
@ -1290,7 +1296,7 @@ const Index = () => {
{ {
reportType === 'patrol' || isRoad || isAnomaly ? reportType === 'patrol' || isRoad || isAnomaly ?
<View className='patrol-img'> <View className='patrol-img'>
现场图片 <View><Text style={{ color: 'red' }}>*&nbsp;</Text>现场图片</View>
{ {
isView ? isView ?
<View className='img-box'> <View className='img-box'>
@ -1347,10 +1353,10 @@ const Index = () => {
</AtButton> */} </AtButton> */}
</View> : </View> :
<View className='conserve-img'> <View className='conserve-img'>
养护图片: <View><Text style={{ color: 'red' }}>*&nbsp;</Text>养护图片:</View>
<View className='horizontal-line hl-one'> <View className='horizontal-line hl-one'>
<View className='circle c-one'></View> <View className='circle c-one'></View>
<View className='text t-one'>养护前</View> <View className='text t-one'><Text style={{ color: 'red' }}>*&nbsp;</Text>养护前</View>
</View> </View>
{ {
isView ? isView ?
@ -1371,7 +1377,7 @@ const Index = () => {
<View className='horizontal-line hl-two'> <View className='horizontal-line hl-two'>
<View className='circle c-two'></View> <View className='circle c-two'></View>
<View className='text t-two'>养护中</View> <View className='text t-two'><Text style={{ color: 'red' }}>*&nbsp;</Text>养护中</View>
</View> </View>
{ {
isView ? isView ?
@ -1392,7 +1398,7 @@ const Index = () => {
<View className='horizontal-line hl-three'> <View className='horizontal-line hl-three'>
<View className='circle c-three'></View> <View className='circle c-three'></View>
<View className='text t-three'>养护后</View> <View className='text t-three'><Text style={{ color: 'red' }}>*&nbsp;</Text>养护后</View>
</View> </View>
{ {
isView ? isView ?
@ -1518,7 +1524,7 @@ const Index = () => {
maxLength={50} maxLength={50}
/> />
<View className='patrol-img'> <View className='patrol-img'>
处理图片 <View><Text style={{ color: 'red' }}>*&nbsp;</Text>处理图片</View>
{ {
handle == 'handle' || handleState == '已处理' ? handle == 'handle' || handleState == '已处理' ?
<View className='img-box'> <View className='img-box'>

Loading…
Cancel
Save