This commit is contained in:
shijing 2026-07-30 14:02:28 +08:00
commit d3e700fcae
12 changed files with 205 additions and 112 deletions

View File

@ -201,14 +201,20 @@ export const schedulePeriodEnum = new EnumFactory({
}) })
export const wmState = new EnumFactory({ export const wmState = new EnumFactory({
10: { text: '合格', type: 'success' }, 10: { text: '正常', type: 'success' },
20: { text: '不合格', type: 'warning' }, 20: { text: '不合格', type: 'warning' },
30: { text: '返', type: 'warning' }, 30: { text: '返', type: 'warning' },
34: { text: '返完成', type: 'warning' }, 34: { text: '返完成', type: 'warning' },
40: { text: '检验', type: 'primary' }, 40: { text: '检验', type: 'primary' },
50: { text: '报废', type: 'danger' }, 50: { text: '报废', type: 'danger' },
}, parseInt) }, parseInt)
export const defectGrade = new EnumFactory({
10: { text: '合格', type: 'success' },
20: { text: '合格B类', type: 'warning' },
30: { text: '不合格', type: 'danger' },
}, parseInt)
export const certStateEnum = new EnumFactory({ export const certStateEnum = new EnumFactory({
10: { text: '正常', type: 'success' }, 10: { text: '正常', type: 'success' },
20: { text: '临期', type: 'warning' }, 20: { text: '临期', type: 'warning' },

View File

@ -103,7 +103,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="合格B类默认记合格"> <el-form-item label="生产日志默认将合格B类计入合格品">
<el-switch <el-switch
v-model="form.clear_defect" v-model="form.clear_defect"
></el-switch> ></el-switch>

View File

@ -55,6 +55,7 @@
<span>{{ item.batch }}</span> <span>{{ item.batch }}</span>
<span v-if="item.material_&&item.material_.process_name">({{ item.material_.process_name }})</span> <span v-if="item.material_&&item.material_.process_name">({{ item.material_.process_name }})</span>
<span v-else>(原料棒)</span> <span v-else>(原料棒)</span>
<el-tag v-if="item.defect_grade != null" :type="item.defect_grade === 30 ? 'danger' : item.defect_grade === 20 ? 'warning' : 'success'" size="small" style="margin-left: 8px;">{{ item.defect_grade_name }}</el-tag>
<el-tag v-if="item.defect!==null" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ item.defect_name }}</el-tag> <el-tag v-if="item.defect!==null" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ item.defect_name }}</el-tag>
<div style="float: right"> <div style="float: right">
<span>{{ item.count_canhandover }}</span> <span>{{ item.count_canhandover }}</span>
@ -228,10 +229,10 @@
<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-col :md="24" :sm="24" v-if="canClearBatchDefect">
<el-form-item label="清除缺陷"> <el-form-item label="清除批次缺陷">
<el-checkbox v-model="form.clear_defect"> <el-checkbox v-model="form.clear_defect">
源批次缺陷不一致勾选后合并批次将清除缺陷标记 {{ clearBatchDefectHint }}
</el-checkbox> </el-checkbox>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -469,19 +470,30 @@ export default {
if (!this.form.handoverb || this.form.handoverb.length === 0) return 0; if (!this.form.handoverb || this.form.handoverb.length === 0) return 0;
return this.form.handoverb.reduce((sum, item) => sum + Number(item.count || 0), 0); return this.form.handoverb.reduce((sum, item) => sum + Number(item.count || 0), 0);
}, },
// state OK(10) defect "" canClearBatchDefect() {
defectMismatch() {
if (this.mtype !== 30) return false; if (this.mtype !== 30) return false;
if (this.new_wm) return false; if (this.new_wm) return false;
const items = this.form.handoverb || []; const items = this.form.handoverb || [];
if (items.length < 2) return false; if (items.length < 2) return false;
if (!items.every(i => Number(i.state) === 10)) return false; const states = new Set(items.map(i => Number(i.state)));
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect)); if (states.size !== 1) return false;
return defectIds.size > 1; const tracking = Number(items[0].tracking);
if (tracking === 20) return true;
return items.every(i =>
Number(i.state) === 10 &&
i.defect != null &&
Number(i.defect_okcate) === 20
);
},
clearBatchDefectHint() {
const items = this.form.handoverb || [];
return Number(items[0] && items[0].tracking) === 20
? "仅清除合批后批次的缺陷归类,单件缺陷记录保持不变"
: "将合格B类合并为无缺陷批次";
} }
}, },
watch: { watch: {
defectMismatch(val) { canClearBatchDefect(val) {
if (!val) { if (!val) {
this.form.clear_defect = false; this.form.clear_defect = false;
} }
@ -538,7 +550,7 @@ export default {
let that = this; let that = this;
var req = { var req = {
page: 0, page: 0,
state__in:'10,34', state__in: this.mtype === 30 ? '10,20,34' : '10,34',
tag:that.tag, tag:that.tag,
mgroupx:that.mgroupId mgroupx:that.mgroupId
}; };

View File

@ -34,7 +34,7 @@
</el-select> </el-select>
<el-select <el-select
v-model="query.state" v-model="query.state"
placeholder="物料状态" placeholder="库存状态"
clearable clearable
@change="handleQuery" @change="handleQuery"
style="width: 250px" style="width: 250px"
@ -46,6 +46,9 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-select v-model="query.defect__okcate" placeholder="缺陷等级" clearable style="width: 130px" @change="handleQuery">
<el-option v-for="item in defectGradeOptions" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-input <el-input
style="margin-right: 5px" style="margin-right: 5px"
v-model="query.search" v-model="query.search"
@ -70,13 +73,20 @@
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column type="selection" width="50"></el-table-column> <el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="状态" prop="state" width="100" > <el-table-column label="库存状态" prop="state" width="110" >
<template #default="scope"> <template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type"> <el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}} {{wmState[scope.row.state]?.text}}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="缺陷等级" prop="defect_grade" width="105">
<template #default="scope">
<el-tag v-if="scope.row.defect_grade != null" :type="defectGrade[scope.row.defect_grade]?.type">{{ defectGrade[scope.row.defect_grade]?.text }}</el-tag>
<span v-else-if="scope.row.notok_sign">未分级</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
prop="material_name" prop="material_name"
@ -141,9 +151,11 @@
min-width="80" min-width="80"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="不合格标记" label="缺陷项/标记"
prop="defect_name" prop="defect_name"
></el-table-column> >
<template #default="scope">{{ scope.row.defect_name || scope.row.notok_sign_name || '—' }}</template>
</el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="create_time" prop="create_time"
@ -344,7 +356,7 @@
</el-container> </el-container>
</template> </template>
<script> <script>
import { wmState } from "@/utils/enum.js"; import { defectGrade, wmState } from "@/utils/enum.js";
import checkDialog from "./check_form.vue"; import checkDialog from "./check_form.vue";
import showDrawer from "./check_drawer.vue"; import showDrawer from "./check_drawer.vue";
import scrapDialog from "./handover_form.vue"; import scrapDialog from "./handover_form.vue";
@ -386,6 +398,7 @@ export default {
data() { data() {
return { return {
wmState, wmState,
defectGrade,
apiObj: null, apiObj: null,
params: { params: {
tag : 'todo', tag : 'todo',
@ -395,6 +408,7 @@ export default {
query: { query: {
search: "", search: "",
state: 10, state: 10,
defect__okcate: null,
current_merged:null, current_merged:null,
}, },
dialog: { dialog: {
@ -410,9 +424,17 @@ export default {
tableData: [], tableData: [],
selection: [], selection: [],
stateOptions:[ stateOptions:[
{ value: 10, name: "正常"},
{ value: 20, name: "不合格品"},
{ value: 30, name: "返修"},
{ value: 34, name: "返修完成"},
{ value: 40, name: "待检验"},
{ value: 50, name: "报废"},
],
defectGradeOptions: [
{ value: 10, name: "合格"}, { value: 10, name: "合格"},
{ value: 20, name: "不合格"}, { value: 20, name: "合格B类"},
{ value: 30, name: "返工"}, { value: 30, name: "不合格"},
], ],
mergedOptions:[ mergedOptions:[
{ value: false, name: "未合批"}, { value: false, name: "未合批"},

View File

@ -19,9 +19,9 @@
></el-switch> ></el-switch>
<el-select <el-select
v-model="query.state" v-model="query.state"
placeholder="物料状态" placeholder="库存状态"
clearable clearable
@change="searchStateChange" @change="handleQuery"
style="width: 100px" style="width: 100px"
> >
<el-option <el-option
@ -31,6 +31,9 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-select v-model="query.defect__okcate" placeholder="缺陷等级" clearable style="width: 130px" @change="handleQuery">
<el-option v-for="item in defectGradeOptions" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-select <el-select
v-model="query.defect" v-model="query.defect"
placeholder="不合格项" placeholder="不合格项"
@ -69,13 +72,20 @@
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column type="selection" width="50"></el-table-column> <el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="状态" prop="state" width="80" > <el-table-column label="库存状态" prop="state" width="110" >
<template #default="scope"> <template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type"> <el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}} {{wmState[scope.row.state]?.text}}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="缺陷等级" prop="defect_grade" width="105">
<template #default="scope">
<el-tag v-if="scope.row.defect_grade != null" :type="defectGrade[scope.row.defect_grade]?.type">{{ defectGrade[scope.row.defect_grade]?.text }}</el-tag>
<span v-else-if="scope.row.notok_sign">未分级</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
prop="material_name" prop="material_name"
@ -140,9 +150,11 @@
min-width="80" min-width="80"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="不合格标记" label="缺陷项/标记"
prop="defect_name" prop="defect_name"
></el-table-column> >
<template #default="scope">{{ scope.row.defect_name || scope.row.notok_sign_name || '—' }}</template>
</el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="create_time" prop="create_time"
@ -315,7 +327,7 @@
</el-container> </el-container>
</template> </template>
<script> <script>
import { wmState } from "@/utils/enum.js"; import { defectGrade, wmState } from "@/utils/enum.js";
import materials from "./../mtm/materials.vue"; import materials from "./../mtm/materials.vue";
import checkDialog from "./check_form.vue"; import checkDialog from "./check_form.vue";
import showDrawer from "./check_drawer.vue"; import showDrawer from "./check_drawer.vue";
@ -359,6 +371,7 @@ export default {
data() { data() {
return { return {
wmState, wmState,
defectGrade,
apiObj: null, apiObj: null,
params: { params: {
tag : 'done', tag : 'done',
@ -369,6 +382,7 @@ export default {
search: "", search: "",
defect: "", defect: "",
state: null, state: null,
defect__okcate: null,
}, },
dialog: { dialog: {
save: false, save: false,
@ -384,9 +398,17 @@ export default {
selection: [], selection: [],
defectOptions: [], defectOptions: [],
stateOptions:[ stateOptions:[
{ value: 10, name: "正常"},
{ value: 20, name: "不合格品"},
{ value: 30, name: "返修"},
{ value: 34, name: "返修完成"},
{ value: 40, name: "待检验"},
{ value: 50, name: "报废"},
],
defectGradeOptions: [
{ value: 10, name: "合格"}, { value: 10, name: "合格"},
{ value: 20, name: "不合格"}, { value: 20, name: "合格B类"},
{ value: 30, name: "返工"}, { value: 30, name: "不合格"},
], ],
queryWm: { queryWm: {
search: "", search: "",

View File

@ -60,7 +60,7 @@
</el-descriptions> </el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;"> <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;"> <div v-if="mlogItem.submit_time == null && hasOkBDefect" style="margin-right: 16px;display:flex;align-items:center;">
<span style="margin-right: 6px;">合格B类记为合格</span> <span style="margin-right: 6px;">将合格B类计入合格品</span>
<el-switch v-model="mlogItem.clear_defect"></el-switch> <el-switch v-model="mlogItem.clear_defect"></el-switch>
</div> </div>
<el-button <el-button

View File

@ -77,6 +77,7 @@
:value="item.id" :value="item.id"
> >
<span>{{ item.batch }}</span> <span>{{ item.batch }}</span>
<el-tag v-if="item.defect_grade != null" :type="item.defect_grade === 30 ? 'danger' : item.defect_grade === 20 ? 'warning' : 'success'" size="small" style="margin-left: 8px;">{{ item.defect_grade_name }}</el-tag>
<el-tag v-if="item.defect_name&&item.defect_name!==null" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ item.defect_name }}</el-tag> <el-tag v-if="item.defect_name&&item.defect_name!==null" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ item.defect_name }}</el-tag>
<span style="float: right;">{{ item.count_cando }}</span> <span style="float: right;">{{ item.count_cando }}</span>
</el-option> </el-option>

View File

@ -45,9 +45,10 @@
> >
<el-table-column label="物料" prop="full_name"> <el-table-column label="物料" prop="full_name">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span> <span v-if="scope.row.state==20" style="color: #e6a23c;border: 1px solid #e6a23c;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;"></span> <span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;"></span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span> <span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<el-tag v-if="scope.row.defect_grade != null" :type="scope.row.defect_grade === 30 ? 'danger' : scope.row.defect_grade === 20 ? 'warning' : 'success'" size="small" style="margin-left: 8px;">{{ scope.row.defect_grade_name }}</el-tag>
<el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag> <el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -193,10 +194,10 @@
<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-col :md="24" :sm="24" v-if="canClearBatchDefect">
<el-form-item label="清除缺陷"> <el-form-item label="清除批次缺陷">
<el-checkbox v-model="form.clear_defect"> <el-checkbox v-model="form.clear_defect">
源批次缺陷不一致勾选后合并批次将清除缺陷标记 {{ clearBatchDefectHint }}
</el-checkbox> </el-checkbox>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -217,9 +218,10 @@
> >
<el-table-column label="物料" prop="full_name"> <el-table-column label="物料" prop="full_name">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span> <span v-if="scope.row.state==20" style="color: #e6a23c;border: 1px solid #e6a23c;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;"></span> <span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;"></span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span> <span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<el-tag v-if="scope.row.defect_grade != null" :type="scope.row.defect_grade === 30 ? 'danger' : scope.row.defect_grade === 20 ? 'warning' : 'success'" size="small" style="margin-left: 8px;">{{ scope.row.defect_grade_name }}</el-tag>
<el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag> <el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -479,14 +481,25 @@ export default {
that.getTid(); that.getTid();
}, },
computed: { computed: {
// state OK(10) defect "" canClearBatchDefect() {
defectMismatch() {
if (this.mtype !== 30) return false; if (this.mtype !== 30) return false;
const items = this.form.handoverb || []; const items = this.form.handoverb || [];
if (items.length < 2) return false; if (items.length < 2) return false;
if (!items.every(i => Number(i.state) === 10)) return false; const states = new Set(items.map(i => Number(i.state)));
const defectIds = new Set(items.map(i => i.defect == null ? null : i.defect)); if (states.size !== 1) return false;
return defectIds.size > 1; const tracking = Number(items[0].tracking);
if (tracking === 20) return true;
return items.every(i =>
Number(i.state) === 10 &&
i.defect != null &&
Number(i.defect_okcate) === 20
);
},
clearBatchDefectHint() {
const items = this.form.handoverb || [];
return Number(items[0] && items[0].tracking) === 20
? "仅清除合批后批次的缺陷归类,单件缺陷记录保持不变"
: "将合格B类合并为无缺陷批次";
} }
}, },
watch: { watch: {
@ -496,7 +509,7 @@ export default {
console.log('batchList',v) console.log('batchList',v)
} }
}, },
defectMismatch(val) { canClearBatchDefect(val) {
if (!val) { if (!val) {
this.form.clear_defect = false; this.form.clear_defect = false;
} }
@ -661,6 +674,13 @@ export default {
this.mode = mode; this.mode = mode;
this.mtype = mtype; this.mtype = mtype;
this.form.clear_defect = false; this.form.clear_defect = false;
if (mtype === 30) {
this.paramsM = {
...this.paramsM,
state__in: '10,20,34'
};
delete this.paramsM.state;
}
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'){
@ -675,6 +695,8 @@ export default {
obj.label = item.label; obj.label = item.label;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect; obj.defect = item.defect;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.tracking || (item.material_ && item.material_.tracking);
obj.material = item.material; obj.material = item.material;
obj.count_cando = item.count_canhandover; obj.count_cando = item.count_canhandover;
obj.count = item.count_canhandover; obj.count = item.count_canhandover;
@ -704,6 +726,8 @@ export default {
obj.count = item.count_canhandover; obj.count = item.count_canhandover;
obj.defect = item.defect; obj.defect = item.defect;
obj.defect_name = item.defect_name; obj.defect_name = item.defect_name;
obj.defect_okcate = item.defect_okcate;
obj.tracking = item.material_ && item.material_.tracking;
obj.count_cando = item.count_canhandover; obj.count_cando = item.count_canhandover;
obj.material = item.material; obj.material = item.material;
if(that.type==50){ if(that.type==50){
@ -726,7 +750,8 @@ export default {
if(!row || !row.batch){ if(!row || !row.batch){
return ""; return "";
} }
return row.defect_name ? `${row.batch} [${row.defect_name}]` : row.batch; const details = [row.defect_grade_name, row.defect_name].filter(Boolean);
return details.length ? `${row.batch} [${details.join("")}]` : row.batch;
}, },
countChange(){ countChange(){
let that = this; let that = this;

View File

@ -12,11 +12,11 @@
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-select <el-select
v-model="queryState" v-model="query.state"
placeholder="物料状态" placeholder="库存状态"
clearable clearable
style="width: 250px" style="width: 250px"
@change="searchStateChange" @change="handleQuery"
> >
<el-option <el-option
v-for="item in stateOptions" v-for="item in stateOptions"
@ -25,6 +25,9 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-select v-model="query.defect__okcate" placeholder="缺陷等级" clearable style="width: 130px" @change="handleQuery">
<el-option v-for="item in defectGradeOptions" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-input <el-input
style="margin-right: 5px" style="margin-right: 5px"
v-model="query.search" v-model="query.search"
@ -49,13 +52,20 @@
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column type="selection"></el-table-column> <el-table-column type="selection"></el-table-column>
<el-table-column label="状态" prop="state" width="100" > <el-table-column label="库存状态" prop="state" width="110" >
<template #default="scope"> <template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type"> <el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}} {{wmState[scope.row.state]?.text}}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="缺陷等级" prop="defect_grade" width="105">
<template #default="scope">
<el-tag v-if="scope.row.defect_grade != null" :type="defectGrade[scope.row.defect_grade]?.type">{{ defectGrade[scope.row.defect_grade]?.text }}</el-tag>
<span v-else-if="scope.row.notok_sign">未分级</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
prop="material_name" prop="material_name"
@ -96,9 +106,11 @@
min-width="80" min-width="80"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="不合格标记" label="缺陷项/标记"
prop="defect_name" prop="defect_name"
></el-table-column> >
<template #default="scope">{{ scope.row.defect_name || scope.row.notok_sign_name || '—' }}</template>
</el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="create_time" prop="create_time"
@ -220,7 +232,7 @@
</el-container> </el-container>
</template> </template>
<script> <script>
import { wmState } from "@/utils/enum.js"; import { defectGrade, wmState } from "@/utils/enum.js";
import printDialog from "./../template/printmaterial.vue"; import printDialog from "./../template/printmaterial.vue";
import checkDialog from "./check_form.vue"; import checkDialog from "./check_form.vue";
import showDrawer from "./check_drawer.vue"; import showDrawer from "./check_drawer.vue";
@ -262,6 +274,7 @@ export default {
data() { data() {
return { return {
wmState, wmState,
defectGrade,
apiObj: null, apiObj: null,
params: { params: {
mgroup: "", mgroup: "",
@ -271,6 +284,7 @@ export default {
query: { query: {
search: "", search: "",
state: null, state: null,
defect__okcate: null,
}, },
dialog: { dialog: {
save: false, save: false,
@ -284,12 +298,18 @@ export default {
tableData: [], tableData: [],
selection: [], selection: [],
stateOptions:[ stateOptions:[
{ value: 100, name: "完全合格"}, { value: 10, name: "正常"},
{ value: 101, name: "合格B类"}, { value: 20, name: "不合格品"},
{ value: 20, name: "不合格"}, { value: 30, name: "返修"},
{ value: 30, name: "返工"}, { value: 34, name: "返修完成"},
{ value: 40, name: "待检验"},
{ value: 50, name: "报废"},
],
defectGradeOptions: [
{ value: 10, name: "合格"},
{ value: 20, name: "合格B类"},
{ value: 30, name: "不合格"},
], ],
queryState: null,
codeText2: "", codeText2: "",
codeText4: "", codeText4: "",
cate_type:'', cate_type:'',
@ -355,25 +375,6 @@ export default {
this.$refs.scrapDialog.open("add",handoverb,30); this.$refs.scrapDialog.open("add",handoverb,30);
}); });
}, },
searchStateChange(){
let that = this;
that.query.state = null;
that.query.defect__isnull = null;
if(that.queryState==100){
that.query.state = 10;
that.query.defect__isnull = true;
}else if(that.queryState==101){
that.query.state = 10;
that.query.defect__isnull = false;
}else if(that.queryState==20){
that.query.state = 20;
that.query.defect__isnull = null;
}else if(that.queryState==30){
that.query.state = 30;
that.query.defect__isnull = null;
}
that.handleQuery();
},
// //
tomio(type) { tomio(type) {
let that = this; let that = this;

View File

@ -29,10 +29,10 @@
style="width: 130px; margin:0" style="width: 130px; margin:0"
></el-date-picker> ></el-date-picker>
<el-select <el-select
v-model="queryState" v-model="query.state"
placeholder="物料状态" placeholder="库存状态"
clearable clearable
@change="searchStateChange" @change="handleQuery"
style="width: 110px" style="width: 110px"
> >
<el-option <el-option
@ -42,6 +42,9 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-select v-model="query.defect__okcate" placeholder="缺陷等级" clearable style="width: 130px" @change="handleQuery">
<el-option v-for="item in defectGradeOptions" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-input <el-input
style="margin-right: 5px;width: 200px" style="margin-right: 5px;width: 200px"
v-model="query.search" v-model="query.search"
@ -66,13 +69,20 @@
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column type="selection"></el-table-column> <el-table-column type="selection"></el-table-column>
<el-table-column label="状态" prop="state" width="100" > <el-table-column label="库存状态" prop="state" width="110" >
<template #default="scope"> <template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type"> <el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}} {{wmState[scope.row.state]?.text}}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="缺陷等级" prop="defect_grade" width="105">
<template #default="scope">
<el-tag v-if="scope.row.defect_grade != null" :type="defectGrade[scope.row.defect_grade]?.type">{{ defectGrade[scope.row.defect_grade]?.text }}</el-tag>
<span v-else-if="scope.row.notok_sign">未分级</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
prop="material_name" prop="material_name"
@ -111,9 +121,11 @@
min-width="80" min-width="80"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="不合格标记" label="缺陷项/标记"
prop="defect_name" prop="defect_name"
></el-table-column> >
<template #default="scope">{{ scope.row.defect_name || scope.row.notok_sign_name || '—' }}</template>
</el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="create_time" prop="create_time"
@ -210,7 +222,7 @@
</el-container> </el-container>
</template> </template>
<script> <script>
import { wmState } from "@/utils/enum.js"; import { defectGrade, wmState } from "@/utils/enum.js";
import materials from "./../mtm/materials.vue"; import materials from "./../mtm/materials.vue";
import printDialog from "./../template/printmaterial.vue"; import printDialog from "./../template/printmaterial.vue";
import checkDialog from "./check_form.vue"; import checkDialog from "./check_form.vue";
@ -254,6 +266,7 @@ export default {
data() { data() {
return { return {
wmState, wmState,
defectGrade,
apiObj: null, apiObj: null,
params: { params: {
mgroup: "", mgroup: "",
@ -263,6 +276,7 @@ export default {
query: { query: {
search: "", search: "",
state: null, state: null,
defect__okcate: null,
}, },
dialog: { dialog: {
save: false, save: false,
@ -275,16 +289,22 @@ export default {
tableData: [], tableData: [],
selection: [], selection: [],
stateOptions:[ stateOptions:[
{ value: 100, name: "完全合格"}, { value: 10, name: "正常"},
{ value: 101, name: "合格B类"}, { value: 20, name: "不合格品"},
{ value: 20, name: "不合格"}, { value: 30, name: "返修"},
{ value: 30, name: "返工"}, { value: 34, name: "返修完成"},
{ value: 40, name: "待检验"},
{ value: 50, name: "报废"},
], ],
queryWm: { queryWm: {
search: "", search: "",
material: "", material: "",
}, },
queryState:null, defectGradeOptions: [
{ value: 10, name: "合格"},
{ value: 20, name: "合格B类"},
{ value: 30, name: "不合格"},
],
route_code:'', route_code:'',
cate_type:'', cate_type:'',
materialType: "wm", materialType: "wm",
@ -321,25 +341,6 @@ export default {
this.$refs.table_wm.queryData(this.queryWm); this.$refs.table_wm.queryData(this.queryWm);
this.materialsVisible = false; this.materialsVisible = false;
}, },
searchStateChange(){
let that = this;
that.query.state = null;
that.query.defect__isnull = null;
if(that.queryState==100){
that.query.state = 10;
that.query.defect__isnull = true;
}else if(that.queryState==101){
that.query.state = 10;
that.query.defect__isnull = false;
}else if(that.queryState==20){
that.query.state = 20;
that.query.defect__isnull = null;
}else if(that.queryState==30){
that.query.state = 30;
that.query.defect__isnull = null;
}
that.handleQuery();
},
tomio(type) { tomio(type) {
let that = this; let that = this;
that.cate_type=type; that.cate_type=type;

View File

@ -64,7 +64,7 @@
<div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;"> <div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
<!-- hasOkBDefect --> <!-- hasOkBDefect -->
<div v-if="mlogItem.submit_time == null" style="margin-right: 16px;display:flex;align-items:center;"> <div v-if="mlogItem.submit_time == null" style="margin-right: 16px;display:flex;align-items:center;">
<span style="margin-right: 6px;">合格B类记为合格</span> <span style="margin-right: 6px;">将合格B类计入合格品</span>
<el-switch v-model="mlogItem.clear_defect"></el-switch> <el-switch v-model="mlogItem.clear_defect"></el-switch>
</div> </div>
<el-button <el-button

View File

@ -54,9 +54,10 @@
<!-- :params = "{type__in: '10,20',is_hidden: false}" --> <!-- :params = "{type__in: '10,20',is_hidden: false}" -->
<el-table-column label="物料" prop="full_name"> <el-table-column label="物料" prop="full_name">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span> <span v-if="scope.row.state==20" style="color: #e6a23c;border: 1px solid #e6a23c;border-radius: 3px;">不合格</span>
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;"></span> <span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;"></span>
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span> <span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
<el-tag v-if="scope.row.defect_grade != null" :type="scope.row.defect_grade === 30 ? 'danger' : scope.row.defect_grade === 20 ? 'warning' : 'success'" size="small" style="margin-left: 8px;">{{ scope.row.defect_grade_name }}</el-tag>
<el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag> <el-tag v-if="scope.row.defect_name" type="warning" size="small" effect="plain" style="margin-left: 8px;">{{ scope.row.defect_name }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -493,7 +494,9 @@ export default {
if(!row || !row.batch){ if(!row || !row.batch){
return ""; return "";
} }
return row.defect_name ? `${row.batch} [${row.defect_name}]` : row.batch; const details = [row.defect_grade_name, row.defect_name].filter(Boolean);
return details.length ? `${row.batch} [${details.join("")}]` : row.batch;
}, },
// //
submit() { submit() {