index.vue
10.9 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
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!--档案到期鉴定-->
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="3" :xs="24">
<div class="head-container">
<el-tree
:data="options"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
:default-expand-all=true
node-key="id"
ref="tree"
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col :span="20" :xs="24" >
<el-tabs type="border-card" value="0" @tab-click="clickTab">
<el-tab-pane label="到期档案" name="0" ></el-tab-pane>
<el-tab-pane label="审批结果" name="1" ></el-tab-pane>
<el-row :gutter="10" class="mb8" v-if="examineState==0">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="multiple"
@click="apply"
v-hasPermi="['server:expiration:add']"
>提交审批</el-button>
</el-col>
</el-row>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" v-if="examineState==1">
<el-form-item label="选择类型" prop="workType">
<el-select v-model="queryParams.expirationType" placeholder="请选择" clearable >
<el-option
v-for="dict in dict.type.expirationType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="审批单号" prop="expirationNo">
<el-input v-model="queryParams.expirationNo" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button type="primary" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" size="mini" @click="yb">延保</el-button>
<el-button type="primary" size="mini" @click="xh">销毁</el-button>
<el-button type="primary" size="mini" @click="yj">移交</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="审批号" align="center" prop="expirationNo" show-overflow-tooltip v-if="examineState==1"/>
<el-table-column label="申请人" align="center" prop="applicant" v-if="examineState==1"/>
<el-table-column label="全宗号" align="center" prop="general" />
<el-table-column label="年度" align="center" prop="year" />
<el-table-column label="题名" align="center" prop="title" />
<el-table-column label="分类号" align="center" prop="sort" />
<el-table-column label="保管期限" align="center" prop="safekeepingDate" show-overflow-tooltip />
<el-table-column label="密级" align="center" prop="secretLevel" />
<el-table-column label="页数" align="center" prop="pages" />
<el-table-column label="归档份数" align="center" prop="filingNumber" />
<el-table-column label="在库份数" align="center" prop="zkNumber" />
<el-table-column label="库位码" align="center" prop="locationCode" />
<el-table-column label="归档部门" align="center" prop="filingDept" />
<el-table-column label="档号" align="center" prop="archivalCode" />
<el-table-column label="责任者" align="center" prop="responsibilityName" />
<!-- <el-table-column label="审批号" align="center" prop="expirationNo" show-overflow-tooltip v-if="examineState==1"/>
<el-table-column label="申请人" align="center" prop="applicant" v-if="examineState==1"/>
<el-table-column label="全宗号" align="center" prop="general" />
<el-table-column label="年度" align="center" prop="year" />
<el-table-column label="案卷号" align="center" prop="volumeMark" />
<el-table-column label="题名" align="center" prop="title" />
<el-table-column label="保管期限" align="center" prop="safekeepingDate" show-overflow-tooltip />
<el-table-column label="立卷人" align="center" prop="vlimeName" />
<el-table-column label="立卷单位" align="center" prop="vlimeDept" />
<el-table-column label="立卷时间" align="center" prop="vlimDate" />
<el-table-column label="到期时间" align="center" prop="expireDate" />
<el-table-column label="库位码" align="center" prop="locationCode" />
<el-table-column label="密级" align="center" prop="secretLevel" />
<el-table-column label="归档部门" align="center" prop="filingDept" />-->
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
</el-tabs>
</el-col>
</el-row>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-form-item label="处理方式" prop="expirationType">
<el-select v-model="form.expirationType" placeholder="处理方式" >
<el-option
v-for="dict in dict.type.expirationType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getDepots} from "@/api/service/depot";
import {treeselect} from "@/api/archives/dept";
import {listPost, apply, yb, xh, yj} from "@/api/service/expiration";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {delPost} from "@/api/service/inventory";
export default {
dicts: ['expirationType'],
components: { Treeselect },
data() {
return {
postList: null,
form: {},
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 弹出层标题
title: "",
// 部门树选项
options: undefined,
// 是否显示弹出层
open: false,
// 表单参数
defaultProps: {
children: "children",
label: "label"
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
filingDept:undefined,
examineState:0,
expirationType:undefined,
expirationNo:undefined
},
// 表单校验
rules: {
},
depotList:[],
examineState:0
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getList();
this.getTreeselect();
this.getDepots();
},
methods: {
/** 树形结构 */
getTreeselect() {
treeselect().then(response => {
this.options = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
console.log(data.id)
this.queryParams.filingDept=data.id;
this.handleQuery();
},/** 搜索按钮操作 */
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;
},
/** 分页 */
getList() {
this.queryParams.examineState=this.examineState;
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 = {
expirationType: undefined,
ids: undefined
};
this.resetForm("form");
},
/** 提交申请 */
apply(row) {
const ids =row.id || this.ids;
this.$modal.confirm('是否确认提交数据?').then(function() {
return apply(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("提交成功");
}).catch(() => {});
},
/** 延保 */
yb(row) {
const ids =row.id || this.ids;
this.$modal.confirm('是否确认延保数据?').then(function() {
return yb(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("提交成功");
}).catch(() => {});
},
/** 销毁 */
xh(row) {
const ids =row.id || this.ids;
this.$modal.confirm('是否确认销毁数据?').then(function() {
return xh(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("提交成功");
}).catch(() => {});
},
/** 移交 */
yj(row) {
const ids =row.id || this.ids;
this.$modal.confirm('是否确认移交数据?').then(function() {
return yj(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("提交成功");
}).catch(() => {});
},
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
updatePost(this.form).then(response => {
this.$modal.msgSuccess("提交成功");
this.open = false;
this.getList();
});
}
});
},
/*以下为初始化数据及以下工具类--------------------------------------------------*/
/** 获取档案库列表 */
getDepots(){
getDepots().then(response=>{
this.depotList=response.depotList;
})
},
expirationTypeFormat(row, column) {
return this.selectDictLabel(this.dict.type.expirationType, row.expirationType);
},
/** 简单Tab */
clickTab(tab, event) {
this.examineState=tab.name;
this.handleQuery();
}
}
};
</script>