Browse Source

bug fixed

duwendi 1 year ago
parent
commit
1141b401e2
1 changed files with 12 additions and 4 deletions
  1. 12 4
      src/pages/index/components/customer_complaint.vue

+ 12 - 4
src/pages/index/components/customer_complaint.vue

@@ -172,6 +172,7 @@ export default {
172 172
         comType: '',
173 173
         parkId: ''
174 174
       },
175
+      queryParams: {},
175 176
       formInline1: {
176 177
         parkId: '',
177 178
         time:  [date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + (date.getDate()), date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + (date.getDate())],
@@ -239,11 +240,16 @@ export default {
239 240
   mounted() {
240 241
     this.getParkDic()
241 242
     this.getKslx()
242
-    this.getTableData()
243
+    this.queryTableData()
243 244
     this.getModelDataData()
244 245
   },
245 246
   watch: {},
246 247
   methods: {
248
+    queryTableData() {
249
+      this.pageNum = 1
250
+      this.queryParams = {...this.formInline}
251
+      this.getTableData()
252
+    },
247 253
     getKslx() {
248 254
       api.getDict({dictType: 'customer_complaint'}).then(res => {
249 255
         this.complaintOptions = res.data || []
@@ -300,12 +306,14 @@ export default {
300 306
         if (valid) {
301 307
           api.khtsSave(this.formLabelAlign).then(res => {
302 308
             if (res.code === 200) {
309
+              this.$refs[formName].resetFields();
303 310
               this.dialogVisible = false
304 311
               this.$message({
305 312
                 message: '添加成功!',
306 313
                 type: 'success'
307 314
               })
308
-              this.getTableData()
315
+              this.queryTableData()
316
+              this.getModelDataData()
309 317
             }
310 318
           })
311 319
         }
@@ -337,8 +345,8 @@ export default {
337 345
       this.dialogVisible2 = false
338 346
     },
339 347
     getTableData() {
340
-      const {pageNum, pageSize} = this
341
-      api.khtsListByPage({current: pageNum, size: pageSize, ...this.formInline}).then(res => {
348
+      const {pageNum, pageSize, queryParams} = this
349
+      api.khtsListByPage({current: pageNum, size: pageSize, ...queryParams}).then(res => {
342 350
         this.tableData = res.data.records || []
343 351
         this.total = res.data.total
344 352
       })