Переглянути джерело

Merge remote-tracking branch 'origin/dev' into dev

Hwf 3 місяців тому
батько
коміт
3fd662753f

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

@@ -24,24 +24,13 @@ declare module 'vue' {
     DistributionMap: typeof import('./../components/Map/YztMap/DistributionMap.vue')['default']
     DrawMap: typeof import('./../components/Map/YztMap/DrawMap.vue')['default']
     Editor: typeof import('./../components/Editor/index.vue')['default']
-    ElAnchor: typeof import('element-plus/es')['ElAnchor']
-    ElAnchorLink: typeof import('element-plus/es')['ElAnchorLink']
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
-    ElCard: typeof import('element-plus/es')['ElCard']
-    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
-    ElCheckboxButton: typeof import('element-plus/es')['ElCheckboxButton']
-    ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
-    ElCollapse: typeof import('element-plus/es')['ElCollapse']
-    ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
-    ElContainer: typeof import('element-plus/es')['ElContainer']
     ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
-    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
-    ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -51,45 +40,24 @@ declare module 'vue' {
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
-    ElHeader: typeof import('element-plus/es')['ElHeader']
     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']
-    ElMain: typeof import('element-plus/es')['ElMain']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
-    ElRadio: typeof import('element-plus/es')['ElRadio']
-    ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
-    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
-    ElSegmented: typeof import('element-plus/es')['ElSegmented']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
-    ElSlider: typeof import('element-plus/es')['ElSlider']
-    ElSpace: typeof import('element-plus/es')['ElSpace']
-    ElStep: typeof import('element-plus/es')['ElStep']
-    ElSteps: typeof import('element-plus/es')['ElSteps']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
-    ElTabPane: typeof import('element-plus/es')['ElTabPane']
-    ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
-    ElTimeline: typeof import('element-plus/es')['ElTimeline']
-    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
-    ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTree: typeof import('element-plus/es')['ElTree']
-    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
@@ -102,9 +70,6 @@ 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']
-    IEpUploadFilled: typeof import('~icons/ep/upload-filled')['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']

+ 20 - 31
src/views/dataFilling/fillingAdd.vue

@@ -176,39 +176,28 @@ const rules = {
   ],
   user_ids: [{ required: true, message: '请选择填报人', trigger: 'blur' }],
 }
-const handleSaveTemporarily = async (formEl,statuCode) => {
-  if (!formEl) return;
-  await formEl.validate((valid, fields) => {
-    if (valid) {
-      if (hotData.value && hotData.value[0] && hotData.value[0].length > 0) {
-        const data2 = [];
-        hotData.value[0].forEach((item) => {
-          if (!!item) {
-            data2.push(item);
-          }
-        })
-        form.value.field_names = data2;
+const handleSaveTemporarily = async (statuCode) => {
+  if (!!form.value.creator_phone) {
+    const phoneRegex = /^1[3-9]\d{9}$/;
+    if(!phoneRegex.test(form.value.creator_phone)) {
+      proxy.$modal.msgError('请输入正确格式的电话号码');
+      return;
+    }
+  }
+  if (hotData.value && hotData.value[0] && hotData.value[0].length > 0) {
+    const data2 = [];
+    hotData.value[0].forEach((item) => {
+      if (!!item) {
+        data2.push(item);
       }
+    })
+    form.value.field_names = data2;
+  }
 
-      form.value.issued_status = statuCode;
-      fillingAdd(form.value).then(() => {
-        proxy.$modal.msgSuccess('暂存成功');
-        emits('close');
-      });
-    } else {
-      nextTick(() => {
-        let isError = document.getElementsByClassName('is-error');
-        isError[0].scrollIntoView({
-          // 滚动到指定节点
-          // 值有start,center,end,nearest,当前显示在视图区域中间
-          block: 'center',
-          // 值有auto、instant,smooth,缓动动画(当前是慢速的)
-          behavior: 'smooth'
-        });
-      });
-      proxy.$modal.msgError('表单校验失败');
-      return false;
-    }
+  form.value.issued_status = statuCode;
+  fillingAdd(form.value).then(() => {
+    proxy.$modal.msgSuccess('暂存成功');
+    emits('close');
   });
 };
 

+ 58 - 5
src/views/dataFilling/tableDetails.vue

@@ -76,6 +76,12 @@
                 </el-form-item>
               </el-form-item>
             </el-col>
+            <el-col :span="8" v-if="reportInfo.issued_status === 2">
+              <el-form-item>
+                应填报{{reportInfo.num_reporters}}人,已填报{{reportInfo.num_reported}}人,未填报{{reportInfo.num_unreported}}人
+                <el-text class="common-btn-text-primary" @click="viewSituation">完成情况</el-text>
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-col>
       </el-row>
@@ -85,6 +91,19 @@
     <hot-table v-if="showTable" ref="wrapper" :data="hotData" :settings="hotSettings" />
   </div>
   <informantSelect v-model="isShowSelect" :tree-data="treeData" :default-check-data="reportInfo.user_ids" @confirm="handleContactSelectData" />
+  <el-dialog v-if="popUp" v-model="reportInfo.user_filling_status" @close="handleDialogClose">
+    <el-table :data="reportInfo.user_filling_status">
+      <el-table-column label="序号" align="center" type="index" width="50px" />
+      <el-table-column label="姓名" align="center" prop="name" />
+      <el-table-column label="填报状态" align="center" prop="submission_status">
+        <template #default="scope">
+          <span :class="scope.row.submission_status == 0 ? 'unreported' : 'reported'">
+            {{ scope.row.submission_status == 0 ? '未填报' : '已填报' }}
+          </span>
+        </template>
+      </el-table-column>
+    </el-table>
+  </el-dialog>
 </template>
 
 <script setup lang="ts">
@@ -123,7 +142,8 @@ const reportInfo = ref({
   num_reported: 0,
   num_unreported: 0,
   field_names: [], //表格内容
-  user_ids: []
+  user_ids: [],
+  user_filling_status: []
 });
 const rules = {
   table_name: [{ required: true, message: '表名不能为空', trigger: 'blur' }],
@@ -138,6 +158,7 @@ const rules = {
 const is_filling_ended = ref(0);
 const selectedReporter = ref(null);
 const router = useRouter();
+const personNum = ref();
 
 const props = defineProps({
   eventId: String
@@ -161,7 +182,14 @@ onMounted(async () => {
 const fetchReportDetails = (reportId) => {
   return fillingList(reportId).then((res: any) => {
     reportInfo.value = res.report_info;
-    const headers = Object.keys(res.table_data["0"]);
+    reportInfo.value.user_filling_status = res.report_info.user_filling_status;
+    personNum.value = reportInfo.value.user_ids.length;  //统计需要填报的总人数
+    let headers = [];
+    if (!res.table_data["0"]) {
+      return;
+    } else {
+      headers = Object.keys(res.table_data["0"]);
+    }
     const result = [
       headers.map(header => res.table_data["0"][header])
     ];
@@ -346,9 +374,15 @@ const handleSaveTemporarily = async (formEl,statuCode) => {
       }
 
       reportInfo.value.issued_status = statuCode;
-      const tempHead = reportInfo.value.field_names.flatMap(obj =>
-        Object.values(obj).filter(value => typeof value === "string")
-      );
+      let tempHead = [];
+      if (!reportInfo.value.field_names) {
+        tempHead = [];
+      } else {
+        tempHead = reportInfo.value.field_names.flatMap(obj =>
+          Object.values(obj).filter(value => typeof value === "string")
+        );
+      }
+
       let data = {
         creator_name: reportInfo.value.creator_name,
         creator_phone: reportInfo.value.creator_phone,
@@ -440,4 +474,23 @@ function findNodeById(data, targetId) {
   }
   return null; // 未找到返回 null
 }
+const popUp = ref(false);
+const viewSituation = () => {
+  popUp.value = true;
+}
+const handleDialogClose = () => {
+  popUp.value = false;
+};
 </script>
+
+<style lang="scss" scoped>
+.unreported {
+  color: #F56C6C;
+  font-weight: bold;
+}
+
+.reported {
+  color: #67C23A;
+  font-weight: bold;
+}
+</style>