This commit is contained in:
caoqianming 2025-12-24 15:41:00 +08:00
commit 824931b48c
12 changed files with 182 additions and 51 deletions

View File

@ -113,7 +113,7 @@
v-auth="'mio.submit'" v-auth="'mio.submit'"
v-if="scope.row.state == 10" v-if="scope.row.state == 10"
> >
<span v-if="scope.row.type =='do_in'">接收</span> <span v-if="scope.row.type =='do_in'&&project_code=='gx'">接收</span>
<span v-else>提交</span> <span v-else>提交</span>
</el-button> </el-button>
<el-button <el-button
@ -207,9 +207,15 @@ export default {
type: "", type: "",
cate: "good", cate: "good",
mioId: "", mioId: "",
project_code: "",
visibleDrawer: false, visibleDrawer: false,
}; };
}, },
mounted() {
let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code;
},
methods: { methods: {
// //
add(type) { add(type) {

View File

@ -70,7 +70,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="物料单价"> <el-form-item label="物料单价" v-if="form.type != 'do_in'||form.type != 'do_out'">
<el-input-number <el-input-number
v-model="form.unit_price" v-model="form.unit_price"
:min="0" :min="0"
@ -534,8 +534,10 @@ export default {
if(that.form.batch == item.batch){ if(that.form.batch == item.batch){
that.form.count = item.count; that.form.count = item.count;
that.form.wm = item.id; that.form.wm = item.id;
if(!that.assembShow){
that.batchcount = item.count; that.batchcount = item.count;
} }
}
}) })
}, },
selectMaterialChange() { selectMaterialChange() {
@ -558,7 +560,7 @@ export default {
} else { } else {
this.getBatchOptions(); this.getBatchOptions();
} }
if(that.type == 'pur_in'){ if(that.form.type == 'pur_in'||that.form.type == 'other_in'||that.assembShow){
that.batchcount = 99999999999; that.batchcount = 99999999999;
if(that.project_code=='gx'){ if(that.project_code=='gx'){
that.form.batch = '无' that.form.batch = '无'

View File

@ -16,7 +16,16 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable v-if="data_show" :data="tableData" row-key="id" border hidePagination hideDo> <scTable
v-if="data_show"
ref="scTable"
:data="tableData"
row-key="id"
hidePagination
border
hideDo
>
<el-table-column type="index" fixed="left"></el-table-column>
<el-table-column label="物料编号" prop="number" min-width="170px" fixed="left"> <el-table-column label="物料编号" prop="number" min-width="170px" fixed="left">
</el-table-column> </el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id"> <el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id">
@ -39,13 +48,13 @@
</el-main> </el-main>
<el-footer> <el-footer>
<el-pagination <el-pagination
small
background background
:small="true" layout="total, sizes,prev, pager, next"
:total="dataTotal" :total="dataTotal"
layout="total, sizes, prev, pager, next, jumper"
:page-size="params.page_size" :page-size="params.page_size"
:page-sizes="[20, 50, 100, 200]" :page-sizes="[20, 50, 100, 200]"
:current-page="params.page" v-model="params.page"
@current-change="getData" @current-change="getData"
@update:page-size="getData" @update:page-size="getData"
></el-pagination> ></el-pagination>
@ -69,7 +78,9 @@ export default {
mioitem__material__type:30, mioitem__material__type:30,
ftest__isnull:0, ftest__isnull:0,
mioitem__mio__state:20, mioitem__mio__state:20,
} },
dataTotal:0,
apiObj:this.$API.inm.mioitemw.list,
}; };
}, },

View File

@ -47,6 +47,10 @@
> >
<el-table-column label="员工" prop="员工" fixed="left"> <el-table-column label="员工" prop="员工" fixed="left">
</el-table-column> </el-table-column>
<el-table-column label="总加工" prop="总生产数">
</el-table-column>
<el-table-column label="总切片数" prop="总切片数">
</el-table-column>
<el-table-column label="暗点" prop="暗点不合格"> <el-table-column label="暗点" prop="暗点不合格">
</el-table-column> </el-table-column>
<el-table-column label="长点" prop="长点"> <el-table-column label="长点" prop="长点">
@ -58,10 +62,6 @@
</el-table-column> </el-table-column>
<el-table-column label="长点率" prop="长点率"> <el-table-column label="长点率" prop="长点率">
</el-table-column> </el-table-column>
<el-table-column label="总加工" prop="总生产数">
</el-table-column>
<el-table-column label="总切片数" prop="总切片数">
</el-table-column>
<el-table-column label="加功率" prop="加功率"> <el-table-column label="加功率" prop="加功率">
</el-table-column> </el-table-column>
<el-table-column label="暗点系数" prop="暗点系数"> <el-table-column label="暗点系数" prop="暗点系数">

View File

@ -729,7 +729,7 @@ export default {
countUseChange(){ countUseChange(){
if(this.form.count_real>this.form.count_use){ if(this.form.count_real>this.form.count_use){
this.form.count_real = this.form.count_use; this.form.count_real = this.form.count_use;
this.count_ok = this.form.count_real - this.form.count_notok; this.form.count_ok = this.form.count_use - this.form.count_notok;
} }
}, },
countNotOkSun() { countNotOkSun() {

View File

@ -160,7 +160,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="mtype!==30&&form.handoverb.length>0"> <el-col :md="12" :sm="24">
<el-form-item label="接收工段" prop="recive_mgroup"> <el-form-item label="接收工段" prop="recive_mgroup">
<el-select <el-select
v-model="form.recive_mgroup" v-model="form.recive_mgroup"
@ -180,7 +180,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="mtype!==30"> <el-col :md="12" :sm="24">
<el-form-item label="接收人"> <el-form-item label="接收人">
<el-select <el-select
v-model="form.recive_user" v-model="form.recive_user"
@ -392,6 +392,7 @@ export default {
that.mtype=30; that.mtype=30;
that.change_batch = true; that.change_batch = true;
} }
that.form.recive_mgroup = "";
let arr = that.$route.path.split("/"); let arr = that.$route.path.split("/");
that.route_code = arr[2]; that.route_code = arr[2];
let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT"); let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT");
@ -407,9 +408,12 @@ export default {
that.form.material_changed = that.wmItem.material; that.form.material_changed = that.wmItem.material;
that.form.material_changed_fname = that.wmItem.material_name; that.form.material_changed_fname = that.wmItem.material_name;
} }
if(that.type==20||that.type==50){ that.$nextTick(()=>{
console.log('that.type',that.type,'that.mtype',that.mtype)
if(that.type==20||that.type==50||(that.type==10&&that.mtype==30)||(that.mtype==30&&that.new_wm!=='')){
that.form.recive_mgroup = that.mgroupId; that.form.recive_mgroup = that.mgroupId;
} }
})
// type=10 // type=10
// type=20 // type=20
// type=30 // type=30
@ -755,9 +759,6 @@ 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==30){
that.form.recive_mgroup = that.form.send_mgroup;
}
that.form.mtype=that.mtype; that.form.mtype=that.mtype;
if(that.route_code=='shangpaipingmo'){ if(that.route_code=='shangpaipingmo'){
that.form.handoverb.forEach(item=>{ that.form.handoverb.forEach(item=>{
@ -771,7 +772,7 @@ export default {
}) })
} }
// //
if(that.mtype==20||that.mtype==30||that.type==40){ if(that.mtype==20||(that.mtype==30&&that.type==50&&that.new_wm!=='')||(that.mtype==30&&that.type==10)||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;
that.$emit("success"); that.$emit("success");

View File

@ -30,7 +30,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<span style="margin: 0 0 0 20px;">选择物料:</span> <span style="margin: 0 0 0 20px;" v-if="route_code=='pengma'">选择物料:</span>
<el-input ref="codeInput" <el-input ref="codeInput"
placeholder="扫描交接物料" placeholder="扫描交接物料"
v-model="listItem.wm_in" clearable v-model="listItem.wm_in" clearable
@ -38,6 +38,7 @@
@change="formWminChange($index,listItem.wm_in)" @change="formWminChange($index,listItem.wm_in)"
></el-input> ></el-input>
<el-select <el-select
v-if="route_code=='pengma'"
v-model="listItem.wpr" v-model="listItem.wpr"
placeholder="选择交接物料" placeholder="选择交接物料"
@change="wm_inChange($index)" @change="wm_inChange($index)"
@ -54,14 +55,24 @@
<span style="margin: 0 20px;">数量{{ listItem.count }}</span> <span style="margin: 0 20px;">数量{{ listItem.count }}</span>
<el-button v-if="mode!=='show'" type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button> <el-button v-if="mode!=='show'" type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
</el-col> </el-col>
<el-col :span="24" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;"> <el-col v-if="route_code=='pengma'" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;">
<div v-for="(item2,index2) in form.handoverb[$index].handoverbw" :key="item2.wpr" class="wprItem"> <div v-for="(item2,index2) in form.handoverb[$index].handoverbw" :key="item2.wpr" style="display: inline-block;">
<div v-if="item2.wpr!==undefined&&item2.wpr!==null&&item2.wpr!==''" class="wprItem">
<span>{{ item2.number }}</span> <span>{{ item2.number }}</span>
<el-icon class="circleCloseFilled" @click="deleteWpr($index,index2,item2.wpr)"><el-icon-circleClose-filled /></el-icon> <el-icon class="circleCloseFilled" @click="deleteWpr($index,index2,item2.wpr)"><el-icon-circleClose-filled /></el-icon>
</div> </div>
<div v-for="item3 in diff" :key="item3" class="wprItem disabledItem"> <div v-else class="wprItem disabledItem">
<span>{{ item3 }}</span> <span>{{ item2.number }}</span>
</div> </div>
</div>
<!-- <div v-for="item3 in diff" :key="item3" class="wprItem disabledItem">
<span>{{ item3 }}</span>
</div> -->
</el-col>
<el-col v-else :span="24" style="padding-left: 80px;margin-bottom: 20px;margin-top: -5px;">
<span v-for="(item2) in wprOptions" :key="item2.wpr" style="margin-right: 10px;">
<el-checkbox v-model="item2.checked" :label="item2.number" @change="handleChange($index)"/>
</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -141,6 +152,7 @@ export default {
trigger: "blur", trigger: "blur",
}, },
}, },
route_code:"",
batchOrign:{}, batchOrign:{},
wprOptions: [], wprOptions: [],
materialOptions: [], materialOptions: [],
@ -152,6 +164,9 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
let paths = that.$route.path;
let arr = paths.split("/");
that.route_code = arr[2];
that.form.type = that.type; that.form.type = that.type;
that.form.handle_date = that.form.send_date = that.$TOOL.dateFormat2(new Date()); that.form.handle_date = that.form.send_date = that.$TOOL.dateFormat2(new Date());
that.form.send_mgroup = that.form.recive_mgroup = that.mgroupId; that.form.send_mgroup = that.form.recive_mgroup = that.mgroupId;
@ -162,6 +177,9 @@ export default {
getWpr(id){ getWpr(id){
let that = this; let that = this;
that.$API.wpm.wpr.list.req({page:0,wm:id}).then((res) => { that.$API.wpm.wpr.list.req({page:0,wm:id}).then((res) => {
res.forEach(item=>{
item.checked = false;
})
that.wprOptions = res; that.wprOptions = res;
}); });
}, },
@ -218,34 +236,37 @@ export default {
if(arrs.length>1){ if(arrs.length>1){
that.form.handoverb[index].wpr = ''; that.form.handoverb[index].wpr = '';
arrs.forEach(arr=>{ arrs.forEach(arr=>{
let obj = {};
obj.number = arr;
let options = that.wprOptions.filter(item=>{return item.number.indexOf(arr) > -1&&!item.disabled});
if(options.length>0){
obj.wpr = options[0].id;
barchArrs.push(arr);
}
that.form.handoverb[index].handoverbw.push(obj);
that.wprOptions.forEach(item=>{ that.wprOptions.forEach(item=>{
if(item.number.indexOf(arr) > -1&&!item.disabled){ if(item.number.indexOf(arr) > -1&&!item.disabled){
item.disabled = true; item.disabled = true;
let obj = {};
obj.number = item.number;
obj.wpr = item.id;
barchArrs.push(arr);
that.form.handoverb[index].handoverbw.push(obj);
that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length;
} }
}) })
}) })
that.form.handoverb[index].count = barchArrs.length;
//arrswpr, //arrswpr,
let diff = arrs.filter(item => !barchArrs.includes(item)); let diff = arrs.filter(item => !barchArrs.includes(item));
that.diff = diff; that.diff = diff;
console.log('diff',diff)
if(diff.length>0){ if(diff.length>0){
that.$message.warning("物料"+diff.join(",")+"不在该批次中"); that.$message.warning("物料"+diff.join(",")+"不在该批次中");
// that.$confirm(""+diff.join(",")+"", "", {type: "warning",}).then(() => {});
} }
}else{ }else{
//handoverbdisabled //handoverbdisabled
that.wprOptions.forEach(item=>{ that.wprOptions.forEach(item=>{
if(item.number.indexOf(arr) > -1){ if(item.number.indexOf(number) > -1){
if(item.disabled){ if(item.disabled){
that.$message.error("该物料已被分配"); that.$message.error("该物料已被分配");
that.form.handoverb[index].wpr = ''; that.form.handoverb[index].wpr = '';
}else{ }else{
item.checked = true;
item.disabled = true; item.disabled = true;
let obj = {}; let obj = {};
obj.number = item.number; obj.number = item.number;
@ -295,6 +316,21 @@ export default {
} }
that.form.handoverb.splice(index,1); that.form.handoverb.splice(index,1);
}, },
handleChange(index){
let that = this;
that.form.handoverb[index].handoverbw = [];
let trueCount = this.wprOptions.filter(item => item.checked === true).length;
that.form.handoverb[index].count =trueCount;
this.wprOptions.forEach(item=>{
if(item.checked){
let obj = {};
obj.number = item.number;
obj.wpr = item.id;
item.disabled = true;
that.form.handoverb[index].handoverbw.push(obj);
}
})
},
// //
submit() { submit() {
let that = this; let that = this;
@ -303,6 +339,7 @@ export default {
let total = 0; let total = 0;
if(this.form.handoverb.length>0){ if(this.form.handoverb.length>0){
this.form.handoverb.forEach(item=>{ this.form.handoverb.forEach(item=>{
item.handoverbw = item.handoverbw.filter(item=>{ return item.wpr&&item.wpr!==''&&item.wpr!==null&&item.wpr!==undefined})
total += item.count; total += item.count;
}) })
} }

View File

@ -93,7 +93,7 @@
min-width="150" min-width="150"
> >
<template #default="scope"> <template #default="scope">
<span v-if="route_code=='pengma'" @click="rowClick(scope.row)" style="color:#0052d9;font-weight: 600;cursor: pointer;">{{scope.row.batch}}</span> <span v-if="route_code=='pengma'||route_code=='kaiaomian'||route_code=='paoaomian'" @click="rowClick(scope.row)" style="color:#0052d9;font-weight: 600;cursor: pointer;">{{scope.row.batch}}</span>
<span v-else>{{scope.row.batch}}</span> <span v-else>{{scope.row.batch}}</span>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -101,20 +101,15 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="物料" prop="material_name" min-width="120"></el-table-column>
label="物料"
prop="material_name"
min-width="120"
></el-table-column>
<el-table-column label="数量" prop="count" width="80"></el-table-column> <el-table-column label="数量" prop="count" width="80"></el-table-column>
<el-table-column label="批次" prop="batch" width="60"> <el-table-column label="批次" prop="batch" min-width="60">
<template #default="scope"> <template #default="scope">
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text> <el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="新批次号" prop="new_batch" min-width="80"> <el-table-column label="新批次号" prop="new_batch" min-width="80">
</el-table-column> </el-table-column>
<el-table-column label="交接类型" prop="type" width="100"> <el-table-column label="交接类型" prop="type" width="100">
<template #default="scope"> <template #default="scope">
<el-text v-if="scope.row.mtype==20" type="warning">拆批</el-text> <el-text v-if="scope.row.mtype==20" type="warning">拆批</el-text>

View File

@ -186,8 +186,16 @@
</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="新批次号" prop="new_batch"> <el-form-item label="新批次号" required>
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input> <el-select filterable remote :remote-method="remoFun" v-model="new_batch" @selsect="new_batch_change">
<el-option
v-for="item in batchList"
:key="item.id"
:label="item.batch"
:value="item.id"
></el-option>
</el-select>
<!-- <el-input v-model="form.new_batch" placeholder="新批次号"></el-input> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="route_code=='tuihuo' || form.oinfo_json.test_file"> <el-col :md="12" :sm="24" v-if="route_code=='tuihuo' || form.oinfo_json.test_file">
@ -340,12 +348,14 @@ export default {
}, },
], ],
}, },
new_batch:'',
listParams:{}, listParams:{},
totalCount: 0, totalCount: 0,
mtype:10, mtype:10,
deptID:'', deptID:'',
route_code:'', route_code:'',
codeText: "", codeText: "",
batchList:[],
fileList:[], fileList:[],
userList: [], userList: [],
userList2: [], userList2: [],
@ -406,6 +416,14 @@ export default {
} }
that.getTid(); that.getTid();
}, },
watch: {
batchList:{
deep:true,
handler (v) {
console.log('batchList',v)
}
}
},
methods: { methods: {
getTid (){ getTid (){
var that = this; var that = this;
@ -514,6 +532,44 @@ export default {
that.userList2 = res; that.userList2 = res;
}); });
}, },
remoFun(val){
let that = this;
let params = {};
that.batchList = [];
params.material = that.form.handoverb[0].material;
params.batch = val;
params.mgroup = that.mgroupId;
params.count_all = 1;
params.defect = that.form.handoverb[0].defect!=null?that.form.handoverb[0].defect:'';
params.defect__isnull = that.form.handoverb[0].defect!=null?false:true;
params.page = 0;
that.$API.wpm.wmaterial.list.req(params).then(res=>{
if(res.length>0){
that.batchList = res;
}else{
let obj = {};
obj.batch = val;
obj.id = val;
that.batchList.push(obj);
}
})
},
new_batch_change(){
let that = this;
let arr = that.batchList.filter(item=>{
return item.batch == that.new_batch;
})
if(arr.length>0){
that.form.new_batch = arr[0].batch;
}else{
that.batchList.forEach(item=>{
if(item.id == that.new_batch){
that.form.new_batch = item.batch;
that.form.new_wm = item.id;
}
})
}
},
addMaterial(){ addMaterial(){
this.addShow = true; this.addShow = true;
}, },
@ -538,6 +594,8 @@ export default {
obj.wm = item.wm; obj.wm = item.wm;
obj.label = item.label; obj.label = item.label;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect;
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;
this.form.handoverb.push(obj); this.form.handoverb.push(obj);
@ -617,6 +675,23 @@ export default {
that.form.mtype=30; that.form.mtype=30;
that.mtype==30 that.mtype==30
} }
if(that.mtype==30&&that.form.new_batch==null&&that.form.new_batch==undefined&&that.new_batch!=''){
let arr = that.batchList.filter(item=>{
return item.batch == that.new_batch;
})
if(arr.length>0){
that.form.new_batch = arr[0].batch;
}else{
that.batchList.forEach(item=>{
if(item.id == that.new_batch){
that.form.new_batch = item.batch;
that.form.new_wm = item.id;
}
})
}
}
console.log('that.form.new_wm',that.form.new_wm);
console.log('that.form.new_batch',that.form.new_batch);
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;

View File

@ -324,6 +324,8 @@ export default {
let obj = {}; let obj = {};
obj.wm = item.id; obj.wm = item.id;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect;
obj.material = item.material;
obj.count_canhandover = item.count_canhandover; obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover; obj.count = item.count_canhandover;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')'; obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';

View File

@ -409,6 +409,8 @@ export default {
let obj = {}; let obj = {};
obj.wm = item.id; obj.wm = item.id;
obj.batch = item.batch; obj.batch = item.batch;
obj.defect = item.defect;
obj.material = item.material;
obj.count_canhandover = item.count_canhandover; obj.count_canhandover = item.count_canhandover;
obj.count = item.count_canhandover; obj.count = item.count_canhandover;
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')'; obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';