This commit is contained in:
TianyangZhang 2026-05-15 17:06:35 +08:00
commit 44c1e7cd94
15 changed files with 211 additions and 61 deletions

View File

@ -17,8 +17,8 @@
<div class="header-right"> <div class="header-right">
<!-- <span class="shift-badge">白班</span> --> <!-- <span class="shift-badge">白班</span> -->
<div class="user-badge"> <div class="user-badge">
<div class="user-avatar"></div> <div class="user-avatar">A</div>
<span style="font-size:13px">张三</span> <span style="font-size:13px">admin</span>
</div> </div>
</div> </div>
</header> </header>
@ -284,14 +284,14 @@ export default {
], ],
persons: [ persons: [
{ name: '张三', val: 920, color: '#4fc3f7' }, { name: '郭香林', val: 920, color: '#4fc3f7' },
{ name: '李四', val: 796, color: '#ff6b6b' }, { name: '于浩洋', val: 796, color: '#ff6b6b' },
{ name: '王五', val: 734, color: '#00e5ff' }, { name: '张明杰', val: 734, color: '#00e5ff' },
{ name: '赵六', val: 661, color: '#ffc107' }, { name: '裴仁强', val: 661, color: '#ffc107' },
{ name: '钱七', val: 594, color: '#bb86fc' }, { name: '曾玉明', val: 594, color: '#bb86fc' },
{ name: '孙八', val: 508, color: '#4fc3f7' }, { name: '朱凯', val: 508, color: '#4fc3f7' },
{ name: '周九', val: 438, color: '#ff6b6b' }, { name: '夏春立', val: 438, color: '#ff6b6b' },
{ name: '吴十', val: 360, color: '#69f0ae' }, { name: '李学文', val: 360, color: '#69f0ae' },
], ],
equipments: [ equipments: [

View File

@ -240,16 +240,16 @@ export default {
], ],
persons: [ persons: [
{ name: '张三', val: 860, color: '#4fc3f7', av: '' }, { name: '谭瑶', val: 860, color: '#4fc3f7', av: '' },
{ name: '李四', val: 742, color: '#ff6b6b', av: '' }, { name: '武月会', val: 742, color: '#ff6b6b', av: '' },
{ name: '王五', val: 698, color: '#00e5ff', av: '' }, { name: '赵凤云', val: 698, color: '#00e5ff', av: '' },
{ name: '赵六', val: 631, color: '#ffc107', av: '' }, { name: '李占营', val: 631, color: '#ffc107', av: '' },
{ name: '钱七', val: 570, color: '#bb86fc', av: '' }, { name: '陈新艳', val: 570, color: '#bb86fc', av: '' },
{ name: '孙八', val: 488, color: '#4fc3f7', av: '' }, { name: '朱芳丽', val: 488, color: '#4fc3f7', av: '' },
{ name: '周九', val: 412, color: '#ff6b6b', av: '' }, { name: '陈圆', val: 412, color: '#ff6b6b', av: '' },
{ name: '吴十', val: 344, color: '#69f0ae', av: '' }, { name: '刘春亮', val: 344, color: '#69f0ae', av: '' },
{ name: '郑十一', val: 295, color: '#ffc107', av: '' }, { name: '朱晓兴', val: 295, color: '#ffc107', av: '' },
{ name: '冯十二', val: 260, color: '#bb86fc', av: '' }, { name: '程雪佩', val: 260, color: '#bb86fc', av: '' },
], ],
equipments: [ equipments: [

View File

@ -13,7 +13,7 @@
:model="form" :model="form"
:rules="rules" :rules="rules"
label-position="right" label-position="right"
label-width="100px" label-width="110px"
style="padding: 0 10px" style="padding: 0 10px"
> >
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
@ -97,6 +97,13 @@
></el-switch> ></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="合批清除缺陷">
<el-switch
v-model="form.clear_defect"
></el-switch>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="排序"> <el-form-item label="排序">
<el-input-number <el-input-number
@ -128,6 +135,7 @@ const defaultForm = {
wpr_number_rule: "", wpr_number_rule: "",
into_wm_mgroup: true, into_wm_mgroup: true,
store_notok: true, store_notok: true,
has_ok_b_defect:false,
}; };
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],

View File

@ -77,6 +77,7 @@ export default {
number:"", number:"",
mioitem__material__type:30, mioitem__material__type:30,
ftest__isnull:0, ftest__isnull:0,
ordering:"-create_time",
mioitem__mio__state:20, mioitem__mio__state:20,
}, },
dataTotal:0, dataTotal:0,

View File

@ -53,6 +53,9 @@
<el-form-item label="打码器端口"> <el-form-item label="打码器端口">
<el-input-number v-model="addForm.coder_port" :min="1" :max="65535" :controls="false"></el-input-number> <el-input-number v-model="addForm.coder_port" :min="1" :max="65535" :controls="false"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="打码器用户区">
<el-input v-model="addForm.coder_field" clearable placeholder="喷码机里用户区名(默认 1),切码型时填不同用户区名"></el-input>
</el-form-item>
<el-form-item label="模板代码" prop="commands"> <el-form-item label="模板代码" prop="commands">
<el-input v-model="addForm.commands" clearable :rows="9" type="textarea"></el-input> <el-input v-model="addForm.commands" clearable :rows="9" type="textarea"></el-input>
</el-form-item> </el-form-item>
@ -70,6 +73,7 @@
commands: "", commands: "",
coder_ip: "", coder_ip: "",
coder_port: 3100, coder_port: 3100,
coder_field: "1",
}; };
export default { export default {
name: 'labeltemplate', name: 'labeltemplate',
@ -154,6 +158,7 @@
this.addForm.commands=row.commands.join("\n"); this.addForm.commands=row.commands.join("\n");
this.addForm.coder_ip=row.coder_ip; this.addForm.coder_ip=row.coder_ip;
this.addForm.coder_port=row.coder_port; this.addForm.coder_port=row.coder_port;
this.addForm.coder_field=row.coder_field || "1";
this.limitedVisible = true; this.limitedVisible = true;
}, },

View File

@ -224,11 +224,18 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="change_batch&&new_wm==''"> <el-col :md="12" :sm="24" v-if="change_batch&&new_wm==''">
<el-form-item label="新批次号" prop="new_batch"> <el-form-item label="新批次号" prop="new_batch">
<el-input v-model="form.new_batch" placeholder="新批次号" @change="new_batch(form.new_batch)" :disabled="type==50&&isFeiPinku"></el-input> <el-input v-model="form.new_batch" placeholder="新批次号" @change="new_batch(form.new_batch)" :disabled="type==50&&isFeiPinku"></el-input>
<span style="color: red;">请手动录入新批次号不要用已有批次</span> <span style="color: red;">请手动录入新批次号不要用已有批次</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="24" :sm="24" v-if="defectMismatch">
<el-form-item label="清除缺陷">
<el-checkbox v-model="form.clear_defect">
源批次缺陷不一致勾选后合并批次将清除缺陷标记
</el-checkbox>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-footer v-if="mode!=='show'"> <el-footer v-if="mode!=='show'">
@ -308,7 +315,8 @@ export default {
recive_user: null, recive_user: null,
recive_mgroup: null, recive_mgroup: null,
handoverb:[], handoverb:[],
new_batch:'' new_batch:'',
clear_defect: false
}, },
rules: { rules: {
new_batch:[ new_batch:[
@ -457,6 +465,25 @@ export default {
} }
that.getMgroupOptions(); that.getMgroupOptions();
}, },
computed: {
// state OK(10) defect ""
defectMismatch() {
if (this.mtype !== 30) return false;
if (this.new_wm) return false;
const items = this.form.handoverb || [];
if (items.length < 2) return false;
if (!items.every(i => Number(i.state) === 10)) return false;
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect));
return defectIds.size > 1;
}
},
watch: {
defectMismatch(val) {
if (!val) {
this.form.clear_defect = false;
}
}
},
methods: { methods: {
deletebw(index){ deletebw(index){
let that = this; let that = this;
@ -656,6 +683,7 @@ export default {
if(mtype!==undefined&&mtype!==null){ if(mtype!==undefined&&mtype!==null){
that.mtype = mtype; that.mtype = mtype;
} }
that.form.clear_defect = false;
that.checkedStatus=[]; that.checkedStatus=[];
that.selectItems=[]; that.selectItems=[];
if(mtype==30){ if(mtype==30){

View File

@ -517,6 +517,7 @@ export default {
let obj = {}; let obj = {};
obj.id = item.id; obj.id = item.id;
obj.wm = item.id; obj.wm = item.id;
obj.state = item.state;
obj.batch = item.batch; obj.batch = item.batch;
obj.process = item.material_.process_name; obj.process = item.material_.process_name;
obj.count_canhandover = item.count_canhandover; obj.count_canhandover = item.count_canhandover;

View File

@ -58,7 +58,11 @@
<el-tag :type="wmState[mlogItem.wm_in_state]?.type">{{ wmState[mlogItem.wm_in_state]?.text }}</el-tag> <el-tag :type="wmState[mlogItem.wm_in_state]?.type">{{ wmState[mlogItem.wm_in_state]?.text }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;"> <div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
<div v-if="mlogItem.submit_time == null && hasOkBDefect" style="margin-right: 16px;display:flex;align-items:center;">
<span style="margin-right: 6px;">合格B类不拆批</span>
<el-switch v-model="mlogItem.clear_defect"></el-switch>
</div>
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null" v-if="mlogItem.submit_time == null"
@ -86,12 +90,12 @@
> >
<sc-form-table <sc-form-table
hideDelete hideDelete
:tableHeight="tableHeight" tableHeight="190px"
v-model="processLists" v-model="processLists"
:addTemplate="addTemplate" :addTemplate="addTemplate"
placeholder="暂无数据" placeholder="暂无数据"
> >
<el-table-column label="工序"> <el-table-column label="工序" width="150px">
<template #default="scope"> <template #default="scope">
<el-select <el-select
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@ -111,7 +115,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作人"> <el-table-column label="操作人" width="150px">
<template #default="scope"> <template #default="scope">
<ehsSelect <ehsSelect
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@ -126,7 +130,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="使用设备"> <el-table-column label="使用设备" width="120px">
<template #default="scope"> <template #default="scope">
<el-select <el-select
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@ -147,7 +151,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作时间"> <el-table-column label="操作时间" width="220px">
<template #default="scope"> <template #default="scope">
<el-date-picker <el-date-picker
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@ -162,7 +166,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="班次" prop="shift_name"> <el-table-column label="班次" prop="shift_name" width="80px">
<!-- <template #default="scope"> <!-- <template #default="scope">
<el-select <el-select
v-if="scope.row.isEdit" v-if="scope.row.isEdit"
@ -485,6 +489,13 @@ export default {
print print
}, },
emits: ["success", "closed"], emits: ["success", "closed"],
computed: {
hasOkBDefect() {
const rows = this.tableData2 || [];
return rows.some(row => Array.isArray(row.mlogbdefect)
&& row.mlogbdefect.some(d => Number(d.defect_okcate) === 20 && Number(d.count) > 0));
},
},
data() { data() {
return { return {
wmState, wmState,
@ -976,14 +987,25 @@ export default {
submitFun(){ submitFun(){
let that = this; let that = this;
that.isSaveing = true; that.isSaveing = true;
that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { const doSubmit = () => {
that.isSaveing = false; that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => {
that.visible = false; that.isSaveing = false;
that.$emit('closed',false); that.visible = false;
that.$message.success("操作成功"); that.$emit('closed',false);
}).catch(() => { that.$message.success("操作成功");
that.isSaveing = false; }).catch(() => {
}); that.isSaveing = false;
});
};
if (that.hasOkBDefect) {
that.$API.wpm.mlog.change.req(that.mlogItem.id, { clear_defect: !!that.mlogItem.clear_defect }).then(() => {
doSubmit();
}).catch(() => {
that.isSaveing = false;
});
} else {
doSubmit();
}
}, },
saveMuserSubmit(row){ saveMuserSubmit(row){
let that = this; let that = this;

View File

@ -55,7 +55,7 @@
</thead> </thead>
<tbody> <tbody>
<tr v-for="(row, index) in mlogbwlist" :key="row.id"> <tr v-for="(row, index) in mlogbwlist" :key="row.id">
<td class="w_50 padding_4 sticky-cell sticky-left-select" style="text-align: center;"> <td class="w_50 padding_4 sticky-cell sticky-left-select">
<input type="checkbox" class="checkboxInput" v-model="selectedindexes" :value="row.id" @change="selectChange"> <input type="checkbox" class="checkboxInput" v-model="selectedindexes" :value="row.id" @change="selectChange">
</td> </td>
<td class="w_50 padding_4 sticky-cell sticky-left-index"> <td class="w_50 padding_4 sticky-cell sticky-left-index">
@ -1242,7 +1242,6 @@ input{
} }
.w_50{ .w_50{
width: 50px; width: 50px;
min-width: 50px;
} }
.w_80{ .w_80{
width: 80px; width: 80px;

View File

@ -9,22 +9,28 @@
<h4>关联产品</h4> <h4>关联产品</h4>
<el-button v-if="mode=='out'" type="primary" @click="wprNumberChange">发货编号</el-button> <el-button v-if="mode=='out'" type="primary" @click="wprNumberChange">发货编号</el-button>
<el-button v-if="mode=='out'" type="warning" @click="wprNumberClear">清空编号</el-button> <el-button v-if="mode=='out'" type="warning" @click="wprNumberClear">清空编号</el-button>
<el-button
type="warning"
:disabled="selectedRows.length === 0"
@click="batchSendToCoder"
>批量喷码</el-button>
<el-input <el-input
v-if="mode=='ins'"
style="margin-right: 5px;width: 200px;" style="margin-right: 5px;width: 200px;"
v-model="search" v-model="search"
placeholder="编号" placeholder="编号"
clearable clearable
@keyup.enter="handleWprQuery"
></el-input> ></el-input>
<el-button <el-button
v-if="mode=='ins'"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleWprQuery" @click="handleWprQuery"
></el-button> ></el-button>
</template> </template>
<template #default> <template #default>
<el-table ref="wprTable" id="wprTable" :data="wprList" :height="wprTableHeight" border highlight-current-row> <el-table ref="wprTable" id="wprTable" :data="wprList" :height="wprTableHeight" border highlight-current-row @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="产品编号" prop="number" min-width="100px" ></el-table-column> <el-table-column label="产品编号" prop="number" min-width="100px" ></el-table-column>
<el-table-column label="对外编号" prop="number_out" min-width="100px" <el-table-column label="对外编号" prop="number_out" min-width="100px"
v-if="mgroupName=='成品内外初检'||mgroupName=='成品内质复检'||mgroupName=='成品性能检测'||mgroupName=='成品尺寸检测'||mgroupName=='成品外观复检一'||mgroupName=='成品外观复检二'" v-if="mgroupName=='成品内外初检'||mgroupName=='成品内质复检'||mgroupName=='成品性能检测'||mgroupName=='成品尺寸检测'||mgroupName=='成品外观复检一'||mgroupName=='成品外观复检二'"
@ -122,6 +128,7 @@ export default {
wmtype:'', wmtype:'',
scQr_code:'', scQr_code:'',
wprList:[], wprList:[],
selectedRows:[],
digitNum:3, digitNum:3,
wprTableHeight:500, wprTableHeight:500,
printer_name:localStorage.getItem("printer_name"), printer_name:localStorage.getItem("printer_name"),
@ -244,15 +251,16 @@ export default {
}, },
handleWprQuery(){ handleWprQuery(){
let that = this; let that = this;
that.wprList.forEach((item,index)=>{ let foundIndex = that.wprList.findIndex(item => item.number.indexOf(that.search) > -1);
if(item.number.indexOf(that.search) > -1){ if(foundIndex > -1){
that.$refs.wprTable.setCurrentRow(item); let found = that.wprList.splice(foundIndex, 1)[0];
let rows = document.querySelectorAll("#wprTable .el-table__row"); that.wprList.unshift(found);
let row = rows[index]; that.$nextTick(() => {
let rowTop = row.offsetTop; that.$refs.wprTable.setCurrentRow(that.wprList[0]);
that.$refs.wprTable.scrollTo({ top: rowTop }); that.$refs.wprTable.toggleRowSelection(that.wprList[0], true);
} that.$refs.wprTable.scrollTo({ top: 0 });
}) });
}
}, },
// //
printMaterial(row){ printMaterial(row){
@ -352,7 +360,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
delete map[row.id]; delete map[row.id];
that.coderLoadingIds = map; that.coderLoadingIds = map;
}; };
that.$API.cm.labeltemplate.list.req({search: templateName, page: 0}).then((res) => { that.$API.cm.labeltemplate.list.req({name: templateName, page: 0}).then((res) => {
let list = Array.isArray(res) ? res : (res && res.results) || []; let list = Array.isArray(res) ? res : (res && res.results) || [];
let template = list.find(t => t.name === templateName); let template = list.find(t => t.name === templateName);
if (!template) { if (!template) {
@ -370,6 +378,15 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
}).finally(release); }).finally(release);
}).catch(release); }).catch(release);
}, },
handleSelectionChange(rows){
this.selectedRows = rows;
},
batchSendToCoder(){
let that = this;
that.selectedRows.forEach(row => {
that.sendToCoder(row);
});
},
// //
handleSaveSuccess() { handleSaveSuccess() {
this.$refs.tables.refresh(); this.$refs.tables.refresh();

View File

@ -189,10 +189,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="change_batch"> <el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号" required> <el-form-item label="新批次号" required>
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input> <el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="24" :sm="24" v-if="defectMismatch">
<el-form-item label="清除缺陷">
<el-checkbox v-model="form.clear_defect">
源批次缺陷不一致勾选后合并批次将清除缺陷标记
</el-checkbox>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row v-if="addShow&&route_code=='tuihuo'"> <el-row v-if="addShow&&route_code=='tuihuo'">
<el-col> <el-col>
@ -342,6 +349,7 @@ export default {
ticket:null, ticket:null,
ticket_:null, ticket_:null,
oinfo_json:{}, oinfo_json:{},
clear_defect: false,
}, },
initForm:{}, initForm:{},
selectObjIds:[], selectObjIds:[],
@ -470,12 +478,28 @@ export default {
} }
that.getTid(); that.getTid();
}, },
computed: {
// state OK(10) defect ""
defectMismatch() {
if (this.mtype !== 30) return false;
const items = this.form.handoverb || [];
if (items.length < 2) return false;
if (!items.every(i => Number(i.state) === 10)) return false;
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect));
return defectIds.size > 1;
}
},
watch: { watch: {
batchList:{ batchList:{
deep:true, deep:true,
handler (v) { handler (v) {
console.log('batchList',v) console.log('batchList',v)
} }
},
defectMismatch(val) {
if (!val) {
this.form.clear_defect = false;
}
} }
}, },
methods: { methods: {
@ -636,6 +660,7 @@ export default {
console.log(data) console.log(data)
this.mode = mode; this.mode = mode;
this.mtype = mtype; this.mtype = mtype;
this.form.clear_defect = false;
if(data!==''&&data!==null&&data!==undefined){ if(data!==''&&data!==null&&data!==undefined){
console.log(typeof(data)=='string') console.log(typeof(data)=='string')
if(typeof(data)=='string'){ if(typeof(data)=='string'){
@ -646,6 +671,7 @@ export default {
data.forEach(item=>{ data.forEach(item=>{
let obj = {}; let obj = {};
obj.wm = item.wm; obj.wm = item.wm;
obj.state = item.state?item.state:'';
obj.label = item.label; obj.label = item.label;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect; obj.defect = item.defect;

View File

@ -431,6 +431,7 @@ export default {
let obj = {}; let obj = {};
obj.wm = item.id; obj.wm = item.id;
obj.batch = item.batch; obj.batch = item.batch;
obj.state = item.state;
obj.defect = item.defect; obj.defect = item.defect;
obj.material = item.material; obj.material = item.material;
obj.count_canhandover = item.count_canhandover; obj.count_canhandover = item.count_canhandover;

View File

@ -170,6 +170,10 @@
<el-table-column label="仓库" prop="warehouse_name"> <el-table-column label="仓库" prop="warehouse_name">
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="count"> <el-table-column label="数量" prop="count">
<template #default="scope">
{{ scope.row.count }}
<el-tag :type="getType(scope.row.okcate)" v-if="scope.row.defect_name">{{ scope.row.defect_name }}</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="90"> <el-table-column label="操作" width="90">
<template #default="scope"> <template #default="scope">
@ -237,6 +241,10 @@
<el-table-column label="仓库" prop="warehouse_name"> <el-table-column label="仓库" prop="warehouse_name">
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="count"> <el-table-column label="数量" prop="count">
<template #default="scope">
{{ scope.row.count }}
<el-tag :type="getType(scope.row.okcate)" v-if="scope.row.defect_name">{{ scope.row.defect_name }}</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="组合件信息" label="组合件信息"
@ -417,6 +425,15 @@ export default {
} }
Object.assign(this.form, data); Object.assign(this.form, data);
}, },
getType(type){
if(type==10){
return 'success'
}else if(type==20){
return 'danger'
}else if(type==30){
return 'warning'
}
},
getTableData() { getTableData() {
let that = this; let that = this;
let obj = {}; let obj = {};

View File

@ -199,7 +199,6 @@ export default {
mioId: "", mioId: "",
project_code: "", project_code: "",
visibleDrawer: false, visibleDrawer: false,
inmRecordDialog:false,
}; };
}, },
mounted() { mounted() {

View File

@ -61,7 +61,12 @@
<el-link :href="mlogItem.test_file" target="_blank" type="primary" :underline="false">{{mlogItem.test_file}}</el-link> <el-link :href="mlogItem.test_file" target="_blank" type="primary" :underline="false">{{mlogItem.test_file}}</el-link>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;"> <div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
<!-- hasOkBDefect -->
<div v-if="mlogItem.submit_time == null" style="margin-right: 16px;display:flex;align-items:center;">
<span style="margin-right: 6px;">合格B类不拆批</span>
<el-switch v-model="mlogItem.clear_defect"></el-switch>
</div>
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null" v-if="mlogItem.submit_time == null"
@ -397,6 +402,13 @@ export default {
printDialog printDialog
}, },
emits: ["success", "closed"], emits: ["success", "closed"],
computed: {
hasOkBDefect() {
const rows = this.tableData2 || [];
return rows.some(row => Array.isArray(row.mlogbdefect)
&& row.mlogbdefect.some(d => Number(d.defect_okcate) === 20 && Number(d.count) > 0));
},
},
data() { data() {
return { return {
wmState, wmState,
@ -638,11 +650,25 @@ export default {
// //
mlogSubmit() { mlogSubmit() {
let that = this; let that = this;
that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { that.isSaveing = true;
that.isSaveing = false; const doSubmit = () => {
that.visible = false; that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => {
that.$message.success("操作成功"); that.isSaveing = false;
}); that.visible = false;
that.$message.success("操作成功");
}).catch(() => {
that.isSaveing = false;
});
};
if (that.hasOkBDefect) {
that.$API.wpm.mlog.change.req(that.mlogItem.id, { clear_defect: !!that.mlogItem.clear_defect }).then(() => {
doSubmit();
}).catch(() => {
that.isSaveing = false;
});
} else {
doSubmit();
}
}, },
// // // //
// getInit() { // getInit() {