刘洋 1 vuosi sitten
vanhempi
commit
d560e3f17f

+ 72 - 26
src/views/work-hours/work-hours-manage/work-attendance/detail-dialog.vue

@@ -95,45 +95,76 @@
         :columns="columns"
         :data="tableData"
         bordered
-        :pagination="{
-          defaultCurrent: 1,
-          defaultPageSize: 10,
-          onChange,
-          total: pagination.total,
-          current: pagination.pageNumber,
-          showPageSize: false,
-        }"
       >
         <template #signIn="{ col, row }">
-          {{
+          <!-- {{
             row.signInTime
               ? timestampFilter(row[col.colKey], 'tt') +
                 (row.signInAddress ? row.signInAddress : '')
               : '异常'
-          }}
+          }} -->
+          <t-link
+            theme="primary"
+            hover="color"
+            @click="showCurAddress(row.signInInfo)"
+          >
+            {{
+              row.signInInfo
+                ? timestampFilter(row.signInInfo?.signTime) +
+                  (row.signInInfo?.signAddress
+                    ? row.signInInfo.signAddress
+                    : '')
+                : '异常'
+            }}
+          </t-link>
         </template>
         <template #signOut="{ col, row }">
-          {{
+          <!-- {{
             row.signOutTime
               ? timestampFilter(row[col.colKey], 'tt') +
                 (row.signOutAddress ? row.signOutAddress : '')
               : '异常'
-          }}
+          }} -->
+          <t-link
+            theme="primary"
+            hover="color"
+            @click="showCurAddress(row.signOutInfo)"
+          >
+            {{
+              row.signOutInfo
+                ? timestampFilter(row.signOutInfo?.signTime) +
+                  (row.signOutInfo?.signAddress
+                    ? row.signOutInfo.signAddress
+                    : '')
+                : '异常'
+            }}
+          </t-link>
         </template>
         <template #workHours="{ col, row }">
           {{
-            row.signOutTime && row.signInTime
-              ? ((row.signOutTime - row.signInTime) / 1000 / 60 / 60).toFixed(2)
+            row.signInInfo?.signTime && row.signOutInfo?.signTime
+              ? (
+                  (row.signOutInfo?.signTime - row.signInInfo?.signTime) /
+                  1000 /
+                  60 /
+                  60
+                ).toFixed(2)
               : ''
           }}
         </template>
       </t-table>
-      <t-space class="sop-step-footer" style="flex-direction: row">
+      <t-space class="sop-step-footer p-t-20px" style="flex-direction: row">
         <t-button theme="primary" @click="emit('update:visible', false)"
           >返回
         </t-button>
       </t-space>
     </div>
+    <QqMap
+      :longitude="longitude"
+      :latitude="latitude"
+      v-if="showMap"
+      @close="showMap = false"
+    ></QqMap>
   </my-drawer>
 </template>
 
@@ -144,11 +175,21 @@ import {
   customerTypeFilter,
   attendanceSubmitStatusFilter,
 } from '@/utils/filter';
-import { computed, reactive, watch } from 'vue';
+import { computed, ref, watch } from 'vue';
 import useFetchTable from '@/hooks/useFetchTable';
 import { dkmxDetailApi } from '@/api/work-hours';
 import { randomCode } from '@/utils/tool';
-
+import QqMap from '@/components/common/qq-map/index.vue';
+const showMap = ref(false);
+const longitude = ref(null);
+const latitude = ref(null);
+const showCurAddress = (row) => {
+  if (row?.axisX && row?.axisY) {
+    longitude.value = row.axisX;
+    latitude.value = row.axisY;
+    showMap.value = true;
+  }
+};
 const emit = defineEmits(['update:visible', 'confirm']);
 const props = defineProps({
   visible: Boolean,
@@ -169,18 +210,23 @@ const columns = [
 const params = computed(() => {
   return {
     sopNo: props.row.sopNo,
-    archivesId: props.row.archivesId,
+    userId: props.row.userId,
   };
 });
 
-const { pagination, tableData, fetchData, onChange } = useFetchTable(
-  dkmxDetailApi,
-  {
-    params,
-  },
-  false
-);
-
+// const { pagination, tableData, fetchData, onChange } = useFetchTable(
+//   dkmxDetailApi,
+//   {
+//     params,
+//   },
+//   false
+// );
+const tableData = ref([]);
+const fetchData = () => {
+  dkmxDetailApi(params.value).then((res) => {
+    tableData.value = res?.dingFormList || [];
+  });
+};
 watch(
   () => props.visible,
   (val) => {