feat:分析值保留两位有效数字计算
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-sticky>
|
||||
<navbar-back title="点检">
|
||||
<navbar-back title="设备巡检">
|
||||
<up-button
|
||||
v-if="detailInfo.id"
|
||||
type="primary"
|
||||
:plain="true"
|
||||
icon="list"
|
||||
size="small"
|
||||
text="设备点检记录"
|
||||
text="设备巡检记录"
|
||||
@click="handleCheckRecord"
|
||||
></up-button>
|
||||
</navbar-back>
|
||||
@@ -16,18 +16,19 @@
|
||||
<view class="container">
|
||||
<n-scanTemp
|
||||
v-if="!detailInfo.id"
|
||||
title="请扫描设备条码进行点检"
|
||||
title="请扫描设备条码进行巡检"
|
||||
icon="dailyCheck"
|
||||
@deviceId="id => getDailyCheckRecord(id)"
|
||||
@scanResult="result => handleScanResult(result)"
|
||||
/>
|
||||
<view v-else class="content">
|
||||
<view>
|
||||
<uni-section titleFontSize="22px" type="line" title="设备点检信息">
|
||||
<uni-section titleFontSize="22px" type="line" title="设备巡检信息">
|
||||
<template v-slot:right>
|
||||
<up-button
|
||||
v-if="detailInfo.submitFlag == '1'"
|
||||
type="success"
|
||||
text="新建点检"
|
||||
text="新建巡检"
|
||||
@click="handleCreateDailyCheck"
|
||||
></up-button>
|
||||
</template>
|
||||
@@ -43,7 +44,7 @@
|
||||
<view>
|
||||
<uni-section titleFontSize="22px" type="line" title="检查项"> </uni-section>
|
||||
<up-row class="p10 font-bold" style="background-color: #f5f5f5">
|
||||
<up-col span="4">点检项目</up-col>
|
||||
<up-col span="4">巡检项目</up-col>
|
||||
<up-col span="3">检查标准</up-col>
|
||||
<up-col span="2"> 频次</up-col>
|
||||
<up-col style="text-align: center" span="3">是否正常</up-col>
|
||||
@@ -75,10 +76,10 @@
|
||||
<up-textarea v-model="detailInfo.content" placeholder="请输入内容"></up-textarea>
|
||||
<view class="p10">附件照片:</view>
|
||||
<n-upload v-model="detailInfo.attachment" />
|
||||
<view class="p10">点检人:</view>
|
||||
<view class="p10">巡检人:</view>
|
||||
<up-input v-model="detailInfo.checkUserName"></up-input>
|
||||
<view v-if="detailInfo.submitFlag == '1'">
|
||||
<view class="p10">点检日期:</view>
|
||||
<view class="p10">巡检日期:</view>
|
||||
<uni-datetime-picker type="datetime" v-model="detailInfo.checkDate" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -129,32 +130,37 @@ const { lockOrientation } = useScreenOrientation()
|
||||
|
||||
const pageLoading = ref(false)
|
||||
let detailInfo = ref({})
|
||||
|
||||
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||
watch(scanQRInfo, newVal => {
|
||||
if (newVal && nx.$router.getCurrentPage().route == 'pages/device/deviceBusDailyCheck/index') {
|
||||
try {
|
||||
const codeObj = JSON.parse(newVal)
|
||||
if (!pageLoading.value) {
|
||||
getDailyCheckRecord(codeObj.id)
|
||||
}
|
||||
scanQRInfo.value = ''
|
||||
} catch (error) {
|
||||
scanQRInfo.value = ''
|
||||
uni.showToast({
|
||||
title: '请扫描设备码',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
function handleScanResult(result) {
|
||||
const codeObj = JSON.parse(result)
|
||||
if (!pageLoading.value) {
|
||||
getDailyCheckRecord(codeObj.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
// const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||
// watch(scanQRInfo, newVal => {
|
||||
// if (newVal && nx.$router.getCurrentPage().route == 'pages/device/deviceBusDailyCheck/index') {
|
||||
// try {
|
||||
// const codeObj = JSON.parse(newVal)
|
||||
// if (!pageLoading.value) {
|
||||
// getDailyCheckRecord(codeObj.id)
|
||||
// }
|
||||
// scanQRInfo.value = ''
|
||||
// } catch (error) {
|
||||
// scanQRInfo.value = ''
|
||||
// uni.showToast({
|
||||
// title: '请扫描设备码',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
const modalText = computed(() => {
|
||||
return `确定${modalType.value == '0' ? '暂存' : '提交'}吗?${modalType.value == '0' ? '' : '提交后不能修改'} `
|
||||
})
|
||||
onShow(() => {
|
||||
scanQRInfo.value = ''
|
||||
})
|
||||
let goBack = ref(false)
|
||||
// onShow(() => {
|
||||
// scanQRInfo.value = ''
|
||||
// })
|
||||
let goBack = ref(false) //设备使用前进行点检操作标记
|
||||
onLoad(options => {
|
||||
if (options.deviceId) {
|
||||
goBack.value = true
|
||||
@@ -211,7 +217,7 @@ function handleSubmit(type) {
|
||||
}
|
||||
if (!detailInfo.value.checkUserName) {
|
||||
return uni.showToast({
|
||||
title: '请输入点检人',
|
||||
title: '请输入巡检人',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -246,11 +252,11 @@ function handleCheckRecord() {
|
||||
nx.$store('biz').deviceInfo = deviceInfo
|
||||
nx.$router.go('/pages/device/deviceBusDailyCheck/list')
|
||||
}
|
||||
// 新建点检
|
||||
// 新建巡检
|
||||
function handleCreateDailyCheck() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定新建点检吗?',
|
||||
content: '确定新建巡检吗?',
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
const res = await dailyCheckApi.createDailyCheck({
|
||||
|
||||
Reference in New Issue
Block a user