巡检 - 已提交的点位禁用
This commit is contained in:
parent
06f9b79012
commit
a0c040e3af
@ -60,6 +60,12 @@
|
|||||||
color: #1890ff;
|
color: #1890ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disabled {
|
||||||
|
opacity: 0.6;
|
||||||
|
cursor: not-allowed;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.camera-section {
|
.camera-section {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<!-- 点位选择下拉菜单 -->
|
<!-- 点位选择下拉菜单 -->
|
||||||
<view class="select-container">
|
<view class="select-container">
|
||||||
<label class="select-label">选择点位</label>
|
<label class="select-label">选择点位</label>
|
||||||
<input type="text" class="search-input" v-model="searchKeyword" @focus="showOptions = true"
|
<input type="text" class="search-input" v-model="searchKeyword" @focus="showOptions = !showOptions"
|
||||||
placeholder="请输入点位名称搜索" readonly />
|
placeholder="请输入点位名称搜索" readonly />
|
||||||
|
|
||||||
<!-- 下拉选项 -->
|
<!-- 下拉选项 -->
|
||||||
@ -14,11 +14,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 有选项时显示选项列表 -->
|
<!-- 有选项时显示选项列表 -->
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<view v-for="option in pointsList"
|
<view v-for="option in pointsList" :key="option.id" class="option-item"
|
||||||
:key="option.id"
|
@click="option.exec_status != 3 && selectPointHandler(option)"
|
||||||
class="option-item"
|
:class="{ 'disabled': option.exec_status == 3 }">
|
||||||
@click="selectPointHandler(option)">
|
<view>
|
||||||
{{ option.point_info.point_name }}
|
{{ option.point_info.point_name }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -157,7 +158,7 @@ export default {
|
|||||||
title: '正在上传图片...',
|
title: '正在上传图片...',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
|
|
||||||
// 使用Promise.all并行上传所有图片
|
// 使用Promise.all并行上传所有图片
|
||||||
const uploadPromises = this.images.map(imagePath => {
|
const uploadPromises = this.images.map(imagePath => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -170,27 +171,27 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 等待所有图片上传完成
|
// 等待所有图片上传完成
|
||||||
const uploadedImageUrls = await Promise.all(uploadPromises);
|
const uploadedImageUrls = await Promise.all(uploadPromises);
|
||||||
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
// 准备提交数据,使用服务器返回的图片URL
|
// 准备提交数据,使用服务器返回的图片URL
|
||||||
const params = {
|
const params = {
|
||||||
task_id: parseInt(this.taskId), // 巡检任务ID
|
task_id: parseInt(this.taskId), // 巡检任务ID
|
||||||
task_point_id: parseInt(this.selectedPoint), // 巡检点ID
|
task_point_id: parseInt(this.selectedPoint), // 巡检点ID
|
||||||
image: uploadedImageUrls // 巡检图片,使用服务器返回的URL数组
|
image: uploadedImageUrls // 巡检图片,使用服务器返回的URL数组
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('上传成功的图片URL:', uploadedImageUrls)
|
console.log('上传成功的图片URL:', uploadedImageUrls)
|
||||||
|
|
||||||
// 调用正确的接口
|
// 调用正确的接口
|
||||||
const res = await request(apiArr.routingInspectionSubmit, "POST", params);
|
const res = await request(apiArr.routingInspectionSubmit, "POST", params);
|
||||||
|
|
||||||
// 输出提交的数据
|
// 输出提交的数据
|
||||||
console.log('提交数据:', params)
|
console.log('提交数据:', params)
|
||||||
|
|
||||||
// 显示提交成功提示
|
// 显示提交成功提示
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交成功',
|
title: '提交成功',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user