fix:车间库存添加检验记录页面,退火日志审批时控制页面按钮
This commit is contained in:
parent
ee973ca0da
commit
85e2bf1078
|
@ -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>
|
|
@ -304,7 +304,7 @@ export default {
|
|||
test_date: "",
|
||||
batch: "",
|
||||
count: null,
|
||||
count_ok: null,
|
||||
count_ok: 0,
|
||||
count_sampling_ok:'',
|
||||
count_notok: 0,
|
||||
count_notok_json:{}
|
||||
|
@ -436,18 +436,24 @@ export default {
|
|||
this.count_notok_json.count_n_md+
|
||||
this.count_notok_json.count_n_ps+
|
||||
this.count_notok_json.count_n_qt;
|
||||
if(count_notok>this.form.count_notok){
|
||||
this.$notify.error("不合格数量有问题");
|
||||
if(count_notok>that.form.count_notok){
|
||||
that.$notify.error("不合格数量有问题");
|
||||
that.isSaveing = false;
|
||||
}else{
|
||||
if(count_notok<this.form.count_notok){
|
||||
that.count_notok_json.count_n_qt = this.form.count_notok-count_notok;
|
||||
if(count_notok<that.form.count_notok){
|
||||
that.count_notok_json.count_n_qt = that.form.count_notok-count_notok;
|
||||
}
|
||||
if(that.supplier!== null&&that.form.type2==10){
|
||||
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;
|
||||
console.log('that.form',that.form)
|
||||
that.$API.qm.ftestwork.create.req(that.form)
|
||||
.then((res) => {
|
||||
that.$API.qm.ftestwork.submit.req(res.id)
|
||||
|
|
|
@ -107,13 +107,13 @@
|
|||
v-if="scope.row.notok_sign_name == null"
|
||||
>检验
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
link size="small"
|
||||
type="warning"
|
||||
@click="table_Check(scope.row)"
|
||||
@click="tableCheckList(scope.row)"
|
||||
v-if="scope.row.notok_sign_name == null"
|
||||
>检验记录
|
||||
</el-button> -->
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
@ -135,12 +135,20 @@
|
|||
@closed="dialog.save = false"
|
||||
>
|
||||
</check-dialog>
|
||||
<showDrawer
|
||||
ref="showDrawer"
|
||||
v-if="visibleDrawer"
|
||||
:wm="wm"
|
||||
@closed="visibleDrawer = false"
|
||||
>
|
||||
</showDrawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import { wmState } from "@/utils/enum.js";
|
||||
import materials from "./../mtm/materials.vue";
|
||||
import checkDialog from "./check_form.vue";
|
||||
import showDrawer from "./check_drawer.vue";
|
||||
export default {
|
||||
props: {
|
||||
mgroupName: {
|
||||
|
@ -150,7 +158,8 @@ export default {
|
|||
},
|
||||
components: {
|
||||
materials,
|
||||
checkDialog
|
||||
checkDialog,
|
||||
showDrawer
|
||||
},
|
||||
name: "wmaterial",
|
||||
data() {
|
||||
|
@ -219,6 +228,14 @@ export default {
|
|||
this.$refs.saveDialog.open(mode);
|
||||
});
|
||||
},
|
||||
//获取当前批次车间物料的检验记录
|
||||
tableCheckList(row){
|
||||
this.wm = row.id;
|
||||
this.visibleDrawer = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.showDrawer.open();
|
||||
});
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection) {
|
||||
this.selection = selection;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<div style="padding: 5px 10px;display: flex;justify-content: end;">
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="mlogItem.submit_time == null"
|
||||
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||mlogItem.ticket_.state_.type==1)"
|
||||
@click="mlogUpdate"
|
||||
style="margin-right: 10px;"
|
||||
v-auth="'mlog.update'"
|
||||
|
@ -48,13 +48,13 @@
|
|||
<!-- 退火-->
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="mlogItem.mgroup_name=='退火'"
|
||||
v-if="mlogItem.mgroup_name=='退火'&&(mlogItem.ticket==null||mlogItem.ticket_.state_.type==1)"
|
||||
:loading="isSaveing"
|
||||
@click="createTicket"
|
||||
>放行审批</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-else
|
||||
v-if="mlogItem.mgroup_name!='退火'"
|
||||
:loading="isSaveing"
|
||||
@click="mlogSubmit"
|
||||
>提交</el-button
|
||||
|
@ -71,7 +71,7 @@
|
|||
<div>
|
||||
<el-button
|
||||
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"
|
||||
@click="table_add"
|
||||
>新增</el-button
|
||||
|
@ -115,13 +115,13 @@
|
|||
link
|
||||
type="primary"
|
||||
@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
|
||||
link
|
||||
:disabled="mlogItem.submit_time !== null"
|
||||
:disabled="mlogItem.submit_time !== null||mlogItem.ticket!==null||mlogItem.ticket_.state_.type!==1"
|
||||
type="danger"
|
||||
@click="table_in_del(scope.row)"
|
||||
>
|
||||
|
@ -185,7 +185,7 @@
|
|||
<el-table-column type="expand">
|
||||
<template #default="props">
|
||||
<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="层数">
|
||||
{{item.floor}}
|
||||
</el-descriptions-item>
|
||||
|
@ -253,7 +253,7 @@
|
|||
<el-button
|
||||
link
|
||||
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)"
|
||||
>
|
||||
检验
|
||||
|
@ -283,6 +283,7 @@
|
|||
v-if="dialog.edit"
|
||||
ref="editDialog"
|
||||
:dept="deptId"
|
||||
:mgroupName= "mlogItem.mgroup_name"
|
||||
@success="handleEditSuccess"
|
||||
@closed="dialog.edit = false"
|
||||
>
|
||||
|
@ -303,13 +304,11 @@
|
|||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="退火时间">
|
||||
<el-date-picker
|
||||
type="datetime"
|
||||
<el-input-number
|
||||
v-model="oinfo_json.退火时间"
|
||||
style="width: 100%"
|
||||
value-format="YYYY-MM-DD HH:mm"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
></el-date-picker>
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
/>min
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
|
@ -550,8 +549,17 @@ export default {
|
|||
},
|
||||
//填写退火放行单信息
|
||||
createTicket(){
|
||||
this.ticketDialog = true;
|
||||
this.oinfo_json.退火炉号 = this.mlogItem.equipment_name.split("|")[0];
|
||||
if(this.mlogItem.work_end_time==null){
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue