Explorar el Código

历史导出+栏舍

Shan9312 hace 1 año
padre
commit
d1073f2e4e

+ 2 - 3
.env.development

@@ -4,10 +4,9 @@ ENV = 'development'
 # base api
 # 测试线
 # VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
-# VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 白少后台本地
-VUE_APP_BASE_API = 'http://192.168.1.233/'
-
+# VUE_APP_BASE_API = 'http://192.168.1.233/'
 # VUE_APP_BASE_API = 'http://192.168.1.93/'
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

BIN
dist-tmr-20240802-发版本.zip


+ 28 - 6
src/views/formulationPlan/dhedFormula/index.vue

@@ -273,12 +273,13 @@
       <div class="app-history">
         <div class="search">
           <el-date-picker v-model="history.getdataListParm.parammaps.date" type="date" placeholder="请选择历史记录时间" :clearable="false" style="width: 180px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeDate" />
-          <!-- <el-select v-model="history.getdataListParm.parammaps.barid" clearable filterable placeholder="请选择栏舍" style="width: 180px;" class="filter-item">
-            <el-option v-for="item in barList" :key="item.id" :label="item.bname" :value="item.id" />
+          <el-select v-model="history.getdataListParm.parammaps.barName" clearable filterable placeholder="请选择栏舍" style="width: 180px;" class="filter-item">
+            <el-option v-for="item in barList" :key="item.id" :label="item.bname" :value="item.bname" />
           </el-select>
-          <el-input v-model="history.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" />
-          <el-button class="successBorder" @click="handleHistorySearch">查询</el-button> -->
-          <!-- <el-button class="successBorder" @click="handleApplication">应用</el-button> -->
+          <!-- <el-input v-model="history.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" /> -->
+          <el-button class="successBorder" @click="handleHistorySearch">查询</el-button>
+          <el-button class="export" icon="el-icon-upload2"  @click="handleExport(3)">导出</el-button>
+          
         </div>
         <div class="table">
           <u-table
@@ -1146,6 +1147,10 @@ export default {
   },
 
   methods: {
+    handleHistorySearch(){
+      this.table
+      this.getDateList()
+    },
     getButtons() {
       const Edit = 'DhedFormula'
       const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
@@ -3182,7 +3187,22 @@ export default {
           ]
           json2excel(excelDatas, '栏舍配方导入模板', true, 'xlsx')
         })
-      } else {
+      } else if (item == 3){
+        GetDataByName(this.history.getdataDateParm).then(response => {
+        console.log('历史数据', this.history.list)
+        if (response.data.list !== null) {
+          var excelDatas = [
+              {
+                tHeader: ['栏舍名称','班次', '软件牛头数', '实际牛头数', '系数(%)', '系数头数', '配方模板', '班次比例', '班次重量',  '配方重量', '配方干物质', '饲喂干物质量','采样干物质量','日投喂量'],
+                filterVal: ['barname', 'times','softccount', 'ccount', 'ratio', 'ccountratio', 'ptname', 'tratio', 'weight', 'pweight', 'dryweight', 'swdryw', 'cydryw','sumweight'],
+                tableDatas: this.history.list,
+                sheetName: 'Sheet1'
+              }
+            ]
+          json2excel(excelDatas, '历史记录栏舍配方', true, 'xlsx')
+        } 
+      })
+      }else {
         console.log('点击了导出数据')
         this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
         GetDataByName(this.download.getdataListParm).then(response => {
@@ -3293,6 +3313,8 @@ export default {
           json2excel(excelDatas, '栏舍配方', true, 'xlsx')
         })
       }
+
+      
     },
 
     beforeImport(file) {

+ 13 - 13
vue.config.js

@@ -1,6 +1,6 @@
 'use strict'
 const path = require('path')
-const defaultSettings = require('./src/settings.js')
+const defaultSettings = require('./src/settings.js')
 // const TerserPlugin = require('terser-webpack-plugin')
 
 function resolve(dir) {
@@ -47,18 +47,18 @@ module.exports = {
     },
     after: require('./mock/mock-server.js')
   },
-
-  configureWebpack: {
-    // provide the app's title in webpack's name field, so that
-    // it can be accessed in index.html to inject the correct title.
-
-    devtool: 'source-map',
-    name: name,
-    resolve: {
-      alias: {
-        '@': resolve('src')
-      }
-    }
+
+  configureWebpack: {
+    // provide the app's title in webpack's name field, so that
+    // it can be accessed in index.html to inject the correct title.
+
+    devtool: 'source-map',
+    name: name,
+    resolve: {
+      alias: {
+        '@': resolve('src')
+      }
+    }
   },
   chainWebpack(config) {
     config.plugins.delete('preload') // TODO: need test