zhangjie 1 vuosi sitten
vanhempi
commit
d5c4bc426a

+ 5 - 0
src/api/service-unit.js

@@ -53,6 +53,11 @@ export const serviceUnitQueryApi = (data) =>
     url: '/api/service/service/unit/page',
     params: data,
   });
+export const serviceUnitListApi = (data) =>
+  request({
+    url: '/api/admin/common/query_service_unit',
+    params: data,
+  });
 export const serviceUnitEditApi = (data) =>
   request({
     url: '/api/service/service/unit/edit',

+ 12 - 6
src/api/work-hours.js

@@ -61,16 +61,22 @@ export const workAttendanceCancelWithdrawApi = (id) =>
 // work-statistics
 export const workStatisticsListApi = (data) =>
   request({
-    url: '/api/system/work-statistics/list',
-    data,
+    url: '/api/admin/tb/ding/query',
+    params: data,
   });
 export const workStatisticsInfoApi = (data) =>
   request({
-    url: '/api/system/work-statistics/info',
-    data,
+    url: '/api/admin/tb/ding/count',
+    params: data,
+  });
+export const workStatisticsExportApi = (data) =>
+  request({
+    url: ' /api/admin/tb/ding/export',
+    params: data,
+    download: true,
   });
 export const workStatisticsPassApi = (id) =>
   request({
-    url: '/api/system/work-statistics/pass',
-    data: { id },
+    url: '/api/admin/ding/exception/apply/save',
+    params: { id },
   });

+ 1 - 1
src/components/common/select-customer/index.vue

@@ -26,7 +26,7 @@ const attrs = useAttrs();
 
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
-  modelValue: { type: [Number, String], default: '' },
+  modelValue: { type: [Number, String, Array], default: '' },
   type: { type: String, default: '' },
   typeRequired: { type: Boolean, default: false },
 });

+ 64 - 0
src/components/common/select-filter-user/index.vue

@@ -0,0 +1,64 @@
+<template>
+  <t-select
+    v-model="selected"
+    clearable
+    filterable
+    :loading="loading"
+    @search="search"
+    @change="onChange"
+  >
+    <t-option
+      v-for="item in optionList"
+      :key="item.id"
+      :value="item.id"
+      :label="item.realName"
+    />
+  </t-select>
+</template>
+
+<script setup name="SelectFilterUser">
+import { ref, watch } from 'vue';
+import { getUserList } from '@/api/user';
+
+const emit = defineEmits(['update:modelValue', 'change']);
+const props = defineProps({
+  modelValue: { type: [Number, String], default: '' },
+});
+
+let optionList = ref([]);
+let selected = ref('');
+let loading = ref(false);
+
+async function search(userInfo) {
+  optionList.value = [];
+  if (!userInfo) return;
+
+  if (loading.value) return;
+  loading.value = true;
+  const res = await getUserList({
+    userInfo,
+    enable: true,
+    pageNumber: 1,
+    pageSize: 10,
+  }).catch(() => {});
+  loading.value = false;
+  if (!res) return;
+
+  optionList.value = res.records;
+}
+
+const onChange = () => {
+  const selectedData = optionList.value.find(
+    (item) => selected.value === item.id
+  );
+  emit('update:modelValue', selected.value);
+  emit('change', selectedData);
+};
+
+watch(
+  () => props.modelValue,
+  (val) => {
+    selected.value = val;
+  }
+);
+</script>

+ 1 - 1
src/components/common/select-role/index.vue

@@ -26,7 +26,7 @@ const attrs = useAttrs();
 
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
-  modelValue: { type: [Number, String], default: '' },
+  modelValue: { type: [Number, String, Array], default: '' },
 });
 
 const search = async () => {

+ 1 - 1
src/components/common/select-service-level/index.vue

@@ -26,7 +26,7 @@ const attrs = useAttrs();
 
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
-  modelValue: { type: [Number, String], default: '' },
+  modelValue: { type: [Number, String, Array], default: '' },
   type: { type: String, default: '' },
   typeRequired: { type: Boolean, default: false },
 });

+ 21 - 8
src/components/common/select-service-unit/index.vue

@@ -17,7 +17,7 @@
 
 <script setup name="SelectServiceUnit">
 import { onMounted, ref, useAttrs, watch } from 'vue';
-import { serviceUnitQueryApi } from '@/api/service-unit';
+import { serviceUnitListApi } from '@/api/service-unit';
 
 let optionList = ref([]);
 let selected = ref('');
@@ -26,20 +26,24 @@ const attrs = useAttrs();
 
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
-  modelValue: { type: [Number, String], default: '' },
-  status: { type: String },
+  modelValue: { type: [Number, String, Array], default: '' },
+  filterParams: {
+    type: Object,
+    default() {
+      // type:'',status:''
+      return {};
+    },
+  },
 });
 
 const search = async () => {
   optionList.value = [];
 
-  let data = { pageNumber: 1, pageSize: 100 };
-  if (props.status) data.status = props.status;
-
-  const res = await serviceUnitQueryApi(data).catch(() => {});
+  let data = { ...props.filterParams };
+  const res = await serviceUnitListApi(data).catch(() => {});
   if (!res) return;
 
-  optionList.value = res.records || [];
+  optionList.value = res;
 };
 
 const onChange = () => {
@@ -63,4 +67,13 @@ watch(
     selected.value = val;
   }
 );
+watch(
+  () => props.filterParams,
+  (val, oldval) => {
+    if (JSON.stringify(val) !== JSON.stringify(oldval)) search();
+  },
+  {
+    deep: true,
+  }
+);
 </script>

+ 1 - 1
src/components/common/select-supplier/index.vue

@@ -26,7 +26,7 @@ const attrs = useAttrs();
 
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
-  modelValue: { type: [Number, String], default: '' },
+  modelValue: { type: [Number, String, Array], default: '' },
   type: { type: String, default: '' },
   typeRequired: { type: Boolean, default: false },
 });

+ 1 - 1
src/components/common/select-type-user/index.vue

@@ -26,7 +26,7 @@ const attrs = useAttrs();
 
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
-  modelValue: { type: [Number, String], default: '' },
+  modelValue: { type: [Number, String, Array], default: '' },
   type: { type: String, default: '' },
 });
 

+ 3 - 0
src/components/global/search-form/components/search-form-item.vue

@@ -35,6 +35,9 @@
   <template v-if="item.type == undefined || item.type == 'text'">
     <t-input v-model="params[item.prop]" v-bind="attrs" />
   </template>
+  <template v-if="item.type == 'number'">
+    <t-input-number v-model="params[item.prop]" v-bind="attrs" />
+  </template>
   <!-- 下拉选择框 -->
   <template v-if="item.type == 'select' || item.type == 'multipleSelect'">
     <t-select

+ 9 - 0
src/config/constants.js

@@ -65,3 +65,12 @@ export const ISSUES_REASON_TYPE = {
   OTHER: '其它',
 };
 export const ISSUES_INFLUENCE_DEGREE = ['A', 'B', 'C', 'D'];
+
+// SOP
+export const FLOW_STATUS = {
+  START: '已开始',
+  AUDITING: '审核中',
+  REJECT: '已驳回',
+  END: '已终止',
+  FINISH: '已结束',
+};

+ 5 - 0
src/utils/filter.js

@@ -7,6 +7,7 @@ import {
   SERVICE_UNIT_STATUS,
   ISSUES_TYPE,
   ISSUES_REASON_TYPE,
+  FLOW_STATUS,
 } from '@/config/constants';
 import { dateFormat } from './tool';
 
@@ -46,3 +47,7 @@ export function issuesTypeFilter(val) {
 export function issuesReasonTypeFilter(val) {
   return ISSUES_REASON_TYPE[val] || DEFAULT_FIELD;
 }
+// sop
+export function flowStatusFilter(val) {
+  return FLOW_STATUS[val] || DEFAULT_FIELD;
+}

+ 27 - 10
src/views/project-quality/project-quality-manage/issues-feedback/index.vue

@@ -34,13 +34,19 @@
         <template #type="{ col, row }">
           {{ customerTypeFilter(row[col.colKey]) }}
         </template>
+        <template #flow-status="{ col, row }">
+          {{ flowStatusFilter(row[col.colKey]) }}
+        </template>
         <template #issues-type="{ col, row }">
           {{ issuesTypeFilter(row[col.colKey]) }}
         </template>
         <template #issues-reason="{ col, row }">
           {{ issuesReasonTypeFilter(row[col.colKey]) }}
         </template>
-        <template #create-time="{ col, row }">
+        <template #submit-time="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #update-time="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
         </template>
       </t-table>
@@ -64,6 +70,7 @@ import {
   customerTypeFilter,
   issuesReasonTypeFilter,
   issuesTypeFilter,
+  flowStatusFilter,
 } from '@/utils/filter';
 import {
   ISSUES_INFLUENCE_DEGREE,
@@ -197,22 +204,32 @@ const columns = [
     width: 50,
     fixed: 'left',
   },
-  { colKey: 'problemNo', title: '质量问题编号' },
-  { colKey: 'crmNo', title: '项目单号' },
+  { colKey: 'problemNo', title: '质量问题编号', minWidth: 120 },
+  { colKey: 'crmNo', title: '项目单号', minWidth: 120 },
   { colKey: 'customType', title: '客户类型', cell: 'type', width: 100 },
   { colKey: 'custom', title: '客户名称' },
   { colKey: 'sopType', title: '实施产品' },
   { colKey: 'summary', title: '问题简要' },
-  { colKey: 'userName', title: '责任人' },
+  { colKey: 'userNames', title: '责任人' },
   { colKey: 'type', title: '问题类型', cell: 'issues-type', width: 120 },
   { colKey: 'reason', title: '问题归因', cell: 'issues-reason', width: 120 },
   { colKey: 'influenceDegree', title: '影响度', width: 70 },
-  { colKey: 'createName', title: '提交人' },
-  { colKey: 'createTime', title: '提交时间', cell: 'create-time', width: 170 },
-  { colKey: 'm', title: '更新时间' },
-  { colKey: 'n', title: '流程状态' },
-  { colKey: 'o', title: '当前节点' },
-  { colKey: 'p', title: '当前负责人' },
+  { colKey: 'submitter', title: '提交人' },
+  {
+    colKey: 'submissionTime',
+    title: '提交时间',
+    cell: 'submit-time',
+    width: 170,
+  },
+  {
+    colKey: 'updateDateTime',
+    title: '更新时间',
+    cell: 'update-time',
+    width: 170,
+  },
+  { colKey: 'status', title: '流程状态', cell: 'flow-status', width: 100 },
+  { colKey: 'setup', title: '当前节点' },
+  { colKey: 'pendApproveUsers', title: '当前负责人' },
 ];
 
 const { pagination, tableData, fetchData, search, onChange } = useFetchTable(

+ 9 - 4
src/views/service-unit/service-unit-manage/add-range/index.vue

@@ -1,6 +1,13 @@
 <template>
   <div class="add-range flex flex-col h-full">
-    <SearchForm :fields="fields" :params="params"></SearchForm>
+    <SearchForm :fields="fields" :params="params">
+      <template #user="{ item, params }">
+        <select-type-user
+          v-model="params[item.prop]"
+          type="ACCOUNT_MANAGER"
+        ></select-type-user>
+      </template>
+    </SearchForm>
 
     <div class="flex-1 page-wrap">
       <div class="btn-group">
@@ -74,9 +81,7 @@ const fields = ref([
     type: 'select',
     labelWidth: 80,
     colSpan: 5,
-    attrs: {
-      clearable: true,
-    },
+    cell: 'user',
   },
   {
     prop: 'productType',

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

@@ -96,7 +96,7 @@ const { formData, isEdit } = useClearDialog(
   {
     id: null,
     name: '',
-    serviceId: '1',
+    serviceId: '',
     dingRoleIds: [],
     supplierId: '',
     signInTime: ['06:00', '10:00'],

+ 1 - 0
src/views/system/config-manage/service-level-manage/edit-service-level-dialog.vue

@@ -28,6 +28,7 @@
         </t-col>
         <t-col :span="12">
           <t-form-item label="项目角色配置" name="roleList">
+            <!-- TODO: -->
             <t-select v-model="formData.roleList">
               <t-option
                 v-for="(val, key) in CUSTOMER_TYPE"

+ 3 - 2
src/views/system/notice-log/notice-manage/edit-notice-dialog.vue

@@ -23,7 +23,8 @@
         </t-col>
         <t-col :span="6">
           <t-form-item label="服务单元" name="serviceId">
-            <t-select v-model="formData.serviceId"> </t-select>
+            <select-service-unit v-model="formData.serviceId">
+            </select-service-unit>
           </t-form-item>
         </t-col>
         <t-col :span="12">
@@ -74,7 +75,7 @@ const { formData, isEdit } = useClearDialog(
   {
     id: null,
     type: '',
-    serviceId: '1',
+    serviceId: '',
     title: '',
     content: '',
     status: 'UN_PUBLISH',

+ 0 - 1
src/views/system/notice-log/notice-manage/notice-message-dialog.vue

@@ -95,7 +95,6 @@ const fields = ref([
     labelWidth: 70,
     colSpan: 5,
     cell: 'supplier',
-    options: [],
   },
   {
     prop: 'status',

+ 169 - 78
src/views/work-hours/work-hours-manage/work-statistics/index.vue

@@ -1,14 +1,31 @@
 <template>
   <div class="work-statistics flex flex-col h-full">
-    <SearchForm :fields="fields" :params="params"></SearchForm>
+    <SearchForm :fields="fields" :params="params">
+      <template #service="{ item, params }">
+        <select-service-unit v-model="params[item.prop]"></select-service-unit>
+      </template>
+      <template #supplier="{ item, params }">
+        <select-supplier v-model="params[item.prop]"> </select-supplier>
+      </template>
+      <template #creator="{ item, params }">
+        <select-filter-user v-model="params[item.prop]"> </select-filter-user>
+      </template>
+    </SearchForm>
     <div class="flex-1 page-wrap">
-      <t-space>
-        <span>考勤总计:{{ statisticsInfo.a }}</span>
-        <span>已提交:{{ statisticsInfo.b }}</span>
-        <span>待提交:{{ statisticsInfo.c }}</span>
-        <span>已提交累计人天:{{ statisticsInfo.d }}天</span>
-        <span>已提交累计工时:{{ statisticsInfo.e }}小时</span>
-      </t-space>
+      <div class="flex justify-between items-center">
+        <t-space>
+          <span>考勤总计:{{ statisticsInfo.total }}</span>
+          <span>已提交:{{ statisticsInfo.submitted }}</span>
+          <span>待提交:{{ statisticsInfo.unSubmitted }}</span>
+          <span>已提交累计人天:{{ statisticsInfo.allDays }}天</span>
+          <span>已提交累计工时:{{ statisticsInfo.allHours }}小时</span>
+        </t-space>
+        <div class="btn-group">
+          <t-button theme="success" @click="handleExport"
+            >导出统计结果</t-button
+          >
+        </div>
+      </div>
       <t-table
         size="small"
         row-key="id"
@@ -23,101 +40,88 @@
           current: pagination.pageNumber,
         }"
       >
+        <template #user="{ row }">
+          {{ row.userName }}({{ row.userNo }})
+        </template>
+        <template #start-time="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #end-time="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #submit-time="{ col, row }">
+          {{ timestampFilter(row[col.colKey]) }}
+        </template>
+        <template #status="{ col, row }">
+          {{ flowStatusFilter(row[col.colKey]) }}
+        </template>
+        <template #operate="{ row }">
+          <div class="table-operations">
+            <t-link
+              v-if="row.status === 'AUDITING'"
+              theme="primary"
+              hover="color"
+              @click="handlePass(row)"
+            >
+              同意撤回
+            </t-link>
+          </div>
+        </template>
       </t-table>
     </div>
   </div>
 </template>
 
 <script setup lang="jsx" name="WorkStatistics">
-import { ref, reactive } from 'vue';
+import { ref, reactive, onMounted } from 'vue';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
 import {
   workStatisticsListApi,
   workStatisticsInfoApi,
+  workStatisticsExportApi,
   workStatisticsPassApi,
 } from '@/api/work-hours';
-
-const columns = [
-  { colKey: 'a', title: '服务单元' },
-  { colKey: 'b', title: 'SOP流水号' },
-  { colKey: 'c', title: '客户名称' },
-  { colKey: 'd', title: '省份' },
-  { colKey: 'e', 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: '实际出勤(天)', 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: '提交人' },
-  { colKey: 'r', title: '提交时间', width: 170 },
-  { colKey: 's', title: '提交状态', width: 100 },
-  {
-    title: '管理',
-    colKey: 'operate',
-    fixed: 'right',
-    width: 120,
-    cell: (h, { row }) => {
-      return (
-        <div class="table-operations">
-          <t-link
-            theme="primary"
-            hover="color"
-            onClick={(e) => {
-              e.stopPropagation();
-              handlePass(row);
-            }}
-          >
-            同意撤回
-          </t-link>
-        </div>
-      );
-    },
-  },
-];
-const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
-  workStatisticsListApi
-);
-
-let statisticsInfo = reactive({ a: 1, b: 2, c: 3, d: 4, e: 5 });
-const getStatisticsInfo = async () => {
-  const res = await workStatisticsInfoApi(params);
-  statisticsInfo = res.data || {};
-};
+import { timestampFilter, flowStatusFilter } from '@/utils/filter';
+import { FLOW_STATUS } from '@/config/constants';
+import { dictToOptionList } from '@/utils/tool';
 
 const fields = ref([
   {
-    prop: 'a',
+    prop: 'serviceId',
     label: '服务单元',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
+    cell: 'service',
   },
   {
-    prop: 'b',
+    prop: 'status',
     label: '提交状态',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
+    options: dictToOptionList(FLOW_STATUS),
+    attrs: {
+      clearable: true,
+    },
   },
   {
-    prop: 'c',
+    prop: 'createId',
     label: '提交人',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
+    cell: 'creator',
   },
   {
-    prop: 'd',
+    prop: 'userName',
     label: '姓名',
     labelWidth: 100,
     colSpan: 5,
+    attrs: {
+      clearable: true,
+    },
   },
   {
     type: 'buttons',
@@ -134,42 +138,125 @@ const fields = ref([
     ],
   },
   {
-    prop: 'e',
+    prop: 'supplierId',
     label: '所属供应商',
     type: 'select',
     labelWidth: 100,
     colSpan: 5,
+    cell: 'supplier',
   },
   {
-    prop: 'f',
+    prop: 'custom',
     label: '客户名称',
     labelWidth: 100,
     colSpan: 5,
+    attrs: {
+      clearable: true,
+    },
   },
   {
-    prop: 'g',
+    prop: 'sopNo',
     label: 'SOP流水号',
     labelWidth: 100,
     colSpan: 5,
+    attrs: {
+      clearable: true,
+    },
   },
   {
-    prop: 'h',
+    prop: 'days',
+    type: 'number',
     label: '违规工时>',
     labelWidth: 100,
     colSpan: 5,
+    attrs: {
+      theme: 'column',
+      decimalPlaces: 0,
+      max: 1000000,
+      min: 0,
+      style: 'width: 120px',
+    },
   },
 ]);
 const params = reactive({
-  a: '',
-  b: '',
-  c: '',
-  d: '',
-  e: '',
-  f: '',
-  g: '',
-  h: '',
+  serviceId: '',
+  status: '',
+  createId: '',
+  userName: '',
+  supplierId: '',
+  custom: '',
+  sopNo: '',
+  days: '',
 });
 
+const columns = [
+  { colKey: 'service', title: '服务单元' },
+  { colKey: 'sopNo', title: 'SOP流水号' },
+  { colKey: 'custom', title: '客户名称' },
+  { colKey: 'province', title: '省份' },
+  { colKey: 'city', title: '城市' },
+  {
+    colKey: 'examStartTime',
+    title: '项目开始时间',
+    width: 170,
+    cell: 'start-time',
+  },
+  {
+    colKey: 'examEndTime',
+    title: '项目结束时间',
+    width: 170,
+    cell: 'end-time',
+  },
+  { colKey: 'userName', title: '姓名(人员档案号)', cell: 'user', width: 150 },
+  { colKey: 'roleName', title: '项目角色' },
+  { colKey: 'supplier', title: '供应商' },
+  { colKey: 'attendance', title: '实际出勤(天)', width: 120 },
+  { colKey: 'weekdays', title: '工作日(天)', width: 110 },
+  { colKey: 'weekends', title: '周末(天)', width: 100 },
+  { colKey: 'holidays', title: '法定节假日(天)', width: 140 },
+  { colKey: 'workHours', title: '累计工时(天)', width: 120 },
+  { colKey: 'violationDays', title: '违规工时(天)', width: 120 },
+  { colKey: 'submitter', title: '提交人' },
+  {
+    colKey: 'submissionTime',
+    title: '提交时间',
+    cell: 'submit-time',
+    width: 170,
+  },
+  { colKey: 'status', title: '提交状态', cell: 'status', width: 100 },
+  {
+    title: '管理',
+    colKey: 'operate',
+    cell: 'operate',
+    fixed: 'right',
+    width: 100,
+  },
+];
+const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
+  workStatisticsListApi
+);
+
+let statisticsInfo = ref({});
+const getStatisticsInfo = async () => {
+  const res = await workStatisticsInfoApi(params);
+  statisticsInfo.value = res || {};
+};
+
+const handleExport = () => {
+  const confirmDia = DialogPlugin({
+    header: '操作提示',
+    body: `确定要导出查询到的所有结果吗?`,
+    confirmBtn: '确定',
+    cancelBtn: '取消',
+    onConfirm: async () => {
+      confirmDia.hide();
+      const res = await workStatisticsExportApi(params).catch(() => {});
+      if (!res) return;
+      MessagePlugin.success('开始下载');
+    },
+  });
+};
+
 const handlePass = (row) => {
   const confirmDia = DialogPlugin({
     header: '同意撤回提示',
@@ -185,4 +272,8 @@ const handlePass = (row) => {
     },
   });
 };
+
+onMounted(() => {
+  getStatisticsInfo();
+});
 </script>