fix:设备巡检和检定记录的修订
This commit is contained in:
parent
c60f1bc32f
commit
ffbc69ebab
|
@ -75,7 +75,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="180">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="table_record(scope.row)" v-auth="'echeckrecord.create'">
|
||||
<el-button link type="primary" @click="table_record(scope.row)" v-auth="'einspect.create'">
|
||||
巡检
|
||||
</el-button>
|
||||
<el-button link type="warning" @click="table_edit(scope.row)" v-auth="'equipment.update'">
|
||||
|
@ -97,7 +97,7 @@
|
|||
@closed="dialog.save = false"></check-dialog>
|
||||
<el-drawer title="巡检记录" v-model="visibleRecord" :size="1000" destroy-on-close @closed="visibleRecord = false">
|
||||
<el-container v-loading="loading">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'equipment'"
|
||||
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'einspect.create'"
|
||||
style="position: absolute;z-index: 10;left: 110px;top: 16px;">新增</el-button>
|
||||
<el-button type="primary" icon="el-icon-download" @click="exportExcel"
|
||||
style="position: absolute;z-index: 10;left:200px;top: 16px;">导出</el-button>
|
||||
|
@ -117,7 +117,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="160px">
|
||||
<template #default="scope">
|
||||
<el-link type="danger" @click="record_del(scope.row)" v-auth="'equipment.delete'">
|
||||
<el-link type="danger" @click="record_del(scope.row)" v-auth="'einspect.delete'">
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
|
@ -310,6 +310,17 @@ export default {
|
|||
this.$refs.saveDialog.open("show", 10).setData(row);
|
||||
});
|
||||
},
|
||||
//删除检验
|
||||
record_del(row) {
|
||||
let that = this;
|
||||
that.$API.em.einspect.delete.req(row.id).then((res) => {
|
||||
that.$message.success("删除成功");
|
||||
that.$refs.drawer_table.refresh();
|
||||
that.$refs.table.refresh();
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
table_record(row) {
|
||||
this.item = row;
|
||||
this.form.equipment = row.id;
|
||||
|
@ -325,16 +336,17 @@ export default {
|
|||
},
|
||||
//提交巡检记录
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
let that = this;
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
this.$API.em.einspect.create.req(this.form).then(res => {
|
||||
this.visible = false;
|
||||
this.isSaveing = false;
|
||||
this.$message.success("操作成功");
|
||||
this.$refs.drawer_table.refresh();
|
||||
that.isSaveing = true;
|
||||
that.$API.em.einspect.create.req(that.form).then(res => {
|
||||
that.visible = false;
|
||||
that.isSaveing = false;
|
||||
that.$message.success("操作成功");
|
||||
that.$refs.drawer_table.refresh();
|
||||
}).catch(() => {
|
||||
this.isSaveing = false;
|
||||
that.isSaveing = false;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<el-table-column label="操作" fixed="right" align="center" width="170px">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" v-if="scope.row.cycle !== null" @click="table_record(scope.row)"
|
||||
v-auth="'einspect.create'">
|
||||
v-auth="'echeckrecord.create'">
|
||||
检定记录
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'equipment.update'">
|
||||
|
@ -109,7 +109,7 @@
|
|||
</el-dialog>
|
||||
<el-drawer title="检定记录" v-model="visibleRecord" :size="1000" destroy-on-close @closed="visibleRecord = false">
|
||||
<el-container v-loading="loading">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'equipment'"
|
||||
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'echeckrecord.create'"
|
||||
style="position: absolute;z-index: 10;left: 110px;top: 16px;"></el-button>
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<scTable ref="drawer_table" :apiObj="apiObj2" row-key="id" stripe :params="query2">
|
||||
|
@ -127,7 +127,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="160px">
|
||||
<template #default="scope">
|
||||
<el-link type="danger" @click="record_del(scope.row)" v-auth="'equipment.delete'">
|
||||
<el-link type="danger" @click="record_del(scope.row)" v-auth="'echeckrecord.delete'">
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
|
@ -236,27 +236,29 @@ export default {
|
|||
},
|
||||
//提交检验
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
let that = this;
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
this.$API.em.echeckrecord.create.req(this.form).then(res => {
|
||||
this.visible = false;
|
||||
this.isSaveing = false;
|
||||
this.$message.success("操作成功");
|
||||
this.$refs.drawer_table.refresh();
|
||||
this.$refs.table.refresh();
|
||||
that.isSaveing = true;
|
||||
that.$API.em.echeckrecord.create.req(that.form).then(res => {
|
||||
that.visible = false;
|
||||
that.isSaveing = false;
|
||||
that.$message.success("操作成功");
|
||||
that.$refs.drawer_table.refresh();
|
||||
that.$refs.table.refresh();
|
||||
}).catch(() => {
|
||||
this.isSaveing = false;
|
||||
that.isSaveing = false;
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除检验
|
||||
record_del(row) {
|
||||
let that = this;
|
||||
this.$API.em.echeckrecord.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.drawer_table.refresh();
|
||||
this.$refs.table.refresh();
|
||||
that.$message.success("删除成功");
|
||||
that.$refs.drawer_table.refresh();
|
||||
that.$refs.table.refresh();
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
|
|
|
@ -732,7 +732,7 @@ export default {
|
|||
this.$API.mtm.routepack.item.req(this.projectId).then((res) => {
|
||||
console.log("routepackitem", res);
|
||||
this.$API.mtm.route.list
|
||||
.req({ page: 0, material: res.material })
|
||||
.req({ page: 0, material: res.material,routepack:res.id})
|
||||
.then((res) => {
|
||||
that.routepackes = res;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue