Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
d8b7e344bd
|
@ -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;
|
||||
});
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
v-model="form.route"
|
||||
placeholder="工艺路线"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
:disabled="mode == 'edit'"
|
||||
>
|
||||
|
@ -89,6 +90,7 @@
|
|||
v-model="form.equipment"
|
||||
placeholder="生产设备"
|
||||
clearable
|
||||
filterable
|
||||
:disabled="mode == 'edit'"
|
||||
style="width: 100%"
|
||||
>
|
||||
|
@ -97,7 +99,10 @@
|
|||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
>
|
||||
<span style="float:left">{{item.name}}</span>
|
||||
<span style="float:right">{{item.number}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -309,7 +314,7 @@ export default {
|
|||
},
|
||||
getEquipment() {
|
||||
this.$API.em.equipment.list
|
||||
.req({ page: 0, type: 10 })
|
||||
.req({ page: 0, type: 10,belong_dept:this.dept })
|
||||
.then((res) => {
|
||||
this.options = res;
|
||||
});
|
||||
|
|
|
@ -133,6 +133,28 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="破损">
|
||||
<el-input-number
|
||||
v-model="form.count_n_ps"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="countChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="其他">
|
||||
<el-input-number
|
||||
v-model="form.count_n_qt"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="countChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
|
@ -153,7 +175,21 @@ export default {
|
|||
return {
|
||||
loading: false,
|
||||
//表单数据
|
||||
form: {},
|
||||
form: {
|
||||
batch: null,
|
||||
count_real: 0,
|
||||
count_ok: 0,
|
||||
count_notok: 0,
|
||||
count_n_hs: 0,
|
||||
count_n_qp: 0,
|
||||
count_n_swen: 0,
|
||||
count_n_bb: 0,
|
||||
count_n_md: 0,
|
||||
count_n_xh: 0,
|
||||
count_n_ps: 0,
|
||||
count_n_qt: 0,
|
||||
count_n_wm: 0,
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
batch: [
|
||||
|
@ -197,6 +233,8 @@ export default {
|
|||
this.form.count_n_bb +
|
||||
this.form.count_n_md +
|
||||
this.form.count_n_xh +
|
||||
this.form.count_n_ps +
|
||||
this.form.count_n_qt +
|
||||
this.form.count_n_wm;
|
||||
this.form.count_ok = this.form.count_real - this.form.count_notok;
|
||||
},
|
||||
|
@ -214,6 +252,8 @@ export default {
|
|||
this.form.count_n_bb +
|
||||
this.form.count_n_md +
|
||||
this.form.count_n_xh +
|
||||
this.form.count_n_ps +
|
||||
this.form.count_n_qt +
|
||||
this.form.count_n_wm;
|
||||
let sum = this.form.count_ok + this.form.count_notok;
|
||||
if (sum - this.form.count_real == 0) {
|
||||
|
|
Loading…
Reference in New Issue