fix:bug修复

This commit is contained in:
shijing 2025-01-21 10:42:30 +08:00
parent 24b4781f53
commit dfdecc01bd
5 changed files with 72 additions and 20 deletions

View File

@ -31,8 +31,13 @@
</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 v-for="item in qct_defects" :label="item.defect_name" :key="item.id">
<template #default="scope">
{{ scope.row.}}
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="检验日期" prop="test_date">
</el-table-column>
<el-table-column label="检验人" prop="test_user_name">
@ -47,6 +52,7 @@ export default {
emits: ["closed"],
props: {
wm: { type: String, default: "" },
material: { type: String, default: "" },
},
data() {
return {
@ -58,17 +64,32 @@ export default {
10: "抽检",
20: "全检",
},
qct_defects:[],
isSaveing: false,
};
},
mounted() {},
mounted() {
},
methods: {
open() {
this.visible = true;
this.paramsObj.wm = this.wm;
this.apiObj = this.$API.qm.ftestwork.list;
this.getdefects();
return this;
},
//
getdefects(){
let that = this;
that.$API.qm.qct.list.req({ page: 0, qctmat__material: that.material }).then((res) => {
if(res.length>0){
that.$API.qm.qct.item.req(res[0].id).then((res) => {
that.qct_defects = res;
})
}
});
},
table_del(row){
this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$refs.drawer_table.fetch();

View File

@ -180,14 +180,17 @@
</el-col>
<el-col :span="7" >
<el-form-item label="" style="position: relative;">
<div style="position: absolute;
<el-link
:underline="false"
style="position: absolute;
top: 0;
left: -80px;
width: 80px;
height: 32px;
color: #0052d9;
line-height: 32px;"
@click="showbw($index)"
>交接数量</div>
>交接数量</el-link>
<el-input-number
v-model="listItem.count"
controls-position="right"
@ -503,20 +506,36 @@ export default {
this.visible = true;
return this;
},
materialChange() {
materialChange() {
let that = this;
let totalCount = 0;
let data = that.materialOptions.filter((item) => {
return that.selectItems.indexOf(item.id)>-1;
});
data.forEach(item=>{
data.forEach((item,index)=>{
item.wm = item.id;
item.count = item.count_cando;
totalCount += item.count_cando;
item.handoverbw = [];
that.getWprList(item.id,index);
})
that.totalCount = totalCount;
that.form.handoverb = data;
},
getWprList(id,index){
console.log('id',id,'index',index);
let that = this;
let handoverbw = [];
that.$API.wpm.wpr.list.req({wm:id,page:0}).then((res) => {
res.forEach(wpritem=>{
let obj = {};
obj.wpr = wpritem.id;
obj.number = wpritem.number;
handoverbw.push(obj);
})
that.form.handoverb[index].handoverbw = handoverbw;
})
},
countChange(){
let that = this;
let totalCount = 0;
@ -530,7 +549,7 @@ export default {
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
if (that.mode == "add") {
that.$API.wpm.handover.create.req(that.form).then((res) => {
@ -571,7 +590,7 @@ export default {
},
//
setData(data) {
this.totalCount = data.count;
this.totalCount = data.count?data.count:data.handoverb.count;
Object.assign(this.form, data);
if(data.type==30){
this.getUserList3();

View File

@ -154,6 +154,7 @@
ref="showDrawer"
v-if="visibleDrawer"
:wm="wm"
:material="wmMaterial"
@closed="visibleDrawer = false"
>
</showDrawer>
@ -172,7 +173,7 @@
<h4>关联产品</h4>
</template>
<template #default>
<scTable ref="wprTable" :apiObj="wprApiObj" :params="wprParams">
<scTable ref="wprTable" :data="wprList">
<el-table-column label="产品编号" prop="number"></el-table-column>
<el-table-column label="缺陷项">
<template #default="scope">
@ -273,6 +274,7 @@ export default {
wprParams:{
wm: ""
},
wmMaterial:'',
cate_type:'',
process:'',
materialType: "wm",
@ -345,6 +347,7 @@ export default {
//
tableCheckList(row){
this.wm = row.id;
this.wmMaterial = row.material;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
@ -376,9 +379,11 @@ export default {
},
showWpr(row){
let that = this;
that.wprParams.wm='';
that.wprParams.wm = row.id;
that.wprVisibleDrawer = true;
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
that.wprList = res.results;
})
},
//
handleSaveSuccess(data, mode) {

View File

@ -340,7 +340,7 @@
:tracking="tracking"
:materialIn="materialIn"
@success="handleSaveSuccess"
@closed="dialog.save = false"
@closed="saveMlogbInClose"
>
</save-dialog>
<check-dialog
@ -636,12 +636,20 @@ export default {
handleCheckSuccess() {
this.$refs.tableOut.refresh();
},
handlesCheckSuccess(){},
handlesCheckSuccess(){
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();
},
fileUPSuccess(res) {
let that = this;
console.log('res',res);
this.test_file = res.path;
},
saveMlogbInClose(){
this.dialog.save = false;
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();
},
//
handleEditSuccess() {
this.getMlogItem();

View File

@ -127,6 +127,7 @@ export default {
materialOptions: [],
mgroup_code:'',
mlogbInId:'',
mlogbInCount:0,
hasMlogbIn:false,
visible: false,
isSaveing: false,
@ -196,7 +197,6 @@ export default {
},
//
formWminChange(code){
console.log('code',code)
let that = this,codeId='',keys="",arr=[];
if(code.indexOf("#")>-1){
let arrs = code.split("#");
@ -204,6 +204,8 @@ export default {
codeId = arrs[1];
that.scanKyes = keys;
if(keys=='wpr'){//
console.log('wpr',codeId)
that.form.parent = '';
that.$API.wpm.wpr.item.req(codeId).then((res) => {
if(res){
let bwitem = {};
@ -216,18 +218,14 @@ export default {
if (arr.length > 0) {//
let batch = arr[0].batch;
that.wm_in = arr[0].batch;
that.form.count_use =1;
console.log('batch',batch);
that.mlogbInCount = arr[0].count;//
//
let arr0= that.mlogbIns.filter((item)=>{
return item.batch == batch;
})
console.log('arr0',arr0)
if (arr0.length > 0) {
that.hasMlogbIn = true;
bwitem.mlogb = arr0[0].id;
that.form.parent = '';
console.log('bwitem',bwitem)
}else{
that.form.batch = arr[0].batch;
that.form.wm_in = arr[0].id;
@ -306,7 +304,8 @@ export default {
that.form.batch = '';
that.form.parent = '';
that.form.count_use = 0;
if(that.scanKyes=='wpr'){
if(that.scanKyes=='wpr'&&that.mlogbInCount>1){
//1
that.bwItemForm.mlogb = res.id;
that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {})
}