This commit is contained in:
parent
e97b14446a
commit
912d0fb4f7
|
|
@ -234,8 +234,21 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.visible = true
|
||||
this.getItemList()
|
||||
this.visible = true;
|
||||
// 1. 清空选中项数组(关键)
|
||||
this.selectedItems = [];
|
||||
this.allSelectedItems = [];
|
||||
// 2. 强制清空表格DOM层面的选中状态(解决reserve-selection残留)
|
||||
if (this.$refs.itemTable) {
|
||||
this.$refs.itemTable.clearSelection();
|
||||
}
|
||||
// 3. 重置页码并重新获取列表(确保每次打开都是第一页)
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getItemList();
|
||||
// 4. 强制更新表格,重新计算selectable状态
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.itemTable) this.$refs.itemTable.$forceUpdate();
|
||||
});
|
||||
},
|
||||
|
||||
async getItemList() {
|
||||
|
|
@ -281,6 +294,7 @@ export default {
|
|||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
this.selectedItems=[]
|
||||
this.getItemList()
|
||||
},
|
||||
selectable(row) {
|
||||
|
|
@ -333,6 +347,11 @@ export default {
|
|||
onClose() {
|
||||
this.selectedItems = []
|
||||
this.allSelectedItems = []
|
||||
// 1. 重置查询参数(复用重置方法)
|
||||
this.onHandleReset()
|
||||
// 2. 清空弹窗显示状态
|
||||
this.visible = false
|
||||
|
||||
},
|
||||
|
||||
// 新增:装备分类选择变化
|
||||
|
|
|
|||
|
|
@ -120,9 +120,9 @@ export default {
|
|||
console.log('🚀 ~ this.queryParams.dateRange:', this.queryParams.dateRange)
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
startDate: this.queryParams.dateRange ? this.queryParams.dateRange[0] : undefined,
|
||||
endDate: this.queryParams.dateRange ? this.queryParams.dateRange[1] : undefined,
|
||||
dateRange: undefined
|
||||
startTime: this.queryParams.dateRange ? this.queryParams.dateRange[0] : '',
|
||||
endTime: this.queryParams.dateRange ? this.queryParams.dateRange[1] : '',
|
||||
dateRange: ''
|
||||
}
|
||||
const res = await getRetireApplyListAPI(params)
|
||||
this.tableData = res.rows || []
|
||||
|
|
@ -244,7 +244,7 @@ export default {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
::v-deep .el-card__body {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<el-form-item label="操作时间" style="margin-left: 10px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="datetimerange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
|
|
@ -99,8 +99,9 @@
|
|||
<!-- 出库记录单 -->
|
||||
<el-dialog title="维修记录单" :visible.sync="outRecordVisible" width="80%" append-to-body>
|
||||
<el-row style="display: flex; justify-content: flex-end; gap: 8px;">
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载PDF</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>
|
||||
<!-- 下载PDF-->
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载</el-button>
|
||||
<!-- <el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>-->
|
||||
<el-button size="mini" type="primary" @click="onHandlePrint">打印</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleClose">关闭</el-button>
|
||||
</el-row>
|
||||
|
|
@ -131,16 +132,16 @@
|
|||
<tr>
|
||||
<th style="width: 100px;">序号</th>
|
||||
<th>类型</th>
|
||||
<th>装备名称</th>
|
||||
<th>设备名称</th>
|
||||
<th>规格型号</th>
|
||||
<th>装备编码</th>
|
||||
<th>设备编码</th>
|
||||
<th>数量</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, index) in outRecordData" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td> {{ item.type === '1' ? '工具' : (item.type === '2' ? '装备' : '未知类型') }}</td>
|
||||
<td> {{ item.type === '2' ? '工具' : (item.type === '1' ? '装备' : '未知类型') }}</td>
|
||||
<td>{{ item.devName }}</td>
|
||||
<td>{{ item.devModel }}</td>
|
||||
<td>{{ item.devCode }}</td>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<el-form-item label="操作时间" style="margin-left: 10px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="datetimerange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
|
|
@ -104,8 +104,9 @@
|
|||
<!-- 出库记录单 -->
|
||||
<el-dialog title="出库记录单" :visible.sync="outRecordVisible" width="80%" append-to-body>
|
||||
<el-row style="display: flex; justify-content: flex-end; gap: 8px;">
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载PDF</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>
|
||||
<!-- 下载PDF-->
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载</el-button>
|
||||
<!-- <el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>-->
|
||||
<el-button size="mini" type="primary" @click="onHandlePrint">打印</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleClose">关闭</el-button>
|
||||
</el-row>
|
||||
|
|
@ -134,9 +135,9 @@
|
|||
<tr>
|
||||
<th style="width: 100px;">序号</th>
|
||||
<th>类型</th>
|
||||
<th>装备名称</th>
|
||||
<th>设备名称</th>
|
||||
<th>规格型号</th>
|
||||
<th>装备编码</th>
|
||||
<th>设备编码</th>
|
||||
<th>数量</th>
|
||||
<th>使用到期时间</th>
|
||||
</tr>
|
||||
|
|
@ -144,7 +145,7 @@
|
|||
<tbody>
|
||||
<tr v-for="(item, index) in outRecordData" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td> {{ item.type === '1' ? '工具' : (item.type === '2' ? '装备' : '未知类型') }}</td>
|
||||
<td> {{ item.type === '2' ? '工具' : (item.type === '1' ? '装备' : '未知类型') }}</td>
|
||||
<td>{{ item.devName }}</td>
|
||||
<td>{{ item.devModel }}</td>
|
||||
<td>{{ item.devCode }}</td>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<el-form-item label="操作时间" style="margin-left: 10px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="datetimerange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
<!-- }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" show-overflow-tooltip prop="devNum" label="装备数量"/>
|
||||
<el-table-column align="center" show-overflow-tooltip prop="devNum" label="数量"/>
|
||||
<el-table-column align="center" show-overflow-tooltip prop="address" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="onHandleOutRecord(scope.row)">
|
||||
|
|
@ -107,8 +107,9 @@
|
|||
<!-- 出库记录单 -->
|
||||
<el-dialog title="退役记录单" :visible.sync="outRecordVisible" width="80%" append-to-body>
|
||||
<el-row style="display: flex; justify-content: flex-end; gap: 8px;">
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载PDF</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>
|
||||
<!-- 下载PDF-->
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载</el-button>
|
||||
<!-- <el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>-->
|
||||
<el-button size="mini" type="primary" @click="onHandlePrint">打印</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleClose">关闭</el-button>
|
||||
</el-row>
|
||||
|
|
@ -137,9 +138,9 @@
|
|||
<tr>
|
||||
<th style="width: 100px;">序号</th>
|
||||
<th>类型</th>
|
||||
<th>装备名称</th>
|
||||
<th>设备名称</th>
|
||||
<th>规格型号</th>
|
||||
<th>装备编码</th>
|
||||
<th>设备编码</th>
|
||||
<th>数量</th>
|
||||
<th>最大使用年限</th>
|
||||
<th>剩余使用年限</th>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="操作时间">
|
||||
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="至" style="width: 240px"
|
||||
<el-date-picker v-model="dateRange" type="daterange" range-separator="至" style="width: 240px"
|
||||
value-format="yyyy-MM-dd" end-placeholder="结束日期" start-placeholder="开始日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -93,8 +93,9 @@
|
|||
<!-- 出库记录单 -->
|
||||
<el-dialog title="退库记录单" :visible.sync="outRecordVisible" width="80%" append-to-body>
|
||||
<el-row style="display: flex; justify-content: flex-end; gap: 8px;">
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载PDF</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>
|
||||
<!-- 下载PDF-->
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载</el-button>
|
||||
<!-- <el-button size="mini" type="primary" @click="onHandleDownload">下载</el-button>-->
|
||||
<el-button size="mini" type="primary" @click="onHandlePrint">打印</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandleClose">关闭</el-button>
|
||||
</el-row>
|
||||
|
|
@ -125,9 +126,9 @@
|
|||
<tr>
|
||||
<th style="width: 100px;">序号</th>
|
||||
<th>类型</th>
|
||||
<th>装备名称</th>
|
||||
<th>设备名称</th>
|
||||
<th>规格型号</th>
|
||||
<th>装备编码</th>
|
||||
<th>设备编码</th>
|
||||
<th>数量</th>
|
||||
<th>使用到期时间</th>
|
||||
</tr>
|
||||
|
|
@ -135,7 +136,7 @@
|
|||
<tbody>
|
||||
<tr v-for="(item, index) in outRecordData" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td> {{ item.type === '1' ? '工具' : (item.type === '2' ? '装备' : '未知类型') }}</td>
|
||||
<td> {{ item.type === '2' ? '工具' : (item.type === '1' ? '装备' : '未知类型') }}</td>
|
||||
<td>{{ item.devName }}</td>
|
||||
<td>{{ item.devModel }}</td>
|
||||
<td>{{ item.devCode }}</td>
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
destroy-on-close
|
||||
@close="onClose"
|
||||
>
|
||||
<!-- 新增质检表单 -->
|
||||
<!-- 新增维保维保表单 -->
|
||||
<template v-if="dialogTitle === '维保操作'">
|
||||
<el-form
|
||||
v-if="addOrEditDialogVisible"
|
||||
|
|
@ -221,7 +221,7 @@
|
|||
</el-form>
|
||||
</template>
|
||||
|
||||
<!-- 质检记录详情 -->
|
||||
<!-- 维保记录详情 -->
|
||||
<template v-if="dialogTitle === '维保记录'">
|
||||
<el-row style="padding-bottom: 20px">
|
||||
<el-col :span="6">
|
||||
|
|
@ -475,8 +475,8 @@ export default {
|
|||
addOrEditFormRules() {
|
||||
return {
|
||||
maId: [{ required: true, message: '请选择关联装备', trigger: 'change' }],
|
||||
nextCheckTime: [{ required: true, message: '请输入下次质检日期', trigger: 'blur' }],
|
||||
qcUser: [{ required: true, message: '请输入质检员', trigger: 'change' }],
|
||||
nextCheckTime: [{ required: true, message: '请输入下次维保日期', trigger: 'blur' }],
|
||||
qcUser: [{ required: true, message: '请输入维保员', trigger: 'change' }],
|
||||
phonenumber: [
|
||||
{ required: true, message: '请输入联系电话', trigger: 'blur' },
|
||||
{
|
||||
|
|
@ -485,8 +485,8 @@ export default {
|
|||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
qcTime: [{ required: true, message: '请选择质检日期', trigger: 'change' }],
|
||||
fileInfoList: [{ required: true, message: '请上传质检附件', trigger: 'blur' }]
|
||||
qcTime: [{ required: true, message: '请选择维保日期', trigger: 'change' }],
|
||||
fileInfoList: [{ required: true, message: '请上传维保附件', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -535,7 +535,7 @@ export default {
|
|||
this.total = res.data.total
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('获取质检列表失败:', error)
|
||||
console.error('获取维保列表失败:', error)
|
||||
this.$message.error('获取数据失败,请重试')
|
||||
}
|
||||
},
|
||||
|
|
@ -636,7 +636,7 @@ export default {
|
|||
this.qualityDetailsList = res.rows
|
||||
this.totalInDialog = res.total
|
||||
} catch (error) {
|
||||
console.error('获取质检详情失败:', error)
|
||||
console.error('获取维保详情失败:', error)
|
||||
this.$message.error('获取详情数据失败,请重试')
|
||||
}
|
||||
},
|
||||
|
|
@ -659,7 +659,7 @@ export default {
|
|||
this.getLeaseListDataInDialog()
|
||||
},
|
||||
|
||||
// 删除质检记录
|
||||
// 删除维保记录
|
||||
async onDelete(row) {
|
||||
try {
|
||||
const res = await qualityDeleteByIdApi({
|
||||
|
|
@ -674,7 +674,7 @@ export default {
|
|||
this.$message.error(res.msg || '删除失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('删除质检记录失败:', error)
|
||||
console.error('删除维保记录失败:', error)
|
||||
// this.$message.error('删除失败,请重试')
|
||||
}
|
||||
},
|
||||
|
|
@ -693,7 +693,7 @@ export default {
|
|||
this.$message.error(res.msg || '提交失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交质检数据失败:', error)
|
||||
console.error('提交维保数据失败:', error)
|
||||
this.$message.error('提交失败,请重试')
|
||||
}
|
||||
}
|
||||
|
|
@ -778,7 +778,7 @@ export default {
|
|||
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,已自动忽略多余文件。`)
|
||||
},
|
||||
|
||||
// 质检日期变化时自动计算下次质检日期
|
||||
// 维保日期变化时自动计算下次维保日期
|
||||
onQcChange(value) {
|
||||
if (!value || !this.warningDays) return
|
||||
const currentDate = new Date(value)
|
||||
|
|
|
|||
|
|
@ -475,6 +475,7 @@ export default {
|
|||
|
||||
// 弹窗关闭事件
|
||||
handleClose() {
|
||||
this.resetQuery()
|
||||
this.selectedMap.clear()
|
||||
this.visible = false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue