文件上传限制,巡检详情日期参数
This commit is contained in:
@@ -99,6 +99,7 @@ import { getInspectionMain } from '@/api/insepction.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
const taskid = ref('')
|
||||
let date = ''
|
||||
const info = ref({
|
||||
planName: '',
|
||||
remindTime: '',
|
||||
@@ -114,7 +115,7 @@ const baseFormData = ref([])
|
||||
|
||||
function init() {
|
||||
if (!taskid.value) return
|
||||
getInspectionMain(taskid.value)
|
||||
getInspectionMain(taskid.value, date)
|
||||
.then(res => {
|
||||
info.value = res.data
|
||||
if (!res.data.routes) return
|
||||
@@ -154,6 +155,8 @@ function init() {
|
||||
|
||||
onLoad(options => {
|
||||
taskid.value = options.id
|
||||
date = options.date
|
||||
console.log(date)
|
||||
init()
|
||||
})
|
||||
|
||||
|
||||
@@ -162,7 +162,8 @@ function handleTap(ite) {
|
||||
|
||||
if (isComputed(ite.taskStatus)) {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/inspection/inspection_main?id=' + ite.id
|
||||
url:
|
||||
'/pageSubPack/inspection/inspection_main?id=' + ite.id + '&date=' + queryParmas.value.date
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import filePicker from '@/components/filePicker/filePicker.vue'
|
||||
import { getInspectionMain, putInsepctionPoint } from '@/api/insepction.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
@@ -209,6 +209,10 @@ function handleSubmit(item) {
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '正在提交',
|
||||
mask: true
|
||||
})
|
||||
let obj = {
|
||||
pointId: item.pointId,
|
||||
imgUrl: item.files.length > 0 ? item.files.join(',') : '',
|
||||
@@ -219,6 +223,16 @@ function handleSubmit(item) {
|
||||
putInsepctionPoint(obj)
|
||||
.then(res => {
|
||||
item.complated = true
|
||||
if (isComputed.value) {
|
||||
uni.showToast({
|
||||
title: '巡检完成',
|
||||
mask: true,
|
||||
duration: 2000,
|
||||
success() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
@@ -226,15 +240,20 @@ function handleSubmit(item) {
|
||||
title: '网络错误'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
const isComputed = computed(() => {
|
||||
// 遍历每一项
|
||||
return baseFormData.value.every(item => {
|
||||
const bol = baseFormData.value.every(item => {
|
||||
// 每一项里的所有 points 都必须是已完成
|
||||
return item.points.every(point => point.complated)
|
||||
})
|
||||
return bol
|
||||
})
|
||||
|
||||
/**
|
||||
* 预览图片
|
||||
* @param {Array} images - 所有图片的URL数组
|
||||
|
||||
Reference in New Issue
Block a user