Browse Source

[Wip 0000] 瓦斯巡检特定版

houzekong 3 days ago
parent
commit
4a4e954603

+ 7 - 1
src/views/vent/gas/gasInspect/gasInspect.api.ts

@@ -20,6 +20,7 @@ enum Api {
   taskDetailsList = '/safety/gasDayReport/taskDetailsList', // 瓦斯巡检任务明细列表分页查询
   zipdownload = '/ventanaly-sharefile/fileServer/zipdownload',
   operateGasCheckTaskDetail = '/safety/gasDayReport/operateGasCheckTaskDetail',
+  getManageTasklist = '/safety/gasDayReport/getManageTasklist',
 }
 
 /**
@@ -110,7 +111,12 @@ export const deleteTeam = (params) => defHttp.delete({ url: Api.deleteTeam, para
  */
 export const taskDetailsList = (params) => defHttp.get({ url: Api.taskDetailsList, params });
 /**
- * 瓦斯巡检任务明细列表新增与删除
+ * 瓦斯巡检任务明细列表
  * @param params
  */
 export const operateGasCheckTaskDetail = (params) => defHttp.post({ url: Api.operateGasCheckTaskDetail, params });
+/**
+ * 瓦斯巡检任务明细管理列表
+ * @param params
+ */
+export const getManageTasklist = (params) => defHttp.post({ url: Api.getManageTasklist, params });

+ 14 - 14
src/views/vent/gas/gasInspect/gasInspect.data.ts

@@ -235,6 +235,18 @@ export const taskColumns: BasicColumn[] = [
     align: 'center',
   },
   {
+    title: '总巡检数',
+    dataIndex: 'totalCheckNum',
+    key: 'totalCheckNum',
+    align: 'center',
+  },
+  {
+    title: '未巡检数',
+    dataIndex: 'missCheckNum',
+    key: 'missCheckNum',
+    align: 'center',
+  },
+  {
     title: '创建人',
     dataIndex: 'createBy',
     key: 'createBy',
@@ -307,8 +319,8 @@ export const taskDetailsColumns: BasicColumn[] = [
   },
   {
     title: 'ID',
-    dataIndex: 'id',
-    key: 'id',
+    dataIndex: 'deviceId',
+    key: 'deviceId',
     align: 'center',
   },
   {
@@ -336,18 +348,6 @@ export const taskDetailsColumns: BasicColumn[] = [
     align: 'center',
   },
   {
-    title: '总巡检数',
-    dataIndex: 'totalCheckNum',
-    key: 'totalCheckNum',
-    align: 'center',
-  },
-  {
-    title: '未巡检数',
-    dataIndex: 'missCheckNum',
-    key: 'missCheckNum',
-    align: 'center',
-  },
-  {
     title: '已关联当前任务',
     dataIndex: 'isSelect',
     key: 'isSelect',

+ 7 - 20
src/views/vent/gas/gasInspect/index2.vue

@@ -19,7 +19,7 @@
       <BasicModal title="任务表单" @register="registerModal1" @ok="handleSubmit">
         <BasicForm @register="registerForm" />
       </BasicModal>
-      <BasicModal title="任务详情列表" :width="1200" @register="registerModal2">
+      <BasicModal title="任务详情列表" :show-cancel-btn="false" :width="1200" @register="registerModal2">
         <BasicTable @register="registerTable2">
           <!-- <template #action="{ record }"> </template> -->
           <template #bodyCell="{ column, text }">
@@ -42,10 +42,10 @@
           </template>
         </BasicTable>
       </BasicModal>
-      <BasicModal :width="1200" @register="registerModal3">
+      <BasicModal :width="1200" :show-cancel-btn="false" @register="registerModal3">
         <a-space class="search-area mb-10px">
           <a-popconfirm title="确认操作" ok-text="确定" cancel-text="取消" @confirm="handlePatch('add')">
-            <a-button type="primary" preIcon="ant-design:plus-outlined">新增</a-button>
+            <a-button type="primary" preIcon="ant-design:plus-outlined">添加</a-button>
           </a-popconfirm>
           <a-popconfirm title="删除内容无法取消,是否删除" ok-text="确定" cancel-text="取消" @confirm="handlePatch('del')">
             <a-button type="primary" preIcon="ant-design:close-outlined">删除</a-button>
@@ -81,7 +81,7 @@
   import { ref, onMounted, nextTick } from 'vue';
   import customHeader from '/@/components/vent/customHeader.vue';
   import { taskColumns, pagination, taskschemas, taskDetailsColumns } from './gasInspect.data';
-  import { deleteTeam, operateGasCheckTaskDetail, taskDetailsList, teamAdd, teamEdit, teamList } from './gasInspect.api';
+  import { deleteTeam, getManageTasklist, operateGasCheckTaskDetail, taskDetailsList, teamAdd, teamEdit, teamList } from './gasInspect.api';
   import { BasicTable } from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage';
   import { message } from 'ant-design-vue';
@@ -110,12 +110,6 @@
   const { tableContext: tx2 } = useListPage({
     tableProps: {
       api: taskDetailsList,
-      beforeFetch: (data) => {
-        return {
-          ...data,
-          taskId: selectedRow.value.id,
-        };
-      },
       columns: taskDetailsColumns,
       pagination,
       showActionColumn: false,
@@ -127,19 +121,12 @@
   // 任务管理列表
   const { tableContext: tx3 } = useListPage({
     tableProps: {
-      api: taskDetailsList,
-      beforeFetch: (data) => {
-        return {
-          ...data,
-          taskId: selectedRow.value.id,
-        };
-      },
+      api: () => getManageTasklist({ taskId: selectedRow.value.id }).then((r) => r.map((e, i) => ({ id: i, ...e }))),
       rowSelection: {
         type: 'checkbox',
         getCheckboxProps: (record) => {
           return {
             disabled: record.isOtherSelect,
-            name: record.id,
           };
         },
       },
@@ -153,7 +140,7 @@
   });
   const [registerTable1, tableContext1] = tx1;
   const [registerTable2] = tx2;
-  const [registerTable3, { getSelectRows, reload }, { rowSelection }] = tx3;
+  const [registerTable3, { reload }, { rowSelection, selectedRows }] = tx3;
   const [registerModal1, modalContext1] = useModal();
   const [registerModal2, modalContext2] = useModal();
   const [registerModal3, modalContext3] = useModal();
@@ -197,7 +184,7 @@
   function handlePatch(mode) {
     operateGasCheckTaskDetail({
       taskId: selectedRow.value.id,
-      operateList: getSelectRows().map((e) => {
+      operateList: selectedRows.value.map((e) => {
         return {
           deviceId: e.deviceId, //设备id(巡检地址id)
           checkNum: e.checkNum, //巡检次数