瀏覽代碼

完成系统管理ui

zhangjie 1 年之前
父節點
當前提交
7c9110e484

+ 1 - 0
src/api/system.js

@@ -153,6 +153,7 @@ export const checkinQueryApi = (data) =>
   request({
   request({
     url: '/api/sys/ding/group/query',
     url: '/api/sys/ding/group/query',
     params: data,
     params: data,
+    paramsSerializer,
   });
   });
 export const checkinListApi = (data) =>
 export const checkinListApi = (data) =>
   request({
   request({

+ 12 - 8
src/components/common/select-enable/index.vue

@@ -8,19 +8,23 @@
 </template>
 </template>
 
 
 <script setup name="SelectEnable">
 <script setup name="SelectEnable">
-import { ref, watch } from 'vue';
+import { computed, ref, watch } from 'vue';
 import { ABLE_TYPE } from '@/config/constants';
 import { ABLE_TYPE } from '@/config/constants';
 
 
-let optionList = ref([]);
-let selected = ref('');
-
-optionList.value = Object.keys(ABLE_TYPE).map((k) => {
-  return { value: k === 'true', label: ABLE_TYPE[k] };
-});
-
 const emit = defineEmits(['update:modelValue', 'change']);
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
 const props = defineProps({
   modelValue: { type: [Boolean, String], default: '' },
   modelValue: { type: [Boolean, String], default: '' },
+  options: { type: Object },
+});
+
+let selected = ref('');
+
+const optionList = computed(() => {
+  const data = props.options ?? ABLE_TYPE;
+
+  return Object.keys(data).map((k) => {
+    return { value: k === 'true', label: data[k] };
+  });
 });
 });
 
 
 const onChange = () => {
 const onChange = () => {

+ 5 - 0
src/config/constants.js

@@ -22,6 +22,11 @@ export const EDUCATION_TYPE = {
   MIDDLE_SCHOOL: '初中',
   MIDDLE_SCHOOL: '初中',
 };
 };
 // 启用/禁用
 // 启用/禁用
+export const TRUE_OR_FALSE_TYPE = {
+  true: '是',
+  false: '否',
+};
+// 启用/禁用
 export const ABLE_TYPE = {
 export const ABLE_TYPE = {
   true: '启用',
   true: '启用',
   false: '禁用',
   false: '禁用',

+ 7 - 0
src/style/global.less

@@ -260,6 +260,9 @@ body {
 .text-indent {
 .text-indent {
   text-indent: 2em;
   text-indent: 2em;
 }
 }
+.width-full {
+  width: 100%;
+}
 .red {
 .red {
   color: @error-color;
   color: @error-color;
 }
 }
@@ -267,6 +270,10 @@ body {
   color: @light-text-color;
   color: @light-text-color;
 }
 }
 
 
+.color-warning {
+  color: @warning-color;
+}
+
 // pages ---------------->
 // pages ---------------->
 // message-list
 // message-list
 .message-list {
 .message-list {

+ 46 - 21
src/views/system/config-manage/checkin-manage/edit-checkin-dialog.vue

@@ -2,32 +2,24 @@
   <my-dialog
   <my-dialog
     :visible="visible"
     :visible="visible"
     :header="title"
     :header="title"
-    :width="900"
+    :width="600"
     attach="body"
     attach="body"
     :closeOnOverlayClick="false"
     :closeOnOverlayClick="false"
     @close="emit('update:visible', false)"
     @close="emit('update:visible', false)"
   >
   >
-    <t-form ref="formRef" :data="formData" :rules="rules" :labelWidth="120">
-      <t-row :gutter="[0, 20]">
+    <t-form ref="formRef" :data="formData" :rules="rules" labelAlign="top">
+      <t-row :gutter="[20, 20]">
         <t-col :span="6">
         <t-col :span="6">
           <t-form-item label="考勤组名称" name="name">
           <t-form-item label="考勤组名称" name="name">
             <t-input v-model="formData.name" clearable />
             <t-input v-model="formData.name" clearable />
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
-        <t-col :span="6">
-          <t-form-item label="服务单元" name="serviceId">
-            <select-service-unit
-              v-model="formData.serviceId"
-              :filterParams="{}"
-            >
-            </select-service-unit>
-          </t-form-item>
-        </t-col>
+
         <t-col :span="6">
         <t-col :span="6">
           <t-form-item label="适用考勤对象" name="dingRoleIds">
           <t-form-item label="适用考勤对象" name="dingRoleIds">
             <select-role
             <select-role
               v-model="formData.dingRoleIds"
               v-model="formData.dingRoleIds"
-              :min-collapsed-num="2"
+              :min-collapsed-num="1"
               :filterable="false"
               :filterable="false"
               multiple
               multiple
             >
             >
@@ -40,16 +32,27 @@
             </select-supplier>
             </select-supplier>
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
-        <t-col :span="6">
+        <t-col :span="12">
           <t-form-item label="签到时段" name="signInTime">
           <t-form-item label="签到时段" name="signInTime">
-            <t-time-range-picker v-model="formData.signInTime" format="HH:mm" />
+            <t-time-range-picker
+              v-model="formData.signInTime"
+              format="HH:mm"
+              class="width-full"
+            />
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
-        <t-col :span="6">
-          <t-form-item label="签退时段" name="signOutTime">
+        <t-col :span="12">
+          <t-form-item name="signOutTime">
+            <template #label>
+              <span>签退时段</span>
+              <span class="color-warning m-l-5px"
+                >(签到时段设置后,24小时未覆盖到的时段默认为签退时段)</span
+              >
+            </template>
             <t-time-range-picker
             <t-time-range-picker
               v-model="formData.signOutTime"
               v-model="formData.signOutTime"
               format="HH:mm"
               format="HH:mm"
+              class="width-full"
             />
             />
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
@@ -57,7 +60,7 @@
           <t-form-item label="审核角色" name="approveRoleIds">
           <t-form-item label="审核角色" name="approveRoleIds">
             <select-role
             <select-role
               v-model="formData.approveRoleIds"
               v-model="formData.approveRoleIds"
-              :min-collapsed-num="2"
+              :min-collapsed-num="1"
               :filterable="false"
               :filterable="false"
               multiple
               multiple
             >
             >
@@ -65,8 +68,11 @@
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
         <t-col :span="6">
         <t-col :span="6">
-          <t-form-item label="是否开启人脸" name="faceOpen">
-            <t-switch v-model="formData.faceOpen" />
+          <t-form-item label="是否开启人脸" name="faceOpen" required-mark>
+            <select-enable
+              v-model="formData.faceOpen"
+              :options="TRUE_OR_FALSE_TYPE"
+            />
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
         <t-col :span="6">
         <t-col :span="6">
@@ -75,9 +81,20 @@
               v-model="formData.reissueCardCount"
               v-model="formData.reissueCardCount"
               :decimalPlaces="0"
               :decimalPlaces="0"
               :min="1"
               :min="1"
+              theme="column"
+              style="width: 100%"
             />
             />
           </t-form-item>
           </t-form-item>
         </t-col>
         </t-col>
+        <t-col :span="6">
+          <t-form-item label="服务单元" name="serviceId">
+            <select-service-unit
+              v-model="formData.serviceId"
+              :filterParams="{}"
+            >
+            </select-service-unit>
+          </t-form-item>
+        </t-col>
       </t-row>
       </t-row>
     </t-form>
     </t-form>
     <template #foot>
     <template #foot>
@@ -92,9 +109,9 @@
 import { ref, computed } from 'vue';
 import { ref, computed } from 'vue';
 import { MessagePlugin } from 'tdesign-vue-next';
 import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import useClearDialog from '@/hooks/useClearDialog';
-// import { CUSTOMER_TYPE } from '@/config/constants';
 import { checkinEditApi } from '@/api/system';
 import { checkinEditApi } from '@/api/system';
 import { omit } from 'lodash';
 import { omit } from 'lodash';
+import { TRUE_OR_FALSE_TYPE } from '@/config/constants';
 const emit = defineEmits(['update:visible', 'success']);
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 const formRef = ref(null);
 
 
@@ -200,6 +217,14 @@ const rules = {
       trigger: 'change',
       trigger: 'change',
     },
     },
   ],
   ],
+  reissueCardCount: [
+    {
+      required: true,
+      message: '允许补卡次数必填',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
 };
 };
 const save = async () => {
 const save = async () => {
   const valid = await formRef.value.validate();
   const valid = await formRef.value.validate();

+ 129 - 9
src/views/system/config-manage/checkin-manage/index.vue

@@ -13,6 +13,32 @@
           :filterParams="{}"
           :filterParams="{}"
         ></select-service-unit>
         ></select-service-unit>
       </template>
       </template>
+      <template #supplier="{ item, params }">
+        <select-supplier
+          v-model="params[item.prop]"
+          :min-collapsed-num="1"
+          :filterable="false"
+          multiple
+        ></select-supplier>
+      </template>
+      <template #dingRole="{ item, params }">
+        <select-role
+          v-model="params[item.prop]"
+          :min-collapsed-num="1"
+          :filterable="false"
+          multiple
+        >
+        </select-role>
+      </template>
+      <template #approveRole="{ item, params }">
+        <select-role
+          v-model="params[item.prop]"
+          :min-collapsed-num="1"
+          :filterable="false"
+          multiple
+        >
+        </select-role>
+      </template>
     </SearchForm>
     </SearchForm>
     <div class="flex-1 page-wrap">
     <div class="flex-1 page-wrap">
       <t-table
       <t-table
@@ -52,7 +78,7 @@
           }}
           }}
         </template>
         </template>
         <template #status="{ col, row }">
         <template #status="{ col, row }">
-          {{ serviceUnitStatusFilter(row[col.colKey]) }}
+          <status-tag :value="row[col.colKey]" type="serviceUnit"></status-tag>
         </template>
         </template>
         <template #create-time="{ col, row }">
         <template #create-time="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
           {{ timestampFilter(row[col.colKey]) }}
@@ -79,13 +105,16 @@
 </template>
 </template>
 
 
 <script setup name="CheckinManage">
 <script setup name="CheckinManage">
-import { ref, reactive, onMounted } from 'vue';
+import { ref, reactive, onMounted, computed } from 'vue';
 import { useRoute } from 'vue-router';
 import { useRoute } from 'vue-router';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditCheckinDialog from './edit-checkin-dialog.vue';
 import EditCheckinDialog from './edit-checkin-dialog.vue';
 import { checkinQueryApi, checkinDeleteApi } from '@/api/system';
 import { checkinQueryApi, checkinDeleteApi } from '@/api/system';
-import { timestampFilter, serviceUnitStatusFilter } from '@/utils/filter';
+import { timestampFilter } from '@/utils/filter';
+import { SERVICE_UNIT_STATUS } from '@/config/constants';
+import { dictToOptionList } from '@/utils/tool';
+import { omit } from 'lodash';
 
 
 const showEditCheckinDialog = ref(false);
 const showEditCheckinDialog = ref(false);
 const curRow = ref(null);
 const curRow = ref(null);
@@ -100,6 +129,36 @@ const fields = ref([
     labelWidth: 100,
     labelWidth: 100,
     colSpan: 5,
     colSpan: 5,
     cell: 'service',
     cell: 'service',
+    attrs: {
+      clearable: true,
+    },
+  },
+  {
+    prop: 'status',
+    label: '服务单元发布状态',
+    type: 'select',
+    labelWidth: 160,
+    colSpan: 5,
+    options: dictToOptionList(SERVICE_UNIT_STATUS),
+    attrs: {
+      clearable: true,
+    },
+  },
+  {
+    prop: 'supplierIds',
+    label: '适用供应商',
+    type: 'select',
+    labelWidth: 100,
+    colSpan: 5,
+    cell: 'supplier',
+  },
+  {
+    prop: 'dingRoleIds',
+    label: '适用考勤对象',
+    type: 'select',
+    labelWidth: 100,
+    colSpan: 5,
+    cell: 'dingRole',
   },
   },
   {
   {
     type: 'buttons',
     type: 'buttons',
@@ -114,14 +173,59 @@ const fields = ref([
       },
       },
     ],
     ],
   },
   },
+  {
+    prop: 'approveRoleIds',
+    label: '审核角色',
+    type: 'select',
+    labelWidth: 100,
+    colSpan: 5,
+    cell: 'approveRole',
+  },
+  {
+    prop: 'faceOpen',
+    label: '是否开启人脸',
+    type: 'select',
+    labelWidth: 160,
+    colSpan: 5,
+    options: [
+      {
+        label: '是',
+        value: 1,
+      },
+      {
+        label: '否',
+        value: 0,
+      },
+    ],
+    attrs: {
+      clearable: true,
+    },
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间',
+    type: 'daterange',
+    labelWidth: 100,
+    colSpan: 10,
+    attrs: {
+      clearable: true,
+      valueType: 'time-stamp',
+    },
+  },
 ]);
 ]);
 const params = reactive({
 const params = reactive({
   serviceId: '',
   serviceId: '',
+  status: '',
+  supplierIds: '',
+  dingRoleIds: '',
+  approveRoleIds: '',
+  faceOpen: null,
+  createTime: [],
 });
 });
 
 
 const columns = [
 const columns = [
-  { colKey: 'service', title: '服务单元', minWidth: 120 },
-  { colKey: 'status', title: '发布状态', cell: 'status', width: 100 },
+  { colKey: 'service', title: '服务单元', minWidth: 140 },
+  { colKey: 'status', title: '服务单元发布状态', width: 100 },
   { colKey: 'name', title: '考勤组名称', minWidth: 140 },
   { colKey: 'name', title: '考勤组名称', minWidth: 140 },
   {
   {
     colKey: 'dingObjs',
     colKey: 'dingObjs',
@@ -129,13 +233,18 @@ const columns = [
     cell: 'ding-objs',
     cell: 'ding-objs',
     minWidth: 200,
     minWidth: 200,
   },
   },
-  { colKey: 'supplier', title: '适用供应商', minWidth: 140 },
+  { colKey: 'supplier', title: '适用供应商', minWidth: 200 },
   { colKey: 'signInTime', title: '签到时段', width: 160 },
   { colKey: 'signInTime', title: '签到时段', width: 160 },
   { colKey: 'signOutTime', title: '签退时段', width: 160 },
   { colKey: 'signOutTime', title: '签退时段', width: 160 },
-  { colKey: 'auditRoles', title: '审核角色', cell: 'approve-objs', width: 120 },
+  {
+    colKey: 'auditRoles',
+    title: '审核角色',
+    cell: 'approve-objs',
+    minWidth: 200,
+  },
   { colKey: 'faceOpen', title: '是否开启人脸', cell: 'face-open', width: 120 },
   { colKey: 'faceOpen', title: '是否开启人脸', cell: 'face-open', width: 120 },
   { colKey: 'reissueCardCount', title: '允许补卡次数', width: 120 },
   { colKey: 'reissueCardCount', title: '允许补卡次数', width: 120 },
-  { colKey: 'createName', title: '创建人', with: 120 },
+  { colKey: 'createName', title: '创建人', with: 140 },
   { colKey: 'createTime', title: '创建时间', cell: 'create-time', width: 180 },
   { colKey: 'createTime', title: '创建时间', cell: 'create-time', width: 180 },
   {
   {
     title: '管理',
     title: '管理',
@@ -144,6 +253,17 @@ const columns = [
     width: 120,
     width: 120,
   },
   },
 ];
 ];
+
+const computedParams = computed(() => {
+  let data = omit(params, ['createTime']);
+  data.createStartTime = params.createTime[0];
+  data.createEndTime = params.createTime[1];
+  if (typeof data.faceOpen === 'number') {
+    data.faceOpen = !!data.faceOpen;
+  }
+  return data;
+});
+
 const {
 const {
   loading: tableLoading,
   loading: tableLoading,
   pagination,
   pagination,
@@ -151,7 +271,7 @@ const {
   fetchData,
   fetchData,
   search,
   search,
   onChange,
   onChange,
-} = useFetchTable(checkinQueryApi, { params }, false);
+} = useFetchTable(checkinQueryApi, { params: computedParams }, false);
 
 
 const handleAdd = () => {
 const handleAdd = () => {
   curRow.value = null;
   curRow.value = null;

+ 1 - 5
src/views/system/notice-log/notice-manage/index.vue

@@ -119,11 +119,7 @@ import {
 } from '@/api/system';
 } from '@/api/system';
 import { dictToOptionList } from '@/utils/tool';
 import { dictToOptionList } from '@/utils/tool';
 import { NOTICE_TYPE, PUBLISH_STATUS } from '@/config/constants';
 import { NOTICE_TYPE, PUBLISH_STATUS } from '@/config/constants';
-import {
-  noticeTypeFilter,
-  publishStatusFilter,
-  timestampFilter,
-} from '@/utils/filter';
+import { noticeTypeFilter, timestampFilter } from '@/utils/filter';
 
 
 const showEditNoticeDialog = ref(false);
 const showEditNoticeDialog = ref(false);
 const showNoticeMessageDialog = ref(false);
 const showNoticeMessageDialog = ref(false);