20250523-修复报修服务中的工单列表

This commit is contained in:
luoyu 2025-05-23 09:37:23 +08:00
parent f0f64b9d45
commit b57bf57af5

View File

@ -82,8 +82,10 @@
</a-col>
<a-col :md='8' :sm='24'>
<span class='table-page-search-submitButtons'>
<a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
<a-button type='primary' @click='queryAndSave'>查询</a-button>
<a-button style='margin-left: 8px' @click='reset()'>重置</a-button>
<a-button style='margin-left: 8px' type='primary' @click='saveUserFilterConditions'>保存筛选条件</a-button>
<a-button style='margin-left: 8px' type='danger' @click='clearUserFilterConditions'>清除筛选条件</a-button>
<a-button style='margin-left: 8px' type='primary' @click='exportRepair()'>导出工单模版</a-button>
<a-button style='margin-left: 8px' type='primary' @click='importDataVisible()'>导入</a-button>
<a-button style='margin-left: 8px' type='primary' @click='exportRepairList()'>导出工单数据</a-button>
@ -401,30 +403,8 @@ export default {
this.selectedRows = selectedRows
},
reset() {
this.queryParam = {
'type': 'all',
'explain': '',
'sn': '',
'typeId': '',
'deviceId': '',
'status': '',
'repairLevel': '',
'beginTime': '',
'endTime': '',
'evalService': '',
'timeout': '',
'remark': '',
'name': ''
}
this.dateRange = []
// localStorage
localStorage.removeItem('repairListFilterConditions')
this.handleOk(true)
// this.queryParam = {}
// this.queryParam.typeId = ''
// this.selectRepairList()
//
this.clearUserFilterConditions()
},
customRequest(file) {
// file
@ -591,12 +571,12 @@ export default {
this.$refs.modal.add()
},
handleView(repairId) {
//
try {
this.saveFilterConditions()
} catch (e) {
console.error('保存筛选条件失败', e)
}
//
// try {
// this.saveFilterConditions()
// } catch (e) {
// console.error('', e)
// }
//
this.$router.push({ name: 'repairView', query: { repairId: repairId } })
},
@ -693,12 +673,111 @@ export default {
this.$nextTick(() => {
if (this.$refs.table) {
this.$refs.table.refresh(true)
// 使
this.$message.info('已应用保存的筛选条件')
}
})
} catch (e) {
console.error('恢复筛选条件失败:', e)
}
}
},
saveUserFilterConditions() {
//
try {
//
const hasFilter = Object.keys(this.queryParam).some(key => {
// type'all'
if (key === 'type' && this.queryParam[key] === 'all') {
return false
}
//
return this.queryParam[key] !== '' && this.queryParam[key] !== null && this.queryParam[key] !== undefined
})
//
const hasDateRange = this.dateRange && this.dateRange.length === 2
if (!hasFilter && !hasDateRange) {
this.$message.info('当前没有设置筛选条件,无需保存')
return
}
//
this.saveFilterConditions()
this.$message.success('筛选条件已保存,下次访问将自动应用')
} catch (e) {
console.error('保存筛选条件失败', e)
this.$message.error('保存筛选条件失败')
}
},
clearUserFilterConditions() {
//
try {
// localStorage
localStorage.removeItem('repairListFilterConditions')
//
this.queryParam = {
'type': 'all',
'explain': '',
'sn': '',
'typeId': '',
'deviceId': '',
'status': '',
'repairLevel': '',
'beginTime': '',
'endTime': '',
'evalService': '',
'timeout': '',
'remark': '',
'name': ''
}
//
this.dateRange = []
//
this.$nextTick(() => {
if (this.$refs.table) {
this.$refs.table.refresh(true)
}
})
this.$message.success('筛选条件已清除,列表已重置')
} catch (e) {
console.error('清除筛选条件失败', e)
this.$message.error('清除筛选条件失败')
}
},
//
queryAndSave() {
//
try {
//
const hasFilter = Object.keys(this.queryParam).some(key => {
// type'all'
if (key === 'type' && this.queryParam[key] === 'all') {
return false
}
//
return this.queryParam[key] !== '' && this.queryParam[key] !== null && this.queryParam[key] !== undefined
})
//
const hasDateRange = this.dateRange && this.dateRange.length === 2
if (hasFilter || hasDateRange) {
//
this.saveFilterConditions()
this.$message.success('筛选条件已自动保存')
}
} catch (e) {
console.error('自动保存筛选条件失败', e)
}
//
this.$refs.table.refresh(true)
}
},
watch: {}