Selaa lähdekoodia

集团管理,项目管理,集团字典

shaun-sheep 5 vuotta sitten
vanhempi
commit
25ff97c0e0

+ 8 - 3
src/App.vue

@@ -6,8 +6,13 @@
 
 <script>
 
-export default {
+  export default {
     name: 'App',
     components: {},
-}
-</script>
+  }
+</script>
+<style>
+  .el-dialog__header {
+    border: 1px solid #eee;
+  }
+</style>

+ 62 - 0
src/components/manage/group/groupDialog.vue

@@ -0,0 +1,62 @@
+<template>
+  <el-dialog :title="title" :visible.sync="dialogFormVisible" class="group-dialog" width="30%">
+    <el-form :model="form" ref="form" :rules="rules" style="overflow: hidden">
+      <el-form-item label="集团名称:" label-width="120px" prop="name">
+        <el-input v-model="form.name" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="集团id" label-width="120px" prop="id" v-if="title=='添加集团'">
+        <el-input v-model="form.id" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item align="center">
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
+        <el-button type="primary" @click="changeConfirm('form')">确 定</el-button>
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    name: "groupDialog",
+    props: ['title'],
+    data() {
+      return {
+        form: {
+          name: '',
+          id: ''
+        },
+        dialogFormVisible: false,
+        rules: {
+          name: [
+            {required: true, message: '请输入集团名称', trigger: 'blur'}
+          ],
+          id: [
+            {
+              required: true, message: '请输入集团id', trigger: 'blur'
+            }
+          ]
+        }
+      }
+    },
+    methods: {
+      handleDialog() {
+        this.dialogFormVisible = true
+      },
+      changeConfirm(form) {
+        this.$refs[form].validate(valid => {
+          if (valid) {
+            console.log('success')
+          } else {
+            return false
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .el-dialog__header{
+    border:1px solid #eee;
+  }
+</style>

+ 116 - 0
src/components/manage/product/projectDialog.vue

@@ -0,0 +1,116 @@
+<template>
+  <el-dialog :title="title" :visible.sync="dialogFormVisible" class="group-dialog" width="30%">
+    <el-form :model="form" ref="form" :rules="rules" style="overflow: hidden">
+      <p class="text-color">项目基础信息</p>
+      <el-form-item label="所属集团:" label-width="120px" prop="group">
+        <el-select v-model="form.group" placeholder="请选择活动区域" style="display: block" :disabled="title=='编辑项目'">
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="项目名称" label-width="120px" prop="name">
+        <el-input v-model="form.name" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="项目id" label-width="120px" prop="id">
+        <el-input v-model="form.id" autocomplete="off" :disabled="title=='编辑项目'"></el-input>
+      </el-form-item>
+      <div v-show="title!='编辑项目'">
+        <p class="text-color">使用的集团方案</p>
+        <el-form-item label="" label-width="120px">
+          <el-radio-group v-model="radio">
+            <el-radio
+              v-for="item in radioList"
+              :key="item.label"
+              :label="item.label"
+              style="display:block;margin-bottom: 10px"
+            >{{item.value}}
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </div>
+
+      <el-form-item align="center">
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
+        <el-button type="primary" @click="changeConfirm('form')">确 定</el-button>
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    name: "projectDialog",
+    props: ['title'],
+    data() {
+      return {
+        form: {
+          name: '',
+          id: '',
+          group: ''
+        },
+        dialogFormVisible: false,
+        rules: {
+          name: [
+            {required: true, message: '请输入集团名称', trigger: 'blur'}
+          ],
+          id: [
+            {
+              required: true, message: '请输入集团id', trigger: 'blur'
+            }
+          ],
+          group: [
+            {
+              required: true, message: '请选择集团', trigger: 'change'
+            }
+          ]
+        },
+        options: [{
+          value: '选项1',
+          label: '黄金糕'
+        }, {
+          value: '选项2',
+          label: '双皮奶'
+        }],
+        radio: '0',
+        radioList: [
+          {
+            label: '0',
+            value: '默认方案'
+          }, {
+            label: '1',
+            value: '方案1'
+          }
+        ]
+      }
+    },
+    methods: {
+      handleDialog() {
+        this.dialogFormVisible = true
+      },
+      changeConfirm(form) {
+        this.$refs[form].validate(valid => {
+          if (valid) {
+            console.log('success')
+          } else {
+            return false
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .group-dialog {
+    .text-color {
+      color: #999999;
+      margin-bottom: 20px;
+      border-left: 4px solid #999999;
+      text-indent: 5px;
+    }
+  }
+</style>

+ 165 - 139
src/data/menus.js

@@ -24,143 +24,169 @@ export default [
 	},
 	// 人员管理
 	{
-		path: '/manage/user',
-		name: '人员管理',
-		icon: 'icon-renyuanguanli',
-		opts: [{
-			name: '查看',
-			basic: true,
-			permission: 'system:user:query'
-		}]
-	},
-	/******************** 数字字典 ***************************/
-	{
-		path: '/dictionary',
-		name: '数字字典',
-		disabled: true,
-	},
-	// 集团字典
-	{
-		path: '/group',
-		name: '集团字典',
-		icon: 'icon-shanglou',
-		children: [{
-			path: '/group/record',
-			name: '查看审核记录',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},
-		{
-			path: '/group/dictionary',
-			name: '管理集团字典',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},
-		{
-			path: '/group/content',
-			name: '内容管理',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},
-		// {
-		// 	path: '/floor/data',
-		// 	name: '现场数据整理',
-		// 	icon: '',
-		// 	children: [ {
-		// 		path: '/floor/data',
-		// 		name: '信息点整理',
-		// 		icon: '',
-		// 		opts: [{
-		// 			name: '查看',
-		// 			basic: true,
-		// 			permission: 'system:role:query'
-		// 		}]
-		// 	},
-		// 	{
-		// 		path: '/floor/plan',
-		// 		name: '位置标签整理',
-		// 		icon: '',
-		// 		opts: [{
-		// 			name: '查看',
-		// 			basic: true,
-		// 			permission: 'system:role:query'
-		// 		}]
-		// 	}]
-		// },
-		]
-	},
-	// 项目字典
-	{
-		path: '/project',
-		name: '项目字典',
-		icon: 'icon-taizhangzhangbushezhi',
-		children: [{
-			path: '/project/record',
-			name: '查看审核记录',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},
-		{
-			path: '/project/dictionary',
-			name: '管理项目字典',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}]
-	},
-	// 变更审核
-	{
-		path: '/record',
-		name: '变更审核',
-		icon: 'icon-taizhangzhangbushezhi',
-		children: [{
-			path: '/record/add',
-			name: '审核新增',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},
-		{
-			path: '/record/modify',
-			name: '审核修改',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},
-		{
-			path: '/record/dictionary',
-			name: '审核记录',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}]
-	},
+    path: '/manage/user',
+    name: '人员管理',
+    icon: 'icon-renyuanguanli',
+    opts: [{
+      name: '查看',
+      basic: true,
+      permission: 'system:user:query'
+    }]
+  },
+  /******************** 数字字典 ***************************/
+  {
+    path: '/dictionary',
+    name: '数字字典',
+    disabled: true
+  },
+  {
+    path: '/group',
+    name: '集团字典',
+    icon: 'icon-shanglou',
+
+
+  },
+  // 项目字典
+  {
+    path: '/project',
+    name: '项目字典',
+    icon: 'icon-taizhangzhangbushezhi'
+  },
+  // 变更审核
+  {
+    path: '/record',
+    name: '变更审核',
+    icon: 'icon-taizhangzhangbushezhi'
+  }
+  /*
+    {
+      path: '/dictionary',
+      name: '数字字典',
+      disabled: true,
+    },
+    // 集团字典
+    {
+      path: '/group',
+      name: '集团字典',
+      icon: 'icon-shanglou',
+      children: [{
+        path: '/group/record',
+        name: '查看审核记录',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      },
+      {
+        path: '/group/dictionary',
+        name: '管理集团字典',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      },
+      {
+        path: '/group/content',
+        name: '内容管理',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      },
+      // {
+      // 	path: '/floor/data',
+      // 	name: '现场数据整理',
+      // 	icon: '',
+      // 	children: [ {
+      // 		path: '/floor/data',
+      // 		name: '信息点整理',
+      // 		icon: '',
+      // 		opts: [{
+      // 			name: '查看',
+      // 			basic: true,
+      // 			permission: 'system:role:query'
+      // 		}]
+      // 	},
+      // 	{
+      // 		path: '/floor/plan',
+      // 		name: '位置标签整理',
+      // 		icon: '',
+      // 		opts: [{
+      // 			name: '查看',
+      // 			basic: true,
+      // 			permission: 'system:role:query'
+      // 		}]
+      // 	}]
+      // },
+      ]
+    },
+    // 项目字典
+    {
+      path: '/project',
+      name: '项目字典',
+      icon: 'icon-taizhangzhangbushezhi',
+      children: [{
+        path: '/project/record',
+        name: '查看审核记录',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      },
+      {
+        path: '/project/dictionary',
+        name: '管理项目字典',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      }]
+    },
+    // 变更审核
+    {
+      path: '/record',
+      name: '变更审核',
+      icon: 'icon-taizhangzhangbushezhi',
+      children: [{
+        path: '/record/add',
+        name: '审核新增',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      },
+      {
+        path: '/record/modify',
+        name: '审核修改',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      },
+      {
+        path: '/record/dictionary',
+        name: '审核记录',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      }]
+    },
+    */
 ]

+ 81 - 10
src/router/system.js

@@ -2,16 +2,87 @@ import LayoutMain from '@/framework/layout/Main'
 import Index from '@/views/index'
 import auth from '@/views/system/auth'
 import noUser from '@/views/system/nouser'
+//集团管理
+import manageGroup from '@/views/manage/group'
+//项目管理
+import manageProject from '@/views/manage/project'
+//集团字典
+import groupDictionaries from '@/views/group'
+//项目字典
+import projectDictionaries from '@/views/project'
+//变更审核
+import record from '@/views/record'
 
 export default [
-    {
-        path: '/',
-        name: '',
-        component: LayoutMain,
-        children: [
-            { path: '', name: 'blank', component: Index },
-        ]
-    },
-    { path: '/auth', name: 'auth', component: auth },
-    { path: '/noUser', name: 'noUser', component: noUser },
+  {
+    path: '/',
+    name: '',
+    component: LayoutMain,
+    children: [
+      {path: '', name: 'blank', component: Index},
+    ]
+  },
+  {path: '/auth', name: 'auth', component: auth},
+  {path: '/noUser', name: 'noUser', component: noUser},
+  {
+    path: '/manage',
+    name: 'LayoutMain',
+    component: LayoutMain,
+    children: [
+      {
+        path: 'group',
+        name: 'manageGroup',
+        component: manageGroup,
+        meta: {keepAlive: false, breadcrumbs: [{label: '集团管理'}]}
+      },
+      {
+        path: 'project',
+        name: 'manageProject',
+        component: manageProject,
+        meta: {keepAlive: false, breadcrumbs: [{label: '项目管理'}]}
+      },
+    ]
+  },
+  {
+    path: '/project',
+    name: 'LayoutMain',
+    component: LayoutMain,
+    children: [
+      {
+        path: '/group',
+        name: 'groupDictionaries',
+        component: groupDictionaries,
+        meta: {keepAlive: false, breadcrumbs: [{label: '集团字典'}]}
+      },
+
+    ]
+  },
+  {
+    path: '/project',
+    name: 'LayoutMain',
+    component: LayoutMain,
+    children: [
+      {
+        path: '/project',
+        name: 'projectDictionaries',
+        component: projectDictionaries,
+        meta: {keepAlive: false, breadcrumbs: [{label: '项目字典'}]}
+      },
+
+    ]
+  }, {
+    path: '/project',
+    name: 'LayoutMain',
+    component: LayoutMain,
+    children: [
+      {
+        path: '/record',
+        name: 'record',
+        component: record,
+        meta: {keepAlive: false, breadcrumbs: [{label: '变更审核'}]}
+      },
+
+
+    ]
+  },
 ]

+ 127 - 0
src/views/group/index.vue

@@ -0,0 +1,127 @@
+<template>
+  <div class="saga-group-dictionaries">
+    <div class="group">
+      <h4>集团</h4>
+      <div class="group-search">
+        <el-input placeholder="输入集团名称、编码搜索" v-model="groupName">
+          <i slot="suffix" class="el-icon-search el-input__icon"></i>
+        </el-input>
+      </div>
+      <ul>
+        <li v-for="(item,index) in groupList" :key="item.id" :class="{'active':idx==index}"
+            @click="handleGroup(index,item)">
+          {{item.name}}
+        </li>
+      </ul>
+
+    </div>
+    <div class="group-list">
+      <div class="top">
+        <span class="text">集团字典待审核的申请:<b>80</b></span>
+<!--        <el-button type="text" class="btn">查看审核记录</el-button>-->
+<!--        <el-button type="primary" class="btn">管理集团字典</el-button>-->
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: "index",
+    data() {
+      return {
+        groupName: '',
+        idx: 0,
+        groupList: [
+          {
+            name: '集团名称',
+            id: '0'
+          },
+          {
+            name: '集团名称',
+            id: '1'
+          },
+          {
+            name: '集团名称',
+            id: '2'
+          }
+        ]
+      }
+    },
+    methods: {
+      handleGroup(index, item) {
+        this.idx = index
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .saga-group-dictionaries {
+    overflow: hidden;
+    display: flex;
+
+    .group {
+      background: #ffffff;
+      height: calc(100% - 10px);
+      width: 17%;
+
+      h4 {
+        padding-left: 20px;
+        /*border-top: 1px solid #d9d9d9;*/
+        /*border-bottom: 1px solid #d9d9d9;*/
+        background: #d9d9d9;
+        color: #2b2b2b;
+        line-height: 44px;
+        font-size: 17px;
+      }
+
+      .group-search {
+        margin: 15px 10px;
+      }
+
+      .active {
+        background: #f5f7fa;
+      }
+
+      ul {
+        li {
+          padding-left: 15px;
+          height: 40px;
+          line-height: 40px;
+          cursor: pointer;
+        }
+      }
+    }
+
+    .group-list {
+      flex-grow: 1;
+      background: #ffffff;
+      margin-left: 20px;
+      height: calc(100% - 10px);
+
+      .top {
+        height: 60px;
+        line-height: 60px;
+        border: 1px solid #eeeeee;
+        overflow: hidden;
+
+        .text {
+          font-size: 17px;
+          display: inline-block;
+          margin-left: 30px;
+          float: left;
+
+          b {
+            font-weight: 600;
+            display: inline-block;
+          }
+        }
+
+        .btn {
+
+        }
+      }
+    }
+  }
+</style>

+ 91 - 0
src/views/manage/group/index.vue

@@ -0,0 +1,91 @@
+<template>
+  <div class="saga-group">
+    <div class="header">
+      <el-input placeholder="输入集团名称、编码进行搜索" v-model="value" class="search">
+        <i slot="suffix" class="el-input__icon el-icon-search"></i>
+      </el-input>
+      <el-button class="button" @click="addGroup">添加集团</el-button>
+    </div>
+    <div class="content">
+      <el-table :data="tableData" stripe style="width: 100%;" :header-cell-style="{background:'#eef1f6'}">
+        <el-table-column prop="date" label="集团名称" align="center"/>
+        <el-table-column prop="name" label="集团id" align="center"/>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="scope">
+            <span @click="handleEdit(scope.$index,scope.row) " class="el-icon-edit-outline cursor"></span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <groupDialog ref="handleAddGroup" :title="title"/>
+
+  </div>
+</template>
+
+<script>
+  import groupDialog from "../../../components/manage/group/groupDialog";
+
+  export default {
+    name: "group",
+    components: {groupDialog},
+    data() {
+      return {
+        value: '',
+        title: '',
+        tableData: [{
+          date: '2016-05-02',
+          name: '王小虎',
+        }, {
+          date: '2016-05-04',
+          name: '王小虎',
+        }, {
+          date: '2016-05-01',
+          name: '王小虎',
+        }, {
+          date: '2016-05-03',
+          name: '王小虎',
+        }]
+      }
+    },
+    methods: {
+      addGroup() {
+        this.title = '添加集团'
+        this.$refs.handleAddGroup.handleDialog()
+      },
+      handleEdit(index, row) {
+        this.title = '编辑集团'
+        this.$refs.handleAddGroup.handleDialog()
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .saga-group {
+    background: #ffffff;
+    border: 1px solid #eee;
+
+    .header {
+      margin: 20px;
+      overflow: hidden;
+
+      .search {
+        float: left;
+        width: 20%;
+      }
+
+      .button {
+        float: right;
+      }
+    }
+
+    .content {
+      margin-top: 20px;
+
+      .cursor {
+        cursor: pointer;
+      }
+    }
+  }
+</style>

+ 132 - 0
src/views/manage/project/index.vue

@@ -0,0 +1,132 @@
+<template>
+  <div class="saga-project">
+    <div class="header">
+      <el-input placeholder="输入集团名称、编码进行搜索" v-model="value" class="search">
+        <i slot="suffix" class="el-input__icon el-icon-search"></i>
+      </el-input>
+      <div class="project-select">
+        <span>所属集团:</span>
+        <el-select v-model="groupName" placeholder="请选择">
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </div>
+
+      <el-button class="button" @click="addGroup">添加项目</el-button>
+    </div>
+    <div class="content">
+      <el-table :data="tableData" stripe style="width: 100%;" :header-cell-style="{background:'#eef1f6'}">
+        <el-table-column prop="group" label="所属集团" align="center"/>
+        <el-table-column prop="date" label="项目名称" align="center"/>
+        <el-table-column prop="name" label="项目id" align="center"/>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="scope">
+            <span @click="handleEdit(scope.$index,scope.row) " class="el-icon-edit-outline cursor"></span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <projectDialog ref="handleAddProject" :title="title"/>
+
+  </div>
+</template>
+
+<script>
+  import projectDialog from "../../../components/manage/product/projectDialog";
+
+  export default {
+    name: "project",
+    components: {projectDialog},
+    data() {
+      return {
+        value: '',
+        title: '',
+        tableData: [{
+          date: '2016-05-02',
+          name: '王小虎',
+          group: '万达'
+        }, {
+          date: '2016-05-04',
+          name: '王小虎',
+          group: '万达'
+
+        }, {
+          date: '2016-05-01',
+          name: '王小虎',
+          group: '万达'
+
+        }, {
+          date: '2016-05-03',
+          name: '王小虎',
+          group: '万达'
+        }],
+        options: [{
+          value: '选项1',
+          label: '黄金糕'
+        }, {
+          value: '选项2',
+          label: '双皮奶'
+        }, {
+          value: '选项3',
+          label: '蚵仔煎'
+        }, {
+          value: '选项4',
+          label: '龙须面'
+        }, {
+          value: '选项5',
+          label: '北京烤鸭'
+        }],
+        groupName: ''
+      }
+    },
+    methods: {
+      addGroup() {
+        this.title = '添加项目'
+        this.$refs.handleAddProject.handleDialog()
+      },
+      handleEdit(index, row) {
+        this.title = '编辑项目'
+        this.$refs.handleAddProject.handleDialog()
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .saga-project {
+    background: #ffffff;
+    border: 1px solid #eee;
+
+    .header {
+      margin: 20px;
+      overflow: hidden;
+
+      .project-select {
+        margin-left: 40px;
+        display: inline-block;
+      }
+
+      .search {
+        float: left;
+        width: 20%;
+      }
+
+      .button {
+        float: right;
+      }
+    }
+
+    .content {
+      margin-top: 20px;
+
+      .cursor {
+        cursor: pointer;
+      }
+    }
+  }
+</style>

+ 13 - 0
src/views/project/index.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+    export default {
+        name: "index"
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/views/record/index.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+    export default {
+        name: "index"
+    }
+</script>
+
+<style scoped>
+
+</style>