巡检接口
This commit is contained in:
@@ -67,7 +67,10 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="items_picker_box">
|
||||
<view class="label"> 巡检照片 </view>
|
||||
<view class="label">
|
||||
<text v-if="info.inspectSetting === 1" class="is-required">*</text>
|
||||
<text>巡检照片</text>
|
||||
</view>
|
||||
<view class="filePickerbox" v-if="!ite.complated">
|
||||
<filePicker
|
||||
v-model="ite.files"
|
||||
@@ -138,6 +141,14 @@ const rules = {
|
||||
errorMessage: '巡检状态不能为空'
|
||||
}
|
||||
]
|
||||
},
|
||||
files: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
errorMessage: '巡检照片不能为空'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,8 +180,6 @@ function init() {
|
||||
})
|
||||
.filter(item => item !== false)
|
||||
baseFormData.value = result
|
||||
console.log(result)
|
||||
console.log(isComputed.value)
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
@@ -194,7 +203,16 @@ function onUploadFail(e) {
|
||||
|
||||
/** 提交巡检点 检查情况 */
|
||||
function handleSubmit(item) {
|
||||
console.log(item, baseFormData.value)
|
||||
if (info.value.inspectSetting === 1) {
|
||||
if (item.files.length <= 0) {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
mask: true,
|
||||
title: '必须拍照'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
let obj = {
|
||||
pointId: item.pointId,
|
||||
imgUrl: item.files.length > 0 ? item.files.join(',') : '',
|
||||
@@ -202,15 +220,15 @@ function handleSubmit(item) {
|
||||
status: item.status,
|
||||
taskId: taskid.value
|
||||
}
|
||||
console.log(obj)
|
||||
putInsepctionPoint(obj)
|
||||
.then(res => {
|
||||
item.complated = true
|
||||
console.log(isComputed.value)
|
||||
console.log(res)
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络错误'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -240,6 +258,10 @@ function previewImages(images, currentIndex) {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.is-required {
|
||||
color: #dd524d;
|
||||
font-weight: bold;
|
||||
}
|
||||
.inspection_upload_box {
|
||||
background: #f9f9f9;
|
||||
padding: 20rpx 40rpx;
|
||||
|
||||
Reference in New Issue
Block a user