This commit is contained in:
caoqianming 2025-02-11 11:31:47 +08:00
commit b52c990fb5
7 changed files with 207 additions and 298 deletions

View File

@ -15,14 +15,9 @@
设备状态 设备状态
</div> </div>
<div class="boxlabel"> <div class="boxlabel">
<span class="stateIcon bwIcon"></span> <span class="stateIcon yxicon"></span>
<span>保温中</span> <span>运行中</span>
<span class="eqNum">{{hh.bw}}</span> <span class="eqNum">{{hh.yx}}</span>
</div>
<div class="boxlabel">
<span class="stateIcon lqIcon"></span>
<span>冷却中</span>
<span class="eqNum">{{hh.lq}}</span>
</div> </div>
<div class="boxlabel"> <div class="boxlabel">
<span class="stateIcon wyxIcon"></span> <span class="stateIcon wyxIcon"></span>
@ -112,16 +107,16 @@
<div class="totalStatic"> <div class="totalStatic">
<span class="totalStaticItem">日投产量</span> <span class="totalStaticItem">日投产量</span>
<span class="totalStaticItem">日加工数</span> <span class="totalStaticItem">日加工数</span>
<span class="totalStaticItem">日加工前不良</span> <span class="totalStaticItem">日加工前不良</span>
<span class="totalStaticItem">日合格数</span> <span class="totalStaticItem">日合格数</span>
<span class="totalStaticItem">日不合格数</span> <span class="totalStaticItem">日不合格数</span>
</div> </div>
<div class="totalStatic"> <div class="totalStatic">
<span class="totalStaticItem totalStaticItemNum">{{ kctj.dhh }}</span> <span class="totalStaticItem totalStaticItemNum">{{ sctj.rtcs }}</span>
<span class="totalStaticItem totalStaticItemNum">{{ kctj.hhz }}</span> <span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgs }}</span>
<span class="totalStaticItem totalStaticItemNum">{{ kctj.thz }}</span> <span class="totalStaticItem totalStaticItemNum">{{ sctj.rjgqbls }}</span>
<span class="totalStaticItem totalStaticItemNum">{{ kctj.thok }}</span> <span class="totalStaticItem totalStaticItemNum">{{ sctj.rhgs }}</span>
<span class="totalStaticItem totalStaticItemNum">{{ kctj.thok }}</span> <span class="totalStaticItem totalStaticItemNum">{{ sctj.rbhgs }}</span>
</div> </div>
<dv-scroll-board :config="configDatas" class="boxmain boxmainbottom" style="width:98%;margin:auto" /> <dv-scroll-board :config="configDatas" class="boxmain boxmainbottom" style="width:98%;margin:auto" />
</div> </div>
@ -141,7 +136,7 @@ export default {
components: { scScrollTavle }, components: { scScrollTavle },
data() { data() {
return { return {
basicOption: { barOption: {
backgroundColor: "", backgroundColor: "",
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
@ -155,63 +150,6 @@ export default {
legend: { legend: {
icon: "stack", icon: "stack",
right: 0, right: 0,
data: [
{
backgroundColor: "rgb(1,235,239)",
name: "减薄",
itemStyle: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(250,205,0)",
},
{
offset: 1,
color: "rgb(254,129,0)",
},
]
),
},
textStyle: {
color: "#fff",
},
},
{
backgroundColor: "rgb(250,205,0)",
name: "退火",
itemStyle: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(1,235,239)",
},
{
offset: 1,
color: "rgb(5, 158, 163)",
},
]
),
},
textStyle: {
color: "#fff",
},
},
],
},
toolbox: {
feature: {
// saveAsImage: {}
},
}, },
grid: { grid: {
left: "3%", left: "3%",
@ -250,9 +188,8 @@ export default {
}, },
series: [ series: [
{ {
name: "今日统计", name: "加工数",
type: "bar", type: "bar",
// stack: "Ad",
barWidth: 10, barWidth: 10,
emphasis: { emphasis: {
focus: "series", focus: "series",
@ -262,32 +199,11 @@ export default {
position: "top", position: "top",
color: "#fff", color: "#fff",
}, },
itemStyle: {
borderRadius: [5, 5, 0, 0],
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(250,205,0)",
},
{
offset: 1,
color: "rgb(254,129,0)",
},
]
),
},
data: [], data: [],
}, },
{ {
name: "", name: "合格数",
type: "bar", type: "bar",
// stack: "Ad",
barWidth: 10, barWidth: 10,
emphasis: { emphasis: {
focus: "series", focus: "series",
@ -297,61 +213,72 @@ export default {
position: "top", position: "top",
color: "#fff", color: "#fff",
}, },
itemStyle: { data: [],
borderRadius: [5, 5, 0, 0],
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgb(1,235,239)",
}, },
{ {
offset: 1, name: "合格率",
color: "rgb(5, 158, 163)", type: "bar",
barWidth: 10,
emphasis: {
focus: "series",
}, },
] label: {
), show: true,
position: "top",
color: "#fff",
}, },
data: [], data: [],
}, },
], ],
}, },
pieOption: {
backgroundColor: "",
tooltip: {
trigger: 'item'
},
legend: {
icon: "stack",
right: 0,
},
series: [
{
name: '不合格占比',
type: 'pie',
radius: ['1%', '60%'],
center: ['50%', '55%'],
label: false,
data: [
{value: 0, name: '划伤'},
{value: 0, name: '气泡'},
{value: 0, name: '水纹'},
{value: 0, name: '崩边'},
{value: 0, name: '雾面'},
{value: 0, name: '麻点'},
{value: 0, name: '线痕'},
{value: 0, name: '破损'},
{value: 0, name: '其他'},
]
}
]
},
tableHeight: 100, tableHeight: 100,
speed: 2000, speed: 2000,
time: null, time: null,
hh:{ hh:{
bw:0, yx:0,
lq:0,
wyx:0, wyx:0,
gz:0, gz:0,
}, },
th:{
bw:0,
lq:0,
wyx:0,
gz:0,
},
sctj_ysetday:{
hh:0,
th:0
},
tcfx:{
yesterday:0,
today:0,
tomorrow:0,
}, sctj:{
kctj:{ rtcs:0,
dhh:0, rjgs:0,
hhz:0, rjgqbls:0,
thz:0, rhgs:0,
thok:0, rbhgs:0,
}, },
dayInterval: null, dayInterval: null,
chartInterval1: null,
chartInterval2: null, chartInterval2: null,
// //
configDataInm:{ configDataInm:{
@ -386,7 +313,7 @@ export default {
// //
configDatas :{ configDatas :{
headerBGC:'#0a3f44', headerBGC:'#0a3f44',
header:['投产量','加工数','加工前不良数','合格数','不合格数'], header:['日期','加工数','合格数','不合格数'],
headerHeight:40, headerHeight:40,
data:[] data:[]
}, },
@ -395,9 +322,12 @@ export default {
today: "", today: "",
end_time:'', end_time:'',
start_time:'', start_time:'',
mgroups:[],
daysList:[],
}; };
}, },
mounted() { mounted() {
let that = this;
//table //table
this.tableHeight = document.getElementById("scrollContainer").clientHeight; this.tableHeight = document.getElementById("scrollContainer").clientHeight;
this.showTime(); this.showTime();
@ -412,26 +342,37 @@ export default {
let dates = item.split('-'); let dates = item.split('-');
let obj = dates[1]+'-'+dates[2]; let obj = dates[1]+'-'+dates[2];
xAxisData.push(obj); xAxisData.push(obj);
let dayitem = Number(dates[2]);
that.daysList.push(dayitem);
}) })
console.log('that.daysList',that.daysList);
that.today = new Date().toISOString().split('T')[0]
// console.log('new Date', new Date().toISOString().split('T'))
this.xAxisData = xAxisData; this.xAxisData = xAxisData;
let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24); let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24); let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss"); let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd");
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss"); let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd");
this.start_time = start_time; this.start_time = start_time;
this.end_time = end_time; this.end_time = end_time;
this.$nextTick(() => { this.$nextTick(() => {
this.$API.mtm.mgroup.list.req({page:0,belong_dept__name:'减薄车间'}).then((res) => {
that.mgroups = res;
that.configDataEq.data = [];
that.configDataHandover.data = [];
res.forEach((item)=>{
// //
this.getEqState(); that.getEqState(item.id);
//
this.getMaterials(item.id);
//
this.getHandover(item.id);
})
})
// //
this.getMtask(); this.getMtask();
//
this.getMaterials();
//
this.getHandover();
/// ///
this.getProductLine1(); this.getProductLine();
this.getProductLine2();
}) })
}, },
methods: { methods: {
@ -461,7 +402,7 @@ export default {
}); });
} }
if (option == null) { if (option == null) {
option = Object.assign({}, this.basicOption); option = Object.assign({}, this.barOption);
} }
setTimeout(() => { setTimeout(() => {
try { try {
@ -471,32 +412,50 @@ export default {
return myChart; return myChart;
}, },
// //
getProductLine1() { getProductLine() {
let that = this; let that = this;
let obj = { let obj = {
query: {start_time: that.start_time,end_time: that.end_time}, query: {start_date: that.start_time,end_date: that.end_time,dept_name:'减薄车间'},
}; };
that.$API.bi.dataset.exec.req("thslrk", obj).then((res) => { that.$API.bi.dataset.exec.req("lineDay", obj).then((res) => {
let list = res.data2.ds0; let list = res.data2.ds0;
let seriesData1 = []; let seriesData0 = [],seriesData1 = [],seriesData2 = [];
for (let i = 0; i < that.xAxisData.length; i++) { for (let i = 0; i < that.xAxisData.length; i++) {
seriesData1[i] = 0; seriesData0[i] = 0;seriesData1[i] = 0;seriesData2[i] = 0;
} }
if (list.length > 0) { if (list.length > 0) {
list.forEach((item) => { list.forEach((item) => {
let date = item.日期.split("-")[1]+'-'+item.日期.split("-")[2]; let arr = [];
let index = that.xAxisData.indexOf(date); arr[0] = item.+'-'+item.+'-'+item.;
seriesData1[index] = item.送料数+item.入库数; arr[1] = item.生产数;
arr[2] = item.合格数;
arr[3] = item.不合格数;
that.configDatas.data.push(arr);
let indexs = that.daysList.indexOf(item.);
seriesData0[indexs] = item.生产数;
seriesData1[indexs] = item.合格数;
seriesData2[indexs] = item.合格率;
that.pieOption.series.data[0].value += item.划伤;
that.pieOption.series.data[1].value += item.气泡;
that.pieOption.series.data[2].value += item.水纹;
that.pieOption.series.data[3].value += item.崩边;
that.pieOption.series.data[4].value += item.雾面;
that.pieOption.series.data[5].value += item.麻点;
that.pieOption.series.data[6].value += item.线痕;
that.pieOption.series.data[7].value += item.破损;
that.pieOption.series.data[8].value += item.其他;
}); });
} }
that.tcfx.yesterday = seriesData1[5]; that.barOption.xAxis.data = that.xAxisData;
let chart1Option = deepCopy(this.basicOption); that.barOption.series[0].data = seriesData0;
chart1Option.xAxis.data = that.xAxisData; that.barOption.series[1].data = seriesData1;
chart1Option.series[0].data = seriesData1; that.barOption.series[2].data = seriesData2;
let chart1 = this.setChart("chart1", chart1Option); let chart1 = this.setChart("chart1", that.barOption);
let index1 = 0; let chart2 = this.setChart("chart2", that.pieOption);
this.chartInterval2 = setInterval(function () { let index1 = 0,index2 = 0;
if (index1 < chart1Option.series[0].data.length) { this.chartInterval1 = setInterval(function () {
if (index1 < that.barOption.series[0].data.length) {
chart1.dispatchAction({ chart1.dispatchAction({
type: "downplay", type: "downplay",
seriesIndex: 0, seriesIndex: 0,
@ -516,41 +475,8 @@ export default {
index1 = 0; index1 = 0;
} }
}, 3000); }, 3000);
});
},
//
getProductLine2() {
let that = this;
let obj = {
query: {start_time: that.start_time,end_time: that.end_time},
};
that.$API.bi.dataset.exec.req("jltj", obj).then((res) => {
let list = res.data2.ds0;
let seriesData1 = [],seriesData2 = [];
for (let i = 0; i < that.xAxisData.length; i++) {
seriesData1[i] = 0;
seriesData2[i] = 0;
}
if (list.length > 0) {
list.forEach((item) => {
let date = item.日期.split("-")[1]+'-'+item.日期.split("-")[2];
let index = that.xAxisData.indexOf(date);
seriesData1[index] = item.黑化数;
seriesData2[index] = item.退火数;
});
}
that.sctj_ysetday.hh = seriesData1[5];
that.sctj_ysetday.th = seriesData2[5];
let chart2Option = deepCopy(this.basicOption);
chart2Option.xAxis.data = that.xAxisData;
chart2Option.series[0].name = '黑化数';
chart2Option.series[1].name = '退火数';
chart2Option.series[0].data = seriesData1;
chart2Option.series[1].data = seriesData2;
let chart2 = this.setChart("chart2", chart2Option);
let index2 = 0;
this.chartInterval2 = setInterval(function () { this.chartInterval2 = setInterval(function () {
if (index2 < chart2Option.series[0].data.length) { if (index2 < that.barOption.series[0].data.length) {
chart2.dispatchAction({ chart2.dispatchAction({
type: "downplay", type: "downplay",
seriesIndex: 0, seriesIndex: 0,
@ -573,24 +499,22 @@ export default {
}); });
}, },
// //
getEqState() { getEqState(id) {
let that = this; let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup_name: '减薄'}).then((res) => { that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
that.hh.bw = res.保温; that.hh.bw = res.保温;
that.hh.lq = res.冷却; that.hh.lq = res.冷却;
that.hh.yx = res.运行;
that.hh.wyx = res.未运行; that.hh.wyx = res.未运行;
that.hh.gz = res.故障; that.hh.gz = res.故障;
that.configDataEq.data = [];
let nowTime = new Date(res.now).getTime(); let nowTime = new Date(res.now).getTime();
if(res.rows.length>0){ if(res.rows.length>0){
res.rows.forEach((item) => { res.rows.forEach((item) => {
let arr = []; let arr = [];
arr[0] = item.name; arr[0] = item.name;
arr[1] = item.number; arr[1] = item.number;
if(item.mstate=='保温'){ if(item.mstate=='冷却'){
arr[2] = '<span style="color:rgb(245, 196, 0)">保温</span>'; arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
}else if(item.mstate=='冷却'){
arr[2] = '<span style="color:rgb(0,163,245)">冷却</span>';
}else if(item.mstate=='未运行'){ }else if(item.mstate=='未运行'){
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>'; arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
}else if(item.mstate=='故障'){ }else if(item.mstate=='故障'){
@ -626,7 +550,7 @@ export default {
getMtask() { getMtask() {
let that = this; let that = this;
let obj = {}; let obj = {};
obj.mgroup__name = '黑化'; obj.mgroup__name = '减薄A,减薄B';
obj.page = 0; obj.page = 0;
that.$API.pm.mtask.list.req(obj).then((res) => { that.$API.pm.mtask.list.req(obj).then((res) => {
that.configDataTask.data = []; that.configDataTask.data = [];
@ -652,13 +576,13 @@ export default {
}); });
}, },
// //
getHandover() { getHandover(id) {
let that = this; let that = this;
let obj = {}; let obj = {};
obj.mgroup__name = '减薄'; obj.mgroup = id;
obj.page = 0; obj.page = 0;
obj.send_date =
that.$API.wpm.handover.list.req(obj).then((res) => { that.$API.wpm.handover.list.req(obj).then((res) => {
that.configDataHandover.data = [];
res.forEach((item) => { res.forEach((item) => {
let arr = []; let arr = [];
arr[0] = item.material_name; arr[0] = item.material_name;
@ -683,7 +607,7 @@ export default {
// //
getMaterials() { getMaterials() {
let that = this; let that = this;
that.$API.wpm.wmaterial.list.req({ page: 0,mgroup__name__in:'减薄' }).then((res) => { that.$API.wpm.wmaterial.list.req({ page: 0,mgroup__name__in:'减薄A,减薄B' }).then((res) => {
that.configDataInm.data = []; that.configDataInm.data = [];
if(res.length>0){ if(res.length>0){
res.forEach((item) => { res.forEach((item) => {
@ -775,7 +699,7 @@ export default {
.bwIcon{ .bwIcon{
background-color: rgb(245, 196, 0); background-color: rgb(245, 196, 0);
} }
.lqIcon{ .lqIcon,.yxicon{
background-color: rgb(0,163,245); background-color: rgb(0,163,245);
} }
.wyxIcon{ .wyxIcon{
@ -791,7 +715,7 @@ export default {
height: calc(100% - 50px); height: calc(100% - 50px);
} }
.boxmain.boxmainbottom{ .boxmain.boxmainbottom{
height: calc(100% - 120px); height: calc(100% - 38px);
} }
.lineDiv { .lineDiv {
height: 40px; height: 40px;

View File

@ -555,11 +555,10 @@ export default {
// //
getUserList2() { getUserList2() {
let that = this; let that = this;
let deptID = '';
this.mgroupOptions.forEach(item => { this.mgroupOptions.forEach(item => {
if(item.id==that.form.recive_mgroup){ if(item.id==that.form.recive_mgroup){
deptID = item.belong_dept; let deptID = item.belong_dept;
this.$API.system.user.list.req({ depts: deptID, page: 0 }).then((res) => { this.$API.system.user.list.req({ belong_dept: deptID, page: 0 }).then((res) => {
that.userList2 = res; that.userList2 = res;
}); });
} }
@ -707,17 +706,14 @@ export default {
} }
let that = this; let that = this;
if(data.indexOf('#')>-1){ if(data.indexOf('#')>-1){
// let keys = data.split('#')[0];
let id = data.split('#')[1]; let id = data.split('#')[1];
this.$API.cm.labelmat.item.req(id).then((res) => { this.$API.cm.labelmat.item.req(id).then((res) => {
let arr = that.form.handoverb.filter((item) => { let arr = that.form.handoverb.filter((item) => {
return item.batch == res.batch&&item.state==res.state; return item.batch == res.batch&&item.state==res.state;
}) })
// console.log('arr',arr)
if(arr.length>0){ if(arr.length>0){
that.$message.error("该批次已存在") that.$message.error("该批次已存在")
}else{ }else{
// console.log('materialOptions',that.materialOptions)
that.materialOptions.forEach((item) => { that.materialOptions.forEach((item) => {
if(item.batch == res.batch){ if(item.batch == res.batch){
let params = {material: item.material,type: that.type}; let params = {material: item.material,type: that.type};
@ -730,9 +726,9 @@ export default {
obj.count_cando = item.count; obj.count_cando = item.count;
obj.count = item.count; obj.count = item.count;
obj.handoverbw = []; obj.handoverbw = [];
that.$API.wpm.wpr.list.req({wm:item.id}).then((res) => { that.$API.wpm.wpr.list.req({wm:item.id,page:0}).then((res) => {
let handoverbw = []; let handoverbw = [];
let list = res.results; let list = res;
list.forEach(item1=>{ list.forEach(item1=>{
let obj1 = {}; let obj1 = {};
obj1.wpr = item1.id; obj1.wpr = item1.id;

View File

@ -173,7 +173,7 @@
<h4>关联产品</h4> <h4>关联产品</h4>
</template> </template>
<template #default> <template #default>
<scTable ref="wprTable" :data="wprList"> <scTable ref="wprTable" hidePagination :data="wprList">
<el-table-column label="产品编号" prop="number"></el-table-column> <el-table-column label="产品编号" prop="number"></el-table-column>
<el-table-column label="记录数据" prop="oinfo"> <el-table-column label="记录数据" prop="oinfo">
<template #default="scope"> <template #default="scope">
@ -279,6 +279,7 @@ export default {
material: "", material: "",
}, },
wprParams:{ wprParams:{
page:0,
wm: "" wm: ""
}, },
wmMaterial:'', wmMaterial:'',
@ -389,7 +390,7 @@ export default {
that.wprParams.wm = row.id; that.wprParams.wm = row.id;
that.wprVisibleDrawer = true; that.wprVisibleDrawer = true;
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
that.wprList = res.results; that.wprList = res;
}) })
}, },
// //

View File

@ -356,6 +356,7 @@
ref="checkDialogSingle" ref="checkDialogSingle"
:mlogb="mlogb" :mlogb="mlogb"
:wm = "wm" :wm = "wm"
:batchNumber="batchNumber"
:handle_user="handle_user" :handle_user="handle_user"
:handle_date="handle_date" :handle_date="handle_date"
@success="handlesCheckSuccess" @success="handlesCheckSuccess"
@ -480,6 +481,7 @@ export default {
}, },
qct:null, qct:null,
defectlist:[], defectlist:[],
batchNumber:'',
}; };
}, },
mounted() { mounted() {
@ -595,6 +597,7 @@ export default {
let that = this; let that = this;
that.mlogb = row.id; that.mlogb = row.id;
that.wm = row.wm_in; that.wm = row.wm_in;
that.batchNumber = row.batch;
that.handle_date=that.mlogItem.handle_date; that.handle_date=that.mlogItem.handle_date;
that.handle_user = that.mlogItem.handle_user; that.handle_user = that.mlogItem.handle_user;
that.dialog.check_single = true; that.dialog.check_single = true;

View File

@ -57,7 +57,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24" v-if="mode=='add'">
<el-form-item label="关联任务" prop="mtask"> <el-form-item label="关联任务" prop="mtask">
<el-select <el-select
v-model="form.mtask" v-model="form.mtask"

View File

@ -59,7 +59,7 @@
</el-form> </el-form>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button> <el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
<el-button @click="visibleDrawer = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
</el-main> </el-main>
</el-container> </el-container>
@ -197,51 +197,11 @@ export default {
}, },
// //
formWminChange(code){ formWminChange(code){
let that = this,codeId='',keys="",arr=[]; let that = this,codeId='',arr=[];
if(code.indexOf("#")>-1){ if(code.indexOf("#")>-1){
let arrs = code.split("#"); let arrs = code.split("#");
keys = arrs[0];
codeId = arrs[1]; codeId = arrs[1];
that.scanKyes = keys; that.scanKyes = arrs[0];
if(keys=='wpr'){//
console.log('wpr',codeId)
that.form.parent = '';
that.$API.wpm.wpr.item.req(codeId).then((res) => {
if(res){
let bwitem = {};
bwitem.mlogb="";
bwitem.number=res.number;
bwitem.wpr=res.id;
arr = that.materialOptions.filter((item) => {
return item.id == res.wm;
})
if (arr.length > 0) {//
let batch = arr[0].batch;
that.wm_in = arr[0].batch;
that.mlogbInCount = arr[0].count;//
//
let arr0= that.mlogbIns.filter((item)=>{
return item.batch == batch;
})
if (arr0.length > 0) {
that.hasMlogbIn = true;
that.form.count_use = 1;
bwitem.mlogb = arr0[0].id;
}else{
that.form.batch = arr[0].batch;
that.form.wm_in = arr[0].id;
that.form.count_use = 1;
that.wm_in = arr[0].batch;
}
that.bwItemForm = bwitem;
console.log('that.bwItemForm',that.bwItemForm)
}else{
that.wm_in = '';
that.$message.error("批次号不存在");
}
}
}).catch((err) => {})
}else{//
this.$API.cm.labelmat.item.req(codeId).then((res) => { this.$API.cm.labelmat.item.req(codeId).then((res) => {
if(res){ if(res){
arr = that.materialOptions.filter((item) => { arr = that.materialOptions.filter((item) => {
@ -263,22 +223,42 @@ export default {
that.wm_in = ''; that.wm_in = '';
that.$message.error("批次号不存在"); that.$message.error("批次号不存在");
}); });
}
}else{ }else{
arr = that.materialOptions.filter((item) => { that.$API.wpm.wpr.list.req({number:code,page:0}).then((res) => {
return item.batch == code; if(res.length>0){
let bwitem = {};
bwitem.mlogb="";
bwitem.number=res[0].number;
bwitem.wpr=res[0].id;
let arr = that.materialOptions.filter((item) => {
return item.id == res[0].wm;
}) })
if (arr.length > 0) { if(arr.length>0){ //
let batch = arr[0].batch;
that.wm_in = arr[0].batch;
that.mlogbInCount = arr[0].count;//
//
let arr0= that.mlogbIns.filter((item)=>{
return item.batch == batch;
})
if (arr0.length > 0) {
that.hasMlogbIn = true;
that.form.count_use = 1;
bwitem.mlogb = arr0[0].id;
}else{
that.form.batch = arr[0].batch; that.form.batch = arr[0].batch;
that.form.wm_in = arr[0].id; that.form.wm_in = arr[0].id;
that.form.count_use = arr[0].count; that.form.count_use = 1;
that.wm_in = arr[0].batch; that.wm_in = arr[0].batch;
}
that.bwItemForm = bwitem;
}else{ }else{
that.wm_in = ''; that.wm_in = '';
that.$message.error("批次号不存在"); that.$message.error("批次号不存在");
} }
} }
})
}
}, },
// //
@ -305,7 +285,7 @@ export default {
that.form.batch = ''; that.form.batch = '';
that.form.parent = ''; that.form.parent = '';
that.form.count_use = 0; that.form.count_use = 0;
if(that.scanKyes=='wpr'&&that.mlogbInCount>1){ if(that.scanKyes!=='mat'&&that.mlogbInCount>1){
//1 //1
that.bwItemForm.mlogb = res.id; that.bwItemForm.mlogb = res.id;
that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {}) that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {})

View File

@ -181,6 +181,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
batchNumber:{
type: String,
default: "",
},
}, },
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
@ -214,6 +218,7 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
that.addTemplate.number = that.batchNumber;
that.params.mlogb = that.addTemplate.mlogb = that.mlogb; that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
}, },
methods: { methods: {