lin.liu 1 週間 前
コミット
3f7972a5bc

+ 50 - 34
secure-producting-vue/src/views/form/DangerCheckRecord.vue

@@ -31,30 +31,16 @@
             new Date(2000, 1, 1, 0, 0, 0),
             new Date(2000, 1, 1, 23, 59, 59),
           ]"
+          style="width:240px"
         ></el-date-picker>
       </el-form-item>
-      <el-form-item label="检查人员" prop="checkPerson">
-        <el-input
-          v-model="queryParams.checkPerson"
-          placeholder="请输入"
-          clearable
-          style="width: 200px"
-          @keyup.enter="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="是否有隐患" prop="hasDanger">
-        <el-radio-group v-model="queryParams.hasDanger">
-          <el-radio :label="0">无隐患</el-radio>
-          <el-radio :label="1">有隐患</el-radio>
-        </el-radio-group>
-      </el-form-item>
       <el-form-item label="检查单状态" prop="listStatus">
         <el-select
           v-model="queryParams.listStatus"
           multiple
           clearable
           placeholder="请选择"
-          style="width: 240px"
+          style="max-width:240px"
         >
           <el-option
             v-for="item in checkFormStatusList"
@@ -64,13 +50,28 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="检查人员" prop="checkPerson">
+        <el-input
+          v-model="queryParams.checkPerson"
+          placeholder="请输入"
+          clearable
+          style="width:200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否有隐患" prop="hasDanger">
+        <el-radio-group v-model="queryParams.hasDanger">
+          <el-radio :label="0">无隐患</el-radio>
+          <el-radio :label="1">有隐患</el-radio>
+        </el-radio-group>
+      </el-form-item>
       <el-form-item label="网格类型" prop="ListGridCategory">
         <el-select
           v-model="queryParams.ListGridCategory"
           multiple
           clearable
           placeholder="请选择"
-          style="width: 240px"
+          style="max-width:240px"
         >
           <el-option
             v-for="item in gridCategoryList"
@@ -86,7 +87,7 @@
           multiple
           clearable
           placeholder="请选择"
-          style="width: 240px"
+          style="max-width:240px"
         >
           <el-option
             v-for="item in dangerCategoryList"
@@ -98,13 +99,16 @@
       </el-form-item>
       <el-form-item label="所属部门" prop="listDepartment">
         <el-tree-select
-          v-model="value"
+          v-model="queryParams.listDepartment"
           :data="deptOptions"
           multiple
+          clearable
+          collapse-tags
+          collapse-tags-tooltip
+          :max-collapse-tags="3"
           check-strictly
-          :render-after-expand="false"
-          show-checkbox
-          style="width: 240px"
+          :props="{ value: 'id', label: 'label', children: 'children' }"
+          style="width:220px"
         />
       </el-form-item>
       <el-form-item>
@@ -138,20 +142,27 @@
       @selection-change="handleSelectionChange"
       @row-dblclick="handleDetail"
     >
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="检查时间" align="center" prop="heckTimeView" />
-      <el-table-column label="状态" align="center" prop="status">
+      <el-table-column label="检查时间" width="96" align="center" prop="checkTimeView">
+        <template #default="scope">
+          {{ parseTime(scope.row.checkTimeView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" width="60" align="center" prop="status">
         <template #default="scope">
           {{ getStatusTxt(scope.row.status) }}
         </template>
       </el-table-column>
-      <el-table-column label="检查单号" align="center" prop="checkFormNo" />
-      <el-table-column label="检查表名称" align="center" prop="checkFormName" />
+      <el-table-column label="检查单号" width="231" align="center" prop="checkFormNo" />
+      <el-table-column label="检查表名称" width="300" align="left" prop="checkFormName" />
       <el-table-column label="所属部门" align="center" prop="departmentTxt" />
       <el-table-column label="所属关区" align="center" prop="customsName" />
       <el-table-column label="检查人员" align="center" prop="checkPerson" />
-      <el-table-column label="是否有隐患" align="center" prop="hasDangerTxt" />
-      <el-table-column label="整改期限" align="center" prop="rectifyDeadlineView" />
+      <el-table-column label="是否有隐患" width="89" align="center" prop="hasDangerTxt" />
+      <el-table-column label="整改期限" width="96" align="center" prop="rectifyDeadlineView">
+        <template #default="scope">
+          {{ parseTime(scope.row.rectifyDeadlineView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
       <el-table-column
         label="操作"
         align="center"
@@ -289,6 +300,7 @@ import { listEnumValue } from "@/api/system/base"
 import {
   submit, detail, modify, search
 } from "@/api/form/DangerCheckRecord";
+import { parseTime } from "@/utils/ruoyi"
 
 const { proxy } = getCurrentInstance();
 
@@ -323,7 +335,7 @@ const queryParams = ref({
   listDangerCategory: undefined,
   listDepartment: undefined,
   customs: undefined,
-  hasDanger: 0
+  hasDanger: undefined
 });
 
 const formCreate = ref({});
@@ -488,9 +500,9 @@ function submitModify() {
 
 
 function getStatusTxt(status) {
-  let find = checkFormStatusList.value.filter(c => c.value === status);
+  let find = checkFormStatusList.value.find(c => parseInt(c.value) === status);
   if (find) {
-    return find.Label;
+    return find.label;
   }
   return '未知';
 }
@@ -532,6 +544,10 @@ getDeptTree();
 initListGridCategory();
 // 调用初始化隐患分类下拉框数据
 initListDangerCategory();
-// 调用列表查询
-getList();
+
+/** 页面加载完毕 */
+onMounted(async () => {
+  // 获取列表数据
+  getList();
+});
 </script>

+ 11 - 4
secure-producting-vue/src/views/grid/components/MyGridAndCheck.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
-    <el-card shadow="hover" header="隐患检查" style="margin-bottom: 5px">
-      <el-table :data="listMineGrid" stripe style="width: 100%">
+    <el-card shadow="hover" header="今日隐患检查" style="margin-bottom: 5px">
+      <el-table :data="listMineGrid" stripe style="width: 100%" empty-text="当期帐号没有网格归属,请联系管理员!">
         <el-table-column prop="checkFormName" label="检查表信息" :show-overflow-tooltip="true">
           <template #default="scope">
             {{ scope.row.gridName + ' - ' + scope.row.checkFormName }}
@@ -14,9 +14,11 @@
               v-if="scope.row.checkStatus === 1"
               link
               type="primary"
+              icon="View"
               @click="handleDetail(scope.row)"
             >查看</el-button>
             <el-button
+              v-if="scope.row.checkStatus === 0"
               link
               type="primary"
               icon="Edit"
@@ -43,7 +45,7 @@
               :gridId="submitItem.gridId"
               :checkFormId="submitItem.checkFormId"
               :checkFormName="submitItem.checkFormName"
-              @closeCallback="showSubmitCheck = false"
+              @closeCallback="submitCallBack"
             ></submit-danger-check>
           </el-scrollbar>
         </div>
@@ -98,7 +100,12 @@ function handleDoForm(row) {
 
 function submitCheck() {
   // 调用子组件的函数
-  proxy.$refs["refSubmitCheck"].submitCheck();
+  proxy.$refs.refSubmitCheck.submitCheck();
+}
+
+function submitCallBack() {
+  showSubmitCheck.value = false;
+  getListPerson();
 }
 
 getListPerson();

+ 6 - 5
secure-producting-vue/src/views/grid/components/SubmitDangerCheck.vue

@@ -188,13 +188,11 @@ const props = defineProps({
     checkFormName: {
         type: String,
         default: '',
-    },
-    // 关闭回调函数
-    closeCallback: {
-      type: Object
     }
 });
 
+const emit = defineEmits(['closeCallback']);
+
 const uploadUrl = import.meta.env.VITE_APP_BASE_API + "/file/upload";
 const allowedFileTypes = ref([
   'image/jpeg',   // JPEG 图像文件
@@ -319,7 +317,7 @@ function submitCheck() {
       submit(formSubmit.value)
       .then((response) => {
         proxy.$modal.msgSuccess("提交成功");
-        that.props.closeCallback();
+        emit('closeCallback');
       })
       .finally(() => {
         loadingSubmit.value = false;
@@ -377,4 +375,7 @@ onMounted(async () => {
   initListDictData();
   getFormDetail();
 });
+
+// 主动暴露函数给父组件
+defineExpose({ submitCheck });
 </script>