From cb22fc4b0573d59f7c00be7dc51e86e53d4a37a0 Mon Sep 17 00:00:00 2001
From: mengjiao <3338049200@qq,com>
Date: Fri, 27 Sep 2024 07:28:40 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E6=9D=90=E9=80=80=E8=B4=A7=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2--=E6=89=93=E5=8D=B0=E4=BF=AE=E6=94=B92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/wms/outorderfc.js | 10 +
src/views/wms/returnorderzs/index.vue | 286 ++++++++++++++++++--------
2 files changed, 208 insertions(+), 88 deletions(-)
diff --git a/src/api/wms/outorderfc.js b/src/api/wms/outorderfc.js
index 409029a..06aa541 100644
--- a/src/api/wms/outorderfc.js
+++ b/src/api/wms/outorderfc.js
@@ -149,3 +149,13 @@ export function getIdCardListTH(data) {
data: data
});
}
+
+// 查询包材出库单列表
+export function listReturnDY(query) {
+ return request({
+ url: '/wms/outorder/listReturnDY',
+ method: 'post',
+ params: query
+ });
+
+}
diff --git a/src/views/wms/returnorderzs/index.vue b/src/views/wms/returnorderzs/index.vue
index 7c48167..8d704e7 100644
--- a/src/views/wms/returnorderzs/index.vue
+++ b/src/views/wms/returnorderzs/index.vue
@@ -48,6 +48,17 @@
v-hasPermi="['mes:pro:workorder:edit']"
>打印标识卡
+
+
+ 打印生产物料
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 普通领料/退料单
+
+ 领料
+ 退料 ✓
+
+
+
+
+
+
+ 领料单:{{printData.factory}}
+ 工厂编码:{{printData.factory}}
+ 库存地点:
+ 发料日期:
+ 打印日期:{{printData.printDate}}
+
+
+ 成本中心编码:
+ 成本中心:
+ 移动类型:
+ 物料凭证:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -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 // 先将refreshProTable设置为false,隐藏表格
+ 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) {
+ // // 使用slice方法从当前索引i开始切割
+ // 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 // 立即将refreshProTable设置为true,显示表格
+ 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) {