Commit 4bc86437 authored by tanjunxin's avatar tanjunxin

fix: 1.领料申请打印优化; 2.生产报工增加工单数量字段

parent 24658682
...@@ -77,7 +77,8 @@ ...@@ -77,7 +77,8 @@
<el-table-column label="工作单元" width="120" align="center" prop="workunitName" /> <el-table-column label="工作单元" width="120" align="center" prop="workunitName" />
<el-table-column label="外协单号" width="150" align="center" prop="assistProcessCode" /> <el-table-column label="外协单号" width="150" align="center" prop="assistProcessCode" />
<el-table-column label="生产工单编号" width="150" align="center" prop="workorderCode" /> <el-table-column label="生产工单编号" width="150" align="center" prop="workorderCode" />
<el-table-column label="任务数量" width="100" align="center" prop="woQuantity" /> <el-table-column label="任务数量" width="100" align="center" prop="quantity" />
<el-table-column label="工单数量" width="100" align="center" prop="woQuantity" />
<el-table-column label="报工数量" align="center" prop="feedbackTime" width="180"> <el-table-column label="报工数量" align="center" prop="feedbackTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getSumNumber(scope.row) }}</span> <span>{{ getSumNumber(scope.row) }}</span>
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<div class="productOrderSpecification"> <div class="productOrderSpecification">
<div class="pageTop"> <div class="pageTop">
<div class="titles" style="padding-bottom: 30px;">领料单 <div class="titles" style="padding-bottom: 30px;">领料单
<div v-if="Table.applyNo" class="barcode"> <div v-if="Table[0].applyNo" class="barcode">
<vue-barcode <vue-barcode
:value="Table.applyNo" :value="Table[0].applyNo"
margin-right="5" margin-right="5"
:display-value="Table.applyNo" :display-value="Table[0].applyNo"
font="bold" font="bold"
margin-left="5" margin-left="5"
text-margin="5" text-margin="5"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
style="width:250px;" style="width:250px;"
width="2" width="2"
ean128="ean128" ean128="ean128"
:text="'领取单号:'+ Table.applyNo" :text="'领取单号:'+ Table[0].applyNo"
height="45" height="45"
margin-top="10" margin-top="10"
margin="10" margin="10"
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
</div> </div>
</div> </div>
<div class="titles text-left"> <div class="titles text-left">
<div class="cdbh">领料部门:{{Table.workunitName}}</div> <div class="cdbh">领料部门:{{Table[0].workunitName}}</div>
</div> </div>
<div class="titles text-left"> <div class="titles text-left">
<div class="cdbh">领取类型:{{Table.applyType}}</div> <div class="cdbh">领取类型:{{Table[0].applyType}}</div>
<div class="cdbh">领取日期:{{Table.createTime}}</div> <div class="cdbh">领取日期:{{Table[0].createTime}}</div>
<div class="cdbh" style="padding-left: 30px">列印时间:{{Table.printTime}}</div> <div class="cdbh" style="padding-left: 30px">列印时间:{{Table[0].printTime}}</div>
</div> </div>
</div> </div>
<table border class="form-header font-size-16" style="table-layout: fixed;width: 100%;border:1px solid #000000;font-size:14px;line-height: 25px; margin: 8px 10px 5px 10px;"> <table border class="form-header font-size-16" style="table-layout: fixed;width: 100%;border:1px solid #000000;font-size:14px;line-height: 25px; margin: 8px 10px 5px 10px;">
...@@ -40,23 +40,23 @@ ...@@ -40,23 +40,23 @@
<!-- <td colspan="3" align="center">单位</td> --> <!-- <td colspan="3" align="center">单位</td> -->
<td colspan="4" align="center">申请量</td> <td colspan="4" align="center">申请量</td>
</tr> </tr>
<tr height="20" v-for="(item,index) in Table.processes" :key="'processes' + index" class="color000"> <tr height="20" v-for="(item,index) in Table" :key="'processes' + index" class="color000">
<td colspan="3" align="center">{{item.serialNumber}}</td> <td colspan="3" align="center">{{item.serialNumber}}</td>
<td colspan="6" align="center">{{item.itemCode}}</td> <td colspan="6" align="center">{{item.sapItemCode ? Number(item.sapItemCode) : ''}}</td>
<td colspan="11" align="center">{{item.itemName}}</td> <td colspan="11" align="center">{{item.itemName}}</td>
<!-- <td colspan="3" align="center">{{item.serialNumber}}</td> --> <!-- <td colspan="3" align="center">{{item.serialNumber}}</td> -->
<td colspan="4" align="center">{{item.applyNum}}</td> <td colspan="4" align="center">{{item.applyNum}}</td>
</tr> </tr>
<tr height="20" class="color000"> <tr height="20" class="color000">
<td colspan="9" align="center">生产单号<br/>共计:{{Table.processes.length}}份单</td> <td colspan="9" align="center">生产单号<br/>共计:{{Table.length}}份单</td>
<td colspan="15" align="center"> <td colspan="15" align="center">
{{Table.workorderCode}} {{Table[0].workorderCode}}
</td> </td>
</tr> </tr>
</table> </table>
<div class="pageBottom"> <div class="pageBottom">
<div> <div>
领取人:{{ Table.createBy }} 领取人:{{ Table[0].createBy }}
</div> </div>
</div> </div>
</div> </div>
...@@ -138,18 +138,52 @@ export default { ...@@ -138,18 +138,52 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.productOrderSpecification{ @media print {
position: relative; @page {
width: 920px; size: A4;
height: 600px; margin: 0;
padding: 0 49px; }
padding-top:20px;
box-sizing: border-box; html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
/* 将需要铺满A4纸的内容放在这里 */
.content {
width: 100%;
height: 100%;
padding: 0;
}
/* 表格边框 */
table {
border-collapse: collapse;
border: 1px solid #000;
}
/* 表格内容边框 */
td,
th {
border: 1px solid #000;
}
} }
.pageTop{ .font-family-song {
font-family: "宋体";
}
.productOrderSpecification{
height: 100vh;
padding: 24px;
color: #000; color: #000;
padding: 0px 10px; display: flex;
flex-direction: column;
// justify-content: center;
.pageTop {
padding-bottom: 8px;
box-sizing: border-box;
text-align: center;
position: relative;
.titles{ .titles{
text-align: center; text-align: center;
font-size:22px; font-size:22px;
...@@ -181,22 +215,22 @@ export default { ...@@ -181,22 +215,22 @@ export default {
margin:0 auto; margin:0 auto;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
}
}
.pageBottom{
display: flex;
justify-content: flex-end;
width: 850px;
position: absolute;
bottom: 0px;
padding: 0px 49px;
color: #000;
div{
margin-left:100px;
min-width: 100px;
} }
} }
// .pageBottom{
// display: flex;
// justify-content: flex-end;
// width: 850px;
// position: absolute;
// bottom: 0px;
// padding: 0px 49px;
// color: #000;
// border: 2px solid #000;
// div{
// margin-left:100px;
// min-width: 100px;
// }
// }
[text-center]{ [text-center]{
text-align: center; text-align: center;
} }
...@@ -211,5 +245,6 @@ export default { ...@@ -211,5 +245,6 @@ export default {
word-break:break-all word-break:break-all
} }
} }
}
</style> </style>
...@@ -498,19 +498,31 @@ export default { ...@@ -498,19 +498,31 @@ export default {
return this.$message.warning('没有数据') return this.$message.warning('没有数据')
} }
if(res.code === 200 && res.data) { if(res.code === 200 && res.data) {
// res.data.forEach(element => {
// const item = this.dict.type.pro_requisition_type.find(v=> Number(v.value) === element.applyType)
// const applyType = item && item.label ? item.label : ''
// this.printTable.push({
// ...element,
// applyType,
// processes: [{
// serialNumber: element.serialNumber,
// itemCode: element.itemCode,
// itemName: element.itemName,
// applyNum: element.applyNum,
// }]
// })
// });
const temp = [];
res.data.forEach(element => { res.data.forEach(element => {
const item = this.dict.type.pro_requisition_type.find(v=> Number(v.value) === element.applyType) const item = this.dict.type.pro_requisition_type.find(v=> Number(v.value) === element.applyType)
const applyType = item && item.label ? item.label : '' element.applyType = item && item.label ? item.label : '';
this.printTable.push({ const index = temp.findIndex(ele => ele == element.applyNo);
...element, if(index == -1) {
applyType, temp.push(element.applyNo);
processes: [{ this.printTable.push([element]);
serialNumber: element.serialNumber, } else {
itemCode: element.itemCode, this.printTable[index].push(element);
itemName: element.itemName, }
applyNum: element.applyNum,
}]
})
}); });
console.log("printTable", this.printTable) console.log("printTable", this.printTable)
this.$nextTick(() => { this.$nextTick(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment