fix:车间库存添加检验记录页面,退火日志审批时控制页面按钮

This commit is contained in:
shijing 2024-09-04 09:50:46 +08:00
parent ee973ca0da
commit 85e2bf1078
4 changed files with 164 additions and 26 deletions

View File

@ -0,0 +1,107 @@
<template>
<el-drawer
v-model="visible"
title="检验记录"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-main>
<scTable
ref="drawer_table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsObj"
>
<!-- <el-table-column type="index" width="50" /> -->
<el-table-column label="检验类型">
<template #default="scope">
<el-tag v-if="scope.row.type2 == 10">
{{ type2_[scope.row.type2] }}
</el-tag>
<el-tag v-else type="success">
{{ type2_[scope.row.type2] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="物料批次" prop="batch">
</el-table-column>
<el-table-column label="总数" prop="count">
</el-table-column>
<el-table-column label="检验数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling }}</span>
<span v-else>{{ scope.row.count }}</span>
</template>
</el-table-column>
<el-table-column label="合格数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok }}</span>
<span v-else>{{ scope.row.count_ok }}</span>
</template>
</el-table-column>
<el-table-column label="不合格数" prop="count_notok">
</el-table-column>
<el-table-column label="合格率">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok/scope.row.count_sampling*100 }}%</span>
<span v-else>{{ scope.row.count_ok/scope.row.count*100 }}%</span>
</template>
</el-table-column>
<el-table-column label="检验日期" prop="test_date">
</el-table-column>
<el-table-column label="检验人" prop="start_date">
</el-table-column>
<!-- <el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-button
link
type="primary"
v-auth="'ftestwork.update'"
@click="table_del(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["closed"],
props: {
wm: { type: String, default: "" },
},
data() {
return {
visible: false,
apiObj: null,
paramsObj: {},
form: {},
type2_: {
10: "抽检",
20: "全检",
},
isSaveing: false,
};
},
mounted() {},
methods: {
open() {
this.visible = true;
this.paramsObj.wm = this.wm;
this.apiObj = this.$API.qm.ftestwork.list;
return this;
},
table_del(row){
this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$refs.drawer_table.fetch();
});
},
},
};
</script>

View File

@ -304,7 +304,7 @@ export default {
test_date: "", test_date: "",
batch: "", batch: "",
count: null, count: null,
count_ok: null, count_ok: 0,
count_sampling_ok:'', count_sampling_ok:'',
count_notok: 0, count_notok: 0,
count_notok_json:{} count_notok_json:{}
@ -436,18 +436,24 @@ export default {
this.count_notok_json.count_n_md+ this.count_notok_json.count_n_md+
this.count_notok_json.count_n_ps+ this.count_notok_json.count_n_ps+
this.count_notok_json.count_n_qt; this.count_notok_json.count_n_qt;
if(count_notok>this.form.count_notok){ if(count_notok>that.form.count_notok){
this.$notify.error("不合格数量有问题"); that.$notify.error("不合格数量有问题");
that.isSaveing = false; that.isSaveing = false;
}else{ }else{
if(count_notok<this.form.count_notok){ if(count_notok<that.form.count_notok){
that.count_notok_json.count_n_qt = this.form.count_notok-count_notok; that.count_notok_json.count_n_qt = that.form.count_notok-count_notok;
} }
if(that.supplier!== null&&that.form.type2==10){ if(that.supplier!== null&&that.form.type2==10){
that.form.need_update_wm = false; that.form.need_update_wm = false;
} }
that.form.count_ok = this.form.count-this.form.count_notok; // that.form.count_ok = that.form.count-that.form.count_notok;
if(that.form.type2==10){//
that.form.count_sampling_ok = that.form.count_sampling - that.form.count_notok;
}else{//
that.form.count_ok = that.form.count - that.form.count_notok;
}
that.form.count_notok_json = that.count_notok_json; that.form.count_notok_json = that.count_notok_json;
console.log('that.form',that.form)
that.$API.qm.ftestwork.create.req(that.form) that.$API.qm.ftestwork.create.req(that.form)
.then((res) => { .then((res) => {
that.$API.qm.ftestwork.submit.req(res.id) that.$API.qm.ftestwork.submit.req(res.id)

View File

@ -107,13 +107,13 @@
v-if="scope.row.notok_sign_name == null" v-if="scope.row.notok_sign_name == null"
>检验 >检验
</el-button> </el-button>
<!-- <el-button <el-button
link size="small" link size="small"
type="warning" type="warning"
@click="table_Check(scope.row)" @click="tableCheckList(scope.row)"
v-if="scope.row.notok_sign_name == null" v-if="scope.row.notok_sign_name == null"
>检验记录 >检验记录
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
@ -135,12 +135,20 @@
@closed="dialog.save = false" @closed="dialog.save = false"
> >
</check-dialog> </check-dialog>
<showDrawer
ref="showDrawer"
v-if="visibleDrawer"
:wm="wm"
@closed="visibleDrawer = false"
>
</showDrawer>
</el-container> </el-container>
</template> </template>
<script> <script>
import { wmState } from "@/utils/enum.js"; import { wmState } from "@/utils/enum.js";
import materials from "./../mtm/materials.vue"; import materials from "./../mtm/materials.vue";
import checkDialog from "./check_form.vue"; import checkDialog from "./check_form.vue";
import showDrawer from "./check_drawer.vue";
export default { export default {
props: { props: {
mgroupName: { mgroupName: {
@ -150,7 +158,8 @@ export default {
}, },
components: { components: {
materials, materials,
checkDialog checkDialog,
showDrawer
}, },
name: "wmaterial", name: "wmaterial",
data() { data() {
@ -219,6 +228,14 @@ export default {
this.$refs.saveDialog.open(mode); this.$refs.saveDialog.open(mode);
}); });
}, },
//
tableCheckList(row){
this.wm = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
// //
selectionChange(selection) { selectionChange(selection) {
this.selection = selection; this.selection = selection;

View File

@ -37,7 +37,7 @@
<div style="padding: 5px 10px;display: flex;justify-content: end;"> <div style="padding: 5px 10px;display: flex;justify-content: end;">
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null" v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||mlogItem.ticket_.state_.type==1)"
@click="mlogUpdate" @click="mlogUpdate"
style="margin-right: 10px;" style="margin-right: 10px;"
v-auth="'mlog.update'" v-auth="'mlog.update'"
@ -48,13 +48,13 @@
<!-- 退火--> <!-- 退火-->
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.mgroup_name=='退火'" v-if="mlogItem.mgroup_name=='退火'&&(mlogItem.ticket==null||mlogItem.ticket_.state_.type==1)"
:loading="isSaveing" :loading="isSaveing"
@click="createTicket" @click="createTicket"
>放行审批</el-button> >放行审批</el-button>
<el-button <el-button
type="primary" type="primary"
v-else v-if="mlogItem.mgroup_name!='退火'"
:loading="isSaveing" :loading="isSaveing"
@click="mlogSubmit" @click="mlogSubmit"
>提交</el-button >提交</el-button
@ -71,7 +71,7 @@
<div> <div>
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null" v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||mlogItem.ticket_.state_.type==1)"
icon="el-icon-plus" icon="el-icon-plus"
@click="table_add" @click="table_add"
>新增</el-button >新增</el-button
@ -115,13 +115,13 @@
link link
type="primary" type="primary"
@click="table_in_edit(scope.row)" @click="table_in_edit(scope.row)"
:disabled="mlogItem.submit_time !== null" :disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||mlogItem.ticket_.state_.type!==1"
> >
编辑 编辑
</el-button> </el-button>
<el-button <el-button
link link
:disabled="mlogItem.submit_time !== null" :disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||mlogItem.ticket_.state_.type!==1"
type="danger" type="danger"
@click="table_in_del(scope.row)" @click="table_in_del(scope.row)"
> >
@ -185,7 +185,7 @@
<el-table-column type="expand"> <el-table-column type="expand">
<template #default="props"> <template #default="props">
<div style="padding-left: 50px" v-if="props.row.count_notok_json.length>0"> <div style="padding-left: 50px" v-if="props.row.count_notok_json.length>0">
<el-descriptions :column="4" v-for="item in props.row.count_notok_json"> <el-descriptions :column="4" v-for="item in props.row.count_notok_json" :key="item">
<el-descriptions-item label="层数"> <el-descriptions-item label="层数">
{{item.floor}} {{item.floor}}
</el-descriptions-item> </el-descriptions-item>
@ -253,7 +253,7 @@
<el-button <el-button
link link
type="primary" type="primary"
:disabled="mlogItem.submit_time !== null" :disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||mlogItem.ticket_.state_.type!==1"
@click="table_out_check(scope.row)" @click="table_out_check(scope.row)"
> >
检验 检验
@ -283,6 +283,7 @@
v-if="dialog.edit" v-if="dialog.edit"
ref="editDialog" ref="editDialog"
:dept="deptId" :dept="deptId"
:mgroupName= "mlogItem.mgroup_name"
@success="handleEditSuccess" @success="handleEditSuccess"
@closed="dialog.edit = false" @closed="dialog.edit = false"
> >
@ -303,13 +304,11 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="退火时间"> <el-form-item label="退火时间">
<el-date-picker <el-input-number
type="datetime"
v-model="oinfo_json.退火时间" v-model="oinfo_json.退火时间"
style="width: 100%" :min="1"
value-format="YYYY-MM-DD HH:mm" controls-position="right"
format="YYYY-MM-DD HH:mm" />min
></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
@ -550,8 +549,17 @@ export default {
}, },
//退 //退
createTicket(){ createTicket(){
this.ticketDialog = true; if(this.mlogItem.work_end_time==null){
this.oinfo_json.退火炉号 = this.mlogItem.equipment_name.split("|")[0]; this.$message.error("请先编辑日志并选择结束时间");
}else{
let sum = 0;
this.mlogItem.reminder_interval_list.forEach(item => {
sum+=item;
});
this.oinfo_json.退火时间 = sum;
this.oinfo_json.退火炉号 = this.mlogItem.equipment_name.split("|")[0];
this.ticketDialog = true;
}
}, },
//退, //退,
submitTicketCreate(id) { submitTicketCreate(id) {