刘洋 7 maanden geleden
bovenliggende
commit
0b174410d9

+ 5 - 1
src/views/sop/components/dynamic-form-item/UPLOAD_IMAGE.vue

@@ -4,7 +4,11 @@
       ref="uploadRef3"
       v-model="files"
       :theme="theme"
-      :tips="config.length ? `最多只能上传 ${config.length} 张图片` : ''"
+      :tips="
+        config.length && config.writable
+          ? `最多只能上传 ${config.length} 张图片`
+          : ''
+      "
       accept="image/*"
       :abridge-name="[6, 6]"
       :auto-upload="true"

+ 3 - 3
src/views/sop/components/dynamic-form-item/static-content/DEVICE_IN.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="static-device-in">
     <t-tabs v-model="curStep">
-      <t-tab-panel value="设备签收登记" label="设备签收登记">
+      <!-- <t-tab-panel value="设备签收登记" label="设备签收登记">
         <Tab1 :sop="sop" />
-      </t-tab-panel>
+      </t-tab-panel> -->
       <t-tab-panel value="设备去处登记" label="设备去处登记"
         ><Tab2 :sop="sop" @getTableData="getTableData" />
       </t-tab-panel>
@@ -24,7 +24,7 @@ const props = defineProps({
     },
   },
 });
-const curStep = ref('设备签收登记');
+const curStep = ref('设备去处登记');
 const getTableData = (val) => {
   emit('getTableData', val);
 };

+ 10 - 37
src/views/sop/sop-manage/sop-step/index.vue

@@ -110,6 +110,14 @@
             :data="formData"
             labelAlign="top"
           >
+            <!-- “设备签收登记”表格,挪至 现场环境测试节点  2024.11月需求 -->
+            <div
+              v-if="curStepData?.formKey === 'cloudmark_sop_env_test.form'"
+              style="padding: 0 15px"
+            >
+              <BIG_TITLE :config="{ title: '设备签收登记' }" />
+              <Tab1 :sop="sop" />
+            </div>
             <!-- 如果是 设备入库登记,则展示固定内容,与动态表单无关 -->
             <div v-if="IS_DEVICE_IN">
               <StaticDeviceIn :sop="sop" @get-table-data="getTableData" />
@@ -231,6 +239,7 @@ import { MessagePlugin } from 'tdesign-vue-next';
 
 import DynamicFormItem from '../../components/dynamic-form-item/index.vue';
 import StaticDeviceIn from '../../components/dynamic-form-item/static-content/DEVICE_IN.vue';
+import BIG_TITLE from '../../components/dynamic-form-item/BIG_TITLE.vue';
 // import { useRouter, useRoute } from 'vue-router';
 import {
   sopFlowViewApi,
@@ -244,6 +253,7 @@ import { objCopy, timeNumberToText } from '@/utils/tool';
 import { timestampFilter } from '@/utils/filter';
 import bus from '@/utils/bus';
 import html2canvas from 'html2canvas';
+import Tab1 from '@/components/common/device-manage-new/tab1.vue';
 
 const deviceTableData = ref([]);
 const getTableData = (val) => {
@@ -648,44 +658,7 @@ const curFormConfig = computed(() => {
 
   // 填报时第一步的特殊处理
   if (curStepData.value.setup === 1) {
-    // region_user_id_1 区域协调人
-    // engineer_user_id_1 实施工程师
-    // assistant_engineer_user_id_1 助理工程师
     formProperty.forEach((field) => {
-      // // 区域协调人
-      // if (field.formId.startsWith('region_user')) {
-      //   field.value = crmInfo.value.regionCoordinatorId;
-      //   field.options = [
-      //     {
-      //       label: crmInfo.value.regionCoordinatorName,
-      //       value: crmInfo.value.regionCoordinatorId,
-      //     },
-      //   ];
-      // }
-      // // 实施工程师
-      // if (field.formId.startsWith('engineer_user')) {
-      //   field.options = crmInfo.value.effectEngineerList.map((user) => {
-      //     return {
-      //       label: user.name,
-      //       value: user.userId,
-      //     };
-      //   });
-      //   if (field.options.length == 1) {
-      //     field.value = field.options[0].value;
-      //   }
-      // }
-      // // 助理工程师
-      // if (field.formId.startsWith('assistant_engineer_user')) {
-      //   field.options = crmInfo.value.assistantEngineerList.map((user) => {
-      //     return {
-      //       label: user.name,
-      //       value: user.userId,
-      //     };
-      //   });
-      //   if (!field.options.length) {
-      //     field.writable = false;
-      //   }
-      // }
       if (field.formId.startsWith('week_people_day') && !field.value) {
         field.value = crmInfo.value.peoperDay;
       }

+ 106 - 0
src/views/work-hours/work-hours-manage/work-statistics/append-hours-dialog.vue

@@ -0,0 +1,106 @@
+<template>
+  <my-dialog
+    :visible="visible"
+    :header="`追加工时`"
+    :width="600"
+    :closeOnOverlayClick="false"
+    @close="emit('update:visible', false)"
+  >
+    <template #foot>
+      <t-button theme="default" @click="emit('update:visible', false)"
+        >取消</t-button
+      >
+      <t-button theme="primary" @click="save">保存</t-button>
+    </template>
+  </my-dialog>
+</template>
+<script setup name="AddUserDialog">
+import useClearDialog from '@/hooks/useClearDialog';
+import { ref, computed, reactive } from 'vue';
+import { getOrgStructList, getRoleList, addUser } from '@/api/user';
+import { useRequest } from 'vue-request';
+import { GENDER_TYPE } from '@/config/constants';
+
+const props = defineProps({
+  visible: Boolean,
+  curRow: Object,
+});
+const emit = defineEmits(['close', 'success']);
+const formRef = ref(null);
+let formData = reactive({
+  addDays: '', // 增加天数
+  addHours: '', // 增加工时
+  serviceId: '',
+  sopNo: null, // sopNo 区协不传其他必传
+  userId: '', // 要增加工时所选择的人的id
+});
+
+const rules = {
+  loginName: [
+    {
+      required: true,
+      message: '请填写登录名',
+      type: 'error',
+      trigger: 'blur',
+    },
+  ],
+  realName: [
+    {
+      required: true,
+      message: '请填写真实姓名',
+      type: 'error',
+      trigger: 'blur',
+    },
+  ],
+  mobileNumber: [
+    {
+      required: true,
+      message: '请填写手机号',
+    },
+  ],
+  orgId: [
+    {
+      required: true,
+      message: '请选择机构',
+    },
+  ],
+  gender: [
+    {
+      required: true,
+      message: '请选择性别',
+    },
+  ],
+  roleIds: [
+    {
+      required: true,
+      message: '请选择角色',
+    },
+    {
+      validator: (val) => {
+        if (!val?.length) {
+          return {
+            result: false,
+            message: '请选择角色',
+          };
+        }
+        return {
+          result: true,
+          type: 'success',
+        };
+      },
+    },
+  ],
+};
+const addHandler = () => {
+  addUser({ ...formData, id: props.curRow?.id || undefined }).then(() => {
+    emit('success');
+  });
+};
+const save = () => {
+  formRef.value.validate().then(async (result) => {
+    if (result === true) {
+      addHandler();
+    }
+  });
+};
+</script>

+ 0 - 322
src/views/work-hours/work-hours-manage/work-statistics/index_old.vue

@@ -1,322 +0,0 @@
-<template>
-  <div class="work-statistics flex flex-col h-full">
-    <div v-if="perm.BUTTON_Export" class="page-action">
-      <t-button theme="primary" @click="handleExport">
-        <template #icon><svg-icon name="export" color="#fff" /></template
-        >导出统计结果
-      </t-button>
-    </div>
-    <SearchForm :fields="fields" :params="params" :search="mixinSearch">
-      <template #service="{ item, params }">
-        <select-service-unit
-          v-model="params[item.prop]"
-          :filterParams="{ statusList: ['PUBLISH'] }"
-        ></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">
-      <p class="page-wrap-tips">
-        <t-space :size="0">
-          <span>
-            <ErrorCircleFilledIcon /> 考勤总计:{{ statisticsInfo.total }}
-          </span>
-          <span>已提交:{{ statisticsInfo.submitted }}</span>
-          <span>待提交:{{ statisticsInfo.unSubmitted }}</span>
-          <span>已提交累计人天:{{ statisticsInfo.allDays }}天</span>
-          <span
-            >已提交累计工时:{{ statisticsInfo.allHours?.toFixed(1) }}小时</span
-          >
-          <template #separator>
-            <t-divider layout="vertical" />
-          </template>
-        </t-space>
-      </p>
-
-      <t-table
-        size="small"
-        row-key="id"
-        :columns="columns"
-        :data="tableData"
-        bordered
-        :pagination="{
-          defaultCurrent: 1,
-          defaultPageSize: 10,
-          onChange,
-          showJumper: true,
-          showPageSize: false,
-          total: pagination.total,
-          current: pagination.pageNumber,
-        }"
-      >
-        <template #user="{ row }">
-          {{ row.userName }}({{ row.userNo }})
-        </template>
-        <template #scanStartTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #scanEndTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #markPaperStartTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #markPaperEndTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </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 }">
-          {{ attendanceStatisticsSubmitStatusFilter(row[col.colKey]) }}
-        </template>
-        <template #operate="{ row }">
-          <div v-if="perm.LINK_Reject" class="table-operations">
-            <t-link
-              :disabled="row.status !== 'APPLY_WITHDRAW'"
-              theme="primary"
-              hover="color"
-              @click="handlePass(row)"
-            >
-              同意撤回
-            </t-link>
-          </div>
-        </template>
-      </t-table>
-    </div>
-  </div>
-</template>
-
-<script setup name="WorkStatistics">
-import { ref, reactive, onMounted } from 'vue';
-import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
-import { ErrorCircleFilledIcon } from 'tdesign-icons-vue-next';
-import useFetchTable from '@/hooks/useFetchTable';
-import {
-  workStatisticsListApi,
-  workStatisticsInfoApi,
-  workStatisticsExportApi,
-  workStatisticsPassApi,
-} from '@/api/work-hours';
-import {
-  timestampFilter,
-  attendanceStatisticsSubmitStatusFilter,
-} from '@/utils/filter';
-import { ATTENDANCE_STATISTICS_SUBMIT_STATUS } from '@/config/constants';
-import { dictToOptionList } from '@/utils/tool';
-import usePermission from '@/hooks/usePermission';
-const { perm } = usePermission();
-
-const fields = ref([
-  {
-    prop: 'serviceId',
-    label: '服务单元',
-    type: 'select',
-    labelWidth: 90,
-    colSpan: 6,
-    cell: 'service',
-  },
-  {
-    prop: 'status',
-    label: '提交状态',
-    type: 'select',
-    labelWidth: 80,
-    colSpan: 6,
-    options: dictToOptionList(ATTENDANCE_STATISTICS_SUBMIT_STATUS).filter(
-      (item) => item.value !== 'WILL_SUBMIT'
-    ),
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'createId',
-    label: '提交人',
-    type: 'select',
-    labelWidth: 95,
-    colSpan: 6,
-    cell: 'creator',
-  },
-  {
-    prop: 'userName',
-    label: '姓名',
-    labelWidth: 80,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    type: 'buttons',
-    colSpan: 3,
-    children: [
-      {
-        type: 'button',
-        text: '搜索',
-        onClick: () => {
-          search();
-          getStatisticsInfo();
-        },
-      },
-    ],
-  },
-  {
-    prop: 'supplierId',
-    label: '所属供应商',
-    type: 'select',
-    labelWidth: 90,
-    colSpan: 6,
-    cell: 'supplier',
-  },
-  {
-    prop: 'custom',
-    label: '客户名称',
-    labelWidth: 80,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
-    },
-  },
-  {
-    prop: 'sopNo',
-    label: 'SOP流水号',
-    labelWidth: 95,
-    colSpan: 6,
-    attrs: {
-      clearable: true,
-    },
-  },
-  // {
-  //   prop: 'days',
-  //   type: 'number',
-  //   label: '违规工时',
-  //   labelWidth: 80,
-  //   colSpan: 6,
-  //   attrs: {
-  //     theme: 'column',
-  //     decimalPlaces: 0,
-  //     max: 1000000,
-  //     min: 0,
-  //     label: '>',
-  //     style: 'width: 100%',
-  //   },
-  // },
-]);
-const mixinSearch = () => {
-  search();
-  getStatisticsInfo();
-};
-const params = reactive({
-  serviceId: '',
-  status: '',
-  createId: '',
-  userName: '',
-  supplierId: '',
-  custom: '',
-  sopNo: '',
-  // days: '',
-});
-
-const columns = [
-  { colKey: 'service', title: '服务单元', width: 160 },
-  { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
-  { colKey: 'custom', title: '客户名称', width: 120 },
-  { colKey: 'province', title: '省份', width: 120 },
-  { colKey: 'city', title: '城市', width: 120 },
-  // {
-  //   colKey: 'examStartTime',
-  //   title: '项目开始时间',
-  //   width: 180,
-  //   cell: 'start-time',
-  // },
-  // {
-  //   colKey: 'examEndTime',
-  //   title: '项目结束时间',
-  //   width: 180,
-  //   cell: 'end-time',
-  // },
-  { colKey: 'scanStartTime', title: '扫描开始时间', width: 180 },
-  { colKey: 'scanEndTime', title: '扫描结束时间', width: 180 },
-  { colKey: 'markPaperStartTime', title: '阅卷开始时间', width: 180 },
-  { colKey: 'markPaperEndTime', title: '阅卷结束时间', width: 180 },
-  { colKey: 'userName', title: '姓名(人员档案号)', cell: 'user', width: 170 },
-  { colKey: 'roleName', title: '项目角色', width: 120 },
-  { colKey: 'supplier', title: '供应商' },
-  { colKey: 'attendance', title: '实际出勤(天)', width: 140 },
-  { colKey: 'weekdays', title: '工作日(天)', width: 130 },
-  { colKey: 'weekends', title: '周末(天)', width: 120 },
-  { colKey: 'holidays', title: '法定节假日(天)', width: 160 },
-  { colKey: 'workHours', title: '累计工时(小时)', width: 140 },
-  // { colKey: 'violationDays', title: '违规工时(天)', width: 140 },
-  { colKey: 'submitter', title: '提交人', width: 120 },
-  {
-    colKey: 'submissionTime',
-    title: '提交时间',
-    cell: 'submit-time',
-    width: 180,
-  },
-  { colKey: 'status', title: '提交状态', cell: 'status', width: 100 },
-  {
-    title: '管理',
-    colKey: 'operate',
-    fixed: 'right',
-    width: 100,
-  },
-];
-const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
-  workStatisticsListApi,
-  { params }
-);
-
-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: '同意撤回提示',
-    body: `您确定要同意撤回这条工时数据吗?撤回后,该工时数据可以暂时无法继续结算。`,
-    confirmBtn: '确定',
-    cancelBtn: '取消',
-    onConfirm: async () => {
-      confirmDia.hide();
-      const res = await workStatisticsPassApi(row.id).catch(() => {});
-      if (!res) return;
-      MessagePlugin.success('操作成功');
-      fetchData();
-    },
-  });
-};
-
-onMounted(() => {
-  getStatisticsInfo();
-});
-</script>