许成详 6 years ago
parent
commit
02179733ee

+ 5
- 2
src/pages/system/caseManager/caseInfo/index.vue View File

@@ -32,10 +32,10 @@
32 32
               size="mini"
33 33
               type="warning"
34 34
               @click="editItem(scope.$index, scope.row)">编辑</el-button>
35
-            <!-- <el-button
35
+            <el-button
36 36
               size="mini"
37 37
               type="success"
38
-              @click="keyManager(scope.$index, scope.row)">钥匙管理</el-button> -->
38
+              @click="pplConcerned(scope.$index, scope.row)">相关人员</el-button>
39 39
           </template>
40 40
         </el-table-column>
41 41
       </el-table>
@@ -76,6 +76,9 @@ export default {
76 76
     this.getList()
77 77
   },
78 78
   methods: {
79
+    pplConcerned (index, row) { // 相关人员
80
+      this.$router.push({name: 'pplConcerned', query: {id: row.CaseId}})
81
+    },
79 82
     getList () { // 获取列表
80 83
       this.$ajax(this.$api.caseManager.getCaseList.url, {
81 84
         method: this.$api.caseManager.getCaseList.method,

+ 158
- 0
src/pages/system/caseManager/caseInfo/pplConcerned/editPPLConcerned/index.vue View File

@@ -0,0 +1,158 @@
1
+<template>
2
+  <div class="subPage">
3
+    <form class="mainForm">
4
+      <ul>
5
+        <li class="flex-h">
6
+          <span>用户类型:</span>
7
+          <div class="flex-item">
8
+            <el-select v-model="postData.UserType" placeholder="请选择">
9
+              <el-option
10
+                v-for="item in typeList"
11
+                :key="item.TypeId"
12
+                :label="item.TypeName"
13
+                :value="item.TypeId">
14
+              </el-option>
15
+            </el-select>
16
+          </div>
17
+        </li>
18
+        <li class="flex-h">
19
+          <span>用户姓名:</span>
20
+          <div class="flex-item">
21
+            <div style="width:50%">
22
+              <el-input
23
+                placeholder="请输入名称"
24
+                v-model="postData.UserName"
25
+                clearable>
26
+              </el-input>
27
+            </div>
28
+          </div>
29
+        </li>
30
+        <li class="flex-h">
31
+          <span>手机号码:</span>
32
+          <div class="flex-item">
33
+            <div style="width:50%">
34
+              <el-input
35
+                placeholder="请输入手机号码"
36
+                v-model="postData.Tel"
37
+                clearable>
38
+              </el-input>
39
+            </div>
40
+          </div>
41
+        </li>
42
+        <li style="text-align:center">
43
+          <el-button type="primary" size="mini" @click="submit">保存</el-button>
44
+          <el-button type="danger" size="mini" @click="cancel">取消</el-button>
45
+        </li>
46
+      </ul>
47
+    </form>
48
+  </div>
49
+</template>
50
+
51
+<script>
52
+import { mapState } from 'vuex'
53
+
54
+export default {
55
+  name: '',
56
+  data () {
57
+    return {
58
+      postData: {
59
+        CaseUserId: '', // 主键id
60
+        OrgId: '', // 机构id
61
+        CaseId: this.$route.query.id, // 案场id
62
+        UserName: '', // 用户名称
63
+        Tel: '', // 电话
64
+        UserType: '', // 用户类型
65
+      },
66
+      typeList: [],
67
+    }
68
+  },
69
+  computed: {
70
+    ...mapState({
71
+      cases: x => x.app.cases.list,
72
+      defaultCaseId: x => x.app.cases.default,
73
+      OrgId: x => x.app.user.OrgId,
74
+    }),
75
+    CaseId: {
76
+      get () {
77
+        return this.postData.caseid || this.defaultCaseId
78
+      },
79
+      set (val) {
80
+        this.postData.caseid = val
81
+      }
82
+    }
83
+  },
84
+  created () {
85
+    this.getUserTypeList()
86
+    this.getCaseUserInfo()
87
+  },
88
+  components: {},
89
+  methods: {
90
+    getCaseUserInfo () {
91
+      if (this.$route.query.userid !== undefined) {
92
+        this.$ajax(this.$api.caseManager.getCaseUserInfo.url, {
93
+          method: this.$api.caseManager.getCaseUserInfo.method,
94
+          urlData: {id: this.$route.query.userid}
95
+        }).then(res => {
96
+          this.postData = res
97
+        })
98
+      }
99
+    },
100
+    getUserTypeList () { // 获取用户类型
101
+      this.$ajax(this.$api.caseManager.getUserTypeList.url, {
102
+        method: this.$api.caseManager.getUserTypeList.method,
103
+      }).then(res => {
104
+        this.typeList = res
105
+        this.postData.UserType = res[0].TypeId
106
+      })
107
+    },
108
+    submit () { // 提交数据
109
+      if (this.postData.UserName === '') {
110
+        this.$message({
111
+          type: 'error',
112
+          message: '用户名称不能为空'
113
+        })
114
+        return false
115
+      }
116
+      if (this.postData.Tel === '') {
117
+        this.$message({
118
+          type: 'error',
119
+          message: '手机号码不能为空'
120
+        })
121
+        return false
122
+      }
123
+      this.postData.OrgId = this.OrgId
124
+      if (this.$route.query.userid !== undefined) {
125
+        this.$ajax(this.$api.caseManager.editCaseUser.url, {
126
+          method: this.$api.caseManager.editCaseUser.method,
127
+          data: this.postData
128
+        }).then(res => {
129
+          this.$message({
130
+            type: 'success',
131
+            message: '操作成功'
132
+          })
133
+          this.$router.push({ name: 'pplConcerned', query: { id: this.$route.query.id } })
134
+        })
135
+      } else {
136
+        this.$ajax(this.$api.caseManager.addCaseUser.url, {
137
+          method: this.$api.caseManager.addCaseUser.method,
138
+          data: this.postData
139
+        }).then(res => {
140
+          this.$message({
141
+            type: 'success',
142
+            message: '操作成功'
143
+          })
144
+          this.$router.push({ name: 'pplConcerned', query: { id: this.$route.query.id } })
145
+        })
146
+      }
147
+    },
148
+    cancel () { // 取消
149
+      this.$router.push({ name: 'pplConcerned', query: { id: this.$route.query.id } })
150
+    }
151
+  }
152
+}
153
+</script>
154
+
155
+<!-- Add "scoped" attribute to limit CSS to this component only -->
156
+<style lang="scss" scoped>
157
+@import "page.scss";
158
+</style>

+ 56
- 0
src/pages/system/caseManager/caseInfo/pplConcerned/editPPLConcerned/page.scss View File

@@ -0,0 +1,56 @@
1
+span{
2
+  em{
3
+    color: red;
4
+  }
5
+}
6
+.map{
7
+  height: 500px;
8
+  background: #eee;
9
+  position: relative;
10
+  overflow: hidden;
11
+  box-sizing: border-box;
12
+  border: 1px solid #dcdfe6;
13
+
14
+  &>div.search{
15
+    display: inline-block;
16
+    position: absolute;
17
+  }
18
+
19
+  &>div.flex-item{
20
+    width: 100%;
21
+    &>div{
22
+      width: 100%;
23
+      height: 100%;
24
+      position: relative;
25
+      overflow: hidden;
26
+    }
27
+  }
28
+}
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+

+ 115
- 0
src/pages/system/caseManager/caseInfo/pplConcerned/index.vue View File

@@ -0,0 +1,115 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click="addPPLConcerned">新增相关人员</el-button>
7
+        </div>
8
+      </div>
9
+      <div class="moreFilter"></div>
10
+    </div>
11
+    <div class="system-table-box">
12
+      <el-table
13
+        :data="currentList"
14
+        stripe
15
+        style="width: 100%">
16
+        <el-table-column
17
+          prop="UserType"
18
+          label="用户类型">
19
+        </el-table-column>
20
+        <el-table-column
21
+          prop="UserName"
22
+          label="用户名称">
23
+        </el-table-column>
24
+        <el-table-column
25
+          prop="Tel"
26
+          label="手机号">
27
+        </el-table-column>
28
+        <el-table-column label="操作" width="200">
29
+          <template slot-scope="scope">
30
+            <el-button
31
+              size="mini"
32
+              type="warning"
33
+              @click="editItem(scope.$index, scope.row)">编辑</el-button>
34
+          </template>
35
+        </el-table-column>
36
+      </el-table>
37
+    </div>
38
+    <el-pagination
39
+      @current-change="handleCurrentChange"
40
+      :current-page.sync="postData.page"
41
+      :page-size="postData.pagesize"
42
+      layout="prev, pager, next, jumper"
43
+      :total="total">
44
+    </el-pagination>
45
+  </div>
46
+</template>
47
+
48
+<script>
49
+
50
+export default {
51
+  name: '',
52
+  data () {
53
+    return {
54
+      total: 0,
55
+      postData: { // 表格搜索条件
56
+        caseid: this.$route.query.id, // 案场名称
57
+        page: 1, // 当前页码
58
+        pagesize: 10, // 请求数据量
59
+      },
60
+      currentList: [],
61
+      typeList: [],
62
+    }
63
+  },
64
+  created () {
65
+    this.getUserTypeList().then(() => {
66
+      this.getList()
67
+    })
68
+  },
69
+  methods: {
70
+    getUserTypeList () { // 获取用户类型
71
+      return new Promise((resolve) => {
72
+        this.$ajax(this.$api.caseManager.getUserTypeList.url, {
73
+          method: this.$api.caseManager.getUserTypeList.method,
74
+        }).then(res => {
75
+          this.typeList = res
76
+          resolve()
77
+        })
78
+      })
79
+    },
80
+    addPPLConcerned () { // 添加相关人员
81
+      this.$router.push({ name: 'editPPLConcerned', query: { id: this.$route.query.id } })
82
+    },
83
+    getList () { // 获取列表
84
+      this.$ajax(this.$api.caseManager.getCaseUserList.url, {
85
+        method: this.$api.caseManager.getCaseUserList.method,
86
+        queryData: this.postData
87
+      }).then(res => {
88
+        for (var n = 0; n < res.list.length; n++) {
89
+          res.list[n].UserType = this.typeList.filter(x => x.TypeId === res.list[n].UserType)[0].TypeName
90
+        }
91
+        this.currentList = res.list
92
+        this.postData.page = res.page
93
+        this.total = res.pagenum
94
+      })
95
+    },
96
+    handleCurrentChange (val) { // 跳转到分页
97
+      this.getList()
98
+    },
99
+    editItem (index, row) { // 修改
100
+      this.$router.push({ name: 'editPPLConcerned', query: { id: this.$route.query.id, userid: row.CaseUserId } })
101
+    },
102
+    searchList (key) { // 搜索列表
103
+      this.postData.name = key
104
+      this.currentList = []
105
+      this.postData.page = 1
106
+      this.getList()
107
+    }
108
+  }
109
+}
110
+</script>
111
+
112
+<!-- Add "scoped" attribute to limit CSS to this component only -->
113
+<style lang="scss" scoped>
114
+@import "page.scss";
115
+</style>

+ 36
- 0
src/pages/system/caseManager/caseInfo/pplConcerned/page.scss View File

@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+

+ 12
- 0
src/pages/system/page.js View File

@@ -12,6 +12,8 @@ import caseManager from './caseManager/index' // 案场管理
12 12
 import caseInfo from './caseManager/caseInfo/index' // 案场信息
13 13
 import addCase from './caseManager/caseInfo/addCase/index' // 新增案场
14 14
 import editCase from './caseManager/caseInfo/editCase/index' // 新增案场
15
+import pplConcerned from './caseManager/caseInfo/pplConcerned/index' // 相关人员
16
+import editPPLConcerned from './caseManager/caseInfo/pplConcerned/editPPLConcerned/index' // 编辑相关人员
15 17
 import keyManager from './caseManager/keyManager/index' // 钥匙管理
16 18
 import addKey from './caseManager/keyManager/add' // 新增钥匙
17 19
 import caseAreaManager from './caseManager/caseAreaManager/index' // 案场区域管理
@@ -116,6 +118,16 @@ export default {
116 118
             name: 'editCase',
117 119
             component: editCase,
118 120
             children: []
121
+          }, { // 相关人员
122
+            path: 'pplConcerned',
123
+            name: 'pplConcerned',
124
+            component: pplConcerned,
125
+            children: [{ // 编辑相关人员
126
+              path: 'editPPLConcerned',
127
+              name: 'editPPLConcerned',
128
+              component: editPPLConcerned,
129
+              children: []
130
+            }]
119 131
           }]
120 132
         }, { // 钥匙管理
121 133
           path: 'keyManager',

+ 16
- 0
src/util/api.js View File

@@ -72,6 +72,22 @@ const $api = {
72 72
       method: 'put',
73 73
       url: `${baseUrl}${common}/case/info/:id`
74 74
     },
75
+    getCaseUserList: { // 获取案场相关人员列表
76
+      method: 'get',
77
+      url: `${baseUrl}${common}/case/user`
78
+    },
79
+    getCaseUserInfo: { // 获取案场相关人员信息
80
+      method: 'get',
81
+      url: `${baseUrl}${common}/case/user/:id`
82
+    },
83
+    addCaseUser: { // 新增案场相关人员
84
+      method: 'post',
85
+      url: `${baseUrl}${common}/case/user`
86
+    },
87
+    editCaseUser: { // 更新案场相关人员
88
+      method: 'put',
89
+      url: `${baseUrl}${common}/case/user`
90
+    },
75 91
     getKeyList: { // 获取钥匙列表
76 92
       method: 'get',
77 93
       url: `${baseUrl}${common}/case/key`