瀏覽代碼

[Feat 0000] 为瓦斯巡检任务管理页面添加管理明细项时的操作提示,添加搜索表单

houzekong 3 周之前
父節點
當前提交
ae8293e9de

+ 1 - 1
src/views/system/dict/components/DistrictTeam.vue

@@ -2,7 +2,7 @@
 <template>
   <BasicTable @register="registerTable" :rowClassName="getRowClassName">
     <template #tableTitle>
-      <a-button type="primary" @click="handleCreate"> 新增</a-button>
+      <a-button type="primary" @click="handleCreate">新增</a-button>
     </template>
     <template #bodyCell="{ column, record }">
       <template v-if="column.dataIndex === 'action'">

+ 77 - 8
src/views/vent/gas/gasInspect/index2.vue

@@ -3,10 +3,12 @@
   <div class="gasReport">
     <customHeader>瓦斯巡检任务管理</customHeader>
     <div class="report-container">
-      <a-space class="search-area">
-        <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleEdit">新增任务</a-button>
-      </a-space>
       <BasicTable @register="registerTable1">
+        <template #tableTitle>
+          <a-space>
+            <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleEdit">新增任务</a-button>
+          </a-space>
+        </template>
         <template #action="{ record }">
           <a class="table-action-link" @click="handleManage(record)">管理</a>
           <a class="table-action-link" @click="handleDetail(record)">详情</a>
@@ -84,16 +86,46 @@
   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';
+  import { Modal, message } from 'ant-design-vue';
   import { BasicModal, useModal } from '/@/components/Modal';
   import { BasicForm, useForm } from '/@/components/Form';
+  import { getAutoScrollContainer } from '/@/utils/common/compUtils';
 
   // 任务列表
+  const searchParams1 = ref<any>({ deviceName: '' });
   const { tableContext: tx1 } = useListPage({
     tableProps: {
       api: teamList,
+      beforeFetch: (params) => {
+        Object.assign(params, searchParams1.value);
+      },
       columns: taskColumns,
       pagination,
+      formConfig: {
+        labelAlign: 'left',
+        labelWidth: 80,
+        compact: true,
+        schemas: [
+          {
+            label: '日期',
+            field: 'createTime',
+            component: 'DatePicker',
+            componentProps: {
+              showTime: false,
+              valueFormat: 'YYYY-MM-DD',
+              getPopupContainer: getAutoScrollContainer,
+            },
+          },
+          {
+            label: '所属区队',
+            field: 'districtTeam',
+            component: 'JDictSelectTag',
+            componentProps: {
+              dictCode: 'districtTeam',
+            },
+          },
+        ],
+      },
       actionColumn: {
         title: '操作',
         dataIndex: 'action',
@@ -102,7 +134,7 @@
         slots: { customRender: 'action' },
       },
       showTableSetting: false,
-      useSearchForm: false,
+      useSearchForm: true,
     },
     pagination: true,
   });
@@ -205,9 +237,43 @@
 
   // 关联明细
   function handlePatch(mode) {
+    // 过滤已选择条目,关联至其他任务的已经无法选中所以不做处理,关联至本任务的无法再添加,未关联的无法删除
+    const addedRows = selectedRows.value.filter((e) => {
+      return e.isSelect === true;
+    });
+    const otherRows = selectedRows.value.filter((e) => {
+      return e.isSelect === false;
+    });
+
+    if (mode === 'add' && addedRows.length) {
+      Modal.confirm({
+        title: '确认',
+        content: '您选择的条目含有已关联项,是否继续添加其他未关联项?',
+        okText: '确认',
+        cancelText: '取消',
+        onOk() {
+          patchConfirmHandler(otherRows, mode);
+        },
+      });
+    } else if (mode === 'del' && otherRows.length) {
+      Modal.confirm({
+        title: '确认',
+        content: '您选择的条目含有未关联项,是否继续删除其他已关联项?',
+        okText: '确认',
+        cancelText: '取消',
+        onOk() {
+          patchConfirmHandler(addedRows, mode);
+        },
+      });
+    } else {
+      patchConfirmHandler(selectedRows.value, mode);
+    }
+  }
+
+  function patchConfirmHandler(rows, mode) {
     operateGasCheckTaskDetail({
       taskId: selectedRow.value.id,
-      operateList: selectedRows.value.map((e) => {
+      operateList: rows.map((e) => {
         return {
           deviceId: e.deviceId, //设备id(巡检地址id)
           checkNum: e.checkNum, //巡检次数
@@ -242,12 +308,15 @@
 </script>
 
 <style lang="less" scoped>
+  @import '/@/design/theme.less';
+
   .gasReport {
     width: 100%;
     height: 100%;
     padding: 80px 10px 15px 10px;
     box-sizing: border-box;
     position: relative;
+    color: var(--vent-font-color);
 
     .search-area {
       margin: 20px 0px;
@@ -257,7 +326,7 @@
         align-items: center;
 
         .item-text {
-          color: #fff;
+          color: var(--vent-font-color);
         }
       }
     }
@@ -278,7 +347,7 @@
     .zxm-input {
       border: 1px solid #3ad8ff77 !important;
       background-color: #ffffff00 !important;
-      color: #fff !important;
+      color: var(--vent-font-color) !important;
     }
   }
 </style>

+ 6 - 6
src/views/vent/gas/gasReport/gas-report.api.ts

@@ -4,8 +4,8 @@ enum Api {
   getGasAddressList = '/safety/gasDayReport/getGasAddressList',
   getList = '/safety/gasDayReport/list',
   expComReportByParam = '/safety/reportInfo/expComReportByParam',
-  reviewPass='/safety/gasDayReport/reviewPass',
-  getIsReviewPass='/safety/gasDayReport/getIsReviewPass'
+  reviewPass = '/safety/gasDayReport/reviewPass',
+  getIsReviewPass = '/safety/gasDayReport/getIsReviewPass',
 }
 /**
  * 获取瓦斯日报区队,检测地点下拉选项
@@ -26,11 +26,11 @@ export const getList = (params) => defHttp.get({ url: Api.getList, params });
 export const expComReportByParam = (params) => defHttp.post({ url: Api.expComReportByParam, params, responseType: 'blob' });
 /**
  * 审核通过
- * @param params 
+ * @param params
  */
-export const reviewPass = (params) => defHttp.post({ url: Api.reviewPass,params });
+export const reviewPass = (params) => defHttp.post({ url: Api.reviewPass, params });
 /**
  * 判断是否已审核通过
- * @param params 
+ * @param params
  */
-export const getIsReviewPass = (params) => defHttp.post({ url: Api.getIsReviewPass,params });
+export const getIsReviewPass = (params) => defHttp.post({ url: Api.getIsReviewPass, params });