|
@@ -7,6 +7,16 @@
|
7
|
7
|
<el-table :data="tableData" style="background: #2a2a2a;border-color: #333;">
|
8
|
8
|
<el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
|
9
|
9
|
</el-table-column>
|
|
10
|
+ <el-table-column
|
|
11
|
+ label="操作"
|
|
12
|
+ width="200">
|
|
13
|
+ <template slot-scope="scope" style="display: inline-block">
|
|
14
|
+ <el-button type="success" @click="handleAudit(scope.row)" slot="reference">修改</el-button>
|
|
15
|
+ <el-popconfirm title="确定删除吗?" @confirm="deleteRow(scope.row)">
|
|
16
|
+ <el-button type="danger" slot="reference">删除</el-button>
|
|
17
|
+ </el-popconfirm>
|
|
18
|
+ </template>
|
|
19
|
+ </el-table-column>
|
10
|
20
|
</el-table>
|
11
|
21
|
<div class="table-pagination">
|
12
|
22
|
<el-pagination :background="false" layout="total, prev, pager, next" :total="total" @current-change="handlePageChange"
|
|
@@ -19,7 +29,6 @@
|
19
|
29
|
width="50%"
|
20
|
30
|
custom-class="audit-dialog">
|
21
|
31
|
<div style="height: 100px" class="form-div">
|
22
|
|
- <el-form label-position="left" label-width="80px" :model="formLabelAlign">
|
23
|
32
|
<el-form label-position="left" label-width="80px" :model="formLabelAlign">
|
24
|
33
|
<el-form-item label="申请名称">
|
25
|
34
|
<el-input v-model="formLabelAlign.requestTitle"></el-input>
|
|
@@ -28,17 +37,17 @@
|
28
|
37
|
<el-input v-model="formLabelAlign.supportChannel"></el-input>
|
29
|
38
|
</el-form-item>
|
30
|
39
|
</el-form>
|
31
|
|
- </el-form>
|
32
|
40
|
</div>
|
33
|
41
|
<span slot="footer" class="dialog-footer">
|
34
|
42
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
35
|
|
- <el-button type="primary" @click="handleConfirm">确 定</el-button>
|
|
43
|
+ <el-button type="success" @click="handleConfirm">确 定</el-button>
|
36
|
44
|
</span>
|
37
|
45
|
</el-dialog>
|
38
|
46
|
</div>
|
39
|
47
|
</template>
|
40
|
48
|
<script>
|
41
|
49
|
import api from "@/api/audit.js";
|
|
50
|
+import api1 from "@/api/article_z";
|
42
|
51
|
|
43
|
52
|
export default {
|
44
|
53
|
components: {},
|
|
@@ -51,7 +60,7 @@ export default {
|
51
|
60
|
},
|
52
|
61
|
{
|
53
|
62
|
label: '申请时间',
|
54
|
|
- key: 'requestTime'
|
|
63
|
+ key: 'createTime'
|
55
|
64
|
},
|
56
|
65
|
{
|
57
|
66
|
label: '支持渠道',
|
|
@@ -59,22 +68,26 @@ export default {
|
59
|
68
|
},
|
60
|
69
|
{
|
61
|
70
|
label: '受理状态',
|
62
|
|
- key: 'acceptanceStatus'
|
|
71
|
+ key: 'requestState'
|
63
|
72
|
}
|
64
|
73
|
],
|
65
|
|
- tableData: [{"requestTitle":'申请更换闸机',"requestTime":'2023-12-25 10:00:00',"supportChannel":'留言板',"acceptanceStatus":'已受理'},
|
66
|
|
- {"requestTitle":'申请路面整修',"requestTime":'2023-12-30 10:00:00',"supportChannel":'电话沟通',"acceptanceStatus":'未受理'},],
|
67
|
|
- total: 3,
|
|
74
|
+ tableData: [{"requestTitle":'申请更换闸机',"createTime":'2023-12-25 10:00:00',"supportChannel":'留言板',"requestState":'已受理'},
|
|
75
|
+ {"requestTitle":'申请路面整修',"createTime":'2023-12-30 10:00:00',"supportChannel":'电话沟通',"requestState":'未受理'},],
|
|
76
|
+ total: 0,
|
68
|
77
|
pageSize: 10,
|
69
|
78
|
pageNum: 1,
|
70
|
79
|
radio: '2',
|
71
|
80
|
dialogVisible: false,
|
72
|
|
- selRow: {},
|
|
81
|
+ // selRow: {},
|
73
|
82
|
searchWords: undefined,
|
74
|
83
|
formLabelAlign: {
|
|
84
|
+ id: '',
|
75
|
85
|
requestTitle: '',
|
76
|
|
- supportChannel: ''
|
|
86
|
+ createTime:'',
|
|
87
|
+ supportChannel: '',
|
|
88
|
+ requestState:''
|
77
|
89
|
},
|
|
90
|
+ title:'',
|
78
|
91
|
}
|
79
|
92
|
},
|
80
|
93
|
mounted() {
|
|
@@ -87,11 +100,17 @@ export default {
|
87
|
100
|
this.getTableData()
|
88
|
101
|
},
|
89
|
102
|
handleAudit(row) {
|
90
|
|
- this.selRow = row
|
|
103
|
+ this.title = '修改技术支持'
|
|
104
|
+ this.formLabelAlign= row
|
91
|
105
|
this.dialogVisible = true
|
92
|
106
|
},
|
93
|
|
- handleCancelApply(row) {
|
94
|
|
- console.log('enter handle cancel apply')
|
|
107
|
+ deleteRow (record) {
|
|
108
|
+ api1.deleteSupport_delete({id: record.id}).then(res => {
|
|
109
|
+ if (res.code === 200) {
|
|
110
|
+ this.$message({type: 'success', message: '删除成功!'})
|
|
111
|
+ this.getTableData()
|
|
112
|
+ }
|
|
113
|
+ })
|
95
|
114
|
},
|
96
|
115
|
handleAdd () {
|
97
|
116
|
this.title = '技术支持申请'
|
|
@@ -100,46 +119,48 @@ export default {
|
100
|
119
|
this.dialogVisible = true
|
101
|
120
|
},
|
102
|
121
|
handleConfirm() {
|
103
|
|
- const {id} = this.selRow
|
104
|
|
- console.log('radio', this.radio)
|
105
|
|
- api.applyResource({id, applyType: this.formLabelAlign.requestTitle}).then(res => {
|
106
|
|
- if(res.success) {
|
107
|
|
- this.dialogVisible = false
|
108
|
|
- this.$message({
|
109
|
|
- message: '审核成功!',
|
110
|
|
- type: 'success'
|
111
|
|
- })
|
112
|
|
- this.getTableData()
|
113
|
|
- }
|
114
|
|
- })
|
|
122
|
+ if (this.title === '修改技术支持') {
|
|
123
|
+ api1.addSupport_save({id: this.formLabelAlign.id, requestTitle: this.formLabelAlign.requestTitle, supportChannel: this.formLabelAlign.supportChannel}).then(res => {
|
|
124
|
+ if(res.code === 200) {
|
|
125
|
+ this.dialogVisible = false
|
|
126
|
+ this.$message({
|
|
127
|
+ message: '修改成功!',
|
|
128
|
+ type: 'success'
|
|
129
|
+ })
|
|
130
|
+ this.getTableData()
|
|
131
|
+ }
|
|
132
|
+ })
|
|
133
|
+ }else {
|
|
134
|
+ api1.addSupport_save({requestTitle: this.formLabelAlign.requestTitle, supportChannel: this.formLabelAlign.supportChannel}).then(res => {
|
|
135
|
+ if(res.code === 200) {
|
|
136
|
+ this.dialogVisible = false
|
|
137
|
+ this.$message({
|
|
138
|
+ message: '添加成功!',
|
|
139
|
+ type: 'success'
|
|
140
|
+ })
|
|
141
|
+ this.getTableData()
|
|
142
|
+ }
|
|
143
|
+ })
|
|
144
|
+ }
|
|
145
|
+
|
115
|
146
|
},
|
116
|
147
|
getTableData() {
|
117
|
|
- const {pageNum, pageSize, searchWords} = this
|
118
|
|
- api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
|
119
|
|
- this.tableData = []
|
120
|
|
- res.data.records.map((item, index) => {
|
121
|
|
- const newItem = {...item}
|
122
|
|
- newItem.applyTypeText = this.getApplyTypeText(item.applyType)
|
123
|
|
- this.tableData.push(newItem)
|
124
|
|
- })
|
|
148
|
+ const {pageNum, pageSize} = this
|
|
149
|
+ api1.getSupport_get({current: pageNum, size: pageSize,}).then(res => {
|
|
150
|
+ this.tableData = res.data.records || []
|
125
|
151
|
this.total = res.data.total
|
126
|
152
|
})
|
127
|
153
|
},
|
128
|
|
- getApplyTypeText(val) {
|
129
|
|
- if (!val){
|
130
|
|
- return '未申请'
|
131
|
|
- }
|
132
|
|
- const textMap = {
|
133
|
|
- 1: '待审批',
|
134
|
|
- 2: '审批通过',
|
135
|
|
- 3: '审批驳回'
|
136
|
|
- }
|
137
|
|
- return textMap[val]
|
138
|
|
- },
|
139
|
|
- handleSearch() {
|
140
|
|
- this.pageNum = 1
|
141
|
|
- this.getTableData()
|
142
|
|
- }
|
|
154
|
+ // getCurrentTime() {
|
|
155
|
+ // //获取当前时间并打印
|
|
156
|
+ // let yy = new Date().getFullYear();
|
|
157
|
+ // let mm = new Date().getMonth()+1;
|
|
158
|
+ // let dd = new Date().getDate();
|
|
159
|
+ // let hh = new Date().getHours();
|
|
160
|
+ // let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
|
|
161
|
+ // let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
|
|
162
|
+ // return yy+'/'+mm+'/'+dd+' '+hh+':'+mf+':'+ss;
|
|
163
|
+ // }
|
143
|
164
|
}
|
144
|
165
|
}
|
145
|
166
|
</script>
|