Browse Source

Merge branch 'master' of http://git.qmth.com.cn/sop/web

刘洋 1 năm trước cách đây
mục cha
commit
0e3fcb50b7
29 tập tin đã thay đổi với 770 bổ sung346 xóa
  1. 8 1
      src/api/project-quality.js
  2. 57 0
      src/api/resource-guard.js
  3. 76 36
      src/api/system.js
  4. 18 3
      src/components/global/search-form/index.vue
  5. 17 11
      src/config/constants.js
  6. 1 0
      src/hooks/useFetchTable.js
  7. 6 1
      src/mock/index.js
  8. 45 33
      src/mock/system.js
  9. 26 0
      src/utils/filter.js
  10. 11 0
      src/utils/tool.js
  11. 6 2
      src/views/project-quality/project-quality-manage/issues-feedback/index.vue
  12. 7 27
      src/views/project-quality/project-quality-manage/issues-query/index.vue
  13. 8 12
      src/views/resource-guard/device-guard/registration-query/index.vue
  14. 78 15
      src/views/resource-guard/person-guard/person-allocate/index.vue
  15. 110 15
      src/views/resource-guard/person-guard/person-files/add-person-file-dialog.vue
  16. 91 33
      src/views/resource-guard/person-guard/person-files/index.vue
  17. 26 27
      src/views/system/config-manage/checkin-manage/edit-checkin-dialog.vue
  18. 13 12
      src/views/system/config-manage/checkin-manage/index.vue
  19. 9 9
      src/views/system/config-manage/customer-manage/edit-customer-dialog.vue
  20. 39 25
      src/views/system/config-manage/customer-manage/index.vue
  21. 9 9
      src/views/system/config-manage/device-manage/edit-device-dialog.vue
  22. 5 4
      src/views/system/config-manage/device-manage/index.vue
  23. 24 19
      src/views/system/config-manage/service-level-manage/edit-service-level-dialog.vue
  24. 16 7
      src/views/system/config-manage/service-level-manage/index.vue
  25. 2 2
      src/views/system/config-manage/supplier-manage/edit-supplier-dialog.vue
  26. 42 35
      src/views/system/config-manage/supplier-manage/index.vue
  27. 8 3
      src/views/system/notice-log/notice-manage/index.vue
  28. 6 2
      src/views/work-hours/work-hours-manage/abnormal-check/wait-check.vue
  29. 6 3
      src/views/work-hours/work-hours-manage/work-attendance/index.vue

+ 8 - 1
src/api/project-quality.js

@@ -1,6 +1,6 @@
 import { request } from '@/utils/request.js';
 
-// issues-feedback
+// issuse-feedback
 export const issuesFeedbackListApi = (data) =>
   request({
     url: '/api/system/issuse-feedback/list',
@@ -11,3 +11,10 @@ export const issuesFeedbackDestroyApi = (ids) =>
     url: '/api/system/issuse-feedback/destroy',
     data: { ids },
   });
+
+// issues-query
+export const issuesQueryListApi = (data) =>
+  request({
+    url: '/api/system/issuse-query/list',
+    data,
+  });

+ 57 - 0
src/api/resource-guard.js

@@ -0,0 +1,57 @@
+import { request } from '@/utils/request.js';
+
+// person-files
+export const personFilesListApi = (data) =>
+  request({
+    url: '/api/system/person-files/list',
+    data,
+  });
+export const personFilesEditApi = (data) => {
+  if (data.id) {
+    return request({
+      url: '/api/system/person-files/edit',
+      data,
+    });
+  } else {
+    return request({
+      url: '/api/system/person-files/add',
+      data,
+    });
+  }
+};
+export const personFilesDestroyApi = (ids) =>
+  request({
+    url: '/api/system/person-files/destroy',
+    data: { ids },
+  });
+
+export const personFilesExportApi = (ids) =>
+  request({
+    url: '/api/system/person-files/export',
+    data: { ids },
+    download: true,
+  });
+
+// person-allocate
+export const personAllocateListApi = (data) =>
+  request({
+    url: '/api/system/person-allocate/list',
+    data,
+  });
+export const personAllocateStatisticsApi = (data) =>
+  request({
+    url: '/api/system/person-allocate/statistics',
+    data,
+  });
+export const personAllocateSubmitSopApi = (data) =>
+  request({
+    url: '/api/system/person-allocate/submit-sop',
+    data,
+  });
+
+// registration-query
+export const registrationQueryListApi = (data) =>
+  request({
+    url: '/api/system/registration-query/list',
+    data,
+  });

+ 76 - 36
src/api/system.js

@@ -1,168 +1,208 @@
 import { request } from '@/utils/request.js';
 
 // customer-manage
-export const customerListApi = (data) =>
+export const customeryQueryApi = (data) =>
   request({
-    url: '/api/system/customer/list',
-    data,
+    url: '/api/sys/custom/query',
+    params: data,
+  });
+export const customerDetailApi = (id) =>
+  request({
+    url: '/api/sys/custom/get',
+    params: { id },
   });
 export const customerEditApi = (data) => {
   if (data.id) {
     return request({
-      url: '/api/system/customer/edit',
+      url: '/api/sys/custom/update',
       data,
     });
   } else {
     return request({
-      url: '/api/system/customer/add',
+      url: '/api/sys/custom/add',
       data,
     });
   }
 };
 export const customerDeleteApi = (id) =>
   request({
-    url: '/api/system/customer/delete',
-    data: { id },
+    url: '/api/sys/custom/delete',
+    params: { id },
   });
 
 // supplier-manage
+export const supplierQueryApi = (data) =>
+  request({
+    url: '/api/sys/supplier/query',
+    params: data,
+  });
 export const supplierListApi = (data) =>
   request({
-    url: '/api/system/supplier/list',
-    data,
+    url: '/api/sys/supplier/list',
+    params: data,
+  });
+export const supplierDetailApi = (id) =>
+  request({
+    url: '/api/sys/supplier/get',
+    params: { id },
   });
 export const supplierEditApi = (data) => {
   if (data.id) {
     return request({
-      url: '/api/system/supplier/edit',
+      url: '/api/sys/supplier/update',
       data,
     });
   } else {
     return request({
-      url: '/api/system/supplier/add',
+      url: '/api/sys/supplier/add',
       data,
     });
   }
 };
-export const supplierEnableApi = ({ id, enable }) =>
+export const supplierEnableApi = (id) =>
   request({
-    url: '/api/system/supplier/enable',
-    data: { id, enable },
+    url: '/api/sys/supplier/enable',
+    params: { id },
   });
 
 // device-manage
+export const deviceQueryApi = (data) =>
+  request({
+    url: '/api/sys/device/query',
+    params: data,
+  });
 export const deviceListApi = (data) =>
   request({
-    url: '/api/system/device/list',
-    data,
+    url: '/api/sys/device/list',
+    params: data,
+  });
+export const deviceDetailApi = (id) =>
+  request({
+    url: '/api/sys/device/get',
+    params: { id },
   });
 export const deviceEditApi = (data) => {
   if (data.id) {
     return request({
-      url: '/api/system/device/edit',
+      url: '/api/sys/device/update',
       data,
     });
   } else {
     return request({
-      url: '/api/system/device/add',
+      url: '/api/sys/device/add',
       data,
     });
   }
 };
 export const deviceDestroyApi = (id) =>
   request({
-    url: '/api/system/device/destroy',
-    data: { id },
+    url: '/api/sys/device/delete',
+    params: { id },
   });
 
 // service-level-manage
+export const serviceLevelQueryApi = (data) =>
+  request({
+    url: '/api/sys/level/query',
+    params: data,
+  });
 export const serviceLevelListApi = (data) =>
   request({
-    url: '/api/system/service-level/list',
-    data,
+    url: '/api/sys/level/list',
+    params: data,
+  });
+export const serviceLevelDetailApi = (id) =>
+  request({
+    url: '/api/sys/level/get',
+    params: { id },
   });
 export const serviceLevelEditApi = (data) => {
   if (data.id) {
     return request({
-      url: '/api/system/service-level/edit',
+      url: '/api/sys/level/update',
       data,
     });
   } else {
     return request({
-      url: '/api/system/service-level/add',
+      url: '/api/sys/level/add',
       data,
     });
   }
 };
 export const serviceLevelDeleteApi = (id) =>
   request({
-    url: '/api/system/service-level/delete',
+    url: '/api/sys/level/delete',
     data: { id },
   });
 
 // checkin-manage
+export const checkinQueryApi = (data) =>
+  request({
+    url: '/api/sys/ding/group/query',
+    data,
+  });
 export const checkinListApi = (data) =>
   request({
-    url: '/api/system/checkin/list',
+    url: '/api/sys/ding/group/list',
     data,
   });
 export const checkinEditApi = (data) => {
   if (data.id) {
     return request({
-      url: '/api/system/checkin/edit',
+      url: '/api/sys/ding/group/update',
       data,
     });
   } else {
     return request({
-      url: '/api/system/checkin/add',
+      url: '/api/sys/ding/group/add',
       data,
     });
   }
 };
 export const checkinDeleteApi = (id) =>
   request({
-    url: '/api/system/checkin/delete',
+    url: '/api/sys/ding/group/delete',
     data: { id },
   });
 
 // log-manage
 export const logListApi = (data) =>
   request({
-    url: '/api/system/log/list',
+    url: '/api/sys/log/list',
     data,
   });
 
 // notice-manage
 export const noticeListApi = (data) =>
   request({
-    url: '/api/system/notice/list',
+    url: '/api/sys/notice/list',
     data,
   });
 export const noticeEditApi = (data) => {
   if (data.id) {
     return request({
-      url: '/api/system/notice/edit',
+      url: '/api/sys/notice/edit',
       data,
     });
   } else {
     return request({
-      url: '/api/system/notice/add',
+      url: '/api/sys/notice/add',
       data,
     });
   }
 };
 export const noticePublishApi = (id) =>
   request({
-    url: '/api/system/notice/publish',
+    url: '/api/sys/notice/publish',
     data: { id },
   });
 export const noticeCancelPublishApi = (id) =>
   request({
-    url: '/api/system/notice/cancel-publish',
+    url: '/api/sys/notice/cancel-publish',
     data: { id },
   });
 export const noticeDestroyApi = (id) =>
   request({
-    url: '/api/system/notice/destroy',
+    url: '/api/sys/notice/destroy',
     data: { id },
   });

+ 18 - 3
src/components/global/search-form/index.vue

@@ -17,7 +17,12 @@
           :style="{ width: colToWidth(item.colSpan || 0) }"
           :class="{ 'buttons-wrap': item.type == 'buttons' }"
         >
-          <SearchFormItem :item="item" :params="params" />
+          <slot
+            v-if="item.cell"
+            :name="item.cell"
+            v-bind="{ item, params }"
+          ></slot>
+          <SearchFormItem v-else :item="item" :params="params" />
         </t-form-item>
         <div class="flex-1"></div>
         <t-form-item
@@ -28,7 +33,12 @@
           :style="{ width: colToWidth(item.colSpan || 0) }"
           :class="{ 'buttons-wrap': item.type == 'buttons' }"
         >
-          <SearchFormItem :item="item" :params="params" />
+          <slot
+            v-if="item.cell"
+            :name="item.cell"
+            v-bind="{ item, params }"
+          ></slot>
+          <SearchFormItem v-else :item="item" :params="params" />
         </t-form-item>
         <div v-if="showExpandBtn && !showAll" class="flex-1 text-right">
           <t-button
@@ -53,7 +63,12 @@
           :style="{ width: colToWidth(item.colSpan || 0) }"
           :class="{ 'buttons-wrap': item.type == 'buttons' }"
         >
-          <SearchFormItem :item="item" :params="params" />
+          <slot
+            v-if="item.cell"
+            :name="item.cell"
+            v-bind="{ item, params }"
+          ></slot>
+          <SearchFormItem v-else :item="item" :params="params" />
         </t-form-item>
       </div>
     </t-form>

+ 17 - 11
src/config/constants.js

@@ -1,16 +1,22 @@
-export const NOTICE_TYPE = {
-  COMMON: '公告',
-  SERVICE_UNIT: '服务单元通知',
-  SUPPLIER: '供应商通知',
-};
-
+// 系统管理 ------->
+// 客户类型
 export const CUSTOMER_TYPE = {
-  TEACH: '高校教务处',
-  GRADUATE: '研究生',
+  OFFICE: '高校教务处',
+  CLOUD_MARK: '研究生',
+};
+// 供应商类型
+export const SUPPLIER_TYPE = {
+  HUMAN: '人力',
+  DEVICE: '设备',
 };
-
+// 设备状态
 export const RUNNING_STATUS = {
   NORMAL: '正常',
-  ERROR: '故障',
-  DEAD: '销毁',
+  ERRBREAK_DOWNOR: '故障',
+};
+// 公告类型
+export const NOTICE_TYPE = {
+  COMMON: '公告',
+  SERVICE_UNIT: '服务单元通知',
+  SUPPLIER: '供应商通知',
 };

+ 1 - 0
src/hooks/useFetchTable.js

@@ -35,6 +35,7 @@ export default function useFetchTable(apiFn, options = {}, immediately = true) {
       let res = await apiFn(params);
       //下方代码 后续根据实际接口返回字段进行修改
       let list = Array.isArray(res.records) ? res.records : [];
+      let list = Array.isArray(res.records) ? res.records : [];
       tableData.value = list;
       pagination.total = res.total;
       loading.value = false;

+ 6 - 1
src/mock/index.js

@@ -430,7 +430,7 @@ export const editApi = Mock.mock('/api/edit', 'post', (data) => {
 
 //模拟一个分页请求
 const listTemplate = {
-  'list|10': [
+  'records|10': [
     {
       'id|+1': 1,
       'a|1-3': '11',
@@ -456,6 +456,11 @@ const listTemplate = {
 };
 export const tableApi = Mock.mock('/api/table', 'post', listTemplate);
 export const dataListApi = Mock.mock(/\/api\/.*\/list$/, 'post', listTemplate);
+export const dataListQueryApi = Mock.mock(
+  /\/api\/.*\/query$/,
+  'post',
+  listTemplate
+);
 export const actionApi = Mock.mock(/\/api\/.*/, 'post', {
   ok: true,
 });

+ 45 - 33
src/mock/system.js

@@ -8,7 +8,7 @@ const getListTemplate = (fields) => {
   });
 
   return {
-    'list|10': [
+    'records|10': [
       {
         'id|+1': 1,
         ...item,
@@ -19,39 +19,51 @@ const getListTemplate = (fields) => {
 };
 
 // system customer manage
-export const customerListApi = Mock.mock(
-  '/api/system/customer/list',
-  'post',
-  getListTemplate({
-    name: '1122',
-    type: '333',
-    province: '4',
-    city: '5',
-    area: '6',
-    address: '7',
-    manager: '8',
-    serviceName: '9',
-    roles: '10',
-    k: 12,
-    l: '12',
-    m: '13',
-  })
-);
+export const customerListApi = Mock.mock('/api/sys/custom/query', 'post', {
+  'records|10': [
+    {
+      'id|+1': 1,
+      'name': '1122',
+      'type': '333',
+      'province': '4',
+      'city': '5',
+      'area': '6',
+      'address': '7',
+      'managerName': '8',
+      'level': '9',
+      'roleList|2': [
+        {
+          'id|+1': 1,
+          'customId': 0,
+          'quota': 2,
+          'roleId': 0,
+          'roleName|3-5': '00',
+        },
+      ],
+      'peoperDay': 12,
+      'createName': '12',
+      'createTime': '13',
+    },
+  ],
+  'total': 80,
+});
 // supplier customer manage
-export const supplierListApi = Mock.mock(
-  '/api/system/supplier/list',
-  'post',
-  getListTemplate({
-    code: '22',
-    name: '33',
-    type: '44',
-    remark: '55',
-    enable: true,
-  })
-);
+export const supplierListApi = Mock.mock('/api/sys/supplier/query', 'post', {
+  'records|10': [
+    {
+      'id|+1': 1,
+      'code': '22',
+      'name': '33',
+      'type': '44',
+      'remark': '55',
+      'enable': true,
+    },
+  ],
+  'total': 80,
+});
 // device customer manage
 export const deviceListApi = Mock.mock(
-  '/api/system/device/list',
+  '/api/sys/device/query',
   'post',
   getListTemplate({
     code: '22',
@@ -66,7 +78,7 @@ export const deviceListApi = Mock.mock(
 );
 // service-level manage
 export const serviceLevelListApi = Mock.mock(
-  '/api/system/service-level/list',
+  '/api/sys/service-level/query',
   'post',
   getListTemplate({
     name: '11',
@@ -78,7 +90,7 @@ export const serviceLevelListApi = Mock.mock(
 );
 // checkin customer manage
 export const checkinListApi = Mock.mock(
-  '/api/system/checkin/list',
+  '/api/sys/checkin/query',
   'post',
   getListTemplate({
     unit: '11',

+ 26 - 0
src/utils/filter.js

@@ -0,0 +1,26 @@
+import {
+  CUSTOMER_TYPE,
+  SUPPLIER_TYPE,
+  RUNNING_STATUS,
+  NOTICE_TYPE,
+} from '@/config/constants';
+
+const DEFAULT_FIELD = '--';
+
+// 常规
+export function enableFilter(val) {
+  return val ? '启用' : '禁用';
+}
+// 系统管理
+export function customerTypeFilter(val) {
+  return CUSTOMER_TYPE[val] || DEFAULT_FIELD;
+}
+export function supplierTypeFilter(val) {
+  return SUPPLIER_TYPE[val] || DEFAULT_FIELD;
+}
+export function runningStatusFilter(val) {
+  return RUNNING_STATUS[val] || DEFAULT_FIELD;
+}
+export function noticeTypeFilter(val) {
+  return NOTICE_TYPE[val] || DEFAULT_FIELD;
+}

+ 11 - 0
src/utils/tool.js

@@ -341,3 +341,14 @@ export const toSecondFloorArray = (arr) => {
   }, []);
   return newArr;
 };
+
+/**
+ * 字典数据转成option list
+ * @param {Object} data 字典数据
+ * @returns list
+ */
+export const dictToOptionList = (data) => {
+  return Object.keys(data).map((k) => {
+    return { value: k, label: data[k] };
+  });
+};

+ 6 - 2
src/views/project-quality/project-quality-manage/issues-feedback/index.vue

@@ -71,7 +71,12 @@ const columns = [
 ];
 
 const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
-  issuesFeedbackListApi
+  issuesFeedbackListApi,
+  {
+    fetchDataHandle: () => {
+      selectedRowKeys.value = [];
+    },
+  }
 );
 
 const fields = ref([
@@ -172,7 +177,6 @@ const handleDestroy = () => {
       );
       if (!res) return;
       MessagePlugin.success('操作成功');
-      selectedRowKeys.value = [];
       fetchData();
     },
   });

+ 7 - 27
src/views/project-quality/project-quality-manage/issues-query/index.vue

@@ -13,10 +13,8 @@
           defaultPageSize: 10,
           onChange,
           total: pagination.total,
+          current: pagination.page,
         }"
-        :selected-row-keys="selectedRowKeys"
-        select-on-row-click
-        @select-change="selectChange"
       >
       </t-table>
     </div>
@@ -25,22 +23,10 @@
 
 <script setup lang="jsx" name="IssuesQuery">
 import { reactive, ref } from 'vue';
-import { useRequest } from 'vue-request';
-import { getTableData } from '@/api/test';
+import { issuesQueryListApi } from '@/api/project-quality';
 import useFetchTable from '@/hooks/useFetchTable';
 
-const selectedRowKeys = ref([]);
-const selectChange = (value, { selectedRowData }) => {
-  selectedRowKeys.value = value;
-};
-
 const columns = [
-  {
-    colKey: 'row-select',
-    type: 'multiple',
-    width: 50,
-    fixed: 'left',
-  },
   { colKey: 'a', title: '质量问题编号' },
   { colKey: 'b', title: '项目单号' },
   { colKey: 'c', title: '客户类型' },
@@ -91,6 +77,9 @@ const fields = ref([
       {
         type: 'button',
         text: '查询',
+        onClick: () => {
+          search();
+        },
       },
     ],
   },
@@ -132,15 +121,6 @@ const params = reactive({
   h: [],
 });
 
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, search, onChange } =
+  useFetchTable(issuesQueryListApi);
 </script>
-
-<style></style>

+ 8 - 12
src/views/resource-guard/device-guard/registration-query/index.vue

@@ -13,6 +13,7 @@
           defaultPageSize: 10,
           onChange,
           total: pagination.total,
+          current: pagination.page,
         }"
       >
       </t-table>
@@ -22,7 +23,7 @@
 
 <script setup lang="jsx" name="RegistrationQuery">
 import { ref, reactive } from 'vue';
-import { getTableData } from '@/api/test';
+import { registrationQueryListApi } from '@/api/resource-guard';
 import useFetchTable from '@/hooks/useFetchTable';
 
 const columns = [
@@ -35,15 +36,9 @@ const columns = [
   { colKey: 'g', title: '供应商' },
   { colKey: 'h', title: '发往地' },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-
-const refresh = async () => {};
+const { pagination, tableData, search, onChange } = useFetchTable(
+  registrationQueryListApi
+);
 
 const fields = ref([
   {
@@ -80,6 +75,9 @@ const fields = ref([
       {
         type: 'button',
         text: '查询',
+        onClick: () => {
+          search();
+        },
       },
     ],
   },
@@ -106,5 +104,3 @@ const params = reactive({
   f: '',
 });
 </script>
-
-<style></style>

+ 78 - 15
src/views/resource-guard/person-guard/person-allocate/index.vue

@@ -2,6 +2,31 @@
   <div class="person-allocate flex flex-col h-full">
     <SearchForm :fields="fields" :params="params"></SearchForm>
     <div class="flex-1 page-wrap">
+      <div class="flex justify-between items-center">
+        <t-space>
+          <span>已发布派单:{{ statisticsInfo.a }}</span>
+          <span
+            >实施工程师配额:{{ statisticsInfo.b }} /
+            {{ statisticsInfo.b }}</span
+          >
+          <span
+            >助理工程师配额:{{ statisticsInfo.c }}/
+            {{ statisticsInfo.b }}</span
+          >
+          <span
+            >区域协调人配额:{{ statisticsInfo.d }} /
+            {{ statisticsInfo.b }}</span
+          >
+        </t-space>
+        <div class="btn-group">
+          <t-button
+            theme="success"
+            :disabled="!selectedRowKeys.length"
+            @click="multDeploy"
+            >批量调配</t-button
+          >
+        </div>
+      </div>
       <t-table
         size="small"
         row-key="id"
@@ -13,6 +38,7 @@
           defaultPageSize: 10,
           onChange,
           total: pagination.total,
+          current: pagination.page,
         }"
         :selected-row-keys="selectedRowKeys"
         select-on-row-click
@@ -25,14 +51,14 @@
 
 <script setup lang="jsx" name="PersonAllocate">
 import { reactive, ref } from 'vue';
-import { useRequest } from 'vue-request';
-import { getTableData } from '@/api/test';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
+import {
+  personAllocateListApi,
+  personAllocateStatisticsApi,
+  personAllocateSubmitSopApi,
+} from '@/api/resource-guard';
 
-const selectedRowKeys = ref([]);
-const selectChange = (value, { selectedRowData }) => {
-  selectedRowKeys.value = value;
-};
 const columns = [
   {
     colKey: 'row-select',
@@ -57,6 +83,7 @@ const columns = [
     colKey: 'operate',
     fixed: 'right',
     width: 120,
+    align: 'center',
     cell: (h, { row }) => {
       return (
         <div class="table-operations">
@@ -65,6 +92,7 @@ const columns = [
             hover="color"
             onClick={(e) => {
               e.stopPropagation();
+              handleDeploy(row);
             }}
           >
             调配
@@ -74,6 +102,7 @@ const columns = [
             hover="color"
             onClick={(e) => {
               e.stopPropagation();
+              handleSubmitSop(row);
             }}
           >
             发布SOP
@@ -83,13 +112,25 @@ const columns = [
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
+const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
+  personAllocateListApi,
+  {
+    fetchDataHandle: () => {
+      selectedRowKeys.value = [];
+    },
+  }
+);
+let statisticsInfo = reactive({ a: 1, b: 2, c: 3, d: 4, e: 5 });
+const getStatisticsInfo = async () => {
+  const res = await personAllocateStatisticsApi(params);
+  statisticsInfo = res.data || {};
+};
+
+const selectedRowKeys = ref([]);
+const selectChange = (value) => {
+  selectedRowKeys.value = value;
+};
+
 const fields = ref([
   {
     prop: 'a',
@@ -125,6 +166,10 @@ const fields = ref([
       {
         type: 'button',
         text: '查询',
+        onClick: () => {
+          search();
+          getStatisticsInfo();
+        },
       },
     ],
   },
@@ -135,6 +180,24 @@ const params = reactive({
   c: '',
   d: '',
 });
-</script>
 
-<style></style>
+const multDeploy = () => {};
+const handleDeploy = (row) => {
+  console.log(row);
+};
+const handleSubmitSop = (row) => {
+  const confirmDia = DialogPlugin({
+    header: '发布SOP提示',
+    body: `您确定要发布当前派单的SOP吗?`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await personAllocateSubmitSopApi(row.id).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+      fetchData();
+    },
+  });
+};
+</script>

+ 110 - 15
src/views/resource-guard/person-guard/person-files/add-person-file-dialog.vue

@@ -1,12 +1,12 @@
 <template>
   <my-dialog
     :visible="visible"
-    @close="emit('update:visible', false)"
-    :header="`${isEdit ? '修改' : '新增'}人员档案`"
+    :header="title"
     :width="900"
     :closeOnOverlayClick="false"
+    @close="emit('update:visible', false)"
   >
-    <t-form ref="formRef" :model="formData" layout="inline" labelWidth="120px">
+    <t-form ref="formRef" :model="formData" :rules="rules" labelWidth="120px">
       <t-row :gutter="[0, 20]">
         <t-col :span="4">
           <t-form-item label="人员档案编号">
@@ -14,37 +14,37 @@
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="姓名">
+          <t-form-item label="姓名" name="a">
             <t-input v-model="formData.a"></t-input>
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="常住区域">
+          <t-form-item label="常住区域" name="b">
             <t-select v-model="formData.b"></t-select>
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="身份证号">
+          <t-form-item label="身份证号" name="c">
             <t-input v-model="formData.c"></t-input>
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="性别">
+          <t-form-item label="性别" name="d">
             <t-select v-model="formData.d"></t-select>
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="学历">
+          <t-form-item label="学历" name="e">
             <t-select v-model="formData.e"></t-select>
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="手机号">
+          <t-form-item label="手机号" name="f">
             <t-input v-model="formData.f"></t-input>
           </t-form-item>
         </t-col>
         <t-col :span="8">
-          <t-form-item label="电子邮箱">
+          <t-form-item label="电子邮箱" name="g">
             <t-input v-model="formData.g"></t-input>
           </t-form-item>
         </t-col>
@@ -72,17 +72,17 @@
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="所属供应商">
+          <t-form-item label="所属供应商" name="i">
             <t-select v-model="formData.i"></t-select>
           </t-form-item>
         </t-col>
         <t-col :span="4">
-          <t-form-item label="入档时间">
+          <t-form-item label="入档时间" name="j">
             <t-date-picker v-model="formData.j" />
           </t-form-item>
         </t-col>
         <t-col :span="12">
-          <t-form-item label="认证项目角色">
+          <t-form-item label="认证项目角色" name="k">
             <t-checkbox-group v-model="formData.k">
               <t-checkbox>实施工程师</t-checkbox>
               <t-checkbox>区域协调人</t-checkbox>
@@ -121,8 +121,11 @@
   </my-dialog>
 </template>
 <script setup name="AddPersonFileDialog">
+import { ref, computed } from 'vue';
+import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
-import { ref } from 'vue';
+import { personfilesEditApi } from '@/api/resource-guard';
+
 const emit = defineEmits(['update:visible']);
 const formRef = ref(null);
 const file = ref([]);
@@ -131,6 +134,10 @@ const props = defineProps({
   curRow: Object,
 });
 
+const title = computed(() => {
+  return (isEdit.value ? '编辑' : '新增') + '人员档案';
+});
+
 const requestMethod = (f) => {
   return new Promise((rs) => {
     rs({
@@ -168,5 +175,93 @@ const { formData, isEdit } = useClearDialog(
   getDetail
 );
 
-const save = () => {};
+const rules = {
+  a: [
+    { required: true, message: '姓名必填', type: 'error', trigger: 'change' },
+  ],
+  b: [
+    {
+      required: true,
+      message: '常住区域必选',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  c: [
+    {
+      required: true,
+      message: '身份证号必填',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  d: [
+    {
+      required: true,
+      message: '性别必选',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  e: [
+    {
+      required: true,
+      message: '学历必选',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  f: [
+    {
+      required: true,
+      message: '手机号必填',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  g: [
+    {
+      required: true,
+      message: '电子邮箱必填',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  i: [
+    {
+      required: true,
+      message: '所属供应商必选',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  j: [
+    {
+      required: true,
+      message: '入档时间必填',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+  k: [
+    {
+      required: true,
+      message: '认证项目角色必选',
+      type: 'error',
+      trigger: 'change',
+    },
+  ],
+};
+
+const save = async () => {
+  const valid = await formRef.value.validate();
+  if (valid !== true) return;
+
+  const res = await personfilesEditApi(formData).catch(() => {});
+  if (!res) return;
+
+  MessagePlugin.success('保存成功');
+  emit('update:visible', false);
+  emit('success');
+};
 </script>

+ 91 - 33
src/views/resource-guard/person-guard/person-files/index.vue

@@ -2,16 +2,15 @@
   <div class="person-files flex flex-col h-full">
     <SearchForm :fields="fields" :params="params"></SearchForm>
     <div class="flex-1 page-wrap">
-      <div class="btn-group">
-        <t-button
-          theme="success"
-          @click="
-            curRow = null;
-            showAddPersonFileDialog = true;
-          "
-          >新增</t-button
-        >
-        <t-button theme="success" @click="multImport">批量导入</t-button>
+      <t-space size="small">
+        <t-button theme="success" @click="handleAdd">新增</t-button>
+        <upload-button
+          upload-url="/api/upload"
+          :button-props="{
+            content: '批量导入',
+            theme: 'success',
+          }"
+        ></upload-button>
         <t-button
           theme="success"
           @click="multExport"
@@ -20,11 +19,11 @@
         >
         <t-button
           theme="success"
-          @click="cancelIt"
           :disabled="!selectedRowKeys.length"
+          @click="handleDestroy"
           >作废</t-button
         >
-      </div>
+      </t-space>
       <t-table
         size="small"
         row-key="id"
@@ -36,6 +35,7 @@
           defaultPageSize: 10,
           onChange,
           total: pagination.total,
+          current: pagination.page,
         }"
         :selected-row-keys="selectedRowKeys"
         select-on-row-click
@@ -47,24 +47,25 @@
     <AddPersonFileDialog
       v-model:visible="showAddPersonFileDialog"
       :curRow="curRow"
+      @success="fetchData"
     ></AddPersonFileDialog>
   </div>
 </template>
 
 <script setup lang="jsx" name="PersonFiles">
 import { ref, reactive } from 'vue';
-import { getTableData } from '@/api/test';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import AddPersonFileDialog from './add-person-file-dialog';
+import {
+  personFilesListApi,
+  personFilesDestroyApi,
+  personFilesExportApi,
+} from '@/api/resource-guard';
+
 const curRow = ref(null);
 const showAddPersonFileDialog = ref(false);
-const selectedRowKeys = ref([]);
-const selectChange = (value, { selectedRowData }) => {
-  selectedRowKeys.value = value;
-};
-const multImport = () => {};
-const multExport = () => {};
-const cancelIt = () => {};
+
 const columns = [
   {
     colKey: 'row-select',
@@ -96,7 +97,8 @@ const columns = [
     title: '操作',
     colKey: 'operate',
     fixed: 'right',
-    width: 150,
+    width: 80,
+    align: 'center',
     cell: (h, { row }) => {
       return (
         <div class="table-operations">
@@ -105,8 +107,7 @@ const columns = [
             hover="color"
             onClick={(e) => {
               e.stopPropagation();
-              curRow.value = row;
-              showAddPersonFileDialog.value = true;
+              handleEdit(row);
             }}
           >
             修改
@@ -116,14 +117,19 @@ const columns = [
     },
   },
 ];
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
-const refresh = async () => {};
+const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
+  personFilesListApi,
+  {
+    fetchDataHandle: () => {
+      selectedRowKeys.value = [];
+    },
+  }
+);
+
+const selectedRowKeys = ref([]);
+const selectChange = (value, { selectedRowData }) => {
+  selectedRowKeys.value = value;
+};
 
 const fields = ref([
   {
@@ -161,6 +167,9 @@ const fields = ref([
       {
         type: 'button',
         text: '查询',
+        onClick: () => {
+          search();
+        },
       },
     ],
   },
@@ -194,6 +203,55 @@ const params = reactive({
   f: [],
   g: '',
 });
-</script>
 
-<style></style>
+const handleAdd = () => {
+  curRow.value = null;
+  showAddPersonFileDialog.value = true;
+};
+const handleEdit = (row) => {
+  curRow.value = row;
+  showAddPersonFileDialog.value = true;
+};
+const handleDestroy = () => {
+  if (!selectedRowKeys.value.length) {
+    MessagePlugin.error('请选择要作废的记录');
+    return;
+  }
+
+  const confirmDia = DialogPlugin({
+    header: '操作提示',
+    body: `确定要作废当前选择的所有记录吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await personFilesDestroyApi(selectedRowKeys.value).catch(
+        () => {}
+      );
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+      fetchData();
+    },
+  });
+};
+const multExport = () => {
+  if (!selectedRowKeys.value.length) {
+    MessagePlugin.error('请选择要作废的记录');
+    return;
+  }
+  const confirmDia = DialogPlugin({
+    header: '操作提示',
+    body: `确定要导出选择的所有记录吗?`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await personFilesExportApi(selectedRowKeys.value).catch(
+        () => {}
+      );
+      if (!res) return;
+      MessagePlugin.success('开始下载');
+    },
+  });
+};
+</script>

+ 26 - 27
src/views/system/config-manage/checkin-manage/edit-checkin-dialog.vue

@@ -15,8 +15,8 @@
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="服务单元" name="unit">
-            <t-select v-model="formData.unit">
+          <t-form-item label="服务单元" name="service">
+            <t-select v-model="formData.service">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"
                 :key="key"
@@ -27,8 +27,8 @@
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="适用考勤对象" name="to">
-            <t-select v-model="formData.to">
+          <t-form-item label="适用考勤对象" name="tdingObjs">
+            <t-select v-model="formData.tdingObjs">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"
                 :key="key"
@@ -39,8 +39,8 @@
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="适用供应商" name="supplier">
-            <t-select v-model="formData.supplier">
+          <t-form-item label="适用供应商" name="supplierId">
+            <t-select v-model="formData.supplierId">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"
                 :key="key"
@@ -51,17 +51,17 @@
           </t-form-item>
         </t-col>
         <t-col :span="12">
-          <t-form-item label="签到时段" name="checkinTime">
+          <t-form-item label="签到时段" name="signInTime">
             <t-time-range-picker
-              v-model="formData.checkinTime"
+              v-model="formData.signInTime"
               format="HH:mm:ss"
             />
           </t-form-item>
         </t-col>
         <t-col :span="12">
-          <t-form-item label="签退时段" name="checkoutTime">
+          <t-form-item label="签退时段" name="signOutTime">
             <t-time-range-picker
-              v-model="formData.checkoutTime"
+              v-model="formData.signOutTime"
               format="HH:mm:ss"
             />
           </t-form-item>
@@ -79,14 +79,14 @@
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="是否开启人脸" name="openFace">
-            <t-switch v-model="formData.openFace" />
+          <t-form-item label="是否开启人脸" name="faceOpen">
+            <t-switch v-model="formData.faceOpen" />
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="允许补卡次数" name="backupCount">
+          <t-form-item label="允许补卡次数" name="reissueCardCount">
             <t-input-number
-              v-model="formData.backupCount"
+              v-model="formData.reissueCardCount"
               :decimalPlaces="0"
               :min="1"
             />
@@ -122,16 +122,15 @@ const title = computed(() => {
 
 const { formData, isEdit } = useClearDialog(
   {
-    unit: '',
-    status: '',
     name: '',
-    to: [],
-    supplier: '',
-    checkinTime: [],
-    checkoutTime: [],
+    serviceId: '',
+    tdingObjs: [],
+    supplierId: '',
+    signInTime: [],
+    signOutTime: [],
     auditRoles: [],
-    openFace: false,
-    backupCount: 2,
+    faceOpen: false,
+    reissueCardCount: 2,
   },
   props,
   null
@@ -152,7 +151,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  unit: [
+  serviceId: [
     {
       required: true,
       message: '服务单元必选',
@@ -160,7 +159,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  to: [
+  tdingObjs: [
     {
       required: true,
       message: '适用考勤对象必选',
@@ -168,7 +167,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  supplier: [
+  supplierId: [
     {
       required: true,
       message: '适用供应商必选',
@@ -176,7 +175,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  checkinTime: [
+  signInTime: [
     {
       required: true,
       message: '签到时段必选',
@@ -184,7 +183,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  checkoutTime: [
+  signOutTime: [
     {
       required: true,
       message: '签退时段必选',

+ 13 - 12
src/views/system/config-manage/checkin-manage/index.vue

@@ -35,23 +35,24 @@ import { ref, reactive } from 'vue';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditCheckinDialog from './edit-checkin-dialog.vue';
-import { checkinListApi, checkinDeleteApi } from '@/api/system';
+import { checkinQueryApi, checkinDeleteApi } from '@/api/system';
+
 const showEditCheckinDialog = ref(false);
 const curRow = ref(null);
 
 const columns = [
-  { colKey: 'unit', title: '服务单元' },
+  { colKey: 'service', title: '服务单元' },
   { colKey: 'status', title: '发布状态' },
   { colKey: 'name', title: '考勤组名称' },
-  { colKey: 'to', title: '适用考勤对象' },
+  { colKey: 'tdingObjs', title: '适用考勤对象' },
   { colKey: 'supplier', title: '适用供应商' },
-  { colKey: 'checkinTime', title: '签到时段' },
-  { colKey: 'checkoutTime', title: '签退时段' },
+  { colKey: 'signInTime', title: '签到时段' },
+  { colKey: 'signOutTime', title: '签退时段' },
   { colKey: 'auditRoles', title: '审核角色' },
-  { colKey: 'openFace', title: '是否开启人脸' },
-  { colKey: 'backupCount', title: '允许补卡次数' },
-  { colKey: 'creator', title: '创建人' },
-  { colKey: 'createdTime', title: '创建时间' },
+  { colKey: 'faceOpen', title: '是否开启人脸' },
+  { colKey: 'reissueCardCount', title: '允许补卡次数' },
+  { colKey: 'createName', title: '创建人' },
+  { colKey: 'createTime', title: '创建时间', width: 170 },
   {
     title: '管理',
     colKey: 'operate',
@@ -87,11 +88,11 @@ const columns = [
   },
 ];
 const { pagination, tableData, fetchData, search, onChange } =
-  useFetchTable(checkinListApi);
+  useFetchTable(checkinQueryApi);
 
 const fields = ref([
   {
-    prop: 'a',
+    prop: 'serviceId',
     label: '服务单元名称',
     type: 'select',
     labelWidth: 100,
@@ -116,7 +117,7 @@ const fields = ref([
   },
 ]);
 const params = reactive({
-  a: '',
+  serviceId: '',
 });
 
 const handleAdd = () => {

+ 9 - 9
src/views/system/config-manage/customer-manage/edit-customer-dialog.vue

@@ -37,8 +37,8 @@
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="客户经理" name="manager">
-            <t-select v-model="formData.manager">
+          <t-form-item label="客户经理" name="managerId">
+            <t-select v-model="formData.managerId">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"
                 :key="key"
@@ -50,7 +50,7 @@
         </t-col>
         <t-col :span="6">
           <t-form-item label="服务档位">
-            <t-select v-model="formData.level">
+            <t-select v-model="formData.levelId">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"
                 :key="key"
@@ -63,7 +63,7 @@
         <t-col :span="6">
           <t-form-item label="标准人天">
             <t-input-number
-              v-model="formData.dayCount"
+              v-model="formData.peoperDay"
               :decimalPlaces="0"
               :min="1"
             />
@@ -99,13 +99,13 @@ const title = computed(() => {
 
 const { formData, isEdit } = useClearDialog(
   {
-    id: '',
+    id: null,
     name: '',
     type: '',
     address: '',
-    manager: '',
-    level: '',
-    dayCount: '',
+    managerId: null,
+    levelId: null,
+    peoperDay: 1,
   },
   props,
   null
@@ -140,7 +140,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  manager: [
+  managerId: [
     { required: true, message: '经理必选', type: 'error', trigger: 'change' },
   ],
 };

+ 39 - 25
src/views/system/config-manage/customer-manage/index.vue

@@ -1,15 +1,21 @@
 <template>
   <div class="registration-query flex flex-col h-full">
-    <SearchForm :fields="fields" :params="params"></SearchForm>
+    <SearchForm :fields="fields" :params="params">
+      <template #manager="{ item, params }">
+        <t-select v-model="params[item.prop]">
+          <t-option label="label1" :value="1" />
+          <t-option label="label2" :value="2" />
+        </t-select>
+      </template>
+    </SearchForm>
     <div class="flex-1 page-wrap">
       <t-space size="small">
         <t-button theme="success" @click="handleAdd">新增</t-button>
         <upload-button
-          upload-url="/api/upload"
+          upload-url="/api/sys/custom/import"
           :button-props="{
             content: '批量导入',
           }"
-          :max-size="512"
         ></upload-button>
       </t-space>
       <t-table
@@ -26,6 +32,13 @@
           current: pagination.page,
         }"
       >
+        <template #role-list="{ col, row }">
+          {{
+            row[col.colKey]
+              .map((item) => `${item.roleName}(${item.quota})`)
+              .join(',')
+          }}
+        </template>
       </t-table>
     </div>
 
@@ -42,8 +55,10 @@ import { ref, reactive } from 'vue';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditCustomerDialog from './edit-customer-dialog.vue';
-import UploadButton from '@/components/common/upload-button/index.vue';
-import { customerListApi, customerDeleteApi } from '@/api/system';
+import { customeryQueryApi, customerDeleteApi } from '@/api/system';
+import { CUSTOMER_TYPE } from '@/config/constants';
+import { dictToOptionList } from '@/utils/tool';
+
 const showEditCustomerDialog = ref(false);
 const curRow = ref(null);
 
@@ -55,12 +70,12 @@ const columns = [
   { colKey: 'city', title: '城市' },
   { colKey: 'area', title: '县区' },
   { colKey: 'address', title: '地址' },
-  { colKey: 'manager', title: '客户经理' },
-  { colKey: 'serviceName', title: '服务档位名称' },
-  { colKey: 'roles', title: '项目角色配置' },
-  { colKey: 'k', title: '标准人天' },
-  { colKey: 'l', title: '创建人' },
-  { colKey: 'm', title: '创建时间' },
+  { colKey: 'managerName', title: '客户经理' },
+  { colKey: 'level', title: '服务档位名称' },
+  { colKey: 'roleList', title: '项目角色配置', cell: 'role-list', width: 170 },
+  { colKey: 'peoperDay', title: '标准人天', width: 80 },
+  { colKey: 'createName', title: '创建人' },
+  { colKey: 'createTime', title: '创建时间', width: 170 },
   {
     title: '管理',
     colKey: 'operate',
@@ -96,30 +111,28 @@ const columns = [
   },
 ];
 const { pagination, tableData, fetchData, search, onChange } =
-  useFetchTable(customerListApi);
+  useFetchTable(customeryQueryApi);
 
 const fields = ref([
   {
-    prop: 'a',
+    prop: 'type',
     label: '客户类型',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
-    options: [
-      { value: 1, label: '研究生' },
-      { value: 2, label: '高校教务处' },
-    ],
+    options: dictToOptionList(CUSTOMER_TYPE),
   },
   {
-    prop: 'b',
+    prop: 'managerId',
+    cell: 'manager',
     label: '客户经理',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
-    options: [{ value: 1, label: '张三' }],
+    // options: [{ value: 1, label: '张三' }],
   },
   {
-    prop: 'd',
+    prop: 'name',
     label: '客户名称',
     labelWidth: 100,
     colSpan: 5,
@@ -129,11 +142,12 @@ const fields = ref([
     },
   },
   {
-    prop: 'b',
+    prop: 'levelId',
     label: '服务档位',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
+    // ToDo:异步加载 测试
     options: [{ value: 1, label: '一档' }],
   },
   {
@@ -151,10 +165,10 @@ const fields = ref([
   },
 ]);
 const params = reactive({
-  a: '',
-  b: '',
-  c: [],
-  d: '',
+  type: '',
+  managerId: '',
+  name: '',
+  levelId: '',
 });
 
 const handleAdd = () => {

+ 9 - 9
src/views/system/config-manage/device-manage/edit-device-dialog.vue

@@ -10,8 +10,8 @@
     <t-form ref="formRef" :data="formData" :rules="rules" :labelWidth="100">
       <t-row :gutter="[0, 20]">
         <t-col :span="6">
-          <t-form-item label="设备编号" name="code">
-            <t-input v-model="formData.code" clearable />
+          <t-form-item label="设备编号" name="name">
+            <t-input v-model="formData.name" clearable />
           </t-form-item>
         </t-col>
         <t-col :span="6">
@@ -30,8 +30,8 @@
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="供应商" name="supllier">
-            <t-select v-model="formData.supllier">
+          <t-form-item label="供应商" name="supplierId">
+            <t-select v-model="formData.supplierId">
               <t-option
                 v-for="(val, key) in RUNNING_STATUS"
                 :key="key"
@@ -97,20 +97,20 @@ const title = computed(() => {
 
 const { formData, isEdit } = useClearDialog(
   {
-    code: '',
+    name: '',
     serialNo: '',
     brand: '',
     buyTime: '',
-    supllier: '',
+    supplierId: '',
     status: '',
     location: '',
-    scanCount: '',
+    scanCount: null,
   },
   props,
   null
 );
 const rules = {
-  code: [
+  name: [
     {
       required: true,
       message: '设备编号必填',
@@ -141,7 +141,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  supllier: [
+  supplierId: [
     { required: true, message: '供应商必选', type: 'error', trigger: 'change' },
   ],
   status: [

+ 5 - 4
src/views/system/config-manage/device-manage/index.vue

@@ -33,16 +33,17 @@ import { ref } from 'vue';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditDeviceDialog from './edit-device-dialog.vue';
-import { deviceListApi, deviceDestroyApi } from '@/api/system';
+import { deviceQueryApi, deviceDestroyApi } from '@/api/system';
+
 const showEditDeviceDialog = ref(false);
 const curRow = ref(null);
 
 const columns = [
-  { colKey: 'code', title: '设备编号' },
+  { colKey: 'name', title: '设备编号' },
   { colKey: 'serialNo', title: '序列号' },
   { colKey: 'brand', title: '品牌' },
   { colKey: 'buyTime', title: '购买时间' },
-  { colKey: 'supllier', title: '供应商' },
+  { colKey: 'supplier', title: '供应商' },
   { colKey: 'status', title: '运行状态' },
   { colKey: 'location', title: '当前所在地' },
   { colKey: 'scanCount', title: '总扫描量' },
@@ -81,7 +82,7 @@ const columns = [
   },
 ];
 const { pagination, tableData, fetchData, onChange } =
-  useFetchTable(deviceListApi);
+  useFetchTable(deviceQueryApi);
 
 const handleAdd = () => {
   curRow.value = null;

+ 24 - 19
src/views/system/config-manage/service-level-manage/edit-service-level-dialog.vue

@@ -10,13 +10,13 @@
     <t-form ref="formRef" :data="formData" :rules="rules" :labelWidth="120">
       <t-row :gutter="[0, 20]">
         <t-col :span="6">
-          <t-form-item label="服务档位名称" name="name">
-            <t-input v-model="formData.name" clearable />
+          <t-form-item label="服务档位名称" name="level">
+            <t-input v-model="formData.level" clearable />
           </t-form-item>
         </t-col>
         <t-col :span="6">
-          <t-form-item label="业务类型" name="businessType">
-            <t-select v-model="formData.businessType">
+          <t-form-item label="业务类型" name="type">
+            <t-select v-model="formData.type">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"
                 :key="key"
@@ -27,8 +27,8 @@
           </t-form-item>
         </t-col>
         <t-col :span="12">
-          <t-form-item label="项目角色配置" name="roles">
-            <t-select v-model="formData.roles">
+          <t-form-item label="项目角色配置" name="roleList">
+            <t-select v-model="formData.roleList">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"
                 :key="key"
@@ -38,6 +38,15 @@
             </t-select>
           </t-form-item>
         </t-col>
+        <t-col :span="12">
+          <t-form-item label="设备配额">
+            <t-input-number
+              v-model="formData.devices"
+              :decimalPlaces="0"
+              :min="1"
+            />
+          </t-form-item>
+        </t-col>
       </t-row>
     </t-form>
     <template #foot>
@@ -54,6 +63,7 @@ import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
 import { CUSTOMER_TYPE } from '@/config/constants';
 import { serviceLevelEditApi } from '@/api/system';
+
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);
 
@@ -63,26 +73,21 @@ const props = defineProps({
 });
 
 const title = computed(() => {
-  return (isEdit.value ? '编辑' : '新增') + '考勤组';
+  return (isEdit.value ? '编辑' : '新增') + '服务档位';
 });
 
 const { formData, isEdit } = useClearDialog(
   {
-    unit: '',
-    name: '',
-    to: [],
-    supplier: '',
-    checkinTime: [],
-    checkoutTime: [],
-    auditRoles: [],
-    openFace: false,
-    backupCount: 2,
+    level: '',
+    type: '',
+    devices: null,
+    roleList: [],
   },
   props,
   null
 );
 const rules = {
-  name: [
+  level: [
     { required: true, message: '名称必填', type: 'error', trigger: 'change' },
     {
       min: 2,
@@ -97,7 +102,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  businessType: [
+  type: [
     {
       required: true,
       message: '业务类型必选',
@@ -105,7 +110,7 @@ const rules = {
       trigger: 'change',
     },
   ],
-  roles: [
+  roleList: [
     {
       required: true,
       message: '项目角色必须配置',

+ 16 - 7
src/views/system/config-manage/service-level-manage/index.vue

@@ -17,6 +17,13 @@
           total: pagination.total,
         }"
       >
+        <template #role-list="{ col, row }">
+          {{
+            row[col.colKey]
+              .map((item) => `${item.roleName}(${item.quota})`)
+              .join(',')
+          }}
+        </template>
       </t-table>
     </div>
 
@@ -33,16 +40,18 @@ import { ref } from 'vue';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditServiceLevelDialog from './edit-service-level-dialog.vue';
-import { serviceLevelListApi, serviceLevelDeleteApi } from '@/api/system';
+import { serviceLevelQueryApi, serviceLevelDeleteApi } from '@/api/system';
+
 const showEditServiceLevelDialog = ref(false);
 const curRow = ref(null);
 
 const columns = [
-  { colKey: 'name', title: '服务档位名称' },
-  { colKey: 'businessType', title: '业务类型' },
-  { colKey: 'roles', title: '项目角色配置' },
-  { colKey: 'creator', title: '创建人' },
-  { colKey: 'createdTime', title: '创建时间' },
+  { colKey: 'level', title: '服务档位名称' },
+  { colKey: 'type', title: '业务类型', width: 100 },
+  { colKey: 'roleList', title: '项目角色配置', cell: 'role-list', width: 170 },
+  { colKey: 'devices', title: '设备配置(台)' },
+  { colKey: 'createName', title: '创建人' },
+  { colKey: 'createTime', title: '创建时间', width: 170 },
   {
     title: '操作',
     colKey: 'operate',
@@ -78,7 +87,7 @@ const columns = [
   },
 ];
 const { pagination, tableData, fetchData, onChange } =
-  useFetchTable(serviceLevelListApi);
+  useFetchTable(serviceLevelQueryApi);
 
 const handleAdd = () => {
   curRow.value = null;

+ 2 - 2
src/views/system/config-manage/supplier-manage/edit-supplier-dialog.vue

@@ -23,7 +23,7 @@
           <t-form-item label="类型" name="type">
             <t-select v-model="formData.type">
               <t-option
-                v-for="(val, key) in NOTICE_TYPE"
+                v-for="(val, key) in SUPPLIER_TYPE"
                 :key="key"
                 :label="val"
                 :value="key"
@@ -50,7 +50,7 @@
 import { ref, computed } from 'vue';
 import { MessagePlugin } from 'tdesign-vue-next';
 import useClearDialog from '@/hooks/useClearDialog';
-import { NOTICE_TYPE } from '@/config/constants';
+import { SUPPLIER_TYPE } from '@/config/constants';
 import { supplierEditApi } from '@/api/system';
 const emit = defineEmits(['update:visible', 'success']);
 const formRef = ref(null);

+ 42 - 35
src/views/system/config-manage/supplier-manage/index.vue

@@ -17,6 +17,39 @@
           total: pagination.total,
         }"
       >
+        <template #type="{ row }">
+          {{ supplierTypeFilter(row.type) }}
+        </template>
+        <template #enable="{ row }">
+          {{ enableFilter(row.enable) }}
+        </template>
+        <template #operate="{ row }">
+          <div class="table-operations">
+            <t-link
+              theme="primary"
+              hover="color"
+              @click="
+                (e) => {
+                  e.stopPropagation();
+                  handleEdit(row);
+                }
+              "
+            >
+              修改
+            </t-link>
+            <t-link
+              :theme="row.enable ? 'primary' : 'danger'"
+              hover="color"
+              @click="
+                (e) => {
+                  e.stopPropagation();
+                  handleEnable(row);
+                }
+              "
+              >{{ enableFilter(!row.enable) }}</t-link
+            >
+          </div>
+        </template>
       </t-table>
     </div>
 
@@ -34,52 +67,29 @@ import { ref } from 'vue';
 import { MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import EditSupplierDialog from './edit-supplier-dialog.vue';
-import { supplierListApi, supplierEnableApi } from '@/api/system';
+import { supplierQueryApi, supplierEnableApi } from '@/api/system';
+import { enableFilter, supplierTypeFilter } from '@/utils/filter';
+
 const showEditSupplierDialog = ref(false);
 const curRow = ref(null);
 
 const columns = [
   { colKey: 'code', title: '供应商编号' },
   { colKey: 'name', title: '供应商名称' },
-  { colKey: 'type', title: '类型' },
+  { colKey: 'type', title: '类型', cell: 'type' },
   { colKey: 'remark', title: '备注' },
-  { colKey: 'enable', title: '启用/禁用' },
+  { colKey: 'enable', title: '启用/禁用', cell: 'enable', width: 80 },
   {
     title: '操作',
     colKey: 'operate',
     fixed: 'right',
     width: 120,
     align: 'center',
-    cell: (h, { row }) => {
-      return (
-        <div class="table-operations">
-          <t-link
-            theme="primary"
-            hover="color"
-            onClick={(e) => {
-              e.stopPropagation();
-              handleEdit(row);
-            }}
-          >
-            修改
-          </t-link>
-          <t-link
-            theme="primary"
-            hover="color"
-            onClick={(e) => {
-              e.stopPropagation();
-              handleDisable(row);
-            }}
-          >
-            禁用
-          </t-link>
-        </div>
-      );
-    },
+    cell: 'operate',
   },
 ];
 const { pagination, tableData, fetchData, onChange } =
-  useFetchTable(supplierListApi);
+  useFetchTable(supplierQueryApi);
 
 const handleAdd = () => {
   curRow.value = null;
@@ -89,11 +99,8 @@ const handleEdit = (row) => {
   curRow.value = row;
   showEditSupplierDialog.value = true;
 };
-const handleDisable = async (row) => {
-  const res = await supplierEnableApi({
-    id: row.id,
-    enable: !row.enable,
-  }).catch(() => {});
+const handleEnable = async (row) => {
+  const res = await supplierEnableApi(row.id).catch(() => {});
 
   if (!res) return;
   MessagePlugin.success('操作成功');

+ 8 - 3
src/views/system/notice-log/notice-manage/index.vue

@@ -112,8 +112,14 @@ const columns = [
     },
   },
 ];
-const { pagination, tableData, fetchData, search, onChange } =
-  useFetchTable(noticeListApi);
+const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
+  noticeListApi,
+  {
+    fetchDataHandle: () => {
+      selectedRowKeys.value = [];
+    },
+  }
+);
 
 const fields = ref([
   {
@@ -197,7 +203,6 @@ const handleDestroy = () => {
       const res = await noticeDestroyApi(selectedRowKeys.value).catch(() => {});
       if (!res) return;
       MessagePlugin.success('操作成功');
-      selectedRowKeys.value = [];
       fetchData();
     },
   });

+ 6 - 2
src/views/work-hours/work-hours-manage/abnormal-check/wait-check.vue

@@ -104,7 +104,12 @@ const columns = [
   },
 ];
 const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
-  workHoursWaitCheckListApi
+  workHoursWaitCheckListApi,
+  {
+    fetchDataHandle: () => {
+      selectedRowKeys.value = [];
+    },
+  }
 );
 
 const fields = ref([
@@ -195,7 +200,6 @@ const handleAudit = async (selectedIds, pass) => {
       );
       if (!res) return;
       MessagePlugin.success('操作成功');
-      selectedRowKeys.value = [];
       fetchData();
     },
   });

+ 6 - 3
src/views/work-hours/work-hours-manage/work-attendance/index.vue

@@ -139,7 +139,12 @@ const columns = [
   },
 ];
 const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
-  workAttendanceListApi
+  workAttendanceListApi,
+  {
+    fetchDataHandle: () => {
+      selectedRowKeys.value = [];
+    },
+  }
 );
 let statisticsInfo = reactive({ a: 1, b: 2, c: 3, d: 4, e: 5 });
 const getStatisticsInfo = async () => {
@@ -264,7 +269,6 @@ const multSubmit = () => {
       );
       if (!res) return;
       MessagePlugin.success('操作成功');
-      selectedRowKeys.value = [];
       fetchData();
     },
   });
@@ -286,7 +290,6 @@ const multExport = () => {
       );
       if (!res) return;
       MessagePlugin.success('开始下载');
-      selectedRowKeys.value = [];
     },
   });
 };