feat:添加fmlog和第二大类的日志填写

This commit is contained in:
shijing 2024-09-05 10:55:09 +08:00
parent 23c9d67b7a
commit 93b3a053f2
3 changed files with 120 additions and 201 deletions

View File

@ -141,9 +141,9 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="加工前不良" prop="count_n_jgqbl">
<el-form-item label="加工前不良" prop="count_pn_jgqbl">
<el-input-number
v-model="form.count_n_jgqbl"
v-model="form.count_pn_jgqbl"
:min="0"
class="width100"
controls-position="right"
@ -334,10 +334,11 @@ const defaultForm = {
mtaskb: null,
shift: null,
wm_in: null,
fmlog:null,
work_start_time:'',
work_end_time:'',
material_out:'',
count_n_jgqbl:0,
count_pn_jgqbl:0,
count_use:0,
count_real: 0,
count_ok: 0,
@ -358,7 +359,7 @@ const defaultForm = {
export default {
props: {
fmlogId: {
fmlog: {
type: String,
default: "",
},
@ -424,6 +425,9 @@ export default {
this.getMgroup();
this.getMtask();
this.getMtaskb();
console.log('this.fmlog',this.fmlog)
this.form.fmlog = this.fmlog;
console.log('this.form.fmlog',this.form.fmlog)
},
methods: {
disabledDateFn(time) {

View File

@ -1,12 +1,13 @@
<template>
<el-drawer
title="日志列表"
title="日志详情"
v-model="visible"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div>
<el-container>
<el-header style="height:100px;padding:0">
<el-card style="width: 100%" header="基本信息" shadow="never">
<el-descriptions>
<el-descriptions-item label="工艺路线">{{
@ -19,41 +20,21 @@
fmlogItem.belong_dept_name
}}</el-descriptions-item>
</el-descriptions>
<!-- <div style="padding: 5px 10px;display: flex;justify-content: end;">
<el-button
type="primary"
v-if="fmlogItem.submit_time == null&&(fmlogItem.ticket==null||fmlogItem.ticket_.state_.type==1)"
@click="mlogUpdate"
style="margin-right: 10px;"
v-auth="'mlog.update'"
>
编辑
</el-button>
<el-button
type="primary"
v-if="fmlogItem.mgroup_name!='退火'&&fmlogItem.submit_time == null"
:loading="isSaveing"
@click="mlogSubmit"
>提交</el-button
>
</div> -->
</el-card>
</el-header>
<!-- mlog -->
<el-card
style="width: 100%; margin: 1vh 0"
shadow="never"
>
<div>
<el-button
<el-main style="padding-top: 40px;position: relative;">
<el-button
type="primary"
v-if="fmlogItem.submit_time == null&&(fmlogItem.ticket==null||fmlogItem.ticket_.state_.type==1)"
style="position: absolute;top: 5px;"
v-if="fmlogItem.submit_time == null"
icon="el-icon-plus"
@click="table_add"
>新增</el-button
>
</div>
<div style="height: 4px"></div>
<scTable
stripe
ref="table"
:apiObj="apiObj"
row-key="id"
@ -61,85 +42,78 @@
:query="params"
@row-click="table_detail"
>
<el-table-column
label="#"
type="index"
width="50"
></el-table-column>
<el-table-column
label="生产设备"
prop="equipment_name"
min-width="150"
></el-table-column>
<el-table-column
label="部门/工段"
prop="belong_dept_name"
>
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
<el-table-column type="index" width="50"></el-table-column>
<el-table-column type="expand">
<template #default="props">
<div style="padding-left: 50px">
<el-descriptions :column="4">
<el-descriptions-item label="划伤">{{
props.row.count_n_hs
}}</el-descriptions-item>
<el-descriptions-item label="气泡">{{
props.row.count_n_qp
}}</el-descriptions-item>
<el-descriptions-item label="水纹">{{
props.row.count_n_swen
}}</el-descriptions-item>
<el-descriptions-item label="崩边">{{
props.row.count_n_bb
}}</el-descriptions-item>
<el-descriptions-item label="小崩边">{{
props.row.count_n_xbb
}}</el-descriptions-item>
<el-descriptions-item label="雾面">{{
props.row.count_n_wm
}}</el-descriptions-item>
<el-descriptions-item label="麻点">{{
props.row.count_n_md
}}</el-descriptions-item>
<el-descriptions-item label="线痕">{{
props.row.count_n_xh
}}</el-descriptions-item>
</el-descriptions>
</div>
</template>
</el-table-column>
<el-table-column
label="处理人"
prop="handle_user_name"
width="80"
></el-table-column>
<el-table-column
label="开始时间"
prop="work_start_time"
></el-table-column>
<el-table-column
label="结束时间"
prop="work_end_time"
></el-table-column>
<el-table-column label="操作员" prop="handle_user_name" min-width="80"></el-table-column>
<el-table-column label="设备" prop="equipment_name" min-width="150"></el-table-column>
<el-table-column label="领料数" prop="count_use"></el-table-column>
<el-table-column label="加工数" prop="count_real"></el-table-column>
<el-table-column label="加工前不良" prop="count_pn_jgqbl"></el-table-column>
<el-table-column label="合格数" prop="count_ok"></el-table-column>
<el-table-column label="不合格数" prop="count_notok"></el-table-column>
<el-table-column label="开始时间" prop="work_start_time"></el-table-column>
<el-table-column label="结束时间" prop="work_end_time"></el-table-column>
<el-table-column label="班次" prop="shift_name"></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="150"
width="100"
>
<template #default="scope">
<el-button
link
size="small"
v-auth="'mlog.update'"
<el-button link size="small" v-auth="'mlog.submit'"
v-if="scope.row.submit_time == null" type="primary"
@click.stop="mlogSubmit(scope.row)"
>提交
</el-button>
<el-button link size="small" v-auth="'mlog.delete'" type="danger"
v-if="scope.row.submit_time == null"
type="primary"
@click.stop="table_edit(scope.row)"
>编辑</el-button
>
<el-button
link
size="small"
@click="table_detail(scope.row)"
type="primary"
>详情</el-button
>
<el-button
link
size="small"
v-auth="'mlog.delete'"
type="danger"
v-if="scope.row.submit_time == null"
@click.stop="table_del(scope.row, scope.$index)"
>删除</el-button
>
<el-button
link
v-else
size="small"
type="danger"
@click.stop="table_del(scope.row)"
>删除
</el-button>
<el-button link v-else size="small" type="danger"
@click.stop="mlogRevert(scope.row)"
>撤回</el-button
>
>撤回
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</el-main>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:fmlog="fmlogId"
:fmlog="params.fmlog"
:mgroup="mgroup"
:mtask="mtask"
@success="handleSaveSuccess"
@ -153,7 +127,7 @@
@closed="dialog.check = false"
>
</check-dialog>
</div>
</el-container>
</el-drawer>
</template>
<script>
@ -190,7 +164,7 @@ export default {
fmlogItem: {},
saveInForm: {
count_use: 0,
count_n_jgqbl: 0,
count_pn_jgqbl: 0,
},
oinfo_json:{
退火炉号:'',
@ -223,8 +197,8 @@ export default {
mounted() {
this.getfmlogItem();
this.params.fmlog = this.fmlogId;
console.log('this.params.fmlog',this.params.fmlog);
this.apiObj = this.$API.wpm.mlog.list;
this.getInit();
},
methods: {
open() {
@ -244,102 +218,67 @@ export default {
Object.assign(this.form, data);
this.getRoute(data.id);
},
//
mlogUpdate() {
this.dialog.edit = true;
this.$nextTick(() => {
this.$refs.editDialog.open("edit").setData(this.fmlogItem);
});
},
// mlogUpdate(data) {
// this.$refs.editDialog.open().setData(data);
// },
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open();
});
},
//
table_in_edit(row) {
this.saveInForm = row;
this.saveInDialog = true;
},
//
saveInSubmit() {
let that = this;
that.$refs.saveInForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
let obj = {};
obj.count_use = that.saveInForm.count_use;
obj.count_n_jgqbl = that.saveInForm.count_n_jgqbl;
that.$API.wpm.mlogb.updateIn
.req(that.saveInForm.id, obj)
.then((res) => {
that.isSaveing = false;
that.$message.success("操作成功");
that.saveInDialog = false;
that.$refs.tableIn.refresh();
that.$refs.tableOut.refresh();
})
.catch(() => {
that.isSaveing = false;
});
}
});
},
table_in_del(row) {
let that = this;
that.$confirm("确定删除吗?").then(() => {
that.$API.wpm.mlogb.delIn.req(row.id).then((res) => {
that.$message.success("操作成功");
that.$refs.tableIn.refresh();
that.$refs.tableOut.refresh();
//inout
});
});
},
table_out_check(row) {
this.dialog.check = true;
let obj = {};
Object.assign(obj, row);
obj.mgroup_name = this.fmlogItem.mgroup_name;
this.$nextTick(() => {
this.$refs.checkDialog.open(obj);
});
},
//
mlogSubmit() {
let that = this;
that.$API.wpm.mlog.submit.req(that.fmlogItem.id).then((res) => {
mlogSubmit(row) {
let that = this;
that.isSaveing = true;
that.$API.wpm.mlog.submit.req(row.id).then((res) => {
that.isSaveing = false;
that.visible = false;
this.$refs.table.refresh();
that.$message.success("操作成功");
});
},
//
getInit() {
let that = this;
that.$API.wf.workflow.initkey.req(" backfire").then((res) => {
that.initForm = res;
//
mlogRevert(row) {
this.$confirm(`确定撤回该日志吗?`, "提示", {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.mlog.revert.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("撤回成功");
}
});
});
},
//
table_del(row) {
let that = this;
this.$confirm(`确定删除该日志吗?`, "提示", {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.mlog.delete.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("删除成功");
}
});
});
},
handleSaveSuccess() {
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();
this.$refs.table.refresh();
},
handleCheckSuccess() {
this.$refs.tableOut.refresh();
this.$refs.table.refresh();
},
fileUPSuccess(res) {
console.log('res',res);
this.test_file = res.id;
},
handleEditSuccess() {},
//
setFilters(filters) {
this.selectionFilters = filters;

View File

@ -44,6 +44,7 @@
</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="备注" prop="note"></el-table-column>
<el-table-column
label="操作"
fixed="right"
@ -76,14 +77,6 @@
@click.stop="table_del(scope.row, scope.$index)"
>删除</el-button
>
<el-button
link
v-else
size="small"
type="danger"
@click.stop="mlogRevert(scope.row)"
>撤回</el-button
>
</template>
</el-table-column>
</scTable>
@ -192,7 +185,7 @@ export default {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.mlog.delete.req(id).then((res) => {
this.$API.wpm.fmlog.delete.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
@ -202,23 +195,6 @@ export default {
});
});
},
//
mlogRevert(row) {
this.$confirm(`确定撤回该日志吗?`, "提示", {
type: "warning",
}).then(() => {
var id = row.id;
this.$API.wpm.mlog.revert.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("撤回成功");
}
});
});
},
//
selectionChange(selection) {
this.selection = selection;