|
@@ -10,6 +10,9 @@
|
10
|
10
|
<el-col :span="8">
|
11
|
11
|
<el-form-item>
|
12
|
12
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
|
13
|
+ <el-form-item>
|
|
14
|
+ <el-button type="success" @click="handleAdd">添加凭证</el-button>
|
|
15
|
+ </el-form-item>
|
13
|
16
|
</el-form-item>
|
14
|
17
|
</el-col>
|
15
|
18
|
</el-row>
|
|
@@ -25,7 +28,8 @@
|
25
|
28
|
<el-table-column
|
26
|
29
|
label="操作"
|
27
|
30
|
width="100">
|
28
|
|
- <template slot-scope="scope">
|
|
31
|
+ <template slot-scope="scope" style="display: inline-block">
|
|
32
|
+ <el-button type="primary" @click="handleEdit(scope.row)" slot="reference">修改</el-button>
|
29
|
33
|
<el-popconfirm title="确定删除吗?" @confirm="deleteRow(scope.row)">
|
30
|
34
|
<el-button type="danger" slot="reference">移除</el-button>
|
31
|
35
|
</el-popconfirm>
|
|
@@ -38,18 +42,19 @@
|
38
|
42
|
</el-pagination>
|
39
|
43
|
</div>
|
40
|
44
|
<el-dialog
|
41
|
|
- title="审核"
|
42
|
|
- :visible.sync="dialogVisible"
|
43
|
|
- width="60%"
|
44
|
|
- custom-class="audit-dialog">
|
45
|
|
- <el-row class="mg-bt">
|
46
|
|
- <el-col class="label" :span="4">审核:</el-col>
|
47
|
|
- <el-col :span="18">
|
48
|
|
- <el-radio v-model="radio" label="2">通过</el-radio>
|
49
|
|
- <el-radio v-model="radio" label="3">驳回</el-radio>
|
50
|
|
- </el-col>
|
51
|
|
- </el-row>
|
52
|
|
- <span slot="footer" class="dialog-footer">
|
|
45
|
+ :title="title"
|
|
46
|
+ :visible.sync="dialogVisible"
|
|
47
|
+ width="60%"
|
|
48
|
+ custom-class="audit-dialog">
|
|
49
|
+ <el-form style="height: 100px" class="form-div" label-position="left" label-width="80px" :model="formLabelAlign">
|
|
50
|
+ <el-form-item label="凭证ID">
|
|
51
|
+ <el-input v-model="formLabelAlign.pzId"></el-input>
|
|
52
|
+ </el-form-item>
|
|
53
|
+ <el-form-item label="凭证名称">
|
|
54
|
+ <el-input v-model="formLabelAlign.pzName"></el-input>
|
|
55
|
+ </el-form-item>
|
|
56
|
+ </el-form>
|
|
57
|
+ <span slot="footer" class="dialog-footer">
|
53
|
58
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
54
|
59
|
<el-button type="primary" @click="handleConfirm">确 定</el-button>
|
55
|
60
|
</span>
|
|
@@ -63,6 +68,9 @@ export default {
|
63
|
68
|
components: {},
|
64
|
69
|
data() {
|
65
|
70
|
return {
|
|
71
|
+ formInline: {
|
|
72
|
+ credentialName: ''
|
|
73
|
+ },
|
66
|
74
|
columns: [
|
67
|
75
|
{
|
68
|
76
|
label: '凭证ID',
|
|
@@ -81,11 +89,11 @@ export default {
|
81
|
89
|
total: 0,
|
82
|
90
|
pageSize: 10,
|
83
|
91
|
pageNum: 1,
|
84
|
|
- radio: '2',
|
85
|
92
|
dialogVisible: false,
|
86
|
|
- selRow: {},
|
87
|
|
- formInline: {
|
88
|
|
- credentialName: ''
|
|
93
|
+ title: '',
|
|
94
|
+ formLabelAlign: {
|
|
95
|
+ pzId: '',
|
|
96
|
+ pzName: ''
|
89
|
97
|
}
|
90
|
98
|
}
|
91
|
99
|
},
|
|
@@ -98,59 +106,62 @@ export default {
|
98
|
106
|
indexMethod(index) {
|
99
|
107
|
return this.pageSize * (this.pageNum - 1) + index + 1
|
100
|
108
|
},
|
101
|
|
- deleteRow (record) {
|
102
|
|
- console.log(record, '11111')
|
103
|
|
- },
|
104
|
|
- handlePageChange() {
|
105
|
|
- this.getTableData()
|
106
|
|
- },
|
107
|
|
- handleAudit(row) {
|
108
|
|
- this.selRow = row
|
|
109
|
+ handleEdit(row) {
|
|
110
|
+ this.title = '修改凭证'
|
|
111
|
+ this.formLabelAlign = row
|
109
|
112
|
this.dialogVisible = true
|
110
|
113
|
},
|
111
|
|
- handleCancelApply(row) {
|
112
|
|
- console.log('enter handle cancel apply')
|
|
114
|
+ handleAdd () {
|
|
115
|
+ this.title = '添加凭证'
|
|
116
|
+ this.formLabelAlign = {}
|
|
117
|
+ this.dialogVisible = true
|
113
|
118
|
},
|
114
|
|
- handleConfirm() {
|
115
|
|
- const {id} = this.selRow
|
116
|
|
- console.log('radio', this.radio)
|
117
|
|
- api.applyResource({id, applyType: this.radio}).then(res => {
|
118
|
|
- if(res.success) {
|
119
|
|
- this.dialogVisible = false
|
|
119
|
+ deleteRow (record) {
|
|
120
|
+ api.deletePz({id: record.id}).then(res => {
|
|
121
|
+ if (res.code === 200) {
|
120
|
122
|
this.$message({
|
121
|
|
- message: '审核成功!',
|
|
123
|
+ message: '删除成功!',
|
122
|
124
|
type: 'success'
|
123
|
125
|
})
|
124
|
126
|
this.getTableData()
|
125
|
127
|
}
|
126
|
128
|
})
|
127
|
129
|
},
|
128
|
|
- getTableData() {
|
129
|
|
- const {pageNum, pageSize, searchWords} = this
|
130
|
|
- api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
|
131
|
|
- this.tableData = []
|
132
|
|
- res.data.records.map((item, index) => {
|
133
|
|
- const newItem = {...item}
|
134
|
|
- newItem.applyTypeText = this.getApplyTypeText(item.applyType)
|
135
|
|
- this.tableData.push(newItem)
|
136
|
|
- })
|
137
|
|
- this.total = res.data.total
|
138
|
|
- })
|
|
130
|
+ handlePageChange() {
|
|
131
|
+ this.getTableData()
|
139
|
132
|
},
|
140
|
|
- getApplyTypeText(val) {
|
141
|
|
- if (!val){
|
142
|
|
- return '未申请'
|
143
|
|
- }
|
144
|
|
- const textMap = {
|
145
|
|
- 1: '待审批',
|
146
|
|
- 2: '审批通过',
|
147
|
|
- 3: '审批驳回'
|
|
133
|
+ handleConfirm() {
|
|
134
|
+ if (this.title === '修改凭证') {
|
|
135
|
+ let params = {...formLabelAlign}
|
|
136
|
+ api.addPz().then(res => {
|
|
137
|
+ if(res.code === 200) {
|
|
138
|
+ this.dialogVisible = false
|
|
139
|
+ this.$message({
|
|
140
|
+ message: '修改成功!',
|
|
141
|
+ type: 'success'
|
|
142
|
+ })
|
|
143
|
+ this.getTableData()
|
|
144
|
+ }
|
|
145
|
+ })
|
|
146
|
+ } else {
|
|
147
|
+ api.addPz({ipAddr: this.formLabelAlign.ipAddr}).then(res => {
|
|
148
|
+ if(res.code === 200) {
|
|
149
|
+ this.dialogVisible = false
|
|
150
|
+ this.$message({
|
|
151
|
+ message: '添加成功!',
|
|
152
|
+ type: 'success'
|
|
153
|
+ })
|
|
154
|
+ this.getTableData()
|
|
155
|
+ }
|
|
156
|
+ })
|
148
|
157
|
}
|
149
|
|
- return textMap[val]
|
150
|
158
|
},
|
151
|
|
- handleSearch() {
|
152
|
|
- this.pageNum = 1
|
153
|
|
- this.getTableData()
|
|
159
|
+ getTableData() {
|
|
160
|
+ const {pageNum, pageSize} = this
|
|
161
|
+ api.pzglListByPage({pageNum, pageSize, credentialName: this.formInline.credentialName}).then(res => {
|
|
162
|
+ this.tableData = res.data.records || []
|
|
163
|
+ this.total = res.data.total
|
|
164
|
+ })
|
154
|
165
|
}
|
155
|
166
|
}
|
156
|
167
|
}
|
|
@@ -193,6 +204,7 @@ export default {
|
193
|
204
|
width: 100px;
|
194
|
205
|
height: 40px;
|
195
|
206
|
}
|
|
207
|
+
|
196
|
208
|
.body-wrapper {
|
197
|
209
|
padding: 20px;
|
198
|
210
|
background: #0c0c0c;
|
|
@@ -207,16 +219,24 @@ export default {
|
207
|
219
|
margin-bottom: 20px;
|
208
|
220
|
text-align: center;
|
209
|
221
|
.input-wrapper{
|
210
|
|
- width: 36%;
|
|
222
|
+ width: 36%;
|
211
|
223
|
}
|
212
|
224
|
}
|
213
|
225
|
}
|
214
|
226
|
.audit-dialog{
|
215
|
|
- .mg-bt{
|
216
|
|
- margin-bottom: 24px;
|
217
|
|
- }
|
218
|
|
- .label{
|
219
|
|
- text-align: right;
|
|
227
|
+ .mg-bt{
|
|
228
|
+ margin-bottom: 24px;
|
|
229
|
+ }
|
|
230
|
+ .label{
|
|
231
|
+ text-align: right;
|
|
232
|
+ }
|
|
233
|
+ .form-div{
|
|
234
|
+ /deep/ .el-input__inner{
|
|
235
|
+ height: 35px;
|
|
236
|
+ width: 90%;
|
|
237
|
+ border: 1px solid #a6a5a5;
|
|
238
|
+ color: #fff;
|
220
|
239
|
}
|
|
240
|
+ }
|
221
|
241
|
}
|
222
|
242
|
</style>
|