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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
| <template>
| <div>
| <el-row>
| <el-col :span="24">
| <third-register></third-register>
| </el-col>
| </el-row>
| <el-row>
| <el-col :span="24">
| <basic-container title="待办事项">
| <Statistic></Statistic>
| </basic-container>
| </el-col>
| </el-row>
| <el-row>
| <el-col :span="16">
| <basic-container title="待办流程任务">
| <avue-crud ref="crud" :table-loading="loading" :data="todoData" :option="todoOption"
| @on-load="onLoad"
| @cell-click="cellHandle"
| :page.sync="page">
| <template #menu="{size,row,index}">
| <el-button @click="gotodo(row,index)"
| icon="el-icon-check"
| type="text"
| :size="size">执行</el-button>
| </template>
| </avue-crud>
| </basic-container>
| </el-col>
| <el-col :span="8">
| <el-row>
| <basic-container title="消息列表">
| <el-collapse v-model="logActiveNames" @change="handleChange">
| <el-collapse-item v-for="item in noticeData" :title="item.title" :name="item.id">
| <div>{{item.subtitle}}</div>
| </el-collapse-item>
| </el-collapse>
| </basic-container>
| </el-row>
|
| </el-col>
| </el-row>
| <el-dialog title="修改密码" :visible.sync="dialogFormVisible" append-to-body :close-on-press-escape="false" :before-close="Xdelhandle">
| <el-form :model="form" :rules="rules" ref="form">
| <el-form-item label="原密码" :label-width="formLabelWidth" prop="oldPassword">
| <el-input v-model="form.oldPassword" autocomplete="off"></el-input>
| </el-form-item>
| <el-form-item label="新密码" :label-width="formLabelWidth" prop="newPassword">
| <el-input v-model="form.newPassword" autocomplete="off"></el-input>
| </el-form-item>
| <el-form-item label="确认密码" :label-width="formLabelWidth" prop="newPassword1">
| <el-input v-model="form.newPassword1" autocomplete="off"></el-input>
| </el-form-item>
| </el-form>
| <div slot="footer" class="dialog-footer">
| <el-button @click="delhandle">取 消</el-button>
| <el-button type="primary" @click="addok">确 定</el-button>
| </div>
| </el-dialog>
| </div>
| </template>
|
| <script>
| import {mapGetters} from "vuex";
| import {check,updatePassword} from "@/api/system/user"
| import md5 from "js-md5";
| import {removeToken} from "@/util/auth";
| import Statistic from './Statistic.vue';
| import {validatenull} from "@/util/validate";
| import {flowCategory,flowRoute} from "@/util/flow";
| import {todoList} from "@/api/work/work";
|
| export default {
| name: "wel",
| components: {Statistic},
| data() {
| return {
| loading: false,
| page: {
| pageSize: 10,
| currentPage: 1,
| total: 0
| },
| // 代办流程任务data
| todoData: [],
| // 代办流程任务option
| todoOption: {
| addBtn: false,
| header: false,
| align: 'center',
| index: true,
| menuWidth: 80,
| editBtn: false,
| delBtn: false,
| border:true,
| column: [{
| label: '任务名称',
| prop: 'taskName',
| sortable:true,
| headerAlign:'center',
| align:'left',
| html: true,
| width:300,
| overHidden:true,
| formatter: (val) => {
| return '<a name="processname" href="javascript:;" style="color: #66b1ff;">' + val.variables.processName+'-'+val.taskName + '</a>'
| }
| },
| {
| label: '上一步处理时间',
| sortable:true,
| width:150,
| prop: 'createTime'
| },
| {
| label: '上一步操作人',
| sortable:true,
| width:120,
| prop: 'historyActivityAssigneName'
| },
| {
| label: '流程描述',
| prop: 'processDesc',
| overHidden:true,
| formatter: (val) => {
| return val.variables.processDesc
| }
| },
| {
| label: '所属流程模板',
| sortable:true,
| overHidden:true,
| prop: 'categoryName'
| }
| ]
| },
| noticeData: [{
| img: '/img/bg/vip1.png',
| title: '史蒂夫·乔布斯 关注了你',
| subtitle: '05-08 15:08',
| tag: '已经开始',
| status: 0
| }, {
| img: '/img/bg/vip2.png',
| title: '斯蒂夫·沃兹尼亚克 关注了你',
| subtitle: '05-08 15:08',
| tag: '未开始',
| status: 1
| }, {
| img: '/img/bg/vip3.png',
| title: '蒂姆·库克 关注了你',
| subtitle: '05-08 15:08',
| status: 3,
| tag: '有错误'
| }, {
| img: '/img/bg/vip4.png',
| title: '比尔·费尔南德斯 关注了你',
| subtitle: '05-08 15:08',
| status: 4,
| tag: '已完成'
| }],
| logActiveNames: ['28'],
| userarr: [],
| userid: '',
| updataArr: [],
| dialogFormVisible: false,
| form: {
| oldPassword: '',
| newPassword: '',
| newPassword1: '',
| },
| rules: {
| oldPassword: [
| {required: true, message: '请输入原密码', trigger: 'blur'}
| ],
| newPassword: [
| {required: true, message: '请输入新密码', trigger: 'blur'}
| ],
| newPassword1: [
| {required: true, message: '请输确认密码', trigger: 'blur'}
| ]
| },
| };
| },
| // 拿到userid请求接口
| created() {
| this.updataArr = JSON.parse(localStorage.getItem("updataid"))
| this.userid = this.$store.state.user.upadatastatus.user_id
| this.checkhandle()
| },
| computed: {
| ...mapGetters(["userInfo", "flowRoutes"]),
| },
| methods: {
| handleChange(val) {
| window.console.log(val);
| },
| //element组件关闭弹窗的延迟回调,这里没有用关闭弹窗的方法,因为当用户点击确认也是关闭弹窗,如果登录成功弹窗关闭后也是会清除token回到登录页
| //Xdelhandle是点击X号关闭弹唱,delhandle是点击取消关闭弹窗,在这分了两个事件
| Xdelhandle() {
| removeToken()
| this.dialogFormVisible = false
| },
| // 关闭弹窗后清除token返回到登录页面
| delhandle() {
| removeToken()
| this.dialogFormVisible = false
| },
| // 修改密码方法
| addok() {
| this.dialogFormVisible = false
| updatePassword(md5(this.form.oldPassword), this.form.newPassword, this.form.newPassword1).then(res => {
| if (res.data.code == 200) {
| this.$message({
| type: "success",
| message: "修改成功!"
| })
| }
| }).catch(res => {
| console.log(res)
| this.checkhandle()
| })
| },
| // 提醒时间请求,也需要判断是否为超管身份,超管身份不判断
| checkhandle() {
| if (this.updataArr.user_id != '0' && this.updataArr.tenant_id !== '000000') {
| check(this.userid).then(res => {
| if (res.data.data > 0) {
| this.$message({
| type: 'warning',
| message: `你还有${res.data.data}天就要修改密码了`
| })
| } else if (res.data.data == -1) {
| this.$message({
| type: "warning",
| message: "密码策略已被修改,请重新修改密码!"
| })
| setTimeout(() => {
| this.dialogFormVisible = true
| }, 1500)
| } else if (res.data.data == 0) {
| this.$message({
| type: 'success',
| message: "操作成功"
| })
| }
| }).catch(res => {
| console.log(res)
| })
| }
| },
| onLoad(page, params = {}) {
| this.loading = true;
| const query = {
| ...this.query,
| category: (params.category) ? flowCategory(params.category) : null
| };
| todoList(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => {
| const data = res.data.data;
| this.page.total = data.total;
| this.todoData = data.records;
| this.loading = false;
| }).catch(error => {
| this.$message.error(error);
| this.loading = false;
| })
| },
| cellHandle(row, column, cell, event) {
| if (column.property == 'taskName') {
| this.gotodo(row)
| }
| },
| gotodo(row, index) {
| this.$router.push({ path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/handle/${row.taskId}/${row.processInstanceId}/${row.businessId}` });
| }
| }
| };
| </script>
|
| <style>
| .el-font-size {
| font-size: 14px;
| }
|
| </style>
|
|