Prechádzať zdrojové kódy

fix: 🐛 修复问题

@sun-chaoqun 2 rokov pred
rodič
commit
0faad3abf6

+ 3 - 0
src/api/storehouse/index.ts

@@ -114,3 +114,6 @@ export const Storehouse_Stock_List = (params: any) => $http.post('/testapi/stora
 export const Storehouse_Stock_Detail_List = (params: any) => $http.post('/testapi/storage/Stock/Detail_List', params)
 // 导出明细
 export const Storehouse_Stock_Detail_Excel = (params: any) => $http.post('/testapi/storage/Stock/Detail_Excel', params)
+
+// 检查 Sn 号
+export const Storehouse_Device_Check = (params: any) => $http.post('/testapi/storage/Device/Check', params)

+ 4 - 3
src/layouts/Header/Notice.vue

@@ -60,13 +60,14 @@ onMounted(() => {
       target.scrollHeight - target.scrollTop === target.clientHeight &&
       globalStore.noticeTotal !== newsList.value.length
     ) {
-      console.log('/notice')
       globalStore.SET_NoticePage()
       globalStore.SET_User_News_List()
     }
   })
 
-  globalStore.SET_User_News_List()
+  if (!globalStore.noticeList.length) {
+    globalStore.SET_User_News_List()
+  }
 })
 
 defineExpose({
@@ -78,7 +79,7 @@ defineExpose({
     <el-tabs v-model="activeName" @tab-click="handleClick" id="notice">
       <transition-group
         appear
-        leave-active-class="animate__animated animate__fadeInLeft"
+        leave-active-class="animate__animated animate__fadeOutLeft"
         enter-active-class="animate__animated animate__fadeInLeft"
       >
         <el-tab-pane label="未读" name="first" key="first">

+ 3 - 1
src/stores/index.ts

@@ -130,7 +130,9 @@ export const GlobalStore = defineStore({
         page_z: 10
       }
       const res: any = await User_News_List(params)
-      this.SET_NoticeList(res.Data.Data)
+      setTimeout(() => {
+        this.SET_NoticeList(res.Data.Data)
+      }, 100)
       this.SET_NoticeTotal(res.Data.Num)
     }
   }

+ 8 - 0
src/utils/common.ts

@@ -23,6 +23,14 @@ export const isEmptyObject = (obj: object) => Object.keys(obj).length > 0
 export const dayJs = (date?: Date | string) => dayjs(date)
 
 /**
+ * 生成一个唯一值
+ * @returns string
+ */
+export const generateRandom = (): string => {
+  return Math.random().toString(16).slice(2)
+}
+
+/**
  *
  * @param menuList 菜单列表
  * @param result 输出得结果

+ 74 - 33
src/views/account/roles/Roles.vue

@@ -47,7 +47,6 @@ const DialogOpen = async (row: any) => {
   dialog.value?.DialogOpen()
 }
 
-// const checkList = ref<string[]>([])
 const columns: ColumnProps[] = [
   { type: 'index', label: '#', width: 80 },
   { prop: 'T_name', label: '姓名' },
@@ -58,9 +57,6 @@ const columns: ColumnProps[] = [
 const getSysList = async () => {
   const { Data } = await User_Sys_List({ User_tokey: globalStore.GET_User_tokey })
   SysList.value = Data as InSys[]
-  // for await (let item of SysList.value) {
-  //   getMenuList(item.T_sys)
-  // }
   const promises = []
   for (let item of SysList.value) {
     promises.push(getMenuList(item.T_sys))
@@ -82,6 +78,7 @@ const getSysList = async () => {
     })
     menuList.value = menuListTemporary
     setCheckedTreeKeys(permissionArr.value)
+    console.log(permissionArr.value)
   })
 }
 const getMenuList = async (code: string) => {
@@ -205,47 +202,88 @@ const searchHandle = () => {
 const treeRef = ref<InstanceType<typeof ElTree>>()
 const menuList = ref<any[]>([])
 
+/**
+ * 返回拼接的 M + Id
+ * @param children 菜单数组
+ */
+const getMontageRole = (children: any[]) => {
+  let result = ''
+
+  const getChildIds = (node: any) => {
+    if (!node.Children) {
+      return `M${node.Id}|`
+    }
+    let ids = node.Children.map((child: any) => {
+      return getChildIds(child)
+    })
+    return `M${node.Id}|${ids.join('')}`
+  }
+
+  children.forEach((item: any) => {
+    result += getChildIds(item)
+  })
+  return result
+}
+/**
+ * 提交
+ */
 const append = async (data: any) => {
   const currentMenu = menuMap.get(data.T_permission)
+  console.log(menuMap)
+
   const { code, children } = currentMenu
 
-  let T_menu = ''
-  children.forEach((item: any) => {
-    let str = 'M' + item.Id + '|'
-    T_menu += str
-  })
+  let T_menu = getMontageRole(children)
+  console.log(children)
+
   const params = {
     User_tokey: globalStore.GET_User_tokey,
     T_id: currentVal.T_id,
     T_code: code,
     T_menu
   }
-  const res = await User_Power_Edit_Menu(params)
-  if (res.Code === 200) {
-    ElMessage.success('修改成功!')
-    dialog.value?.DialogClose()
-  }
+  // const res = await User_Power_Edit_Menu(params)
+  // if (res.Code === 200) {
+  //   ElMessage.success('修改成功!')
+  //   // dialog.value?.DialogClose()
+  // }
 }
 let fatherData: any = {}
 const checkChange = (data: any, check: boolean) => {
-  const father = menuMap.get(data.T_permission)
-  if (father) {
-    fatherData = data
-    fatherCheckHandle(data.Children, father, check)
-    return
+  let fatherData = menuMap.get(data.T_permission)
+  if (['/base'].includes(data.T_permission)) {
+    fatherData = menuMap.get('/stock')
   }
-  const prevFather = menuMap.get(fatherData.T_permission)
-  const { children } = prevFather
+
   if (check) {
-    prevFather.children.push(data)
-  }
-  if (!father && !check) {
-    const index = children.findIndex((item: any) => item.T_permission === data.T_permission)
-    if (index !== -1) {
-      children.splice(index, 1)
-    }
+    console.log(data, fatherData)
   }
+
+  // console.log(data, check)
+  // if (father) {
+  //   fatherData = data
+  //   fatherCheckHandle(data.Children, father, check)
+  //   // console.log(father)
+  //   return
+  // }
+  // const prevFather = menuMap.get(fatherData.T_permission)
+  // console.log(fatherData, prevFather)
+
+  // const children = prevFather?.children
+  // // console.log(children)
+  // if (check) {
+  //   console.log(children)
+  //   prevFather.children.push(data)
+  // }
+  // if (!father && !check) {
+  //   const index = children.findIndex((item: any) => item.T_permission === data.T_permission)
+  //   if (index !== -1) {
+  //     console.log('-1')
+  //     children.splice(index, 1)
+  //   }
+  // }
 }
+
 /**
  * 处理点击父级 tree 时的处理
  */
@@ -253,14 +291,17 @@ const fatherCheckHandle = (children: any[], father: any, check: boolean) => {
   if (check) {
     children.forEach((item: any) => {
       if (item.Children) {
-        father.children.push(item)
-        fatherCheckHandle(item.Children, father, check)
+        if (father.children.findIndex((child: any) => item.T_permission === child.T_permission) === -1) {
+          father.children.push(item)
+          fatherCheckHandle(item.Children, father, check)
+        }
       } else {
-        father.children.push(item)
+        if (father.children.findIndex((child: any) => item.T_permission === child.T_permission) === -1) {
+          console.log('push3')
+          father.children.push(item)
+        }
       }
     })
-  } else {
-    father.children = []
   }
 }
 /**

+ 10 - 9
src/views/home/Home.vue

@@ -22,7 +22,7 @@ const activeName = ref('first')
 const newsList = computed<NoticeType[]>(() => {
   return globalStore.noticeList
 })
-console.log(newsList.value)
+
 const handleClick = (tab: TabsPaneContext) => {
   const { props } = tab
   globalStore.SET_NoticeList([], true)
@@ -58,7 +58,6 @@ const ScrollHandle = (e: any) => {
     target.scrollHeight - target.scrollTop === target.clientHeight &&
     globalStore.noticeTotal !== newsList.value.length
   ) {
-    console.log('/home')
     globalStore.SET_NoticePage()
     globalStore.SET_User_News_List()
   }
@@ -74,7 +73,6 @@ onMounted(() => {
   }
 })
 onUnmounted(() => {
-  console.log('组件销毁')
   tabs__content.removeEventListener('scroll', ScrollHandle)
 })
 </script>
@@ -86,11 +84,12 @@ onUnmounted(() => {
       <el-tabs v-model="activeName" @tab-click="handleClick" id="home">
         <transition-group
           appear
-          leave-active-class="animate__animated animate__fadeInLeft"
+          mode="out-in"
+          leave-active-class="animate__animated animate__fadeOutLeft"
           enter-active-class="animate__animated animate__fadeInLeft"
         >
           <el-tab-pane label="未读" name="first" key="first">
-            <div class="item" v-for="item in newsList" :key="item.T_uuid" @click="previewNotice(item)">
+            <div class="item" v-for="item in newsList" :key="item.T_uuid + 'first'" @click="previewNotice(item)">
               <div class="item-box">
                 <el-badge :value="item.T_Tag === 0 ? 'new' : ''">{{ item.T_Title }}</el-badge>
               </div>
@@ -98,7 +97,7 @@ onUnmounted(() => {
             </div>
           </el-tab-pane>
           <el-tab-pane label="全部" name="second" key="second">
-            <div class="item" v-for="item in newsList" :key="item.T_uuid" @click="previewNotice(item)">
+            <div v-for="item in newsList" :key="item.T_uuid + 'second'" class="item" @click="previewNotice(item)">
               <div class="item-box">
                 <el-badge :value="item.T_Tag === 0 ? 'new' : ''">{{ item.T_Title }}</el-badge>
               </div>
@@ -121,7 +120,7 @@ onUnmounted(() => {
   // align-items: center;
   .notice {
     width: 50%;
-    height: 50%;
+    height: 60%;
     padding: 15px;
     display: flex;
     flex-direction: column;
@@ -132,7 +131,7 @@ onUnmounted(() => {
       height: calc(100% - 25px);
       :deep(.el-tabs__content) {
         padding-top: 10px;
-        height: calc(100% - 80px);
+        height: calc(100% - 60px);
         overflow-y: scroll;
       }
     }
@@ -141,10 +140,13 @@ onUnmounted(() => {
       display: flex;
       padding: 5px 16px;
       cursor: pointer;
+      transition: transform 0.5s ease-in-out;
       justify-content: space-between;
       &:hover {
         background-color: #ecf5ff;
         color: #409eff;
+        box-shadow: 0 0 6px #dfdfdf;
+        transform: translateX(-2px);
       }
       .item-box {
         width: 80%;
@@ -166,7 +168,6 @@ onUnmounted(() => {
   }
   h1 {
     font-size: 2rem;
-    margin-bottom: 20px;
   }
 }
 </style>

+ 5 - 5
src/views/salary/salary/SalaryFrom.vue

@@ -8,6 +8,7 @@ import { StarFilled } from '@element-plus/icons-vue'
 
 const formRef = ref<FormInstance>()
 const form = ref({
+  Id: '',
   T_base: '',
   T_post: '',
   T_seniority: '',
@@ -23,7 +24,7 @@ const form = ref({
   T_large_medical_insurance: '',
   T_housing_fund: '',
   T_remark: '',
-  T_State: 1
+  T_State: ''
 })
 const rules = reactive<FormRules>(reuls_validator)
 const resetForm = (formEl: FormInstance | undefined) => {
@@ -74,10 +75,9 @@ defineExpose({
 <template>
   <el-card class="form-card" style="flex: 1">
     <el-row :gutter="24">
-      <el-col :span="12" style="margin-left: 4rem">
-        <el-tag type="warning" effect="dark"
-          >已发布 <el-icon> <StarFilled /> </el-icon
-        ></el-tag>
+      <el-col :span="12" style="margin-left: 4rem" v-if="form.T_State">
+        <el-tag v-if="form.T_State == '1'" type="success" effect="dark">未发布 </el-tag>
+        <el-tag v-else type="warning" effect="dark">已发布 </el-tag>
       </el-col>
     </el-row>
     <el-form :model="form" ref="formRef" :rules="rules">

+ 3 - 3
src/views/storehouse/Classify.vue

@@ -74,7 +74,7 @@ const AddUserName = (formEl: FormInstance | undefined) => {
         })
       }
       if (res.Code === 200) {
-        ElMessage.success('分类名称添加成功!!')
+        ElMessage.success('产品分类添加成功!!')
         nextTick(() => {
           drawerRef.value?.closeDrawer()
           TableRef.value?.getTableList()
@@ -90,7 +90,7 @@ const AddUserName = (formEl: FormInstance | undefined) => {
 
 // 删除
 const UserDelete = (row: any) => {
-  ElMessageBox.confirm('您确定要删除分类名称吗?', '警告', {
+  ElMessageBox.confirm('您确定要删除产品分类吗?', '警告', {
     confirmButtonText: '确定',
     cancelButtonText: '取消',
     type: 'warning'
@@ -145,7 +145,7 @@ const searchHandle = () => {
     </TableBase>
     <Drawer ref="drawerRef" :handleClose="callbackDrawer">
       <template #header="{ params }">
-        <h4 :id="params.titleId" :class="params.titleClass">{{ isNew ? '添加' : '编辑' }} - 产品名称</h4>
+        <h4 :id="params.titleId" :class="params.titleClass">{{ isNew ? '添加' : '编辑' }} - 产品分类</h4>
       </template>
       <el-form ref="ruleFormRef" :model="form" :rules="rules">
         <el-divider border-style="dashed" />

+ 2 - 3
src/views/storehouse/IoTNetworkCard.vue

@@ -42,7 +42,7 @@ const form = reactive({
 
 const validate_T_sn = (rule: any, value: any, callback: any) => {
   if (form.T_state === 2 && value === '') {
-    callback(new Error('请输入关联SN'))
+    callback(new Error('请输入已使用的关联SN'))
   } else {
     callback()
   }
@@ -82,7 +82,6 @@ const AddUserName = (formEl: FormInstance | undefined) => {
     if (valid) {
       let res: any = {}
       if (isNew.value) {
-        console.log(form)
         res = await Storehouse_IotCard_Add({ User_tokey: globalStore.GET_User_tokey, ...form })
       } else {
         res = await Storehouse_IotCard_Edit({
@@ -159,7 +158,7 @@ const searchHandle = () => {
               />
             </el-col>
             <el-col :xl="10" :md="12">
-              <span class="inline-flex items-center">产品分类:</span>
+              <span class="inline-flex items-center">状态:</span>
               <el-select v-model="initParam.T_state" class="w-50 m-2" clearable placeholder="请选择状态~">
                 <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>

+ 1 - 1
src/views/storehouse/List.vue

@@ -86,7 +86,7 @@ const AddUserName = (formEl: FormInstance | undefined) => {
 
 // 删除
 const UserDelete = (row: any) => {
-  ElMessageBox.confirm('您确定要删除该仓库名称吗?', '警告', {
+  ElMessageBox.confirm('您确定要删除该仓库吗?', '警告', {
     confirmButtonText: '确定',
     cancelButtonText: '取消',
     type: 'warning'

+ 2 - 4
src/views/storehouse/ProductionList.vue

@@ -40,7 +40,7 @@ const rules = reactive<FormRules>({
   T_name: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
   T_class: [{ required: true, message: '请选择产品分类', trigger: 'blur' }],
   T_model: [{ required: true, message: '请输入产品型号', trigger: 'blur' }],
-  T_spec: [{ required: true, message: '请选择仓库规格', trigger: 'blur' }],
+  T_spec: [{ required: true, message: '请选择产品规格', trigger: 'blur' }],
   T_relation_sn: [{ required: true, message: '请选择关联SN', trigger: 'blur' }]
 })
 const form = reactive({
@@ -236,9 +236,7 @@ onMounted(() => {
           <el-input v-model="form.T_model" type="text" autocomplete="off" placeholder="请输入产品型号" />
         </el-form-item>
         <el-form-item label="产品规格:" class="m-b-6" :label-width="formLabelWidth" prop="T_spec">
-          <el-select v-model="form.T_spec" placeholder="请选择产品规格~">
-            <el-option v-for="item in specList" :key="item.Id" :label="item.T_name" :value="item.T_name" />
-          </el-select>
+          <el-input v-model="form.T_spec" type="text" autocomplete="off" placeholder="请选择产品规格" />
         </el-form-item>
         <el-form-item label="关联SN:" class="m-b-6" :label-width="formLabelWidth" prop="T_relation_sn">
           <el-radio-group v-model="form.T_relation_sn" class="ml-4">

+ 2 - 0
src/views/storehouse/inventory/InStorageForm.vue

@@ -139,6 +139,8 @@ const deleteProduct = (row: any) => {
 
 const callbackDrawer = (done: Fn) => {
   resetForm(ruleFormRef.value)
+  drawerProductRef.value?.clearSelection()
+  drawerSnRef.value?.clearDeviceSn()
   done()
 }
 /**

+ 27 - 1
src/views/storehouse/inventory/InStorageProduct.vue

@@ -204,7 +204,20 @@ defineExpose({
                 <el-tag v-if="row.T_relation_sn === 1" effect="dark">是</el-tag>
                 <el-tag v-else type="success" effect="dark">否</el-tag>
               </span>
-              <el-image v-if="item.prop === 'T_img'" style="height: 50px" :src="row.T_img" fit="cover" />
+              <el-image
+                v-if="item.prop === 'T_img'"
+                fit="cover"
+                style="width: 50px; height: 50px"
+                :src="row.T_img"
+                :preview-src-list="[row.T_img]"
+                :preview-teleported="true"
+              >
+                <template #error>
+                  <div class="image-slot">
+                    <el-icon><Picture /></el-icon>
+                  </div>
+                </template>
+              </el-image>
             </template>
           </el-table-column>
           <el-table-column v-if="item.ellipsis && item.prop === 'T_model'" align="center" v-bind="item">
@@ -254,4 +267,17 @@ defineExpose({
     }
   }
 }
+.image-slot .el-icon {
+  font-size: 30px;
+}
+.image-slot {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  width: 100%;
+  height: 100%;
+  background: var(--el-fill-color-light);
+  color: var(--el-text-color-secondary);
+  font-size: 30px;
+}
 </style>

+ 24 - 16
src/views/storehouse/inventory/InStorageSn.vue

@@ -3,18 +3,17 @@ import { ref, reactive, nextTick } from 'vue'
 import Drawer from '@/components/Drawer/index.vue'
 import type { FormInstance, FormRules } from 'element-plus'
 import { Delete } from '@element-plus/icons-vue'
+import { Storehouse_Device_Check } from '@/api/storehouse/index'
 
 type Fn = () => void
 interface FormSnType {
-  Id: number | undefined
-  T_sn: string
-}
-interface SNType {
+  Id?: number
   sn: string
 }
+
 const snTable = ref()
-const SNDataMap = new Map<number, SNType[]>()
-const tableSnData = ref<any[]>([])
+const SNDataMap = new Map<number, FormSnType[]>()
+const tableSnData = ref<FormSnType[]>([])
 const ruleSnFormRef = ref<FormInstance>()
 const drawerSnRef = ref<InstanceType<typeof Drawer> | null>(null)
 
@@ -25,20 +24,23 @@ const snColumns = [
 ]
 const formSn = reactive<FormSnType>({
   Id: undefined,
-  T_sn: ''
+  sn: ''
 })
 const rulesSn = reactive<FormRules>({
-  T_sn: [{ required: true, message: '请输入SN号', trigger: 'blur' }]
+  sn: [{ required: true, message: '请输入SN号', trigger: 'blur' }]
 })
 
 const addSn = (formEl: FormInstance | undefined) => {
   if (!formEl) return
   formEl.validate(async valid => {
     if (valid) {
-      tableSnData.value.push({ sn: formSn.T_sn })
-      nextTick(() => {
-        resetSnForm(ruleSnFormRef.value)
-      })
+      const res: any = await Storehouse_Device_Check({ T_sn: formSn.sn })
+      if (res.Code === 200) {
+        tableSnData.value.push({ sn: formSn.sn })
+        nextTick(() => {
+          resetSnForm(ruleSnFormRef.value)
+        })
+      }
     }
   })
 }
@@ -66,14 +68,20 @@ const resetSnForm = (formEl: FormInstance | undefined) => {
 
 const addDeviceSn = (id: number) => {
   formSn.Id = id
-  SNDataMap.set(id, [])
+  if (SNDataMap.has(id)) {
+    tableSnData.value = SNDataMap.get(id) as FormSnType[]
+  } else {
+    SNDataMap.set(id, [])
+  }
   drawerSnRef.value?.openDrawer()
 }
-const deleteDeviceSn = (id: number) => SNDataMap.delete(id)
 const getDeviceSn = () => SNDataMap
+const clearDeviceSn = () => SNDataMap.clear()
+const deleteDeviceSn = (id: number) => SNDataMap.delete(id)
 defineExpose({
   getDeviceSn,
   addDeviceSn,
+  clearDeviceSn,
   deleteDeviceSn
 })
 </script>
@@ -84,8 +92,8 @@ defineExpose({
       <template #header>
         <div class="sn-header">
           <el-form ref="ruleSnFormRef" :model="formSn" :rules="rulesSn">
-            <el-form-item label="SN:" label-width="120px" prop="T_sn">
-              <el-input v-model="formSn.T_sn" type="text" placeholder="请输入SN" class="w-50" />
+            <el-form-item label="SN:" label-width="120px" prop="sn">
+              <el-input v-model="formSn.sn" type="text" placeholder="请输入SN" class="w-50" />
             </el-form-item>
           </el-form>
           <el-button type="primary" @click="addSn(ruleSnFormRef)">添加</el-button>

+ 1 - 2
src/views/storehouse/outStock/OutStockProduct.vue

@@ -74,8 +74,6 @@ const getRowKey = (row: any) => {
 
 // 加载第二个抽屉数据
 const load = () => {
-  console.log(initParam.page, total, tableProductData.value.length)
-
   if (initParam.page && total === tableProductData.value.length) {
     ElMessage.warning('没有更多数据了!!')
     return
@@ -122,6 +120,7 @@ const productColumns = [
   { prop: 'T_product_class_name', label: '产品分类' },
   { prop: 'T_product_model', label: '产品型号', ellipsis: true },
   { prop: 'T_product_spec', label: '产品规格' },
+  { prop: 'T_total', label: '库存数量' },
   { prop: 'T_product_relation_sn', label: '关联SN', name: 'T_product_relation_sn' }
 ]
 

+ 2 - 1
src/views/storehouse/outStock/ReceiveOutStock.vue

@@ -133,7 +133,6 @@ const AddInStorage = (formEl: FormInstance | undefined) => {
       })
       if (res.Code === 200) {
         ElMessage.success('出库成功!')
-        drawerProductRef.value?.clearSelection()
         nextTick(() => {
           resetForm(ruleFormRef.value)
           router.back()
@@ -162,6 +161,8 @@ const closeReceive = () => {
 const resetForm = (formEl: FormInstance | undefined) => {
   if (!formEl) return
   tableData.value = []
+  drawerSnRef.value?.clearDeviceSn()
+  drawerProductRef.value?.clearSelection()
   formEl.resetFields()
 }
 /**

+ 2 - 3
src/views/storehouse/outStock/SaleOutStock.vue

@@ -172,7 +172,6 @@ const selectDepot = (val: any) => {
 /**
  * 选择合同
  */
-const inputContractRef = ref()
 const selectContract = () => contractNumberRef.value?.openDrawer()
 const getContactInfo = ({ T_number }: { T_number: string }) => {
   if (form.value.T_contract_number === T_number) return
@@ -219,6 +218,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
  */
 const closeSaleOutStock = () => {
   resetForm(ruleFormRef.value)
+  drawerSnRef.value?.clearDeviceSn()
   router.back()
 }
 /**
@@ -231,11 +231,10 @@ const AddSaleOutStock = (formEl: FormInstance | undefined) => {
     if (valid) {
       const res: any = await Storehouse_StockOut_Add({
         User_tokey: globalStore.GET_User_tokey,
-        ...form,
+        ...form.value,
         T_product: form.value.T_product.join(''),
         T_receive: form.value.T_uuid
       })
-      console.log(res)
       if (res.Code === 200) {
         ElMessage.success('出库成功!')
         nextTick(() => {

+ 5 - 12
src/views/storehouse/outStock/receiveUser.vue

@@ -12,7 +12,7 @@ const globalStore = GlobalStore()
 const drawerRef = ref<InstanceType<typeof Drawer> | null>(null)
 const tableRef = ref<InstanceType<typeof TableBase> | null>(null)
 
-const Dialogcolumns: ColumnProps[] = [{ prop: 'T_name', label: '名字', name: 'T_name' }]
+const Dialogcolumns: ColumnProps[] = [{ prop: 'T_name', label: '名字' }]
 const InitParam = {
   User_tokey: globalStore.GET_User_tokey,
   T_name: '',
@@ -27,19 +27,14 @@ const searchHandle = () => {
  */
 const getApproverInfo = (row: any) => {
   emit('onUserInfo', row)
-  console.log('colse')
   drawerRef.value?.closeDrawer()
 }
-const callbackDrawer = (done: () => void) => {
-  done()
-}
+const callbackDrawer = (done: () => void) => done()
 
 const emit = defineEmits<{ (event: 'onUserInfo', value: any): void }>()
 
-const openDrawer = () => {
-  console.log('open')
-  drawerRef.value?.openDrawer()
-}
+const openDrawer = () => drawerRef.value?.openDrawer()
+
 defineExpose({
   openDrawer
 })
@@ -57,6 +52,7 @@ defineExpose({
         :initParam="InitParam"
         :requestApi="User_List"
         layout="total, prev, pager, next"
+        :rowClick="getApproverInfo"
       >
         <template #table-header>
           <el-row :gutter="20">
@@ -67,9 +63,6 @@ defineExpose({
             </el-col>
           </el-row>
         </template>
-        <template #T_name="{ row }">
-          <el-button type="primary" link @click="getApproverInfo(row)">{{ row.T_name }}</el-button>
-        </template>
       </TableBase>
     </Drawer>
   </div>

+ 89 - 12
src/views/workAttendance/Overtime.vue

@@ -105,7 +105,55 @@ const tableRowClassName = (data: any): any => {
       leave-active-class="animate__animated animate__bounceOutRight"
       enter-active-class="animate__animated animate__bounceInDown"
     >
-      <el-row class="h-100 f-1 margin-left-3" v-if="userInfo.Id">
+      <div class="Overtime-container" v-if="userInfo.Id">
+        <el-card class="m-b-3 b-show-0">
+          <h3 class="title-user m-b-5">员工基本信息</h3>
+          <div class="info-content">
+            <el-avatar shape="square" size="large" :icon="UserFilled" />
+            <div class="info-name">
+              <h4 class="m-b-3">名字:{{ userInfo.T_user_name }}</h4>
+            </div>
+          </div>
+          <div class="Overtime-content">
+            <div>
+              开始时间:<el-tag v-if="userInfo.T_start_time" type="success" effect="dark">
+                {{ userInfo.T_start_time }}
+              </el-tag>
+            </div>
+            <div>
+              结束时间:<el-tag v-if="userInfo.T_end_time" type="success" effect="dark">
+                {{ userInfo.T_end_time }}
+              </el-tag>
+            </div>
+            <div>
+              加班时长:<el-tag v-if="userInfo.T_duration" type="success" effect="dark">
+                {{ getFormatDuration(userInfo.T_duration as any) }}
+              </el-tag>
+            </div>
+            <div style="display: flex">
+              <span>取证:</span>
+              <el-image
+                v-if="userInfo.T_prove_img"
+                style="width: 200px"
+                :preview-src-list="[userInfo.T_prove_img]"
+                :preview-teleported="true"
+                :src="userInfo.T_prove_img"
+                fit="cover"
+              />
+              <span v-else>无</span>
+            </div>
+            <div>
+              <span class="ml-3 w-35 text-gray-600 inline-flex items-center">内容:</span>
+              {{ userInfo.T_text }}
+            </div>
+          </div>
+          <div class="btn">
+            <el-button type="primary" @click="LeaveUser(1)">通过</el-button>
+            <el-button type="danger" @click="LeaveUser(0)">不通过</el-button>
+          </div>
+        </el-card>
+      </div>
+      <!-- <el-row class="h-100 f-1 margin-left-3" v-if="userInfo.Id">
         <el-col :span="24" class="h-100" style="overflow: hidden; display: flex; flex-direction: column">
           <el-card class="m-b-3 b-show-0">
             <h3 class="title-user m-b-5">员工基本信息</h3>
@@ -152,12 +200,6 @@ const tableRowClassName = (data: any): any => {
             <el-row>
               <el-col>
                 <span class="ml-3 w-35 text-gray-600 inline-flex items-center">内容:</span>
-                <!-- <el-input
-                  v-model="userInfo.T_text"
-                  :autosize="{ minRows: 4, maxRows: 6 }"
-                  type="textarea"
-                  placeholder="加班内容"
-                /> -->
                 {{ userInfo.T_text }}
               </el-col>
             </el-row>
@@ -167,13 +209,48 @@ const tableRowClassName = (data: any): any => {
             </div>
           </el-card>
         </el-col>
-      </el-row>
+      </el-row> -->
     </transition>
   </div>
 </template>
 
 <style scoped lang="scss">
 @import '@/styles/var.scss';
+
+.Overtime-container {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  .el-card {
+    width: 50%;
+    height: 60%;
+    border-radius: 12px;
+    h3 {
+      font-size: 24px;
+      text-align: center;
+    }
+    :deep(.el-card__body) {
+      display: flex;
+      flex-direction: column;
+      height: 100%;
+    }
+  }
+  .Overtime-content {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    overflow: auto;
+    // justify-content: space-between;
+    margin-top: 20px;
+    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 微软雅黑, Arial,
+      sans-serif;
+    font-size: 14px;
+    div {
+      margin-bottom: 10px;
+    }
+  }
+}
 .Overtime {
   display: flex;
   height: 100%;
@@ -197,7 +274,7 @@ const tableRowClassName = (data: any): any => {
   }
   :deep(.el-card .el-card__body) {
     font-weight: bold;
-    color: var(--el-text-color-secondary);
+    // color: var(--el-text-color-secondary);
   }
   .f-1 {
     flex: 1;
@@ -207,16 +284,16 @@ const tableRowClassName = (data: any): any => {
     text-align: center;
   }
   .title-user {
-    text-align: left;
+    // text-align: left;
   }
   .btn {
-    margin-top: 2rem;
+    margin-top: 1rem;
     display: flex;
     justify-content: end;
   }
   .info-content {
     display: flex;
-    color: #606266;
+    // color: #606266;
     .info-name {
       display: flex;
       // flex-direction: column;