Quellcode durchsuchen

剩料配置页面

Shan9312 vor 1 Jahr
Ursprung
Commit
4c45be24d4

BIN
dist-tmr-测试线-20240603.zip


+ 162 - 151
src/router/index.js

@@ -1,59 +1,59 @@
-import Vue from 'vue'
+import Vue from 'vue'
 import Router from 'vue-router'
-
-
-Vue.use(Router)
-
-/* Layout */
-import Layout from '@/layout'
-
-/**
- * Note: sub-menu only appear when route children.length >= 1
- * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
- *
- * hidden: true                   if set true, item will not show in the sidebar(default is false)
- * alwaysShow: true               if set true, will always show the root menu
- *                                if not set alwaysShow, when item has more than one children route,
- *                                it will becomes nested mode, otherwise not show the root menu
- * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
- * name:'router-name'             the name is used by <keep-alive> (must set!!!)
- * meta : {
-    roles: ['admin','editor']    control the page roles (you can set multiple roles)
-    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
-    icon: 'svg-name'             the icon show in the sidebar
-    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
-    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
-  }
- */
-
-/**
- * constantRoutes
- * a base page that does not have permission requirements
- * all roles can be accessed
- */
-export const constantRoutes = [
-  {
-    path: '/login',
-    component: () => import('@/views/login/index'),
-    hidden: true
-  },
-  {
-    path: '/404',
-    component: () => import('@/views/404'),
-    hidden: true
-  },
-
-  {
-    path: '/',
-    component: Layout,
-    redirect: '/dashboard',
-    children: [{
-      path: 'dashboard',
-      name: 'Dashboard',
-      // component: () => import('@/views/dashboard/editor/index'),
-      component: () => import('@/views/dashboard/index'),
-      meta: { title: '首页', icon: '首页', affix: true }
-    }]
+
+
+Vue.use(Router)
+
+/* Layout */
+import Layout from '@/layout'
+
+/**
+ * Note: sub-menu only appear when route children.length >= 1
+ * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
+ *
+ * hidden: true                   if set true, item will not show in the sidebar(default is false)
+ * alwaysShow: true               if set true, will always show the root menu
+ *                                if not set alwaysShow, when item has more than one children route,
+ *                                it will becomes nested mode, otherwise not show the root menu
+ * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
+ * name:'router-name'             the name is used by <keep-alive> (must set!!!)
+ * meta : {
+    roles: ['admin','editor']    control the page roles (you can set multiple roles)
+    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
+    icon: 'svg-name'             the icon show in the sidebar
+    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
+    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
+  }
+ */
+
+/**
+ * constantRoutes
+ * a base page that does not have permission requirements
+ * all roles can be accessed
+ */
+export const constantRoutes = [
+  {
+    path: '/login',
+    component: () => import('@/views/login/index'),
+    hidden: true
+  },
+  {
+    path: '/404',
+    component: () => import('@/views/404'),
+    hidden: true
+  },
+
+  {
+    path: '/',
+    component: Layout,
+    redirect: '/dashboard',
+    children: [{
+      path: 'dashboard',
+      name: 'Dashboard',
+      // component: () => import('@/views/dashboard/editor/index'),
+      component: () => import('@/views/dashboard/index'),
+      meta: { title: '首页', icon: '首页', affix: true }
+    }]
   },
   {
     path: '/changpwd',
@@ -65,104 +65,115 @@ export const constantRoutes = [
       component: () => import('@/views/changpwd/changpwd/index'),
       meta: { title: '修改密码', icon: '修改密码', affix: false }
     }]
-  }
-]
-
-/**
- * asyncRoutes
- * the routes that need to be dynamically loaded based on user roles
- */
-export const asyncRoutes = [
-  {
-    path: '/nested',
-    component: Layout,
-    redirect: '/nested/menu1',
-    name: 'Nested',
-    meta: {
-      title: 'Nested',
-      icon: 'nested'
-    },
-    children: [
-      {
-        path: 'menu1',
-        component: () => import('@/views/nested/menu1/index'), // Parent router-view
-        name: 'Menu1',
-        meta: { title: 'Menu1' },
-        children: [
-          {
-            path: 'menu1-1',
-            component: () => import('@/views/nested/menu1/menu1-1'),
-            name: 'Menu1-1',
-            meta: { title: 'Menu1-1' }
-          },
-          {
-            path: 'menu1-2',
-            component: () => import('@/views/nested/menu1/menu1-2'),
-            name: 'Menu1-2',
-            meta: { title: 'Menu1-2' },
-            children: [
-              {
-                path: 'menu1-2-1',
-                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
-                name: 'Menu1-2-1',
-                meta: { title: 'Menu1-2-1' }
-              },
-              {
-                path: 'menu1-2-2',
-                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
-                name: 'Menu1-2-2',
-                meta: { title: 'Menu1-2-2' }
-              }
-            ]
-          },
-          {
-            path: 'menu1-3',
-            component: () => import('@/views/nested/menu1/menu1-3'),
-            name: 'Menu1-3',
-            meta: { title: 'Menu1-3' }
-          }
-        ]
-      },
-      {
-        path: 'menu2',
-        component: () => import('@/views/nested/menu2/index'),
-        meta: { title: 'menu2' }
-      }
-
-    ]
-  },
-
-  {
-    path: 'external-link',
-    component: Layout,
-    children: [
-      {
-        path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
-        meta: { title: 'External Link', icon: 'link' }
-      }
-    ]
-  },
-  // 404 page must be placed at the end !!!
-  { path: '*', redirect: '/404', hidden: true }
-]
-
-const createRouter = () => new Router({
-  // mode: 'history', // require service support
-  scrollBehavior: () => ({ y: 0 }),
-  routes: constantRoutes
-})
-
-const router = createRouter()
-
-// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
-export function resetRouter() {
-  const newRouter = createRouter()
-  router.matcher = newRouter.matcher // reset router
+  },
+  {
+    path: '/leftoverManagement',
+    component: Layout,
+    redirect: '/leftoverManagement',
+    children: [{
+      path: 'leftoverManagement',
+      name: 'leftoverManagement',
+      component: () => import('@/views/leftoverManagement/index.vue'),
+      meta: { title: '剩料配置',icon: '撒料计划'}
+    }]
+  },
+]
+
+/**
+ * asyncRoutes
+ * the routes that need to be dynamically loaded based on user roles
+ */
+export const asyncRoutes = [
+  {
+    path: '/nested',
+    component: Layout,
+    redirect: '/nested/menu1',
+    name: 'Nested',
+    meta: {
+      title: 'Nested',
+      icon: 'nested'
+    },
+    children: [
+      {
+        path: 'menu1',
+        component: () => import('@/views/nested/menu1/index'), // Parent router-view
+        name: 'Menu1',
+        meta: { title: 'Menu1' },
+        children: [
+          {
+            path: 'menu1-1',
+            component: () => import('@/views/nested/menu1/menu1-1'),
+            name: 'Menu1-1',
+            meta: { title: 'Menu1-1' }
+          },
+          {
+            path: 'menu1-2',
+            component: () => import('@/views/nested/menu1/menu1-2'),
+            name: 'Menu1-2',
+            meta: { title: 'Menu1-2' },
+            children: [
+              {
+                path: 'menu1-2-1',
+                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
+                name: 'Menu1-2-1',
+                meta: { title: 'Menu1-2-1' }
+              },
+              {
+                path: 'menu1-2-2',
+                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
+                name: 'Menu1-2-2',
+                meta: { title: 'Menu1-2-2' }
+              }
+            ]
+          },
+          {
+            path: 'menu1-3',
+            component: () => import('@/views/nested/menu1/menu1-3'),
+            name: 'Menu1-3',
+            meta: { title: 'Menu1-3' }
+          }
+        ]
+      },
+      {
+        path: 'menu2',
+        component: () => import('@/views/nested/menu2/index'),
+        meta: { title: 'menu2' }
+      }
+
+    ]
+  },
+
+  {
+    path: 'external-link',
+    component: Layout,
+    children: [
+      {
+        path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
+        meta: { title: 'External Link', icon: 'link' }
+      }
+    ]
+  },
+  // 404 page must be placed at the end !!!
+  { path: '*', redirect: '/404', hidden: true }
+]
+
+const createRouter = () => new Router({
+  // mode: 'history', // require service support
+  scrollBehavior: () => ({ y: 0 }),
+  routes: constantRoutes
+})
+
+const router = createRouter()
+
+// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
+export function resetRouter() {
+  const newRouter = createRouter()
+  router.matcher = newRouter.matcher // reset router
 }
 const originalPush = Router.prototype.push
 Router.prototype.push = function push(location, onResolve, onReject) {
   if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
   return originalPush.call(this, location).catch(err => err)
-}
-
-export default router
+}
+
+export default router

+ 123 - 120
src/store/modules/permission.js

@@ -1,107 +1,107 @@
-// import { asyncRoutes, constantRoutes } from '@/router'
-import { constantRoutes } from '@/router'
-import { validatenull } from '@/utils/validate'
-// for get menus from server
-// import { getMenuByRole } from '@/api/menu'
-import { getRecuData,transData,GetDataByName } from '@/api/common'
-import Layout from '@/layout'
-
-function buildRouter(aMenu) {
-  const aRouter = []
-
-  aMenu.forEach(item => {
-    if (!validatenull(item.component)) {
-      const oRouter = {
-        meta: { 'title': '', 'icon': '' },
-        children: []
-      }
-
-      if (item.component !== 'Iframe') {
-        if (item.component === 'Layout') {
-          oRouter.component = Layout
+// import { asyncRoutes, constantRoutes } from '@/router'
+import { constantRoutes } from '@/router'
+import { validatenull } from '@/utils/validate'
+// for get menus from server
+// import { getMenuByRole } from '@/api/menu'
+import { getRecuData,transData,GetDataByName } from '@/api/common'
+import Layout from '@/layout'
+
+function buildRouter(aMenu) {
+  const aRouter = []
+
+  aMenu.forEach(item => {
+    if (!validatenull(item.component)) {
+      const oRouter = {
+        meta: { 'title': '', 'icon': '' },
+        children: []
+      }
+
+      if (item.component !== 'Iframe') {
+        if (item.component === 'Layout') {
+          oRouter.component = Layout
         } else {
-          oRouter.component = require('@/views/' + item.component + '.vue').default
-        }
+          oRouter.component = require('@/views/' + item.component + '.vue').default
+        }
           oRouter.name = item.path
-          oRouter.id = item.id || null
-        if (item.redirect !== '') {
-          oRouter.redirect = item.redirect || null
-          oRouter.path = '/' + item.path
-        } else {
-          oRouter.path = item.path
-        }
+          oRouter.id = item.id || null
+        if (item.redirect !== '') {
+          oRouter.redirect = item.redirect || null
+          oRouter.path = '/' + item.path
+        } else {
+          oRouter.path = item.path
+        }
         // console.log(item)
         if(item.seebutton == 1 || item.seebutton == 2){
-          oRouter.meta.icon = item.icon
-          oRouter.meta.title = item.title
-          // oRouter.meta.noCache = item.noCache || false
-          oRouter.meta.noCache = true
-          // oRouter.meta.breadcrumb = item.breadcrumb || true
-          oRouter.children = validatenull(item.children) ? [] : buildRouter(item.children)
-          aRouter.push(oRouter)
-        }
-      }
-    }
-  })
-
-  return aRouter
-}
-
-/**
- * Use meta.role to determine if the current user has permission
- * @param roles
- * @param route
- */
-function hasPermission(roles, route) {
-  if (route.meta && route.meta.roles) {
-    return roles.some(role => route.meta.roles.includes(role))
-  } else {
-    return true
-  }
-}
-
-/**
- * Filter asynchronous routing tables by recursion
- * @param routes asyncRoutes
- * @param roles
- */
-export function filterAsyncRoutes(routes, roles) {
-  const res = []
-
-  routes.forEach(route => {
-    const tmp = { ...route }
-    if (hasPermission(roles, tmp)) {
-      if (tmp.children) {
-        tmp.children = filterAsyncRoutes(tmp.children, roles)
-      }
-      res.push(tmp)
-    }
-  })
-
-  return res
-}
-
-const state = {
-  routes: [],
-  addRoutes: [],
+          oRouter.meta.icon = item.icon
+          oRouter.meta.title = item.title
+          // oRouter.meta.noCache = item.noCache || false
+          oRouter.meta.noCache = true
+          // oRouter.meta.breadcrumb = item.breadcrumb || true
+          oRouter.children = validatenull(item.children) ? [] : buildRouter(item.children)
+          aRouter.push(oRouter)
+        }
+      }
+    }
+  })
+
+  return aRouter
+}
+
+/**
+ * Use meta.role to determine if the current user has permission
+ * @param roles
+ * @param route
+ */
+function hasPermission(roles, route) {
+  if (route.meta && route.meta.roles) {
+    return roles.some(role => route.meta.roles.includes(role))
+  } else {
+    return true
+  }
+}
+
+/**
+ * Filter asynchronous routing tables by recursion
+ * @param routes asyncRoutes
+ * @param roles
+ */
+export function filterAsyncRoutes(routes, roles) {
+  const res = []
+
+  routes.forEach(route => {
+    const tmp = { ...route }
+    if (hasPermission(roles, tmp)) {
+      if (tmp.children) {
+        tmp.children = filterAsyncRoutes(tmp.children, roles)
+      }
+      res.push(tmp)
+    }
+  })
+
+  return res
+}
+
+const state = {
+  routes: [],
+  addRoutes: [],
   data1: {
-    name: 'getmenu',
-    idname: 'id',
-    parammaps: { id: -1 }
-  }
-}
-
-const mutations = {
+    name: 'getmenu',
+    idname: 'id',
+    parammaps: { id: -1 }
+  }
+}
+
+const mutations = {
   SET_ROUTES: (state, routes) => {
-    // console.log(state,routes)
-    state.addRoutes = routes
-    state.routes = constantRoutes.concat(routes)
-  }
-}
-
-const actions = {
-  generateRoutes({ commit }, roles) {
-    return new Promise((resolve, reject) => {
+    // console.log(state,routes)
+    state.addRoutes = routes
+    state.routes = constantRoutes.concat(routes)
+  }
+}
+
+const actions = {
+  generateRoutes({ commit }, roles) {
+    return new Promise((resolve, reject) => {
       GetDataByName(state.data1).then(response => {
         if(response.data.list !== null){
           for(let i=0;i<response.data.list.length;i++){
@@ -115,17 +115,20 @@ const actions = {
             }
           }
           console.log(response.data.list,'==========9999')
-          const menus  = transData(response.data.list, 'id', 'parentId', 'children')
-          // const menus = response.data
-          if (menus.length === 0) {
-            reject('menus data is null1')
+          // const arrRout = response.data.list.filter((item)=>{
+          //     return item.component != 'basicDate/leftoverManagement/index'
+          // })
+          const menus  = transData(response.data.list, 'id', 'parentId', 'children')
+          // const menus = response.data
+          if (menus.length === 0) {
+            reject('menus data is null1')
           }
-          const accessedRoutes = buildRouter(menus)
-          // final add 404
-          accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
-          // commit to stores
-          commit('SET_ROUTES', accessedRoutes)
-          // return for add to router
+          const accessedRoutes = buildRouter(menus)
+          // final add 404
+          accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
+          // commit to stores
+          commit('SET_ROUTES', accessedRoutes)
+          // return for add to router
           resolve(accessedRoutes)
         } else {
           const menus  = []
@@ -140,15 +143,15 @@ const actions = {
           commit('SET_ROUTES', accessedRoutes)
           // return for add to router
           resolve(accessedRoutes)
-        }
-      })
-    })
-  }
-}
-
-export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}
+        }
+      })
+    })
+  }
+}
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}

+ 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')

Datei-Diff unterdrückt, da er zu groß ist
+ 715 - 714
src/views/basicData/feedTable/index.vue


+ 8 - 0
src/views/formulationPlan/recipeTemplate/index.vue

@@ -151,6 +151,14 @@
                 <el-input v-if="scope.row.Edit" v-model="scope.row.autozone" type="textarea" :disabled="scope.row.fttype !=='预混配方'" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:95%;padding:10px 0;" />
               </template>
             </el-table-column>
+            <el-table-column label="替代方案" min-width="130px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.fttype }}</span>
+                <el-select v-if="scope.row.Edit || scope.row.isCreate == true" v-model="scope.row.fttypeid" filterable placeholder="替代方案" class="filter-item" style="width:95%;padding:10px 0;" @change="changeFormulaType">
+                  <el-option v-for="item in formulaTypeList" :key="item.value" :label="item.label" :value="item.value" />
+                </el-select>
+              </template>
+            </el-table-column>
             <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <el-button v-if="row.NoEdit && isRoleEdit && ispastureuse==0" icon="el-icon-tickets" class="miniSuccess" @click="handleRowRecipeRecord(row)" />

+ 177 - 0
src/views/leftoverManagement/index.vue

@@ -0,0 +1,177 @@
+<template>
+  <div class="container">
+    <div class="header-box">
+      <p> 剩料计划</p>
+      <el-button type="primary" plain class="add-btn" @click="dialogVisible = true">新 增</el-button>
+    </div>
+
+    <div class="table">
+      <el-table
+       element-loading-text="给我一点时间"
+        :data="tableData"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        class="elTable table-fixed"
+        >
+        <el-table-column
+          label="序号"
+          width="60"
+          type="index"
+          >
+        </el-table-column>
+        <el-table-column
+          label="替代方案"
+          prop="name"
+          width="180">
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              class="miniSuccess"
+              icon="el-icon-edit-outline"
+              @click="handleEdit(scope.$index, scope.row)"></el-button>
+            <el-button
+              size="mini"
+              type="danger"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.$index, scope.row)"></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!--  -->
+      <el-pagination
+      class="page"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :current-page.sync="currentPage1"
+      :page-size="100"
+      layout="total, prev, pager, next"
+      :total="1000">
+    </el-pagination>
+     </div>
+
+     <!-- 新增删除提示 -->
+     <el-dialog
+        title="剩料新增"
+        :visible.sync="dialogVisible"
+        width="30%"
+       >
+        <div>
+          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+            <el-form-item label="替代方案" prop="name">
+              <el-select v-model="ruleForm.name" placeholder="请选择替代方案">
+                <el-option label="日料" value="1"></el-option>
+                <el-option label="豆bo" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-form>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button class="add-btn" @click="dialogVisible = false">取 消</el-button>
+          <el-button class="add-btn" type="primary" @click="dialogVisible = false">确 定</el-button>
+        </span>
+      </el-dialog>
+
+  </div>
+</template>
+
+<script>
+  import {
+    GetDataByName,
+    GetDataByNames
+  } from '@/api/common'
+  import Cookies from 'js-cookie'
+  import {
+    MessageBox
+  } from 'element-ui'
+  export default {
+    name: 'LeftoverManagement',
+    data() {
+      return {
+        tableData: [{
+          id:1,
+          num: '1',
+          name: '日粮',
+        }, {
+          id:2,
+          num: '2',
+          name: '豆泊',
+        }, {
+          id:3,
+          num: '3',
+          name: '日粮',
+        }],
+        currentPage1: 1,
+        dialogVisible:false,
+        //
+        ruleForm: {
+          name: '',
+        },
+        rules:{
+          name: [
+            { required: true, message: '请选择替代方案', trigger: 'change' }
+          ]
+        }
+      }
+    },
+    created() {},
+    methods: {
+      handleEdit(index, row) {
+        console.log(index, row);
+        // 获取当前数据,点击编辑
+        this.ruleForm = row;
+        this.dialogVisible = true;
+      },
+      handleDelete(index, row) {
+        console.log(index, row);
+        this.$confirm('确定删除当前剩料配置吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });
+        })
+      },
+      //
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`);
+      },
+      handleCurrentChange(val) {
+        console.log(`当前页: ${val}`);
+      }
+
+    },
+
+  }
+</script>
+
+<style lang="scss" scoped>
+  .header-box{
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .container{
+    padding: 15px;
+    min-height:600px;
+    margin-left:10px;
+    .add-btn{
+      width:90px;
+      height:40px;
+    }
+    .page{
+      margin-top:20px;
+    }
+  }
+</style>

Datei-Diff unterdrückt, da er zu groß ist
+ 795 - 773
src/views/shedProduction/materialRemainingRecord/index.vue


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.