diff --git a/src/api/admin/repair.js b/src/api/admin/repair.js index 62427a4..3070535 100644 --- a/src/api/admin/repair.js +++ b/src/api/admin/repair.js @@ -45,6 +45,22 @@ export function review(parameter, uniqueArr) { }) } +// 重新派单处理流程 +export function handleFlow(repair, content, operate) { + return axios({ + url: api.repair + '/flow/handle', + method: 'post', + data: { + 'repair': repair, + 'content': content, + 'operate': operate + }, + headers: { + 'Content-Type': 'application/json;charset=UTF-8' + } + }) +} + export function complete(parameter) { return axios({ url: api.repair + '/complete', diff --git a/src/views/admin/RepairList.vue b/src/views/admin/RepairList.vue index 86e02a0..e279b81 100644 --- a/src/views/admin/RepairList.vue +++ b/src/views/admin/RepairList.vue @@ -123,15 +123,14 @@ 详情 - - + 重新派单 + 删除 - - +
@@ -153,6 +152,7 @@ import { STable } from '@/components' import { getRepairList, complete, delRepair } from '@/api/admin/repair' import { oneWorkerList, oneFloorList, oneFloorCreateList } from '@/api/admin/repair/repairStats' import RepairModal from './modules/RepairModal.vue' +import AgainModal from './modules/AgainModal.vue' import { checkPermission } from '@/utils/permissions' import { getRepairDeviceList } from '@/api/admin/repair/repairDevice' import { getRepairTypeList } from '@/api/admin/repair/repairDeviceType' @@ -166,7 +166,8 @@ export default { name: 'TableList', components: { STable, - RepairModal + RepairModal, + AgainModal }, data() { return { @@ -622,30 +623,30 @@ export default { this.dateRange[1].format('YYYY-MM-DD') ]; } - + const filterConditions = { queryParam: JSON.parse(JSON.stringify(this.queryParam)), // 深拷贝查询参数 dateRange: formattedDateRange, typeId: this.queryParam.typeId || '', deviceId: this.queryParam.deviceId || '' } - + // 保存到localStorage localStorage.setItem('repairListFilterConditions', JSON.stringify(filterConditions)) }, - + // 从localStorage恢复筛选条件 restoreFilterConditions() { const savedConditions = localStorage.getItem('repairListFilterConditions') if (savedConditions) { try { const conditions = JSON.parse(savedConditions) - + // 恢复查询参数 if (conditions.queryParam) { this.queryParam = conditions.queryParam } - + // 恢复日期范围 if (conditions.dateRange && conditions.dateRange.length === 2) { this.dateRange = [ @@ -655,12 +656,12 @@ export default { this.queryParam.startTime = conditions.dateRange[0] this.queryParam.endTime = conditions.dateRange[1] } - + // 恢复设备类型及子类 if (conditions.typeId) { // 先加载设备类型 this.selectDevice(conditions.typeId) - + // 确保设备子类被正确设置 if (conditions.deviceId) { this.$nextTick(() => { @@ -668,7 +669,7 @@ export default { }) } } - + // 刷新表格 this.$nextTick(() => { if (this.$refs.table) { @@ -694,15 +695,15 @@ export default { // 检查其他参数是否有值 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('筛选条件已保存,下次访问将自动应用') @@ -716,7 +717,7 @@ export default { try { // 清除localStorage中保存的筛选条件 localStorage.removeItem('repairListFilterConditions') - + // 重置查询参数 this.queryParam = { 'type': 'all', @@ -733,17 +734,17 @@ export default { 'remark': '', 'name': '' } - + // 重置时间范围 this.dateRange = [] - + // 刷新列表数据 this.$nextTick(() => { if (this.$refs.table) { this.$refs.table.refresh(true) } }) - + this.$message.success('筛选条件已清除,列表已重置') } catch (e) { console.error('清除筛选条件失败', e) @@ -763,10 +764,10 @@ export default { // 检查其他参数是否有值 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() @@ -775,9 +776,12 @@ export default { } catch (e) { console.error('自动保存筛选条件失败', e) } - + // 然后刷新表格 this.$refs.table.refresh(true) + }, + handleAgain(repairId) { + this.$refs.againModal.show(repairId) } }, watch: {} diff --git a/src/views/admin/modules/AgainModal.vue b/src/views/admin/modules/AgainModal.vue new file mode 100644 index 0000000..377573c --- /dev/null +++ b/src/views/admin/modules/AgainModal.vue @@ -0,0 +1,175 @@ + + + + + \ No newline at end of file