fix:光芯日志可选择工艺步骤
This commit is contained in:
parent
22bdea774a
commit
bb806e4fb4
|
@ -17,6 +17,27 @@
|
|||
style="padding: 0"
|
||||
>
|
||||
<el-row>
|
||||
<el-col v-if="route==null">
|
||||
<el-form-item label="工艺步骤">
|
||||
<el-select
|
||||
v-model="form.route"
|
||||
placeholder="工艺步骤"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@change="changeRoute"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in routeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>[{{ item.routepack_name }}]{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="批次号" prop="wm_in">
|
||||
<el-select
|
||||
|
@ -429,6 +450,21 @@ export default {
|
|||
that.form.handle_date = that.$TOOL.dateFormat2(new Date());;
|
||||
},
|
||||
methods: {
|
||||
// getRoute() {
|
||||
// let that = this;
|
||||
// that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => {
|
||||
// that.routeOptions = res;
|
||||
// });
|
||||
// },
|
||||
changeRoute(){
|
||||
let that = this;
|
||||
that.routeOptions.forEach(item=>{
|
||||
if(item.id==that.form.route){
|
||||
console.log('item',item)
|
||||
that.getdefects(item.id,item.material_in,item.material_out);
|
||||
}
|
||||
})
|
||||
},
|
||||
getTeam() {
|
||||
let that = this;
|
||||
let form = {};
|
||||
|
@ -475,9 +511,11 @@ export default {
|
|||
that.getUserList();
|
||||
});
|
||||
},
|
||||
getdefects(){
|
||||
getdefects(route,material_in,material_out){
|
||||
let that = this;
|
||||
if(that.is_fix){
|
||||
console.log('getdefects')
|
||||
if(that.is_fix&&that.materialFix!==null&&that.materialFix!==''){
|
||||
console.log('that.materialFix',that.materialFix)
|
||||
that.$API.qm.qct.getQct.req({material: that.materialFix,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
|
@ -494,37 +532,42 @@ export default {
|
|||
}
|
||||
})
|
||||
}else{
|
||||
that.$API.qm.qct.getQct.req({material: that.material_in,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_indefects=res.qct_defects;
|
||||
if(that.mlogindefect.length>0){
|
||||
that.qct_indefects.forEach(item => {
|
||||
that.mlogindefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectinform[item.defect_name] = item2.count;
|
||||
}
|
||||
})
|
||||
console.log('route',route)
|
||||
if(route!==null){
|
||||
console.log('material_in',material_in)
|
||||
console.log('material_out',material_out)
|
||||
that.$API.qm.qct.getQct.req({material:material_in,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
})
|
||||
}
|
||||
})
|
||||
//material_out
|
||||
that.$API.qm.qct.getQct.req({material: that.material_out,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
if(that.mlogdefect.length>0){
|
||||
that.qct_defects.forEach(item => {
|
||||
that.mlogdefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectform[item.defect_name] = item2.count;
|
||||
}
|
||||
that.qct_indefects=res.qct_defects;
|
||||
if(that.mlogindefect.length>0){
|
||||
that.qct_indefects.forEach(item => {
|
||||
that.mlogindefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectinform[item.defect_name] = item2.count;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
//material_out
|
||||
that.$API.qm.qct.getQct.req({material:material_out,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
})
|
||||
}
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
if(that.mlogdefect.length>0){
|
||||
that.qct_defects.forEach(item => {
|
||||
that.mlogdefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
that.defectform[item.defect_name] = item2.count;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
getEquipment() {
|
||||
|
@ -542,18 +585,23 @@ export default {
|
|||
getRoute() {
|
||||
let that = this;
|
||||
if(!that.is_fix){//正常生产
|
||||
that.$API.mtm.route.item.req(that.route).then(res=>{
|
||||
that.material_in = res.material_in;
|
||||
that.material_out = that.form.material_out = res.material_out;
|
||||
if(that.mlogId){
|
||||
that.getMlogObj();
|
||||
}else{
|
||||
that.getdefects();
|
||||
}
|
||||
|
||||
});
|
||||
if(that.route==null){
|
||||
that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => {
|
||||
that.routeOptions = res;
|
||||
});
|
||||
}else{
|
||||
that.$API.mtm.route.item.req(that.route).then(res=>{
|
||||
that.material_in = res.material_in;
|
||||
that.material_out = that.form.material_out = res.material_out;
|
||||
});
|
||||
}
|
||||
if(that.mlogId){
|
||||
that.getMlogObj();
|
||||
}
|
||||
}else{
|
||||
// that.getdefects();
|
||||
that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => {
|
||||
that.routeOptions = res;
|
||||
});
|
||||
}
|
||||
},
|
||||
//获取工段人员
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<el-card style="width: 100%" header="基本信息" shadow="never">
|
||||
<el-button type="primary" @click="handlePrint" style="position: absolute;right: 20px;">打印</el-button>
|
||||
<el-descriptions>
|
||||
<el-descriptions-item label="工艺路线">{{
|
||||
<el-descriptions-item label="工艺步骤">{{
|
||||
fmlogItem.route_name
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="任务编号">{{
|
||||
|
@ -29,8 +29,7 @@
|
|||
v-if="fmlogItem.submit_time == null"
|
||||
icon="el-icon-plus"
|
||||
@click="table_add"
|
||||
>新增</el-button
|
||||
>
|
||||
>新增</el-button>
|
||||
<scScanner @scanResult="codeTextChange" style="margin:0 10px;"></scScanner>
|
||||
<el-input
|
||||
ref="codeInput"
|
||||
|
@ -263,10 +262,11 @@ export default {
|
|||
that.fmlogItem = res;
|
||||
that.route = res.route;
|
||||
that.is_fix = res.is_fix;
|
||||
that.material_in = that.material_in;
|
||||
that.material_out = that.material_out;
|
||||
that.paramsWm.mgroup = res.mgroup;
|
||||
that.apiObjWm = that.$API.wpm.wmaterial.list;
|
||||
that.getMlogs();
|
||||
|
||||
});
|
||||
},
|
||||
getMlogs(){
|
||||
|
|
|
@ -10,9 +10,11 @@
|
|||
<el-card style="width: 100%" header="基本信息" shadow="never">
|
||||
<el-button type="primary" @click="handlePrint" style="position: absolute;right: 20px;">打印</el-button>
|
||||
<el-descriptions>
|
||||
<el-descriptions-item label="工艺路线">{{
|
||||
mlogItem.routepack_name
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工艺步骤">
|
||||
<el-tag v-if="mlogItem.is_fix" type="warning">返工</el-tag>
|
||||
<span v-if="mlogItem.material_in_name!==null">{{mlogItem.material_in_name}}-></span>
|
||||
<span v-if="mlogItem.material_out_name!==null">{{mlogItem.material_out_name}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="输入物料">{{
|
||||
mlogItem.material_in_name
|
||||
}}</el-descriptions-item>
|
||||
|
@ -344,6 +346,8 @@
|
|||
:mgroupName = "mgroupName"
|
||||
:codeText = "codeText"
|
||||
:materialIn="materialIn"
|
||||
:process = "process"
|
||||
:hasRoute = "hasRoute"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
|
@ -603,6 +607,9 @@ export default {
|
|||
let that = this;
|
||||
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
|
||||
that.mlogItem = res;
|
||||
if(res.route!==null){
|
||||
this.hasRoute = true;
|
||||
}
|
||||
that.mgroupName = res.mgroup_name;
|
||||
if(res.test_file!==null){
|
||||
that.fileList = [{name:res.test_file,url:res.test_file}];
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mlogtype!=='rework'">
|
||||
<el-form-item label="工艺步骤" prop="route">
|
||||
<el-form-item label="工艺步骤">
|
||||
<el-select
|
||||
v-model="form.route"
|
||||
placeholder="工艺步骤"
|
||||
|
@ -72,6 +72,7 @@
|
|||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>[{{ item.routepack_name }}]{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
|
@ -16,6 +16,28 @@
|
|||
label-width="100px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col v-if="!hasRoute">
|
||||
<el-form-item label="工艺步骤" prop="route">
|
||||
<el-select
|
||||
v-model="form.route"
|
||||
placeholder="工艺步骤"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
:disabled="mode == 'edit'"
|
||||
@change="routeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in routeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>[{{ item.routepack_name }}]{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="批次号" prop="wm_in">
|
||||
<xtSelect
|
||||
|
@ -36,36 +58,10 @@
|
|||
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count" width="110px"></el-table-column>
|
||||
<el-table-column label="车间库存" prop="count" width="110px"></el-table-column>
|
||||
<el-table-column label="可用数量" prop="count_cando" width="110px"></el-table-column>
|
||||
</xtSelect>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="批次号" prop="wm_in">
|
||||
<el-select
|
||||
v-model="form.wm_in"
|
||||
placeholder="物料"
|
||||
clearable
|
||||
filterable
|
||||
class="width-100"
|
||||
@change="materialBatchChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item.id"
|
||||
>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<div>
|
||||
<span v-if="item.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
|
||||
<span v-if="item.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
|
||||
<span>{{ item.batch }}({{ item.material_name }})</span>
|
||||
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
|
||||
</div>
|
||||
<span>{{ item.count }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联任务">
|
||||
|
@ -100,7 +96,8 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item :label="mgroupMtype==10?'领用数量':'批次总数'">
|
||||
<el-input-number
|
||||
v-model="selectObj.count_cando"
|
||||
v-model="form.count_use"
|
||||
:max="selectObj.count_cando"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
|
@ -191,6 +188,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { max } from 'd3';
|
||||
|
||||
const defaultForm = {
|
||||
mlog: "",
|
||||
mtask: "",
|
||||
|
@ -225,6 +224,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasRoute:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
mgroupMtype:{
|
||||
type: String,
|
||||
default: "",
|
||||
|
@ -233,6 +236,11 @@ export default {
|
|||
type:Array,
|
||||
default:()=>[]
|
||||
},
|
||||
process:{
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
|
||||
},
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
|
@ -269,6 +277,7 @@ export default {
|
|||
options: [],
|
||||
cellsList:[],
|
||||
qct_defects:[],
|
||||
routeOptions: [],
|
||||
materialOptions: [],
|
||||
defectform:{},
|
||||
visible: false,
|
||||
|
@ -307,7 +316,13 @@ export default {
|
|||
// that.getMaterial();
|
||||
}
|
||||
if(that.is_fix){}else{
|
||||
this.getdefects();
|
||||
console.log('that.materialIn' ,that.materialIn);
|
||||
if(that.materialIn!==''&&that.materialIn!==null){
|
||||
this.getdefects(that.materialIn);
|
||||
}
|
||||
}
|
||||
if(!this.hasRoute){
|
||||
this.getRoute();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -322,12 +337,29 @@ export default {
|
|||
this.cellsList = data.count_json_from;
|
||||
}
|
||||
},
|
||||
getRoute() {
|
||||
let that = this;
|
||||
that.$API.mtm.route.list
|
||||
.req({ process: that.process, page: 0, routepack__state: 30 })
|
||||
.then((res) => {
|
||||
that.routeOptions = res;
|
||||
if(res.length==1){
|
||||
that.form.route = res[0].id;
|
||||
}
|
||||
});
|
||||
},
|
||||
getMtask() {
|
||||
let that = this;
|
||||
this.$API.pm.mtask.list.req({ page: 0, mgroup: that.mgroup, state: 20 }).then((res) => {
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
routeChange(){
|
||||
let that = this;
|
||||
that.$API.mtm.route.item.req(that.form.route).then((res) => {
|
||||
that.form.parent = res.parent;
|
||||
});
|
||||
},
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
let that = this;
|
||||
|
@ -363,18 +395,18 @@ export default {
|
|||
});
|
||||
})
|
||||
},
|
||||
getdefects(){
|
||||
getdefects(material){
|
||||
let that = this;
|
||||
let material = that.is_fix?that.materialFix:that.materialIn;
|
||||
// let material = that.is_fix?that.materialFix:that.materialIn;
|
||||
that.$API.qm.qct.getQct.req({material: material,tag:'process'}).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
let count_pn_jgqbl = 0;
|
||||
if(data.mlogbdefect.length>0){
|
||||
if(res.mlogbdefect.length>0){
|
||||
that.qct_defects.forEach(item => {
|
||||
data.mlogbdefect.forEach(item2=>{
|
||||
res.mlogbdefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
count_pn_jgqbl+=item2.count;
|
||||
that.defectform[item.defect_name] = item2.count;
|
||||
|
@ -387,19 +419,12 @@ export default {
|
|||
materialBatchChange(){
|
||||
let that = this;
|
||||
that.form.batch = that.selectObj.batch;
|
||||
that.form.count_use = that.selectObj.count;
|
||||
that.form.count_use = that.selectObj.count_cando;
|
||||
that.batch_count = that.selectObj.count;
|
||||
that.materialFix = that.selectObj.material;
|
||||
that.getdefects();
|
||||
// that.materialOptions.forEach(item => {
|
||||
// if(item.id==that.form.wm_in){
|
||||
// that.form.batch = item.batch;
|
||||
// that.form.count_use = item.count;
|
||||
// that.batch_count = item.count;
|
||||
// that.materialFix = item.material;
|
||||
// that.getdefects();
|
||||
// }
|
||||
// });
|
||||
if(that.is_fix){
|
||||
that.materialFix = that.selectObj.material;
|
||||
}
|
||||
that.getdefects(that.selectObj.material);
|
||||
},
|
||||
//添加层组
|
||||
cellsAdd(){
|
||||
|
|
|
@ -78,17 +78,13 @@
|
|||
<el-table-column
|
||||
label="生产设备"
|
||||
prop="equipment_name"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="进度" prop="belong_dept_name" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<template #default="scope">
|
||||
<el-progress id="progressbwlq" :percentage="customMethod(scope.row,1)" :stroke-width="20" :color="customMethod(scope.row,2)" :text-inside="true"><span>{{customMethod(scope.row,3)}}</span></el-progress>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="部门/工段"
|
||||
prop="belong_dept_name"
|
||||
>
|
||||
<el-table-column label="部门/工段" prop="belong_dept_name">
|
||||
<template #default="scope">
|
||||
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||
</template>
|
||||
|
@ -115,13 +111,13 @@
|
|||
label="结束时间"
|
||||
prop="work_end_time"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="是否提交">
|
||||
<el-table-column label="审批单号">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.submit_time != null" color="green">
|
||||
<CircleCheckFilled />
|
||||
<el-icon v-if="scope.row.ticket !== null" color="green">
|
||||
{{ scope.row.ticket_.sn }}
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="提交时间"
|
||||
prop="submit_time"
|
||||
|
@ -138,22 +134,12 @@
|
|||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<!-- <el-button
|
||||
link
|
||||
size="small"
|
||||
v-auth="'mlog.update'"
|
||||
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>
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
|
@ -161,16 +147,21 @@
|
|||
type="danger"
|
||||
v-if="scope.row.submit_time == null"
|
||||
@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
|
||||
>
|
||||
>撤回</el-button>
|
||||
<el-button
|
||||
link
|
||||
v-if="scope.row.ticket_!== null&&userId==scope.row.ticket_.create_by&&scope.row.ticket_.state_!==null&&scope.row.ticket_.state_.enable_retreat"
|
||||
size="small"
|
||||
type="danger"
|
||||
@click.stop="mlogWf(scope.row)"
|
||||
>撤回审批</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
@ -251,6 +242,7 @@ export default {
|
|||
codeText: "",
|
||||
route_code: "",
|
||||
showHidden:false,
|
||||
userId: this.$TOOL.data.get("USER_INFO").id,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -343,7 +335,15 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
mlogWf(row){
|
||||
this.$confirm(`确定撤回该日志审批吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.wf.ticket.ticketRetreat.req(row.ticket).then(res=>{
|
||||
that.$refs.table.refresh();
|
||||
})
|
||||
})
|
||||
},
|
||||
customMethod(row,index){
|
||||
let color = '',context = '';
|
||||
let percent = 0;
|
||||
|
|
Loading…
Reference in New Issue