|
|
@@ -6,9 +6,7 @@
|
|
|
@keyup.enter="search_onSubmit" id="searchInput" style="width: 460px;height: 50px;margin-left: 10px;">
|
|
|
</el-input>
|
|
|
<el-button type="primary" @click="Reporting_onSubmit" style="height: 50px;font-size: 20px;margin-left: 20px;">面料入库</el-button>
|
|
|
- <!-- <el-button type="danger" @click="deldetail_delclick" style="width: 80px;height: 50px;" v-if="del_details=== true" :disabled="details_Selection === '' " class="bt" >删除</el-button> -->
|
|
|
</el-row>
|
|
|
-
|
|
|
<layout>
|
|
|
<layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
|
|
|
<div class="JKWTree-tree" style="height: 70vh;">
|
|
|
@@ -27,18 +25,16 @@
|
|
|
@row-click="Recordclicks" @row-dblclick="Doubleclickrecord"
|
|
|
@selection-change="detailSelectionChange" style="width: 100%;height: 65vh" border
|
|
|
:summary-method="getSummaries" tooltip-effect="dark" :data="recordtableData" row-key="ID" >
|
|
|
- <!-- <el-table-column align="center" type="selection" width="40"//> -->
|
|
|
- <el-table-column align="left" label="入库单" prop="出库单" width="140"/>
|
|
|
- <el-table-column align="left" label="订单编号" prop="订单编号" width="180"/>
|
|
|
- <el-table-column align="left" label="款号" prop="款号" width="180"/>
|
|
|
- <el-table-column align="left" label="款式" prop="款式" width="180"/>
|
|
|
- <el-table-column align="left" label="物料名称" prop="物料名称" width="180"/>
|
|
|
- <el-table-column align="left" label="单号类型" prop="单号类型" width="90"/>
|
|
|
- <el-table-column align="left" label="入库总数" prop="总数" width="110"/>
|
|
|
+ <el-table-column align="left" label="入库单号" prop="出库单" width="140"/>
|
|
|
+ <el-table-column align="left" label="订单编号" prop="订单编号" width="105"/>
|
|
|
+ <el-table-column align="left" label="款号" prop="款号" width="140"/>
|
|
|
+ <el-table-column align="left" label="款式" prop="款式" width="140"/>
|
|
|
+ <el-table-column align="left" label="物料名称" prop="物料名称" width="140"/>
|
|
|
+ <el-table-column align="left" label="入库总数" prop="总数" width="90"/>
|
|
|
<el-table-column align="left" label="入库人员" prop="操作机台" width="110"/>
|
|
|
- <el-table-column align="left" label="入库日期" prop="日期" width="120"/>
|
|
|
+ <el-table-column align="left" label="入库日期" prop="日期" width="100"/>
|
|
|
<el-table-column align="left" label="创建日期" prop="创建日期" width="160"/>
|
|
|
-
|
|
|
+ <el-table-column align="left" label="类型" prop="单号类型" width="90"/>
|
|
|
<el-table-column fixed="right" label="操作" width="130">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-button @click="record_deleteRow(row,$index)" type="success" size="small"
|
|
|
@@ -47,10 +43,8 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
- <!-- 分页 -->
|
|
|
<div class="gva-pagination">
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
@@ -84,29 +78,31 @@
|
|
|
@row-click="detailsclicks" @row-dblclick="Doubleclickdetails"
|
|
|
@selection-change="detailSelectionChange" style="width: 100%;height: 75vh" border
|
|
|
:summary-method="getSummaries" tooltip-effect="dark" :data="rdetailstableData" row-key="ID" >
|
|
|
- <!-- <el-table-column align="center" type="selection" width="40"/> -->
|
|
|
- <el-table-column align="left" label="入库单号" prop="出库单据编号" width="140"/>
|
|
|
- <!-- <el-table-column align="left" label="批次号" prop="批次号" width="90"/> -->
|
|
|
- <el-table-column align="left" label="订单编号" prop="订单编号" width="105"/>
|
|
|
- <!-- <el-table-column align="left" label="客户" prop="客户编号" width="70"/> -->
|
|
|
- <el-table-column align="left" label="生产款号" prop="款号" width="140"/>
|
|
|
- <!-- <el-table-column align="left" label="款式" prop="款式" width="120"/> -->
|
|
|
- <!-- <el-table-column align="left" label="物料编码" prop="物料编码" width="150"/> -->
|
|
|
- <el-table-column align="left" label="物料名称" prop="物料名称" width="150"/>
|
|
|
- <el-table-column align="left" label="颜色" prop="BOM_颜色" width="120"/>
|
|
|
- <!-- <el-table-column align="left" label="计划用料" prop="计划用料" width="90"/> -->
|
|
|
- <!-- <el-table-column align="left" label="计划门幅" prop="计划门幅" width="90"/> -->
|
|
|
- <el-table-column align="left" label="定额用料" prop="实际门幅" width="90"/>
|
|
|
- <el-table-column align="left" label="定额门幅" prop="定额门幅" width="90"/>
|
|
|
- <el-table-column align="left" label="入库数量" prop="数量" width="90"/>
|
|
|
- <el-table-column align="left" label="入仓总量" prop="入仓总量" width="90"/>
|
|
|
- <el-table-column align="left" label="库存总量" prop="库存数量" width="90"/>
|
|
|
- <el-table-column align="left" label="投料单位" prop="单位" width="90"/>
|
|
|
- <el-table-column align="left" label="部门" prop="departname" width="110"/>
|
|
|
- <el-table-column align="left" label="备注" prop="remark" width="110"/>
|
|
|
- <el-table-column align="left" label="入库人员" prop="操作机台" width="100"/>
|
|
|
- <el-table-column align="left" label="入库日期" prop="日期" width="160"/>
|
|
|
-
|
|
|
+ <!-- <el-table-column align="center" type="selection" width="40"/> -->
|
|
|
+ <el-table-column align="left" label="入库单号" prop="出库单据编号" width="140"/>
|
|
|
+ <!-- <el-table-column align="left" label="批次号" prop="批次号" width="90"/> -->
|
|
|
+ <el-table-column align="left" label="订单编号" prop="订单编号" width="105"/>
|
|
|
+ <!-- <el-table-column align="left" label="客户" prop="客户编号" width="70"/> -->
|
|
|
+ <el-table-column align="left" label="生产款号" prop="款号" width="140"/>
|
|
|
+ <!-- <el-table-column align="left" label="款式" prop="款式" width="120"/> -->
|
|
|
+ <!-- <el-table-column align="left" label="物料编码" prop="物料编码" width="150"/> -->
|
|
|
+ <el-table-column align="left" label="物料名称" prop="物料名称" width="140"/>
|
|
|
+ <el-table-column align="left" label="颜色" prop="BOM_颜色" width="100"/>
|
|
|
+ <!-- <el-table-column align="left" label="计划用料" prop="计划用料" width="90"/> -->
|
|
|
+ <!-- <el-table-column align="left" label="计划门幅" prop="计划门幅" width="90"/> -->
|
|
|
+ <el-table-column align="left" label="计划用料" prop="计划用料" width="90"/>
|
|
|
+ <el-table-column align="left" label="计划门幅" prop="计划门幅" width="90"/>
|
|
|
+ <el-table-column align="left" label="定额用料" prop="定额用料" width="90"/>
|
|
|
+ <el-table-column align="left" label="定额门幅" prop="定额门幅" width="90"/>
|
|
|
+ <el-table-column align="left" label="入库数量" prop="数量" width="90"/>
|
|
|
+ <el-table-column align="left" label="入仓总量" prop="入仓总量" width="90"/>
|
|
|
+ <el-table-column align="left" label="库存总量" prop="库存数量" width="90"/>
|
|
|
+ <el-table-column align="left" label="投料单位" prop="单位" width="90"/>
|
|
|
+ <el-table-column align="left" label="部门" prop="departname" width="110"/>
|
|
|
+ <el-table-column align="left" label="备注" prop="remark" width="300"/>
|
|
|
+ <el-table-column align="left" label="入库人员" prop="操作机台" width="100"/>
|
|
|
+ <el-table-column align="left" label="入库日期" prop="日期" width="100"/>
|
|
|
+ <el-table-column align="left" label="创建日期" prop="创建日期" width="160"/>
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
@@ -119,14 +115,10 @@
|
|
|
<el-dialog v-model="res_bomdialogFormVisible" :before-close="res_bomcloseDialog" style="width: 100%;height: 100%;margin: 0px;padding: 0px;" destroy-on-close>
|
|
|
<div class="dialog-footer" style="margin: 0px;">
|
|
|
<el-button type="primary" @click="res_bomcloseDialog" style="width: 100px;height: 50px;margin-left: 10px;">关 闭</el-button>
|
|
|
- <el-button type="primary" @click="dj_Dialog" style="width: 120px; height: 50px;">
|
|
|
- 添加面料
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" @click="dj_Dialog" style="width: 120px; height: 50px;">添加面料</el-button>
|
|
|
<el-button type="primary" @click="res_bomenterDialog" style="width: 100px;height: 50px;">一键入库</el-button>
|
|
|
</div>
|
|
|
-
|
|
|
<el-divider style='margin: 10px 0px 10px 0px;'><span class="print-title" style="font-size: 18px;">面料入库明细</span></el-divider>
|
|
|
-
|
|
|
<div style="display: flex; gap: 20px; align-items: center;">
|
|
|
<!-- 左部分 -->
|
|
|
<div style="">
|
|
|
@@ -164,9 +156,6 @@
|
|
|
<el-descriptions-item label="生产款号">{{ mianliaotabData.生产款号 }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="颜色">{{ mianliaotabData.颜色 }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="物料名称">{{ mianliaotabData.物料名称 }}</el-descriptions-item>
|
|
|
- <!-- <el-descriptions-item label="计划用料">{{ mianliaotabData.计划用料 }}</el-descriptions-item> -->
|
|
|
- <!-- <el-descriptions-item label="计划门幅">{{ mianliaotabData.计划门幅 }}</el-descriptions-item> -->
|
|
|
- <!-- <el-descriptions-item label="单位">{{ mianliaotabData.单位 }}</el-descriptions-item> -->
|
|
|
<el-descriptions-item label="累计入库数量">{{ mianliaotabData.入仓总数量 }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="库存数量">{{ mianliaotabData.库存数量 }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="单位" >
|
|
|
@@ -176,15 +165,10 @@
|
|
|
<el-radio label="公斤" border >公斤</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-descriptions-item>
|
|
|
- <!-- <el-descriptions-item label="领用数量">{{ mianliaotabData.领用数量 }}</el-descriptions-item> -->
|
|
|
</el-descriptions>
|
|
|
-
|
|
|
<el-descriptions class="margin-top" :column="4" :size="size" border>
|
|
|
- <el-descriptions-item label="定额用料">{{ mianliaotabData.定额用料 }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="定额门幅">{{ mianliaotabData.定额门幅 }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="实际门幅">
|
|
|
- <el-input v-model="mianliaotabData.实际门幅" placeholder="" class="green-bg-item" style="margin: 0; width: 100px; "/>
|
|
|
- </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="计划用料">{{ mianliaotabData.计划用料 }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="计划门幅">{{ mianliaotabData.计划门幅 }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="入库数量" >
|
|
|
<el-input v-model="mianliaotabData.入库数量" id='rksl' placeholder="" class="green-bg-item" style="margin: 0; width: 100px;"/>
|
|
|
</el-descriptions-item>
|
|
|
@@ -238,25 +222,16 @@
|
|
|
<el-table-column align="left" label="批次号" prop="批次号" width="90"/>
|
|
|
<el-table-column align="left" label="关联号" prop="关联号" width="90"/>
|
|
|
<el-table-column align="left" label="订单编号" prop="订单编号" width="110"/>
|
|
|
- <el-table-column align="left" label="客户" prop="客户编号" width="90"/>
|
|
|
+ <!-- <el-table-column align="left" label="客户" prop="客户编号" width="90"/> -->
|
|
|
<el-table-column align="left" label="生产款号" prop="生产款号" width="110"/>
|
|
|
- <el-table-column align="left" label="颜色" prop="颜色" width="90"/>
|
|
|
- <el-table-column align="left" label="物料编号" prop="物料编号" width="160" />
|
|
|
+ <el-table-column align="left" label="颜色" prop="颜色" width="100"/>
|
|
|
+ <!-- <el-table-column align="left" label="物料编号" prop="物料编号" width="160" /> -->
|
|
|
<el-table-column align="left" label="物料名称" prop="物料名称" width="130" />
|
|
|
<el-table-column align="left" label="款式" prop="款式" width="120"/>
|
|
|
- <!-- <el-table-column align="left" label="计划用料" prop="计划用料" width="90"/> -->
|
|
|
- <!-- <el-table-column align="left" label="计划门幅" prop="计划门幅" width="90" /> -->
|
|
|
- <el-table-column align="left" label="定额用料" prop="定额用料" width="90" />
|
|
|
- <el-table-column align="left" label="定额门幅" prop="定额门幅" width="90" />
|
|
|
- <el-table-column align="left" label="实际门幅" prop="实际门幅" width="90"/>
|
|
|
<el-table-column align="left" label="入库数量" prop="入库数量" width="90"/>
|
|
|
- <!-- <el-table-column align="left" label="累计入库数量" prop="入仓总数量" width="110"/>
|
|
|
- <el-table-column align="left" label="库存数量" prop="库存数量" width="90"/> -->
|
|
|
- <!-- <el-table-column align="left" label="领用数量" prop="领用数量" width="90"/> -->
|
|
|
<el-table-column align="left" label="单位" prop="单位" width="60"/>
|
|
|
<el-table-column align="left" label="部门" prop="部门" width="60"/>
|
|
|
- <el-table-column align="left" label="备注" prop="备注" width="210"/>
|
|
|
- <!-- <el-table-column align="left" label="关联订单" prop="关联订单" width="300"/> -->
|
|
|
+ <el-table-column align="left" label="备注" prop="备注" width="300"/>
|
|
|
<el-table-column fixed="right" label="操作" width="120">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-button @click="deleteRow($index)" type="danger" size="small">
|
|
|
@@ -560,11 +535,6 @@ const tableRowClick = async (row) => {
|
|
|
ddhformData.wlbh = row['物料编码'];
|
|
|
ddhformData.ks = row['款式'];
|
|
|
|
|
|
- console.log(row.value);
|
|
|
- console.log(row.关联编号);
|
|
|
- console.log(row.订单编号);
|
|
|
- console.log(row.物料编码);
|
|
|
-
|
|
|
// 获取详情数据
|
|
|
const Detailres = await getInputDetail({
|
|
|
关联编号: row.关联编号,
|
|
|
@@ -574,7 +544,6 @@ const tableRowClick = async (row) => {
|
|
|
|
|
|
console.log(Detailres);
|
|
|
|
|
|
- // 将 Detailres.data 中的数据赋值给 mianliaotabData
|
|
|
if (Detailres.code === 0 && Detailres.data) {
|
|
|
mianliaotabData.value = {
|
|
|
订单编号: row.订单编号,
|
|
|
@@ -586,7 +555,7 @@ const tableRowClick = async (row) => {
|
|
|
关联号: Detailres.data.关联编号,
|
|
|
批次号: Detailres.data.批次号,
|
|
|
计划用料: Detailres.data.计划用料,
|
|
|
- 计划门幅: Detailres.data.BOM_计划门幅,
|
|
|
+ 计划门幅: Detailres.data.计划门幅,
|
|
|
定额用料: Detailres.data.定额用料,
|
|
|
定额门幅: Detailres.data.BOM_定额门幅,
|
|
|
入库数量: Detailres.data.入库数量,
|
|
|
@@ -615,75 +584,69 @@ const tableRowClick = async (row) => {
|
|
|
};
|
|
|
const danjutableData = ref([]); // 使用 ref 定义响应式数组
|
|
|
|
|
|
-//添加按钮
|
|
|
+//添加面料按钮
|
|
|
const dj_Dialog = () => {
|
|
|
console.log(mianliaotabData.value);
|
|
|
- // 确保 mianliaotabData 和 mianliaotabData.value 存在
|
|
|
- if (!mianliaotabData || !mianliaotabData.value) {
|
|
|
- console.error('mianliaotabData 为空,无法添加到 danjutableData');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // 检查入库数量是否为空或无效
|
|
|
- if (
|
|
|
- mianliaotabData.value.入库数量 === '' ||
|
|
|
- mianliaotabData.value.入库数量 === undefined ||
|
|
|
- mianliaotabData.value.入库数量 === '0'
|
|
|
- ) {
|
|
|
- ElMessage({ type: 'warning', message: '请填写入库数量' });
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // 检查定额用料和定额门幅是否为空或无效
|
|
|
+ //判断数据必填规则
|
|
|
if (
|
|
|
- mianliaotabData.value.定额用料 === '' ||
|
|
|
- mianliaotabData.value.定额用料 === undefined ||
|
|
|
- mianliaotabData.value.定额用料 === null ||
|
|
|
- mianliaotabData.value.定额门幅 === '' ||
|
|
|
- mianliaotabData.value.定额门幅 === undefined ||
|
|
|
- mianliaotabData.value.定额门幅 === null
|
|
|
- ) {
|
|
|
- ElMessage({ type: 'warning', message: '技术部维护定额用料、门幅,再进行入库操作' });
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (
|
|
|
- mianliaotabData.value.部门 === '' ||
|
|
|
- mianliaotabData.value.部门 === undefined ||
|
|
|
- mianliaotabData.value.部门 === null
|
|
|
- ){
|
|
|
+ mianliaotabData.value.入库数量 === '' ||
|
|
|
+ mianliaotabData.value.入库数量 === undefined ||
|
|
|
+ mianliaotabData.value.入库数量 === '0'
|
|
|
+ ) {
|
|
|
+ ElMessage({ type: 'warning', message: '请填写入库数量' });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // if (
|
|
|
+ // mianliaotabData.value.计划用料 === '' ||
|
|
|
+ // mianliaotabData.value.计划用料 === undefined ||
|
|
|
+ // mianliaotabData.value.计划用料 === null ||
|
|
|
+ // mianliaotabData.value.计划门幅 === '' ||
|
|
|
+ // mianliaotabData.value.计划门幅 === undefined ||
|
|
|
+ // mianliaotabData.value.计划门幅 === null
|
|
|
+ // ) {
|
|
|
+ // ElMessage({ type: 'warning', message: '业务部需维护计划用料、计划门幅后,再进行入库操作' });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ if (
|
|
|
+ mianliaotabData.value.部门 === '' ||
|
|
|
+ mianliaotabData.value.部门 === undefined ||
|
|
|
+ mianliaotabData.value.部门 === null
|
|
|
+ ){
|
|
|
ElMessage({ type: 'warning', message: '请选择部门' });
|
|
|
return;
|
|
|
- }
|
|
|
-
|
|
|
- // 获取 mianliaotabData 的物料名称和颜色
|
|
|
- const { 物料名称, 颜色, 入库数量, 库存数量 } = mianliaotabData.value;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- // 计算 danjutableData 中相同物料名称和颜色的入库数量总和
|
|
|
- const totalOutbound = danjutableData.value
|
|
|
- .filter(
|
|
|
- (item) =>
|
|
|
- item.物料名称 === 物料名称 && item.颜色 === 颜色
|
|
|
- )
|
|
|
- .reduce((sum, item) => sum + Number(item.入库数量), 0);
|
|
|
|
|
|
- // 计算总入库数量(danjutableData 中的总和 + mianliaotabData 中的入库数量)
|
|
|
- const totalOutboundQuantity = totalOutbound + Number(入库数量);
|
|
|
+ // // 获取 mianliaotabData 的物料名称和颜色
|
|
|
+ // const { 物料名称, 颜色, 入库数量, 库存数量 } = mianliaotabData.value;
|
|
|
|
|
|
+ // // 计算 danjutableData 中相同物料名称和颜色的入库数量总和
|
|
|
+ // const totalOutbound = danjutableData.value
|
|
|
+ // .filter(
|
|
|
+ // (item) =>
|
|
|
+ // item.物料名称 === 物料名称 && item.颜色 === 颜色
|
|
|
+ // )
|
|
|
+ // .reduce((sum, item) => sum + Number(item.入库数量), 0);
|
|
|
|
|
|
+ // // 计算总入库数量(danjutableData 中的总和 + mianliaotabData 中的入库数量)
|
|
|
+ // const totalOutboundQuantity = totalOutbound + Number(入库数量);
|
|
|
|
|
|
- // 如果通过检查,将数据添加到 danjutableData
|
|
|
+ //添加面料至缓存区
|
|
|
danjutableData.value.push({
|
|
|
...mianliaotabData.value,
|
|
|
- 实际门幅: mianliaotabData.value.实际门幅 || mianliaotabData.value.定额门幅,
|
|
|
+ // 实际门幅: mianliaotabData.value.实际门幅 || mianliaotabData.value.定额门幅,
|
|
|
});
|
|
|
+
|
|
|
+ //添加面料至缓存区后清空
|
|
|
mianliaotabData.value.入库数量 = '';
|
|
|
+ mianliaotabData.value.备注 = '';
|
|
|
+ mianliaotabData.value.部门 = '';
|
|
|
// mianliaotabData.value.库存数量 = mianliaotabData.value.库存数量 + Number(入库数量);
|
|
|
};
|
|
|
|
|
|
//操作移除按钮
|
|
|
const deleteRow = (index) => {
|
|
|
- //当前点击索引值
|
|
|
console.log(index)
|
|
|
//移除当前行
|
|
|
danjutableData.value.splice(index, 1);
|
|
|
@@ -705,7 +668,7 @@ const resbom_tableColumns = ref(
|
|
|
{ label: '物料编号', prop: '物料编号', width: '160' },
|
|
|
{ label: '物料名称', prop: '物料名称', width: '100' },
|
|
|
{ label: '计划用料', prop: '计划用料', width: '90' },
|
|
|
- { label: '计划门幅', prop: 'BOM_计划门幅', width: '90' },
|
|
|
+ { label: '计划门幅', prop: '计划门幅', width: '90' },
|
|
|
{ label: '定额用料', prop: '定额用料', width: '90' },
|
|
|
{ label: '定额门幅', prop: 'BOM_定额门幅', width: '90' },
|
|
|
{ label: '实际门幅', prop: '实际门幅', width: '100' },
|
|
|
@@ -806,48 +769,53 @@ const scfjfpxsCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
// 确定
|
|
|
const res_bomenterDialog = async () => {
|
|
|
console.log(danjutableData);
|
|
|
- if(danjutableData.value[0]['入库数量'] === ''|| danjutableData.value[0]['入库数量'] === undefined){
|
|
|
- ElMessage({type: 'warning',message: '入库数量不能为空'})
|
|
|
- return
|
|
|
- }
|
|
|
- //日期转换
|
|
|
-let lhrq_formattedDeliveryDate = '';
|
|
|
+ // if(danjutableData.value[0]['入库数量'] === ''|| danjutableData.value[0]['入库数量'] === undefined){
|
|
|
+ // ElMessage({type: 'warning',message: '入库数量不能为空'})
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+
|
|
|
+ //入库日期转换
|
|
|
+ let lhrq_formattedDeliveryDate = '';
|
|
|
if (riqi.value) {
|
|
|
const date = new Date(riqi.value);
|
|
|
lhrq_formattedDeliveryDate = `${date.getFullYear()}-${('0' + (date.getMonth() + 1)).slice(-2)}-${('0' + date.getDate()).slice(-2)}`;
|
|
|
}
|
|
|
- // 构造一个包含所有数据的数组
|
|
|
- const formattedDataArray = danjutableData.value.map(item => ({
|
|
|
- order_id: item['订单编号'],
|
|
|
- 款号: item['生产款号'],
|
|
|
- 物料编码: item['物料编号'],
|
|
|
- 物料名称: item['物料名称'],
|
|
|
- number: item['入库数量'],
|
|
|
- name: "入库",
|
|
|
- sys_id: userStore.userInfo.nickName,
|
|
|
- receipt_number: danhao.value,
|
|
|
- 客户编号: item['客户编号'],
|
|
|
- 款式: item['款式'],
|
|
|
- rq: lhrq_formattedDeliveryDate,
|
|
|
- 批次号: item['批次号'],
|
|
|
- 关联编号: item['关联号'],
|
|
|
- departname: item['部门'],
|
|
|
- remark: item['备注'],
|
|
|
- 实际门幅: item['实际门幅'],
|
|
|
- 单位: item['单位'],
|
|
|
- }));
|
|
|
- console.log(formattedDataArray);
|
|
|
+
|
|
|
+ //将数据存入数组中,给到接到插入数据
|
|
|
+ const formattedDataArray = danjutableData.value.map(item => ({
|
|
|
+ order_id: item['订单编号'],
|
|
|
+ 款号: item['生产款号'],
|
|
|
+ 物料编码: item['物料编号'],
|
|
|
+ 物料名称: item['物料名称'],
|
|
|
+ number: item['入库数量'],
|
|
|
+ name: "入库",
|
|
|
+ sys_id: userStore.userInfo.nickName,
|
|
|
+ receipt_number: danhao.value,
|
|
|
+ 客户编号: item['客户编号'],
|
|
|
+ 款式: item['款式'],
|
|
|
+ rq: lhrq_formattedDeliveryDate,
|
|
|
+ 批次号: item['批次号'],
|
|
|
+ 关联编号: item['关联号'],
|
|
|
+ departname: item['部门'],
|
|
|
+ remark: item['备注'],
|
|
|
+ 实际门幅: item['实际门幅'],
|
|
|
+ 单位: item['单位'],
|
|
|
+ }));
|
|
|
+ console.log(formattedDataArray);
|
|
|
+
|
|
|
try {
|
|
|
- // 异步调用输入数据的接口
|
|
|
+ //新增入库接口调用
|
|
|
const add_inputStash = await inputStash(formattedDataArray);
|
|
|
- // 根据返回的 code 进行提示
|
|
|
if (add_inputStash.code === 0) {
|
|
|
res_bomdialogFormVisible.value = false;
|
|
|
add_searchInfo.value = '';
|
|
|
restableData.splice(0, restableData.length);
|
|
|
ElMessage({ type: 'success', message: '入库成功' });
|
|
|
- danjutableData.value.splice(0, danjutableData.value.length); // 清空表格数据
|
|
|
+ //清空暂存区表格数据
|
|
|
+ danjutableData.value.splice(0, danjutableData.value.length);
|
|
|
+ //刷新左侧菜单栏确保最新数据
|
|
|
getTreeData();
|
|
|
+ //刷新表格确保最新数据
|
|
|
records_onSubmit();
|
|
|
} else {
|
|
|
ElMessage({ type: 'error', message: '入库失败' });
|