This commit is contained in:
helloDy
2023-11-16 21:07:21 +08:00
parent 25d1ac8d90
commit 34e6a73852
16 changed files with 115 additions and 71 deletions

View File

@@ -49,7 +49,8 @@
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择巡检配置">
placeholder="请选择巡检配置"
@change="setInspectionContet">
<el-option
v-for="dict in configList"
:key="dict.id"
@@ -107,20 +108,15 @@
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<!-- <attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:config-id="dataForm.id"
@refreshDataList="getList" /> -->
</el-drawer>
</template>
<script>
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
import { createCheckLog, updateCheckLog, getcheckAllList, getcheckConfigByEqList, getEqCheckLog } from '@/api/equipment/base/inspection/record'
import { createCheckLog, updateCheckLog, getcheckConfigByEqList, getEqCheckLog } from '@/api/equipment/base/inspection/record'
import { getEquipmentAll } from '@/api/base/equipment'
import Editor from "@/components/Editor";
import { getCheckDetPage } from "@/api/equipment/base/inspection/settings";
// import FileUpload from "@/components/FileUpload";
// import { parseTime } from '../../../../core/mixins/code-filter';
// import attrAdd from './attr-add';
@@ -176,7 +172,8 @@ export default {
equipmentId: undefined,
actualTime: undefined,
responsible: undefined,
description: undefined
description: undefined,
files: []
},
list: [],
eqList: [],
@@ -224,8 +221,20 @@ export default {
resetFields(args) {
return this.$refs.dataForm.resetFields(args);
},
initData() {
this.dataForm = {
id: undefined,
configId: undefined,
equipmentId: undefined,
actualTime: undefined,
responsible: undefined,
description: undefined,
files: []
}
this.list = []
},
init(id, isdetail) {
// this.initData();
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
@@ -247,39 +256,12 @@ export default {
});
this.formLoading = false
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定要删除名称为${raw.data.sparePartName}的数据?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteConfigDet(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
// 获取巡检内容分页
getcheckAllList({
...this.listQuery,
configId: this.dataForm.id,
setInspectionContet() {
// 根据巡检配置名称获得巡检配置详细对应巡检内容
getCheckDetPage({
pageNo: 1,
pageSize: 99,
configId: this.dataForm.configId,
}).then((response) => {
this.list = response.data.list;
this.listQuery.total = response.data.total;
@@ -308,6 +290,8 @@ export default {
})
})
this.dataForm.files = arry
} else {
this.dataForm.files = []
}
// 修改的提交

View File

@@ -57,7 +57,7 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addRecord from './addRecord.vue';
import { exportCheckLogExcel } from '@/api/equipment/base/inspection/record'
import { exportCheckLogExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
import { parseTime } from '../../../../core/mixins/code-filter';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@@ -349,9 +349,9 @@ export default {
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除记录"' + row.name + '"?')
.confirm('是否删除设备巡检记录配置名称为"' + row.configName + '"的数据项?')
.then(function () {
return this.delete({ id });
return deleteEqCheckLog(id);
})
.then(() => {
this.getList();