xiaodai2017 2 éve
szülő
commit
ec05218b67

+ 2 - 1
src/components/ReIcon/src/iconifyIconOffline.ts

@@ -43,7 +43,8 @@ import WarningFilled from "@iconify-icons/ep/warning-filled";
 import Excel from "@iconify-icons/fa-solid/file-excel";
 import Promotion from "@iconify-icons/ep/promotion";
 import BellFilled from "@iconify-icons/ep/bell-filled";
-
+import downloadLine from "@iconify-icons/ep/download";
+addIcon("download-line", downloadLine);
 addIcon("bell-filled", BellFilled);
 addIcon("success", Select);
 addIcon("excel", Excel);

+ 0 - 10
src/views/reportForm/reportApply/config/_options.ts

@@ -1,10 +0,0 @@
-export const type_options = [
-  {
-    value: "1",
-    label: "立即执行"
-  },
-  {
-    value: "2",
-    label: "延迟执行"
-  }
-];

+ 0 - 19
src/views/reportForm/reportApply/config/content.config.ts

@@ -1,12 +1,10 @@
 import { ContentConfig } from "/@/components/PageContent";
 
 import { httpList, httpAdd, httpStatus } from "/@/api/reportForm/reportApply";
-// import { useUserInfo } from "/@/hooks/core/useUser";
 import { h } from "vue";
 import dayjs from "dayjs";
 import { ElTag } from "element-plus";
 import { type_options } from "./_options";
-// const { isSuperUser } = useUserInfo();
 const columns = [
   {
     type: "selection",
@@ -23,23 +21,6 @@ const columns = [
     label: "报表名称",
     prop: "name"
   },
-  {
-    label: "执行类型",
-    prop: "type",
-    width: "100px",
-    cellRenderer: ({ row, props }) =>
-      h(
-        ElTag,
-        {
-          size: props.size,
-          type: String(row.type) === "1" ? "" : "success"
-        },
-        {
-          default: () =>
-            type_options.find(s => String(row.type) === s.value)?.label
-        }
-      )
-  },
   {
     label: "状态",
     prop: "status",

+ 0 - 9
src/views/reportForm/reportApply/config/modal.config.ts

@@ -29,15 +29,6 @@ const modalConfig: ModalConfig = {
   colLayout: { span: 24 },
   itemStyle: {},
   formItems: [
-    {
-      field: "type",
-      type: "select",
-      label: "执行类型",
-      labelWidth: "120px",
-      placeholder: "执行类型",
-      rules: [{ required: true, trigger: "change", message: "请选择执行类型" }],
-      options: type_options
-    },
     {
       field: "name",
       type: "input",

+ 0 - 7
src/views/reportForm/reportApply/config/search.config.ts

@@ -1,4 +1,3 @@
-import { type_options } from "./_options";
 import { FormConfig } from "/@/components/PageSearch";
 
 const searchFormConfig: FormConfig = {
@@ -10,12 +9,6 @@ const searchFormConfig: FormConfig = {
     xs: 12
   },
   formItems: [
-    {
-      field: "type",
-      type: "select",
-      placeholder: "执行类型",
-      options: type_options
-    },
     {
       field: "status",
       type: "select",

+ 1 - 4
src/views/reportForm/reportRecord/config/modal.config.ts

@@ -11,10 +11,7 @@ async function get_list() {
     data.forEach(si => {
       const model = {
         value: si.id,
-        label:
-          si.name +
-          "--" +
-          type_options.find(s => String(si.type) === s.value)?.label,
+        label: si.name,
         disabled: String(si.status) == "0"
       };
       arr.push(model);

+ 23 - 6
src/views/reportForm/reportRecord/index.vue

@@ -5,6 +5,7 @@ import modalConfig from "./config/modal.config";
 import { usePageSearch, usePageModal, type PageHooks } from "/@/hooks/page";
 import { useCompany } from "/@/hooks/core/useCompany";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { ElMessage } from "element-plus";
 import dayjs from "dayjs";
 const PageName = "reportRecord";
 
@@ -15,11 +16,27 @@ const hooks: PageHooks = {
   pageModalHook: pageContentRef =>
     usePageModal({
       pageContentRef,
-      confirmCallback: ({ create_timer }) => ({
-        start: dayjs(create_timer[0]).format("YYYY-MM-DD"),
-        end: dayjs(create_timer[1]).format("YYYY-MM-DD"),
-        companyNo: currentCompany.value.companyNo
-      })
+      confirmCallback: ({ create_timer, type }) => {
+        const start = dayjs(create_timer[0]).format("YYYY-MM-DD");
+        const end = dayjs(create_timer[1]).format("YYYY-MM-DD");
+        const delay = 24 * 60 * 60 * 1000;
+        const start_updatetime = new Date(start).valueOf();
+        const end_updatetime = new Date(end).valueOf() + delay;
+        const day = (end_updatetime - start_updatetime) / delay;
+        if (String(type) === "1" && day > 7) {
+          ElMessage.warning("立即执行时,时间区间不能超过7天!");
+          return false;
+        }
+        if (String(type) === "2" && day > 30) {
+          ElMessage.warning("延时执行时,时间区间不能超过30天!");
+          return false;
+        }
+        return {
+          start,
+          end,
+          companyNo: currentCompany.value.companyNo
+        };
+      }
     })
 };
 const download = url => {
@@ -43,7 +60,7 @@ const download = url => {
           type="primary"
           v-if="String(status) === '2'"
           @click="download(down_url)"
-          :icon="useRenderIcon('arrow-down-line')"
+          :icon="useRenderIcon('download-line')"
         />
       </template>
     </PageContainer>