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

View File

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

View File

@ -44,6 +44,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time"></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 <el-table-column
label="操作" label="操作"
fixed="right" fixed="right"
@ -76,14 +77,6 @@
@click.stop="table_del(scope.row, scope.$index)" @click.stop="table_del(scope.row, scope.$index)"
>删除</el-button >删除</el-button
> >
<el-button
link
v-else
size="small"
type="danger"
@click.stop="mlogRevert(scope.row)"
>撤回</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
@ -192,7 +185,7 @@ export default {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
var id = row.id; 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) { if (res.err_msg) {
this.$message.error(res.err_msg); this.$message.error(res.err_msg);
} else { } 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) { selectionChange(selection) {
this.selection = selection; this.selection = selection;