wukai пре 1 недеља
родитељ
комит
91365a510e
1 измењених фајлова са 18 додато и 20 уклоњено
  1. 18 20
      src/views/dye/process/export.vue

+ 18 - 20
src/views/dye/process/export.vue

@@ -7,13 +7,13 @@
         <!-- 时间选择 -->
         <el-col :span="6">
           <div style="display: flex; align-items: center; justify-content: center;">
+            <span style="white-space: nowrap; margin-right: 10px;">时间:</span>
             <el-date-picker clearable
                             v-model="processParams.date"
                             type="date"
                             value-format="YYYY-MM-DD"
                             placeholder="请选择日期"
-                            style="width: 130px"
-                            @change="handleProcessQuery">
+                            style="width: 130px">
             </el-date-picker>
             <el-select v-model="processParams.hour" placeholder="小时" style="width: 80px; margin-left: 5px;">
               <el-option v-for="hour in 24" :key="hour - 1" :label="(hour - 1).toString().padStart(2, '0') + ':00'"
@@ -76,19 +76,16 @@
         <!-- 时间选择 -->
         <el-col :span="6">
           <div style="display: flex; align-items: center; justify-content: center;">
-            <el-date-picker clearable
-                            v-model="electricityParams.date"
-                            type="date"
-                            value-format="YYYY-MM-DD"
-                            placeholder="请选择日期"
-                            style="width: 130px"
-                            @change="handleElectricityQuery">
+            <span style="white-space: nowrap; margin-right: 10px;">时间范围:</span>
+            <el-date-picker
+                v-model="electricityParams.date"
+                type="daterange"
+                value-format="YYYY-MM-DD"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                style="width: 250px">
             </el-date-picker>
-            <el-select v-model="electricityParams.hour" placeholder="小时"
-                       style="width: 80px; margin-left: 5px;">
-              <el-option v-for="hour in 24" :key="hour - 1" :label="(hour - 1).toString().padStart(2, '0') + ':00'"
-                         :value="hour - 1"></el-option>
-            </el-select>
           </div>
         </el-col>
 
@@ -155,8 +152,10 @@ const processParams = reactive({
 });
 
 const electricityParams = reactive({
-  date: new Date(new Date().getTime() - 31 * 60 * 60 * 1000).Format('yyyy-MM-dd'),
-  hour: new Date().getHours(),
+  date: [
+    new Date(new Date().getTime() - 31 * 60 * 60 * 1000).Format('yyyy-MM-dd'),
+    new Date(new Date().getTime() - 31 * 60 * 60 * 1000).Format('yyyy-MM-dd')
+  ],
   types: [],
   lines: []
 });
@@ -190,7 +189,7 @@ function getList() {
 
 // 导出工艺参数
 function exportProcessParams() {
-  proxy.download('dye/process/export', {
+  proxy.download('dye/process/exportProc', {
     date: processParams.date,
     hour: processParams.hour,
     types: processParams.types,
@@ -200,9 +199,8 @@ function exportProcessParams() {
 
 // 导出电量
 function exportElectricity() {
-  proxy.download('dye/electricity/export', {
-    date: electricityParams.date,
-    hour: electricityParams.hour,
+  proxy.download('dye/process/exportPower', {
+    date: electricityParams.date.join(","),
     types: electricityParams.types,
     lines: electricityParams.lines
   }, `前整车间电量_${new Date().getTime()}.xlsx`)