浏览代码

瓦斯巡检,光钎测温详情修改-提交

lxh 3 月之前
父节点
当前提交
12e91eca31

+ 28 - 10
src/views/vent/gas/gasInspect/components/inspectEdit.vue

@@ -6,8 +6,8 @@
                 <a-input v-model:value="formStateEdit.id" disabled />
             </a-form-item>
             <a-form-item label="瓦斯巡检地点:">
-                <a-select ref="select" v-model:value="formStateEdit.strInstallPos" placeholder="请选择...">
-                    <a-select-option v-for="(item, index) in addressList" :key="index">{{ item.label
+                <a-select ref="select" v-model:value="formStateEdit.strInstallPos" placeholder="请选择..." @change="changeAddress">
+                    <a-select-option v-for="(item, index) in addressList" :key="item.value">{{ item.label
                         }}</a-select-option>
                 </a-select>
             </a-form-item>
@@ -31,7 +31,7 @@
 <script setup lang="ts">
 import { ref, reactive, onMounted, watch } from 'vue'
 import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
-import { queryAllDisTeam } from '../gasInspect.api'
+import { queryAllDisTeam,getAllGasIns } from '../gasInspect.api'
 
 let props = defineProps({
     inspectEditData: {
@@ -47,11 +47,9 @@ let formStateEdit = reactive<any>({
     strInstallPos: '',
     disTeamId: '',
     insType: '',
+    deviceId:''
 })
-let addressList = ref<any[]>([//监测地点下拉选项列表
-    // { label: '地址1', value: '1' },
-    // { label: '地址2', value: '2' },
-])
+let addressList = ref<any[]>([])//监测地点下拉选项列表
 let qdList = ref<any[]>([])//区队下拉选项列表
 let $emit = defineEmits(['confirmEdit', 'cancelEdit'])
 
@@ -68,6 +66,25 @@ async function queryAllDisTeamList() {
         })
     }
 }
+//获取所有巡检地址
+async function getAllGasInsList(){
+    let res=await getAllGasIns()
+    console.log(res,'所有巡检地点---------')
+    if(res.length!=0){
+        addressList.value=res.map(el=>{
+            return {
+                label:el.strinstallpos,
+                value:el.strinstallpos,
+                deviceId: el.id,
+            }
+        })
+    }
+}
+//巡检地址选项切换
+let changeAddress=(val)=>{
+    formStateEdit.deviceId=addressList.value.filter(v=>v.value==val)[0].deviceId
+    formStateEdit.strInstallPos=val
+}
 //编辑提交
 let confirmEdit = () => {
     $emit('confirmEdit', formStateEdit)
@@ -79,15 +96,16 @@ let cancelEdit = () => {
         strInstallPos: '',
         disTeamId: '',
         insType: '',
+        deviceId:''
     }
     $emit('cancelEdit',)
 }
 watch(() => props.inspectEditData, (newV, oldV) => {
     formStateEdit = Object.assign({}, newV)
-}, { immediate: true })
-onMounted(() => {
+    getAllGasInsList()
     queryAllDisTeamList()
-})
+}, { immediate: true })
+onMounted(() => {})
 </script>
 
 <style lang="less" scoped>

+ 1 - 1
src/views/vent/gas/gasInspect/components/uploadOrdown.vue

@@ -72,7 +72,7 @@ let handlerComfirm = () => {
 //取消
 let handlerCancel = () => {
     formState.insType = ''
-    $emit('handlerCancel', formState)
+    $emit('handlerCancel')
 }
 </script>
 

+ 8 - 3
src/views/vent/gas/gasInspect/gasInspect.api.ts

@@ -3,7 +3,7 @@ import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
     list = '/safety/gasInsCard/list',//通过id(巡检卡id)查询
-    importByExcel='/safety/gasDayReport/importByExcel',//导入瓦斯巡检地址
+    importByExcel='/safety/gasDayReport/importGasInsCard',//导入瓦斯巡检地址
     exportGasByExcel='/safety/gasDayReport/exportGasByExcel',//导出瓦斯巡检地址
     queryAllDisTeam='/safety/disTeamInfo/queryAllDisTeam',//查询所有区队
     moveOrderNum='/safety/gasInsCard/moveOrderNum',//上下移接口
@@ -11,7 +11,8 @@ enum Api {
     deleteCard='/safety/gasInsCard/delete',//瓦斯巡检卡删除
     taskSubmit='/safety/disTeamInfo/edit',//任务管理下发
     clearCardInfo='/safety/gasInsCard/clearCard',//瓦斯巡检卡信息删除
-    getAllUserInfo='/safety/gasInsCard/getAllUserInfo'//获取早中晚班巡检员列表
+    getAllUserInfo='/safety/gasInsCard/getAllUserInfo',//获取早中晚班巡检员列表
+    getAllGasIns='/safety/gasIns/getAllGasIns'//获取所有巡检地址
 
 }
 
@@ -70,4 +71,8 @@ export const getAllUserInfo = () => defHttp.get({ url: Api.getAllUserInfo, });
  * 任务管理下发
  * @param params 
  */
-export const taskSubmit = (params) => defHttp.post({ url: Api.taskSubmit,params });
+export const taskSubmit = (params) => defHttp.post({ url: Api.taskSubmit,params });
+/**
+ * 获取所有巡检地址
+ */
+export const getAllGasIns = () => defHttp.get({ url: Api.getAllGasIns, });

+ 25 - 17
src/views/vent/gas/gasInspect/index.vue

@@ -154,6 +154,7 @@ let handlerEdit = (record) => {
 async function confirmEdit(param) {
     let res = await edit({ ...param })
     if (res) {
+        visibleEdit.value = false
         queryByIdList()
     }
 }
@@ -197,11 +198,11 @@ async function queryByIdList() {
     let res = await list({ id: searchId.value, pageNo: pagination.current, pageSize: pagination.pageSize })
     console.log(res, '列表查询---')
     pagination.current = 1
-    tableData.value = res.records.map((el:any)=>{
+    tableData.value = res.records.map((el: any) => {
         return {
-            morning:el.insType,
-            afterNoon:el.insType,
-            evening:el.insType,
+            morning: el.insType,
+            afterNoon: el.insType,
+            evening: el.insType,
             ...el
         }
     })
@@ -224,12 +225,24 @@ let getupload = () => {
 }
 //确定导入
 async function handlerComfirm(param) {
-    let res = await importByExcel(param)
-    if (res.code == 200) {
-        visibleUploadorDown.value = false
-        message.success('导入成功')
-        queryByIdList()
+    if (modalType.value == 'upload') {
+        let res = await importByExcel(param)
+        if (res.code == 200) {
+            visibleUploadorDown.value = false
+            message.success('导入成功')
+            queryByIdList()
+        }
+    } else {
+        let res = await exportGasByExcel({ insType: param.insType })
+        console.log(res, '导出数据')
+        if (res) {
+            let filename = `${new Date().getTime()}.xlsx`;
+            downFilePublic(res, filename);
+            visibleUploadorDown.value = false
+            message.success('导出成功')
+        }
     }
+
 }
 //导出
 let getdownload = () => {
@@ -237,14 +250,9 @@ let getdownload = () => {
     visibleUploadorDown.value = true
     titleUploadorDown.value = '导出'
 }
-//确定导出
-async function handlerCancel(param) {
-    let res = await exportGasByExcel({ insType: param.insType })
-    console.log(res, '导出数据')
-    if (res) {
-        let filename = '111.xlsx';
-        downFilePublic(res, filename);
-    }
+//导入/导出取消
+let handlerCancel = () => {
+    visibleUploadorDown.value = false
 }
 // 下载公用方法
 function downFilePublic(content, fileName) {

+ 2 - 2
src/views/vent/gas/gasInspectNonfc/gasInspectNonfc.api.ts

@@ -3,8 +3,8 @@ import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
     list = '/safety/gasIns/list',//通过id(巡检卡id)查询
-    importByExcel='/safety/gasDayReport/importByExcel',//导入瓦斯巡检地址
-    exportGasByExcel='/safety/gasDayReport/exportGasByExcel',//导出瓦斯巡检地址
+    importByExcel='/safety/gasDayReport/importGasIns',//导入瓦斯巡检地址
+    exportGasByExcel='/safety/gasDayReport/exportGasIns',//导出瓦斯巡检地址
     queryAllDisTeam='/safety/disTeamInfo/queryAllDisTeam',//查询所有区队
     moveOrderNum='/safety/gasIns/moveOrderNum',//上下移接口
     edit='/safety/gasIns/edit',//瓦斯巡检地点编辑

+ 18 - 12
src/views/vent/gas/gasInspectNonfc/index.vue

@@ -47,7 +47,7 @@
                 <template #action="{ record }">
                     <a class="table-action-link" @click="handlerEdit(record)">编辑</a>
                     <a-popconfirm title="删除内容无法恢复,是否删除" ok-text="确定" cancel-text="取消"
-                        @confirm="handleDelCardInfo(record)" >
+                        @confirm="handleDelCardInfo(record)">
                         <a class="table-action-link">删除</a>
                     </a-popconfirm>
                     <a class="table-action-link" @click="moveUp(record)">上移</a>
@@ -200,12 +200,23 @@ let getupload = () => {
 }
 //确定导入
 async function handlerComfirm(param) {
-    let res = await importByExcel(param)
-    if (res.code == 200) {
-        visibleUploadorDown.value = false
-        message.success('导入成功')
-        queryByIdList()
+    if (modalType.value == 'upload') {
+        let res = await importByExcel(param)
+        if (res.code == 200) {
+            visibleUploadorDown.value = false
+            message.success('导入成功')
+            queryByIdList()
+        }
+    } else {
+        let res = await exportGasByExcel({ insType: param.insType })
+        console.log(res, '导出数据')
+        if (res) {
+            let filename = `${new Date().getTime()}.xlsx`;
+            downFilePublic(res, filename);
+            message.success('导出成功')
+        }
     }
+
 }
 //导出
 let getdownload = () => {
@@ -215,12 +226,7 @@ let getdownload = () => {
 }
 //确定导出
 async function handlerCancel(param) {
-    let res = await exportGasByExcel({ insType: param.insType })
-    console.log(res, '导出数据')
-    if (res) {
-        let filename = '111.xlsx';
-        downFilePublic(res, filename);
-    }
+    modalType.value =''
 }
 // 下载公用方法
 function downFilePublic(content, fileName) {

+ 3 - 3
src/views/vent/monitorManager/deviceMonitor/components/device/modal/fiber.modal-Gx.vue

@@ -38,7 +38,7 @@
             <div class="item-container">
               <div class="title">最高温度位置</div>
               <div class="value">{{ posMonitor.highposition !== undefined && posMonitor.highposition !== null ?
-                posMonitor.highposition : '-' }} </div>
+                posMonitor.highposition : '-' }} <span>m</span></div>
             </div>
           </div>
           <div class="top-item">
@@ -72,7 +72,7 @@
             <div class="item-container">
               <div class="title">报警位置</div>
               <div class="value">{{ posMonitor.warnposition !== undefined && posMonitor.warnposition !== null ? posMonitor.warnposition : '-'
-                }} </div>
+                }} <span>m</span></div>
             </div>
           </div>
 
@@ -129,7 +129,7 @@ export default defineComponent({
     };
 
     const chartsColumns = chartsColumnListGx;
-    const xAxisPropType = ref('highposition');
+    const xAxisPropType = ref('time');
     const [register, { setModalProps, closeModal }] = useModalInner();