Forráskód Böngészése

更新巡查工作管理页面空白问题

libushang 6 hónapja
szülő
commit
3bd8813ed8

+ 2 - 2
src/views/inspectionWork/inspector.vue

@@ -60,9 +60,9 @@
         <pagination v-show="total > 0" v-model:page="queryParams.page" v-model:limit="queryParams.pageSize" :total="total" @pagination="tableData" />
       </el-col>
     </el-row>
+    <InspectorEdit v-if="inspectorEditState.show" :event-id="inspectorEditState.eventId" @close="handleCancel" />
+    <InspectorAdd v-if="inspectorAddState.show" @close="handleCancel" @refresh="fetchUserData" />
   </div>
-  <InspectorEdit v-if="inspectorEditState.show" :event-id="inspectorEditState.eventId" @close="handleCancel" />
-  <InspectorAdd v-if="inspectorAddState.show" @close="handleCancel" @refresh="fetchUserData" />
 </template>
 
 <script setup lang="ts">

+ 4 - 2
src/views/inspectionWork/inspectorAdd.vue

@@ -50,7 +50,7 @@ import { useRouter } from 'vue-router';
 
 const emits = defineEmits(['close']);
 const props = defineProps<{
-  eventId: string | number;
+  // eventId: string | number;
 }>();
 
 const formData = ref({
@@ -59,7 +59,9 @@ const formData = ref({
   phonenumber: '',
   uuid: ''
 });
-
+const rules = ref({
+  // id: [{ required: true, message: '主键不能为空', trigger: 'blur' }],
+});
 const treeData = ref([]);
 const rawDivisionData = ref([]);
 const formattedDivisionData = ref([]);

+ 3 - 0
src/views/inspectionWork/inspectorEdit.vue

@@ -41,6 +41,9 @@ const formData = ref({
   yzy_account: '',
   area: ''
 });
+const rules = ref({
+  // id: [{ required: true, message: '主键不能为空', trigger: 'blur' }],
+});
 const fetchDetail = async () => {
   const response = await inspectorDetail(props.eventId);
   if (response.code === 200) {

+ 5 - 2
src/views/inspectionWork/patrolSubResult.vue

@@ -102,8 +102,8 @@ const initFormData = reactive({
 const data = reactive({
   form: { ...initFormData },
   queryParams: {
-    page: '',
-    pageSize: '',
+    page: 1,
+    pageSize: 10,
     inspection_result: '',
     area_code: '',
     nick_name: ''
@@ -172,6 +172,9 @@ const handleQuery = () => {
   queryParams.value.page = 1;
   fetchResulData();
 };
+const handleExport = () => {
+  ElMessage.info("导出成功");
+};
 // 重置查询条件
 const resetQuery = () => {
   queryParams.value = { page: 1, pageSize: 10, nick_name: '', area_code: '', inspection_result: '' };

+ 2 - 2
src/views/inspectionWork/patrolSubTasks.vue

@@ -65,9 +65,9 @@
         </el-card>
       </el-col>
     </el-row>
+    <PatrolSubResult v-if="patrolSubResultState.show" :event-id="patrolSubResultState.eventId" @close="handleCancel" />
+    <PatrolTaskEdit v-if="patrolTaskEditState.show" :event-id="patrolTaskEditState.eventId" @close="handleCancel" @refresh-parent="refreshBoth" />
   </div>
-  <PatrolSubResult v-if="patrolSubResultState.show" :event-id="patrolSubResultState.eventId" @close="handleCancel" />
-  <PatrolTaskEdit v-if="patrolTaskEditState.show" :event-id="patrolTaskEditState.eventId" @close="handleCancel" @refresh-parent="refreshBoth" />
 </template>
 <script setup lang="ts">
 import { workDetail, workSubList, updatetask, deleteRisk } from '@/api/inspectionWork/inspector';

+ 5 - 5
src/views/inspectionWork/patrolTask.vue

@@ -75,10 +75,10 @@
         <pagination v-show="total > 0" v-model:page="queryParams.page" v-model:limit="queryParams.pageSize" :total="total" @pagination="tableData" />
       </div>
     </div>
+    <PatrolSubTasks v-if="patrolSubTasksState.show" :event-id="patrolSubTasksState.eventId" @close="handleCancel" @refreshsub="fetchWorkrData" />
+    <PatrolTaskEdit v-if="patrolTaskEditState.show" :event-id="patrolTaskEditState.eventId" @close="handleCancel" @refresh="fetchWorkrData" />
+    <PatrolTaskAdd v-if="patrolTaskAddState.show" @close="handleCancel" @refresh="fetchWorkrData" />
   </div>
-  <PatrolSubTasks v-if="patrolSubTasksState.show" :event-id="patrolSubTasksState.eventId" @close="handleCancel" @refreshsub="fetchWorkrData" />
-  <PatrolTaskEdit v-if="patrolTaskEditState.show" :event-id="patrolTaskEditState.eventId" @close="handleCancel" @refresh="fetchWorkrData" />
-  <PatrolTaskAdd v-if="patrolTaskAddState.show" @close="handleCancel" @refresh="fetchWorkrData" />
 </template>
 <script setup lang="ts">
 import { onMounted, reactive, ref } from 'vue';
@@ -197,7 +197,7 @@ const handleCancel = () => {
 };
 const openPatrolSubTasks = (row) => {
   if (row) {
-    patrolSubTasksState.eventId = row.id; // 假设eventId是id字段
+    patrolSubTasksState.eventId = row.id + ""; // 假设eventId是id字段
     patrolSubTasksState.show = true;
   }
 };
@@ -206,7 +206,7 @@ const handleAdd = () => {
 };
 const handleUpdate = (row) => {
   if (row) {
-    patrolTaskEditState.eventId = row.id; // 假设eventId是id字段
+    patrolTaskEditState.eventId = row.id + ""; // 假设eventId是id字段
     patrolTaskEditState.show = true;
   }
 };

+ 3 - 0
src/views/inspectionWork/patrolTaskEdit.vue

@@ -97,6 +97,9 @@ const fetchDetail = async () => {
     ElMessage.error(response.msg);
   }
 };
+const rules = ref({
+  // id: [{ required: true, message: '主键不能为空', trigger: 'blur' }],
+});
 watch(
   () => props.eventId,
   (newVal) => {