index.vue
6.41 KB
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
<!--我的待办-->
<template>
<div class="app-container">
<el-tabs type="border-card" value="1" @tab-click="clickTab">
<el-tab-pane label="待办列表" name="1" ></el-tab-pane>
<el-tab-pane label="已办列表" name="2" ></el-tab-pane>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="选择待办类型" prop="workType">
<el-select v-model="queryParams.workType" placeholder="请选择" clearable style="width: 240px">
<el-option
v-for="dict in dict.type.workType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="消息内容" align="center" prop="message" />
<el-table-column label="类型" align="center" prop="workType" :formatter="workTypeFormat"/>
<el-table-column label="申请时间" align="center" prop="createTime" />
<el-table-column label="申请人名称" align="center" prop="applicant" />
<el-table-column label="申请人部门" align="center" prop="dept" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['service:inventory:edit']"
>办理</el-button>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['service:inventory:edit']"
>查看审批记录</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-tabs>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-descriptions direction="vertical" :column="5" border>
<el-descriptions-item label="编号" >{{form.no}}</el-descriptions-item>
<el-descriptions-item label="名称">{{form.name}}</el-descriptions-item>
<el-descriptions-item label="目的" >{{form.purpose}}</el-descriptions-item>
<el-descriptions-item label="方式">{{form.way}}</el-descriptions-item>
<el-descriptions-item label="操作">
<el-radio-group v-model="form.examineType" :disabled="workState==2">
<el-radio
v-for="dict in dict.type.examineType"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-descriptions-item>
<el-descriptions-item label="审批意见">
<el-input type="textarea" v-model="form.mark" :disabled="workState==2"></el-input>
</el-descriptions-item>
</el-descriptions>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-if="workState!=2">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPost ,updatePost} from "@/api/service/work";
export default {
name: "work",
dicts: ['workType','examineType','sys_normal_disable'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 岗位表格数据
postList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workType:undefined,
workState:1
},
// 表单参数
form: {},
// 表单校验
rules: {
},
workState:1
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
listPost(this.queryParams).then(response => {
this.postList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
no:undefined,
name:undefined,
purpose:undefined,
way:undefined,
examineType:undefined,
mark:undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!=1
this.multiple = !selection.length
},
handleUpdate(row) {
this.reset();
this.form = row;
this.form.examineType=''+row.examineType;
this.open = true;
this.title = "办理";
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
updatePost(this.form).then(response => {
this.$modal.msgSuccess("审批成功");
this.open = false;
this.getList();
});
}
});
},
workTypeFormat(row, column) {
return this.selectDictLabel(this.dict.type.workType, row.workType);
},
clickTab(tab, event) {
this.queryParams.workState=tab.name;
this.workState=tab.name;
console.log(this.workState);
this.handleQuery();
}
}
};
</script>