zhangjie 1 yıl önce
ebeveyn
işleme
98768cc829

+ 13 - 0
src/api/project-quality.js

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

+ 2 - 2
src/api/system.js

@@ -71,7 +71,7 @@ export const deviceEditApi = (data) => {
 };
 export const deviceDestroyApi = (id) =>
   request({
-    url: '/api/system/device/distroy',
+    url: '/api/system/device/destroy',
     data: { id },
   });
 
@@ -163,6 +163,6 @@ export const noticeCancelPublishApi = (id) =>
   });
 export const noticeDestroyApi = (id) =>
   request({
-    url: '/api/system/notice/distroy',
+    url: '/api/system/notice/destroy',
     data: { id },
   });

+ 8 - 1
src/hooks/useFetchTable.js

@@ -1,6 +1,11 @@
 import { ref, reactive, watch } from 'vue';
 
-//options参数示例:{ pageSize:20 , params: ref({ a:1, b:2 }) }
+// options参数示例:
+// {
+//   pageSize: 20,
+//   params: ref({ a: 1, b: 2 }),
+//   fetchDataHandle: () => {},
+// }
 export default function useFetchTable(apiFn, options = {}, immediately = true) {
   let pagination = reactive({
     page: 1,
@@ -33,6 +38,8 @@ export default function useFetchTable(apiFn, options = {}, immediately = true) {
       tableData.value = list;
       pagination.total = res.total;
       loading.value = false;
+
+      options.fetchDataHandle && options.fetchDataHandle();
     } catch (err) {
       console.warn('分页请求错误:', err);
     }

+ 40 - 15
src/views/project-quality/project-quality-manage/issues-feedback/index.vue

@@ -3,7 +3,10 @@
     <SearchForm :fields="fields" :params="params"></SearchForm>
     <div class="flex-1 page-wrap">
       <div class="btn-group">
-        <t-button theme="success" :disabled="!selectedRowKeys.length"
+        <t-button
+          theme="success"
+          :disabled="!selectedRowKeys.length"
+          @click="handleDestroy"
           >作废</t-button
         >
       </div>
@@ -18,6 +21,7 @@
           defaultPageSize: 10,
           onChange,
           total: pagination.total,
+          current: pagination.page,
         }"
         :selected-row-keys="selectedRowKeys"
         select-on-row-click
@@ -30,15 +34,17 @@
 
 <script setup lang="jsx" name="IssuesFeedback">
 import { reactive, ref } from 'vue';
-import { useRequest } from 'vue-request';
-import { getTableData } from '@/api/test';
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
+import {
+  issuesFeedbackListApi,
+  issuesFeedbackDestroyApi,
+} from '@/api/project-quality';
 import useFetchTable from '@/hooks/useFetchTable';
 
 const selectedRowKeys = ref([]);
-const selectChange = (value, { selectedRowData }) => {
+const selectChange = (value) => {
   selectedRowKeys.value = value;
 };
-
 const columns = [
   {
     colKey: 'row-select',
@@ -64,6 +70,10 @@ const columns = [
   { colKey: 'p', title: '当前负责人' },
 ];
 
+const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
+  issuesFeedbackListApi
+);
+
 const fields = ref([
   {
     prop: 'a',
@@ -100,6 +110,9 @@ const fields = ref([
       {
         type: 'button',
         text: '查询',
+        onClick: () => {
+          search();
+        },
       },
     ],
   },
@@ -141,15 +154,27 @@ const params = reactive({
   h: [],
 });
 
-const {
-  loading: tableLoading,
-  pagination,
-  tableData,
-  fetchData,
-  onChange,
-} = useFetchTable(getTableData);
+const handleDestroy = () => {
+  if (!selectedRowKeys.value.length) {
+    MessagePlugin.error('请选择要作废的记录');
+    return;
+  }
 
-const refresh = async () => {};
+  const confirmDia = DialogPlugin({
+    header: '操作提示',
+    body: `确定要作废当前选择的所有记录吗`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await issuesFeedbackDestroyApi(selectedRowKeys.value).catch(
+        () => {}
+      );
+      if (!res) return;
+      MessagePlugin.success('操作成功');
+      selectedRowKeys.value = [];
+      fetchData();
+    },
+  });
+};
 </script>
-
-<style></style>

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

@@ -4,7 +4,12 @@
     <div class="flex-1 page-wrap">
       <div class="btn-group">
         <t-button theme="success" @click="handleAdd">新增</t-button>
-        <t-button theme="danger" @click="handleDestroy">作废</t-button>
+        <t-button
+          theme="danger"
+          :disabled="!selectedRowKeys.length"
+          @click="handleDestroy"
+          >作废</t-button
+        >
       </div>
       <t-table
         size="small"
@@ -189,9 +194,10 @@ const handleDestroy = () => {
     cancelBtn: '取消',
     onConfirm: async () => {
       confirmDia.hide();
-      const res = await noticeDestroyApi(row.id).catch(() => {});
+      const res = await noticeDestroyApi(selectedRowKeys.value).catch(() => {});
       if (!res) return;
       MessagePlugin.success('操作成功');
+      selectedRowKeys.value = [];
       fetchData();
     },
   });

+ 1 - 0
src/views/work-hours/work-hours-manage/abnormal-check/wait-check.vue

@@ -195,6 +195,7 @@ const handleAudit = async (selectedIds, pass) => {
       );
       if (!res) return;
       MessagePlugin.success('操作成功');
+      selectedRowKeys.value = [];
       fetchData();
     },
   });

+ 15 - 13
src/views/work-hours/work-hours-manage/work-attendance/index.vue

@@ -78,23 +78,23 @@ const columns = [
   { colKey: 'c', title: '客户名称' },
   { colKey: 'd', title: '省份' },
   { colKey: 'e', title: '城市' },
-  { colKey: 'f', title: '进场时间' },
-  { colKey: 'g', title: '撤场时间' },
-  { colKey: 'h', title: '姓名(人员档案号)' },
+  { colKey: 'f', title: '进场时间', width: 170 },
+  { colKey: 'g', title: '撤场时间', width: 170 },
+  { colKey: 'h', title: '姓名(人员档案号)', width: 150 },
   { colKey: 'i', title: '项目角色' },
   { colKey: 'j', title: '供应商' },
-  { colKey: 'k', title: '实际出勤(天)' },
-  { colKey: 'l', title: '工作日(天)' },
-  { colKey: 'm', title: '周末(天)' },
-  { colKey: 'n', title: '法定节假日(天)' },
-  { colKey: 'o', title: '累计工时(天)' },
-  { colKey: 'p', title: '违规工时(天)' },
-  { colKey: 'q', title: '考勤异常数(天)' },
-  { colKey: 'r', title: '剩余补卡次数' },
-  { colKey: 's', title: '待处理异常数' },
+  { colKey: 'k', title: '实际出勤(天)', width: 120 },
+  { colKey: 'l', title: '工作日(天)', width: 110 },
+  { colKey: 'm', title: '周末(天)', width: 100 },
+  { colKey: 'n', title: '法定节假日(天)', width: 140 },
+  { colKey: 'o', title: '累计工时(天)', width: 120 },
+  { colKey: 'p', title: '违规工时(天)', width: 120 },
+  { colKey: 'q', title: '考勤异常数(天)', width: 140 },
+  { colKey: 'r', title: '剩余补卡次数', width: 110 },
+  { colKey: 's', title: '待处理异常数', width: 110 },
   { colKey: 't', title: '提交状态' },
   { colKey: 'u', title: '提交人' },
-  { colKey: 'v', title: '提交时间' },
+  { colKey: 'v', title: '提交时间', width: 170 },
   {
     title: '操作',
     colKey: 'operate',
@@ -264,6 +264,7 @@ const multSubmit = () => {
       );
       if (!res) return;
       MessagePlugin.success('操作成功');
+      selectedRowKeys.value = [];
       fetchData();
     },
   });
@@ -285,6 +286,7 @@ const multExport = () => {
       );
       if (!res) return;
       MessagePlugin.success('开始下载');
+      selectedRowKeys.value = [];
     },
   });
 };