fix:4.14-4.18日光子修改

This commit is contained in:
shijing 2025-04-18 01:43:05 +08:00
parent e1b30f92b1
commit ced71a8aaf
17 changed files with 596 additions and 288 deletions

View File

@ -128,7 +128,7 @@
<el-switch v-model="form.is_autotask" /> <el-switch v-model="form.is_autotask" />
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col :md="12" :sm="24" v-if="project_code=='bxerp'"> <el-col :md="12" :sm="24">
<el-form-item label="切分数量"> <el-form-item label="切分数量">
<el-input-number <el-input-number
v-model="form.div_number" v-model="form.div_number"

View File

@ -2,8 +2,8 @@
<el-dialog <el-dialog
:title="titleMap[mode]" :title="titleMap[mode]"
v-model="visible" v-model="visible"
:size="1000"
destroy-on-close destroy-on-close
style="width: 90%;"
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<el-container v-loading="loading"> <el-container v-loading="loading">
@ -314,7 +314,7 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mtask: { route: {
type: String, type: String,
default: "", default: "",
}, },
@ -372,7 +372,7 @@ export default {
mounted() { mounted() {
this.getShift(); this.getShift();
this.getMgroup(); this.getMgroup();
this.getMtask(); this.getRoute();
this.gettestitem(); this.gettestitem();
this.form.fmlog = this.fmlog; this.form.fmlog = this.fmlog;
this.form.handle_date = this.$TOOL.dateFormat2(new Date());; this.form.handle_date = this.$TOOL.dateFormat2(new Date());;
@ -435,9 +435,9 @@ export default {
}); });
}); });
}, },
getMtask() { getRoute() {
let that = this; 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_in = res.material_in;
that.material_out = that.form.material_out = res.material_out; that.material_out = that.form.material_out = res.material_out;
that.getdefects(); 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() { getMaterial() {
let that = this; let that = this;
@ -499,7 +493,8 @@ export default {
that.materialOptions.forEach(item=>{ that.materialOptions.forEach(item=>{
if(item.id == val){ if(item.id == val){
that.qct_defects.forEach((item) => { 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.materialCount = that.form.count_use =
that.form.count_real = that.form.count_ok = item.count; that.form.count_real = that.form.count_ok = item.count;
@ -563,14 +558,18 @@ export default {
that.form.mgroup = that.mgroup; that.form.mgroup = that.mgroup;
let mlogdefect = [],mlogindefect =[]; let mlogdefect = [],mlogindefect =[];
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
let objin = {}; if(that.defectinform[item.defect_name]>0){
objin.defect = item.defect; let objin = {};
objin.count = that.defectinform[item.defect_name]; objin.defect = item.defect;
mlogindefect.push(objin); objin.count = that.defectinform[item.defect_name];
let obj = {}; mlogindefect.push(objin);
obj.defect = item.defect; }
obj.count = that.defectform[item.defect_name]; if(that.defectform[item.defect_name]>0){
mlogdefect.push(obj) let obj = {};
obj.defect = item.defect;
obj.count = that.defectform[item.defect_name];
mlogdefect.push(obj)
}
}) })
that.form.qct = that.qct; that.form.qct = that.qct;
that.form.mlogdefect = mlogdefect; that.form.mlogdefect = mlogdefect;

View File

@ -12,7 +12,7 @@
<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>
<el-descriptions-item label="工艺路线">{{ <el-descriptions-item label="工艺路线">{{
fmlogItem.routepack_name fmlogItem.route_name
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="任务编号">{{ <el-descriptions-item label="任务编号">{{
fmlogItem.mtask_number fmlogItem.mtask_number
@ -51,7 +51,7 @@
@row-click="table_detail" @row-click="table_detail"
> >
<el-table-column type="index" width="50"></el-table-column> <el-table-column type="index" width="50"></el-table-column>
<el-table-column type="expand"> <!-- <el-table-column type="expand">
<template #default="props"> <template #default="props">
<div style="padding-left: 50px"> <div style="padding-left: 50px">
<el-descriptions :column="2"> <el-descriptions :column="2">
@ -106,7 +106,8 @@
</el-descriptions> </el-descriptions>
</div> </div>
</template> </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="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="equipment_name" min-width="150"></el-table-column>
<el-table-column label="领料数" prop="count_use"></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_pn_jgqbl"></el-table-column>
<el-table-column label="合格数" prop="count_ok"></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="count_notok"></el-table-column>
<el-table-column label="开始时间" prop="work_start_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="work_end_time"></el-table-column> -->
<el-table-column label="班次" prop="shift_name"></el-table-column> <el-table-column label="班次" prop="shift_name"></el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
@ -176,7 +177,7 @@
ref="saveDialogs" ref="saveDialogs"
:fmlog="fmlogId" :fmlog="fmlogId"
:mgroup="mgroup" :mgroup="mgroup"
:mtask="mtask" :route="route"
:process="processId" :process="processId"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
@ -295,7 +296,6 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.codeTextChange(codeText); this.codeTextChange(codeText);
}) })
} }
this.visible = true; this.visible = true;
}, },
@ -304,6 +304,7 @@ export default {
let that = this; let that = this;
that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => { that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => {
that.fmlogItem = res; that.fmlogItem = res;
that.route = res.route;
that.paramsWm.mgroup = res.mgroup; that.paramsWm.mgroup = res.mgroup;
that.$API.wpm.mlog.list.req(that.params).then((res) => { that.$API.wpm.mlog.list.req(that.params).then((res) => {
that.tableData = res; that.tableData = res;

View File

@ -18,7 +18,7 @@
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="关联任务" prop="mtask"> <el-form-item label="关联任务">
<el-select <el-select
v-model="form.mtask" v-model="form.mtask"
placeholder="关联任务" placeholder="关联任务"
@ -42,7 +42,6 @@
v-model="form.route" v-model="form.route"
placeholder="工艺路线" placeholder="工艺路线"
clearable clearable
disabled
filterable filterable
style="width: 100%" style="width: 100%"
> >
@ -52,11 +51,7 @@
:label="item.routepack_name" :label="item.routepack_name"
:value="item.id" :value="item.id"
> >
<span <span>{{ item.routepack_name }}-{{item.process_name}}</span>
>{{ item.routepack_name }}-{{
item.process_name
}}</span
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -88,6 +83,7 @@ const defaultForm = {
mtask:"", mtask:"",
mgroup:"", mgroup:"",
note:'', note:'',
is_fix:false,
}; };
export default { export default {
@ -137,7 +133,7 @@ export default {
}, },
], ],
}, },
is_fix:false,
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
@ -173,8 +169,11 @@ export default {
}); });
}, },
// //
open(mode = "add") { open(mode = "add",text) {
this.mode = mode; this.mode = mode;
if(text){
this.is_fix = true;
}
this.visible = true; this.visible = true;
return this; return this;
}, },
@ -195,10 +194,12 @@ export default {
// //
submit() { submit() {
let that = this; let that = this;
console.log(this.form)
that.$refs.dialogForm.validate(async (valid) => { that.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
if (that.mode === "add") { if (that.mode === "add") {
that.form.is_fix = that.is_fix;
that.form.mgroup = that.mgroup; that.form.mgroup = that.mgroup;
that.$API.wpm.fmlog.create.req(that.form).then((res) => { that.$API.wpm.fmlog.create.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;

View File

@ -49,7 +49,7 @@
:query="params" :query="params"
> >
<el-table-column label="#" type="index" width="50"></el-table-column> <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>
<el-table-column label="任务编号" prop="mtask_number"> <el-table-column label="任务编号" prop="mtask_number">
</el-table-column> </el-table-column>
@ -59,7 +59,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time"></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"> <template #default="scope">
<el-switch v-model="scope.row.enabled" @change="enabledChange(scope.row)"></el-switch> <el-switch v-model="scope.row.enabled" @change="enabledChange(scope.row)"></el-switch>
</template> </template>

View File

@ -167,7 +167,7 @@
size="small" size="small"
@click="table_receive(scope.row)" @click="table_receive(scope.row)"
type="success" 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>
<el-button <el-button
link link

View File

@ -16,7 +16,7 @@
<el-row> <el-row>
<el-form-item label="交接物料"> <el-form-item label="交接物料">
<el-button type="primary" @click="addMaterial" v-if="mode!=='show'">手动添加</el-button> <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>
<el-form-item label-width="0"> <el-form-item label-width="0">
<el-input <el-input
@ -538,6 +538,10 @@ export default {
let that = this; let that = this;
that.$refs.dialogForm.validate(async (valid) => { that.$refs.dialogForm.validate(async (valid) => {
if (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){ if(that.mtype==20||that.mtype==30||that.type==40){
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => { that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;
@ -598,7 +602,7 @@ export default {
return; return;
} }
let that = this; let that = this;
data = data.replace(' ',''); // data = data.replace(' ','');
let id = data.split('#')[1]; let id = data.split('#')[1];
this.$API.cm.labelmat.item.req(id).then((res) => { this.$API.cm.labelmat.item.req(id).then((res) => {
let arr = that.form.handoverb.filter((item) => { let arr = that.form.handoverb.filter((item) => {

View File

@ -27,7 +27,7 @@
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem"> <el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="批次号"> <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-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
@ -224,6 +224,7 @@ export default {
if(total>that.totalCount){ if(total>that.totalCount){
that.$message.error("分配数量不能大于总数量"); that.$message.error("分配数量不能大于总数量");
}else{ }else{
that.form.wm = that.batchOrign.id;
if (that.mode == "add") { if (that.mode == "add") {
that.$API.wpm.handover.create.req(that.form).then((res) => { that.$API.wpm.handover.create.req(that.form).then((res) => {
that.$API.wpm.handover.submit.req(res.id).then((res1) => { that.$API.wpm.handover.submit.req(res.id).then((res1) => {

View File

@ -2,11 +2,11 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" v-auth="'mio.do'" @click="tomio('do_out')">领料</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(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="table_add(40)">报废</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</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> <scScanner :labeltext="'报废扫码'" @scanResult="codeTextChange40"></scScanner>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -148,7 +148,7 @@
@closed="dialog.save = false" @closed="dialog.save = false"
> >
</check-dialog> --> </check-dialog> -->
<!-- /报废 --> <!-- /报废 -->
<scrap-dialog <scrap-dialog
v-if="dialog.scrap" v-if="dialog.scrap"
ref="scrapDialog" ref="scrapDialog"
@ -265,7 +265,7 @@ export default {
stateOptions:[ stateOptions:[
{ value: 10, name: "合格"}, { value: 10, name: "合格"},
{ value: 20, name: "不合格"}, { value: 20, name: "不合格"},
{ value: 30, name: "返"}, { value: 30, name: "返"},
], ],
queryWm: { queryWm: {
search: "", search: "",
@ -366,7 +366,7 @@ export default {
this.$refs.showDrawer.open(); this.$refs.showDrawer.open();
}); });
}, },
/// ///
table_add(type) { table_add(type) {
this.dialog.scrap = true; this.dialog.scrap = true;
this.type = type; this.type = type;

View File

@ -2,11 +2,11 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" v-auth="'mio.do'" @click="tomio('do_in')">入库</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(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="table_add(40)">报废</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</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> <scScanner :labeltext="'报废扫码'" @scanResult="codeTextChange40"></scScanner>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -180,7 +180,7 @@
:cate = "cate_type" :cate = "cate_type"
:process = "processId" :process = "processId"
:mgroupId = "mgroupId" :mgroupId = "mgroupId"
:deptId = "params.belong_dept" :deptId = "deptId"
@success="handleinmSuccess" @success="handleinmSuccess"
> >
</save-dialog> </save-dialog>
@ -261,7 +261,7 @@ export default {
stateOptions:[ stateOptions:[
{ value: 10, name: "合格"}, { value: 10, name: "合格"},
{ value: 20, name: "不合格"}, { value: 20, name: "不合格"},
{ value: 30, name: "返"}, { value: 30, name: "返"},
], ],
queryWm: { queryWm: {
search: "", search: "",
@ -345,7 +345,7 @@ export default {
}) })
} }
}, },
/// ///
table_add(type) { table_add(type) {
this.dialog.scrap = true; this.dialog.scrap = true;
this.type = type; this.type = type;

View File

@ -277,7 +277,7 @@ export default {
if(data==''||data==undefined||data==null){ if(data==''||data==undefined||data==null){
return; return;
} }
data = data.replace(' ',''); // data = data.replace(' ','');
let id = data.split('#')[1]; let id = data.split('#')[1];
this.$API.cm.labelmat.item.req(id).then((res) => { this.$API.cm.labelmat.item.req(id).then((res) => {
console.log('res',res); console.log('res',res);
@ -336,16 +336,29 @@ export default {
} }
} }
}, },
selectBatchChange(item) { selectBatchChange(id) {
this.form.batch = item.batch; let that = this;
this.form.warehouse = item.warehouse; that.batchOptions.forEach((item) => {
this.form.mb = item.id; 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; let that = this;
that.form.batch = item.batch; that.wbatchOptions.forEach((item) => {
that.form.wm = item.id; 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() { selectBatchClear() {
this.form.batch = ""; this.form.batch = "";

View File

@ -160,6 +160,7 @@
:process = "processId" :process = "processId"
:mgroupId = "mgroupId" :mgroupId = "mgroupId"
:deptId = " deptId" :deptId = " deptId"
@closed = "handleinmSuccess"
@success="handleinmSuccess" @success="handleinmSuccess"
> >
</save-dialog> </save-dialog>
@ -318,8 +319,7 @@ export default {
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },
handleinmSuccess(){}, handleinmSuccess(){
handleSaveSuccess() {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
}, },

View File

@ -183,7 +183,7 @@
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id"> <el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
<el-form-item :label="item.defect_name"> <el-form-item :label="item.defect_name">
<el-input-number <el-input-number
v-model="defectform[item.defect_name]" v-model="defectinform[item.defect_name]"
:min="0" :min="0"
style="width: 100%" style="width: 100%"
controls-position="right" controls-position="right"
@ -330,6 +330,8 @@
ref="saveDialog" ref="saveDialog"
:mlog="mlogId" :mlog="mlogId"
:mgroup="mgroup" :mgroup="mgroup"
:is_fix = "is_fix"
:mgroupMtype="mgroupMtype"
:mgroupName = "mlogItem.mgroup_name" :mgroupName = "mlogItem.mgroup_name"
:codeText = "codeText" :codeText = "codeText"
:materialIn="materialIn" :materialIn="materialIn"
@ -340,6 +342,7 @@
<check-dialog <check-dialog
v-if="dialog.check" v-if="dialog.check"
ref="checkDialog" ref="checkDialog"
:mgroupMtype="mgroupMtype"
@success="handleCheckSuccess" @success="handleCheckSuccess"
@closed="dialog.check = false" @closed="dialog.check = false"
> >
@ -462,6 +465,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mgroupMtype:{
type: String,
default: "",
}
}, },
components: { components: {
editDialog, editDialog,
@ -522,7 +529,7 @@ export default {
4: "已完成", 4: "已完成",
5: "已关闭", 5: "已关闭",
}, },
defectform:{}, defectinform:{},
fileList:[], fileList:[],
cellsList:[], cellsList:[],
qct_defects:[], qct_defects:[],
@ -548,6 +555,7 @@ export default {
}, },
], ],
}, },
is_fix:false,
wmId:'', wmId:'',
wmtype:'', wmtype:'',
batchContains:'', batchContains:'',
@ -578,6 +586,7 @@ export default {
that.fileList = [{name:res.test_file,url:res.test_file}]; that.fileList = [{name:res.test_file,url:res.test_file}];
that.form.test_file = res.test_file; that.form.test_file = res.test_file;
} }
that.is_fix = res.is_fix;
that.mgroup = res.mgroup; that.mgroup = res.mgroup;
that.paramsWm.mgroup = res.mgroup; that.paramsWm.mgroup = res.mgroup;
that.materialIn = res.material_in; that.materialIn = res.material_in;
@ -601,13 +610,13 @@ export default {
if(res.length>0){ if(res.length>0){
that.$API.qm.qct.item.req(res[0].id).then((res) => { that.$API.qm.qct.item.req(res[0].id).then((res) => {
res.qct_defects.forEach((item) => { res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0; that.defectinform[item.defect_name] = 0;
}) })
that.qct_defects=res.qct_defects; that.qct_defects=res.qct_defects;
console.log('that.saveInForm.mlogbdefect',that.saveInForm.mlogbdefect); console.log('that.saveInForm.mlogbdefect',that.saveInForm.mlogbdefect);
if(that.saveInForm.mlogbdefect&&that.saveInForm.mlogbdefect.length>0){ if(that.saveInForm.mlogbdefect&&that.saveInForm.mlogbdefect.length>0){
that.saveInForm.mlogbdefect.forEach((item) => { 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.saveInForm.count_pn_jgqbl = 0;
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
if(item.defect_okcate==30){ 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(); // that.countCellChanges();
@ -643,15 +652,24 @@ export default {
table_add() { table_add() {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open(); this.$refs.saveDialog.open('add');
}); });
}, },
// //
table_in_edit(row) { table_in_edit(row) {
this.saveInForm = row; let that = this;
this.getdefects(); if(that.mlogItem.mgroup_name=='黑化'||that.mlogItem.mgroup_name=='退火'){
this.saveInDialog = true; that.dialog.save = true;
that.$nextTick(() => {
that.$refs.saveDialog.open('edit',row);
});
}else{
that.saveInForm = row;
that.getdefects();
that.saveInDialog = true;
}
}, },
// //
saveInSubmit() { saveInSubmit() {
let that = this; let that = this;
@ -659,17 +677,17 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
let obj = {}; let obj = {};
let count_pn_jgqbl = 0,mlogbdefect=[]; let count_pn_jgqbl = 0,mlogbindefect=[];
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
count_pn_jgqbl += that.defectform[item.defect_name] ; count_pn_jgqbl += that.defectinform[item.defect_name] ;
let obj = {}; let obj = {};
obj.defect = item.defect; obj.defect = item.defect;
obj.count = that.defectform[item.defect_name]; obj.count = that.defectinform[item.defect_name];
obj.mlogb = that.saveInForm.id; obj.mlogb = that.saveInForm.id;
mlogbdefect.push(obj); mlogbindefect.push(obj);
}) })
obj.count_use = that.saveInForm.count_use; obj.count_use = that.saveInForm.count_use;
obj.mlogbdefect = mlogbdefect; obj.mlogbindefect = mlogbindefect;
obj.count_pn_jgqbl = count_pn_jgqbl; obj.count_pn_jgqbl = count_pn_jgqbl;
that.$API.wpm.mlogb.updateIn.req(that.saveInForm.id, obj).then((res) => { that.$API.wpm.mlogb.updateIn.req(that.saveInForm.id, obj).then((res) => {
that.isSaveing = false; that.isSaveing = false;

View File

@ -56,7 +56,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-form-item label="工艺路线" prop="route">
<el-select <el-select
v-model="form.route" v-model="form.route"
@ -132,12 +132,12 @@
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="结束时间" prop="work_end_time"> <el-form-item label="结束时间" prop="work_end_time">
<!-- :disabledDate="disabledDateFn" -->
<el-date-picker <el-date-picker
v-model="form.work_end_time" v-model="form.work_end_time"
type="datetime" type="datetime"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
:disabledDate="disabledDateFn"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -196,24 +196,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-col :md="12" :sm="24">
<el-form-item label="操作人"> <el-form-item label="操作人">
<ehsSelect <ehsSelect
@ -351,7 +333,9 @@ export default {
{ id: 10, name: "自产" }, { id: 10, name: "自产" },
{ id: 20, name: "外协" }, { id: 20, name: "外协" },
], ],
mlogtype:"",
codeText:"", codeText:"",
is_fix:false,
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
@ -367,6 +351,8 @@ export default {
this.getSupplier(); this.getSupplier();
this.getEquipment(); this.getEquipment();
this.gettestitem(); this.gettestitem();
let date = new Date();
this.form.work_start_time = this.form.work_end_time = this.$TOOL.dateFormat(date)
}, },
methods: { methods: {
@ -425,7 +411,14 @@ export default {
// //
open(mode = "add",text) { open(mode = "add",text) {
this.mode = mode; 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; this.visible = true;
return this; return this;
}, },

View File

@ -7,7 +7,7 @@
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px"> <el-main style="padding: 0">
<el-form <el-form
ref="dialogForm" ref="dialogForm"
:model="form" :model="form"
@ -25,7 +25,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24" v-if="mgroupMtype==10">
<el-form-item label="实际生产数"> <el-form-item label="实际生产数">
<el-input-number <el-input-number
v-model="form.count_real" v-model="form.count_real"
@ -36,8 +36,111 @@
/> />
</el-form-item> </el-form-item>
</el-col> </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-col :md="12" :sm="24">
<el-form-item label="合格数量"> <el-form-item :label="mgroupMtype==10?'合格数':'入库数'">
<el-input-number <el-input-number
v-model="form.count_ok" v-model="form.count_ok"
:min="0" :min="0"
@ -59,7 +162,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </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>不良统计最大不合格数<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-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
<el-form-item :label="item.defect_name"> <el-form-item :label="item.defect_name">
@ -84,36 +187,40 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </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=='退火'"> <template v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-row> <el-row>
<el-col :span="6">所在层数</el-col> <el-col :span="5">所在层数</el-col>
<el-col :span="6">本层总数</el-col> <el-col :span="5">本层总数</el-col>
<el-col :span="6">抽检数</el-col> <el-col :span="5">抽检数</el-col>
<el-col :span="6">不合格数</el-col> <el-col :span="5">不合格数</el-col>
</el-row> </el-row>
<el-row style="margin-bottom:10px" v-for="item in count_json" :key="item"> <el-row style="margin-bottom:10px" v-for="(item,$index) in count_json" :key="item">
<el-col :span="6"> <el-col :span="5">
<el-input-number <el-input-number
style="width:90%" style="width:90%"
v-model="item.floor" v-model="item.floor"
:disabled="true"
class="width-100" class="width-100"
placeholder="层数" placeholder="层数"
controls-position="right" controls-position="right"
/> />
</el-col> </el-col>
<el-col :span="6"> <el-col :span="5">
<el-input-number <el-input-number
style="width:90%" style="width:90%"
v-model="item.count_use" v-model="item.count_use"
:disabled="true"
class="width-100" class="width-100"
placeholder="本层总数" placeholder="本层总数"
controls-position="right" controls-position="right"
/> />
</el-col> </el-col>
<el-col :span="6"> <el-col :span="5">
<el-input-number <el-input-number
style="width:90%" style="width:90%"
v-model="item.count_test" v-model="item.count_test"
@ -123,7 +230,7 @@
controls-position="right" controls-position="right"
/> />
</el-col> </el-col>
<el-col :span="6"> <el-col :span="5">
<el-input-number <el-input-number
style="width:90%" style="width:90%"
v-model="item.count_notok" v-model="item.count_notok"
@ -134,9 +241,11 @@
@change="notokChanges" @change="notokChanges"
/> />
</el-col> </el-col>
<el-col :span="4">
<el-button @click="lineDel($index)">删除</el-button>
</el-col>
</el-row> </el-row>
</template> </template>
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <el-footer>
@ -150,6 +259,12 @@
<script> <script>
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
props:{
mgroupMtype:{
type: String,
default: "",
}
},
data() { data() {
return { return {
loading: false, loading: false,
@ -190,35 +305,79 @@ export default {
defectform:{}, defectform:{},
cells:0, cells:0,
cell_start:1, cell_start:1,
count_cell:20, count_cell:1,
options: [], options: [],
material_out:'', material_out:'',
qct_defects:[], qct_defects:[],
count_json:[], 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, max_defect_rate:null,
materialOptions: [], materialOptions: [],
canWrite:false,
visible: false, visible: false,
isSaveing: false, isSaveing: false,
batchDisabled: false, batchDisabled: false,
}; };
}, },
mounted() { mounted() {
console.log('mgroupMtype',this.mgroupMtype)
if (this.form.batch != null) { if (this.form.batch != null) {
this.batchDisabled = true; this.batchDisabled = true;
} }
}, },
methods: { methods: {
open(data) { open(data) {
console.log(data)
this.visible = true; this.visible = true;
this.mlogbItem = data; this.mlogbItem = data;
this.count_json = [] 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) => { data.count_json.forEach((item) => {
item.count_notok = 0; item.count_notok = 0;
item.count_test = this.count_cell; item.count_test = this.count_cell;
this.count_json.push(item); this.count_json.push(item);
}) })
this.form.batch = data.batch; 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.material_out = data.material_out;
this.mgroupName = data.mgroup_name; this.mgroupName = data.mgroup_name;
this.getdefects(); this.getdefects();
@ -236,7 +395,6 @@ export default {
} }
}, },
countChange() { countChange() {
console.log('change');
let that = this; let that = this;
that.form.count_notok = 0; that.form.count_notok = 0;
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
@ -250,7 +408,6 @@ export default {
let that = this; let that = this;
let count_notok = 0; let count_notok = 0;
that.count_json.forEach(item=>{ that.count_json.forEach(item=>{
console.log('item',item);
if(that.max_defect_rate!==null&&that.count_cell>0){ if(that.max_defect_rate!==null&&that.count_cell>0){
let notrate = item.count_notok / that.count_cell; let notrate = item.count_notok / that.count_cell;
if(notrate>that.max_defect_rate){ if(notrate>that.max_defect_rate){
@ -271,6 +428,27 @@ export default {
item.count_test = this.count_cell; 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() { submit() {
let that = this; let that = this;
@ -279,30 +457,51 @@ export default {
that.isSaveing = true; that.isSaveing = true;
that.form.mlog = that.mlog; that.form.mlog = that.mlog;
let sum = 0; 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 = {}; 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_real = that.form.count_real;
obj_form.count_notok = that.form.count_notok;
obj_form.mlogbdefect = that.form.mlogbdefect; obj_form.mlogbdefect = that.form.mlogbdefect;
if(that.mgroupName=='黑化'||that.mgroupName=='退火'){ if(that.mgroupName=='黑化'||that.mgroupName=='退火'){
obj_form.count_json = that.count_json; 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.isSaveing = false;
that.$emit("success"); that.$emit("success");
that.visible = false; that.visible = false;
@ -311,10 +510,12 @@ export default {
.catch((err) => { .catch((err) => {
that.isSaveing = false; that.isSaveing = false;
}); });
} else { // if (sum - that.form.count_real == 0) {
that.isSaveing = false;
that.$message.error("使用数量与合格数不合格数数量不对等"); // } else {
} // that.isSaveing = false;
// that.$message.error("使");
// }
} }
}); });
}, },

View File

@ -1,8 +1,8 @@
<template> <template>
<el-dialog <el-dialog
title="添加日志详情" :title="titleMap[mode]"
v-model="visible" v-model="visible"
:size="1000" style="width: 80%;"
destroy-on-close destroy-on-close
@closed="$emit('closed')" @closed="$emit('closed')"
> >
@ -17,85 +17,74 @@
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="关联任务"> <el-form-item label="关联任务">
<el-select <el-select
v-model="form.mtask" v-model="form.mtask"
placeholder="关联任务" placeholder="关联任务"
clearable clearable
style="width: 100%" style="width: 100%"
@change="getMaterial" @change="getMaterial"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
> >
</el-option> <el-option
</el-select> v-for="item in options"
</el-form-item> :key="item.id"
</el-col> :label="item.number"
<el-col :md="12" :sm="24"> :value="item.id"
<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;
"
> >
<span>{{ item.batch }}</span </el-option>
><span>{{ item.count }}</span> </el-select>
</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-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <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-form-item label="加工前不良" prop="count_pn_jgqbl">
<el-input-number <el-input-number
v-model="form.count_pn_jgqbl" v-model="form.count_pn_jgqbl"
@ -111,49 +100,62 @@
<el-input v-model="form.note"/> <el-input v-model="form.note"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-divider v-if="(mgroupName=='黑化'||mgroupName=='退火')&&cellsList.length>0"></el-divider> </el-row>
<template v-if="mgroupName=='黑化'||mgroupName=='退火'"> <el-divider v-if="(mgroupName=='黑化'||mgroupName=='退火')&&cellsList.length>0"></el-divider>
<el-row v-for="(item) in cellsList" :key="item"> <el-button
<el-col :md="12" :sm="24"> v-if="mgroupName=='黑化'||mgroupName=='退火'"
<el-form-item label="所在层数"> icon="el-icon-plus"
<el-input-number type="primary"
style="width:90%" @click="cellsAdd"
v-model="item.floor" ></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" :min="1"
class="width-100"
placeholder="层数" placeholder="层数"
controls-position="right" controls-position="right"
/> />
</el-form-item> </el-form-item>
</el-col> <el-form-item label="层到第" label-width="65">
<el-col :md="12" :sm="24"> <el-input-number
<el-form-item label="本层数量"> v-model="item.end"
<el-input-number :min="1"
style="width:90%" placeholder="层数"
v-model="item.count_use"
:min="0"
class="width-100"
placeholder="本层数量"
controls-position="right" controls-position="right"
/> />
</el-form-item> </el-form-item>
</el-col> <el-form-item label="层,总数:" label-width="80">
</el-row> <el-input-number
<el-divider v-if="qct_defects.length>0"></el-divider> v-model="item.count_t"
<el-row> :min="0"
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id"> placeholder="总数量"
<el-form-item :label="item.defect_name"> controls-position="right"
<el-input-number @change="countTotalChange"
v-model="defectform[item.defect_name]" />
:min="0" </el-form-item>
style="width: 100%" <el-button
controls-position="right" type="danger"
@change="countChange" style="margin: 0 20px;"
/> @click="cellsDel($index)">删除</el-button>
</el-form-item> </el-col>
</el-col> </el-row>
</el-row> </template>
</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-row>
</el-form> </el-form>
</el-main> </el-main>
@ -196,6 +198,14 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
is_fix: {
type: Boolean,
default: false,
},
mgroupMtype:{
type: String,
default: "",
}
}, },
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
@ -225,15 +235,16 @@ export default {
}, },
], ],
}, },
cells:0,// // cells:0,//
count_cell:0,// batch_count:null,
cell_start:1,// // count_cell:0,//
// cell_start:1,//
codeBatch:"", codeBatch:"",
options: [], options: [],
cellsList:[], cellsList:[],
qct_defects:[], qct_defects:[],
materialOptions: [], materialOptions: [],
defectform:{}, defectinform:{},
visible: false, visible: false,
isSaveing: false, isSaveing: false,
setFiltersVisible: false, setFiltersVisible: false,
@ -252,43 +263,55 @@ export default {
}else{ }else{
that.getMaterial(); that.getMaterial();
} }
this.getMtask();
this.getdefects(); this.getdefects();
// this.getMtask();
}, },
methods: { methods: {
open() { open(mode="add",data) {
this.visible = true; this.visible = true;
this.form.mtask = ""; this.form.mtask = "";
this.form.wm_in = ""; this.form.wm_in = "";
this.form.count_use = 0; this.form.count_use = 0;
this.form.parent = ""; this.form.parent = "";
this.form = data;
this.cellsList = data.count_json_from;
}, },
getMtask() { getMtask() {
let that = this; let that = this;
this.$API.pm.mtask.list this.$API.pm.mtask.list.req({ page: 0, mgroup: that.mgroup, state: 20 }).then((res) => {
.req({ page: 0, mgroup: that.mgroup, state: 20 }) that.options = res;
.then((res) => { });
that.options = res;
});
}, },
// //
getMaterial() { getMaterial() {
let that = this; let that = this;
this.$API.wpm.wmaterial.list.req({ let obj = {};
mtaskx: that.form.mtask, obj.mtaskx =that.form.mtask;
mgroupx: that.mgroup, obj.mgroup = that.mgroup;
material: that.materialIn, obj.page =0;
page: 0, if(that.is_fix){
state:10 obj.state =30;
}).then((res) => { }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; that.materialOptions = res;
res.forEach(item => { res.forEach(item => {
if(item.batch==that.codeBatch){ if(item.batch==that.codeBatch){
that.form.wm_in = item.id; 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(){ getdefects(){
let that = this; let that = this;
@ -296,9 +319,20 @@ export default {
if(res.length>0){ if(res.length>0){
that.$API.qm.qct.item.req(res[0].id).then((res) => { that.$API.qm.qct.item.req(res[0].id).then((res) => {
res.qct_defects.forEach((item) => { res.qct_defects.forEach((item) => {
that.defectform[item.defect_name] = 0; that.defectinform[item.defect_name] = 0;
}) })
that.qct_defects=res.qct_defects; 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; let that = this;
that.materialOptions.forEach(item => { that.materialOptions.forEach(item => {
if(item.id==that.form.wm_in){ 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(){ cellStartChanges(){
let that = this; let that = this;
let remaind = (that.form.count_use-that.form.count_pn_jgqbl)%that.count_cell; let remaind = (that.form.count_use-that.form.count_pn_jgqbl)%that.count_cell;
that.cellsList = []; that.cellsList = [];
for(let i=0;i<that.cells;i++){ for(let i=0;i<that.cells;i++){
console.log('i',i)
console.log((that.cells-i)==1)
let obj = {}; let obj = {};
obj.floor=that.cell_start+i; obj.floor=that.cell_start+i;
if((that.cells-i)==1&&remaind>0){ if((that.cells-i)==1&&remaind>0){
@ -337,7 +395,7 @@ export default {
that.form.count_pn_jgqbl = 0; that.form.count_pn_jgqbl = 0;
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
if(item.defect_okcate==30){ 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(); that.countCellChanges();
@ -349,17 +407,18 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
that.form.mlog = that.mlog; that.form.mlog = that.mlog;
that.form.count_json = that.cellsList; if(that.mgroupMtype==10&&that.cellsList.length>0){
let count_pn_jgqbl = 0,mlogbdefect=[]; that.form.count_json_from = that.cellsList;
}
let count_pn_jgqbl = 0,mlogbindefect=[];
that.qct_defects.forEach(item => { that.qct_defects.forEach(item => {
count_pn_jgqbl += that.defectform[item.defect_name] ; count_pn_jgqbl += that.defectinform[item.defect_name] ;
let obj = {}; let obj = {};
obj.defect = item.defect; obj.defect = item.defect;
obj.count = that.defectform[item.defect_name]; obj.count = that.defectinform[item.defect_name];
mlogbdefect.push(obj); mlogbindefect.push(obj);
}) })
// that.form.count_use = that.count_use; that.form.mlogbindefect = mlogbindefect;
that.form.mlogbdefect = mlogbdefect;
that.form.count_pn_jgqbl = count_pn_jgqbl; that.form.count_pn_jgqbl = count_pn_jgqbl;
that.$API.wpm.mlogb.in.req(that.form).then((res) => { that.$API.wpm.mlogb.in.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;

View File

@ -9,6 +9,13 @@
v-auth="'mlog.create'" v-auth="'mlog.create'"
>新增</el-button >新增</el-button
> >
<el-button
type="primary"
icon="el-icon-plus"
@click="table_rework"
v-auth="'mlog.create'"
>返工</el-button
>
<scScanner @scanResult="codeTextChange"></scScanner> <scScanner @scanResult="codeTextChange"></scScanner>
<el-input <el-input
ref="codeInput" ref="codeInput"
@ -57,6 +64,10 @@
prop="material_out_name" prop="material_out_name"
min-width="130" 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>
<el-table-column <el-table-column
label="预计工时" label="预计工时"
@ -171,6 +182,7 @@
ref="detailDialog" ref="detailDialog"
:mlogId="mlogId" :mlogId="mlogId"
:mtask="mtask" :mtask="mtask"
:mgroupMtype="mgroupMtype"
@closed="detailClose" @closed="detailClose"
> >
</detail-drawer> </detail-drawer>
@ -265,6 +277,12 @@ export default {
this.$refs.saveDialog.open("add"); this.$refs.saveDialog.open("add");
}); });
}, },
table_rework(){
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add","rework");
});
},
// //
table_edit(row) { table_edit(row) {
this.dialog.save = true; this.dialog.save = true;