ソースを参照

1.首页添加筛选条件;2.日执行修改样式,新增顺序调整;3.栏舍配方历史记录新增恢复;4.准确性分析新增筛选条件及车次添加区域;5.饲喂效率修改报表表格及导出

duanxiaoduan 1 年間 前
コミット
8e7d84f619

+ 3 - 3
src/utils/request.js

@@ -14,9 +14,9 @@ if (DoMainString) {
 var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
 var browserUrl = window.location.hostname
 console.log("========url===",reg.test(browserUrl))
-if (reg.test(browserUrl)){
-  URL = window.location.protocol +"//"+ browserUrl + ":8082/"
-}
+// if (reg.test(browserUrl)){
+//   URL = window.location.protocol +"//"+ browserUrl + ":8082/"
+// }
 
 Cookies.set('url',URL)
 console.log(process.env.VUE_APP_BASE_API,'===========URL1111')

+ 8 - 2
src/views/dashboard/pasture/index.vue

@@ -88,7 +88,11 @@
           <div class="title">
             <div class="img-title" />
             <span class="content">今日计划统计</span>
-          </div>
+          </div>
+          <b style="margin-left: 20px;">统计类型:</b>
+          <el-select v-model="row2.value" placeholder="请选择" style="width: 100px;">
+            <el-option v-for="item in row2.typeList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <div class="todayPlan">
             <div>
               <div id="row2chartLine1" style="height: 185px;" />
@@ -446,7 +450,9 @@ export default {
         listLoading: true,
         list: ''
       },
-      row2: {
+      row2: {
+        value:1,
+        typeList:[{id:1,name:'全部'},{id:2,name:'固定式'},{id:3,name:'抛料车'}],
         chart1: {
           chartLine: null,
           chartLine_data: {}

+ 17 - 6
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -911,6 +911,7 @@ export default {
   data() {
     return {
       myheight: document.documentElement.clientHeight - 280,
+      // myheight: 500,
       enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
       isDetail:false,
       newGenerationLoading:false,
@@ -2511,13 +2512,23 @@ export default {
         inputPlaceholder:'请输入您要插入的位置',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-        // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
-        // inputErrorMessage: '邮箱格式不正确'
+        inputPattern: /^\d+$/ ,
+        inputErrorMessage: '请检查插入位置序号是否正确'
       }).then(({ value }) => {
-        this.$message({
-          type: 'success',
-          message: '插入的位置是: ' + value
-        });
+        const url = 'authdata/plan/sort/edit'
+        const data = {
+          planId:row.id,
+          mydate:row.mydate,
+          sort:value
+        }
+        postJson(url, data).then(response => {
+          if (response.msg === 'fail') {
+            this.$notify({ title: '失败', message: response.data, type: 'error', duration: 2000 })
+          } else {
+            this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
+            this.getList()
+          }
+        })
       }).catch(() => {
         this.$message({
           type: 'info',

+ 84 - 0
src/views/formulationPlan/dhedFormula/index.vue

@@ -318,6 +318,11 @@
             <u-table-column :key="15" label="饲喂干物质量" prop="swdryw" min-width="70px" align="center" />
             <u-table-column :key="16" label="采样干物质量" prop="cydryw" min-width="70px" align="center" />
             <u-table-column :key="17" label="日投喂量" prop="sumweight" min-width="70px" align="center" />
+            <u-table-column :key="18" label="操作"  prop="sumweight" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="scope">
+                <span style="color: blue;" @click="handleRestore(scope.row)">恢复</span>
+              </template>
+            </u-table-column>
           </u-table>
           <!-- <pagination2 v-show="history.total>0" :total="history.total" :page.sync="history.getdataListParm.offset" :limit.sync="history.getdataListParm.pagecount" @pagination="getHistoryList" /> -->
         </div>
@@ -3414,6 +3419,85 @@ export default {
       this.getList()
       this.isproportion = false
     },
+    handleRestore(row){
+      // 恢复
+      MessageBox.confirm('是否进行恢复?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+      const dataList = this.history.list
+      const result = dataList.filter(obj => obj.barname === row.barname);
+
+       const barList = []
+       result.forEach((item)=>{
+         let obj = {}
+         obj.barname = item.barname
+         obj.ccount = item.ccount
+         obj.ratio = item.ratio
+         // obj.ftname = item.ftname
+         // obj.ptsfname = item.ptsfname
+         if(item.timesin == '1'){ obj.times1 = item.tratio }else{ obj.times1 = 0 }
+         if(item.timesin == '2'){ obj.times2 = item.tratio }else{ obj.times2 = 0 }
+         if(item.timesin == '3'){ obj.times3 = item.tratio }else{ obj.times3 = 0 }
+         if(item.timesin == '4'){ obj.times4 = item.tratio }else{ obj.times4 = 0 }
+         if(item.timesin == '5'){ obj.times5 = item.tratio }else{ obj.times5 = 0 }
+         if(item.timesin == '6'){ obj.times6 = item.tratio }else{ obj.times6 = 0 }
+         barList.push(obj)
+       })
+
+       // 根据 "barname" 属性进行分组
+       const groupedData = barList.reduce((acc, obj) => {
+           const key = obj.barname;
+           if (!acc[key]) {
+               acc[key] = [obj];
+           } else {
+               acc[key].push(obj);
+           }
+           return acc;
+       }, {});
+
+       // 合并相同 "barname" 值的对象
+       const result1 = {};
+       for (const key in groupedData) {
+           if (Object.hasOwnProperty.call(groupedData, key)) {
+               result1[key] = this.mergeObjects(groupedData[key]);
+           }
+       }
+       let arr1 = []
+       arr1.push(result1[row.barname])
+       console.log(arr1,'arr1')
+       const url = 'authdata/fpdetail/batch/edit'
+       let data = {
+         pastureId:Cookies.get('pastureid'),
+         barList:arr1
+       }
+       postJson(url, data).then(response => {
+         if(response.msg !== 'fail'){
+           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+           this.getDateList()
+         }else{
+           this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+         }
+         this.isproportion = false
+       })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消恢复' })
+      })
+    },
+    mergeObjects(arr) {
+        return arr.reduce((acc, obj) => {
+            for (const key in obj) {
+                if (Object.hasOwnProperty.call(obj, key)) {
+                    if (!acc.hasOwnProperty(key)) {
+                        acc[key] = obj[key];
+                    } else if (!isNaN(parseFloat(obj[key]))) {
+                        acc[key] = parseFloat(acc[key]) + parseFloat(obj[key]);
+                    }
+                }
+            }
+            return acc;
+        }, {});
+    }
+
   }
 }
 </script>

+ 6 - 2
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue

@@ -55,6 +55,8 @@
             <span>-</span>
             <el-input-number :controls="false" :precision="2" v-model="tab.table.getdataListParm.parammaps.slzql2" placeholder="撒料正确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
           </div>
+          <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="配方名称" />
+          <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="混料时间段" />
           <el-checkbox v-model="tab.table.getdataListParm.parammaps.error" style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox>
           <el-button class="successBorder" @click="form_search">查询</el-button>
           <el-button class="successBorder" @click="handleRefresh1">重置</el-button>
@@ -114,6 +116,7 @@
             <u-table-column :key="28" sortable label="混料正确率" min-width="70px" align="center" prop="混料正确率" />
             <u-table-column :key="29" sortable label="去除取消正确率" min-width="60px" align="center" prop="去除取消正确率" />
             <u-table-column :key="30" sortable label="标准差" min-width="60px" align="center" prop="方差" />
+            <u-table-column :key="31" v-if="tab.isTrainNumber" sortable label="区域" min-width="60px" align="center" prop="barname" />
             <u-table-column v-if="activeName=='first' && tab.table.list !== null" :key="31" align="center" width="70" label="操作" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee('1',row)" />
@@ -179,6 +182,7 @@
               <u-table-column :key="27" sortable label="撒料正确率" min-width="70px" align="center" prop="撒料正确率" />
               <u-table-column :key="28" sortable label="去除取消正确率" min-width="65px" align="center" prop="去除取消正确率" />
               <u-table-column :key="29" sortable label="标准差" min-width="60px" align="center" prop="方差" />
+              <u-table-column :key="30" v-if="tab.isTrainNumber" sortable label="区域" min-width="60px" align="center" prop="barname" />
               <u-table-column v-if="activeName=='first' && tab.table2.list !== null" :key="30" align="center" width="70" label="操作" class-name="small-padding fixed-width" fixed="right">
                 <template slot-scope="{row}">
                   <el-button class="miniSuccess" icon="el-icon-search" @click="handleSee('2',row)" />
@@ -3050,7 +3054,7 @@ export default {
       }
       data.parammaps = this.tab.table.getdataListParm.parammaps
       postJson(url, data).then(response => {
-        if (response.data !== null) {
+        if (response.data !== null && response.data.list !== null) {
           console.log('汇总统计/混料table数据', response.data.list)
           this.$refs.plTable1.reloadData(response.data.list)
           this.tab.table.list = response.data.list
@@ -3095,7 +3099,7 @@ export default {
       }
       data.parammaps = this.tab.table2.getdataListParm.parammaps
       postJson(url, data).then(response => {
-        if (response.data !== null) {
+        if (response.data !== null && response.data.list !== null) {
           console.log('汇总统计/撒料table数据', response.data.list)
           this.$refs.plTable22.reloadData(response.data.list)
           this.tab.table2.list = response.data.list

+ 2 - 2
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -271,7 +271,7 @@
                   >
                     <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
                     <el-table-column sortable label="配方名称" min-width="110px" align="center" prop="名称" />
-                    <el-table-column sortable label="准确率" min-width="110px" align="center" prop="准确率" />
+                    <el-table-column sortable label="时间(分钟)" min-width="110px" align="center" prop="准确率" />
                   </el-table>
                 </div>
               </div>
@@ -2659,7 +2659,7 @@ export default {
         console.log('混料时间统计导出')
         var excelDatasTabChart3 = [
           {
-            tHeader: ['日期', '配方名称','准确率'],
+            tHeader: ['日期', '配方名称','时间(分钟)'],
             filterVal: ['日期', '名称','准确率'],
             tableDatas: this.tab.chart3.table.list,
             sheetName: '混料时间统计'