Browse Source

临时添加奶源&区域

Shan9312 9 months ago
parent
commit
693c96e0a5
3 changed files with 46 additions and 26 deletions
  1. 18 24
      src/layout/components/Sidebar/SidebarItem.vue
  2. 26 0
      src/views/asset/basics/index.vue
  3. 2 2
      vue.config.js

+ 18 - 24
src/layout/components/Sidebar/SidebarItem.vue

@@ -2,7 +2,7 @@
   <div v-if="!item.hidden" class="menu-wrapper">
     <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"      @click="acconut(onlyOneChild)">
+        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}" @click="acconut(onlyOneChild)">
           <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
         </el-menu-item>
       </app-link>
@@ -20,7 +20,6 @@
           :item="child"
           :base-path="resolvePath(child.path)"
           class="nest-menu"
-     
         />
       </template>
 
@@ -35,9 +34,8 @@ import Item from './Item'
 import AppLink from './Link'
 import FixiOSBug from './FixiOSBug'
 
-
 import { GetDataByName, GetDataByNames, PostDataByName } from '@/api/common'
- 
+
 export default {
   name: 'SidebarItem',
   components: { Item, AppLink },
@@ -59,40 +57,36 @@ export default {
   },
   data() {
     // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
-    // TODO: refactor with render function
+    // refactor with render function
     this.onlyOneChild = null
     return {}
   },
   methods: {
-    //统计点击量
-    acconut(e){
-      console.log("统计点击量")
+    // 统计点击量
+    acconut(e) {
+      console.log('统计点击量')
       var numId = e.id
-       
+
       console.log(numId)
 
-      var send_data =   {
+      var send_data = {
         name: 'addMenuClick',
         page: 1,
         offset: 1,
         pagecount: 10,
         returntype: 'Map',
-        parammaps: {menuId:numId}
-      } 
-
-
-         PostDataByName(send_data).then(response => {
-          
-            if (response.msg !== 'fail') {
-           
-              //this.$notify({ title: '成功', message: '发送!!', type: 'success', duration: 2000 })
-              // this.reload()
-            } else {
-              // failproccess(response, this.$notify)
-            }
-          })
+        parammaps: { menuId: numId }
+      }
 
+      PostDataByName(send_data).then(response => {
+        if (response.msg !== 'fail') {
 
+          // this.$notify({ title: '成功', message: '发送!!', type: 'success', duration: 2000 })
+          // this.reload()
+        } else {
+          // failproccess(response, this.$notify)
+        }
+      })
     },
     hasOneShowingChild(children = [], parent) {
       const showingChildren = children.filter(item => {

+ 26 - 0
src/views/asset/basics/index.vue

@@ -7,6 +7,14 @@
     <el-tabs v-model="tabName" @tab-click="handleTabClick">
       <el-tab-pane v-if="isBasic" label="设备基础信息" name="first">
         <div class="filter-container">
+          <!-- TODO: -->
+          <el-select v-model="getdataListParm.parammaps.area" placeholder="区域" class="filter-item" style="width: 120px;" @change="changePastureName">
+            <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+          </el-select>
+          <el-select v-model="getdataListParm.parammaps.milk" placeholder="奶源部" class="filter-item" style="width: 120px;" @change="changePastureName">
+            <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+          </el-select>
+
           <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;" @change="changePastureName">
             <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
@@ -79,6 +87,10 @@
                 <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
               </template>
             </el-table-column>
+            <!-- TODO: -->
+            <el-table-column label="区域" align="center" prop="pastureName" />
+            <el-table-column label="奶源部" align="center" prop="eqClassName" />
+
             <el-table-column label="牧场" align="center" prop="pastureName" />
             <el-table-column label="设备类别" align="center" prop="eqClassName" />
             <el-table-column align="center" prop="eqName" width="120">
@@ -156,6 +168,14 @@
       </el-tab-pane>
       <el-tab-pane v-if="isBasicSH" label="审核设备" name="second">
         <div class="filter-container">
+          <!-- TODO: -->
+          <el-select v-model="getdataListParmSH.parammaps.area" placeholder="区域" class="filter-item" style="width: 120px;" @change="changePastureName">
+            <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+          </el-select>
+          <el-select v-model="getdataListParmSH.parammaps.milk" placeholder="奶源部" class="filter-item" style="width: 120px;" @change="changePastureName">
+            <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+          </el-select>
+
           <el-select v-model="getdataListParmSH.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;">
             <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
@@ -196,6 +216,10 @@
                 <span>{{ scope.$index + (pageNumSH-1) * pageSizeSH + 1 }}</span>
               </template>
             </el-table-column>
+            <!-- TODO: -->
+            <el-table-column label="区域" align="center" prop="pastureName" />
+            <el-table-column label="奶源部" align="center" prop="eqClassName" />
+
             <el-table-column label="牧场" align="center" prop="pastureName" />
             <el-table-column label="资产编号" align="center" prop="assetCode" />
             <el-table-column label="设备名称" align="center" prop="eqName" />
@@ -1234,11 +1258,13 @@ export default {
       list: [],
       total: 0,
       listLoading: true,
+      // TODO:
       getdataListParm: {
         name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
         parammaps: { proId: '', brandId: '', assetCode: '', eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
       },
       listSH: [], totalSH: 0, listLoadingSH: true, tabName: '',
+      // TODO:
       getdataListParmSH: {
         name: 'getAssetListSH', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
         parammaps: { eqCode: '', eqName: '', pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', SHStatus: '' }

+ 2 - 2
vue.config.js

@@ -59,8 +59,8 @@ module.exports = {
     }
   },
   chainWebpack(config) {
-    config.plugins.delete('preload') // TODO: need test
-    config.plugins.delete('prefetch') // TODO: need test
+    config.plugins.delete('preload') // need test
+    config.plugins.delete('prefetch') // need test
 
     // set svg-sprite-loader
     config.module