fix:车间库存检验记录

This commit is contained in:
shijing 2025-01-15 15:52:51 +08:00
parent 7831d87869
commit 29a9af5312
2 changed files with 52 additions and 39 deletions

View File

@ -15,7 +15,6 @@
stripe
:params="paramsObj"
>
<!-- <el-table-column type="index" width="50" /> -->
<el-table-column label="检验类型">
<template #default="scope">
<el-tag v-if="scope.row.type2 == 10">
@ -28,43 +27,16 @@
</el-table-column>
<el-table-column label="物料批次" prop="batch">
</el-table-column>
<el-table-column label="数" prop="count">
<el-table-column label="检验数" prop="count">
</el-table-column>
<el-table-column label="检验数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling }}</span>
<span v-else>{{ scope.row.count }}</span>
</template>
</el-table-column>
<el-table-column label="合格数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok }}</span>
<span v-else>{{ scope.row.count_ok }}</span>
</template>
<el-table-column label="合格数" prop="count_ok">
</el-table-column>
<el-table-column label="不合格数" prop="count_notok">
</el-table-column>
<el-table-column label="合格率">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok/scope.row.count_sampling*100 }}%</span>
<span v-else>{{ scope.row.count_ok/scope.row.count*100 }}%</span>
</template>
</el-table-column>
<el-table-column label="检验日期" prop="test_date">
</el-table-column>
<el-table-column label="检验人" prop="test_user_name">
</el-table-column>
<!-- <el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-button
link
type="primary"
v-auth="'ftestwork.update'"
@click="table_del(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>

View File

@ -144,7 +144,7 @@
:value="item.id"
>
<span>{{ item.batch }}</span>
<span v-if="item.material_">({{ item.material_.process_name }})</span>
<span v-if="item.material_&&item.material_.process_name">({{ item.material_.process_name }})</span>
<div style="float: right">
<span>{{ item.count }}</span>
@ -168,8 +168,16 @@
<span>{{ listItem.count_cando }}</span>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="交接数量">
<el-col :span="7" >
<el-form-item label="" style="position: relative;">
<div style="position: absolute;
top: 0;
left: -80px;
width: 80px;
height: 32px;
line-height: 32px;"
@click="showbw($index)"
>交接数量</div>
<el-input-number
v-model="listItem.count"
controls-position="right"
@ -189,6 +197,16 @@
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
</el-col>
</el-row>
<el-card shadow="false" v-if="bwVisible" style="position: relative;">
<template #header>
<div style="width: 10px;height: 35px;"></div>
<el-icon style="position: absolute;right: 10px;top: 10px;font-size: 25px;" @click="bwVisibleClose"><el-icon-circle-close /></el-icon>
</template>
<div v-for="(item2,index2) in form.handoverb[bwIndex].handoverbw" :key="item2" style="display: flex;justify-content: space-between;padding-bottom: 10px;padding-left: 10px;">
<span>{{ item2.number }}</span>
<el-button @click="deletebw(index2)" type="primary">删除</el-button>
</div>
</el-card>
<el-row>
<div class="total-count">总计{{ totalCount }}</div>
</el-row>
@ -292,6 +310,7 @@ export default {
},
totalCount: 0,
deptID:'',
bwIndex:0,
userList: [],
userList2: [],
deptOptions:[],
@ -299,6 +318,7 @@ export default {
materialOptions: [],
addShow: false,
visible: false,
bwVisible:false,
scanVisible:false,
isSaveing: false,
setFiltersVisible: false,
@ -338,6 +358,18 @@ export default {
that.getMgroupOptions();
},
methods: {
deletebw(index){
this.form.handoverb[this.bwIndex].handoverbw.splice(index,1);
this.form.handoverb[this.bwIndex].count--;
},
showbw(index){
this.bwIndex = index;
console.log('this.form.handoverb[index].handoverbw',this.form.handoverb[index].handoverbw);
this.bwVisible = true;
},
bwVisibleClose(){
this.bwVisible = false;
},
//
getDeptOptions() {
this.$API.system.dept.list
@ -557,7 +589,7 @@ export default {
indexs = index;
return item.wm == res.wm;
})
//handoverb
//handoverb
if(arr.length>0){
//wprwpr
if(arr[0].handoverbw&&arr[0].handoverbw.length>0){
@ -570,28 +602,36 @@ export default {
}else{
let obj1 = {};
obj1.wpr = res.id;
obj1.number = res.number;
that.form.handoverb[indexs].count+=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
console.log('1',that.form);
}
}else{
that.form.handoverb[indexs].handoverbw = [];
let obj1 = {};
obj1.wpr = res.id;
obj1.number = res.number;
that.form.handoverb[indexs].count=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
console.log('2',that.form);
}
}else{//handoverb
}else{//handoverb
that.materialOptions.forEach((item) => {
console.log('item.id',item.id);
if(item.id == res.wm){
let obj2 = {};
obj2.wm = item.id;
obj2.batch = item.batch;
obj2.counts = item.count;
obj2.count_cando = item.count;
obj2.handoverbw = [];
obj2.count = 1;
let obj3 = {};
obj3.wpr = res.id;
obj3.number = res.number;
obj2.handoverbw.push(obj3);
that.form.handoverb.push(obj2);
console.log('3',that.form);
}
})
}
@ -600,7 +640,7 @@ export default {
}else{
this.$API.cm.labelmat.item.req(id).then((res) => {
let arr = that.form.handoverb.filter((item) => {
return item.batch == res.batch;
return item.batch == res.batch&&item.state==res.state;
})
if(arr.length>0){
that.$message.error("该批次已存在")
@ -610,9 +650,10 @@ export default {
let obj = {};
obj.wm = item.id;
obj.batch = item.batch;
obj.counts = item.count;
obj.count_cando = item.count;
obj.count = item.count;
that.form.handoverb.push(obj)
that.form.handoverb.push(obj);
console.log('4',that.form);
}
})
}