文件上传限制,巡检详情日期参数
This commit is contained in:
@@ -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