zhangjie 1 жил өмнө
parent
commit
6f451f87bc

+ 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,
+  });

+ 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>

+ 0 - 2
src/views/system/config-manage/customer-manage/index.vue

@@ -9,7 +9,6 @@
           :button-props="{
             content: '批量导入',
           }"
-          :max-size="512"
         ></upload-button>
       </t-space>
       <t-table
@@ -42,7 +41,6 @@ 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';
 const showEditCustomerDialog = ref(false);
 const curRow = ref(null);

+ 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 = [];
     },
   });
 };