fix:4.14-4.18日光子修改
This commit is contained in:
parent
e1b30f92b1
commit
ced71a8aaf
|
|
@ -128,7 +128,7 @@
|
|||
<el-switch v-model="form.is_autotask" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :md="12" :sm="24" v-if="project_code=='bxerp'">
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="切分数量">
|
||||
<el-input-number
|
||||
v-model="form.div_number"
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<el-dialog
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
style="width: 90%;"
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
|
|
@ -314,7 +314,7 @@ export default {
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
mtask: {
|
||||
route: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
|
|
@ -372,7 +372,7 @@ export default {
|
|||
mounted() {
|
||||
this.getShift();
|
||||
this.getMgroup();
|
||||
this.getMtask();
|
||||
this.getRoute();
|
||||
this.gettestitem();
|
||||
this.form.fmlog = this.fmlog;
|
||||
this.form.handle_date = this.$TOOL.dateFormat2(new Date());;
|
||||
|
|
@ -435,9 +435,9 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
getMtask() {
|
||||
getRoute() {
|
||||
let that = this;
|
||||
that.$API.pm.mtask.item.req(that.mtask).then(res=>{
|
||||
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;
|
||||
that.getdefects();
|
||||
|
|
@ -464,12 +464,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// getMtaskb() {
|
||||
// let that = this;
|
||||
// that.$API.pm.mtaskb.list.req({ page: 0, mtask:that.mtask }).then((res) => {
|
||||
// that.mtaskbOtions = res;
|
||||
// });
|
||||
// },
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
let that = this;
|
||||
|
|
@ -499,7 +493,8 @@ export default {
|
|||
that.materialOptions.forEach(item=>{
|
||||
if(item.id == val){
|
||||
that.qct_defects.forEach((item) => {
|
||||
that.form[item.defect_name] = 0;
|
||||
that.defectform[item.defect_name] = 0;
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
})
|
||||
that.materialCount = that.form.count_use =
|
||||
that.form.count_real = that.form.count_ok = item.count;
|
||||
|
|
@ -563,14 +558,18 @@ export default {
|
|||
that.form.mgroup = that.mgroup;
|
||||
let mlogdefect = [],mlogindefect =[];
|
||||
that.qct_defects.forEach(item => {
|
||||
let objin = {};
|
||||
objin.defect = item.defect;
|
||||
objin.count = that.defectinform[item.defect_name];
|
||||
mlogindefect.push(objin);
|
||||
let obj = {};
|
||||
obj.defect = item.defect;
|
||||
obj.count = that.defectform[item.defect_name];
|
||||
mlogdefect.push(obj)
|
||||
if(that.defectinform[item.defect_name]>0){
|
||||
let objin = {};
|
||||
objin.defect = item.defect;
|
||||
objin.count = that.defectinform[item.defect_name];
|
||||
mlogindefect.push(objin);
|
||||
}
|
||||
if(that.defectform[item.defect_name]>0){
|
||||
let obj = {};
|
||||
obj.defect = item.defect;
|
||||
obj.count = that.defectform[item.defect_name];
|
||||
mlogdefect.push(obj)
|
||||
}
|
||||
})
|
||||
that.form.qct = that.qct;
|
||||
that.form.mlogdefect = mlogdefect;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<el-button type="primary" @click="handlePrint" style="position: absolute;right: 20px;">打印</el-button>
|
||||
<el-descriptions>
|
||||
<el-descriptions-item label="工艺路线">{{
|
||||
fmlogItem.routepack_name
|
||||
fmlogItem.route_name
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="任务编号">{{
|
||||
fmlogItem.mtask_number
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
@row-click="table_detail"
|
||||
>
|
||||
<el-table-column type="index" width="50"></el-table-column>
|
||||
<el-table-column type="expand">
|
||||
<!-- <el-table-column type="expand">
|
||||
<template #default="props">
|
||||
<div style="padding-left: 50px">
|
||||
<el-descriptions :column="2">
|
||||
|
|
@ -106,7 +106,8 @@
|
|||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="批次号" prop="batch" min-width="80"></el-table-column>
|
||||
<el-table-column label="操作员" prop="handle_user_name" min-width="80"></el-table-column>
|
||||
<el-table-column label="设备" prop="equipment_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="领料数" prop="count_use"></el-table-column>
|
||||
|
|
@ -114,8 +115,8 @@
|
|||
<el-table-column label="加工前不良" prop="count_pn_jgqbl"></el-table-column>
|
||||
<el-table-column label="合格数" prop="count_ok"></el-table-column>
|
||||
<el-table-column label="不合格数" prop="count_notok"></el-table-column>
|
||||
<el-table-column label="开始时间" prop="work_start_time"></el-table-column>
|
||||
<el-table-column label="结束时间" prop="work_end_time"></el-table-column>
|
||||
<!-- <el-table-column label="开始时间" prop="work_start_time"></el-table-column>
|
||||
<el-table-column label="结束时间" prop="work_end_time"></el-table-column> -->
|
||||
<el-table-column label="班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
|
|
@ -176,7 +177,7 @@
|
|||
ref="saveDialogs"
|
||||
:fmlog="fmlogId"
|
||||
:mgroup="mgroup"
|
||||
:mtask="mtask"
|
||||
:route="route"
|
||||
:process="processId"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
|
|
@ -295,7 +296,6 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
this.codeTextChange(codeText);
|
||||
})
|
||||
|
||||
}
|
||||
this.visible = true;
|
||||
},
|
||||
|
|
@ -304,6 +304,7 @@ export default {
|
|||
let that = this;
|
||||
that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => {
|
||||
that.fmlogItem = res;
|
||||
that.route = res.route;
|
||||
that.paramsWm.mgroup = res.mgroup;
|
||||
that.$API.wpm.mlog.list.req(that.params).then((res) => {
|
||||
that.tableData = res;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联任务" prop="mtask">
|
||||
<el-form-item label="关联任务">
|
||||
<el-select
|
||||
v-model="form.mtask"
|
||||
placeholder="关联任务"
|
||||
|
|
@ -42,7 +42,6 @@
|
|||
v-model="form.route"
|
||||
placeholder="工艺路线"
|
||||
clearable
|
||||
disabled
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
|
|
@ -52,11 +51,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>
|
||||
|
|
@ -88,6 +83,7 @@ const defaultForm = {
|
|||
mtask:"",
|
||||
mgroup:"",
|
||||
note:'',
|
||||
is_fix:false,
|
||||
};
|
||||
|
||||
export default {
|
||||
|
|
@ -137,7 +133,7 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
|
||||
is_fix:false,
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
|
|
@ -173,8 +169,11 @@ export default {
|
|||
});
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
open(mode = "add",text) {
|
||||
this.mode = mode;
|
||||
if(text){
|
||||
this.is_fix = true;
|
||||
}
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
|
|
@ -195,10 +194,12 @@ export default {
|
|||
//表单提交方法
|
||||
submit() {
|
||||
let that = this;
|
||||
console.log(this.form)
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
if (that.mode === "add") {
|
||||
that.form.is_fix = that.is_fix;
|
||||
that.form.mgroup = that.mgroup;
|
||||
that.$API.wpm.fmlog.create.req(that.form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
:query="params"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="工艺路线" prop="routepack_name">
|
||||
<el-table-column label="工艺路线" prop="route_name" :min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="任务编号" prop="mtask_number">
|
||||
</el-table-column>
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time"></el-table-column>
|
||||
<el-table-column label="启用">
|
||||
<el-table-column label="启用" width="80">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.enabled" @change="enabledChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@
|
|||
size="small"
|
||||
@click="table_receive(scope.row)"
|
||||
type="success"
|
||||
v-if="(scope.row.recive_mgroup == mgroupId||scope.row.recive_dept == deptId)&&scope.row.submit_time == null"
|
||||
v-if="scope.row.recive_mgroup == mgroupId&&scope.row.submit_time == null"
|
||||
>接收</el-button>
|
||||
<el-button
|
||||
link
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<el-row>
|
||||
<el-form-item label="交接物料">
|
||||
<el-button type="primary" @click="addMaterial" v-if="mode!=='show'">手动添加</el-button>
|
||||
<scScanner @scanResult="codeTextChange(10)"></scScanner>
|
||||
<scScanner @scanResult="codeTextChange"></scScanner>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-input
|
||||
|
|
@ -538,6 +538,10 @@ export default {
|
|||
let that = this;
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if(that.mtype==20||that.mtype==30){
|
||||
that.form.recive_mgroup = that.form.send_mgroup;
|
||||
that.form.mtype = that.mtype;
|
||||
}
|
||||
if(that.mtype==20||that.mtype==30||that.type==40){
|
||||
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
|
|
@ -598,7 +602,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
let that = this;
|
||||
data = data.replace(' ','');
|
||||
// data = data.replace(' ','');
|
||||
let id = data.split('#')[1];
|
||||
this.$API.cm.labelmat.item.req(id).then((res) => {
|
||||
let arr = that.form.handoverb.filter((item) => {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="listItem.batch" disabled></el-input>
|
||||
<el-input v-model="listItem.batch"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
|
|
@ -224,6 +224,7 @@ export default {
|
|||
if(total>that.totalCount){
|
||||
that.$message.error("分配数量不能大于总数量");
|
||||
}else{
|
||||
that.form.wm = that.batchOrign.id;
|
||||
if (that.mode == "add") {
|
||||
that.$API.wpm.handover.create.req(that.form).then((res) => {
|
||||
that.$API.wpm.handover.submit.req(res.id).then((res1) => {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" v-auth="'mio.do'" @click="tomio('do_out')">领料</el-button>
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">返修</el-button>
|
||||
<!-- <el-button type="primary" v-auth="'mio.do'" @click="tomio('do_out')">领料</el-button> -->
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">返工</el-button>
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">报废</el-button>
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</el-button>
|
||||
<scScanner :labeltext="'返修扫码'" @scanResult="codeTextChange20"></scScanner>
|
||||
<scScanner :labeltext="'返工扫码'" @scanResult="codeTextChange20"></scScanner>
|
||||
<scScanner :labeltext="'报废扫码'" @scanResult="codeTextChange40"></scScanner>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
@closed="dialog.save = false"
|
||||
>
|
||||
</check-dialog> -->
|
||||
<!-- 返修/报废 -->
|
||||
<!-- 返工/报废 -->
|
||||
<scrap-dialog
|
||||
v-if="dialog.scrap"
|
||||
ref="scrapDialog"
|
||||
|
|
@ -265,7 +265,7 @@ export default {
|
|||
stateOptions:[
|
||||
{ value: 10, name: "合格"},
|
||||
{ value: 20, name: "不合格"},
|
||||
{ value: 30, name: "返修"},
|
||||
{ value: 30, name: "返工"},
|
||||
],
|
||||
queryWm: {
|
||||
search: "",
|
||||
|
|
@ -366,7 +366,7 @@ export default {
|
|||
this.$refs.showDrawer.open();
|
||||
});
|
||||
},
|
||||
//添加返修/报废
|
||||
//添加返工/报废
|
||||
table_add(type) {
|
||||
this.dialog.scrap = true;
|
||||
this.type = type;
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" v-auth="'mio.do'" @click="tomio('do_in')">入库</el-button>
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">返修</el-button>
|
||||
<!-- <el-button type="primary" v-auth="'mio.do'" @click="tomio('do_in')">入库</el-button> -->
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">返工</el-button>
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">报废</el-button>
|
||||
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</el-button>
|
||||
<scScanner :labeltext="'返修扫码'" @scanResult="codeTextChange20"></scScanner>
|
||||
<scScanner :labeltext="'返工扫码'" @scanResult="codeTextChange20"></scScanner>
|
||||
<scScanner :labeltext="'报废扫码'" @scanResult="codeTextChange40"></scScanner>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
:cate = "cate_type"
|
||||
:process = "processId"
|
||||
:mgroupId = "mgroupId"
|
||||
:deptId = "params.belong_dept"
|
||||
:deptId = "deptId"
|
||||
@success="handleinmSuccess"
|
||||
>
|
||||
</save-dialog>
|
||||
|
|
@ -261,7 +261,7 @@ export default {
|
|||
stateOptions:[
|
||||
{ value: 10, name: "合格"},
|
||||
{ value: 20, name: "不合格"},
|
||||
{ value: 30, name: "返修"},
|
||||
{ value: 30, name: "返工"},
|
||||
],
|
||||
queryWm: {
|
||||
search: "",
|
||||
|
|
@ -345,7 +345,7 @@ export default {
|
|||
})
|
||||
}
|
||||
},
|
||||
//添加返修/报废
|
||||
//添加返工/报废
|
||||
table_add(type) {
|
||||
this.dialog.scrap = true;
|
||||
this.type = type;
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ export default {
|
|||
if(data==''||data==undefined||data==null){
|
||||
return;
|
||||
}
|
||||
data = data.replace(' ','');
|
||||
// data = data.replace(' ','');
|
||||
let id = data.split('#')[1];
|
||||
this.$API.cm.labelmat.item.req(id).then((res) => {
|
||||
console.log('res',res);
|
||||
|
|
@ -336,16 +336,29 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
selectBatchChange(item) {
|
||||
this.form.batch = item.batch;
|
||||
this.form.warehouse = item.warehouse;
|
||||
this.form.mb = item.id;
|
||||
selectBatchChange(id) {
|
||||
let that = this;
|
||||
that.batchOptions.forEach((item) => {
|
||||
if(item.id == id){
|
||||
console.log('item',item);
|
||||
this.form.batch = item.batch;
|
||||
this.form.warehouse = item.warehouse;
|
||||
this.form.mb = item.id;
|
||||
that.form.count = Number(item.count);
|
||||
}
|
||||
})
|
||||
},
|
||||
//选择车间库存物料后的处理
|
||||
selectwmChange(item){
|
||||
selectwmChange(id){
|
||||
let that = this;
|
||||
that.form.batch = item.batch;
|
||||
that.form.wm = item.id;
|
||||
that.wbatchOptions.forEach((item) => {
|
||||
if(item.id == id){
|
||||
console.log('item',item);
|
||||
that.form.batch = item.batch;
|
||||
that.form.wm = item.id;
|
||||
that.form.count = Number(item.count);
|
||||
}
|
||||
})
|
||||
},
|
||||
selectBatchClear() {
|
||||
this.form.batch = "";
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@
|
|||
:process = "processId"
|
||||
:mgroupId = "mgroupId"
|
||||
:deptId = " deptId"
|
||||
@closed = "handleinmSuccess"
|
||||
@success="handleinmSuccess"
|
||||
>
|
||||
</save-dialog>
|
||||
|
|
@ -318,8 +319,7 @@ export default {
|
|||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
handleinmSuccess(){},
|
||||
handleSaveSuccess() {
|
||||
handleinmSuccess(){
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@
|
|||
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
|
||||
<el-form-item :label="item.defect_name">
|
||||
<el-input-number
|
||||
v-model="defectform[item.defect_name]"
|
||||
v-model="defectinform[item.defect_name]"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
controls-position="right"
|
||||
|
|
@ -330,6 +330,8 @@
|
|||
ref="saveDialog"
|
||||
:mlog="mlogId"
|
||||
:mgroup="mgroup"
|
||||
:is_fix = "is_fix"
|
||||
:mgroupMtype="mgroupMtype"
|
||||
:mgroupName = "mlogItem.mgroup_name"
|
||||
:codeText = "codeText"
|
||||
:materialIn="materialIn"
|
||||
|
|
@ -340,6 +342,7 @@
|
|||
<check-dialog
|
||||
v-if="dialog.check"
|
||||
ref="checkDialog"
|
||||
:mgroupMtype="mgroupMtype"
|
||||
@success="handleCheckSuccess"
|
||||
@closed="dialog.check = false"
|
||||
>
|
||||
|
|
@ -462,6 +465,10 @@ export default {
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
mgroupMtype:{
|
||||
type: String,
|
||||
default: "",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
editDialog,
|
||||
|
|
@ -522,7 +529,7 @@ export default {
|
|||
4: "已完成",
|
||||
5: "已关闭",
|
||||
},
|
||||
defectform:{},
|
||||
defectinform:{},
|
||||
fileList:[],
|
||||
cellsList:[],
|
||||
qct_defects:[],
|
||||
|
|
@ -548,6 +555,7 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
is_fix:false,
|
||||
wmId:'',
|
||||
wmtype:'',
|
||||
batchContains:'',
|
||||
|
|
@ -578,6 +586,7 @@ export default {
|
|||
that.fileList = [{name:res.test_file,url:res.test_file}];
|
||||
that.form.test_file = res.test_file;
|
||||
}
|
||||
that.is_fix = res.is_fix;
|
||||
that.mgroup = res.mgroup;
|
||||
that.paramsWm.mgroup = res.mgroup;
|
||||
that.materialIn = res.material_in;
|
||||
|
|
@ -601,13 +610,13 @@ export default {
|
|||
if(res.length>0){
|
||||
that.$API.qm.qct.item.req(res[0].id).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
console.log('that.saveInForm.mlogbdefect',that.saveInForm.mlogbdefect);
|
||||
if(that.saveInForm.mlogbdefect&&that.saveInForm.mlogbdefect.length>0){
|
||||
that.saveInForm.mlogbdefect.forEach((item) => {
|
||||
that.defectform[item.defect_name] = Number(item.count);
|
||||
that.defectinform[item.defect_name] = Number(item.count);
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
@ -620,7 +629,7 @@ export default {
|
|||
that.saveInForm.count_pn_jgqbl = 0;
|
||||
that.qct_defects.forEach(item => {
|
||||
if(item.defect_okcate==30){
|
||||
that.saveInForm.count_pn_jgqbl += that.defectform[item.defect_name];
|
||||
that.saveInForm.count_pn_jgqbl += that.defectinform[item.defect_name];
|
||||
}
|
||||
})
|
||||
// that.countCellChanges();
|
||||
|
|
@ -643,15 +652,24 @@ export default {
|
|||
table_add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open();
|
||||
this.$refs.saveDialog.open('add');
|
||||
});
|
||||
},
|
||||
//自检
|
||||
table_in_edit(row) {
|
||||
this.saveInForm = row;
|
||||
this.getdefects();
|
||||
this.saveInDialog = true;
|
||||
let that = this;
|
||||
if(that.mlogItem.mgroup_name=='黑化'||that.mlogItem.mgroup_name=='退火'){
|
||||
that.dialog.save = true;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.saveDialog.open('edit',row);
|
||||
});
|
||||
}else{
|
||||
that.saveInForm = row;
|
||||
that.getdefects();
|
||||
that.saveInDialog = true;
|
||||
}
|
||||
},
|
||||
|
||||
//提交自检
|
||||
saveInSubmit() {
|
||||
let that = this;
|
||||
|
|
@ -659,17 +677,17 @@ export default {
|
|||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
let obj = {};
|
||||
let count_pn_jgqbl = 0,mlogbdefect=[];
|
||||
let count_pn_jgqbl = 0,mlogbindefect=[];
|
||||
that.qct_defects.forEach(item => {
|
||||
count_pn_jgqbl += that.defectform[item.defect_name] ;
|
||||
count_pn_jgqbl += that.defectinform[item.defect_name] ;
|
||||
let obj = {};
|
||||
obj.defect = item.defect;
|
||||
obj.count = that.defectform[item.defect_name];
|
||||
obj.count = that.defectinform[item.defect_name];
|
||||
obj.mlogb = that.saveInForm.id;
|
||||
mlogbdefect.push(obj);
|
||||
mlogbindefect.push(obj);
|
||||
})
|
||||
obj.count_use = that.saveInForm.count_use;
|
||||
obj.mlogbdefect = mlogbdefect;
|
||||
obj.mlogbindefect = mlogbindefect;
|
||||
obj.count_pn_jgqbl = count_pn_jgqbl;
|
||||
that.$API.wpm.mlogb.updateIn.req(that.saveInForm.id, obj).then((res) => {
|
||||
that.isSaveing = false;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-col :md="12" :sm="24" v-if="mlogtype!=='rework'">
|
||||
<el-form-item label="工艺路线" prop="route">
|
||||
<el-select
|
||||
v-model="form.route"
|
||||
|
|
@ -132,12 +132,12 @@
|
|||
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="结束时间" prop="work_end_time">
|
||||
<!-- :disabledDate="disabledDateFn" -->
|
||||
<el-date-picker
|
||||
v-model="form.work_end_time"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
:disabledDate="disabledDateFn"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -196,24 +196,6 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<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="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<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
|
||||
|
|
@ -351,7 +333,9 @@ export default {
|
|||
{ id: 10, name: "自产" },
|
||||
{ id: 20, name: "外协" },
|
||||
],
|
||||
mlogtype:"",
|
||||
codeText:"",
|
||||
is_fix:false,
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
|
|
@ -367,6 +351,8 @@ export default {
|
|||
this.getSupplier();
|
||||
this.getEquipment();
|
||||
this.gettestitem();
|
||||
let date = new Date();
|
||||
this.form.work_start_time = this.form.work_end_time = this.$TOOL.dateFormat(date)
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -425,7 +411,14 @@ export default {
|
|||
//显示
|
||||
open(mode = "add",text) {
|
||||
this.mode = mode;
|
||||
this.codeText = text;
|
||||
if(text=='rework'){
|
||||
this.mlogtype = 'rework';
|
||||
this.form.mtype=10;
|
||||
this.form.is_fix=true;
|
||||
}else{
|
||||
this.codeText = text;
|
||||
}
|
||||
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-main style="padding: 0">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-col :md="12" :sm="24" v-if="mgroupMtype==10">
|
||||
<el-form-item label="实际生产数">
|
||||
<el-input-number
|
||||
v-model="form.count_real"
|
||||
|
|
@ -36,8 +36,111 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mgroupMtype==20">
|
||||
<el-form-item label="接收总数">
|
||||
<el-input-number v-if="canWrite"
|
||||
v-model="form.count_real"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="countChange"
|
||||
/>
|
||||
<span v-else>{{ form.count_real }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 如果是外协,合格数合不合格数需要可编辑 mgroup---mtype:20外协 -->
|
||||
<el-row v-if="mgroupMtype==20">
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="合格数">
|
||||
<el-input-number v-if="canWrite"
|
||||
v-model="count_json_wx.ok_num"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span v-else>{{ count_json_wx.ok_num }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="不合格数">
|
||||
<el-input-number v-if="canWrite"
|
||||
v-model="count_json_wx.notok_num"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span v-else>{{ count_json_wx.notok_num }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider></el-divider>
|
||||
<el-col>合格数抽检</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="抽检数">
|
||||
<el-input-number
|
||||
v-model="count_json_wx.count_ok_s"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="count_s_change"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="抽检不合格数">
|
||||
<el-input-number
|
||||
v-model="count_json_wx.count_ok_not"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="count_s_change"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="抽检合格率">
|
||||
<el-input-number
|
||||
v-model="count_json_wx.count_ok_rate"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="是否可入库">
|
||||
<el-switch v-model="count_json_wx.count_canInm"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider></el-divider>
|
||||
<el-col>不合格全检</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="全检合格数">
|
||||
<el-input-number
|
||||
v-model="count_json_wx.count_n_ok"
|
||||
:min="0"
|
||||
:max="count_json_wx.notok_num!==null?count_json_wx.notok_num:0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="count_n_change"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="全检不合格数">
|
||||
<el-input-number
|
||||
v-model="count_json_wx.count_n_not"
|
||||
:min="0"
|
||||
:max="count_json_wx.notok_num!==null?count_json_wx.notok_num:0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
@change="count_n_change"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider></el-divider>
|
||||
</el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="合格数量">
|
||||
<el-form-item :label="mgroupMtype==10?'合格数':'入库数'">
|
||||
<el-input-number
|
||||
v-model="form.count_ok"
|
||||
:min="0"
|
||||
|
|
@ -59,7 +162,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="qct_defects.length>0">
|
||||
<el-row v-if="qct_defects.length>0&&mgroupMtype==10">
|
||||
<el-col>不良统计(最大不合格数:<span style="color:red">{{max_defect_rate}}</span>,超过0.5则整层不合格)</el-col>
|
||||
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
|
||||
<el-form-item :label="item.defect_name">
|
||||
|
|
@ -84,36 +187,40 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-divider v-if="mgroupName=='黑化'||mgroupName=='退火'"></el-divider>
|
||||
<el-button
|
||||
v-if="mgroupName=='黑化'||mgroupName=='退火'"
|
||||
icon="el-icon-plus"
|
||||
type="primary"
|
||||
@click="lineAdd"
|
||||
></el-button>
|
||||
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<el-row>
|
||||
<el-col :span="6">所在层数</el-col>
|
||||
<el-col :span="6">本层总数</el-col>
|
||||
<el-col :span="6">抽检数</el-col>
|
||||
<el-col :span="6">不合格数</el-col>
|
||||
<el-col :span="5">所在层数</el-col>
|
||||
<el-col :span="5">本层总数</el-col>
|
||||
<el-col :span="5">抽检数</el-col>
|
||||
<el-col :span="5">不合格数</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom:10px" v-for="item in count_json" :key="item">
|
||||
<el-col :span="6">
|
||||
<el-row style="margin-bottom:10px" v-for="(item,$index) in count_json" :key="item">
|
||||
<el-col :span="5">
|
||||
<el-input-number
|
||||
style="width:90%"
|
||||
v-model="item.floor"
|
||||
:disabled="true"
|
||||
class="width-100"
|
||||
placeholder="层数"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-input-number
|
||||
style="width:90%"
|
||||
v-model="item.count_use"
|
||||
:disabled="true"
|
||||
class="width-100"
|
||||
placeholder="本层总数"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-input-number
|
||||
style="width:90%"
|
||||
v-model="item.count_test"
|
||||
|
|
@ -123,7 +230,7 @@
|
|||
controls-position="right"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-input-number
|
||||
style="width:90%"
|
||||
v-model="item.count_notok"
|
||||
|
|
@ -134,9 +241,11 @@
|
|||
@change="notokChanges"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button @click="lineDel($index)">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
|
|
@ -150,6 +259,12 @@
|
|||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props:{
|
||||
mgroupMtype:{
|
||||
type: String,
|
||||
default: "",
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
|
|
@ -190,35 +305,79 @@ export default {
|
|||
defectform:{},
|
||||
cells:0,
|
||||
cell_start:1,
|
||||
count_cell:20,
|
||||
count_cell:1,
|
||||
options: [],
|
||||
material_out:'',
|
||||
qct_defects:[],
|
||||
count_json:[],
|
||||
count_json_wx:{
|
||||
ok_num:null,
|
||||
notok_num:null,
|
||||
count_ok_s:null,
|
||||
count_ok_not:null,
|
||||
count_ok_rate:null,
|
||||
count_canInm:false,
|
||||
count_n_ok:null,
|
||||
count_n_not:null,
|
||||
},
|
||||
max_defect_rate:null,
|
||||
materialOptions: [],
|
||||
canWrite:false,
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
batchDisabled: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
console.log('mgroupMtype',this.mgroupMtype)
|
||||
if (this.form.batch != null) {
|
||||
this.batchDisabled = true;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(data) {
|
||||
console.log(data)
|
||||
this.visible = true;
|
||||
this.mlogbItem = data;
|
||||
this.count_json = []
|
||||
if(data.count_json_from.length>0){
|
||||
data.count_json_from.forEach((item) => {
|
||||
let cells = item.end-item.start+1;
|
||||
let cells_count = item.count_t/cells;
|
||||
let savNum = item.count_t%cells;
|
||||
for(let i=0;i<cells;i++){
|
||||
let floor = i+item.start;
|
||||
let count_use = i<savNum?cells_count+1:cells_count;
|
||||
let obj= {
|
||||
floor:floor,
|
||||
count_use:count_use,
|
||||
count_test:1,
|
||||
count_notok:0
|
||||
};
|
||||
this.count_json.push(obj);
|
||||
}
|
||||
})
|
||||
}
|
||||
data.count_json.forEach((item) => {
|
||||
item.count_notok = 0;
|
||||
item.count_test = this.count_cell;
|
||||
this.count_json.push(item);
|
||||
})
|
||||
this.form.batch = data.batch;
|
||||
this.form.count_real =this.form.count_ok= data.count_real;
|
||||
if(Number(data.count_notok)>0){
|
||||
this.form.count_real =data.count_real;
|
||||
this.form.count_ok= data.count_ok;
|
||||
this.form.count_notok= data.count_notok;
|
||||
}else{
|
||||
this.form.count_real =this.form.count_ok= data.count_real;
|
||||
}
|
||||
if(data.count_json_wx&&data.count_json_wx.ok_num){
|
||||
this.count_json_wx = data.count_json_wx;
|
||||
}else{
|
||||
this.canWrite = true;
|
||||
this.form.count_ok=null;
|
||||
this.form.count_notok=null;
|
||||
}
|
||||
this.material_out = data.material_out;
|
||||
this.mgroupName = data.mgroup_name;
|
||||
this.getdefects();
|
||||
|
|
@ -236,7 +395,6 @@ export default {
|
|||
}
|
||||
},
|
||||
countChange() {
|
||||
console.log('change');
|
||||
let that = this;
|
||||
that.form.count_notok = 0;
|
||||
that.qct_defects.forEach(item => {
|
||||
|
|
@ -250,7 +408,6 @@ export default {
|
|||
let that = this;
|
||||
let count_notok = 0;
|
||||
that.count_json.forEach(item=>{
|
||||
console.log('item',item);
|
||||
if(that.max_defect_rate!==null&&that.count_cell>0){
|
||||
let notrate = item.count_notok / that.count_cell;
|
||||
if(notrate>that.max_defect_rate){
|
||||
|
|
@ -271,6 +428,27 @@ export default {
|
|||
item.count_test = this.count_cell;
|
||||
})
|
||||
},
|
||||
count_s_change(){
|
||||
let that = this;
|
||||
if(that.count_json_wx.count_ok_not!==null&& that.count_json_wx.count_ok_s!==null){
|
||||
that.count_json_wx.count_ok_rate = (1-that.count_json_wx.count_ok_not/ that.count_json_wx.count_ok_s)*100
|
||||
}
|
||||
},
|
||||
count_n_change(){
|
||||
let that = this;
|
||||
that.form.count_ok = that.count_json_wx.ok_num + that.count_json_wx.count_n_ok;
|
||||
that.form.count_notok = that.count_json_wx.count_n_not;
|
||||
},
|
||||
//添加层组
|
||||
lineAdd(){
|
||||
let that = this;
|
||||
let obj = {floor:null, count_use:null,count_test:null,count_notok:null};
|
||||
that.count_json.push(obj)
|
||||
},
|
||||
//删除层组
|
||||
lineDel(index){
|
||||
this.count_json.splice(index,1)
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
let that = this;
|
||||
|
|
@ -279,30 +457,51 @@ export default {
|
|||
that.isSaveing = true;
|
||||
that.form.mlog = that.mlog;
|
||||
let sum = 0;
|
||||
that.form.count_notok = 0;
|
||||
that.qct_defects.forEach(item => {
|
||||
if(item.defect_okcate==30){
|
||||
that.form.count_notok += that.defectform[item.defect_name] ;
|
||||
}
|
||||
let obj = {};
|
||||
obj.defect = item.defect;
|
||||
obj.count = that.defectform[item.defect_name];
|
||||
obj.mlogb = that.mlogbItem.id;
|
||||
this.form.mlogbdefect.push(obj);
|
||||
|
||||
})
|
||||
that.form.count_ok = that.form.count_real -that.form.count_notok;
|
||||
sum = that.form.count_ok + that.form.count_notok;
|
||||
let obj_form = {};
|
||||
obj_form.count_ok = that.form.count_ok;
|
||||
if(that.mgroupMtype==20){
|
||||
obj_form.count_json_wx = that.count_json_wx;
|
||||
if(that.canWrite){
|
||||
obj_form.count_ok = that.count_json_wx.ok_num;
|
||||
obj_form.count_notok = that.count_json_wx.notok_num;
|
||||
}else{
|
||||
that.qct_defects.forEach(item => {
|
||||
if(item.defect_name=='其他'){
|
||||
let obj = {};
|
||||
obj.defect = item.defect;
|
||||
obj.count = that.count_json_wx.count_n_not;
|
||||
obj.mlogb = that.mlogbItem.id;
|
||||
this.form.mlogbdefect.push(obj);
|
||||
}
|
||||
})
|
||||
obj_form.count_ok = that.count_json_wx.ok_num + that.count_json_wx.count_n_ok;
|
||||
obj_form.count_notok = that.count_json_wx.count_n_not;
|
||||
sum = obj_form.count_ok + obj_form.count_notok;
|
||||
}
|
||||
// if(that.count_json_wx.count_ok_s!==null){
|
||||
|
||||
// }
|
||||
}else{
|
||||
that.qct_defects.forEach(item => {
|
||||
if(item.defect_okcate==30){
|
||||
that.form.count_notok += that.defectform[item.defect_name] ;
|
||||
}
|
||||
let obj = {};
|
||||
obj.defect = item.defect;
|
||||
obj.count = that.defectform[item.defect_name];
|
||||
obj.mlogb = that.mlogbItem.id;
|
||||
this.form.mlogbdefect.push(obj);
|
||||
})
|
||||
that.form.count_ok = that.form.count_real -that.form.count_notok;
|
||||
sum = that.form.count_ok + that.form.count_notok;
|
||||
obj_form.count_ok = that.form.count_ok;
|
||||
obj_form.count_notok = that.form.count_notok;
|
||||
}
|
||||
obj_form.count_real = that.form.count_real;
|
||||
obj_form.count_notok = that.form.count_notok;
|
||||
obj_form.mlogbdefect = that.form.mlogbdefect;
|
||||
if(that.mgroupName=='黑化'||that.mgroupName=='退火'){
|
||||
obj_form.count_json = that.count_json;
|
||||
}
|
||||
if (sum - that.form.count_real == 0) {
|
||||
that.$API.wpm.mlogb.updateOut.req(that.mlogbItem.id, obj_form).then((res) => {
|
||||
that.$API.wpm.mlogb.updateOut.req(that.mlogbItem.id, obj_form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
that.$emit("success");
|
||||
that.visible = false;
|
||||
|
|
@ -311,10 +510,12 @@ export default {
|
|||
.catch((err) => {
|
||||
that.isSaveing = false;
|
||||
});
|
||||
} else {
|
||||
that.isSaveing = false;
|
||||
that.$message.error("使用数量与合格数不合格数数量不对等");
|
||||
}
|
||||
// if (sum - that.form.count_real == 0) {
|
||||
|
||||
// } else {
|
||||
// that.isSaveing = false;
|
||||
// that.$message.error("使用数量与合格数不合格数数量不对等");
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
title="添加日志详情"
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
style="width: 80%;"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
|
|
@ -17,85 +17,74 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联任务">
|
||||
<el-select
|
||||
v-model="form.mtask"
|
||||
placeholder="关联任务"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="getMaterial"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.number"
|
||||
:value="item.id"
|
||||
<el-form-item label="关联任务">
|
||||
<el-select
|
||||
v-model="form.mtask"
|
||||
placeholder="关联任务"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="getMaterial"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="批次号" prop="wm_in">
|
||||
<el-select
|
||||
v-model="form.wm_in"
|
||||
placeholder="物料"
|
||||
clearable
|
||||
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;
|
||||
"
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.number"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>{{ item.batch }}</span
|
||||
><span>{{ item.count }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="领用数量">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<el-form-item label="每层数量">
|
||||
<el-input-number
|
||||
v-model="count_cell"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
@change="countCellChanges"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<el-form-item label="开始层数">
|
||||
<el-input-number
|
||||
v-model="cell_start"
|
||||
:min="1"
|
||||
class="width-100"
|
||||
@change="cellStartChanges"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<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;
|
||||
"
|
||||
>
|
||||
<span>{{ item.batch }}</span
|
||||
><span>{{ item.count }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<el-form-item label="进炉数">
|
||||
<el-input-number
|
||||
v-model="batch_count"
|
||||
class="width-100"
|
||||
:disabled="true"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mgroupMtype==10">
|
||||
<el-form-item :label="mgroupMtype==10?'领用数量':'批次总数'">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" v-if="mgroupMtype==10">
|
||||
<el-form-item label="加工前不良" prop="count_pn_jgqbl">
|
||||
<el-input-number
|
||||
v-model="form.count_pn_jgqbl"
|
||||
|
|
@ -111,49 +100,62 @@
|
|||
<el-input v-model="form.note"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider v-if="(mgroupName=='黑化'||mgroupName=='退火')&&cellsList.length>0"></el-divider>
|
||||
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<el-row v-for="(item) in cellsList" :key="item">
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="所在层数">
|
||||
<el-input-number
|
||||
style="width:90%"
|
||||
v-model="item.floor"
|
||||
</el-row>
|
||||
<el-divider v-if="(mgroupName=='黑化'||mgroupName=='退火')&&cellsList.length>0"></el-divider>
|
||||
<el-button
|
||||
v-if="mgroupName=='黑化'||mgroupName=='退火'"
|
||||
icon="el-icon-plus"
|
||||
type="primary"
|
||||
@click="cellsAdd"
|
||||
></el-button>
|
||||
<template v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<el-row v-for="(item,$index) in cellsList" :key="item">
|
||||
<el-col style="display: flex;">
|
||||
<el-form-item label="第" label-width="50">
|
||||
<el-input-number
|
||||
v-model="item.start"
|
||||
:min="1"
|
||||
class="width-100"
|
||||
placeholder="层数"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="本层数量">
|
||||
<el-input-number
|
||||
style="width:90%"
|
||||
v-model="item.count_use"
|
||||
:min="0"
|
||||
class="width-100"
|
||||
placeholder="本层数量"
|
||||
</el-form-item>
|
||||
<el-form-item label="层到第" label-width="65">
|
||||
<el-input-number
|
||||
v-model="item.end"
|
||||
:min="1"
|
||||
placeholder="层数"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider v-if="qct_defects.length>0"></el-divider>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
|
||||
<el-form-item :label="item.defect_name">
|
||||
<el-input-number
|
||||
v-model="defectform[item.defect_name]"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
controls-position="right"
|
||||
@change="countChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="层,总数:" label-width="80">
|
||||
<el-input-number
|
||||
v-model="item.count_t"
|
||||
:min="0"
|
||||
placeholder="总数量"
|
||||
controls-position="right"
|
||||
@change="countTotalChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-button
|
||||
type="danger"
|
||||
style="margin: 0 20px;"
|
||||
@click="cellsDel($index)">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-divider v-if="qct_defects.length>0"></el-divider>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
|
||||
<el-form-item :label="item.defect_name">
|
||||
<el-input-number
|
||||
v-model="defectinform[item.defect_name]"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
controls-position="right"
|
||||
@change="countChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
|
|
@ -196,6 +198,14 @@ export default {
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
is_fix: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
mgroupMtype:{
|
||||
type: String,
|
||||
default: "",
|
||||
}
|
||||
},
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
|
|
@ -225,15 +235,16 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
cells:0,//层数
|
||||
count_cell:0,//每层数量
|
||||
cell_start:1,//开始层数
|
||||
// cells:0,//层数
|
||||
batch_count:null,
|
||||
// count_cell:0,//每层数量
|
||||
// cell_start:1,//开始层数
|
||||
codeBatch:"",
|
||||
options: [],
|
||||
cellsList:[],
|
||||
qct_defects:[],
|
||||
materialOptions: [],
|
||||
defectform:{},
|
||||
defectinform:{},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
setFiltersVisible: false,
|
||||
|
|
@ -252,43 +263,55 @@ export default {
|
|||
}else{
|
||||
that.getMaterial();
|
||||
}
|
||||
this.getMtask();
|
||||
this.getdefects();
|
||||
// this.getMtask();
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
open(mode="add",data) {
|
||||
this.visible = true;
|
||||
this.form.mtask = "";
|
||||
this.form.wm_in = "";
|
||||
this.form.count_use = 0;
|
||||
this.form.parent = "";
|
||||
this.form = data;
|
||||
this.cellsList = data.count_json_from;
|
||||
},
|
||||
getMtask() {
|
||||
let that = this;
|
||||
this.$API.pm.mtask.list
|
||||
.req({ page: 0, mgroup: that.mgroup, state: 20 })
|
||||
.then((res) => {
|
||||
that.options = res;
|
||||
});
|
||||
this.$API.pm.mtask.list.req({ page: 0, mgroup: that.mgroup, state: 20 }).then((res) => {
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
let that = this;
|
||||
this.$API.wpm.wmaterial.list.req({
|
||||
mtaskx: that.form.mtask,
|
||||
mgroupx: that.mgroup,
|
||||
material: that.materialIn,
|
||||
page: 0,
|
||||
state:10
|
||||
}).then((res) => {
|
||||
let obj = {};
|
||||
obj.mtaskx =that.form.mtask;
|
||||
obj.mgroup = that.mgroup;
|
||||
obj.page =0;
|
||||
if(that.is_fix){
|
||||
obj.state =30;
|
||||
}else{
|
||||
obj.material =that.materialIn;
|
||||
obj.state =10;
|
||||
obj.tag = 'todo';
|
||||
}
|
||||
this.$nextTick(()=>{
|
||||
this.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
that.materialOptions = res;
|
||||
res.forEach(item => {
|
||||
if(item.batch==that.codeBatch){
|
||||
that.form.wm_in = item.id;
|
||||
that.form.count_use = item.count_cando;
|
||||
that.form.count_use = item.count;
|
||||
that.batch_count = item.count;
|
||||
}
|
||||
if(that.form.wm_in == item.id){
|
||||
that.codeBatch=item.batch;
|
||||
that.batch_count = item.count;
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
},
|
||||
getdefects(){
|
||||
let that = this;
|
||||
|
|
@ -296,9 +319,20 @@ export default {
|
|||
if(res.length>0){
|
||||
that.$API.qm.qct.item.req(res[0].id).then((res) => {
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.defectform[item.defect_name] = 0;
|
||||
that.defectinform[item.defect_name] = 0;
|
||||
})
|
||||
that.qct_defects=res.qct_defects;
|
||||
let count_pn_jgqbl = 0;
|
||||
if(data.mlogbindefect.length>0){
|
||||
that.qct_defects.forEach(item => {
|
||||
data.mlogbindefect.forEach(item2=>{
|
||||
if(item.defect==item2.defect){
|
||||
count_pn_jgqbl+=item2.count;
|
||||
that.defectinform[item.defect_name] = item2.count;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
@ -307,17 +341,41 @@ export default {
|
|||
let that = this;
|
||||
that.materialOptions.forEach(item => {
|
||||
if(item.id==that.form.wm_in){
|
||||
that.form.count_use = item.count_cando;
|
||||
that.form.count_use = item.count;
|
||||
that.batch_count = item.count;
|
||||
}
|
||||
});
|
||||
},
|
||||
//添加层组
|
||||
cellsAdd(){
|
||||
let that = this;
|
||||
let obj = {start:null, end:null,count_t:null};
|
||||
that.cellsList.push(obj)
|
||||
},
|
||||
//删除层组
|
||||
cellsDel(index){
|
||||
this.cellsList.splice(index,1)
|
||||
},
|
||||
countTotalChange(){
|
||||
let that = this;
|
||||
let sum = 0,sumTotal=0;
|
||||
that.cellsList.forEach(item=>{
|
||||
sum+=item.count_t;
|
||||
if(sum>that.batch_count){
|
||||
item.count_t=0;
|
||||
that.$message.error('合计数量超过该批次总数量,请重新分配第'+item.start+'层到第'+item.end+'层的数量');
|
||||
}else{
|
||||
sumTotal+=item.count_t;
|
||||
}
|
||||
})
|
||||
that.form.count_use = sumTotal;
|
||||
|
||||
},
|
||||
cellStartChanges(){
|
||||
let that = this;
|
||||
let remaind = (that.form.count_use-that.form.count_pn_jgqbl)%that.count_cell;
|
||||
that.cellsList = [];
|
||||
for(let i=0;i<that.cells;i++){
|
||||
console.log('i',i)
|
||||
console.log((that.cells-i)==1)
|
||||
let obj = {};
|
||||
obj.floor=that.cell_start+i;
|
||||
if((that.cells-i)==1&&remaind>0){
|
||||
|
|
@ -337,7 +395,7 @@ export default {
|
|||
that.form.count_pn_jgqbl = 0;
|
||||
that.qct_defects.forEach(item => {
|
||||
if(item.defect_okcate==30){
|
||||
that.form.count_pn_jgqbl += that.defectform[item.defect_name];
|
||||
that.form.count_pn_jgqbl += that.defectinform[item.defect_name];
|
||||
}
|
||||
})
|
||||
that.countCellChanges();
|
||||
|
|
@ -349,17 +407,18 @@ export default {
|
|||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
that.form.mlog = that.mlog;
|
||||
that.form.count_json = that.cellsList;
|
||||
let count_pn_jgqbl = 0,mlogbdefect=[];
|
||||
if(that.mgroupMtype==10&&that.cellsList.length>0){
|
||||
that.form.count_json_from = that.cellsList;
|
||||
}
|
||||
let count_pn_jgqbl = 0,mlogbindefect=[];
|
||||
that.qct_defects.forEach(item => {
|
||||
count_pn_jgqbl += that.defectform[item.defect_name] ;
|
||||
count_pn_jgqbl += that.defectinform[item.defect_name] ;
|
||||
let obj = {};
|
||||
obj.defect = item.defect;
|
||||
obj.count = that.defectform[item.defect_name];
|
||||
mlogbdefect.push(obj);
|
||||
obj.count = that.defectinform[item.defect_name];
|
||||
mlogbindefect.push(obj);
|
||||
})
|
||||
// that.form.count_use = that.count_use;
|
||||
that.form.mlogbdefect = mlogbdefect;
|
||||
that.form.mlogbindefect = mlogbindefect;
|
||||
that.form.count_pn_jgqbl = count_pn_jgqbl;
|
||||
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,13 @@
|
|||
v-auth="'mlog.create'"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="table_rework"
|
||||
v-auth="'mlog.create'"
|
||||
>返工</el-button
|
||||
>
|
||||
<scScanner @scanResult="codeTextChange"></scScanner>
|
||||
<el-input
|
||||
ref="codeInput"
|
||||
|
|
@ -57,6 +64,10 @@
|
|||
prop="material_out_name"
|
||||
min-width="130"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_out_name!==null">{{scope.row.material_out_name}}</span>
|
||||
<span v-else>返工</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="预计工时"
|
||||
|
|
@ -171,6 +182,7 @@
|
|||
ref="detailDialog"
|
||||
:mlogId="mlogId"
|
||||
:mtask="mtask"
|
||||
:mgroupMtype="mgroupMtype"
|
||||
@closed="detailClose"
|
||||
>
|
||||
</detail-drawer>
|
||||
|
|
@ -265,6 +277,12 @@ export default {
|
|||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
table_rework(){
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add","rework");
|
||||
});
|
||||
},
|
||||
//编辑日志
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue