|
@@ -198,8 +198,8 @@
|
|
|
<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="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="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="300"/>
|
|
<el-table-column align="left" label="关联订单" prop="关联订单" width="300"/>
|
|
@@ -278,7 +278,7 @@
|
|
|
import {ref, reactive} from 'vue'
|
|
import {ref, reactive} from 'vue'
|
|
|
import {getInputDetail,
|
|
import {getInputDetail,
|
|
|
TuihuoReport,
|
|
TuihuoReport,
|
|
|
- InputOrderSearch,outReport,FabricDetail,gitReceiptNumber,FabricDetaillist,FabricDetaildel,ReceiptList,ReceiptDetail} from '@/api/mes/job'
|
|
|
|
|
|
|
+ OutOrderSearch,outReport,FabricDetail,gitReceiptNumber,FabricDetaillist,FabricDetaildel,ReceiptList,ReceiptDetail} from '@/api/mes/job'
|
|
|
import { ElMessage, ElMessageBox,ElUpload, ElButton } from 'element-plus';
|
|
import { ElMessage, ElMessageBox,ElUpload, ElButton } from 'element-plus';
|
|
|
import { useUserStore } from '@/pinia/modules/user'
|
|
import { useUserStore } from '@/pinia/modules/user'
|
|
|
// import { get } from 'scriptjs';
|
|
// import { get } from 'scriptjs';
|
|
@@ -325,7 +325,7 @@
|
|
|
const handleInput = async ()=>{
|
|
const handleInput = async ()=>{
|
|
|
restableData.splice(0, restableData.length);//清空表格
|
|
restableData.splice(0, restableData.length);//清空表格
|
|
|
//订单信息数据查询【接口】
|
|
//订单信息数据查询【接口】
|
|
|
- const orderSearchdata = await InputOrderSearch({search:add_searchInfo.value});
|
|
|
|
|
|
|
+ const orderSearchdata = await OutOrderSearch({search:add_searchInfo.value});
|
|
|
if(orderSearchdata.data.length === 1){
|
|
if(orderSearchdata.data.length === 1){
|
|
|
_orderid.value = orderSearchdata.data[0]['订单编号']
|
|
_orderid.value = orderSearchdata.data[0]['订单编号']
|
|
|
add_searchInfo.value = orderSearchdata.data[0]['订单编号']
|
|
add_searchInfo.value = orderSearchdata.data[0]['订单编号']
|
|
@@ -335,7 +335,7 @@
|
|
|
ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
|
add_lysearchInfo.value = add_searchInfo.value
|
|
add_lysearchInfo.value = add_searchInfo.value
|
|
|
|
|
|
|
|
- const gitReceiptNumberdata = await gitReceiptNumber({number:'CK'});
|
|
|
|
|
|
|
+ const gitReceiptNumberdata = await gitReceiptNumber({number:'TH'});
|
|
|
danhao.value = gitReceiptNumberdata.data.number
|
|
danhao.value = gitReceiptNumberdata.data.number
|
|
|
chukuren.value = userStore.userInfo.nickName
|
|
chukuren.value = userStore.userInfo.nickName
|
|
|
riqi.value = currentDates
|
|
riqi.value = currentDates
|
|
@@ -348,7 +348,7 @@
|
|
|
const add_onSubmit = async ()=>{
|
|
const add_onSubmit = async ()=>{
|
|
|
//清空表格
|
|
//清空表格
|
|
|
restableData.splice(0, restableData.length);
|
|
restableData.splice(0, restableData.length);
|
|
|
- const orderSearchdata = await InputOrderSearch({search:add_searchInfo.value});
|
|
|
|
|
|
|
+ const orderSearchdata = await OutOrderSearch({search:add_searchInfo.value});
|
|
|
if(orderSearchdata.data.length === 1){
|
|
if(orderSearchdata.data.length === 1){
|
|
|
res_bomdialogFormVisible.value = true
|
|
res_bomdialogFormVisible.value = true
|
|
|
_orderid.value = orderSearchdata.data[0]['订单编号']
|
|
_orderid.value = orderSearchdata.data[0]['订单编号']
|
|
@@ -359,7 +359,7 @@
|
|
|
ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
|
add_lysearchInfo.value = add_searchInfo.value
|
|
add_lysearchInfo.value = add_searchInfo.value
|
|
|
|
|
|
|
|
- const gitReceiptNumberdata = await gitReceiptNumber({number:'CK'});
|
|
|
|
|
|
|
+ const gitReceiptNumberdata = await gitReceiptNumber({number:'TH'});
|
|
|
console.log(gitReceiptNumberdata)
|
|
console.log(gitReceiptNumberdata)
|
|
|
danhao.value = gitReceiptNumberdata.data.number
|
|
danhao.value = gitReceiptNumberdata.data.number
|
|
|
chukuren.value = userStore.userInfo.nickName
|
|
chukuren.value = userStore.userInfo.nickName
|
|
@@ -437,7 +437,7 @@
|
|
|
定额用料: Detailres.data.定额用料,
|
|
定额用料: Detailres.data.定额用料,
|
|
|
定额门幅: Detailres.data.BOM_定额门幅,
|
|
定额门幅: Detailres.data.BOM_定额门幅,
|
|
|
退还数量: Detailres.data.退还数量,
|
|
退还数量: Detailres.data.退还数量,
|
|
|
- 入仓总数量: Detailres.data.入仓总量?Detailres.data.入仓总量:0,
|
|
|
|
|
|
|
+ 入仓总数量: Detailres.data.退还数量?Detailres.data.退还数量:0,
|
|
|
库存数量: Detailres.data.库存数量?Detailres.data.库存数量:0,
|
|
库存数量: Detailres.data.库存数量?Detailres.data.库存数量:0,
|
|
|
领用数量: Detailres.data.领用数量,
|
|
领用数量: Detailres.data.领用数量,
|
|
|
关联订单: Detailres.data.关联订单,
|
|
关联订单: Detailres.data.关联订单,
|
|
@@ -445,6 +445,17 @@
|
|
|
单位:'米',
|
|
单位:'米',
|
|
|
实际门幅:Detailres.data.实际门幅
|
|
实际门幅:Detailres.data.实际门幅
|
|
|
};
|
|
};
|
|
|
|
|
+ // 计算 danjutableData 中相同物料名称和颜色的退还数量总和
|
|
|
|
|
+ const { 物料名称, 颜色 } = mianliaotabData.value;
|
|
|
|
|
+ const totalOutbound = danjutableData.value
|
|
|
|
|
+ .filter(
|
|
|
|
|
+ (item) =>
|
|
|
|
|
+ item.物料名称 === 物料名称 && item.颜色 === 颜色
|
|
|
|
|
+ )
|
|
|
|
|
+ .reduce((sum, item) => sum + Number(item.退还数量), 0);
|
|
|
|
|
+
|
|
|
|
|
+ // 更新 mianliaotabData 的库存数量
|
|
|
|
|
+ mianliaotabData.value.库存数量 -= totalOutbound;
|
|
|
} else {
|
|
} else {
|
|
|
console.error('获取详情数据失败:', Detailres.msg);
|
|
console.error('获取详情数据失败:', Detailres.msg);
|
|
|
}
|
|
}
|
|
@@ -453,19 +464,50 @@
|
|
|
|
|
|
|
|
//添加按钮
|
|
//添加按钮
|
|
|
const dj_Dialog = () => {
|
|
const dj_Dialog = () => {
|
|
|
- if (mianliaotabData.value) {
|
|
|
|
|
- // 判断实际门幅是否为空
|
|
|
|
|
- const 实际门幅 = mianliaotabData.value.实际门幅 || mianliaotabData.value.定额门幅;
|
|
|
|
|
-
|
|
|
|
|
- // 将 mianliaotabData 的数据添加到 danjutableData
|
|
|
|
|
- danjutableData.value.push({
|
|
|
|
|
- ...mianliaotabData.value, // 展开 mianliaotabData 的所有属性
|
|
|
|
|
- 实际门幅, // 使用计算后的实际门幅
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- console.error('mianliaotabData 为空,无法添加到 danjutableData');
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // 确保 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;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取 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(退还数量);
|
|
|
|
|
+
|
|
|
|
|
+ // 判断总退还数量是否大于库存数量
|
|
|
|
|
+ if (totalOutboundQuantity > 库存数量) {
|
|
|
|
|
+ ElMessage({ type: 'warning', message: '退还数量不能大于库存数量' });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 如果通过检查,将数据添加到 danjutableData
|
|
|
|
|
+ danjutableData.value.push({
|
|
|
|
|
+ ...mianliaotabData.value,
|
|
|
|
|
+ 实际门幅: mianliaotabData.value.实际门幅 || mianliaotabData.value.定额门幅,
|
|
|
|
|
+ });
|
|
|
|
|
+ mianliaotabData.value.退还数量 = '';
|
|
|
|
|
+ mianliaotabData.value.库存数量 = mianliaotabData.value.库存数量 - Number(退还数量);
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
//操作移除按钮
|
|
//操作移除按钮
|
|
|
const deleteRow = (index) => {
|
|
const deleteRow = (index) => {
|
|
@@ -525,7 +567,7 @@
|
|
|
}, 100);//100毫秒
|
|
}, 100);//100毫秒
|
|
|
|
|
|
|
|
//获取单据编号接口
|
|
//获取单据编号接口
|
|
|
- const gitReceiptNumberdata = await gitReceiptNumber({number:'CK'});
|
|
|
|
|
|
|
+ const gitReceiptNumberdata = await gitReceiptNumber({number:'TH'});
|
|
|
danhao.value = gitReceiptNumberdata.data.number
|
|
danhao.value = gitReceiptNumberdata.data.number
|
|
|
chukuren.value = userStore.userInfo.nickName
|
|
chukuren.value = userStore.userInfo.nickName
|
|
|
riqi.value = currentDates
|
|
riqi.value = currentDates
|