4 changed files with 470 additions and 9 deletions
-
8src/store/modules/user.js
-
12src/views/modules/Abnormal/AbnormalFeedBack.vue
-
117src/views/modules/production/bagLabels.vue
-
340src/views/modules/production/bagLabels_old.vue
@ -0,0 +1,340 @@ |
|||
<script > |
|||
import { |
|||
checkIsPacking, |
|||
getPackagePrintDataList, |
|||
getSOScheduleRoutingDataPrint |
|||
} from "../../../api/production/generateReport"; |
|||
import {printPackageLabelNoPreview} from "../print/print_package_label-NOOREVIEW"; |
|||
export default { |
|||
data(){ |
|||
return{ |
|||
searchData:{ |
|||
seqNo:undefined, |
|||
flag:'', |
|||
}, |
|||
number:1, |
|||
flag:false, |
|||
soScheduleRouting:{ |
|||
|
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs.focusInput.focus() |
|||
}, |
|||
activated() { |
|||
this.$refs.focusInput.focus() |
|||
}, |
|||
computed:{ |
|||
seqNo:function (){ |
|||
return this.searchData.seqNo; |
|||
} |
|||
}, |
|||
watch:{ |
|||
|
|||
}, |
|||
methods:{ |
|||
selectBySeqNo(){ |
|||
// 查询数据 |
|||
this.getSOScheduleRoutingData(); |
|||
}, |
|||
getSOScheduleRoutingData(){ |
|||
if (!this.searchData.seqNo){ |
|||
this.$message.warning("派工单号为空") |
|||
return |
|||
} |
|||
let params = { |
|||
seqNo:this.searchData.seqNo, |
|||
userId:this.$store.state.user.name |
|||
}; |
|||
getSOScheduleRoutingDataPrint(params).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
if (data.total === 0){ |
|||
this.$message.warning("派工单不存在") |
|||
}else if (data.total === 1){ |
|||
this.soScheduleRouting = data.rows[0]; |
|||
this.checkIsPacking() |
|||
}else { |
|||
this.soScheduleRouting = data.rows.find((item)=>item.site===this.$store.state.user.site && item.seqNo === this.searchData.seqNo) |
|||
this.checkIsPacking() |
|||
} |
|||
if (data.row){ |
|||
this.soScheduleRouting.qtyBag = data.row[0].qtyBag |
|||
this.soScheduleRouting.bag = data.row[0].bag |
|||
this.soScheduleRouting.qty = data.row[0].qty |
|||
this.soScheduleRouting.carton = data.row[0].carton |
|||
} |
|||
if (data.data){ |
|||
this.soScheduleRouting.sScheduledDate2 = data.data.sScheduledDate; |
|||
this.soScheduleRouting.operatorName2 = data.data.operatorName; |
|||
this.soScheduleRouting.approveQty2 = data.data.qtyApprove; |
|||
} |
|||
}else { |
|||
this.$message.warning(data.msg) |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error); |
|||
}) |
|||
}, |
|||
checkIsPacking(){ |
|||
let params = { |
|||
site:this.soScheduleRouting.site, |
|||
workCenterNo:this.soScheduleRouting.sWorkCenterNo, |
|||
} |
|||
checkIsPacking(params).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
|
|||
}else { |
|||
this.soScheduleRouting={}; |
|||
this.$message.warning(data.msg) |
|||
this.searchData = { |
|||
seqNo: undefined, |
|||
flag: '', |
|||
} |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error) |
|||
this.searchData = { |
|||
seqNo: undefined, |
|||
flag: '', |
|||
} |
|||
this.soScheduleRouting={}; |
|||
}) |
|||
}, |
|||
printLabel(){ |
|||
if (!this.soScheduleRouting.site){ |
|||
this.$message.warning("请先扫描派工单号") |
|||
return |
|||
} |
|||
if (this.soScheduleRouting.qtyBag === null || this.soScheduleRouting.qtyBag === undefined){ |
|||
this.$message.warning("未维护每袋数量") |
|||
return; |
|||
} |
|||
let params = { |
|||
previousSeqNo:this.soScheduleRouting.previousSeqNo, |
|||
site:this.soScheduleRouting.site, |
|||
orderNo:this.soScheduleRouting.orderNo |
|||
} |
|||
if (this.searchData.flag === 'Y'){ |
|||
this.flag = true; |
|||
return; |
|||
} |
|||
this.printPackageLabelNoPreview(params) |
|||
}, |
|||
printPackageLabelNoPreview(params){ |
|||
if (!params){ |
|||
this.$message.warning("参数为空") |
|||
return |
|||
} |
|||
// 发起请求 |
|||
getPackagePrintDataList(params).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
printPackageLabelNoPreview(data.rows); |
|||
this.searchData.flag = ''; |
|||
}else { |
|||
this.$message.warning(data.msg) |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error) |
|||
}) |
|||
}, |
|||
printLabelEntity(){ |
|||
let params = { |
|||
previousSeqNo:this.soScheduleRouting.previousSeqNo, |
|||
site:this.soScheduleRouting.site, |
|||
orderNo:this.soScheduleRouting.orderNo |
|||
} |
|||
params.number = this.number; |
|||
this.printPackageLabelNoPreview(params) |
|||
} |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div style="padding: 5px"> |
|||
<el-form size="medium" class="title" :model="seqNo" label-position="top" :inline="true" > |
|||
<el-form-item label="派工单号"> |
|||
<el-input-number size="medium" style="width: 100%;margin-top: -5px;" :controls="false" ref="focusInput" :min="0" v-model="searchData.seqNo" @keyup.enter.native="selectBySeqNo"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-select v-model="searchData.flag" clearable> |
|||
<el-option value="" label="标准袋数"></el-option> |
|||
<el-option value="Y" label="零数袋"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" @click="printLabel">打印标签</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="content"> |
|||
<el-card style="height: 80vh;margin-top: 20px"> |
|||
<el-form :model="soScheduleRouting" label-position="top"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="6"> |
|||
<el-form-item label="派工单号"> |
|||
<el-input v-model="soScheduleRouting.seqNo" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="工厂编码"> |
|||
<el-input v-model="soScheduleRouting.site" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="生产订单号"> |
|||
<el-input v-model="soScheduleRouting.orderNo" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label=" "> |
|||
|
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="产品编码"> |
|||
<el-input v-model="soScheduleRouting.partNo" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="产品名称"> |
|||
<el-input v-model="soScheduleRouting.partDesc" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="派工单类型"> |
|||
<el-input v-model="soScheduleRouting.scheduleType" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="派工日期"> |
|||
<el-input v-model="soScheduleRouting.sScheduledDate" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="检验工单号"> |
|||
<el-input v-model="soScheduleRouting.previousSeqNo" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="检验日期"> |
|||
<el-input v-model="soScheduleRouting.sScheduledDate2" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="检验员"> |
|||
<el-input v-model="soScheduleRouting.operatorName2" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="检验合格数量"> |
|||
<el-input v-model="soScheduleRouting.approveQty2" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="工序号"> |
|||
<el-input v-model="soScheduleRouting.itemNo" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="工序名称"> |
|||
<el-input v-model="soScheduleRouting.itemDesc" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label=" "> |
|||
|
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="机台ID"> |
|||
<el-input v-model="soScheduleRouting.sResourceID" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="班次"> |
|||
<el-input v-model="soScheduleRouting.sShiftNo" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="加工中心编码"> |
|||
<el-input v-model="soScheduleRouting.sWorkCenterNo" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="操作员姓名"> |
|||
<el-input v-model="soScheduleRouting.operatorName" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="每袋数量"> |
|||
<el-input v-model="soScheduleRouting.qtyBag" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="每箱袋装数"> |
|||
<el-input v-model="soScheduleRouting.bag" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="整箱数量"> |
|||
<el-input v-model="soScheduleRouting.qty" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="纸箱尺寸"> |
|||
<el-input v-model="soScheduleRouting.carton" readonly></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-card> |
|||
</div> |
|||
<el-dialog title="提示" :visible.sync="flag" @open="()=>{ |
|||
this.$refs.dialogInput.focus(); |
|||
}" @close="()=>{ |
|||
this.number = 1 |
|||
}" width="15vw" top="30vh"> |
|||
<el-form label-position="top" class="title"> |
|||
<el-form-item label="零数量"> |
|||
<el-input-number size="medium" style="width: 100%;text-align: left" :controls="false" ref="dialogInput" :min="1" v-model="number" @keyup.enter.native="selectBySeqNo"></el-input-number> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div style="height: 20px;width: 100%"></div> |
|||
<div style="text-align: center;margin-bottom: 5px"> |
|||
<el-button type="primary" @click="printLabelEntity">确定</el-button> |
|||
</div> |
|||
<div style="height: 5px;width: 100%"></div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped> |
|||
.title .el-input-number /deep/ .el-input__inner{ |
|||
text-align: left; |
|||
margin-top: 5px; |
|||
padding-right: 5px !important; |
|||
padding-left: 5px !important; |
|||
} |
|||
|
|||
.el-form-item--medium /deep/ .el-form-item__label{ |
|||
font-size: 16px; |
|||
line-height: 30px; |
|||
height: 30px; |
|||
} |
|||
|
|||
.el-form-item--medium /deep/ .el-form-item__content{ |
|||
margin-bottom: 5px; |
|||
} |
|||
|
|||
.el-form-item--medium /deep/ .el-form-item__content .el-button{ |
|||
width: 80px; |
|||
height: 30px; |
|||
} |
|||
|
|||
.el-form-item--medium /deep/ .el-form-item__content .el-input .el-input__inner{ |
|||
font-size: 16px; |
|||
line-height: 30px; |
|||
height: 30px !important; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue