Browse Source

1.0版本的页面

epans 1 year ago
parent
commit
9cf24512fa

+ 2 - 2
src/api/common.js

@@ -40,9 +40,9 @@ export function ajaxDataDelete(url,data) {
  
  
 export function checkButtons(buttonsList, buttonName) {
-  // console.log(PermissionButtons)
+   console.log(buttonsList)
   for (let i = 0; i < buttonsList.length; i++) {
-    if (buttonsList[i].menuName === buttonName ) {  
+    if (buttonsList[i].menu_name === buttonName ) {  
       return true
     }
   }

+ 385 - 0
src/utils/md5.js

@@ -0,0 +1,385 @@
+/*
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
+ * Digest Algorithm, as defined in RFC 1321.
+ * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for more info.
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0;   /* hex output format. 0 - lowercase; 1 - uppercase        */
+var b64pad  = "";  /* base-64 pad character. "=" for strict RFC compliance   */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_md5(s)    { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
+function b64_md5(s)    { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
+function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
+function hex_hmac_md5(k, d)
+  { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
+function b64_hmac_md5(k, d)
+  { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
+function any_hmac_md5(k, d, e)
+  { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function md5_vm_test()
+{
+  return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
+}
+
+/*
+ * Calculate the MD5 of a raw string
+ */
+function rstr_md5(s)
+{
+  return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
+}
+
+/*
+ * Calculate the HMAC-MD5, of a key and some data (raw strings)
+ */
+function rstr_hmac_md5(key, data)
+{
+  var bkey = rstr2binl(key);
+  if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
+
+  var ipad = Array(16), opad = Array(16);
+  for(var i = 0; i < 16; i++)
+  {
+    ipad[i] = bkey[i] ^ 0x36363636;
+    opad[i] = bkey[i] ^ 0x5C5C5C5C;
+  }
+
+  var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
+  return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
+}
+
+/*
+ * Convert a raw string to a hex string
+ */
+function rstr2hex(input)
+{
+  try { hexcase } catch(e) { hexcase=0; }
+  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+  var output = "";
+  var x;
+  for(var i = 0; i < input.length; i++)
+  {
+    x = input.charCodeAt(i);
+    output += hex_tab.charAt((x >>> 4) & 0x0F)
+           +  hex_tab.charAt( x        & 0x0F);
+  }
+  return output;
+}
+
+/*
+ * Convert a raw string to a base-64 string
+ */
+function rstr2b64(input)
+{
+  try { b64pad } catch(e) { b64pad=''; }
+  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+  var output = "";
+  var len = input.length;
+  for(var i = 0; i < len; i += 3)
+  {
+    var triplet = (input.charCodeAt(i) << 16)
+                | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
+                | (i + 2 < len ? input.charCodeAt(i+2)      : 0);
+    for(var j = 0; j < 4; j++)
+    {
+      if(i * 8 + j * 6 > input.length * 8) output += b64pad;
+      else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
+    }
+  }
+  return output;
+}
+
+/*
+ * Convert a raw string to an arbitrary string encoding
+ */
+function rstr2any(input, encoding)
+{
+  var divisor = encoding.length;
+  var i, j, q, x, quotient;
+
+  /* Convert to an array of 16-bit big-endian values, forming the dividend */
+  var dividend = Array(Math.ceil(input.length / 2));
+  for(i = 0; i < dividend.length; i++)
+  {
+    dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
+  }
+
+  /*
+   * Repeatedly perform a long division. The binary array forms the dividend,
+   * the length of the encoding is the divisor. Once computed, the quotient
+   * forms the dividend for the next step. All remainders are stored for later
+   * use.
+   */
+  var full_length = Math.ceil(input.length * 8 /
+                                    (Math.log(encoding.length) / Math.log(2)));
+  var remainders = Array(full_length);
+  for(j = 0; j < full_length; j++)
+  {
+    quotient = Array();
+    x = 0;
+    for(i = 0; i < dividend.length; i++)
+    {
+      x = (x << 16) + dividend[i];
+      q = Math.floor(x / divisor);
+      x -= q * divisor;
+      if(quotient.length > 0 || q > 0)
+        quotient[quotient.length] = q;
+    }
+    remainders[j] = x;
+    dividend = quotient;
+  }
+
+  /* Convert the remainders to the output string */
+  var output = "";
+  for(i = remainders.length - 1; i >= 0; i--)
+    output += encoding.charAt(remainders[i]);
+
+  return output;
+}
+
+/*
+ * Encode a string as utf-8.
+ * For efficiency, this assumes the input is valid utf-16.
+ */
+function str2rstr_utf8(input)
+{
+  var output = "";
+  var i = -1;
+  var x, y;
+
+  while(++i < input.length)
+  {
+    /* Decode utf-16 surrogate pairs */
+    x = input.charCodeAt(i);
+    y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
+    if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
+    {
+      x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
+      i++;
+    }
+
+    /* Encode output as utf-8 */
+    if(x <= 0x7F)
+      output += String.fromCharCode(x);
+    else if(x <= 0x7FF)
+      output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
+                                    0x80 | ( x         & 0x3F));
+    else if(x <= 0xFFFF)
+      output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
+                                    0x80 | ((x >>> 6 ) & 0x3F),
+                                    0x80 | ( x         & 0x3F));
+    else if(x <= 0x1FFFFF)
+      output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
+                                    0x80 | ((x >>> 12) & 0x3F),
+                                    0x80 | ((x >>> 6 ) & 0x3F),
+                                    0x80 | ( x         & 0x3F));
+  }
+  return output;
+}
+
+/*
+ * Encode a string as utf-16
+ */
+function str2rstr_utf16le(input)
+{
+  var output = "";
+  for(var i = 0; i < input.length; i++)
+    output += String.fromCharCode( input.charCodeAt(i)        & 0xFF,
+                                  (input.charCodeAt(i) >>> 8) & 0xFF);
+  return output;
+}
+
+function str2rstr_utf16be(input)
+{
+  var output = "";
+  for(var i = 0; i < input.length; i++)
+    output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
+                                   input.charCodeAt(i)        & 0xFF);
+  return output;
+}
+
+/*
+ * Convert a raw string to an array of little-endian words
+ * Characters >255 have their high-byte silently ignored.
+ */
+function rstr2binl(input)
+{
+  var output = Array(input.length >> 2);
+  for(var i = 0; i < output.length; i++)
+    output[i] = 0;
+  for(var i = 0; i < input.length * 8; i += 8)
+    output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
+  return output;
+}
+
+/*
+ * Convert an array of little-endian words to a string
+ */
+function binl2rstr(input)
+{
+  var output = "";
+  for(var i = 0; i < input.length * 32; i += 8)
+    output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
+  return output;
+}
+
+/*
+ * Calculate the MD5 of an array of little-endian words, and a bit length.
+ */
+function binl_md5(x, len)
+{
+  /* append padding */
+  x[len >> 5] |= 0x80 << ((len) % 32);
+  x[(((len + 64) >>> 9) << 4) + 14] = len;
+
+  var a =  1732584193;
+  var b = -271733879;
+  var c = -1732584194;
+  var d =  271733878;
+
+  for(var i = 0; i < x.length; i += 16)
+  {
+    var olda = a;
+    var oldb = b;
+    var oldc = c;
+    var oldd = d;
+
+    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
+    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
+    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
+    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
+    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
+    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);
+
+    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
+    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
+    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
+    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
+    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
+    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+
+    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
+    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
+    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
+    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
+    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
+    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+
+    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
+    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
+    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
+    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
+    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
+    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+
+    a = safe_add(a, olda);
+    b = safe_add(b, oldb);
+    c = safe_add(c, oldc);
+    d = safe_add(d, oldd);
+  }
+  return Array(a, b, c, d);
+}
+
+/*
+ * These functions implement the four basic operations the algorithm uses.
+ */
+function md5_cmn(q, a, b, x, s, t)
+{
+  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
+}
+function md5_ff(a, b, c, d, x, s, t)
+{
+  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+}
+function md5_gg(a, b, c, d, x, s, t)
+{
+  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+}
+function md5_hh(a, b, c, d, x, s, t)
+{
+  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+}
+function md5_ii(a, b, c, d, x, s, t)
+{
+  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+  return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function bit_rol(num, cnt)
+{
+  return (num << cnt) | (num >>> (32 - cnt));
+}
+
+module.exports = {
+	md5: function(str){
+		return hex_md5(str);
+	}
+}

+ 15 - 0
src/views/Home.vue

@@ -156,6 +156,19 @@ export default {
     }
   },
   created(){
+
+
+    //处理Store刷新后消失的问题
+     // 在页面加载时读取sessionStorage
+     if (sessionStorage.getItem('store')) {
+        this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('store'))))
+      }
+      // 在页面刷新时将store保存到sessionStorage里
+      window.addEventListener('beforeunload', () => {
+        sessionStorage.setItem('store', JSON.stringify(this.$store.state))
+      })
+
+      
      this.getMenuList()
      this.activePath = window.sessionStorage.getItem('activePath')
   },
@@ -210,8 +223,10 @@ export default {
           if(e.code == 200 ){
             
             me.menuList = e.data.menu_list
+            me.$store.state.buttonsList  = e.data.menu_buttons_path
           } else {
             me.menuList = []
+            me.$store.state.buttonsList  = []
             
           }
 

+ 20 - 3
src/views/Login.vue

@@ -68,13 +68,16 @@
 
 <script>
 import { GetDataByName, PostDataByName, ajaxData } from '@/api/common'
+import {md5} from '@/utils/md5'
+
+
 
 export default {
   data() {
     return {
       loginForm:{
-        user_name:"10011",
-        password:"e10adc3949ba59abbe56e057f20f883e" 
+        user_name:"admin",
+        password:"123456" 
  
       },
       //表单验证规则
@@ -93,6 +96,11 @@ export default {
       rememberPassword: ''
     }
   },
+
+
+  created(){
+     
+  },
   methods:{
     showPwd() {
       if (this.passwordType === 'password') {
@@ -120,7 +128,16 @@ export default {
         //.post是请求方式 也可以是Get
         //这里 /test是后端的接口地址
         //loginForm请求发的参数
-        this.$http.post("/login",this.loginForm ,{ headers:{  } }).then(function(res){
+
+
+       
+
+
+        var send_data = {
+          user_name:me.loginForm.user_name,
+          password: md5(me.loginForm.password) 
+        }
+        this.$http.post("/login",send_data ,{ headers:{  } }).then(function(res){
           //打印请求成功结果
           console.log('res',res)
           console.log('res.data',res.data) 

+ 6 - 4
src/views/basicSettings/CalfType.vue

@@ -9,7 +9,7 @@
           <el-input v-model="searchData.name" placeholder="犊牛类型"  style="width: 220px;" class="g-mr20" clearable />
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary"   v-if="isButtonEdit" @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -42,9 +42,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -164,7 +164,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
      //获取下拉框

+ 17 - 10
src/views/basicSettings/DefaultPara.vue

@@ -68,8 +68,8 @@
 
         <el-row>
           <el-col :span="12">
-            <el-button type="warning" @click="reset_save()">恢复默认</el-button>
-            <el-button type="primary" @click="add_dialog_save()">保存</el-button>
+            <el-button type="warning" v-if="isButtonEdit"  @click="reset_save()">恢复默认</el-button>
+            <el-button type="primary" v-if="isButtonEdit"  @click="add_dialog_save()">保存</el-button>
           </el-col>
         </el-row>
 
@@ -191,7 +191,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "默认标准参数编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
      //获取下拉框
@@ -206,12 +208,6 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
     
     //获取 下拉框
     get_select_list1(){
@@ -376,7 +372,18 @@ export default {
 
 
     reset_save(){
-
+      var me = this
+      ajaxDataPost('/api/v1/ops/base_setting/default_params/reset', {}).then(e => {
+                console.log("新增结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '恢复成功!'  , duration: 2000 })
+         
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '恢复失败!' + e.msg, duration: 2000 })
+                }
+            })
     },
     
 

+ 7 - 10
src/views/basicSettings/FeedCarManagement.vue

@@ -14,7 +14,7 @@
 
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary" v-if="isButtonEdit"   @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -57,9 +57,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" v-if="isButtonEdit"  size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -282,7 +282,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "饲喂车管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
 
 
      //获取下拉框
@@ -297,12 +299,7 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+   
 
     //获取 下拉框
     get_select_list1(){

+ 5 - 8
src/views/basicSettings/FeedCost.vue

@@ -43,7 +43,7 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" size="mini" v-if="isButtonEdit"  icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -227,7 +227,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "饲料成本设置编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
      //获取下拉框
@@ -242,12 +244,7 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+    
     
     //获取 下拉框
     get_select_list1(){

+ 8 - 11
src/views/basicSettings/FeedTemplate.vue

@@ -51,9 +51,9 @@
               <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
                 <template slot-scope="scope">
                   <!-- 修改按钮 -->
-                  <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit1(scope.row)">修改</el-button>
+                  <el-button type="primary"  v-if="isButtonEdit"  size="mini" icon="el-icon-edit" @click="form_edit1(scope.row)">修改</el-button>
                   <!-- 删除按钮 -->
-                  <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete1(scope.row)">删除</el-button>
+                  <el-button type="danger"  v-if="isButtonEdit"  size="mini" icon="el-icon-delete" @click="form_delete1(scope.row)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -101,9 +101,9 @@
               <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
                 <template slot-scope="scope">
                   <!-- 修改按钮 -->
-                  <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit2(scope.row)">修改</el-button>
+                  <el-button type="primary"  v-if="isButtonEdit"  size="mini" icon="el-icon-edit" @click="form_edit2(scope.row)">修改</el-button>
                   <!-- 删除按钮 -->
-                  <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete2(scope.row)">删除</el-button>
+                  <el-button type="danger"  v-if="isButtonEdit"  size="mini" icon="el-icon-delete" @click="form_delete2(scope.row)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -294,7 +294,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "预设饲喂模板编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
      //获取下拉框
@@ -309,12 +311,7 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+    
     
     //获取 下拉框
     get_select_list1(){

+ 20 - 15
src/views/cowManagement/CowInfo.vue

@@ -32,7 +32,7 @@
 
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary"  v-if="isButtonEdit" @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -115,9 +115,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" size="mini" icon="el-icon-edit"  v-if="isButtonEdit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger" size="mini" icon="el-icon-delete"  v-if="isButtonEdit"  @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -212,13 +212,13 @@ export default {
       //接口 - 下拉框 列表 栏舍组
       url_get_select2:'/api/v1/ops/barn_group/list?page=1&page_size=1000',
 
-      //按钮权限
-      isButtonEdit:false,
+      
 
       //获取 - 表格数据 - 参数
       searchData:{
         calf_code: "",
         barn_name: "",
+        barn_id:undefined,
         mother_code: "",
         calf_category_id:undefined,
         genders: undefined,
@@ -299,6 +299,8 @@ export default {
    
 
       },
+      //按钮权限
+      isButtonEdit:false,
 
      
        
@@ -306,27 +308,26 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "牛只信息编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
-     //获取下拉框
-     this.get_select_list1()
+      //获取下拉框
+      this.get_select_list1()
 
       //表格 - 初始化 
       this.get_table_data()
 
+
+ 
      
 
     
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+  
     
     //获取 下拉框
     get_select_list1(){
@@ -434,7 +435,11 @@ export default {
       me.searchData.max_daily_weight_gain = undefined
       me.searchData.min_daily_age = undefined
       me.searchData.max_daily_age = undefined
- 
+
+      me.searchData.page = 1
+      me.searchData.page_size = 10
+
+     
 
 
       me.get_table_data()

+ 50 - 21
src/views/cowManagement/EventRecord.vue

@@ -19,7 +19,7 @@
 
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary"  v-if="isButtonEdit"  @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -92,9 +92,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -138,16 +138,16 @@
             </el-row>
             <!-- 饲喂 -->
             <el-row   v-if="addForm.event_kind == 2">
-               <el-form-item label="一班进食量:" prop="first_class_food_number">
+                <el-form-item label="一班进食量:" prop="first_class_food_number"  >
                   <el-input ref="first_class_food_number" v-model="addForm.first_class_food_number"   />
                 </el-form-item> 
-                <el-form-item label="二班进食量:" prop="second_class_food_number">
+                <el-form-item label="二班进食量:" prop="second_class_food_number" v-if="class_num == 2 || class_num == 3 || class_num == 4">
                   <el-input ref="second_class_food_number" v-model="addForm.second_class_food_number"   />
                 </el-form-item> 
-                <el-form-item label="三班进食量:" prop="third_class_food_number">
+                <el-form-item label="三班进食量:" prop="third_class_food_number" v-if="class_num == 3 || class_num == 4 ">
                   <el-input ref="third_class_food_number" v-model="addForm.third_class_food_number"  />
                 </el-form-item> 
-                <el-form-item label="四班进食量:" prop="fourth_class_food_number">
+                <el-form-item label="四班进食量:" prop="fourth_class_food_number" v-if="class_num == 4">
                   <el-input ref="fourth_class_food_number" v-model="addForm.fourth_class_food_number"  />
                 </el-form-item> 
             </el-row>
@@ -261,8 +261,11 @@ export default {
 
       //获取 - 表格数据 - 参数
       searchData:{
-        name: "",
+        operation_user: "",
         inputDatetime1:"",
+        min_operation_time:"",
+        min_operation_time:"",
+        source:undefined,
         page: 1,  //页码
         page_size: 10,   //每页数量
         total:0,  //总页数
@@ -367,6 +370,7 @@ export default {
         // {id: "栏舍组2", name: "栏舍组2"}, 
         // {id: "栏舍组3", name: "栏舍组3"}
       ], 
+      class_num:4,
 
      
        
@@ -374,14 +378,22 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
-     
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "事件记录编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
 
      //获取下拉框
       this.get_select_list1()
 
-      //表格 - 初始化 
-      this.get_table_data()
+   var me = this
+
+       //表格 - 初始化 
+      setTimeout(function () {
+        me.get_table_data()
+			}, 1000);
+
+     
+      
 
      
 
@@ -389,18 +401,13 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+ 
     
     //获取 下拉框
     get_select_list1(){
         var me = this
 
-        ajaxDataPost('http://192.168.1.70:8087/api/v1/ops/calf/list?page=1&page_size=10000', {}).then(e => {
+        ajaxDataPost('/api/v1/ops/calf/list?page=1&page_size=10000', {}).then(e => {
           console.log("牛只下拉框:",e)
 
           if(e.code == 200 ){
@@ -415,7 +422,7 @@ export default {
 
   
 
-        ajaxDataPost('http://192.168.1.70:8087/api/v1/ops/barn/list?page=1&page_size=1000', {}).then(e => {
+        ajaxDataPost('/api/v1/ops/barn/list?page=1&page_size=1000', {}).then(e => {
           console.log("栏舍下拉框:",e)
 
           if(e.code == 200 ){
@@ -426,6 +433,19 @@ export default {
           }
         })
 
+
+      // 班次数量下拉框
+      ajaxDataGet('/api/v1/ops/calf_feed/enum/list').then(e => {
+        console.log(e)
+        if(e.code === 200){
+          var class_num = e.data.class_list.length
+        } else {
+          var class_num = 4
+        }
+        console.log("class_num========",class_num)
+        me.class_num = class_num
+      })
+
  
 
     
@@ -482,7 +502,16 @@ export default {
     //重置 表格
     form_clear(){
       var me = this
-      me.searchData.name = ""
+      me.searchData.operation_user = ""
+      me.searchData.inputDatetime1 = ""
+      me.searchData.min_operation_time = ""
+      me.searchData.min_operation_time = ""
+      me.searchData.source = undefined
+      me.searchData.page = 1
+      me.searchData.page_size = 10
+
+    
+
       me.get_table_data()
     },
 

+ 18 - 12
src/views/cowShedManagement/CowCowShed.vue

@@ -11,12 +11,12 @@
           <el-select v-model="searchData.status" filterable placeholder="栏舍状态" class="g-mr20" style="width: 180px;" clearable>
             <el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id" />
           </el-select>
-          <el-select v-model="searchData.barn_group_id" filterable placeholder="犊牛状态" class="g-mr20" style="width: 180px;" clearable>
+          <!-- <el-select v-model="searchData.barn_group_id" filterable placeholder="犊牛状态" class="g-mr20" style="width: 180px;" clearable>
             <el-option v-for="item in barnGroupList" :key="item.id" :label="item.value" :value="item.id" />
-          </el-select>
+          </el-select> -->
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary"  v-if="isButtonEdit"  @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -58,9 +58,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" v-if="isButtonEdit"  size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger" v-if="isButtonEdit"  size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -137,6 +137,8 @@ export default {
       //获取 - 表格数据 - 参数
       searchData:{
         name: "",
+        barn_group_name: "",
+        status: undefined,
         page: 1,  //页码
         page_size: 10,   //每页数量
         total:0,  //总页数
@@ -196,7 +198,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "牛只栏舍编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
      //获取下拉框
@@ -211,12 +215,7 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+  
     
     //获取 下拉框
     get_select_list1(){
@@ -294,6 +293,13 @@ export default {
     form_clear(){
       var me = this
       me.searchData.name = ""
+      me.searchData.name = ""
+      me.searchData.barn_group_name = undefined
+      me.searchData.page = 1
+      me.searchData.page_size = 10
+
+
+      
       me.get_table_data()
     },
 

+ 7 - 10
src/views/cowShedManagement/CowShedGroup.vue

@@ -9,7 +9,7 @@
           <el-input v-model="searchData.name" placeholder="栏舍组名"  style="width: 220px;" class="g-mr20" clearable />
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary"  v-if="isButtonEdit"   @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -37,9 +37,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" v-if="isButtonEdit"  size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger" v-if="isButtonEdit"  size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -185,7 +185,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "栏舍分组编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
      //获取下拉框
@@ -200,12 +202,7 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+  
     
     //获取 下拉框
     get_select_list1(){

+ 13 - 3
src/views/dataStatistics/FeedProcess.vue

@@ -167,8 +167,7 @@ export default {
  
         page: 1,  //页码
         page_size: 10,   //每页数量
-        total:0,  //总页数
-        pastureId: ""
+        total:0  //总页数
       },
       tableLoading: false,
       //表格内容
@@ -325,7 +324,18 @@ export default {
     //重置 表格
     form_clear(){
       var me = this
-      me.searchData.name = ""
+      me.searchData.date = ""
+      me.searchData.barn_name = ""
+      me.searchData.barn_group_name = ""
+      me.searchData.feed_plan_id = undefined
+      me.searchData.class_number = undefined
+      me.searchData.feed_vehicle_id = undefined
+      me.searchData.min_accurate_ratio = undefined
+      me.searchData.max_accurate_ratio = undefined
+      me.searchData.min_temp = undefined
+      me.searchData.max_temp = undefined
+
+   
       me.get_table_data()
     },
  

+ 15 - 6
src/views/formulaPlan/FeedPlan.vue

@@ -15,7 +15,7 @@
         <el-input v-model="searchData.barn_name" placeholder="饲喂栏舍"  style="width: 180px;" class="g-mr20" clearable />
         <el-button type="primary"   @click="form_search">搜索</el-button>
         <el-button type="primary"   @click="form_clear">重置</el-button>
-        <el-button type="primary"   @click="form_add">添加车次</el-button>
+        <el-button type="primary" v-if="isButtonEdit"  @click="form_add">添加车次</el-button>
          <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
       <!-- 表格 -->
@@ -91,9 +91,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -393,8 +393,13 @@ export default {
     }
   },
   created(){
-      //获取按钮权限
-      // this.get_auto_buttons
+ 
+    //获取按钮权限
+    const isButtonEdit = checkButtons(this.$store.state.buttonsList, "饲喂计划编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+     
+
 
     //获取下拉框
     this.get_select_list1()
@@ -494,7 +499,11 @@ export default {
       me.searchData.formula_name = ""
       me.searchData.barn_name = ""
       me.searchData.barn_group_name = ""
-      me.searchData.status = 
+      me.searchData.status = undefined
+      me.searchData.page = 1
+      me.searchData.page_size = 10
+
+     
       me.get_table_data()
     },
 

+ 41 - 24
src/views/formulaPlan/FormulaTemplate.vue

@@ -21,7 +21,7 @@
 
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary"   v-if="isButtonEdit"  @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -68,9 +68,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button type="primary"  v-if="isButtonEdit"  size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button type="danger"  v-if="isButtonEdit"  size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -149,22 +149,22 @@
                   <span>{{ scope.row.daily_feed_number }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="第一班占比(%)" min-width="150px" align="center">
+              <el-table-column label="第一班占比(%)" min-width="150px" align="center" >
                 <template slot-scope="scope">
                   <span>{{ scope.row.first_class_ratio }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="第二班占比(%)" min-width="150px" align="center">
+              <el-table-column label="第二班占比(%)" min-width="150px" align="center" v-if="class_num == 2 || class_num == 3 || class_num == 4">
                 <template slot-scope="scope">
                   <span>{{ scope.row.second_class_ratio }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="第三班占比(%)" min-width="150px" align="center">
+              <el-table-column label="第三班占比(%)" min-width="150px" align="center" v-if=" class_num == 3 || class_num == 4">
                 <template slot-scope="scope">
                   <span>{{ scope.row.third_class_ratio }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="第四班占比(%)" min-width="150px" align="center">
+              <el-table-column label="第四班占比(%)" min-width="150px" align="center" v-if="  class_num == 4">
                 <template slot-scope="scope">
                   <span>{{ scope.row.fourth_class_ratio }}</span>
                 </template>
@@ -189,9 +189,9 @@
               <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
                 <template slot-scope="scope">
                   <!-- 修改按钮 -->
-                  <el-button type="primary" size="mini" icon="el-icon-edit" @click="edit_step(scope.$index, scope.row)">修改</el-button>
+                  <el-button type="primary"  v-if="isButtonEdit"  size="mini" icon="el-icon-edit" @click="edit_step(scope.$index, scope.row)">修改</el-button>
                   <!-- 删除按钮 -->
-                  <el-button type="danger" size="mini" icon="el-icon-delete" @click="delete_step(scope.$index, scope.row)">删除</el-button>
+                  <el-button type="danger"  v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="delete_step(scope.$index, scope.row)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -253,19 +253,19 @@
               </el-form-item> 
             </el-col> 
             <el-col :span="12">
-              <el-form-item label="第二班占比(%):" prop="second_class_ratio">
+              <el-form-item label="第二班占比(%):" prop="second_class_ratio" v-if="class_num == 2 || class_num == 3 || class_num == 4">
                 <el-input v-model="addFormStep.second_class_ratio"    placeholder=""   />
               </el-form-item> 
             </el-col> 
          </el-row>  
          <el-row :gutter="20">
           <el-col :span="12">
-              <el-form-item label="第三班占比(%):" prop="third_class_ratio">
+              <el-form-item label="第三班占比(%):" prop="third_class_ratio" v-if=" class_num == 3 || class_num == 4">
                 <el-input v-model="addFormStep.third_class_ratio"    placeholder=""   />
               </el-form-item> 
             </el-col> 
             <el-col :span="12">
-              <el-form-item label="第四班占比(%):" prop="fourth_class_ratio">
+              <el-form-item label="第四班占比(%):" prop="fourth_class_ratio" v-if=" class_num == 4">
                 <el-input v-model="addFormStep.fourth_class_ratio"    placeholder=""   />
               </el-form-item> 
             </el-col> 
@@ -449,32 +449,37 @@ export default {
         //   { required: true, message: '类型必填', trigger: 'blur' },
         // ],
       },
+
+ 
+      class_num:4
        
     }
   },
   created(){
-      //获取按钮权限
-      // this.get_auto_buttons 
      
+     //获取按钮权限
+     const isButtonEdit = checkButtons(this.$store.state.buttonsList, "配方模板编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+     
+
+     var me = this
 
      //获取下拉框
      this.get_select_list1()
 
-      //表格 - 初始化 
-      this.get_table_data()
+     //表格 - 初始化 
+     setTimeout(function () {
+       me.get_table_data()
+			}, 1000);
 
      
-
+//  this.get_table_data()
     
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+    
     
     //获取 下拉框
     get_select_list1(){
@@ -514,7 +519,7 @@ export default {
         
 
 
-        ajaxDataGet('/api/v1/ops/base_setting/forage_cost/list?page=1&page_size=1000', {  }).then(e => {
+        ajaxDataGet('/api/v1/ops/base_setting/forage/list?page=1&page_size=1000', {  }).then(e => {
           console.log("饲料下拉框1:",e)
 
           //打印请求成功结果
@@ -525,6 +530,18 @@ export default {
           }
   
         })
+        // 班次数量下拉框
+        ajaxDataGet('/api/v1/ops/calf_feed/enum/list').then(e => {
+          console.log(e)
+          if(e.code === 200){
+            var class_num = e.data.class_list.length
+          } else {
+            var class_num = 4
+          }
+          console.log("class_num========",class_num)
+          me.class_num = class_num
+        })
+
 
     
     },

+ 8 - 8
src/views/systemManagement/Role.vue

@@ -10,7 +10,7 @@
           <el-input v-model="searchData.roleName" placeholder="角色"  style="width: 220px;" class="g-mr20" clearable />
       
           <el-button type="primary"   @click="form_search">搜索</el-button>
-          <el-button type="primary"    @click="form_add">添加角色</el-button>
+          <el-button type="primary"   v-if="isButtonEdit"   @click="form_add">添加角色</el-button>
       </div>
 
 
@@ -47,13 +47,13 @@
         <el-table-column label="操作" align="center" width="400" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
             <!-- 修改按钮 -->
-            <el-button    type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+            <el-button    v-if="isButtonEdit"  type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
             <!-- 删除按钮 -->
-            <el-button   type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+            <el-button   v-if="isButtonEdit"  type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
             <!-- 分配角色 -->
-            <el-button   type="warning" size="mini" icon="el-icon-setting" @click="form_set(scope.row)">页面权限</el-button>
+            <el-button  v-if="isButtonEdit"   type="warning" size="mini" icon="el-icon-setting" @click="form_set(scope.row)">页面权限</el-button>
 
-            <el-button  type="warning" size="mini" icon="el-icon-setting" @click="form_set2(scope.row)">数据权限</el-button>
+            <!-- <el-button  type="warning" size="mini" icon="el-icon-setting" @click="form_set2(scope.row)">数据权限</el-button> -->
 
 
           </template>
@@ -372,9 +372,9 @@ export default {
       //  console.log("this.$store.state.buttonsList==============",this.$store.state.buttonsList)
  
 
-      //  const isButtonEdit = checkButtons(this.$store.state.buttonsList, "角色列表编辑")
-      //  this.isButtonEdit = isButtonEdit
-      //  console.log('this.isButtonEdit==========',this.isButtonEdit)
+       const isButtonEdit = checkButtons(this.$store.state.buttonsList, "角色管理编辑")
+       this.isButtonEdit = isButtonEdit
+       console.log('this.isButtonEdit==========',this.isButtonEdit)
 
 
         

+ 7 - 10
src/views/systemManagement/User.vue

@@ -11,7 +11,7 @@
           <el-input v-model="searchData.name" placeholder="手机号"  style="width: 220px;" class="g-mr20" clearable />
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   @click="form_add">添加</el-button>
+          <el-button type="primary"   v-if="isButtonEdit"  @click="form_add">添加</el-button>
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -59,9 +59,9 @@
         <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
              <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <el-button  v-if="isButtonEdit"  type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
              <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+             <el-button  v-if="isButtonEdit"  type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -193,7 +193,9 @@ export default {
   },
   created(){
       //获取按钮权限
-      // this.get_auto_buttons 
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
      
 
      //获取下拉框
@@ -208,12 +210,7 @@ export default {
   },
   methods:{
 
-    get_auto_buttons() {
-      // 编辑
-      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
-      this.isButtonEdit = isButtonEdit
-      console.log('this.isButtonEdit==========',this.isButtonEdit)
-    },
+    
     
     //获取 下拉框
     get_select_list1(){