snow 1 vuosi sitten
vanhempi
commit
54112b0c11

+ 4 - 4
src/App.vue

@@ -21,12 +21,12 @@ export default defineComponent({
 </script>
 </script>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
-import { ref, onMounted } from "vue";
-import { loadEnv } from "@build/index";
-import * as dd from "dingtalk-jsapi";
-import { JudgeEnvironment } from "/@/utils/validate";
 import { useUserStoreHook } from "/@/store/modules/user";
 import { useUserStoreHook } from "/@/store/modules/user";
+import { JudgeEnvironment } from "/@/utils/validate";
 import { storageSession } from "@pureadmin/utils";
 import { storageSession } from "@pureadmin/utils";
+import { loadEnv } from "@build/index";
+import { ref, onMounted } from "vue";
+import * as dd from "dingtalk-jsapi";
 // import { getToken, removeToken } from "/@/utils/auth";
 // import { getToken, removeToken } from "/@/utils/auth";
 // if (getToken() ?? "") {
 // if (getToken() ?? "") {
 //   removeToken();
 //   removeToken();

+ 5 - 12
src/views/template/publicTemplate/components/template-modal.vue

@@ -46,11 +46,6 @@ const loading = ref(false);
 const formRef = ref<InstanceType<typeof ElForm> | null>(null)
 const formRef = ref<InstanceType<typeof ElForm> | null>(null)
 const formData = ref({ ...initialData });
 const formData = ref({ ...initialData });
 
 
-const requestUsers = async () => {
-  const uResult = await httpUser({ size: 10000, depart_id: formData.value.depart_id });
-  if (uResult.code === 1) users.value = uResult.data.list;
-}
-
 function handleTemplateChange(value) {
 function handleTemplateChange(value) {
   const item = wechatTemplate.value.find(({ template_id }) => template_id === value)
   const item = wechatTemplate.value.find(({ template_id }) => template_id === value)
   formData.value.template_name = item!.title;
   formData.value.template_name = item!.title;
@@ -78,12 +73,10 @@ onMounted(async () => {
   const wtResult = await httpWechatTemplate({});
   const wtResult = await httpWechatTemplate({});
   const dResult = await httpDepart({ size: 10000 })
   const dResult = await httpDepart({ size: 10000 })
   const uResult = await httpUser({ size: 10000, depart_id: formData.value.depart_id,is_wx: 1 });
   const uResult = await httpUser({ size: 10000, depart_id: formData.value.depart_id,is_wx: 1 });
-  if (uResult.code === 1) users.value = uResult.data.list;
-  if (wtResult.code === 1) wechatTemplate.value = wtResult.data;
-  if (dResult.code === 1) departs.value = [
-    {id:0, name:'全部部门'},
-    ...dResult.data
-  ];
+
+  if(uResult.code === 1) users.value = uResult.data.list;
+  if(wtResult.code === 1) wechatTemplate.value = wtResult.data;
+  if(dResult.code === 1) departs.value = [ {id:0, name:'全部部门'}, ...dResult.data];
 })
 })
 
 
 
 
@@ -125,7 +118,7 @@ defineExpose({
 
 
       <el-form-item label="推送时间:" v-model="formData.push_type" prop="push_type">
       <el-form-item label="推送时间:" v-model="formData.push_type" prop="push_type">
         <el-select style="width:100%" placeholder="推送类型" v-model="formData.push_type">
         <el-select style="width:100%" placeholder="推送类型" v-model="formData.push_type">
-          <el-option v-for="type in pushTypes" :key="type.value" :label="type.label" :value="type.value"  />
+          <el-option v-for="type in pushTypes" :key="type.value" :label="type.label" :value="type.value"></el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
 
 

+ 13 - 6
src/views/template/publicTemplate/index.vue

@@ -8,11 +8,9 @@ import contentConfig from "./config/content.config";
 const instance = ref(null);
 const instance = ref(null);
 const templateModalRef = ref<InstanceType<typeof TemplateModal> | null>(null)
 const templateModalRef = ref<InstanceType<typeof TemplateModal> | null>(null)
 
 
-const PageName = "publicTemplate";
+const PageName = "publishTemplate";
 
 
-const hooks: PageHooks = {
-  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
-};
+const hooks: PageHooks = { pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig) };
 
 
 const events: PageEvents = {
 const events: PageEvents = {
   content: {
   content: {
@@ -24,7 +22,16 @@ const events: PageEvents = {
 
 
 <template>
 <template>
   <PageAuth :pageName="PageName">
   <PageAuth :pageName="PageName">
-    <PageContainer  :get-content-ref="ref => (instance = ref)" :events="events" :hooks="hooks" :content-config="contentConfig" :search-config="searchConfig" />
-    <TemplateModal ref="templateModalRef" @refresh="instance.onSearch()" />
+    <PageContainer  
+      :get-content-ref="ref => (instance = ref)" 
+      :events="events" 
+      :hooks="hooks" 
+      :content-config="contentConfig" 
+      :search-config="searchConfig" 
+      />
+    <TemplateModal
+      ref="templateModalRef" 
+      @refresh="instance.onSearch()" 
+     />
   </PageAuth>
   </PageAuth>
 </template>
 </template>

+ 4 - 4
src/views/template/publish/index.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import contentConfig from "./config/content.config";
 import contentConfig from "./config/content.config";
 import searchConfig from "./config/search.config"
 import searchConfig from "./config/search.config"
-import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
 const PageName = "publish";
 const PageName = "publish";
 
 
 const hooks: PageHooks = {
 const hooks: PageHooks = {
@@ -10,9 +10,9 @@ const hooks: PageHooks = {
 </script>
 </script>
 
 
 <template>
 <template>
-  <PageAuth :pageName="PageName">
-    <PageContainer 
-      :hooks="hooks" 
+  <PageAuth pageName="PageName">
+    <PageContainer
+      :hooks="hooks"
       :searchConfig="searchConfig" 
       :searchConfig="searchConfig" 
       :content-config="contentConfig" 
       :content-config="contentConfig" 
       />
       />

+ 65 - 0
src/views/time/frontOrder/components/all.vue

@@ -0,0 +1,65 @@
+<script setup lang="ts">
+import { shallowRef, ref } from "vue";
+import searchConfig from "./config/search.config";
+import contentConfig from "./config/content.config";
+
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { PageContentInstance } from "/@/components/PageContent";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
+
+import { httpRequsetExport } from "/@/utils/export";
+import { isBeyondTime } from "../../_utils/isBeyondTime";
+
+const loading = shallowRef(false);
+const pageContentRef = ref<PageContentInstance | null>(null);
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+
+const callback = {
+  onStart: () => (loading.value = true),
+  onSuccess: () => (loading.value = false),
+  onFail: () => (loading.value = false)
+};
+
+async function handleExportAllReport() {
+  const params = pageContentRef.value.getBasicParams() || {};
+  const { start_date, end_date } = params;
+  const beyondTime = isBeyondTime({
+    start: start_date,
+    end: end_date,
+    len: 10
+  });
+
+  if (beyondTime) return;
+
+  await httpRequsetExport({
+    fileType: "aplication/zip",
+    name: "订单报表.zip",
+    url: "saleexport",
+    isPurchase: true,
+    ...callback,
+    params
+  });
+}
+</script>
+
+<template>
+  <PageContainer
+    :hooks="hooks"
+    :getContentRef="ref => (pageContentRef = ref)"
+    :content-config="contentConfig"
+    :search-config="searchConfig"
+  >
+    <template #content_header>
+      <el-button
+        @click="handleExportAllReport"
+        size="small"
+        :icon="useRenderIcon('arrow-up-line')"
+        type="primary"
+        >导出</el-button
+      >
+    </template>
+  </PageContainer>
+</template>

+ 88 - 0
src/views/time/frontOrder/components/business.vue

@@ -0,0 +1,88 @@
+<script setup lang="ts">
+import { shallowRef, ref } from "vue";
+import { ElMessage } from "element-plus";
+
+import sourceSearchConfig from "./config/search.config";
+import sourceContentConfig from "./config/content.config";
+
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { PageContentInstance } from "/@/components/PageContent";
+
+import { useBusinessSearch, useBusinessContent } from "./../../_hooks";
+import { httpRequsetExport } from "/@/utils/export";
+import { createHttpRequest } from "./../../_http";
+import { isBeyondTime } from "./../../_utils";
+
+
+const lockKey = "relaComNo";
+const loading = shallowRef(false);
+const pageContentRef = ref<PageContentInstance | null>(null);
+
+const { searchConfig } = useBusinessSearch({
+  sourceConfig: sourceSearchConfig
+});
+
+const { contentConfig } = useBusinessContent({
+  sourceConfig: sourceContentConfig,
+  apis: { httpList: createHttpRequest("r_saleexportlist") }
+});
+
+const hooks: PageHooks = {
+  pageSearchHook: () =>
+    usePageSearch(undefined, undefined, searchConfig, false, lockKey)
+};
+
+const callback = {
+  onSuccess: () => (loading.value = false),
+  onStart: () => (loading.value = true),
+  onFail: () => (loading.value = false)
+};
+
+async function handleExportAllReport() {
+  const params = pageContentRef.value.getBasicParams() || {};
+  const { start_date, end_date } = params;
+
+  if (!params[lockKey]) {
+    ElMessage.warning("请选择业务公司");
+    return;
+  }
+
+  const beyondTime = isBeyondTime({
+    start: start_date,
+    end: end_date,
+    len: 10
+  });
+
+  if (beyondTime) return;
+
+  await httpRequsetExport({
+    fileType: "aplication/zip",
+    url: "r_saleexport",
+    name: "订单报表.zip",
+    isPurchase: true,
+    ...callback,
+    params
+  });
+}
+</script>
+
+<template>
+  <PageContainer
+    :hooks="hooks"
+    :getContentRef="ref => (pageContentRef = ref)"
+    :content-config="contentConfig"
+    :search-config="searchConfig"
+    lockKey="relaComNo"
+  >
+    <template #content_header>
+      <el-button
+        @click="handleExportAllReport"
+        size="small"
+        :icon="useRenderIcon('arrow-up-line')"
+        type="primary"
+        >导出</el-button
+      >
+    </template>
+  </PageContainer>
+</template>

+ 89 - 0
src/views/time/frontOrder/components/config/content.config.ts

@@ -0,0 +1,89 @@
+import { createHttpRequest } from "../../../_http";
+import { ContentConfig } from "/@/components/PageContent";
+
+const columns = [
+  {
+    prop: "apply_name",
+    label: "创建人",
+    minWidth: "155px"
+  },
+  {
+    prop: "creater_company",
+    label: "创建人部门",
+    minWidth: "155px"
+  },
+  {
+    prop: "addtime",
+    label: "下单时间",
+    minWidth: "155px"
+  },
+
+  {
+    prop: "orderCode",
+    label: "订单号",
+    minWidth: "155px"
+  },
+  {
+    prop: "first_customer_org",
+    label: "一级企业",
+    minWidth: "155px"
+  },
+  {
+    prop: "second_customer_org",
+    label: "二级企业",
+    minWidth: "155px"
+  },
+  {
+    prop: "companyName",
+    label: "客户名称",
+    minWidth: "155px"
+  },
+  {
+    prop: "good_name",
+    label: "产品名称",
+    minWidth: "155px"
+  },
+  {
+    prop: "good_num",
+    label: "产品数量",
+    minWidth: "155px"
+  },
+  {
+    prop: "unit",
+    label: "单位",
+    minWidth: "155px"
+  },
+  {
+    prop: "sale_price",
+    minWidth: "155px",
+    label: "单价"
+  },
+  {
+    prop: "total_price",
+    minWidth: "155px",
+    label: "金额"
+  },
+
+  {
+    prop: "is_stock",
+    label: "是否库存",
+    minWidth: "155px"
+  },
+  {
+    prop: "order_type",
+    label: "订单来源",
+    minWidth: "155px"
+  }
+];
+
+const contentConfig: ContentConfig = {
+  notPagination: true,
+  superUserNoAction: false,
+  notNeedCompanyFilter: true,
+  columns,
+  apis: {
+    httpList: createHttpRequest("saleexportlist")
+  }
+};
+
+export default contentConfig;

+ 31 - 0
src/views/time/frontOrder/components/config/search.config.ts

@@ -0,0 +1,31 @@
+import { FormConfig } from "/@/components/PageSearch";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "date",
+      type: "date_picker",
+      trigger: "change",
+      otherOptions: {
+        type: "daterange",
+        startPlaceholder: "下单开始时间",
+        endPlaceholder: "下单结束时间",
+        valueFormat: "YYYY-MM-DD",
+        startProp: "start_date",
+        endProp: "end_date"
+      }
+    },
+    {
+      field: 'depart_id',
+      type: 'depart-query',
+      trigger: 'change'
+    },
+    {
+      field: 'plat_type',
+      type: 'plat-switch',
+      trigger: 'change'
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 31 - 0
src/views/time/frontOrder/index.vue

@@ -0,0 +1,31 @@
+<script setup lang="ts">
+import { shallowRef } from "vue";
+import All from "./components/all.vue";
+import Business from "./components/business.vue";
+const actived = shallowRef("1");
+</script>
+
+<template>
+  <div class="report-container">
+    <el-tabs v-model="actived" style="color: #fff">
+      <el-tab-pane label="查看全部" name="1">
+        <all v-if="actived === '1'" />
+      </el-tab-pane>
+
+      <el-tab-pane label="查看业务公司" name="2">
+        <business v-if="actived === '2'" />
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<style scoped lang="scss">
+.report-container {
+  height: calc(100vh - 48px);
+  :deep(.el-tabs__header) {
+    background-color: #fff;
+    padding: 10px;
+    padding-bottom: 0px;
+  }
+}
+</style>

+ 0 - 0
src/views/time/frontOrder/前端报表-订单报表