yangyuxuan 6 ماه پیش
والد
کامیت
3bd6429f16

+ 2 - 0
src/components/DataImport/DataImportDetail.vue

@@ -12,6 +12,8 @@
       </el-table-column>
       <el-table-column label="备注" align="center" prop="event_title">
         <template #default="scope">
+          <div v-if="!!scope.row.warning_num">警告{{scope.row.warning_num}}条</div>
+          <div v-if="!!scope.row.error_num">错误{{scope.row.error_num}}条</div>
           <el-text v-if="scope.row.remark !== null && scope.row.remark.length !== 0" class="common-btn-text-primary" @click="handleShowDetails(scope.row.remark)">详情</el-text>
         </template>
       </el-table-column>

+ 3 - 0
src/types/components.d.ts

@@ -49,6 +49,7 @@ declare module 'vue' {
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
+    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     ElLink: typeof import('element-plus/es')['ElLink']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
@@ -88,6 +89,8 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
+    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
+    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 35 - 27
src/views/inspectionWork/inspectorAdd.vue

@@ -28,11 +28,12 @@
           <el-form-item label="责任区划:" prop="area_code">
             <el-tree-select
               v-model="formData.area_code"
-              :data="formattedDivisionData"
-              :props="{ label: 'label', value: 'code', children: 'children' }"
+              :load="loadNodes"
+              lazy
+              node-key="id"
+              :props="{ label: 'label', value: 'id', children: 'children', isLeaf: 'isShowSelect' }"
               :render-after-expand="false"
               style="width: 468px"
-              @change="onDivisionChange"
               check-strictly
             />
           </el-form-item>
@@ -51,6 +52,8 @@ import { inspectorAdd, phoneList, userList, inspectorDivision } from '@/api/insp
 import { reactive, ref, watch } from 'vue';
 import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
+import { getRegionalTree } from '@/api/PreventionResponsible';
+import { getZoning } from '@/api/riskPrevention/BusinessPortraits';
 
 const emits = defineEmits(['close']);
 const props = defineProps<{
@@ -83,6 +86,23 @@ const defaultProps = reactive({
   }
 })
 
+const loadNodes = (node, resolve) => {
+  if (!node.data.id) {
+    resolve([{
+      id: 1,
+      isShowSelect: false,
+      label: "广东省",
+      parentLabel: "",
+      personSum: -1,
+    }]);
+  } else {
+    getRegionalTree(node.data.id).then((res) => {
+      resolve(res.data);
+    })
+  }
+
+}
+
 // 更新表单数据
 const updateFormData = (userData) => {
   formData.value = {
@@ -156,27 +176,15 @@ const fetchPhoneList = async () => {
 };
 
 const fetchDivisionData = async () => {
-  const response = await inspectorDivision();
+  const response = await getRegionalTree(1);
   if (response.code === 200) {
-    rawDivisionData.value = response.data;
-    formattedDivisionData.value = formatDivisionData(rawDivisionData.value);
-    console.log('Formatted Division Data:', formattedDivisionData.value);
+    formattedDivisionData.value = response.data;
   } else {
     ElMessage.error(response.msg);
   }
 };
 
-const onDivisionChange = (value) => {
-  // 确认选中的项存在
-  const selectedDivision = findNode(formattedDivisionData.value, value);
-  if (!selectedDivision) {
-    ElMessage.warning('未找到匹配的责任区划。');
-    // 将选中的值重置为 null 或空字符串,防止后续逻辑错误
-    formData.value.area_code = null;
-  } else {
-    console.log('Selected Division:', selectedDivision); // 调试输出
-  }
-};
+
 
 // 递归查找节点
 const findNode = (nodes, code) => {
@@ -195,15 +203,15 @@ const findNode = (nodes, code) => {
   return null;
 };
 
-// 格式化责任区划数据
-const formatDivisionData = (data) => {
-  return data.map((item) => ({
-    id: item.id,
-    label: item.label,
-    code: item.code,
-    children: item.children ? formatDivisionData(item.children) : []
-  }));
-};
+// // 格式化责任区划数据
+// const formatDivisionData = (data) => {
+//   return data.map((item) => ({
+//     id: item.id,
+//     label: item.label,
+//     code: item.code,
+//     children: item.children ? formatDivisionData(item.children) : []
+//   }));
+// };
 
 onMounted(() => {
   fetchPhoneList();

+ 56 - 44
src/views/inspectionWork/inspectorEdit.vue

@@ -6,39 +6,40 @@
         <div>修改巡查人员</div>
       </div>
       <div class="common-dialog-box">
-        <el-form ref="form" :model="formData" :rules="rules" label-width="120px">
+        <el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="custom-disabled">
 <!--          <el-form-item label="姓名:" prop="nick_name">-->
 <!--            <el-input v-model="formData.nick_name" style="width: 468px !important" />-->
 <!--          </el-form-item>-->
-          <el-form-item label="姓名:" prop="user_id">
+          <el-form-item label="姓名:" prop="nick_name">
             <el-tree-select
-              v-model="formData.user_id"
+              v-model="formData.nick_name"
               :data="treeData"
               :props="defaultProps"
               node-key="id"
               :render-after-expand="false"
               style="width: 468px"
-              @change="onUserNameChange"
               filterable
+              disabled
             />
           </el-form-item>
-          <el-form-item label="粤政易组织:" prop="yzy_account">
-            <el-input v-model="formData.yzy_account" style="width: 468px !important" />
+          <el-form-item label="粤政易组织:" prop="ancestors_names">
+            <el-input v-model="formData.ancestors_names" style="width: 468px !important" disabled />
           </el-form-item>
           <el-form-item label="联系方式:" prop="phonenumber">
-            <el-input v-model="formData.phonenumber" style="width: 468px !important" />
+            <el-input v-model="formData.phonenumber" style="width: 468px !important"  disabled />
           </el-form-item>
 <!--          <el-form-item label="责任区划:" prop="area_code">-->
 <!--            <el-input v-model="formData.area_code" style="width: 468px !important" />-->
 <!--          </el-form-item>-->
-          <el-form-item label="责任区划:" prop="area_code">
+          <el-form-item label="责任区划:" prop="area">
             <el-tree-select
-              v-model="formData.area_code"
-              :data="formattedDivisionData"
-              :props="{ label: 'label', value: 'code', children: 'children' }"
+              v-model="formData.area"
+              :load="loadNodes"
+              lazy
+              node-key="id"
+              :props="{ label: 'label', value: 'id', children: 'children', isLeaf: 'isShowSelect' }"
               :render-after-expand="false"
               style="width: 468px"
-              @change="onDivisionChange"
               check-strictly
             />
           </el-form-item>
@@ -61,6 +62,7 @@ import {
 } from '@/api/inspectionWork/inspector';
 import { reactive, ref, watch } from 'vue';
 import { ElMessage } from 'element-plus';
+import { getRegionalTree } from '@/api/PreventionResponsible';
 const emits = defineEmits(['close']);
 const treeData = ref([]);
 const formattedDivisionData = ref([]);
@@ -69,11 +71,11 @@ const props = defineProps<{
   eventId: string | number;
 }>();
 const formData = ref({
-  user_id: '',
-  nick_name: '',
-  phonenumber: '',
-  yzy_account: '',
-  area_code: ''
+  // user_id: '',
+  // nick_name: '',
+  // phonenumber: '',
+  // yzy_account: '',
+  // area_code: ''
 });
 // 表单验证规则
 const rules = ref({
@@ -90,6 +92,23 @@ const fetchDetail = async () => {
     ElMessage.error(response.msg);
   }
 };
+
+const loadNodes = (node, resolve) => {
+  if (!node.data.id) {
+    resolve([{
+      id: 1,
+      isShowSelect: false,
+      label: "广东省",
+      parentLabel: "",
+      personSum: -1,
+    }]);
+  } else {
+    getRegionalTree(node.data.id).then((res) => {
+      resolve(res.data);
+    })
+  }
+}
+
 watch(
   () => props.eventId,
   (newVal) => {
@@ -148,10 +167,10 @@ const submitForm = async () => {
   }
 
 };
-const fetchPhoneList = async () => {
-  const response = await phoneList();
-  treeData.value = response.data;
-};
+// const fetchPhoneList = async () => {
+//   const response = await phoneList();
+//   treeData.value = response.data;
+// };
 
 const defaultProps = reactive({
   children:'children',
@@ -160,31 +179,12 @@ const defaultProps = reactive({
     return node.deptType && !node.children;
   }
 })
-const onUserNameChange = async (value) => {
-  if (value) {
-    const response = await userList({ userId: value });
-    if (response.code === 200 && response.rows.length > 0) {
-      updateFormData(response);
-    } else {
-      ElMessage.error(response.msg);
-    }
-  }
-};
-// 格式化责任区划数据
-const formatDivisionData = (data) => {
-  return data.map((item) => ({
-    id: item.id,
-    label: item.label,
-    code: item.code,
-    children: item.children ? formatDivisionData(item.children) : []
-  }));
-};
+
 const fetchDivisionData = async () => {
   const response = await inspectorDivision();
   if (response.code === 200) {
     rawDivisionData.value = response.data;
-    formattedDivisionData.value = formatDivisionData(rawDivisionData.value);
-    console.log('Formatted Division Data:', formattedDivisionData.value);
+    formattedDivisionData.value = rawDivisionData.value;
   } else {
     ElMessage.error(response.msg);
   }
@@ -202,8 +202,20 @@ const onDivisionChange = (value) => {
 };
 
 onMounted(() => {
-  fetchPhoneList();
+  // fetchPhoneList();
   fetchDivisionData();
 });
 </script>
-<style scoped></style>
+<style scoped>
+.custom-disabled {
+  :deep(.el-select__wrapper.is-disabled),
+  :deep(.el-input__wrapper) {
+    background-color: #ffffff !important;
+  }
+  :deep(.el-select__wrapper.is-disabled .el-select__selected-item),
+  :deep(.el-input__inner) {
+    color: rgba(0, 0, 0, 0.85) !important;
+    -webkit-text-fill-color: rgba(0, 0, 0, 0.85) !important;
+  }
+}
+</style>