From cefcb88c6cd0690052e503d5f1c943cb7f8a03cb Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期三, 30 十一月 2022 09:18:32 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/gtqt
---
src/views/intellectInspect/inspectIndex/components/inspectRecordDialog.vue | 82 +++++++++++++++++++++++++++++++++++------
1 files changed, 70 insertions(+), 12 deletions(-)
diff --git a/src/views/intellectInspect/inspectIndex/components/inspectRecordDialog.vue b/src/views/intellectInspect/inspectIndex/components/inspectRecordDialog.vue
index b199964..02fdd0a 100644
--- a/src/views/intellectInspect/inspectIndex/components/inspectRecordDialog.vue
+++ b/src/views/intellectInspect/inspectIndex/components/inspectRecordDialog.vue
@@ -17,14 +17,19 @@
</el-col>
<el-col :span="12" style="margin-bottom: 20px">
<el-form-item label="巡检部门" prop="execDepId">
- <el-cascader @change="giveClassGroup" :disabled="!inspectPointConfirm" placeholder="请选择巡检部门" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" clearable filterable class="input-add" v-model="inspectTaskForm.execDepId"> </el-cascader>
+ <el-cascader @change="giveClassGroup" :disabled="!inspectPointConfirm" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" clearable filterable class="input-add" v-model="inspectTaskForm.execDepId"> </el-cascader>
</el-form-item>
</el-col>
<el-col :span="12" style="margin-bottom: 20px">
<el-form-item label="巡检班组" prop="execClassgroupId">
- <el-select v-model="inspectTaskForm.execClassgroupId" :disabled="!inspectPointConfirm" placeholder="请选择巡检班组" class="input-add">
+ <el-select v-model="inspectTaskForm.execClassgroupId" :disabled="!inspectPointConfirm" class="input-add">
<el-option v-for="item in classGroup" :key="item.id" :value="item.id" :label="item.groupName"></el-option>
</el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12" style="margin-bottom: 20px">
+ <el-form-item label="巡检人" prop="execUserName">
+ <el-input v-model="inspectTaskForm.execUserName" :disabled="!inspectPointConfirm" class="input-add"> </el-input>
</el-form-item>
</el-col>
<el-col :span="12" style="margin-bottom: 20px">
@@ -38,16 +43,35 @@
<el-tabs class="active" v-model="activeName">
<el-tab-pane label="巡检链" name="inspectChain">
<el-table :data="inspectTaskForm.points" fit style="width: 100%">
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column prop="region" label="巡检点" show-overflow-tooltip align="center"></el-table-column>
+ <el-table-column type="index" label="序号" />
+ <el-table-column prop="point" label="巡检点" show-overflow-tooltip align="center"></el-table-column>
+ <el-table-column prop="region" label="所属设备" show-overflow-tooltip align="center"></el-table-column>
+ <el-table-column prop="rfid" label="RFID" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="quotaContent" label="指标作业" show-overflow-tooltip align="center"></el-table-column>
+ <el-table-column prop="secondReferenceResult" label="记录值" show-overflow-tooltip align="center">
+ <template #default="scope">
+ <div :style="{ color: scope.row.reportResult == 1 ? '#ff0000' : '#409eff' }">
+ {{ scope.row.dataReportType == 1 ? '无' : scope.row.secondReferenceResult }}
+ </div>
+ </template>
+ </el-table-column>
<el-table-column prop="quotaUnit" label="指标单位" show-overflow-tooltip align="center"></el-table-column>
+ <el-table-column prop="reportResult" label="结果" show-overflow-tooltip align="center">
+ <template #default="scope">
+ <div :style="{ color: scope.row.reportResult == 1 ? '#ff0000' : '#409eff' }">
+ {{ scope.row.reportResult == 0 ? '正常' : scope.row.reportResult == 1 ? '存在异常' : '无' }}
+ </div>
+ </template>
+ </el-table-column>
<!-- <el-table-column label="操作" width="150" align="center">-->
<!-- <template #default="scope">-->
<!-- <el-button size="small" text type="danger" @click="onDelCheckUnit(scope.$index, scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
+ </el-tab-pane>
+ <el-tab-pane label="统计数据" name="allData">
+ <sum-data :sumData="taskAndQuotas"></sum-data>
</el-tab-pane>
</el-tabs>
</div>
@@ -61,7 +85,7 @@
</template>
<script lang="ts">
-import { reactive, toRefs, ref } from 'vue';
+import { toRefs, reactive, defineComponent, ref, onMounted, defineAsyncComponent } from 'vue';
import { RFIDApi } from '/@/api/intellectInspectSystem/RFID';
import { ElMessage } from 'element-plus/es';
import { inspectTaskApi } from '/@/api/intellectInspectSystem/inspectTask';
@@ -69,6 +93,7 @@
import { inspectRecordApi } from '/@/api/intellectInspectSystem/inspectRecord';
interface dataState {
title: string;
+ taskAndQuotas: [];
pointTitle: string;
activeName: string;
inspectPointConfirm: boolean;
@@ -79,6 +104,7 @@
execClassgroupId: number | null;
execDepId: number | null;
id: number | null;
+ execUserName: string;
startTime: string | null;
taskName: string | null;
taskType: number | null;
@@ -126,6 +152,8 @@
rfidId: number | null;
quotaId: number | null;
quotaUnit: string | null;
+ reportResult: number | null;
+ secondReferenceResult: number | null;
execSequence: number | null;
dataReportType: number | null;
firstReferenceValue: number | null;
@@ -134,12 +162,16 @@
thirdReferenceSign: number | null;
thirdReferenceValue: number | null;
}
-export default {
+export default defineComponent({
name: 'inspectTaskDialog',
+ components: {
+ SumData: defineAsyncComponent(() => import('/@/views/intellectInspect/inspectIndex/components/sum.vue'))
+ },
setup(props: any, context: any) {
const inspectTaskFormRef = ref();
const data = reactive<dataState>({
title: '',
+ taskAndQuotas: [],
pointTitle: '',
activeName: 'inspectChain',
inspectPointConfirm: false,
@@ -157,6 +189,8 @@
quotaId: null,
quotaUnit: null,
execSequence: null,
+ secondReferenceResult: null,
+ reportResult: null,
dataReportType: null,
firstReferenceValue: null,
secondReferenceSign: null,
@@ -169,6 +203,7 @@
execDepId: null,
id: null,
points: [],
+ execUserName: '',
startTime: null,
taskName: null,
taskType: null,
@@ -188,7 +223,7 @@
],
firstReferenceValueList: [
{ id: 0, name: '正常' },
- { id: 1, name: '异常' }
+ { id: 1, name: '存在异常' }
],
secondReferenceSignList: [
{ id: 1, name: '>' },
@@ -215,7 +250,9 @@
rfidId: null,
quotaId: null,
quotaUnit: null,
+ reportResult: null,
execSequence: null,
+ secondReferenceResult: null,
dataReportType: null,
firstReferenceValue: null,
secondReferenceSign: null,
@@ -229,7 +266,7 @@
}
};
- const showInspectRecordDialog = (type: string, item: { id: number; uuid: string }, workTypeList: [], department: [], timeType: [], classGroupList: [], quotaList: [], inspectPointAllList: []) => {
+ const showInspectRecordDialog = (type: string, item: { id: number; uuid: string; execUserName: string }, workTypeList: [], department: [], timeType: [], classGroupList: [], quotaList: [], inspectPointAllList: []) => {
data.quotaList = JSON.parse(JSON.stringify(quotaList));
data.timeList = JSON.parse(JSON.stringify(timeType));
data.inspectPointAllList = JSON.parse(JSON.stringify(inspectPointAllList));
@@ -238,7 +275,8 @@
data.classGroupList = JSON.parse(JSON.stringify(classGroupList));
data.ifShowInspectTaskDialog = true;
data.inspectPointConfirm = false;
- data.title = '查看巡检任务';
+ data.title = '查看巡检记录';
+ getSum(item.id);
inspectRecordApi()
.getInspectRecordById({ id: item.id, uuid: item.uuid })
.then((res) => {
@@ -246,10 +284,29 @@
data.inspectTaskForm.execDepId = res.data.data.execDepId;
giveClassGroup();
data.inspectTaskForm = JSON.parse(JSON.stringify(res.data.data));
+ data.inspectTaskForm.execUserName = item.execUserName;
} else {
}
})
.catch((error) => {});
+ };
+
+ // 格式化表格数据
+ // const toRefer =(row, column, cellValue, index)=>{
+ // return row.secondReferenceResult==0?'正常':(row.reportResult==1?'异常':'无')
+ // }
+
+ const getSum = async (id: number) => {
+ let res = await inspectRecordApi().getInspectRecordSum({ id: id });
+ if (res.data.code === '200') {
+ data.taskAndQuotas = JSON.parse(JSON.stringify(res.data.data.taskAndQuotas));
+ console.log(data.taskAndQuotas, '666666666666');
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
};
const submitInspectPoint = async () => {
@@ -340,7 +397,6 @@
const giveQuotaUnit = () => {
data.inspectPointForm.quotaUnit = data.quotaList.find((item) => item.id === data.inspectPointForm.quotaId)?.unit as string;
};
-
const submitInspectTask = () => {
inspectTaskFormRef.value.validate(async (valid: Boolean) => {
if (valid) {
@@ -390,6 +446,8 @@
...toRefs(data),
inspectTaskFormRef,
deleteFlow,
+ getSum,
+ // toRefer,
giveQuotaUnit,
giveClassGroup,
submitInspectTask,
@@ -399,13 +457,13 @@
openInspectPointDialog
};
}
-};
+});
</script>
<style scoped lang="scss">
$homeNavLengh: 8;
.home-container {
- height: calc(100vh - 114px);
+ height: calc(100vh - 144px);
box-sizing: border-box;
overflow: hidden;
.homeCard {
--
Gitblit v1.9.2