fix:bx日志相关改动

This commit is contained in:
shijing 2024-12-26 09:38:58 +08:00
parent 9eeb26a8fd
commit 2956be3702
7 changed files with 466 additions and 391 deletions

View File

@ -606,11 +606,7 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item
:label="
project_code === 'gx'
? '总数'
: '总袋(桶)数'
"
:label="project_code === 'gx'? '总数': '总袋(桶)数'"
>
<el-input-number
v-model="form.count_bag"
@ -683,7 +679,7 @@
</el-form-item>
</el-col>
<!-- 光子 -->
<el-col :md="12" :sm="24" v-if="project_code !== 'gx'">
<el-col :md="12" :sm="24" v-if="project_code == 'gz'">
<el-form-item label="抽样计算总重量/Kg">
<el-input-number
v-model="form.count_bag_weight_all"
@ -701,7 +697,7 @@
</el-col>
</el-row>
<!-- 光子 -->
<el-row v-if="project_code !== 'gx'">
<el-row v-if="project_code == 'gz'">
<el-col>
<el-form-item label="称重记录/Kg">
<el-button
@ -735,26 +731,6 @@
style="position: absolute; right: -10px; top: 0"
/>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="合同采购量/Kg">
<el-input-number v-model="form.count" :min="0" style="width:100%" controls-position="right">
</el-input-number>
</el-form-item>
</el-col> -->
<!-- <el-col :md="12" :sm="24" prop="is_testok">
<el-form-item label="结论判定" prop="is_testok">
<el-select
v-model="form.is_testok"
placeholder="结论判定"
clearable
style="width:100%"
>
<el-option label="是" value="true"/>
<el-option label="否" value="false"/>
</el-select>
</el-form-item>
</el-col> -->
</el-row>
</el-form>
</el-main>
@ -766,6 +742,164 @@
</el-footer>
</el-container>
</el-dialog>
<el-drawer
v-model="visibleDrawer"
title="检验"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-width="140px"
>
<!-- 入厂检验 -->
<el-row v-if="type == 'pur_in'">
<el-col :md="12" :sm="24">
<el-form-item label="产品名称:">
{{ objitem.material_name }}
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="入厂批次号:">
{{ objitem.batch }}
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验日期" prop="test_date">
<el-date-picker
v-model="form.test_date"
type="date"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验员" prop="test_user">
<el-select
v-model="form.test_user"
placeholder="检验员"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验合格" prop="is_testok">
<el-select
v-model="form.is_testok"
placeholder="检验合格"
clearable
style="width: 100%"
>
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input v-model="form.test_note"> </el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 检测项 -->
<el-row>
<el-col>检测项</el-col>
<el-col v-for="(item) in qct_testitems" :key="item.id" :md="12" :sm="24">
<el-form-item :label="item.testitem_name">
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="form[item.testitem_name]"
:min="0"
class="width-100"
controls-position="right"
@change="defectCountSun"
>
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="form[item.testitem_name]"
:min="0"
class="width-100"
controls-position="right"
@change="defectCountSun"
>
</el-input-number>
<el-input
v-if="item.testitem_field_type=='input-text'"
v-model="form[item.testitem_name]"
class="width-100"
@change="defectCountSun"
>
</el-input>
<el-select
v-if="item.testitem_field_type=='select-text'"
v-model="form[item.testitem_name]"
clearable
class="width-100"
@change="defectCountSun"
>
<el-option
v-for="item0 in item.testitem_choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="form[item.testitem_name]"
clearable
multiple
class="width-100"
@change="defectCountSun"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 缺陷项 -->
<el-row>
<el-col>缺陷项</el-col>
<el-col v-for="item in qct_defects" :key="item.id" :md="12" :sm="24">
<el-form-item :label="item.defect_name">
<span v-if="form[item.defect_name]"></span>
<span v-else></span>
<!-- <el-input v-model="form[item.defect_name]" class="width-100"></el-input> -->
<span v-if="item.note!==null&&item.note!==''" style="font-size: 12px; color: #a9a7a7;">({{ item.note }})</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer v-if="mode == 'add'">
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
<el-button @click="visibleDrawer = false">取消</el-button>
</el-footer>
</el-container>
</el-drawer>
</template>
<script>
export default {
@ -810,6 +944,7 @@ export default {
mioItem: {},
weight_kgs: [{ value: 0 }],
visible: false,
visibleDrawer:false,
isSaveing: false,
userList: [],
processOptions: [],
@ -818,73 +953,147 @@ export default {
setFiltersVisible: false,
belong_dept_options: [],
group: [],
qct_testitems:[],
qct_defects:[],
qctId:'',
};
},
watch: {
qct_testitems: {
handler() {
//
this.qct_testitems.forEach(item => {
if (!(item.testitem_name in this.form)) {
this.form[item.testitem_name] = ''
}
});
},
immediate: true
},
qct_defects: {
handler() {
this.qct_defects.forEach(item => {
if (!(item.defect_name in this.form)) {
this.form[item.defect_name] = false;
// let str = item.rule_expression.replace(/`/g, '');
// this.form[item.defect_name] = str.replace(/\${(.*?)}/g, 'this.form.\$1')?'':'';
}
});
},
immediate: true
}
},
mounted() {
let config_base = this.$TOOL.data.get("BASE_INFO").base;
this.project_code = config_base.base_code;
console.log("this.project_code", this.project_code);
this.getUserList();
let that = this;
if (that.type == "pur_in") {
console.log("objitem", that.objitem);
that.form.material_name = that.objitem.material_name;
that.form.batch = that.objitem.batch;
that.form.count_bag = that.objitem.count_bag;
}
if (
(that.type == "do_in" && that.cate == "halfgood") ||
that.type == "other_in"
) {
this.form.count_notok = 0;
this.form.count_n_zw = 0;
this.form.count_n_tw = 0;
this.form.count_n_qp = 0;
this.form.count_n_wq = 0;
this.form.count_n_dl = 0;
this.form.count_n_pb = 0;
this.form.count_n_dxt = 0;
this.form.count_n_js = 0;
this.form.count_n_qx = 0;
this.form.count_n_hs = 0;
this.form.count_n_ysq = 0;
this.form.count_n_zz = 0;
this.form.count_n_b = 0;
this.form.count_n_qt = 0;
}
if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok = 0;
this.form.count_n_hs = 0;
this.form.count_n_cs = 0;
this.form.count_n_zz = 0;
this.form.count_n_tw = 0;
this.form.count_n_d = 0;
this.form.count_n_zdd = 0;
this.form.count_n_zw = 0;
this.form.count_n_dl = 0;
//
this.form.count_n_qp = 0;
this.form.count_n_bl = 0;
this.form.count_n_hw = 0;
this.form.count_n_yp = 0;
this.form.count_n_bp = 0;
this.form.count_n_sc = 0;
//
this.form.count_n_qx = 0;
this.form.count_n_js = 0;
this.form.count_n_tydd = 0;
this.form.count_n_sw = 0;
this.form.count_n_bhpcd = 0;
this.form.count_n_wq = 0;
let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code;
that.getUserList();
if(that.project_code=='bxerp'){
this.getQctDetail();
}else{
if (that.type == "pur_in") {
console.log("objitem", that.objitem);
that.form.material_name = that.objitem.material_name;
that.form.batch = that.objitem.batch;
that.form.count_bag = that.objitem.count_bag;
}
if (
(that.type == "do_in" && that.cate == "halfgood") ||
that.type == "other_in"
) {
this.form.count_notok = 0;
this.form.count_n_zw = 0;
this.form.count_n_tw = 0;
this.form.count_n_qp = 0;
this.form.count_n_wq = 0;
this.form.count_n_dl = 0;
this.form.count_n_pb = 0;
this.form.count_n_dxt = 0;
this.form.count_n_js = 0;
this.form.count_n_qx = 0;
this.form.count_n_hs = 0;
this.form.count_n_ysq = 0;
this.form.count_n_zz = 0;
this.form.count_n_b = 0;
this.form.count_n_qt = 0;
}
if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok = 0;
this.form.count_n_hs = 0;
this.form.count_n_cs = 0;
this.form.count_n_zz = 0;
this.form.count_n_tw = 0;
this.form.count_n_d = 0;
this.form.count_n_zdd = 0;
this.form.count_n_zw = 0;
this.form.count_n_dl = 0;
//
this.form.count_n_qp = 0;
this.form.count_n_bl = 0;
this.form.count_n_hw = 0;
this.form.count_n_yp = 0;
this.form.count_n_bp = 0;
this.form.count_n_sc = 0;
//
this.form.count_n_qx = 0;
this.form.count_n_js = 0;
this.form.count_n_tydd = 0;
this.form.count_n_sw = 0;
this.form.count_n_bhpcd = 0;
this.form.count_n_wq = 0;
}
}
},
methods: {
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
let config_base = this.$TOOL.data.get("BASE_INFO").base.base_code;
if(config_base=='bxerp'){
this.visibleDrawer = true;
}else{
this.visible = true;
}
return this;
},
//
getQctDetail(){
let that = this;
that.$API.qm.qct.list.req({ qctmat__material: that.objitem.material,page:0 }).then((res) => {
if(res.length>0){
that.qctId = res[0].id;
that.$API.qm.qct.item.req(that.qctId).then((res0) => {
//testitemdefectitem
that.qct_defects = [];
that.qct_testitems = [];
if(res0.qct_defects.length>0){
res0.qct_defects.forEach((item1) => {
let obj = Object.assign({}, item1);
obj.value = '';
that.qct_defects.push(obj);
})
}else{
that.qct_defects = [];
}
if(res0.qct_testitems.length>0){
res0.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){
let str = obj2.testitem_choices.replace(/'/g, '"');
let arr = JSON.parse(str);
obj2.testitem_choices = arr;
}
that.qct_testitems.push(obj2);
})
}else{
that.qct_testitems = [];
}
that.defectCountSun();
})
}
});
},
//
getUserList() {
let that = this;
@ -902,6 +1111,18 @@ export default {
this.weight_kgs.splice(index, 1);
this.form.count_sampling = this.weight_kgs.length;
},
defectCountSun(){
let that = this;
that.qct_defects.forEach(item => {
console.log(item.defect_name,':',item.rule_expression);
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'this.form.\$1')
console.log(item.defect_name,':',str);
let judge = eval(str);
console.log(item.defect_name,':',judge);
that.form[item.defect_name] = judge;
});
},
countSun() {
let that = this;
let sum = 0;
@ -1075,4 +1296,8 @@ export default {
};
</script>
<style></style>
<style>
.width-100{
width: 100%;
}
</style>

View File

@ -65,6 +65,14 @@
</el-table-column>
<el-table-column prop="open" label="操作" width="80" align="center">
<template #default="scope">
<el-button
v-if="!scope.row.edit"
text
type="primary"
size="small"
@click="formTableEdit(scope.row,'mat')"
>编辑</el-button
>
<el-button
v-if="scope.row.id"
text
@ -74,12 +82,12 @@
>删除</el-button
>
<el-button
v-else
v-if="scope.row.edit"
text
type="primary"
size="small"
@click="formTableAdd(scope.row,'mat')"
>添加</el-button
>保存</el-button
>
</template>
</el-table-column>
@ -122,6 +130,14 @@
</el-table-column>
<el-table-column prop="open" label="操作" width="80" align="center">
<template #default="scope">
<el-button
v-if="!scope.row.edit"
text
type="primary"
size="small"
@click="formTableEdit(scope.row,'testitem')"
>编辑</el-button
>
<el-button
v-if="scope.row.id"
text
@ -131,12 +147,12 @@
>删除</el-button
>
<el-button
v-else
v-if="scope.row.edit"
text
type="primary"
size="small"
@click="formTableAdd(scope.row,'testitem')"
>添加</el-button
>保存</el-button
>
</template>
</el-table-column>
@ -152,13 +168,13 @@
>
<el-table-column prop="val" label="排序" width="80">
<template #default="scope">
<span v-if="scope.row.id">{{ scope.row.sort }}</span>
<span v-if="scope.row.edit">{{ scope.row.sort }}</span>
<el-input v-else v-model="scope.row.sort" placeholder="排序"></el-input>
</template>
</el-table-column>
<el-table-column prop="time" label="缺陷项">
<template #default="scope">
<span v-if="scope.row.id">{{scope.row.defect_name}}</span>
<span v-if="scope.row.edit">{{scope.row.defect_name}}</span>
<xtSelect
v-else
:apiObj="apiObj3"
@ -173,20 +189,20 @@
</el-table-column>
<el-table-column prop="val" label="判定表达式" min-width="150">
<template #default="scope">
<span v-if="scope.row.id">{{ scope.row.rule_expression }}</span>
<span v-if="scope.row.edit">{{ scope.row.rule_expression }}</span>
<el-input v-else v-model="scope.row.rule_expression" placeholder="请输入判定表达式"></el-input>
</template>
</el-table-column>
<el-table-column prop="type" label="备注">
<template #default="scope">
<span v-if="scope.row.id">{{ scope.row.note }}</span>
<el-input v-else v-model="defectrow.description" placeholder="备注"></el-input>
<span v-if="scope.row.edit">{{ scope.row.note }}</span>
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="80" align="center">
<el-table-column prop="open" label="操作" width="125" align="center">
<template #default="scope">
<el-button
v-if="scope.row.id"
v-if="!scope.row.edit"
text
type="danger"
size="small"
@ -194,12 +210,20 @@
>删除</el-button
>
<el-button
v-else
v-if="scope.row.id"
text
type="primary"
size="small"
@click="formTableEdit(scope.row.id,'defect')"
>编辑</el-button
>
<el-button
v-if="scope.row.edit"
text
type="primary"
size="small"
@click="formTableAdd(scope.row,'defect')"
>添加</el-button
>保存</el-button
>
</template>
</el-table-column>
@ -258,12 +282,14 @@ export default {
tracing: "",
qct: this.qctId,
material: "",
edit: false,
},
defectaddTemplate:{
qct: this.qctId,
defect: "",
note:'',
sort:'',
edit: false,
rule_expression:'',
},
testitemaddTemplate:{
@ -271,6 +297,7 @@ export default {
note:'',
sort:'',
testitem:'',
edit: false,
},
defectrow:{},
testitemrow:{},
@ -284,33 +311,51 @@ export default {
this.qctItem =this.$TOOL.data.get("qctCurrent");
this.getLists();
},
watch:{
defectrow:{}
},
methods: {
open() {
this.visible = true;
},
getLists(){
let that = this;
that.qctmatlist = [],that.qctdefectlist =[],that.qcttestitemlist =[];
that.$API.qm.qctmat.list.req({qct:that.qctItem.id,page:0}).then(res=>{
that.qctmatlist = res;
res.forEach(item=>{
let obj = object.assign({},item);
obj.edit = false;
that.qctmatlist.push(obj);
})
});
that.$API.qm.qctdefect.list.req({qct:that.qctItem.id,page:0}).then(res=>{
that.qctdefectlist = res;
res.forEach(item=>{
let obj = object.assign({},item);
obj.edit = false;
that.qctdefectlist.push(obj);
})
// that.qctdefectlist = res;
});
that.$API.qm.qcttestitem.list.req({qct:that.qctItem.id,page:0}).then(res=>{
that.qcttestitemlist = res;
res.forEach(item=>{
let obj = object.assign({},item);
obj.edit = false;
that.qcttestitemlist.push(obj);
})
// that.qcttestitemlist = res;
});
},
//
formTableAdd(row,type) {
let that = this,api = '';
if(type=='defect'){
console.log(that.defectrow);
row.note = that.defectrow.description;
// console.log(that.defectrow);
row.note = that.defectrow.note;
api = that.$API.qm.qctdefect.create;
}else if(type=='mat'){
api = that.$API.qm.qctmat.create;
}else if(type=='testitem'){
console.log(that.testitemrow);
// console.log(that.testitemrow);
row.note = that.testitemrow.description;
api = that.$API.qm.qcttestitem.create;
}
@ -324,6 +369,9 @@ export default {
});
})
},
formTableEdit(row,type) {
},
//
formTableDel(id,type) {
let that = this,api = '';

View File

@ -11,22 +11,27 @@
<el-main id="elMain" class="nopadding">
<!-- 日志 -->
<mlogs
v-if="values == '日志'"
v-if="values == '日志'&&componentsShow"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
:mgroup_code="mgroup_code"
style="height: 60%"
></mlogs>
<mtask
v-if="values == '日志'"
v-if="values == '日志'&&componentsShow"
:mgroupName="mgroupName"
style="height: 40%"
></mtask>
<!-- 交接记录 -->
<handover
v-else-if="values == '交接记录'"
v-else-if="values == '交接记录'&&componentsShow"
:mgroupName="mgroupName"
:mgroup_code="mgroup_code"
></handover>
<!-- 库存 -->
<inm v-else-if="values == '库存'" :mgroupName="mgroupName"></inm>
<inm v-else-if="values == '库存'&&componentsShow"
:mgroup_code="mgroup_code"
:mgroupName="mgroupName"></inm>
</el-main>
</el-container>
@ -48,6 +53,9 @@ export default {
mgroupName: "",
mgroupId: "",
selectedIndex:0,
mgroup_code:'',
mgroupDept:'',
componentsShow:false,
};
},
mounted() {
@ -56,10 +64,9 @@ export default {
that.tableHieght = height;
let paths = this.$route.path;
let arr = paths.split("/");
let mgroup_code = arr[2];
that.getMgroups(mgroup_code);
console.log("arr",arr);
console.log("mgroup_code",mgroup_code);
this.mgroup_code = arr[2];
console.log('this.mgroup_code',this.mgroup_code);
that.getMgroups(this.mgroup_code);
},
methods: {
handleChange(value) {
@ -74,35 +81,11 @@ export default {
that.mgroupId = res[0].id;
that.mgroupProcess = res[0].process;
that.mgroupDept = res[0].belong_dept;
console.log("mgroups",that.mgroups);
that.componentsShow = true;
});
},
changeMgroup(id,index){
let that = this;
that.selectedIndex = index;
console.log(that.selectedIndex);
that.mgroupId = id;
that.mgroupName = that.mgroups[index].name;
},
},
};
</script>
<style scoped>
.countBlock {
width: 80px;
color: #ffffff;
text-align: center;
}
.mgroupItem{
height: 35px;
width: 80px;
line-height: 35px;
margin: 5px 0;
text-align: center;
color: #6e80ff;
}
.mgroupItem:hover,.mgroupItemActive{
color: #6e80ff;
background: rgba(83, 109, 254, 0.2);
}
</style>

View File

@ -3,7 +3,7 @@
<el-header>
<div class="left-panel">
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'"
v-if="mgroupName!=='size'&&mgroupName!=='facade'"
v-if="mgroupName=='qingxi'"
>领料</el-button
>
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"

View File

@ -8,7 +8,7 @@
>
<div>
<el-card style="width: 100%" header="基本信息" shadow="never">
<el-button type="primary" @click="handlePrint" style="position: absolute;right: 20px;">打印</el-button>
<!-- <el-button type="primary" @click="handlePrint" style="position: absolute;right: 20px;">打印</el-button> -->
<el-descriptions>
<el-descriptions-item label="工艺路线">{{
mlogItem.routepack_name
@ -40,17 +40,11 @@
<el-descriptions-item label="创建时间">{{
mlogItem.create_time
}}</el-descriptions-item>
<el-descriptions-item label="工单状态" v-if="mlogItem.mgroup_name=='退火'">
<el-tag v-if="mlogItem.ticket_">{{act_states[mlogItem.ticket_.act_state]}}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="检验表单" v-if="mlogItem.mgroup_name=='退火'||mlogItem.mgroup_name=='黑化'">
<el-link :href="mlogItem.test_file" target="_blank" type="primary" :underline="false">{{mlogItem.test_file}}</el-link>
</el-descriptions-item>
</el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;">
<el-button
type="primary"
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
v-if="mlogItem.submit_time == null"
@click="mlogUpdate"
style="margin-right: 10px;"
v-auth="'mlog.update'"
@ -59,18 +53,11 @@
</el-button>
<el-button
type="primary"
v-if="mlogItem.mgroup_name!='退火'&&mlogItem.submit_time == null"
v-if="mlogItem.submit_time == null"
:loading="isSaveing"
@click="mlogSubmit"
>提交</el-button
>
<!-- 退火-->
<el-button
type="primary"
v-if="mlogItem.mgroup_name=='退火'&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
:loading="isSaveing"
@click="createTicket"
>放行审批</el-button>
</div>
</el-card>
<!-- 输入物料 -->
@ -326,90 +313,6 @@
@closed="dialog.edit = false"
>
</edit-dialog>
<!-- 退火放行通知单 -->
<el-dialog v-model="ticketDialog" title="退火放行通知单">
<el-form
:model="saveInForm"
:rules="rules"
label-width="100px"
ref="saveInForm"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="退火炉号">
<el-input v-model="oinfo_json.退火炉号"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="退火时间">
<el-input-number
v-model="oinfo_json.退火时间"
:min="1"
controls-position="right"
/>min
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="退火温度">
<el-input-number
v-model="oinfo_json.退火温度"
:min="1"
style="width: 100%"
controls-position="right"
/>
<span style="position: absolute;right: -17px;">°C</span>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽检结果">
<el-input v-model="oinfo_json.抽检结果"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽检数">
<el-input-number
v-model="oinfo_json.抽检数"
:precision="0"
:min="1"
style="width: 100%"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="强度落球">
<el-input v-model="oinfo_json.强度落球"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="放行标准">退火后直径23.5±0.2黑圈内径5.9±0.1外径7.6-7.77</el-form-item>
</el-row>
<el-form-item label="检验附件">
<sc-upload-file
v-model="fileList"
:multiple="false"
:limit="1"
:accept="['.xlsx', '.xls']"
@success = "fileUPSuccess"
>
<el-button type="primary" icon="el-icon-upload"> </el-button>
</sc-upload-file>
</el-form-item>
</el-form>
<template #footer>
<el-button
v-for="item in initForm.transitions"
:key="item.id"
type="primary"
:loading="isSaveing"
:disabled="isSaveing"
@click="submitTicketCreate(item.id)"
style="margin-right: 4px"
>{{ item.name }}</el-button
>
</template>
</el-dialog>
<el-dialog v-model="printVisible" width="1200px">
<print :baseData="mlogItem" :tableData="tableData" :tableData2="tableData2" type="102" @closePrint="printVisible=false"/>
</el-dialog>
@ -478,22 +381,6 @@ export default {
count_use: 0,
count_pn_jgqbl: 0,
},
oinfo_json:{
退火炉号:'',
退火时间:'',
退火温度:'',
抽检结果:'',
抽检数:'',
强度落球:'',
},
act_states: {
0: "草稿中",
1: "进行中",
2: "被退回",
3: "被撤回",
4: "已完成",
5: "已关闭",
},
fileList:[],
tableDataWm:[],
test_file:'',
@ -504,7 +391,6 @@ export default {
tableData:[],
tableData2:[],
saveInDialog: false,
ticketDialog:false,
printVisible:false,
setFiltersVisible: false,
rules: {
@ -523,17 +409,14 @@ export default {
};
},
mounted() {
console.log('this.mlogId',this.mlogId);
let that = this;
this.paramsIn.mlog = this.mlogId;
this.paramsOut.mlog = this.mlogId;
this.apiObj = this.$API.wpm.mlogb.list;
this.getInit();
that.$API.wpm.mlogb.list.req(that.paramsIn).then((res) => {
that.tableData = res;
})
that.getMlogItem();
},
methods: {
open() {
@ -576,15 +459,16 @@ export default {
this.$refs.editDialog.open("edit").setData(this.mlogItem);
});
},
// mlogUpdate(data) {
// this.$refs.editDialog.open().setData(data);
// },
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open();
});
},
mlogbinSuccess(){
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();
},
//
table_in_edit(row) {
this.saveInForm = row;
@ -644,50 +528,6 @@ export default {
that.$message.success("操作成功");
});
},
//
getInit() {
let that = this;
that.$API.wf.workflow.initkey.req(" backfire").then((res) => {
that.initForm = res;
});
},
//退
createTicket(){
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!==null?this.mlogItem.equipment_name.split("|")[0]:'';
this.ticketDialog = true;
}
},
//退,
submitTicketCreate(id) {
let that = this;
let obj = {};
obj.oinfo_json = that.oinfo_json;
obj.test_file = that.test_file;
that.$API.wpm.mlog.change.req(that.mlogItem.id, obj).then((res) => {
let ticket = {};
that.isSaveing = true;
ticket.title = '退火放行审批单';
ticket.workflow = that.initForm.workflow;
ticket.ticket_data = {t_id: that.mlogItem.id};
ticket.transition = id;
that.$API.wf.ticket.create.req(ticket).then((res) => {
that.isSaveing = false;
that.ticketDialog = false;
that.visible = false;
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
});
});
},
handleSaveSuccess() {
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();

View File

@ -58,14 +58,33 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="工艺路线" prop="route">
<el-form-item label="关联任务" prop="mtask">
<el-select
v-model="form.mtask"
placeholder="关联任务"
clearable
style="width: 100%"
@change="changeMtask"
>
<el-option
v-for="item in mtaskOptions"
:key="item.id"
:label="item.number"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="工艺路线">
<el-select
v-model="form.route"
placeholder="工艺路线"
clearable
disabled
filterable
style="width: 100%"
:disabled="mode == 'edit'"
>
<el-option
v-for="item in routeOptions"
@ -73,11 +92,7 @@
:label="item.routepack_name"
:value="item.id"
>
<span
>{{ item.routepack_name }}-{{
item.process_name
}}</span
>
<span>{{ item.routepack_name }}-{{item.process_name}}</span>
</el-option>
</el-select>
</el-form-item>
@ -104,18 +119,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroup_name=='磨抛一次抛'">
<el-form-item label="批次序号">
<el-input-number
v-model="form.index"
:min="0"
:max="99"
placeholder="第几炉,追加到批次"
style="width: 100%"
controls-position="right"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item
label="开始时间"
@ -142,24 +145,6 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroup_name=='黑化'||mgroup_name=='退火'">
<el-form-item label="保温时间" required>
<el-input-number
v-model="form.reminder_interval_list[0]"
:min="0"
controls-position="right"
/>(min)
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="mgroup_name=='黑化'||mgroup_name=='退火'">
<el-form-item label="冷却时间" required>
<el-input-number
v-model="form.reminder_interval_list[1]"
:min="0"
controls-position="right"
/>(min)
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="操作人">
<ehsSelect
@ -170,21 +155,6 @@
></ehsSelect>
</el-form-item>
</el-col>
<!-- 黑化 -->
<el-col :md="12" :sm="24" v-if="mgroup_name=='黑化'">
<el-form-item label="检验文件">
<sc-upload-file
v-model="fileList"
:multiple="false"
:limit="1"
:accept="['.xlsx', '.xls']"
@success = "fileUPSuccess"
>
<el-button type="primary" icon="el-icon-upload"> </el-button>
</sc-upload-file>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input
@ -217,7 +187,7 @@ const defaultForm = {
work_end_time:null,
note:'',
mgroup:'',
reminder_interval_list: [0,0],
mtask:'',
};
export default {
@ -226,7 +196,7 @@ export default {
type: String,
default: "",
},
mgroup_name:{
mgroupName:{
type: String,
default: "",
},
@ -299,6 +269,7 @@ export default {
options: [],
routeOptions: [],
userOptions: [],
mtaskOptions:[],
supplierOptions: [],
setFiltersVisible: false,
};
@ -308,10 +279,8 @@ export default {
this.getUser();
this.getSupplier();
this.getEquipment();
console.log("this.mgroup",this.mgroup);
console.log("this.mgroup_name",this.mgroup_name);
console.log("this.dept",this.dept);
console.log("this.process",this.process);
this.getMtask();
},
methods: {
disabledDateFn(time) {
@ -334,6 +303,15 @@ export default {
});
});
},
//
getMtask() {
let that = this;
this.$API.pm.mtask.list
.req({ page: 0, mgroup: that.mgroup, state: 20 })
.then((res) => {
that.mtaskOptions = res;
});
},
getSupplier() {
let that = this;
let obj = {};
@ -367,6 +345,14 @@ export default {
}
this.getRoute(data.id);
},
changeMtask(){
let that = this;
that.mtaskOptions.forEach((item) => {
if(item.id == that.form.mtask){
that.form.route = item.route;
}
})
},
fileUPSuccess(res) {
let that = this;
console.log('res',res);
@ -393,7 +379,7 @@ export default {
obj.work_end_time = that.form.work_end_time;
obj.handle_user = that.form.handle_user;
obj.note = that.form.note;
if(that.mgroup_name=='黑化'){
if(that.mgroupName=='黑化'){
that.form.test_file = that.test_file;
}
that.$API.wpm.mlog.change.req(that.form.id, that.form).then((res) => {

View File

@ -34,7 +34,8 @@
</el-select>
</el-form-item>
<el-form-item label="批次号" prop="wm_in">
<el-select
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange"></el-input>
<!-- <el-select
v-model="form.wm_in"
placeholder="交接物料"
clearable
@ -56,24 +57,12 @@
><span>{{ item.count }}</span>
</div>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="领用数量">
<el-input-number
v-model="form.count_use"
:min="1"
controls-position="right"
/>
</el-form-item>
<el-form-item label="所在层数">
<el-input v-model="form.note"/>
</el-select> -->
</el-form-item>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
@ -85,9 +74,8 @@ const defaultForm = {
mlog: "",
mtask: "",
batch: "",
count_use: "",
count_use: 1,
};
export default {
props: {
mlog: {
@ -131,6 +119,7 @@ export default {
},
],
},
wm_in:'',
options: [],
materialOptions: [],
visible: false,
@ -168,24 +157,28 @@ export default {
that.materialOptions = res;
});
},
//
formWminChange(){
//
this.materialOptions.forEach((item) => {
if (item.batch == this.wm_in) {
this.form.wm_in = item.id;
//
this.submit();
}
});
},
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
that.form.mlog = that.mlog;
that.$API.wpm.mlogb.in
.req(that.form)
.then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
that.isSaveing = false;
});
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
that.$emit("mlogbinSuccess");
that.$message.success("添加成功");
}).catch((err) => {
});
}
});
},