Ver código fonte

硬件参数和字典数据

钞小赢 3 anos atrás
pai
commit
c8eb553865

+ 29 - 0
src/api/modules/paramManage/dataDic.api.js

@@ -0,0 +1,29 @@
1
+
2
+  //数据字典
3
+export default ({request}) => ({
4
+  
5
+
6
+//列表
7
+ dataDic(data = {}) {
8
+
9
+
10
+  return request({
11
+    url: `/basic-enum/getTree`,
12
+    method: 'post',
13
+    data
14
+  })
15
+
16
+  },
17
+
18
+  //新增
19
+  addDataDic(data = {}) {
20
+
21
+
22
+    return request({
23
+      url: `basic-enum/save`,
24
+      method: 'post',
25
+      data
26
+    })
27
+  
28
+    }
29
+})

+ 10 - 0
src/api/modules/paramManage/hardParam.api.js

@@ -2,6 +2,16 @@
2 2
   //硬件参数
3 3
 export default ({request}) => ({
4 4
   //左侧树
5
+  leftTree(params = {}) {
6
+
7
+
8
+    return request({
9
+      url: `orgInfo/authority/getTreeList`,
10
+      method: 'get',
11
+      params
12
+    })
13
+  
14
+    },
5 15
 
6 16
 //列表
7 17
  hardParam(data = {}) {

+ 7 - 0
src/assets/style/public-class.scss

@@ -127,6 +127,10 @@ $sizes: (0, 5, 10, 15, 20);
127 127
 .el-tree-node__content:hover {
128 128
   background-color: #91a8bc !important;
129 129
 }
130
+.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
131
+  background-color: #0064b9 !important;
132
+  border-radius: 20px;
133
+}
130 134
 //table border
131 135
 
132 136
 .el-table td,
@@ -169,3 +173,6 @@ $sizes: (0, 5, 10, 15, 20);
169 173
 //   border:1px solid #345684;
170 174
 //   opacity: 12.5;
171 175
 // }
176
+#switchLabel .el-switch__label{
177
+  color:#fff;
178
+}

+ 123 - 81
src/views/demo/parameManagement/dataDictionary/index.vue

@@ -24,7 +24,10 @@
24 24
               <div class="searchRow">
25 25
                 <div>
26 26
                   <el-form-item label="字典名称:">
27
-                    <el-cascader :options="options"></el-cascader>
27
+                    <el-input
28
+                    v-model="formInline.enumName"
29
+                    placeholder="请输入"
30
+                  ></el-input>
28 31
                   </el-form-item>
29 32
 
30 33
                   <el-form-item>
@@ -50,7 +53,7 @@
50 53
                     <el-button
51 54
                       type="primary"
52 55
                       icon="el-icon-plus"
53
-                      @click="addDic"
56
+                      @click="addDic()"
54 57
                       >新建字典</el-button
55 58
                     >
56 59
                   </el-form-item>
@@ -63,36 +66,44 @@
63 66
               border
64 67
               style="width: 100%"
65 68
               row-key="id"
66
-              lazy
67
-              :load="load"
69
+             
70
+              
68 71
               :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
69 72
               :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }"
70 73
             >
71 74
               <el-table-column
72
-                prop="branchOffice"
75
+                prop='enumName'
73 76
                 label="字典名称"
74 77
                 align="center"
75 78
               >
76 79
               </el-table-column>
77 80
               <el-table-column
78
-                prop="directLibrary"
81
+                prop="enumCode"
79 82
                 label="字典标识"
80 83
                 align="center"
81 84
               >
82 85
               </el-table-column>
83 86
               <el-table-column
84
-                prop="subTreasury"
87
+                prop="useState"
85 88
                 label="使用状态"
86 89
                 align="center"
87 90
               >
91
+              <template slot-scope="scope">
92
+                <div v-if="scope.row.useState==1">
93
+                  启用
94
+                </div>
95
+                <div v-if="scope.row.useState==2">
96
+                  停用
97
+                </div>
98
+              </template>
88 99
               </el-table-column>
89
-              <el-table-column prop="cfName" label="更新时间" align="center">
100
+              <el-table-column prop="updateTime" label="更新时间" align="center">
90 101
               </el-table-column>
91 102
 
92 103
               <el-table-column align="center" label="操作" width="180">
93 104
                 <template slot-scope="scope">
94 105
                   <el-button
95
-                    @click="handleCheck(scope.row)"
106
+                    @click="addChildren(scope.row)"
96 107
                     type="text"
97 108
                     size="small"
98 109
                     icon="el-icon-circle-check"
@@ -118,30 +129,32 @@
118 129
 
119 130
 
120 131
     <!-- //字典弹框 -->
121
-    <el-dialog title="新建字典" :visible.sync="dicDialog" id="dialogStyle">
122
-  <el-form :model="form" id="dialogForm" :rules="rules">
123
-    <el-form-item label="字典标识:" :label-width="formLabelWidth" prop="kkk">
124
-      <el-input v-model="form.kkk" autocomplete="off"></el-input>
132
+    <el-dialog :title="title" :visible.sync="dicDialog" id="dialogStyle">
133
+  <el-form :model="form" id="dialogForm" :rules="rules" ref="formData">
134
+    <el-form-item label="字典标识:" :label-width="formLabelWidth" prop="enumCode">
135
+      <el-input v-model="form.enumCode" autocomplete="off"></el-input>
125 136
     </el-form-item>
126
-     <el-form-item label="字典名称:" :label-width="formLabelWidth" prop="name">
127
-      <el-input v-model="form.name" autocomplete="off"></el-input>
137
+     <el-form-item label="字典名称:" :label-width="formLabelWidth" prop="enumName">
138
+      <el-input v-model="form.enumName" autocomplete="off"></el-input>
128 139
     </el-form-item>
129
-     <el-form-item label="描述:" :label-width="formLabelWidth" prop="name">
130
-      <el-input v-model="form.name" autocomplete="off"></el-input>
140
+     <el-form-item label="描述:" :label-width="formLabelWidth" prop="remark">
141
+      <el-input v-model="form.remark" autocomplete="off"></el-input>
131 142
     </el-form-item>
132
-     <el-form-item label="字典状态:" :label-width="formLabelWidth" prop="name">
133
-      <el-input v-model="form.name" autocomplete="off"></el-input>
143
+     <el-form-item label="字典状态:" :label-width="formLabelWidth" id="switchLabel">
144
+          <el-switch v-model="form.useState" active-text="启用"
145
+  inactive-text="禁用"></el-switch>
134 146
     </el-form-item>
135 147
    
136 148
   </el-form>
137 149
   <div slot="footer" class="dialog-footer">
138 150
     <el-button @click="dicDialog = false">取 消</el-button>
139
-    <el-button type="primary" @click="defined()">确 定</el-button>
151
+    <el-button type="primary" @click="defined('formData')">确 定</el-button>
140 152
   </div>
141 153
 </el-dialog>
142 154
   </div>
143 155
 </template>
144 156
 <script>
157
+import api from "@/api";
145 158
 // 引入分页
146 159
 import Pagination from "@/components/pagination";
147 160
 export default {
@@ -149,7 +162,8 @@ export default {
149 162
   components: { Pagination },
150 163
   data() {
151 164
     return {
152
-    
165
+      //初始化弹框标题
166
+      title:"",
153 167
       //初始化弹框状态时关闭的
154 168
       dicDialog:false,
155 169
       //label宽度
@@ -189,58 +203,13 @@ export default {
189 203
 
190 204
       //头部查询条件
191 205
       formInline: {
192
-        cfName: "",
193
-        scanTime: "",
206
+        enumName:"",
194 207
       },
195 208
       //表格字段
196
-      dataDictionaryList: [
197
-        {
198
-          id: 1,
199
-          branchOffice: "中储粮河南分公司",
200
-          directLibrary: "商丘直属库",
201
-          subTreasury: "宁陵粮油储备公司",
202
-          cfName: "1号仓",
203
-          keeper: "白端静",
204
-          lxfs: "13531314569",
205
-          lastScan: "2019-08-21 16:11:59",
206
-          cfState: "出库",
207
-          hasChildren: true,
208
-        },
209
-      ],
209
+      dataDictionaryList: [],
210 210
 
211
-      // 日期插件
212
-      //
213
-      pickerOptions: {
214
-        shortcuts: [
215
-          {
216
-            text: "最近一周",
217
-            onClick(picker) {
218
-              const end = new Date();
219
-              const start = new Date();
220
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
221
-              picker.$emit("pick", [start, end]);
222
-            },
223
-          },
224
-          {
225
-            text: "最近一个月",
226
-            onClick(picker) {
227
-              const end = new Date();
228
-              const start = new Date();
229
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
230
-              picker.$emit("pick", [start, end]);
231
-            },
232
-          },
233
-          {
234
-            text: "最近三个月",
235
-            onClick(picker) {
236
-              const end = new Date();
237
-              const start = new Date();
238
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
239
-              picker.$emit("pick", [start, end]);
240
-            },
241
-          },
242
-        ],
243
-      },
211
+    
212
+   
244 213
       //分页
245 214
       total: 30,
246 215
       listQuery: {
@@ -253,22 +222,74 @@ export default {
253 222
       },
254 223
       //弹框初始化数据
255 224
       form:{
256
-        kkk:"",
257
-        name:"",
225
+        enumCode:"",
226
+        enumName:"",
227
+        useState:false,
228
+        remark:"",
258 229
       },
259 230
       //验证规则
260 231
       rules:{
261
-        kkk:[ {required:true,message:"请输入字典数据名称",trigger:"blur"}],
262
-        name:[ {required:true,message:"请输入字典数据名称",trigger:"blur"}]
263
-      }
232
+        enumCode:[ {required:true,message:"请输入字典标识",trigger:"blur"}],
233
+        enumName:[ {required:true,message:"请输入字典名称",trigger:"blur"}],
234
+        //  useState:[ {required:true,message:"请输入字典名称",trigger:"blur"}],
235
+       
236
+      },
237
+      // 点确定按钮时传的id
238
+      parentId:""
264 239
        
265 240
      
266 241
     };
267 242
   },
268 243
   methods: {
269
-    search() {},
270
-    reset() {},
271
-    getList() {},
244
+    search() {
245
+      this.getList()
246
+    },
247
+    reset() {
248
+      this.formInline.enumName="";
249
+      this.getList()
250
+    },
251
+    //列表
252
+    getList() {
253
+     var condition = {
254
+        enumName: this.formInline.enumName,
255
+        
256
+      };
257
+      condition = JSON.stringify(condition);
258
+       var data = {
259
+       
260
+        condition: condition,
261
+      };
262
+      api.dataDic(data).then(res=>{
263
+        if(res.code==200){
264
+          this.dataDictionaryList=res.data;
265
+        }
266
+      })
267
+      .catch(err=>{
268
+        console.log(err)
269
+      })
270
+    },
271
+    //新增
272
+    addDataDicList(){
273
+       
274
+     let data={
275
+        enumCode:this.form.enumCode,
276
+        enumName:this.form.enumName,
277
+        useState:this.form.useState==true?1:2,
278
+        remark:this.form.remark,
279
+        parentId:this.parentId
280
+      }
281
+      api.addDataDic(data)
282
+        .then(res => {
283
+          if (res.code == 200) {
284
+            this.$message.success("新增成功");
285
+            this.getList();
286
+          }
287
+        })
288
+        .catch(err => {
289
+          console.log(err)
290
+        });
291
+     
292
+    },
272 293
     //查看
273 294
     handleCheck() {
274 295
       this.$router.push({
@@ -306,13 +327,33 @@ export default {
306 327
     },
307 328
     //新建字典
308 329
     addDic() {
309
-      this.dicDialog=true;
330
+      this.form={}
331
+       this.title = "新增字典";
332
+      this.dicDialog = true;
333
+      this.parentId=0;
334
+      
335
+      
336
+    },
337
+    //新建子项
338
+    addChildren(row){
339
+      this.title = "新增子项";
340
+      this.form={}
341
+      this.dicDialog = true;
342
+        this.parentId=row.id;
310 343
     },
311 344
     //点击弹框确定按钮
312
-    defined(){
313
-     this.dicDialog=false;
345
+    defined(formData){
346
+      this.$refs[formData].validate((valid) => {
347
+        if (valid) {
348
+           this.addDataDicList();
349
+             this.dicDialog = false;
350
+        }
351
+      });
314 352
     }
315 353
   },
354
+  mounted(){
355
+    this.getList();
356
+  }
316 357
 };
317 358
 </script>
318 359
 <style lang="scss" scoped>
@@ -326,6 +367,7 @@ export default {
326 367
   display: flex;
327 368
   justify-content: space-between;
328 369
 }
370
+
329 371
 // #dialogForm .el-form-item .el-form-item_label{
330 372
 //   color:#000;
331 373
 // }

+ 130 - 83
src/views/demo/parameManagement/hardwareParame/index.vue

@@ -4,16 +4,21 @@
4 4
       <!-- <template slot="header">首页/硬件参数</template> -->
5 5
       <div class="main">
6 6
         <div class="left">
7
-          <el-input placeholder="输入关键字进行过滤" v-model="filterText">
8
-          </el-input>
7
+          <!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText" >
8
+          </el-input> -->
9 9
 
10 10
           <el-tree
11 11
             class="filter-tree"
12
+            :filter-node-method="filterNode"
13
+            v-loading="loading"
12 14
             :data="leftList"
13 15
             node-key="id"
14 16
             :props="defaultProps"
17
+            :expand-on-click-node="false"
18
+            @node-click="handleNodeClick"
15 19
             default-expand-all
16
-            :filter-node-method="filterNode"
20
+            highlight-current
21
+            :default-expanded-keys="this.defaultExpanded"
17 22
             ref="tree"
18 23
           >
19 24
             <span class="custom-tree-node" slot-scope="{ node, data }">
@@ -101,7 +106,7 @@
101 106
                   align="center"
102 107
                 >
103 108
                 </el-table-column>
104
-                <el-table-column prop="Port" label="设备编号" align="center">
109
+                <el-table-column prop="port" label="设备编号" align="center">
105 110
                 </el-table-column>
106 111
                 <el-table-column prop="ipAdress" label="设备IP" align="center">
107 112
                 </el-table-column>
@@ -133,7 +138,7 @@
133 138
 
134 139
     <!-- //弹框 -->
135 140
     <el-dialog :title="title" :visible.sync="dialogTantou" id="dialogStyle">
136
-      <el-form :model="dialog">
141
+      <el-form :model="dialog" ref="formData">
137 142
         <el-form-item label="设备名称:" :label-width="formLabelWidth">
138 143
           <el-input v-model="dialog.deviceName" autocomplete="off"></el-input>
139 144
         </el-form-item>
@@ -141,12 +146,14 @@
141 146
           <el-input v-model="dialog.ipAdress" autocomplete="off"></el-input>
142 147
         </el-form-item>
143 148
         <el-form-item label="设备编码:" :label-width="formLabelWidth">
144
-          <el-input v-model="dialog.Port" autocomplete="off"></el-input>
149
+          <el-input v-model="dialog.port" autocomplete="off"></el-input>
145 150
         </el-form-item>
146 151
       </el-form>
147 152
       <div slot="footer" class="dialog-footer">
148 153
         <el-button @click="dialogTantou = false">取 消</el-button>
149
-        <el-button type="primary" @click="determine()">确 定</el-button>
154
+        <el-button type="primary" @click="determine('formData')"
155
+          >确 定</el-button
156
+        >
150 157
       </div>
151 158
     </el-dialog>
152 159
   </div>
@@ -157,6 +164,7 @@ export default {
157 164
   name: "hardwareParame",
158 165
   data() {
159 166
     return {
167
+      filterText:"",
160 168
       //初始化弹框标题
161 169
       title: "",
162 170
       //仓房id
@@ -168,82 +176,27 @@ export default {
168 176
       // 弹框默认关闭
169 177
       dialogTantou: false,
170 178
       filterText: "",
171
-      //默认展开的节点
179
+      leftList: [],
172 180
       defaultProps: {
173 181
         children: "children",
174
-        label: "label",
182
+        label: "orgName",
175 183
       },
176
-      //左侧树数据
177
-      leftList: [
178
-        {
179
-          id: 0,
180
-          label: "中储粮河南分公司",
181
-          icon: "el-icon-tickets",
182
-          children: [
183
-            {
184
-              id: 1,
185
-              label: "商丘直属库",
186
-              icon: "el-icon-paperclip",
187
-              children: [
188
-                {
189
-                  id: 4,
190
-                  label: "宁陵粮油储备公司",
191
-                  children: [
192
-                    {
193
-                      id: 9,
194
-                      label: "1号仓",
195
-                    },
196
-                    {
197
-                      id: 10,
198
-                      label: "2号仓",
199
-                    },
200
-                  ],
201
-                },
202
-              ],
203
-            },
204
-            {
205
-              id: 2,
206
-              label: "郑州直属库",
207
-              icon: "el-icon-paperclip",
208
-              children: [
209
-                {
210
-                  id: 5,
211
-                  label: "中牟粮油储备公司",
212
-                  children: [
213
-                    {
214
-                      id: 8,
215
-                      label: "1号仓",
216
-                    },
217
-                    {
218
-                      id: 9,
219
-                      label: "1号仓",
220
-                    },
221
-                  ],
222
-                },
223
-              ],
224
-            },
225
-          ],
226
-        },
227
-      ],
228
-      // 日期插件
229
-      //
184
+
185
+      loading: false,
186
+      //默认展开的节点
187
+      defaultExpanded: [],
188
+      cfbh: "",
230 189
 
231 190
       formInline: {
232 191
         deviceNames: "",
233 192
       },
234 193
       //表格字段
235
-      hardwareList: [
236
-        {
237
-          deviceName: "",
238
-          port: "",
239
-          ipAdress: "",
240
-        },
241
-      ],
194
+      hardwareList: [],
242 195
       //弹框字段
243 196
       dialog: {
244 197
         deviceName: "",
245
-          port: "",
246
-          ipAdress: "",
198
+        port: "",
199
+        ipAdress: "",
247 200
       },
248 201
       //分页
249 202
 
@@ -255,19 +208,72 @@ export default {
255 208
         //总条数
256 209
         total: 0,
257 210
       },
211
+      // 过滤字段初始化
212
+      orgName:"",
258 213
     };
259 214
   },
215
+
260 216
   watch: {
261
-    filterTest(val) {
262
-      this.$refs.tree.filter(val);
217
+      filterText(val) {
218
+        this.$refs.tree.filter(val);
219
+      }
263 220
     },
264
-  },
221
+
265 222
   methods: {
223
+    //获取左侧树
224
+    getLeftTree() {
225
+      this.loading = true;
226
+      let params = {
227
+        orgName:this.orgName,
228
+      };
229
+
230
+      api
231
+        .leftTree(params)
232
+        .then((res) => {
233
+          if (res.code == 200) {
234
+            console.log(res);
235
+            this.leftList = [];
236
+            if (res.data) {
237
+              this.leftList = res.data;
238
+           
239
+
240
+              if (res.data[0].id) {
241
+                this.defaultExpanded.push(res.data[0].id);
242
+                if (res.data[0].children) {
243
+                  this.defaultExpanded.push(
244
+                    res.data[0].children[0].children[0].id
245
+                  );
246
+
247
+                  this.cfbh =
248
+                    res.data[0].children[0].children[0].children[0].id;
249
+                 
250
+                  setTimeout(() => {
251
+                    this.$refs.tree.setCurrentKey(this.cfbh);
252
+                  }, 500);
253
+                  console.log(this.leftList);
254
+                    this.getList();
255
+                }
256
+              }
257
+            }
258
+          } else {
259
+            this.$message({
260
+              type: "error",
261
+              message: res.msg,
262
+            });
263
+          }
264
+          this.loading = false;
265
+        })
266
+        .catch((error) => {
267
+          this.loading = false;
268
+          console.log(error);
269
+        });
270
+    },
266 271
     //获取列表数据
267 272
     getList() {
273
+      console.log("....")
268 274
       var condition = {
269
-        houseId: 1,
270
-        deviceName: "",
275
+        houseId: this.cfbh,
276
+        deviceName: this.formInline.deviceName,
271 277
       };
272 278
       condition = JSON.stringify(condition);
273 279
       var data = {
@@ -288,15 +294,46 @@ export default {
288 294
           console.log(err);
289 295
         });
290 296
     },
297
+    handleNodeClick(data,node) {
298
+    
299
+    if(node.level ===4){
300
+     this.cfbh=data.id;
301
+     console.log(  this.cfbh,";;;")
302
+    }
303
+    this.getList();
304
+    },
291 305
     //新增
292
-    addList(){},
306
+    addList() {
307
+      var data = {
308
+        houseId: this.cfbh,
309
+        deviceName: this.dialog.deviceName,
310
+        ipAdress: this.dialog.ipAdress,
311
+        port: this.dialog.port,
312
+      };
313
+      api
314
+        .addHardParam(data)
315
+        .then(res => {
316
+          if (res.code == 200) {
317
+            this.$message.success("新增成功");
318
+            this.getList();
319
+          }
320
+        })
321
+        .catch(err => {
322
+          console.log(err)
323
+        });
324
+    },
293 325
 
294 326
     filterNode(value, data) {
295 327
       if (!value) return true;
296
-      return data.label.indexOf(value) !== -1;
328
+      return data.orgName.indexOf(value) !== -1;
329
+    },
330
+    search() {
331
+      this.getList()
332
+    },
333
+    reset() {
334
+      this.formInline.deviceName="";
335
+      this.getList();
297 336
     },
298
-    search() {},
299
-    reset() {},
300 337
     //新增
301 338
     addTantou() {
302 339
       this.title = "新增硬件参数";
@@ -319,11 +356,21 @@ export default {
319 356
       this.getList();
320 357
     },
321 358
     //弹框确定按钮
322
-    determine() {},
359
+    determine(formData) {
360
+      this.$refs[formData].validate((valid) => {
361
+        if (valid) {
362
+          this.addList();
363
+             this.dialogTantou = false;
364
+        }
365
+      });
366
+    },
367
+    
368
+    
323 369
   },
324 370
   mounted() {
325 371
     console.log("aaaa");
326
-    this.getList();
372
+    // this.getList();
373
+    this.getLeftTree();
327 374
   },
328 375
 };
329 376
 </script>

+ 331 - 9
src/views/demo/system/roleManagement/index.vue

@@ -1,14 +1,336 @@
1 1
 <template>
2
-    <div>
3
-         <d2-container>
4
-    <template slot="header">系统管理/角色管理</template>
5
- 角色管理
6
-  </d2-container>
7
-      
8
-    </div>
2
+  <div>
3
+    <d2-container>
4
+      <!-- <template slot="header">首页/数据查询</template> -->
5
+      <div class="main">
6
+        <div class="right">
7
+          <!-- <template slot="header">首页/数据查询</template> -->
8
+          <div class="nav">当前所在位置:首页>角色管理</div>
9
+          <div class="right_main">
10
+            <div class="right_title">
11
+              <i class="fa fa-bar-chart" aria-hidden="true" style="padding-right: 5px"></i>
12
+              角色管理
13
+            </div>
14
+            <div class="right_table">
15
+              <el-form :inline="true" :model="formInline" class="demo-form-inline">
16
+                <div class="float-left">
17
+                  <el-form-item label="机构名称">
18
+                    <el-input  v-model="state" >
19
+                     
20
+                     
21
+                    </el-input>
22
+                  </el-form-item>
23
+                  <el-form-item>
24
+                    <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
25
+                  </el-form-item>
26
+                  <el-form-item>
27
+                    <el-button type="primary" icon="el-icon-refresh-left" @click="reset">重置</el-button>
28
+                  </el-form-item>
29
+                </div>
30
+                <div class="float-right">
31
+                  <el-form-item>
32
+
33
+                    <el-button type="primary" icon="el-icon-plus" @click="dialogFormVisible = true">新建角色</el-button>
34
+                  </el-form-item>
35
+
36
+                </div>
37
+              </el-form>
38
+              <el-table :data="tableData" ref='dataTreeList' style="width: 100%" :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }" row-key="id" border :tree-props="{children: 'children',hasChildren: 'hasChildren',}">
39
+                <el-table-column prop="OrganizationName" label="组织机构名称" align="center">
40
+                </el-table-column>
41
+                <el-table-column prop="storeType" label="仓库类型" align="center">
42
+                </el-table-column>
43
+
44
+                <el-table-column prop="state" label="机构状态" align="center">
45
+                </el-table-column>
46
+                <el-table-column prop="CreateDate" label="创建时间" align="center">
47
+                </el-table-column>
48
+                <el-table-column fixed="right" label="操作" width="200">
49
+                  <template slot-scope="scope">
50
+                    <el-button @click="detail(scope.row)" type="text" size="small">编辑</el-button>
51
+                    <el-button @click="detail(scope.row)" type="text" size="small">删除</el-button>
52
+                    <el-button @click="detail(scope.row)" type="text" size="small">查看</el-button>
53
+                    <el-switch v-model="value" active-value='启用' inactive-value='禁用'active-color="#13ce66" inactive-color="#ff4949">
54
+                    </el-switch>
55
+                  </template>
56
+                </el-table-column>
57
+              </el-table>
58
+              <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1" :page-sizes="[10, 20, 30, 40]" :page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pagination.total">
59
+              </el-pagination>
60
+            </div>
61
+          </div>
62
+        </div>
63
+      </div>
64
+      <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
65
+        <el-form :model="form">
66
+          <el-form-item label="活动名称" :label-width="formLabelWidth">
67
+            <el-input v-model="form.name" autocomplete="off" style="width:223px"></el-input>
68
+          </el-form-item>
69
+          <el-form-item label="活动区域" :label-width="formLabelWidth">
70
+            <el-select v-model="form.region" placeholder="请选择活动区域">
71
+              <el-option label="区域一" value="shanghai"></el-option>
72
+              <el-option label="区域二" value="beijing"></el-option>
73
+            </el-select>
74
+          </el-form-item>
75
+        </el-form>
76
+        <div slot="footer" class="dialog-footer">
77
+          <el-button @click="dialogFormVisible = false">取 消</el-button>
78
+          <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
79
+        </div>
80
+      </el-dialog>
81
+    </d2-container>
82
+  </div>
9 83
 </template>
10 84
 <script>
11 85
 export default {
12
-  name:"roleManagement"
86
+  name: 'roleManagement',
87
+  data () {
88
+    return {
89
+      value:'true',//启用开关默认值
90
+      filterText: '',
91
+      restaurants: [], //组织机构搜索
92
+      state: '',
93
+
94
+      formInline: {
95
+        scanTime: ''
96
+      },
97
+      // 表格字段
98
+      dataSearchList: [
99
+        {
100
+          directLibrary: '',
101
+          subTreasury: '',
102
+          cfName: '',
103
+          scanStart: '',
104
+          scanEnd: '',
105
+
106
+          cfState: ''
107
+        }
108
+      ],
109
+      tableData: [{
110
+        id: 1,
111
+        CreateDate: '2016-05-02',
112
+        OrganizationName: '王小虎',
113
+        storeType: '直属库',
114
+        state: '启用',
115
+      }, {
116
+        id: 2,
117
+        CreateDate: '2016-05-02',
118
+        OrganizationName: '王小虎',
119
+        storeType: '直属库',
120
+        state: '启用',
121
+      }, {
122
+        id: 3,
123
+        CreateDate: '2016-05-02',
124
+        OrganizationName: '王小虎',
125
+        storeType: '直属库',
126
+        state: '启用',
127
+        children: [{
128
+          id: 31,
129
+          CreateDate: '2016-05-02',
130
+          OrganizationName: '王小虎',
131
+          storeType: '直属库',
132
+          state: '启用',
133
+        }, {
134
+          id: 32,
135
+          CreateDate: '2016-05-02',
136
+          OrganizationName: '王小虎',
137
+          storeType: '直属库',
138
+          state: '启用',
139
+        }]
140
+      }, {
141
+        id: 4,
142
+        CreateDate: '2016-05-02',
143
+        OrganizationName: '王小虎',
144
+        storeType: '直属库',
145
+        state: '启用',
146
+      }],
147
+      dialogTableVisible: false,
148
+      dialogFormVisible: false,
149
+      formLabelWidth: '120px',
150
+      form: {
151
+        name: '',
152
+        region: ''
153
+      },
154
+      pagination: {
155
+        // 每页显示的条数
156
+        pageSize: 10,
157
+        // 当前页
158
+        curPage: 1,
159
+        // 总数
160
+        total: 20
161
+      }
162
+    }
163
+  },
164
+  watch: {
165
+    filterTest (val) {
166
+      this.$refs.tree.filter(val)
167
+    }
168
+  },
169
+  mounted () {
170
+    this.restaurants = this.loadAll();
171
+  },
172
+  methods: {
173
+    filterNode (value, data) {
174
+      if (!value) return true
175
+      return data.label.indexOf(value) !== -1
176
+    },
177
+    search () { },
178
+    reset () { },
179
+    // 每页条数改变
180
+    handleSizeChange (val) {
181
+      console.log(`每页 ${val} 条`)
182
+    },
183
+    // 当前页改变
184
+    handleCurrentChange (val) {
185
+      // this.pagination.curPage = val;
186
+      console.log(`当前页: ${val}`)
187
+    },
188
+    detail () { },
189
+
190
+    querySearch (queryString, cb) {
191
+      var restaurants = this.restaurants;
192
+      var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
193
+      // 调用 callback 返回建议列表的数据
194
+      cb(results);
195
+    },
196
+    createFilter (queryString) {
197
+      return (restaurant) => {
198
+        return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
199
+      };
200
+    },
201
+    loadAll () {
202
+      return [
203
+        { "value": "三全鲜食(北新泾店)", "address": "长宁区新渔路144号" },
204
+        { "value": "Hot honey 首尔炸鸡(仙霞路)", "address": "上海市长宁区淞虹路661号" },
205
+        { "value": "新旺角茶餐厅", "address": "上海市普陀区真北路988号创邑金沙谷6号楼113" },
206
+        { "value": "泷千家(天山西路店)", "address": "天山西路438号" },
207
+        { "value": "胖仙女纸杯蛋糕(上海凌空店)", "address": "上海市长宁区金钟路968号1幢18号楼一层商铺18-101" },
208
+        { "value": "贡茶", "address": "上海市长宁区金钟路633号" },
209
+        { "value": "豪大大香鸡排超级奶爸", "address": "上海市嘉定区曹安公路曹安路1685号" },
210
+        { "value": "茶芝兰(奶茶,手抓饼)", "address": "上海市普陀区同普路1435号" },
211
+        { "value": "十二泷町", "address": "上海市北翟路1444弄81号B幢-107" },
212
+        { "value": "星移浓缩咖啡", "address": "上海市嘉定区新郁路817号" },
213
+        { "value": "阿姨奶茶/豪大大", "address": "嘉定区曹安路1611号" },
214
+        { "value": "新麦甜四季甜品炸鸡", "address": "嘉定区曹安公路2383弄55号" },
215
+        { "value": "Monica摩托主题咖啡店", "address": "嘉定区江桥镇曹安公路2409号1F,2383弄62号1F" },
216
+        { "value": "浮生若茶(凌空soho店)", "address": "上海长宁区金钟路968号9号楼地下一层" },
217
+        { "value": "NONO JUICE  鲜榨果汁", "address": "上海市长宁区天山西路119号" },
218
+        { "value": "CoCo都可(北新泾店)", "address": "上海市长宁区仙霞西路" },
219
+        { "value": "快乐柠檬(神州智慧店)", "address": "上海市长宁区天山西路567号1层R117号店铺" },
220
+        { "value": "Merci Paul cafe", "address": "上海市普陀区光复西路丹巴路28弄6号楼819" },
221
+        { "value": "猫山王(西郊百联店)", "address": "上海市长宁区仙霞西路88号第一层G05-F01-1-306" },
222
+        { "value": "枪会山", "address": "上海市普陀区棕榈路" },
223
+        { "value": "纵食", "address": "元丰天山花园(东门) 双流路267号" },
224
+        { "value": "钱记", "address": "上海市长宁区天山西路" },
225
+        { "value": "壹杯加", "address": "上海市长宁区通协路" },
226
+        { "value": "唦哇嘀咖", "address": "上海市长宁区新泾镇金钟路999号2幢(B幢)第01层第1-02A单元" },
227
+        { "value": "爱茜茜里(西郊百联)", "address": "长宁区仙霞西路88号1305室" },
228
+        { "value": "爱茜茜里(近铁广场)", "address": "上海市普陀区真北路818号近铁城市广场北区地下二楼N-B2-O2-C商铺" },
229
+        { "value": "鲜果榨汁(金沙江路和美广店)", "address": "普陀区金沙江路2239号金沙和美广场B1-10-6" },
230
+        { "value": "开心丽果(缤谷店)", "address": "上海市长宁区威宁路天山路341号" },
231
+        { "value": "超级鸡车(丰庄路店)", "address": "上海市嘉定区丰庄路240号" },
232
+        { "value": "妙生活果园(北新泾店)", "address": "长宁区新渔路144号" },
233
+        { "value": "香宜度麻辣香锅", "address": "长宁区淞虹路148号" },
234
+        { "value": "凡仔汉堡(老真北路店)", "address": "上海市普陀区老真北路160号" },
235
+        { "value": "港式小铺", "address": "上海市长宁区金钟路968号15楼15-105室" },
236
+        { "value": "蜀香源麻辣香锅(剑河路店)", "address": "剑河路443-1" },
237
+        { "value": "北京饺子馆", "address": "长宁区北新泾街道天山西路490-1号" },
238
+        { "value": "饭典*新简餐(凌空SOHO店)", "address": "上海市长宁区金钟路968号9号楼地下一层9-83室" },
239
+        { "value": "焦耳·川式快餐(金钟路店)", "address": "上海市金钟路633号地下一层甲部" },
240
+        { "value": "动力鸡车", "address": "长宁区仙霞西路299弄3号101B" },
241
+        { "value": "浏阳蒸菜", "address": "天山西路430号" },
242
+        { "value": "四海游龙(天山西路店)", "address": "上海市长宁区天山西路" },
243
+        { "value": "樱花食堂(凌空店)", "address": "上海市长宁区金钟路968号15楼15-105室" },
244
+        { "value": "壹分米客家传统调制米粉(天山店)", "address": "天山西路428号" },
245
+        { "value": "福荣祥烧腊(平溪路店)", "address": "上海市长宁区协和路福泉路255弄57-73号" },
246
+        { "value": "速记黄焖鸡米饭", "address": "上海市长宁区北新泾街道金钟路180号1层01号摊位" },
247
+        { "value": "红辣椒麻辣烫", "address": "上海市长宁区天山西路492号" },
248
+        { "value": "(小杨生煎)西郊百联餐厅", "address": "长宁区仙霞西路88号百联2楼" },
249
+        { "value": "阳阳麻辣烫", "address": "天山西路389号" },
250
+        { "value": "南拳妈妈龙虾盖浇饭", "address": "普陀区金沙江路1699号鑫乐惠美食广场A13" }
251
+      ];
252
+    },
253
+    handleSelect (item) {
254
+      console.log(item);
255
+    },
256
+    handleIconClick (ev) {
257
+      console.log(ev);
258
+    },
259
+    // 全部展开
260
+    toggleRowExpansion (isExpansion) {
261
+      this.tableData.forEach(item => {
262
+        this.$refs.dataTreeList.toggleRowExpansion(item, isExpansion);
263
+      })
264
+    },
265
+
266
+  }
13 267
 }
14
-</script>
268
+</script>
269
+<style lang="scss" scoped>
270
+/* .main .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf {
271
+  border-bottom: none ;
272
+} */
273
+// 组织机构输入框
274
+.my-autocomplete {
275
+  li {
276
+    line-height: normal;
277
+    padding: 7px;
278
+
279
+    .name {
280
+      text-overflow: ellipsis;
281
+      overflow: hidden;
282
+    }
283
+    .addr {
284
+      font-size: 12px;
285
+      color: #b4b4b4;
286
+    }
287
+
288
+    .highlighted .addr {
289
+      color: #ddd;
290
+    }
291
+  }
292
+}
293
+
294
+.main {
295
+  height: 100%;
296
+  display: flex;
297
+  .left {
298
+    width: 250px;
299
+    height: 100%;
300
+    background: #163d79;
301
+  }
302
+  .right {
303
+    // margin-left: 20px;
304
+    // width: calc(100% - 250px);
305
+    .nav {
306
+      padding: 10px 0 10px 10px;
307
+      color: #fff;
308
+
309
+      font-size: 14px;
310
+
311
+      background: #004a93;
312
+    }
313
+    .right_main {
314
+      border: 1px solid #67a7df;
315
+      background: #112f5d;
316
+
317
+      margin-top: 10px;
318
+      .right_title {
319
+        color: #fff;
320
+        border-bottom: 1px solid #67a7df;
321
+        padding: 10px;
322
+        font-size: 14px;
323
+      }
324
+      .right_table {
325
+        padding: 20px;
326
+      }
327
+    }
328
+  }
329
+}
330
+.float-left {
331
+  float: left;
332
+}
333
+.float-right {
334
+  float: right;
335
+}
336
+</style>