commit
8e62a96167
9 changed files with 1274 additions and 1066 deletions
@ -0,0 +1,55 @@ |
|||||||
|
import http from '@/http/api.js' |
||||||
|
// 安全点检-根据设备编码查询点检项@param {string} code 设备编码
|
||||||
|
const getSpotCheckByCode = (code) => { |
||||||
|
return http.request({ |
||||||
|
url: `/blade-desk/pdaLoad/getSpotCheckByEcCode/${code}`, |
||||||
|
method: 'GET' |
||||||
|
}) |
||||||
|
} |
||||||
|
// 安全点检-提交点检数据 @param {object} data 提交参数 { sscList: [...] }
|
||||||
|
const saveSpotCheck = (data) => { |
||||||
|
return http.request({ |
||||||
|
url: '/blade-desk/pdaSave/saveBySpotCheck', |
||||||
|
method: 'POST', |
||||||
|
data |
||||||
|
}) |
||||||
|
} |
||||||
|
// 安全巡检-根据编码查询巡检点 @param {String} code 巡检点编码
|
||||||
|
const getInspectionByCode = (code) => { |
||||||
|
return http.request({ |
||||||
|
url: `/blade-desk/pdaLoad/getInspectionByEcCode/${code}`, |
||||||
|
method: 'GET' |
||||||
|
}) |
||||||
|
} |
||||||
|
// 安全巡检-提交巡检数据 @param {object} data 提交参数 { icList: [...] }
|
||||||
|
const saveInspection = (data) => { |
||||||
|
return http.request({ |
||||||
|
url: '/blade-desk/pdaSave/saveByInspection', |
||||||
|
method: 'POST', |
||||||
|
data |
||||||
|
}) |
||||||
|
} |
||||||
|
// 设备报修-根据设备编码查询设备信息@param {string} deviceCode 设备编码
|
||||||
|
const getEcByDeviceCode = (deviceCode) => { |
||||||
|
return http.request({ |
||||||
|
url: '/blade-desk/pdaLoad/getEcByDeviceCode', |
||||||
|
method: 'POST', |
||||||
|
data: { deviceCode } |
||||||
|
}) |
||||||
|
} |
||||||
|
// 设备报修-提交设备报修 @param {object} data 报修数据
|
||||||
|
const saveEqRepair = (data) => { |
||||||
|
return http.request({ |
||||||
|
url: '/blade-desk/pdaSave/saveEqRepair', |
||||||
|
method: 'POST', |
||||||
|
data |
||||||
|
}) |
||||||
|
} |
||||||
|
export default { |
||||||
|
getInspectionByCode, |
||||||
|
saveInspection, |
||||||
|
getSpotCheckByCode, |
||||||
|
saveSpotCheck, |
||||||
|
getEcByDeviceCode, |
||||||
|
saveEqRepair |
||||||
|
} |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
import http from '@/http/api.js' |
||||||
|
// 废水/废气巡检-根据巡检点编码查询任务
|
||||||
|
const getInspectionBySan = (params) => { |
||||||
|
return http.request({ |
||||||
|
url: '/blade-desk/pdaLoad/getInspectionBySan', |
||||||
|
method: 'POST', |
||||||
|
data: params |
||||||
|
}) |
||||||
|
} |
||||||
|
// 废水/废气巡检-提交巡检结果
|
||||||
|
const savePatrolIns = (data) => { |
||||||
|
return http.request({ |
||||||
|
url: '/blade-desk/pdaSave/savePatrolIns', |
||||||
|
method: 'POST', |
||||||
|
data |
||||||
|
}) |
||||||
|
} |
||||||
|
// 酸雾塔加药接口-根据设备编码查询加药记录 @param {string} code 设备编码
|
||||||
|
const epDosingRecByCode = (code) => { |
||||||
|
return http.request({ |
||||||
|
url: `/blade-desk/pdaLoad/epDosingRecByCode/${code}`, |
||||||
|
method: 'GET' |
||||||
|
}) |
||||||
|
} |
||||||
|
// 酸雾塔加药接口-提交加药记录 @param {object} data 加药数据
|
||||||
|
const saveEpDosingRec = (data) => { |
||||||
|
return http.request({ |
||||||
|
url: '/blade-desk/pdaSave/saveEpDosingRec', |
||||||
|
method: 'POST', |
||||||
|
data |
||||||
|
}) |
||||||
|
} |
||||||
|
export default { |
||||||
|
getInspectionBySan, |
||||||
|
savePatrolIns, |
||||||
|
epDosingRecByCode, |
||||||
|
saveEpDosingRec |
||||||
|
} |
||||||
@ -1,231 +1,243 @@ |
|||||||
<template> |
<template> |
||||||
<ifrm ref="ifrm"> |
<ifrm ref="ifrm"> |
||||||
<!-- 安全巡检--> |
<!-- 安全巡检--> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
<uni-forms-item><input type="text" v-model="patrolRegisterValue" @confirm="patrolRegisterConfirm" |
<uni-forms-item> |
||||||
class="uni-input-border" placeholder="巡检点编码" /></uni-forms-item> |
<input |
||||||
</uni-forms> |
type="text" |
||||||
|
v-model="insNum" |
||||||
|
@confirm="insConfirm" |
||||||
|
class="uni-input-border" |
||||||
|
placeholder="巡检点编码" |
||||||
|
/> |
||||||
|
</uni-forms-item> |
||||||
|
</uni-forms> |
||||||
|
<uni-table border stripe emptyText="暂无更多数据" class="table"> |
||||||
|
<uni-tr> |
||||||
|
<uni-th align="center">巡检点编码</uni-th> |
||||||
|
<uni-th align="center">巡检点位置</uni-th> |
||||||
|
</uni-tr> |
||||||
|
<uni-tr v-for="(item, index) in insList" :key="index"> |
||||||
|
<uni-td align="center">{{ item.insNum }}</uni-td> |
||||||
|
<uni-td align="center">{{ item.insSite }}</uni-td> |
||||||
|
</uni-tr> |
||||||
|
</uni-table> |
||||||
|
|
||||||
<uni-table border stripe emptyText="暂无更多数据" class="table"> |
<view style="font-size: 36rpx">巡检备注:</view> |
||||||
<uni-tr> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
<uni-th align="center">巡检点编码</uni-th> |
<uni-forms-item> |
||||||
<uni-th align="center">巡检点位置</uni-th> |
<uni-easyinput |
||||||
</uni-tr> |
type="textarea" |
||||||
<uni-tr v-for="(item, index) in patrolRegisterList" :key="index"> |
autoHeight |
||||||
<uni-td align="center">{{ item.patrolRegister }}</uni-td> |
v-model="memo" |
||||||
<uni-td align="center">{{ item.insSpot }}</uni-td> |
placeholder="请输入内容" |
||||||
</uni-tr> |
/> |
||||||
</uni-table> |
</uni-forms-item> |
||||||
|
</uni-forms> |
||||||
<view style="font-size: 36rpx;">巡检备注:</view> |
<view class="photoTitleSize">{{ uploader.length }}/9</view> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
<view class="showImage"> |
||||||
<uni-forms-item><uni-easyinput type="textarea" autoHeight v-model="parMemo" |
<view v-for="(item, i) in uploader" :key="i" class="showImage-for"> |
||||||
placeholder="请输入内容"></uni-easyinput></uni-forms-item> |
<view class="view-image"> |
||||||
</uni-forms> |
<image :src="item.imageUrl" @tap="previewImage(i)" /> |
||||||
<view class="photoTitleSize">{{uploader.length}}/9</view> |
</view> |
||||||
<view class="showImage"> |
<view class="view-icon"> |
||||||
<view v-for="(item, i) in uploader" :key="i" class="showImage-for"> |
<uni-icons |
||||||
<view class="view-image"> |
type="trash" |
||||||
<image :src="item.imageUrl" @tap="previewImage(i)" /> |
size="14" |
||||||
</view> |
color="gray" |
||||||
<view class="view-icon"> |
@click="removeScene(item, i)" |
||||||
<uni-icons type='trash' size="14" color='gray' @click="removeScene(item, i)"></uni-icons> |
></uni-icons> |
||||||
</view> |
|
||||||
</view> |
|
||||||
<view class="view-center" v-if="uploader.length < 9"> |
|
||||||
<image src="../../static/images/photo.png" @click="chooseImage()"></image> |
|
||||||
</view> |
|
||||||
</view> |
</view> |
||||||
<view class="buttonBox"><button class="button" type="primary" :disabled="!(patrolRegisterList.length > 0)" |
</view> |
||||||
@click="submitClick">提交</button></view> |
<view class="view-center" v-if="uploader.length < 9"> |
||||||
</ifrm> |
<image |
||||||
|
src="../../static/images/photo.png" |
||||||
|
@click="chooseImage()" |
||||||
|
></image> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<view class="buttonBox"> |
||||||
|
<button |
||||||
|
class="button" |
||||||
|
type="primary" |
||||||
|
:disabled="!(insList.length > 0)" |
||||||
|
@click="submitClick" |
||||||
|
> |
||||||
|
提交 |
||||||
|
</button> |
||||||
|
</view> |
||||||
|
</ifrm> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import ifrm from '@/pages/index/ifrm'; |
import ifrm from "@/pages/index/ifrm"; |
||||||
import scan from '../../mixin/scan.js'; |
import scan from "../../mixin/scan.js"; |
||||||
export default { |
import { options } from "@/http/config.js"; |
||||||
mixins: [scan], |
export default { |
||||||
components: { |
mixins: [scan], |
||||||
ifrm |
components: { |
||||||
}, |
ifrm, |
||||||
data() { |
}, |
||||||
return { |
data() { |
||||||
patrolRegisterValue: '', |
return { |
||||||
patrolRegisterList: [], |
insNum: "", |
||||||
uploader: [], |
insList: [], |
||||||
parMemo: '' |
uploader: [], |
||||||
}; |
memo: "", |
||||||
}, |
}; |
||||||
methods: { |
}, |
||||||
getBarCode(code) { |
methods: { |
||||||
this.getData(code); |
getBarCode(code) { |
||||||
}, |
this.getData(code); |
||||||
patrolRegisterConfirm(e) { |
}, |
||||||
this.getBarCode(e.target.value); |
insConfirm(e) { |
||||||
}, |
this.insList = []; |
||||||
getData(code) { |
this.getBarCode(e.target.value); |
||||||
if (!code) return; |
}, |
||||||
this.patrolRegisterValue = code; |
getData(code) { |
||||||
this.$ajax.request({ |
if (!code) return; |
||||||
url: 'pdaLoad/getInspectionByEcCode/' + code, |
this.insNum = code; |
||||||
method: 'GET', |
this.$u.api.getInspectionByCode(code).then((res) => { |
||||||
success: data => { |
this.insNum = ""; |
||||||
console.log(data); |
this.insList = res.data; |
||||||
this.patrolRegisterValue = ''; |
uni.showToast({ title: "数据获取成功" }); |
||||||
this.patrolRegisterList = data; |
}); |
||||||
uni.showToast({ |
}, |
||||||
title: '数据获取成功' |
submitClick() { |
||||||
}); |
this.$u.api |
||||||
} |
.saveInspection({ |
||||||
}); |
code: this.insList.map((item) => item.insNum).join(","), |
||||||
}, |
memo: this.memo, |
||||||
submitClick() { |
// 取出所有上传成功的文件 |
||||||
let piList = []; |
path: this.uploader.map((item) => item.imageUrl), |
||||||
this.patrolRegisterList.forEach(item => { |
}) |
||||||
piList.push({ |
.then((data) => { |
||||||
piId: item.piId |
uni.showToast({ title: "巡检成功" }); |
||||||
}); |
// 清空表单 |
||||||
|
this.insList = []; |
||||||
}); |
this.memo = ""; |
||||||
this.$ajax.request({ |
this.uploader = []; |
||||||
url: 'pdaSave/saveByInspection', |
}); |
||||||
method: 'POST', |
}, |
||||||
data: { |
chooseImage: async function () { |
||||||
piList, |
if (this.insList.length == 0) { |
||||||
parMemo: this.parMemo |
return uni.showToast({ |
||||||
}, |
title: "请先查询巡检点", |
||||||
success: data => { |
icon: "none", |
||||||
uni.showToast({ |
}); |
||||||
title: '巡检成功' |
} |
||||||
}); |
uni.chooseImage({ |
||||||
this.patrolRegisterValue = ''; |
count: 9, |
||||||
this.patrolRegisterList = []; |
// sizeType: ['compressed'], |
||||||
this.uploader = [] |
// sourceType: ['album', 'camera'], |
||||||
} |
success: (res) => { |
||||||
|
uni.showLoading({ |
||||||
|
title: "上传中,请稍候", |
||||||
|
}); |
||||||
|
res.tempFilePaths.forEach((filePath) => { |
||||||
|
console.log("file-----------", filePath); |
||||||
|
console.log("options.baseURL------", options.baseURL); |
||||||
|
const server_config = uni.getStorageSync("server-config") |
||||||
|
console.log(999999,server_config) |
||||||
|
uni.uploadFile({ |
||||||
|
url: |
||||||
|
server_config.rootUrl + |
||||||
|
"/blade-resource/oss/endpoint/put-file-attach", |
||||||
|
filePath: filePath, |
||||||
|
name: "file", |
||||||
|
header: { |
||||||
|
token: "bearer " + uni.getStorageSync("accessToken"), |
||||||
|
"Blade-Auth": "bearer " + uni.getStorageSync("accessToken"), |
||||||
|
"Blade-Requested-With": "BladeHttpRequest", |
||||||
|
}, |
||||||
|
success: (uploadRes) => { |
||||||
|
uni.hideLoading(); |
||||||
|
uni.showToast({ title: "上传成功" }); |
||||||
|
this.uploader.push({ |
||||||
|
upId: JSON.parse(uploadRes.data).data.attachId, |
||||||
|
imageUrl: JSON.parse(uploadRes.data).data.link, |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
chooseImage: async function() { |
fail: (err) => { |
||||||
if (this.patrolRegisterList.length == 0) { |
console.error("❌ 上传失败", err); |
||||||
return uni.showToast({ |
uni.showToast({ title: "上传失败", icon: "none" }); |
||||||
title: '请先查询巡检点', |
}, |
||||||
icon: 'none' |
}); |
||||||
}); |
}); |
||||||
} |
|
||||||
uni.chooseImage({ |
|
||||||
// sourceType: ['album','camera'], //album 从相册选图,camera 使用相机,默认二者都有 |
|
||||||
// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
|
||||||
count: 9, |
|
||||||
success: (res) => { |
|
||||||
uni.showLoading({ |
|
||||||
title: '上传中,请稍候' |
|
||||||
}); |
|
||||||
var tempFilePaths = res.tempFilePaths; |
|
||||||
for (var i = 0; i < tempFilePaths.length; i++) { |
|
||||||
const file = res.tempFiles[i]; |
|
||||||
this.$uploadUtil.upload(file, { |
|
||||||
theId: this.patrolRegisterList[0].piId, |
|
||||||
theTag: 'SafePatrolInspection', |
|
||||||
subTag: 'appDoc' |
|
||||||
}, tempFilePaths[i]).then((upId) => { |
|
||||||
uni.hideLoading(); |
|
||||||
//展示图片 |
|
||||||
this.uploader.push({ |
|
||||||
upId: upId, |
|
||||||
imageUrl: file.path |
|
||||||
}); |
|
||||||
}) |
|
||||||
|
|
||||||
} |
|
||||||
}, |
|
||||||
complete() { |
|
||||||
uni.hideLoading(); |
|
||||||
} |
|
||||||
}) |
|
||||||
}, |
|
||||||
previewImage: function(index) { |
|
||||||
var imags = []; |
|
||||||
this.uploader.forEach(item => { |
|
||||||
imags.push(item.imageUrl); |
|
||||||
}) |
|
||||||
uni.previewImage({ |
|
||||||
current: index, |
|
||||||
urls: imags |
|
||||||
}) |
|
||||||
}, |
|
||||||
|
|
||||||
removeScene(item, i) { |
|
||||||
//删除现场图片 |
|
||||||
this.uploader.splice(i, 1); |
|
||||||
// //删除附件记录 |
|
||||||
this.$uploadUtil.asyncDelete(item.upId).then((data) => { |
|
||||||
uni.showToast({ |
|
||||||
title: '删除成功', |
|
||||||
icon: 'none' |
|
||||||
}); |
|
||||||
}) |
|
||||||
// this.upIdList.splice(this.upIdList.findIndex((upId) => (upId === item.upId)), 1); |
|
||||||
}, |
|
||||||
}, |
}, |
||||||
|
}); |
||||||
|
}, |
||||||
|
// 预览图片 |
||||||
|
previewImage(index) { |
||||||
|
const urls = this.uploader.map((item) => item.imageUrl); |
||||||
|
uni.previewImage({ current: index, urls }); |
||||||
|
}, |
||||||
|
|
||||||
onNavigationBarButtonTap(btn) { |
// 删除图片 |
||||||
this.$refs.ifrm.topMenuClick(btn); |
removeScene(item, index) { |
||||||
}, |
// 先删本地列表 |
||||||
onShow() {} |
this.uploader.splice(index, 1); |
||||||
}; |
uni.showToast({ title: "删除成功", icon: "none" }); |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
onNavigationBarButtonTap(btn) { |
||||||
|
this.$refs.ifrm.topMenuClick(btn); |
||||||
|
}, |
||||||
|
onShow() {}, |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped lang="less"> |
<style scoped lang="less"> |
||||||
.photoTitleSize { |
.photoTitleSize { |
||||||
color: #a1a1a1; |
color: #a1a1a1; |
||||||
text-align: right; |
text-align: right; |
||||||
margin-right: 30rpx; |
margin-right: 30rpx; |
||||||
margin-top: -30rpx; |
margin-top: -30rpx; |
||||||
} |
} |
||||||
|
|
||||||
.showImage { |
|
||||||
display: flex; |
|
||||||
flex-direction: row; |
|
||||||
justify-content: flex-start; |
|
||||||
flex-wrap: wrap; |
|
||||||
margin-left: -20rpx; |
|
||||||
|
|
||||||
.showImage-for { |
.showImage { |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
justify-content: flex-start; |
||||||
|
flex-wrap: wrap; |
||||||
|
margin-left: -20rpx; |
||||||
|
|
||||||
display: flex; |
.showImage-for { |
||||||
flex-direction: column; |
display: flex; |
||||||
width: 200rpx; |
flex-direction: column; |
||||||
margin-left: 30rpx; |
width: 200rpx; |
||||||
height: 260rpx; |
margin-left: 30rpx; |
||||||
|
height: 260rpx; |
||||||
|
|
||||||
.view-icon { |
.view-icon { |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: row; |
flex-direction: row; |
||||||
justify-content: center; |
justify-content: center; |
||||||
margin-top: -10rpx; |
margin-top: -10rpx; |
||||||
} |
} |
||||||
|
|
||||||
image { |
image { |
||||||
border-width: 2rpx; |
border-width: 2rpx; |
||||||
border-color: rgb(229, 229, 229); |
border-color: rgb(229, 229, 229); |
||||||
border-style: solid; |
border-style: solid; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
width: 190rpx; |
width: 190rpx; |
||||||
height: 190rpx; |
height: 190rpx; |
||||||
} |
|
||||||
} |
|
||||||
} |
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
.view-center { |
.view-center { |
||||||
margin: 0rpx 25rpx; |
margin: 0rpx 25rpx; |
||||||
|
|
||||||
image { |
image { |
||||||
border-width: 2rpx; |
border-width: 2rpx; |
||||||
border-color: rgb(229, 229, 229); |
border-color: rgb(229, 229, 229); |
||||||
border-style: solid; |
border-style: solid; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
width: 190rpx; |
width: 190rpx; |
||||||
height: 190rpx; |
height: 190rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
@ -1,120 +1,137 @@ |
|||||||
<template> |
<template> |
||||||
<ifrm ref="ifrm"> |
<ifrm ref="ifrm"> |
||||||
<!-- 安全点检 --> |
<!-- 安全点检 --> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
<uni-forms-item><input type="text" v-model="facilityValue" @confirm="facilityConfirm" |
<uni-forms-item> |
||||||
class="uni-input-border" placeholder="设备编码" /></uni-forms-item> |
<input |
||||||
</uni-forms> |
type="text" |
||||||
<checkbox-group @change="checkboxChange"> |
v-model="facilityValue" |
||||||
<uni-table border stripe emptyText="暂无更多数据" class="table"> |
@confirm="facilityConfirm" |
||||||
<uni-tr> |
class="uni-input-border" |
||||||
<uni-th align="center" width="60"></uni-th> |
placeholder="设备编码" |
||||||
<uni-th align="center">检验项</uni-th> |
/> |
||||||
<uni-th align="center">检验条件</uni-th> |
</uni-forms-item> |
||||||
<uni-th align="center">检验结果</uni-th> |
</uni-forms> |
||||||
<uni-th align="center">描述</uni-th> |
<checkbox-group @change="checkboxChange"> |
||||||
</uni-tr> |
<uni-table border stripe emptyText="暂无更多数据" class="table"> |
||||||
<uni-tr v-for="(item, index) in facilityData" :key="index"> |
<uni-tr> |
||||||
<uni-td align="center"> |
<uni-th align="center" width="60"></uni-th> |
||||||
<checkbox :value="item" :checked="item.checked" /> |
<uni-th align="center">检验项</uni-th> |
||||||
</uni-td> |
<uni-th align="center">检验条件</uni-th> |
||||||
<uni-td align="center">{{ item.checkItem }}</uni-td> |
<uni-th align="center">检验结果</uni-th> |
||||||
<uni-td align="center">{{ item.checkCon }}</uni-td> |
<uni-th align="center">描述</uni-th> |
||||||
<uni-td align="center" class="tableRequired"> |
</uni-tr> |
||||||
<picker @change="bindPickerChange($event, index)" :value="item.facilityIndex" :range="array"> |
<uni-tr v-for="(item, index) in facilityData" :key="index"> |
||||||
<view class="uni-input">{{ array[item.facilityIndex] }}</view> |
<uni-td align="center"> |
||||||
</picker> |
<checkbox :value="item" :checked="item.checked" /> |
||||||
</uni-td> |
</uni-td> |
||||||
<uni-td align="center" width="200"><textarea style="width: 260rpx;" auto-height |
<uni-td align="center">{{ item.checkItem }}</uni-td> |
||||||
v-model="item.describe" /></uni-td> |
<uni-td align="center">{{ item.checkCon }}</uni-td> |
||||||
</uni-tr> |
<uni-td align="center" class="tableRequired"> |
||||||
</uni-table> |
<picker |
||||||
</checkbox-group> |
@change="bindPickerChange($event, index)" |
||||||
<view class="buttonBox"><button class="button" type="primary" :disabled="!(facilitySeceteArr.length > 0)" |
:value="item.facilityIndex" |
||||||
@click="submitClick">提交</button></view> |
:range="array" |
||||||
</ifrm> |
> |
||||||
|
<view class="uni-input">{{ array[item.facilityIndex] }}</view> |
||||||
|
</picker> |
||||||
|
</uni-td> |
||||||
|
<uni-td align="center" width="200"> |
||||||
|
<textarea |
||||||
|
style="width: 260rpx" |
||||||
|
auto-height |
||||||
|
v-model="item.describe" |
||||||
|
/> |
||||||
|
</uni-td> |
||||||
|
</uni-tr> |
||||||
|
</uni-table> |
||||||
|
</checkbox-group> |
||||||
|
<view class="buttonBox"> |
||||||
|
<button |
||||||
|
class="button" |
||||||
|
type="primary" |
||||||
|
:disabled="!(facilitySeceteArr.length > 0)" |
||||||
|
@click="submitClick" |
||||||
|
> |
||||||
|
提交 |
||||||
|
</button> |
||||||
|
</view> |
||||||
|
</ifrm> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import ifrm from '@/pages/index/ifrm'; |
import ifrm from "@/pages/index/ifrm"; |
||||||
import scan from '../../mixin/scan.js'; |
import scan from "../../mixin/scan.js"; |
||||||
export default { |
export default { |
||||||
mixins: [scan], |
mixins: [scan], |
||||||
components: { |
components: { |
||||||
ifrm |
ifrm, |
||||||
}, |
}, |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
facilityValue: '', |
facilityValue: "", |
||||||
array: ['正常', '关机', '异常'], |
array: ["正常", "关机", "异常"], |
||||||
facilityData: [], |
facilityData: [], |
||||||
facilitySeceteArr: [] |
facilitySeceteArr: [], |
||||||
}; |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
checkboxChange(e) { |
|
||||||
this.facilitySeceteArr = e.detail.value; |
|
||||||
}, |
|
||||||
bindPickerChange: function(e, index) { |
|
||||||
this.facilityData[index].facilityIndex = e.target.value; |
|
||||||
}, |
|
||||||
getBarCode(code) { |
|
||||||
this.getData(code); |
|
||||||
}, |
|
||||||
facilityConfirm(e) { |
|
||||||
this.getBarCode(e.target.value); |
|
||||||
}, |
|
||||||
getData(code) { |
|
||||||
if (!code) return; |
|
||||||
this.facilityValue = code; |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'pdaLoad/getSpotCheckByEcCode/' + code, |
|
||||||
method: 'GET', |
|
||||||
success: data => { |
|
||||||
this.facilityValue = ''; |
|
||||||
this.facilityData = []; |
|
||||||
data.forEach(item => { |
|
||||||
this.facilityData.push({ |
|
||||||
...item, |
|
||||||
facilityIndex: 0 |
|
||||||
}); |
|
||||||
}); |
|
||||||
uni.showToast({ |
|
||||||
title: '数据获取成功' |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
submitClick() { |
|
||||||
let arr = []; |
|
||||||
this.facilitySeceteArr.forEach(item => { |
|
||||||
arr.push({ |
|
||||||
sscId: item.sscId, |
|
||||||
checkResult: item.facilityIndex, |
|
||||||
describe: item.describe |
|
||||||
}); |
|
||||||
}); |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'pdaSave/saveBySpotCheck', |
|
||||||
method: 'POST', |
|
||||||
data: { |
|
||||||
sscList: arr |
|
||||||
}, |
|
||||||
success: data => { |
|
||||||
uni.showToast({ |
|
||||||
title: '点检成功' |
|
||||||
}); |
|
||||||
this.facilityValue = ''; |
|
||||||
this.facilityData = []; |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
}, |
|
||||||
onNavigationBarButtonTap(btn) { |
|
||||||
this.$refs.ifrm.topMenuClick(btn); |
|
||||||
}, |
|
||||||
onShow() {} |
|
||||||
}; |
}; |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
checkboxChange(e) { |
||||||
|
this.facilitySeceteArr = e.detail.value; |
||||||
|
}, |
||||||
|
bindPickerChange: function (e, index) { |
||||||
|
this.facilityData[index].facilityIndex = e.target.value; |
||||||
|
}, |
||||||
|
getBarCode(code) { |
||||||
|
this.getData(code); |
||||||
|
}, |
||||||
|
facilityConfirm(e) { |
||||||
|
this.getBarCode(e.target.value); |
||||||
|
}, |
||||||
|
getData(code) { |
||||||
|
if (!code) return; |
||||||
|
this.facilityValue = code; |
||||||
|
this.$u.api.getSpotCheckByCode(code).then((data) => { |
||||||
|
this.facilityValue = ""; |
||||||
|
this.facilityData = []; |
||||||
|
data.forEach((item) => { |
||||||
|
this.facilityData.push({ |
||||||
|
...item, |
||||||
|
facilityIndex: 0, |
||||||
|
}); |
||||||
|
}); |
||||||
|
uni.showToast({ |
||||||
|
title: "数据获取成功", |
||||||
|
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
submitClick() { |
||||||
|
let arr = []; |
||||||
|
this.facilitySeceteArr.forEach((item) => { |
||||||
|
arr.push({ |
||||||
|
sscId: item.sscId, |
||||||
|
checkResult: item.facilityIndex, |
||||||
|
describe: item.describe, |
||||||
|
}); |
||||||
|
}); |
||||||
|
this.$u.api |
||||||
|
.saveSpotCheck({ |
||||||
|
sscList: arr, |
||||||
|
}) |
||||||
|
.then((data) => { |
||||||
|
uni.showToast({ |
||||||
|
title: "点检成功", |
||||||
|
}); |
||||||
|
this.facilityValue = ""; |
||||||
|
this.facilityData = []; |
||||||
|
}); |
||||||
|
}, |
||||||
|
}, |
||||||
|
onNavigationBarButtonTap(btn) { |
||||||
|
this.$refs.ifrm.topMenuClick(btn); |
||||||
|
}, |
||||||
|
onShow() {}, |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped></style> |
<style scoped></style> |
||||||
@ -1,249 +1,270 @@ |
|||||||
<template> |
<template> |
||||||
<ifrm ref="ifrm"> |
<ifrm ref="ifrm"> |
||||||
<!-- 安全巡检--> |
<!-- 安全巡检--> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
<uni-forms-item><input type="text" v-model="deviceRepairValue" @confirm="deviceRepairConfirm" |
<uni-forms-item> |
||||||
class="uni-input-border" placeholder="巡检点编码" /></uni-forms-item> |
<input type="text" v-model="code" @confirm="deviceRepairConfirm" class="uni-input-border" placeholder="巡检点编码" /> |
||||||
</uni-forms> |
</uni-forms-item> |
||||||
<t-table> |
</uni-forms> |
||||||
<t-tr> |
<t-table> |
||||||
<t-td>巡检点编码</t-td> |
<t-tr> |
||||||
<t-td>{{ deviceRepairObj.epInspectionPoint.patrolRegister }}</t-td> |
<t-td>巡检点编码</t-td> |
||||||
</t-tr> |
<t-td>{{ deviceRepairObj.epInspectionPoint.insNum }}</t-td> |
||||||
<t-tr> |
</t-tr> |
||||||
<t-td>巡检点位置</t-td> |
<t-tr> |
||||||
<t-td>{{ deviceRepairObj.epInspectionPoint.insSpot }}</t-td> |
<t-td>巡检点位置</t-td> |
||||||
</t-tr> |
<t-td>{{ deviceRepairObj.epInspectionPoint.insSite }}</t-td> |
||||||
<t-tr> |
</t-tr> |
||||||
<t-td>状态</t-td> |
<t-tr> |
||||||
<t-td>{{ deviceRepairObj.taskStatusText }}</t-td> |
<t-td>状态</t-td> |
||||||
</t-tr> |
<t-td> |
||||||
</t-table> |
{{ |
||||||
<view style="font-size: 36rpx;">巡检备注:</view> |
deviceRepairObj.epInspectionPoint.taskStatus == 1 |
||||||
<uni-forms ref="form" err-show-type="toast"> |
? "待检" |
||||||
<uni-forms-item><uni-easyinput type="textarea" autoHeight v-model="deviceRepairObj.parMemo" |
: deviceRepairObj.epInspectionPoint.taskStatus == 2 |
||||||
placeholder="请输入内容"></uni-easyinput></uni-forms-item> |
? "未检" |
||||||
</uni-forms> |
: deviceRepairObj.epInspectionPoint.taskStatus == 3 |
||||||
<view class="photoTitleSize">{{uploader.length}}/9</view> |
? "已检" |
||||||
<view class="showImage"> |
: "" |
||||||
<view v-for="(item, i) in uploader" :key="i" class="showImage-for"> |
}} |
||||||
<view class="view-image"> |
</t-td> |
||||||
<image :src="item.imageUrl" @tap="previewImage(i)" /> |
</t-tr> |
||||||
</view> |
</t-table> |
||||||
<view class="view-icon"> |
<view style="font-size: 36rpx">巡检备注:</view> |
||||||
<uni-icons type='trash' size="14" color='gray' @click="removeScene(item, i)"></uni-icons> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
</view> |
<uni-forms-item> |
||||||
</view> |
<uni-easyinput type="textarea" autoHeight v-model="deviceRepairObj.epInspectionPoint.parMemo" |
||||||
<view class="view-center" v-if="uploader.length < 9"> |
placeholder="请输入内容"> |
||||||
<image src="../../static/images/photo.png" @click="chooseImage()"></image> |
</uni-easyinput> |
||||||
</view> |
</uni-forms-item> |
||||||
|
</uni-forms> |
||||||
|
<view class="photoTitleSize">{{ uploader.length }}/9</view> |
||||||
|
<view class="showImage"> |
||||||
|
<view v-for="(item, i) in uploader" :key="i" class="showImage-for"> |
||||||
|
<view class="view-image"> |
||||||
|
<image :src="item.imageUrl" @tap="previewImage(i)" /> |
||||||
</view> |
</view> |
||||||
<view class="buttonBox"><button class="button" type="primary" |
<view class="view-icon"> |
||||||
:disabled="!(Object.keys(deviceRepairObj).length > 2)" @click="submitClick">提交</button></view> |
<uni-icons type="trash" size="14" color="gray" @click="removeScene(item, i)" /> |
||||||
</ifrm> |
</view> |
||||||
|
</view> |
||||||
|
<view class="view-center" v-if="uploader.length < 9"> |
||||||
|
<image src="../../static/images/photo.png" @click="chooseImage()" /> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<view class="buttonBox"> |
||||||
|
<button class="button" type="primary" :disabled="!(Object.keys(deviceRepairObj.epInspectionPoint).length > 2)" |
||||||
|
@click="submitClick"> |
||||||
|
提交 |
||||||
|
</button> |
||||||
|
</view> |
||||||
|
</ifrm> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import ifrm from '@/pages/index/ifrm'; |
import ifrm from "@/pages/index/ifrm"; |
||||||
import tTable from '@/components/t-table/t-table.vue'; |
import tTable from "@/components/t-table/t-table.vue"; |
||||||
import tTh from '@/components/t-table/t-th.vue'; |
import tTh from "@/components/t-table/t-th.vue"; |
||||||
import tTr from '@/components/t-table/t-tr.vue'; |
import tTr from "@/components/t-table/t-tr.vue"; |
||||||
import tTd from '@/components/t-table/t-td.vue'; |
import tTd from "@/components/t-table/t-td.vue"; |
||||||
import scan from '../../mixin/scan.js'; |
import scan from "../../mixin/scan.js"; |
||||||
export default { |
import { |
||||||
mixins: [scan], |
options |
||||||
components: { |
} from '@/http/config.js'; |
||||||
ifrm, |
export default { |
||||||
tTable, |
mixins: [scan], |
||||||
tTh, |
components: { |
||||||
tTr, |
ifrm, |
||||||
tTd |
tTable, |
||||||
|
tTh, |
||||||
|
tTr, |
||||||
|
tTd, |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
code: "", |
||||||
|
deviceRepairObj: { |
||||||
|
epInspectionPoint: { |
||||||
|
parMemo: "", |
||||||
}, |
}, |
||||||
data() { |
}, |
||||||
return { |
uploader: [], |
||||||
deviceRepairValue: '', |
}; |
||||||
deviceRepairObj: { |
}, |
||||||
epInspectionPoint: {}, |
methods: { |
||||||
parMemo: '' |
chooseImage: async function () { |
||||||
}, |
if (!this.deviceRepairObj.epInspectionPoint.epcId) { |
||||||
uploader: [] |
return uni.showToast({ |
||||||
}; |
title: '请先查询巡检点', |
||||||
|
icon: 'none' |
||||||
|
}); |
||||||
|
} |
||||||
|
const server_config = uni.getStorageSync("server-config") |
||||||
|
console.log(999999,server_config) |
||||||
|
uni.chooseImage({ |
||||||
|
count: 9, |
||||||
|
// sizeType: ['compressed'], |
||||||
|
// sourceType: ['album', 'camera'], |
||||||
|
success: (res) => { |
||||||
|
uni.showLoading({ |
||||||
|
title: '上传中,请稍候' |
||||||
|
}); |
||||||
|
res.tempFilePaths.forEach(filePath => { |
||||||
|
uni.uploadFile({ |
||||||
|
url: server_config.rootUrl + '/blade-resource/oss/endpoint/put-file-attach', |
||||||
|
filePath: filePath, |
||||||
|
name: 'file', |
||||||
|
header: { |
||||||
|
'token': 'bearer ' + uni.getStorageSync('accessToken'), |
||||||
|
'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken'), |
||||||
|
'Blade-Requested-With': 'BladeHttpRequest' |
||||||
|
}, |
||||||
|
success: (uploadRes) => { |
||||||
|
uni.hideLoading(); |
||||||
|
uni.showToast({ title: '上传成功' }); |
||||||
|
this.uploader.push({ |
||||||
|
upId: JSON.parse(uploadRes.data).data.attachId, |
||||||
|
imageUrl: JSON.parse(uploadRes.data).data.link |
||||||
|
}); |
||||||
|
}, |
||||||
|
fail: (err) => { |
||||||
|
console.error('❌ 上传失败', err); |
||||||
|
uni.showToast({ title: '上传失败', icon: 'none' }); |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
}, |
}, |
||||||
methods: { |
}); |
||||||
|
}, |
||||||
|
previewImage: function (index) { |
||||||
|
var imags = []; |
||||||
|
this.uploader.forEach((item) => { |
||||||
|
imags.push(item.imageUrl); |
||||||
|
}); |
||||||
|
uni.previewImage({ |
||||||
|
current: index, |
||||||
|
urls: imags, |
||||||
|
}); |
||||||
|
}, |
||||||
|
|
||||||
chooseImage: async function() { |
removeScene(item, i) { |
||||||
if (!this.deviceRepairObj.epiId) { |
//删除现场图片 |
||||||
return uni.showToast({ |
this.uploader.splice(i, 1); |
||||||
title: '请先查询巡检点', |
// //删除附件记录 |
||||||
icon: 'none' |
this.$uploadUtil.asyncDelete(item.upId).then((data) => { |
||||||
}); |
uni.showToast({ |
||||||
} |
title: "删除成功", |
||||||
uni.chooseImage({ |
icon: "none", |
||||||
// sourceType: ['album','camera'], //album 从相册选图,camera 使用相机,默认二者都有 |
}); |
||||||
// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
}); |
||||||
count: 9, |
// this.upIdList.splice(this.upIdList.findIndex((upId) => (upId === item.upId)), 1); |
||||||
success: (res) => { |
}, |
||||||
uni.showLoading({ |
|
||||||
title: '上传中,请稍候' |
|
||||||
}); |
|
||||||
var tempFilePaths = res.tempFilePaths; |
|
||||||
for (var i = 0; i < tempFilePaths.length; i++) { |
|
||||||
const file = res.tempFiles[i]; |
|
||||||
this.$uploadUtil.upload(file, { |
|
||||||
theId: this.deviceRepairObj.epiId, |
|
||||||
theTag: 'EpPatrolInspection', |
|
||||||
subTag: 'appDoc' |
|
||||||
}, tempFilePaths[i]).then((upId) => { |
|
||||||
uni.hideLoading(); |
|
||||||
//展示图片 |
|
||||||
this.uploader.push({ |
|
||||||
upId: upId, |
|
||||||
imageUrl: file.path |
|
||||||
}); |
|
||||||
}) |
|
||||||
|
|
||||||
} |
getBarCode(code) { |
||||||
}, |
this.getData(code); |
||||||
complete() { |
}, |
||||||
uni.hideLoading(); |
deviceRepairConfirm(e) { |
||||||
} |
this.getBarCode(e.target.value); |
||||||
}) |
}, |
||||||
}, |
getData(code) { |
||||||
previewImage: function(index) { |
this.code = code; |
||||||
var imags = []; |
this.$u.api |
||||||
this.uploader.forEach(item => { |
.getInspectionBySan({ |
||||||
imags.push(item.imageUrl); |
code: code, |
||||||
}) |
eipType: 2, |
||||||
uni.previewImage({ |
}) |
||||||
current: index, |
.then((res) => { |
||||||
urls: imags |
if (res.data == null) { |
||||||
}) |
return uni.showToast({ |
||||||
}, |
icon: "none", |
||||||
|
title: "此巡检位置暂无任务", |
||||||
removeScene(item, i) { |
}); |
||||||
//删除现场图片 |
} |
||||||
this.uploader.splice(i, 1); |
this.code = ""; |
||||||
// //删除附件记录 |
this.deviceRepairObj.epInspectionPoint = res.data; |
||||||
this.$uploadUtil.asyncDelete(item.upId).then((data) => { |
uni.showToast({ |
||||||
uni.showToast({ |
title: "数据获取成功", |
||||||
title: '删除成功', |
}); |
||||||
icon: 'none' |
}); |
||||||
}); |
}, |
||||||
}) |
submitClick() { |
||||||
// this.upIdList.splice(this.upIdList.findIndex((upId) => (upId === item.upId)), 1); |
this.$u.api |
||||||
}, |
.savePatrolIns({ |
||||||
|
...this.deviceRepairObj.epInspectionPoint, |
||||||
getBarCode(code) { |
path: this.uploader.map((item) => item.imageUrl).join(','), |
||||||
this.getData(code); |
}) |
||||||
}, |
.then((data) => { |
||||||
deviceRepairConfirm(e) { |
uni.showToast({ |
||||||
this.getBarCode(e.target.value); |
title: "保存成功", |
||||||
}, |
}); |
||||||
getData(code) { |
this.code = ""; |
||||||
this.deviceRepairValue = code; |
this.deviceRepairObj = { |
||||||
this.$ajax.request({ |
epInspectionPoint: {}, |
||||||
url: 'pdaLoad/getInspectionBySan', |
}; |
||||||
method: 'POST', |
this.uploader = []; |
||||||
data: { |
}); |
||||||
code: code, |
}, |
||||||
eipType: 2 |
}, |
||||||
}, |
onNavigationBarButtonTap(btn) { |
||||||
success: data => { |
this.$refs.ifrm.topMenuClick(btn); |
||||||
if (data == null) { |
}, |
||||||
return uni.showToast({ |
onShow() { }, |
||||||
icon: "none", |
}; |
||||||
title: '此巡检位置暂无任务' |
|
||||||
}); |
|
||||||
} |
|
||||||
this.deviceRepairValue = ''; |
|
||||||
this.deviceRepairObj = data; |
|
||||||
uni.showToast({ |
|
||||||
title: '数据获取成功' |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
submitClick() { |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'pdaSave/savePatrolIns', |
|
||||||
method: 'POST', |
|
||||||
data: this.deviceRepairObj, |
|
||||||
success: data => { |
|
||||||
uni.showToast({ |
|
||||||
title: '保存成功' |
|
||||||
}); |
|
||||||
this.deviceRepairValue = ''; |
|
||||||
this.deviceRepairObj = { |
|
||||||
epInspectionPoint: {}, |
|
||||||
parMemo: '' |
|
||||||
}; |
|
||||||
this.uploader = [] |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
}, |
|
||||||
onNavigationBarButtonTap(btn) { |
|
||||||
this.$refs.ifrm.topMenuClick(btn); |
|
||||||
}, |
|
||||||
onShow() {} |
|
||||||
}; |
|
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped lang="less"> |
<style scoped lang="less"> |
||||||
.uni-forms-item { |
.uni-forms-item { |
||||||
margin-bottom: 6px !important; |
margin-bottom: 6px !important; |
||||||
} |
} |
||||||
|
|
||||||
.photoTitleSize { |
.photoTitleSize { |
||||||
color: #a1a1a1; |
color: #a1a1a1; |
||||||
text-align: right; |
text-align: right; |
||||||
margin-right: 30rpx; |
margin-right: 30rpx; |
||||||
margin-top: -30rpx; |
margin-top: -30rpx; |
||||||
} |
} |
||||||
|
|
||||||
.showImage { |
|
||||||
display: flex; |
|
||||||
flex-direction: row; |
|
||||||
justify-content: flex-start; |
|
||||||
flex-wrap: wrap; |
|
||||||
margin-left: -20rpx; |
|
||||||
|
|
||||||
.showImage-for { |
.showImage { |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
justify-content: flex-start; |
||||||
|
flex-wrap: wrap; |
||||||
|
margin-left: -20rpx; |
||||||
|
|
||||||
display: flex; |
.showImage-for { |
||||||
flex-direction: column; |
display: flex; |
||||||
width: 200rpx; |
flex-direction: column; |
||||||
margin-left: 30rpx; |
width: 200rpx; |
||||||
height: 260rpx; |
margin-left: 30rpx; |
||||||
|
height: 260rpx; |
||||||
|
|
||||||
.view-icon { |
.view-icon { |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: row; |
flex-direction: row; |
||||||
justify-content: center; |
justify-content: center; |
||||||
margin-top: -10rpx; |
margin-top: -10rpx; |
||||||
} |
} |
||||||
|
|
||||||
image { |
image { |
||||||
border-width: 2rpx; |
border-width: 2rpx; |
||||||
border-color: rgb(229, 229, 229); |
border-color: rgb(229, 229, 229); |
||||||
border-style: solid; |
border-style: solid; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
width: 190rpx; |
width: 190rpx; |
||||||
height: 190rpx; |
height: 190rpx; |
||||||
} |
|
||||||
} |
|
||||||
} |
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
.view-center { |
.view-center { |
||||||
margin: 0rpx 25rpx; |
margin: 0rpx 25rpx; |
||||||
|
|
||||||
image { |
image { |
||||||
border-width: 2rpx; |
border-width: 2rpx; |
||||||
border-color: rgb(229, 229, 229); |
border-color: rgb(229, 229, 229); |
||||||
border-style: solid; |
border-style: solid; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
width: 190rpx; |
width: 190rpx; |
||||||
height: 190rpx; |
height: 190rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
@ -1,249 +1,289 @@ |
|||||||
<template> |
<template> |
||||||
<ifrm ref="ifrm"> |
<ifrm ref="ifrm"> |
||||||
<!-- 安全巡检--> |
<!-- 安全巡检--> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
<uni-forms-item><input type="text" v-model="deviceRepairValue" @confirm="deviceRepairConfirm" |
<uni-forms-item> |
||||||
class="uni-input-border" placeholder="巡检点编码" /></uni-forms-item> |
<input |
||||||
</uni-forms> |
type="text" |
||||||
<t-table> |
v-model="code" |
||||||
<t-tr> |
@confirm="deviceRepairConfirm" |
||||||
<t-td>巡检点编码</t-td> |
class="uni-input-border" |
||||||
<t-td>{{ deviceRepairObj.epInspectionPoint.patrolRegister }}</t-td> |
placeholder="巡检点编码" |
||||||
</t-tr> |
/> |
||||||
<t-tr> |
</uni-forms-item> |
||||||
<t-td>巡检点位置</t-td> |
</uni-forms> |
||||||
<t-td>{{ deviceRepairObj.epInspectionPoint.insSpot }}</t-td> |
<t-table> |
||||||
</t-tr> |
<t-tr> |
||||||
<t-tr> |
<t-td>巡检点编码</t-td> |
||||||
<t-td>状态</t-td> |
<t-td>{{ deviceRepairObj.epInspectionPoint.insNum }}</t-td> |
||||||
<t-td>{{ deviceRepairObj.taskStatusText }}</t-td> |
</t-tr> |
||||||
</t-tr> |
<t-tr> |
||||||
</t-table> |
<t-td>巡检点位置</t-td> |
||||||
<view style="font-size: 36rpx;">巡检备注:</view> |
<t-td>{{ deviceRepairObj.epInspectionPoint.insSite }}</t-td> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
</t-tr> |
||||||
<uni-forms-item><uni-easyinput type="textarea" autoHeight v-model="deviceRepairObj.parMemo" |
<t-tr> |
||||||
placeholder="请输入内容"></uni-easyinput></uni-forms-item> |
<t-td>状态</t-td> |
||||||
</uni-forms> |
<t-td> |
||||||
<view class="photoTitleSize">{{uploader.length}}/9</view> |
{{ |
||||||
<view class="showImage"> |
deviceRepairObj.epInspectionPoint.taskStatus == 1 |
||||||
<view v-for="(item, i) in uploader" :key="i" class="showImage-for"> |
? "待检" |
||||||
<view class="view-image"> |
: deviceRepairObj.epInspectionPoint.taskStatus == 2 |
||||||
<image :src="item.imageUrl" @tap="previewImage(i)" /> |
? "未检" |
||||||
</view> |
: deviceRepairObj.epInspectionPoint.taskStatus == 3 |
||||||
<view class="view-icon"> |
? "已检" |
||||||
<uni-icons type='trash' size="14" color='gray' @click="removeScene(item, i)"></uni-icons> |
: "" |
||||||
</view> |
}} |
||||||
</view> |
</t-td> |
||||||
<view class="view-center" v-if="uploader.length < 9"> |
</t-tr> |
||||||
<image src="../../static/images/photo.png" @click="chooseImage()"></image> |
</t-table> |
||||||
</view> |
<view style="font-size: 36rpx">巡检备注:</view> |
||||||
|
<uni-forms ref="form" err-show-type="toast"> |
||||||
|
<uni-forms-item> |
||||||
|
<uni-easyinput |
||||||
|
type="textarea" |
||||||
|
autoHeight |
||||||
|
v-model="deviceRepairObj.epInspectionPoint.parMemo" |
||||||
|
placeholder="请输入内容" |
||||||
|
> |
||||||
|
</uni-easyinput> |
||||||
|
</uni-forms-item> |
||||||
|
</uni-forms> |
||||||
|
<view class="photoTitleSize">{{ uploader.length }}/9</view> |
||||||
|
<view class="showImage"> |
||||||
|
<view v-for="(item, i) in uploader" :key="i" class="showImage-for"> |
||||||
|
<view class="view-image"> |
||||||
|
<image :src="item.imageUrl" @tap="previewImage(i)" /> |
||||||
</view> |
</view> |
||||||
<view class="buttonBox"><button class="button" type="primary" |
<view class="view-icon"> |
||||||
:disabled="!(Object.keys(deviceRepairObj).length > 2)" @click="submitClick">提交</button></view> |
<uni-icons |
||||||
</ifrm> |
type="trash" |
||||||
|
size="14" |
||||||
|
color="gray" |
||||||
|
@click="removeScene(item, i)" |
||||||
|
/> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<view class="view-center" v-if="uploader.length < 9"> |
||||||
|
<image src="../../static/images/photo.png" @click="chooseImage()" /> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<view class="buttonBox"> |
||||||
|
<button |
||||||
|
class="button" |
||||||
|
type="primary" |
||||||
|
:disabled="!(Object.keys(deviceRepairObj.epInspectionPoint).length > 2)" |
||||||
|
@click="submitClick" |
||||||
|
> |
||||||
|
提交 |
||||||
|
</button> |
||||||
|
</view> |
||||||
|
</ifrm> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import ifrm from '@/pages/index/ifrm'; |
import ifrm from "@/pages/index/ifrm"; |
||||||
import tTable from '@/components/t-table/t-table.vue'; |
import tTable from "@/components/t-table/t-table.vue"; |
||||||
import tTh from '@/components/t-table/t-th.vue'; |
import tTh from "@/components/t-table/t-th.vue"; |
||||||
import tTr from '@/components/t-table/t-tr.vue'; |
import tTr from "@/components/t-table/t-tr.vue"; |
||||||
import tTd from '@/components/t-table/t-td.vue'; |
import tTd from "@/components/t-table/t-td.vue"; |
||||||
import scan from '../../mixin/scan.js'; |
import scan from "../../mixin/scan.js"; |
||||||
export default { |
import { options } from "@/http/config.js"; |
||||||
mixins: [scan], |
export default { |
||||||
components: { |
mixins: [scan], |
||||||
ifrm, |
components: { |
||||||
tTable, |
ifrm, |
||||||
tTh, |
tTable, |
||||||
tTr, |
tTh, |
||||||
tTd |
tTr, |
||||||
|
tTd, |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
code: "", |
||||||
|
deviceRepairObj: { |
||||||
|
epInspectionPoint: { |
||||||
|
parMemo: "", |
||||||
}, |
}, |
||||||
data() { |
}, |
||||||
return { |
uploader: [], |
||||||
deviceRepairValue: '', |
}; |
||||||
deviceRepairObj: { |
}, |
||||||
epInspectionPoint: {}, |
methods: { |
||||||
parMemo: '' |
chooseImage: async function () { |
||||||
}, |
if (!this.deviceRepairObj.epInspectionPoint.epcId) { |
||||||
uploader: [] |
return uni.showToast({ |
||||||
}; |
title: "请先查询巡检点", |
||||||
|
icon: "none", |
||||||
|
}); |
||||||
|
} |
||||||
|
uni.chooseImage({ |
||||||
|
count: 9, |
||||||
|
// sizeType: ['compressed'], |
||||||
|
// sourceType: ['album', 'camera'], |
||||||
|
success: (res) => { |
||||||
|
uni.showLoading({ |
||||||
|
title: "上传中,请稍候", |
||||||
|
}); |
||||||
|
const server_config = uni.getStorageSync("server-config") |
||||||
|
console.log(999999,server_config) |
||||||
|
res.tempFilePaths.forEach((filePath) => { |
||||||
|
uni.uploadFile({ |
||||||
|
url: |
||||||
|
server_config.rootUrl + |
||||||
|
"/blade-resource/oss/endpoint/put-file-attach", |
||||||
|
filePath: filePath, |
||||||
|
name: "file", |
||||||
|
header: { |
||||||
|
token: "bearer " + uni.getStorageSync("accessToken"), |
||||||
|
"Blade-Auth": "bearer " + uni.getStorageSync("accessToken"), |
||||||
|
"Blade-Requested-With": "BladeHttpRequest", |
||||||
|
}, |
||||||
|
success: (uploadRes) => { |
||||||
|
uni.hideLoading(); |
||||||
|
uni.showToast({ title: "上传成功" }); |
||||||
|
this.uploader.push({ |
||||||
|
upId: JSON.parse(uploadRes.data).data.attachId, |
||||||
|
imageUrl: JSON.parse(uploadRes.data).data.link, |
||||||
|
}); |
||||||
|
}, |
||||||
|
fail: (err) => { |
||||||
|
console.error("❌ 上传失败", err); |
||||||
|
uni.showToast({ title: "上传失败", icon: "none" }); |
||||||
|
}, |
||||||
|
}); |
||||||
|
}); |
||||||
}, |
}, |
||||||
methods: { |
}); |
||||||
|
}, |
||||||
|
previewImage: function (index) { |
||||||
|
var imags = []; |
||||||
|
this.uploader.forEach((item) => { |
||||||
|
imags.push(item.imageUrl); |
||||||
|
}); |
||||||
|
uni.previewImage({ |
||||||
|
current: index, |
||||||
|
urls: imags, |
||||||
|
}); |
||||||
|
}, |
||||||
|
|
||||||
chooseImage: async function() { |
removeScene(item, i) { |
||||||
if (!this.deviceRepairObj.epiId) { |
//删除现场图片 |
||||||
return uni.showToast({ |
this.uploader.splice(i, 1); |
||||||
title: '请先查询巡检点', |
// //删除附件记录 |
||||||
icon: 'none' |
this.$uploadUtil.asyncDelete(item.upId).then((data) => { |
||||||
}); |
uni.showToast({ |
||||||
} |
title: "删除成功", |
||||||
uni.chooseImage({ |
icon: "none", |
||||||
// sourceType: ['album','camera'], //album 从相册选图,camera 使用相机,默认二者都有 |
}); |
||||||
// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
}); |
||||||
count: 9, |
// this.upIdList.splice(this.upIdList.findIndex((upId) => (upId === item.upId)), 1); |
||||||
success: (res) => { |
}, |
||||||
uni.showLoading({ |
|
||||||
title: '上传中,请稍候' |
|
||||||
}); |
|
||||||
var tempFilePaths = res.tempFilePaths; |
|
||||||
for (var i = 0; i < tempFilePaths.length; i++) { |
|
||||||
const file = res.tempFiles[i]; |
|
||||||
this.$uploadUtil.upload(file, { |
|
||||||
theId: this.deviceRepairObj.epiId, |
|
||||||
theTag: 'EpPatrolInspection', |
|
||||||
subTag: 'appDoc' |
|
||||||
}, tempFilePaths[i]).then((upId) => { |
|
||||||
uni.hideLoading(); |
|
||||||
//展示图片 |
|
||||||
this.uploader.push({ |
|
||||||
upId: upId, |
|
||||||
imageUrl: file.path |
|
||||||
}); |
|
||||||
}) |
|
||||||
|
|
||||||
} |
getBarCode(code) { |
||||||
}, |
this.getData(code); |
||||||
complete() { |
}, |
||||||
uni.hideLoading(); |
deviceRepairConfirm(e) { |
||||||
} |
this.getBarCode(e.target.value); |
||||||
}) |
}, |
||||||
}, |
getData(code) { |
||||||
previewImage: function(index) { |
this.code = code; |
||||||
var imags = []; |
this.$u.api |
||||||
this.uploader.forEach(item => { |
.getInspectionBySan({ |
||||||
imags.push(item.imageUrl); |
code: code, |
||||||
}) |
eipType: 1, |
||||||
uni.previewImage({ |
}) |
||||||
current: index, |
.then((res) => { |
||||||
urls: imags |
if (res.data == null) { |
||||||
}) |
return uni.showToast({ |
||||||
}, |
icon: "none", |
||||||
|
title: "此巡检位置暂无任务", |
||||||
removeScene(item, i) { |
}); |
||||||
//删除现场图片 |
} |
||||||
this.uploader.splice(i, 1); |
this.code = ""; |
||||||
// //删除附件记录 |
this.deviceRepairObj.epInspectionPoint = res.data; |
||||||
this.$uploadUtil.asyncDelete(item.upId).then((data) => { |
uni.showToast({ |
||||||
uni.showToast({ |
title: "数据获取成功", |
||||||
title: '删除成功', |
}); |
||||||
icon: 'none' |
}); |
||||||
}); |
}, |
||||||
}) |
submitClick() { |
||||||
// this.upIdList.splice(this.upIdList.findIndex((upId) => (upId === item.upId)), 1); |
this.$u.api |
||||||
}, |
.savePatrolIns({ |
||||||
|
...this.deviceRepairObj.epInspectionPoint, |
||||||
getBarCode(code) { |
path: this.uploader.map((item) => item.imageUrl).join(","), |
||||||
this.getData(code); |
}) |
||||||
}, |
.then((data) => { |
||||||
deviceRepairConfirm(e) { |
uni.showToast({ |
||||||
this.getBarCode(e.target.value); |
title: "保存成功", |
||||||
}, |
}); |
||||||
getData(code) { |
this.code = ""; |
||||||
this.deviceRepairValue = code; |
this.deviceRepairObj = { |
||||||
this.$ajax.request({ |
epInspectionPoint: {}, |
||||||
url: 'pdaLoad/getInspectionBySan', |
}; |
||||||
method: 'POST', |
this.uploader = []; |
||||||
data: { |
}); |
||||||
code: code, |
}, |
||||||
eipType: 1 |
}, |
||||||
}, |
onNavigationBarButtonTap(btn) { |
||||||
success: data => { |
this.$refs.ifrm.topMenuClick(btn); |
||||||
if (data == null) { |
}, |
||||||
return uni.showToast({ |
onShow() {}, |
||||||
icon: "none", |
}; |
||||||
title: '此巡检位置暂无任务' |
|
||||||
}); |
|
||||||
} |
|
||||||
this.deviceRepairValue = ''; |
|
||||||
this.deviceRepairObj = data; |
|
||||||
uni.showToast({ |
|
||||||
title: '数据获取成功' |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
submitClick() { |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'pdaSave/savePatrolIns', |
|
||||||
method: 'POST', |
|
||||||
data: this.deviceRepairObj, |
|
||||||
success: data => { |
|
||||||
uni.showToast({ |
|
||||||
title: '保存成功' |
|
||||||
}); |
|
||||||
this.deviceRepairValue = ''; |
|
||||||
this.deviceRepairObj = { |
|
||||||
epInspectionPoint: {}, |
|
||||||
parMemo: '' |
|
||||||
}; |
|
||||||
this.uploader = [] |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
}, |
|
||||||
onNavigationBarButtonTap(btn) { |
|
||||||
this.$refs.ifrm.topMenuClick(btn); |
|
||||||
}, |
|
||||||
onShow() {} |
|
||||||
}; |
|
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped lang="less"> |
<style scoped lang="less"> |
||||||
.uni-forms-item { |
.uni-forms-item { |
||||||
margin-bottom: 6px !important; |
margin-bottom: 6px !important; |
||||||
} |
} |
||||||
|
|
||||||
.photoTitleSize { |
.photoTitleSize { |
||||||
color: #a1a1a1; |
color: #a1a1a1; |
||||||
text-align: right; |
text-align: right; |
||||||
margin-right: 30rpx; |
margin-right: 30rpx; |
||||||
margin-top: -30rpx; |
margin-top: -30rpx; |
||||||
} |
} |
||||||
|
|
||||||
.showImage { |
|
||||||
display: flex; |
|
||||||
flex-direction: row; |
|
||||||
justify-content: flex-start; |
|
||||||
flex-wrap: wrap; |
|
||||||
margin-left: -20rpx; |
|
||||||
|
|
||||||
.showImage-for { |
.showImage { |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
justify-content: flex-start; |
||||||
|
flex-wrap: wrap; |
||||||
|
margin-left: -20rpx; |
||||||
|
|
||||||
display: flex; |
.showImage-for { |
||||||
flex-direction: column; |
display: flex; |
||||||
width: 200rpx; |
flex-direction: column; |
||||||
margin-left: 30rpx; |
width: 200rpx; |
||||||
height: 260rpx; |
margin-left: 30rpx; |
||||||
|
height: 260rpx; |
||||||
|
|
||||||
.view-icon { |
.view-icon { |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: row; |
flex-direction: row; |
||||||
justify-content: center; |
justify-content: center; |
||||||
margin-top: -10rpx; |
margin-top: -10rpx; |
||||||
} |
} |
||||||
|
|
||||||
image { |
image { |
||||||
border-width: 2rpx; |
border-width: 2rpx; |
||||||
border-color: rgb(229, 229, 229); |
border-color: rgb(229, 229, 229); |
||||||
border-style: solid; |
border-style: solid; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
width: 190rpx; |
width: 190rpx; |
||||||
height: 190rpx; |
height: 190rpx; |
||||||
} |
|
||||||
} |
|
||||||
} |
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
.view-center { |
.view-center { |
||||||
margin: 0rpx 25rpx; |
margin: 0rpx 25rpx; |
||||||
|
|
||||||
image { |
image { |
||||||
border-width: 2rpx; |
border-width: 2rpx; |
||||||
border-color: rgb(229, 229, 229); |
border-color: rgb(229, 229, 229); |
||||||
border-style: solid; |
border-style: solid; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
width: 190rpx; |
width: 190rpx; |
||||||
height: 190rpx; |
height: 190rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
Loading…
Reference in new issue