diff --git a/src/api/wms/matetowsn.js b/src/api/wms/matetowsn.js index 4811301..9f6124f 100644 --- a/src/api/wms/matetowsn.js +++ b/src/api/wms/matetowsn.js @@ -15,6 +15,13 @@ export function cardDy(data) { data: data }); } +export function cardBD(data) { + return request({ + url: '/wms/matetowsn/cardBD', + method: 'post', + data: data + }); +} // 查询包材库存明细表详细 export function getMatetowsn(mateOrderInSnId) { return request({ diff --git a/src/api/wms/odsRawOrderIn.js b/src/api/wms/odsRawOrderIn.js index 28e7dda..a4cc964 100644 --- a/src/api/wms/odsRawOrderIn.js +++ b/src/api/wms/odsRawOrderIn.js @@ -42,7 +42,7 @@ export function delOdsRawOrderIn(rawOrderInId) { method: 'delete' }); } -// 新增包材到货单 +// 过账105 export function sap105temporarilyCollected(data) { return request({ url: '/wms/odsRawOrderIn/sap105temporarilyCollected', @@ -50,3 +50,17 @@ export function sap105temporarilyCollected(data) { data: data }); } +export function handleUpdateSAP103(data) { + return request({ + url: '/wms/odsRawOrderIn/handleUpdateSAP103', + method: 'post', + data: data + }); +} +export function handleUpdateSAP105(data) { + return request({ + url: '/wms/odsRawOrderIn/handleUpdateSAP105', + method: 'post', + data: data + }); +} diff --git a/src/api/wms/outorderfc.js b/src/api/wms/outorderfc.js index 284a511..9e29db4 100644 --- a/src/api/wms/outorderfc.js +++ b/src/api/wms/outorderfc.js @@ -182,6 +182,14 @@ export function listProduct(query) { params: query }); } +// 查询物料信息列表 +export function listProductFp(query) { + return request({ + url: '/wms/matenews/listwmsFpStorageNews', + method: 'get', + params: query + }); +} // 查询报工详细列表 export function getCKList(data) { return request({ @@ -197,3 +205,10 @@ export function addOdsProcureOutOrderTS(data) { data: data }); } +export function addwmsFpStorageNewsTS(data) { + return request({ + url: '/wms/outorder/addwmsFpStorageNewsTS', + method: 'post', + data: data + }); +} diff --git a/src/api/wms/sellout.js b/src/api/wms/sellout.js index 6126e6d..d5862ef 100644 --- a/src/api/wms/sellout.js +++ b/src/api/wms/sellout.js @@ -16,7 +16,13 @@ export function listSelloutlistRE(query) { params: query }); } - +export function listSelloutlistRETS(query) { + return request({ + url: '/wms/sellout/listRETS', + method: 'get', + params: query + }); +} // 查询成品销售出库详细 export function getSellout(id) { return request({ diff --git a/src/views/wms/bpprocure/index.vue b/src/views/wms/bpprocure/index.vue index c23a753..9ddcdd2 100644 --- a/src/views/wms/bpprocure/index.vue +++ b/src/views/wms/bpprocure/index.vue @@ -82,7 +82,7 @@ - + @@ -248,6 +248,7 @@ export default { total: 0, // 白坯原材料采购单表格数据 bpprocureList: [], + factoryName: "", // 弹出层标题 title: "", // 是否显示弹出层 @@ -368,8 +369,26 @@ export default { }); }, - handlePrint() { + async handlePrint() { // 获取选中数据 + let factoryCode = localStorage.getItem("USER_POOL_NAME_CURRENT"); + // .substring(3); + console.log(localStorage) + + // 定义 factoryCode 和 factoryName 的映射关系 + const factoryMapping = { + "ds_1000": "中山小榄工厂", + "ds_1010": "阜沙工厂", + "ds_1020": "重庆工厂", + "ds_1030": "江西工厂", + "ds_1040": "安徽工厂", + "ds_999": "中山恒阳" + }; + // 根据 factoryCode 查找对应的 factoryName + console.log(factoryCode) + this.factoryName = factoryMapping[factoryCode] || "未知工厂"; // 如果没有匹配,赋值为“未知工厂” + // if (){} + console.log(this.factoryName ) const selectedData = this.bpprocureList.filter(item => this.ids.includes(item.id)); if (selectedData.length === 0) { this.$message.warning("请先选择要打印的记录"); @@ -390,28 +409,25 @@ export default { })) }; - // 生成条形码 - const barcodeCanvas = document.createElement('canvas'); - console.log(" this.printData.workTable[0].procureCode: " + this.printData.workTable[0].procureCode); + if (this.printData.workTable.length === 0 || !this.printData.workTable[0].procureCode) { + this.$message.warning("没有可打印的数据或数据不完整"); + return; + } - JsBarcode(barcodeCanvas, this.printData.workTable[0].procureCode, { - format: "CODE128", - height: 35, - width: 1.5, - displayValue: true, - // background: "#FFFFFF", // 背景颜色 - // lineColor: "#000000" // 条形码颜色 - }); + try { + // 确保JsBarcode库加载完成 + if (typeof JsBarcode !== 'function') { + throw new Error("JsBarcode库没有正确加载"); + } - // 将条形码转换为 Data URL - const barcodeDataUrl = barcodeCanvas.toDataURL(); - console.log(barcodeDataUrl); // 检查生成的 Data URL + console.log("开始生成条形码..."); + const barcodeDataUrl = await this.generateBarcode(this.printData.workTable[0].procureCode); + console.log("条形码生成成功:", barcodeDataUrl); - // 打印内容 - let printContent = ` + // 创建打印内容 + let printContent = ` - diff --git a/src/views/wms/outorderTS/index.vue b/src/views/wms/outorderTS/index.vue index fea26be..e3a48bf 100644 --- a/src/views/wms/outorderTS/index.vue +++ b/src/views/wms/outorderTS/index.vue @@ -22,25 +22,25 @@ - - 过账 - + + + 生成出库单 - - 打印出库单 - + + + + + + + + + + + 导出 @@ -55,7 +55,7 @@ - + - - + + - - - + - - + @@ -129,54 +117,109 @@ + - - - 查询 - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + + + + + + + + + + + + + + + + + - - + + +
- - - - - + + 查询 @@ -184,24 +227,14 @@ - - - - - + + + - - - - - - - - - + { + listSelloutlistRETS(this.queryParams).then(response => { this.selloutList = response.rows; this.total = response.total; this.loading = false; @@ -378,21 +448,35 @@ }, async submitForm() { const payload = this.addoutorderList.map(item => ({ - id: item.id, + qty: item.qty, // 计划数量 + userDefined6: this.selectedOrderType, // 订单类型 + userDefined1: item.userDefined1, + materialDesc: item.materialDesc, // 物料描述 + materialCode: item.materialCode, // 物料编码 + // 注意:根据您的描述,可能没有 unit 字段,请确认是否需要 + // unit: item.unit, + planNumber: item.planNumber, // 计划数量 + locCode: this.queryParams1.warehouseNo, // 仓库编码 + userDefined2: this.queryParams1.accountingSubject, // 总账科目编号 + userDefined4: this.queryParams1.receiver, // 收货方 + planDate: this.queryParams1.productionDate, // 生产日期 + userDefined5: this.queryParams1.shelfLifeExpiryDate, // 货架寿命到期日 + userDefined3: this.queryParams1.costCenter, // 成本中心(如果订单类型是成本中心) + })); console.log("payload:", payload); // 使用逗号分隔符来打印对象 try { - await this.$confirm('确认生成备货单吗?', '确认', { + await this.$confirm('确认提交出库单吗?', '确认', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'info' }); // 调用接口提交数据 - const response = await addRE(payload); - this.$message.success('备货单生成成功'); + const response = await addwmsFpStorageNewsTS(payload); + this.$message.success('出库单提交成功'); this.open = false; // 关闭对话框 this.addoutorderList = []; // 清空列表或根据需求更新 } catch (error) { @@ -423,6 +507,16 @@ this.single = selection.length !== 1 this.multiple = !selection.length }, + forceUpdate(selection) { + console.log(selection) + }, + handleQtyChange(row, event) { + // 在这里处理输入变化,你可以更新 row 对象中的 qty 属性 + row.planNumber = event; + // 或者调用后端接口保存数据 + // this.saveQtyToServer(row.id, event); + }, + handlequeryform() { this.showMaterialDialog = true; // 显示领料单信息弹窗 this.fetchMaterials(); // 加载领料单数据 @@ -438,34 +532,51 @@ handleAdd() { this.reset(); this.open = true; - this.title = "成本中心出库任务新增"; + this.title = "生成出库单"; this.queryParams1 = {} this.addoutorderList = [] + let factoryCode = localStorage.getItem('USER_POOL_NAME_CURRENT').substring(3) + let params = { factoryCode: factoryCode }; // 构造一个包含工厂代码的对象 + let paramsJSON = JSON.stringify(params); // 将对象转换为JSON字符串 + console.log(factoryCode) + getlistCK(paramsJSON).then(response => { + this.Optionlistck = response.data + console.log(this.Optionlistck) + + + }); }, async confirmMaterialSelection() { const materialsToAdd = []; // 临时存储待添加的材料信息 + for (const material of this.selectedMaterials) { + let queryParams = { + produceCode: material.produceCode, + materialCode: material.materialCode + }; + try { + const response = await listReturnBC(queryParams); + console.log("Response:", response); + + const batches = response.rows || []; // 从响应中提取批次数据 + materialsToAdd.push({ - id: material.id, - deliveryOrder: material.deliveryOrder, - itemNumber: material.itemNumber, - productName: material.productName, - productCode: material.productCode, - unitOfMeasure: material.unitOfMeasure, - lotNumber: material.lotNumber, - planQuantity: material.planQuantity, - outDate: material.outDate, - attr4: material.attr4, - attr3: material.attr3, - attr6: material.attr6, - attr5: material.attr5, - attr7: material.attr7 + produceCode: material.produceCode, + materialDesc: material.materialDesc, + userDefined1: material.userDefined1, + materialCode: material.materialCode, + planNumber: material.planNumber, // 数量 + outNumber: material.outNumber, // 出库数量 + bgnumber: material.bgnumber, // 报工数量 + returnQty: material.planNumber - material.outNumber, // 出库数量 + qty: 0, // 默认数量为0 }); } catch (error) { console.error('Error fetching batches:', error); } } + // 将待添加的材料一次性添加到 addoutorderList 中 this.addoutorderList = this.addoutorderList.concat(materialsToAdd); console.log("Materials processed"); @@ -490,11 +601,11 @@ if (!code) return code; // 处理 null 或 undefined 情况 return code.replace(/^0{1,7}/, ''); // 替换前1到7个0 }, - /** 重置按钮操作 */ + /** 重置按钮操作 */ /** 重置按钮操作 */ async fetchMaterials(pageNum = 1) { // 这里的参数名称为 pageNum this.loading = true; // 显示加载状态 try { - const response = await listSellout({ + const response = await listProductFp({ ...this.queryParams, // 假设 queryParams 包含其他查询条件 pageNum: pageNum, // 将当前页码传递给后端 pageSize: this.pageSize // 确保将每页显示的数量传递给后端 @@ -508,8 +619,8 @@ this.totalMaterials = response.total; // 更新总条目数 } catch (error) { - console.error('获取装运单失败:', error); - this.$message.error('加载装运单失败,请稍后重试。'); + console.error('获取物料信息失败:', error); + this.$message.error('加载物料信息失败,请稍后重试。'); } finally { this.loading = false; // 隐藏加载状态 }