Explorar o código

加入断纱分析导出

wukai hai 2 semanas
pai
achega
da45b5feb3
Modificáronse 1 ficheiros con 41 adicións e 0 borrados
  1. 41 0
      src/views/calc/ds/index.vue

+ 41 - 0
src/views/calc/ds/index.vue

@@ -0,0 +1,41 @@
+<template>
+  <div class="app-container">
+    <el-form ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="日期" prop="daterangeTime">
+        <el-date-picker clearable
+                        v-model="dt"
+                        type="date"
+                        value-format="YYYY-MM-DD"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="'warning" icon="Download" @click="impdata">导出</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+<script setup name="ds">
+import {ref} from "vue";
+
+const {proxy} = getCurrentInstance();
+const dt = ref(null);
+const days = ref(10);
+const showSearch = ref(true);
+
+// 初始化日期
+const initDate = () => {
+  let day = new Date();
+  day.setHours(day.getHours() - 7);
+  day.setDate(day.getDate() - 1);
+  dt.value = new Date(day).Format('yyyy-MM-dd');
+}
+
+function impdata() {
+  let uri = "/api/export/broken-yarn?date=" + dt.value;
+  proxy.download(uri, {}, `断妙分析日报${dt.value}.xlsx`)
+}
+
+// 初始化
+initDate();
+</script>