|
@@ -8,9 +8,19 @@
|
|
|
-->
|
|
-->
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
- <van-form ref="formRef" @submit="onSubmit" class="mt10" required="auto">
|
|
|
|
|
|
|
+ <van-form
|
|
|
|
|
+ ref="formRef"
|
|
|
|
|
+ @submit="onSubmit"
|
|
|
|
|
+ class="mt10"
|
|
|
|
|
+ required="auto"
|
|
|
|
|
+ >
|
|
|
<h4 class="mb8 mt8">巡检信息</h4>
|
|
<h4 class="mb8 mt8">巡检信息</h4>
|
|
|
- <van-field v-model="state.form.taskTitle" label="任务名称" placeholder="任务名称" :rules="[{ required: true, message: '请输入任务名称' }]" />
|
|
|
|
|
|
|
+ <van-field
|
|
|
|
|
+ v-model="state.form.taskTitle"
|
|
|
|
|
+ label="任务名称"
|
|
|
|
|
+ placeholder="任务名称"
|
|
|
|
|
+ :rules="[{ required: true, message: '请输入任务名称' }]"
|
|
|
|
|
+ />
|
|
|
<van-cell-group>
|
|
<van-cell-group>
|
|
|
<van-field
|
|
<van-field
|
|
|
v-model="state.form.labName"
|
|
v-model="state.form.labName"
|
|
@@ -47,30 +57,77 @@
|
|
|
placeholder="隐患说明"
|
|
placeholder="隐患说明"
|
|
|
:rules="[{ required: true, message: '请输入隐患说明' }]"
|
|
:rules="[{ required: true, message: '请输入隐患说明' }]"
|
|
|
/>
|
|
/>
|
|
|
- <van-field name="uploader" label="隐患照片" :rules="[{ required: true, message: '请上传隐患照片' }]">
|
|
|
|
|
|
|
+ <van-field
|
|
|
|
|
+ name="uploader"
|
|
|
|
|
+ label="隐患照片"
|
|
|
|
|
+ :rules="[{ required: true, message: '请上传隐患照片' }]"
|
|
|
|
|
+ >
|
|
|
<template #input>
|
|
<template #input>
|
|
|
- <van-uploader v-model="state.form.photos" :after-read="afterRead" preview-size="60" :preview-full-image="true" :max-count="6" />
|
|
|
|
|
|
|
+ <van-uploader
|
|
|
|
|
+ v-model="state.form.photos"
|
|
|
|
|
+ :after-read="afterRead"
|
|
|
|
|
+ preview-size="60"
|
|
|
|
|
+ :preview-full-image="true"
|
|
|
|
|
+ :max-count="6"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</van-field>
|
|
</van-field>
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
|
<van-action-bar placeholder>
|
|
<van-action-bar placeholder>
|
|
|
- <van-action-bar-icon icon="wap-home-o" text="首页" @click="router.push('/home')" />
|
|
|
|
|
- <van-action-bar-icon icon="revoke" text="返回" @click="router.push('/lab/inspection/home')" />
|
|
|
|
|
- <van-action-bar-button type="primary" text="立即提交" :loading="loading" native-type="submit" />
|
|
|
|
|
|
|
+ <van-action-bar-icon
|
|
|
|
|
+ icon="wap-home-o"
|
|
|
|
|
+ text="首页"
|
|
|
|
|
+ @click="router.push('/home')"
|
|
|
|
|
+ />
|
|
|
|
|
+ <van-action-bar-icon
|
|
|
|
|
+ icon="revoke"
|
|
|
|
|
+ text="返回"
|
|
|
|
|
+ @click="router.push('/lab/inspection/home')"
|
|
|
|
|
+ />
|
|
|
|
|
+ <van-action-bar-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ text="立即提交"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ native-type="submit"
|
|
|
|
|
+ />
|
|
|
</van-action-bar>
|
|
</van-action-bar>
|
|
|
</van-form>
|
|
</van-form>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 实验室 -->
|
|
<!-- 实验室 -->
|
|
|
- <van-popup v-model:show="state.shwoLab" position="bottom">
|
|
|
|
|
- <van-picker :columns="labList" :columns-field-names="{ text: 'labName', value: 'id' }" @confirm="pickLab" @cancel="state.shwoLab = false" />
|
|
|
|
|
|
|
+ <van-popup
|
|
|
|
|
+ v-model:show="state.shwoLab"
|
|
|
|
|
+ position="bottom"
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-picker
|
|
|
|
|
+ :columns="labList"
|
|
|
|
|
+ :columns-field-names="{ text: 'labName', value: 'id' }"
|
|
|
|
|
+ @confirm="pickLab"
|
|
|
|
|
+ @cancel="state.shwoLab = false"
|
|
|
|
|
+ />
|
|
|
</van-popup>
|
|
</van-popup>
|
|
|
<!-- 负责人 -->
|
|
<!-- 负责人 -->
|
|
|
- <van-popup v-model:show="state.shwoUser" position="bottom">
|
|
|
|
|
- <van-picker :columns="userList" :columns-field-names="{ text: 'name', value: 'id' }" @confirm="pickUser" @cancel="state.shwoUser = false" />
|
|
|
|
|
|
|
+ <van-popup
|
|
|
|
|
+ v-model:show="state.shwoUser"
|
|
|
|
|
+ position="bottom"
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-picker
|
|
|
|
|
+ :columns="userList"
|
|
|
|
|
+ :columns-field-names="{ text: 'name', value: 'id' }"
|
|
|
|
|
+ @confirm="pickUser"
|
|
|
|
|
+ @cancel="state.shwoUser = false"
|
|
|
|
|
+ />
|
|
|
</van-popup>
|
|
</van-popup>
|
|
|
<!-- 所在时间 -->
|
|
<!-- 所在时间 -->
|
|
|
- <van-popup v-model:show="showAddDatePicker" position="bottom">
|
|
|
|
|
- <van-calendar v-model:show="showAddDatePicker" @confirm="onConfirmDate" @cancel="showAddDatePicker = false" type="range" />
|
|
|
|
|
|
|
+ <van-popup
|
|
|
|
|
+ v-model:show="showAddDatePicker"
|
|
|
|
|
+ position="bottom"
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-calendar
|
|
|
|
|
+ v-model:show="showAddDatePicker"
|
|
|
|
|
+ @confirm="onConfirmDate"
|
|
|
|
|
+ @cancel="showAddDatePicker = false"
|
|
|
|
|
+ type="range"
|
|
|
|
|
+ />
|
|
|
</van-popup>
|
|
</van-popup>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -111,10 +168,10 @@
|
|
|
frcnEndDate: '',
|
|
frcnEndDate: '',
|
|
|
labName: '',
|
|
labName: '',
|
|
|
troubleDesc: '',
|
|
troubleDesc: '',
|
|
|
- frcnPmName: ''
|
|
|
|
|
|
|
+ frcnPmName: '',
|
|
|
},
|
|
},
|
|
|
shwoLab: false,
|
|
shwoLab: false,
|
|
|
- shwoUser: false
|
|
|
|
|
|
|
+ shwoUser: false,
|
|
|
})
|
|
})
|
|
|
const loading = ref(false) // 加载状态
|
|
const loading = ref(false) // 加载状态
|
|
|
|
|
|
|
@@ -129,7 +186,7 @@
|
|
|
frcnEndDate: '',
|
|
frcnEndDate: '',
|
|
|
labName: '',
|
|
labName: '',
|
|
|
troubleDesc: '',
|
|
troubleDesc: '',
|
|
|
- frcnPmName: ''
|
|
|
|
|
|
|
+ frcnPmName: '',
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -154,20 +211,20 @@
|
|
|
const [errValid] = await to(formRef.value.validate())
|
|
const [errValid] = await to(formRef.value.validate())
|
|
|
if (errValid) return
|
|
if (errValid) return
|
|
|
let params = JSON.parse(JSON.stringify(state.form))
|
|
let params = JSON.parse(JSON.stringify(state.form))
|
|
|
- console.log(params)
|
|
|
|
|
- const files = params.photos.map((item: any) => {
|
|
|
|
|
|
|
+ params.photos = params.photos.map((item: any) => {
|
|
|
return {
|
|
return {
|
|
|
name: item.name,
|
|
name: item.name,
|
|
|
- url: item.url
|
|
|
|
|
|
|
+ url: item.url,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ console.log(params)
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
const [err, res]: ToResponse = await to(rectificationApi.onCreate(params))
|
|
const [err, res]: ToResponse = await to(rectificationApi.onCreate(params))
|
|
|
loading.value = false
|
|
loading.value = false
|
|
|
if (err) return
|
|
if (err) return
|
|
|
showNotify({
|
|
showNotify({
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
- message: '巡检隐患信息已提交,请耐心等待处理'
|
|
|
|
|
|
|
+ message: '巡检隐患信息已提交,请耐心等待处理',
|
|
|
})
|
|
})
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
router.push('/lab/inspection/home')
|
|
router.push('/lab/inspection/home')
|