|
@@ -0,0 +1,260 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="app-container">
|
|
3
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
4
|
+ <el-form-item prop="projectId">
|
|
5
|
+ <el-select v-model="queryType" style="width: 100px;">
|
|
6
|
+ <el-option label="项目编号" value="1"></el-option>
|
|
7
|
+ <el-option label="项目名称" value="2"></el-option>
|
|
8
|
+ </el-select>
|
|
9
|
+ <el-select v-model="queryParams.projectId" clearable filterable remote reserve-keyword placeholder="请输入关键字"
|
|
10
|
+ :remote-method="remoteMethod" :loading="loading" style="width: 300px;">
|
|
11
|
+ <el-option v-for="project in projectList" :key="project.projectId"
|
|
12
|
+ :label="project.projectNumber + '-' + project.projectName" :value="project.projectId">
|
|
13
|
+ </el-option>
|
|
14
|
+ </el-select>
|
|
15
|
+ </el-form-item>
|
|
16
|
+ <el-form-item label="核算时间" prop="checkTime">
|
|
17
|
+ <el-date-picker clearable v-model="queryParams.checkTime" type="date" value-format="yyyy-MM-dd"
|
|
18
|
+ placeholder="请选择核算时间">
|
|
19
|
+ </el-date-picker>
|
|
20
|
+ </el-form-item>
|
|
21
|
+ <el-form-item>
|
|
22
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
23
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
24
|
+ </el-form-item>
|
|
25
|
+ </el-form>
|
|
26
|
+
|
|
27
|
+ <el-row :gutter="10" class="mb8">
|
|
28
|
+ <el-col :span="1.5">
|
|
29
|
+ <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
30
|
+ v-hasPermi="['oa:check:export']">导出</el-button>
|
|
31
|
+ </el-col>
|
|
32
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
33
|
+ </el-row>
|
|
34
|
+
|
|
35
|
+ <el-table v-loading="loading" :data="checkList" @selection-change="handleSelectionChange">
|
|
36
|
+ <el-table-column type="index" label="序号" width="55" align="center" />
|
|
37
|
+ <el-table-column label="项目编号" align="center" prop="project.projectNumber" />
|
|
38
|
+ <el-table-column label="项目名称" align="center" prop="project.projectName" />
|
|
39
|
+ <el-table-column label="核算人" align="center" prop="checkUser.nickName" />
|
|
40
|
+ <el-table-column label="核算时间" align="center" prop="checkTime" width="180">
|
|
41
|
+ <template slot-scope="scope">
|
|
42
|
+ <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d}') }}</span>
|
|
43
|
+ </template>
|
|
44
|
+ </el-table-column>
|
|
45
|
+ <el-table-column label="核算说明" align="center" prop="checkComment" />
|
|
46
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
47
|
+ <template slot-scope="scope">
|
|
48
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
|
|
49
|
+ v-hasPermi="['oa:check:query']">查看</el-button>
|
|
50
|
+ </template>
|
|
51
|
+ </el-table-column>
|
|
52
|
+ </el-table>
|
|
53
|
+
|
|
54
|
+ <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
55
|
+ @pagination="getList" />
|
|
56
|
+
|
|
57
|
+ <!-- 添加或修改cmc项目核算对话框 -->
|
|
58
|
+ <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
|
|
59
|
+ <budget-adjust :taskForm="taskForm" :taskName="''"></budget-adjust>
|
|
60
|
+ </el-dialog>
|
|
61
|
+ </div>
|
|
62
|
+</template>
|
|
63
|
+
|
|
64
|
+<script>
|
|
65
|
+import { listCheck, getCheck, delCheck, addCheck, updateCheck } from "@/api/oa/budget/check";
|
|
66
|
+import { listProject } from '@/api/oa/project/project';
|
|
67
|
+import budgetAdjust from '@/views/flowable/form/budget/adjust/budgetAdjust.vue';
|
|
68
|
+
|
|
69
|
+export default {
|
|
70
|
+ name: "Check",
|
|
71
|
+ components: { budgetAdjust },
|
|
72
|
+ data() {
|
|
73
|
+ return {
|
|
74
|
+ // 遮罩层
|
|
75
|
+ loading: true,
|
|
76
|
+ // 选中数组
|
|
77
|
+ ids: [],
|
|
78
|
+ // 非单个禁用
|
|
79
|
+ single: true,
|
|
80
|
+ // 非多个禁用
|
|
81
|
+ multiple: true,
|
|
82
|
+ // 显示搜索条件
|
|
83
|
+ showSearch: true,
|
|
84
|
+ // 总条数
|
|
85
|
+ total: 0,
|
|
86
|
+ // cmc项目核算表格数据
|
|
87
|
+ checkList: [],
|
|
88
|
+ // 弹出层标题
|
|
89
|
+ title: "",
|
|
90
|
+ // 是否显示弹出层
|
|
91
|
+ open: false,
|
|
92
|
+ // 查询参数
|
|
93
|
+ queryParams: {
|
|
94
|
+ pageNum: 1,
|
|
95
|
+ pageSize: 10,
|
|
96
|
+ budgetId: null,
|
|
97
|
+ projectId: null,
|
|
98
|
+ checker: null,
|
|
99
|
+ checkTime: null,
|
|
100
|
+ checkComment: null,
|
|
101
|
+ cwUserId: null,
|
|
102
|
+ cwTime: null,
|
|
103
|
+ cwComment: null,
|
|
104
|
+ managerUserId: null,
|
|
105
|
+ managerTime: null,
|
|
106
|
+ managerComment: null,
|
|
107
|
+ zjlUserId: null,
|
|
108
|
+ zjlTime: null,
|
|
109
|
+ zjlComment: null
|
|
110
|
+ },
|
|
111
|
+ // 表单参数
|
|
112
|
+ form: {},
|
|
113
|
+ // 表单校验
|
|
114
|
+ rules: {
|
|
115
|
+ },
|
|
116
|
+ taskForm: {
|
|
117
|
+ formId: ''
|
|
118
|
+ },
|
|
119
|
+ queryType: '1',
|
|
120
|
+ projectList: [],
|
|
121
|
+ };
|
|
122
|
+ },
|
|
123
|
+ created() {
|
|
124
|
+ this.getList();
|
|
125
|
+ },
|
|
126
|
+ methods: {
|
|
127
|
+ /** 查询cmc项目核算列表 */
|
|
128
|
+ getList() {
|
|
129
|
+ this.loading = true;
|
|
130
|
+ listCheck(this.queryParams).then(response => {
|
|
131
|
+ this.checkList = response.rows;
|
|
132
|
+ this.total = response.total;
|
|
133
|
+ this.loading = false;
|
|
134
|
+ });
|
|
135
|
+ },
|
|
136
|
+ // 取消按钮
|
|
137
|
+ cancel() {
|
|
138
|
+ this.open = false;
|
|
139
|
+ this.reset();
|
|
140
|
+ },
|
|
141
|
+ // 表单重置
|
|
142
|
+ reset() {
|
|
143
|
+ this.form = {
|
|
144
|
+ checkId: null,
|
|
145
|
+ budgetId: null,
|
|
146
|
+ projectId: null,
|
|
147
|
+ checker: null,
|
|
148
|
+ checkTime: null,
|
|
149
|
+ checkComment: null,
|
|
150
|
+ cwUserId: null,
|
|
151
|
+ cwTime: null,
|
|
152
|
+ cwComment: null,
|
|
153
|
+ managerUserId: null,
|
|
154
|
+ managerTime: null,
|
|
155
|
+ managerComment: null,
|
|
156
|
+ zjlUserId: null,
|
|
157
|
+ zjlTime: null,
|
|
158
|
+ zjlComment: null
|
|
159
|
+ };
|
|
160
|
+ this.resetForm("form");
|
|
161
|
+ },
|
|
162
|
+ /** 搜索按钮操作 */
|
|
163
|
+ handleQuery() {
|
|
164
|
+ this.queryParams.pageNum = 1;
|
|
165
|
+ this.getList();
|
|
166
|
+ },
|
|
167
|
+ remoteMethod(val) {
|
|
168
|
+ let params1 = {
|
|
169
|
+ pageNum: 1,
|
|
170
|
+ pageSize: 20,
|
|
171
|
+ projectNumber: val
|
|
172
|
+ }
|
|
173
|
+ let params2 = {
|
|
174
|
+ pageNum: 1,
|
|
175
|
+ pageSize: 20,
|
|
176
|
+ projectName: val
|
|
177
|
+ }
|
|
178
|
+ let params = {};
|
|
179
|
+ if (this.queryType == '1') {
|
|
180
|
+ params = params1
|
|
181
|
+ } else {
|
|
182
|
+ params = params2
|
|
183
|
+ }
|
|
184
|
+ listProject(params).then(res => {
|
|
185
|
+ this.projectList = res.rows;
|
|
186
|
+ })
|
|
187
|
+ },
|
|
188
|
+ /** 查看按钮操作 */
|
|
189
|
+ handleView(row) {
|
|
190
|
+ this.taskForm.formId = row.checkId;
|
|
191
|
+
|
|
192
|
+ this.open = true;
|
|
193
|
+ this.title = "查看cmc项目核算";
|
|
194
|
+ },
|
|
195
|
+ /** 重置按钮操作 */
|
|
196
|
+ resetQuery() {
|
|
197
|
+ this.resetForm("queryForm");
|
|
198
|
+ this.handleQuery();
|
|
199
|
+ },
|
|
200
|
+ // 多选框选中数据
|
|
201
|
+ handleSelectionChange(selection) {
|
|
202
|
+ this.ids = selection.map(item => item.checkId)
|
|
203
|
+ this.single = selection.length !== 1
|
|
204
|
+ this.multiple = !selection.length
|
|
205
|
+ },
|
|
206
|
+ /** 新增按钮操作 */
|
|
207
|
+ handleAdd() {
|
|
208
|
+ this.reset();
|
|
209
|
+ this.open = true;
|
|
210
|
+ this.title = "添加cmc项目核算";
|
|
211
|
+ },
|
|
212
|
+ /** 修改按钮操作 */
|
|
213
|
+ handleUpdate(row) {
|
|
214
|
+ this.reset();
|
|
215
|
+ const checkId = row.checkId || this.ids
|
|
216
|
+ getCheck(checkId).then(response => {
|
|
217
|
+ this.form = response.data;
|
|
218
|
+ this.open = true;
|
|
219
|
+ this.title = "修改cmc项目核算";
|
|
220
|
+ });
|
|
221
|
+ },
|
|
222
|
+ /** 提交按钮 */
|
|
223
|
+ submitForm() {
|
|
224
|
+ this.$refs["form"].validate(valid => {
|
|
225
|
+ if (valid) {
|
|
226
|
+ if (this.form.checkId != null) {
|
|
227
|
+ updateCheck(this.form).then(response => {
|
|
228
|
+ this.$modal.msgSuccess("修改成功");
|
|
229
|
+ this.open = false;
|
|
230
|
+ this.getList();
|
|
231
|
+ });
|
|
232
|
+ } else {
|
|
233
|
+ addCheck(this.form).then(response => {
|
|
234
|
+ this.$modal.msgSuccess("新增成功");
|
|
235
|
+ this.open = false;
|
|
236
|
+ this.getList();
|
|
237
|
+ });
|
|
238
|
+ }
|
|
239
|
+ }
|
|
240
|
+ });
|
|
241
|
+ },
|
|
242
|
+ /** 删除按钮操作 */
|
|
243
|
+ handleDelete(row) {
|
|
244
|
+ const checkIds = row.checkId || this.ids;
|
|
245
|
+ this.$modal.confirm('是否确认删除cmc项目核算编号为"' + checkIds + '"的数据项?').then(function () {
|
|
246
|
+ return delCheck(checkIds);
|
|
247
|
+ }).then(() => {
|
|
248
|
+ this.getList();
|
|
249
|
+ this.$modal.msgSuccess("删除成功");
|
|
250
|
+ }).catch(() => { });
|
|
251
|
+ },
|
|
252
|
+ /** 导出按钮操作 */
|
|
253
|
+ handleExport() {
|
|
254
|
+ this.download('oa/check/export', {
|
|
255
|
+ ...this.queryParams
|
|
256
|
+ }, `check_${new Date().getTime()}.xlsx`)
|
|
257
|
+ }
|
|
258
|
+ }
|
|
259
|
+};
|
|
260
|
+</script>
|