包材退货页面--打印修改2

master
mengjiao 9 months ago
parent 662a6ab429
commit cb22fc4b05

@ -149,3 +149,13 @@ export function getIdCardListTH(data) {
data: data
});
}
// 查询包材出库单列表
export function listReturnDY(query) {
return request({
url: '/wms/outorder/listReturnDY',
method: 'post',
params: query
});
}

@ -48,6 +48,17 @@
v-hasPermi="['mes:pro:workorder:edit']"
>打印标识卡
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
:disabled="single"
icon="el-icon-download"
size="mini"
@click="showPrint"
v-hasPermi="['mes:prepare:export']"
>打印生产物料</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
@ -232,6 +243,95 @@
</div>
</div>
</el-dialog>
<!-- 打印预览弹出层(生产物料) -->
<el-dialog
title="退料单打印"
:visible.sync="printDialogVisible"
:width="shengchan?'861px':'871px'"
>
<div id="printFrom" class="my-print-box">
<el-form :model="form">
<!-- 表头-工单信息 -->
<!-- 导航栏 -->
<el-row class="my-print-nav">
<el-col :span="24">
<div style="display: flex; justify-content: flex-end;">
<div class="my-print-barcode" :width="shengchan ? '631px' : '621px'">
<svg id="barcode"></svg>
</div>
</div>
</el-col>
</el-row>
<!-- 主数据 -->
<!-- 表头-工单信息 -->
<el-row>
<div class="my-print-head">
<el-col :span="24" style="text-align: center;">
<h3 style="margin: 0;">普通领料/退料单</h3>
<div style="margin-top: 10px;">
<span>领料</span>
<span style="margin-left: 20px;">退料 <span style="color: green;"></span></span>
</div>
</el-col>
</div>
</el-row>
<!-- 导航栏 -->
<el-row class="my-print-nav">
<el-col :span="6">领料单:{{printData.factory}}</el-col>
<el-col :span="6">工厂编码:{{printData.factory}}</el-col>
<el-col :span="6">库存地点:</el-col>
<el-col :span="6">发料日期:</el-col>
<el-col :span="6">打印日期:{{printData.printDate}}</el-col>
</el-row>
<el-row class="my-print-nav">
<el-col :span="6">成本中心编码:</el-col>
<el-col :span="6">成本中心:</el-col>
<el-col :span="6">移动类型:</el-col>
<el-col :span="6">物料凭证:</el-col>
</el-row>
<el-table
v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" :data="printData.workTable"
border style="width: 1000px;padding-bottom: 1px;">
<el-table-column prop="materialCode" label="物料编码" :width="150" :formatter="productCodeFormate"></el-table-column>
<el-table-column prop="materialDesc" label="物料描述" :width="200"></el-table-column>
<el-table-column prop="unit" width="55" label="单位"></el-table-column>
<el-table-column prop="userDefined5" width="165" label="批号"></el-table-column>
<el-table-column prop="quantity" label="计划数量" width="100"></el-table-column>
<el-table-column prop="planNumber" width="75" label="实发数量"></el-table-column>
<el-table-column prop="routeCode" width="75" label="备注"></el-table-column>
</el-table>
<!-- 底部 -->
<el-row class="my-print-foot0">
<el-col :offset="2" :span="3">白色:车间联</el-col>
<el-col :offset="1" :span="3">蓝色:仓库联</el-col>
<el-col :offset="1" :span="3">红色:财务联</el-col>
</el-row>
<el-row class="my-print-foot">
<el-col :offset="1" :span="3">品管员审批:</el-col>
<el-col :offset="2" :span="3">领料人:{{printData.createBy}}</el-col>
<el-col :offset="2" :span="3">仓管员:</el-col>
</el-row>
<div class="fy" v-if="index!=printData.workTable.length-1"></div>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlePrint(printData)"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -250,8 +350,11 @@ import {
listreturnderZC,
addreturnderZC,
getIdCardListTH,
listReturnDY,
listOutorderZU
} from '@/api/wms/outorderfc'
import moment from "moment/moment";
import JsBarcode from "jsbarcode";
export default {
name: "Outorder",
@ -269,99 +372,33 @@ export default {
multiple: true,
//
showSearch: true,
newWorkerLoading: false,
refreshNewWorkerTable:true,
//
total: 0,
//
printData: {
printable: 'printFrom',
pageNo:1,
ignore: ['no-print'],
workCenter: "暂无数据",
SAPNo: null,
manufacture: null,
auditor: null,
produceCode:"",
printDate: null,
createBy:"",
factory: null,
productDate: null,
workTable: [],
barcode:null,//
},
printDialogVisible: false,
shengchan:true,
//
outorderList: [
],
// outorderListceshi: [
// {
// createBy: 'admin',
// siteCode: '1000',
// produceCode: '000100305998',
// materialCode: '000000040000015127',
// materialDesc: 'Ф134mm×H100mm 36(2201)',
// planDate: '2023-12-25',
// planNumber: 3000.0,
// outNumber: 3000.0,
// locCode: 'WH02',
// productionLineCode: 'LJ8',
// orderStatus: '3',
// userDefined1: '20231225154549',
// userDefined2: '00001',
// userDefined3: '',
// userDefined10: '1',
// createDate: '2023-12-25',
// id: '18d2af6969e0405ba202a5c09bc14f33',
// active: '1',
// unit: 'ST',
// list: [
// {
// createBy: 'admin',
// siteCode: '1000',
// produceCode: '000100305998',
// materialCode: '000000040000015127',
// materialDesc: 'Ф134mm×H100mm 36(2201)',
// planDate: '2023-12-25',
// planNumber: 3000.0,
// outNumber: 3000.0,
// locCode: 'WH02',
// productionLineCode: 'LJ8',
// orderStatus: '3',
// userDefined1: '20231225154549',
// userDefined2: '00001',
// userDefined3: '',
// userDefined10: '1',
// createDate: '2023-12-25',
// id: '18d2af6969e0405ba202a5c09bc14f331',
// active: '1',
// unit: 'ST',
// },
// {
// createBy: 'admin',
// siteCode: '1000',
// produceCode: '000100305998',
// materialCode: '000000040000015127',
// materialDesc: 'Ф134mm×H100mm 36(2201)',
// planDate: '2023-12-25',
// planNumber: 3000.0,
// outNumber: 3000.0,
// locCode: 'WH02',
// productionLineCode: 'LJ8',
// orderStatus: '3',
// userDefined1: '20231225154549',
// userDefined2: '00001',
// userDefined3: '',
// userDefined10: '1',
// createDate: '2023-12-25',
// id: '18d2af6969e0405ba202a5c09bc14f332',
// active: '1',
// unit: 'ST',
// },
// ],
// },
// {
// createBy: 'admin',
// siteCode: '1000',
// produceCode: '000100305998',
// materialCode: '000000040000015127',
// materialDesc: 'Ф134mm×H100mm 36(2201)',
// planDate: '2023-12-25',
// planNumber: 3000.0,
// outNumber: 3000.0,
// locCode: 'WH02',
// productionLineCode: 'LJ8',
// orderStatus: '3',
// userDefined1: '20231225154549',
// userDefined2: '00001',
// userDefined3: '',
// userDefined10: '1',
// createDate: '2023-12-25',
// id: '18d2af6969e0405ba202a5c09bc14f32',
// active: '1',
// unit: 'ST',
// },
// ],
//
title: "",
//
@ -668,6 +705,21 @@ export default {
}
}
,
//
handlePrint(params) {
printJS({
printable: params.printable, // 'printFrom', // id
type: params.type || 'html',
dpi: 360, //
//font_size: "",//
header: params.header, // '',
targetStyles: ['*'],
////style:'body {margin: 2mm;padding: 0;}.fy{page-break-after: always;} table { width:100%;height:800px;border-collapse: collapse;} table, th, td { border: 2px solid black; white-space: pre-wrap; word-break: break-all;} .el-table .cell{padding-left:1px;padding-right:1px;border: 2px solid black;}',
ignoreElements: params.ignore || [], // ['no-print']
properties: params.properties || null
})
},
printIdCard() {
// ID
if (this.ids.length === 0) {
@ -702,6 +754,55 @@ export default {
this.currentPage = page; //
this.fetchMaterials(page); //
},
// ()
showPrint() {
this.shengchan = true;
//
this.printData.workCenter = "暂无数据";
this.printData.pageNo =0 ;
this.printData.printDate = null;
this.printData.workTable = [];
this.printData.factory = null;
this.printData.productDate = null;
//
this.printDialogVisible = true;
this.newWorkerLoading = true // true
this.refreshNewWorkerTable = false // refreshProTablefalse
listReturnDY(this.outorderList[0].produceCode,'0').then(response => {
this.showWorkorderCode = true;
this.printData.printTitle = '订单物料';
this.printData.factory = response.data[0].siteCode
//this.printData.productDate = response.data.mesPrepareDetailList[0].productDate
this.printData.printDate = moment(new Date()).format('YYYY-MM-DD')
this.printData.produceCode = response.data[0].produceCode
this.printData.workTable = response.data;
this.printData.pageNo = response.data.length;
this.printData.createBy= response.data[0].createBy;
// let chunkedArray = [];
// console.log(this.printData.workTable[0].produceCode)
// //this.printData.workTable
// let chunkSize = (i === 0) ? this.fenyeNumber : this.fenyeNumberTwo;
//
// for (let i = 0; i < this.printData.workTable.length; i += chunkSize) {
// // 使slicei
// let chunk = this.printData.workTable.slice(i, i + chunkSize);
// // chunkedArray
// chunkedArray.push(chunk);
// }
// this.printData.workTable = chunkedArray;
console.log(this.printData.workTable[0].produceCode)
this.printData.produceCode = response.data.produceCode
this.refreshNewWorkerTable = true // refreshProTabletrue
this.newWorkerLoading = false // false
this.generateBarcode(this.outorderList[0].produceCode); //
})
},
//
productCodeFormate(row, column, cellValue){
return cellValue.slice(7,18); //
},
async confirmMaterialSelection() {
const materialsToAdd = []; //
@ -741,6 +842,15 @@ export default {
console.log("Materials processed");
this.showMaterialDialog = false; //
},
//
generateBarcode(barcode){
JsBarcode("#barcode", barcode, {
format: "CODE128",
height:35,
width:1.5,
displayValue: true,
});
},
handleMaterialSelectionChange(selection) {

Loading…
Cancel
Save