-
-
-
-
-
+
+
查询
@@ -184,24 +227,14 @@
-
-
-
-
-
+
+
+
- {{ formatProductCode(scope.row.productCode) }}
+ {{ formatProductCode(scope.row.materialCode) }}
-
-
-
-
-
-
-
-
-
+
{
+ 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; // 隐藏加载状态
}