|
|
|
@ -175,7 +175,7 @@ |
|
|
|
class="table-row" |
|
|
|
> |
|
|
|
<div class="col-no">{{ index + 1 }}</div> |
|
|
|
<div class="col-material-code">{{ item.materialCode || item.partNo }}</div> |
|
|
|
<div class="col-material-code clickable-part" @click="showStockDialogFn(item)">{{ item.materialCode || item.partNo }}</div> |
|
|
|
<div class="col-required-qty">{{ item.labelCount || 0 }}</div> |
|
|
|
<div class="col-inbound-qty">{{ item.totalinLabels || 0 }}</div> |
|
|
|
</div> |
|
|
|
@ -194,11 +194,58 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 可用库存弹窗 --> |
|
|
|
<div v-if="showStockDialog" class="stock-overlay"> |
|
|
|
<div class="stock-modal"> |
|
|
|
<div class="modal-header"> |
|
|
|
<span class="modal-title">可用库存 - {{ currentPartNo }}</span> |
|
|
|
<i class="el-icon-close close-btn" @click="closeStockDialog"></i> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-body"> |
|
|
|
<div v-if="stockLoading" class="loading-container"> |
|
|
|
<i class="el-icon-loading"></i> |
|
|
|
<span>加载中...</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-else-if="stockList.length > 0" class="stock-table"> |
|
|
|
<div class="table-header"> |
|
|
|
<div class="col-roll-no">标签条码</div> |
|
|
|
<div class="col-qty">数量</div> |
|
|
|
<div class="col-location">库位</div> |
|
|
|
<div class="col-batch">合约号码</div> |
|
|
|
<div class="col-date">入库日期</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="table-body"> |
|
|
|
<div v-for="(item, index) in stockList" :key="index" class="table-row"> |
|
|
|
<div class="col-roll-no">{{ item.rollNo }}</div> |
|
|
|
<div class="col-qty">{{ item.rollQty }} <span class="unit-text">{{ item.um }}</span></div> |
|
|
|
<div class="col-location">{{ item.location }}</div> |
|
|
|
<div class="col-batch">{{ item.batchNo }}</div> |
|
|
|
<div class="col-date">{{ item.daysInStock }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-else class="empty-stock"> |
|
|
|
<i class="el-icon-box"></i> |
|
|
|
<p>暂无可用库存</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-footer"> |
|
|
|
<button class="btn-close" @click="closeStockDialog">关闭</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { getSalesReturnDetails, validateLabelWithSalesReturn, confirmSalesReturnStorage, getSalesReturnMaterialList, getScannedLabelList } from "@/api/salesReturn.js"; |
|
|
|
import { getInventoryStock } from "@/api/inbound.js"; |
|
|
|
import { getCurrentWarehouse } from '@/utils' |
|
|
|
import moment from 'moment'; |
|
|
|
export default { |
|
|
|
@ -214,7 +261,12 @@ export default { |
|
|
|
showMaterialDialog: false, |
|
|
|
materialList: [], |
|
|
|
materialListLoading: false, |
|
|
|
isRemoveMode: false // 默认为添加模式 |
|
|
|
isRemoveMode: false, // 默认为添加模式 |
|
|
|
// 可用库存弹窗相关 |
|
|
|
showStockDialog: false, |
|
|
|
stockList: [], |
|
|
|
stockLoading: false, |
|
|
|
currentPartNo: '' |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -427,6 +479,54 @@ export default { |
|
|
|
this.showMaterialDialog = false; |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示可用库存弹窗 |
|
|
|
showStockDialogFn(item) { |
|
|
|
this.currentPartNo = item.materialCode || item.partNo; |
|
|
|
this.showStockDialog = true; |
|
|
|
this.loadInventoryStock(this.currentPartNo); |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载物料可用库存 |
|
|
|
loadInventoryStock(partNo) { |
|
|
|
this.stockLoading = true; |
|
|
|
const params = { |
|
|
|
site: this.materialInfo.site, |
|
|
|
notifyNo: this.returnNo, |
|
|
|
notifyType: '销售退货', |
|
|
|
orderNo: '', |
|
|
|
orderLineNo: '', |
|
|
|
partNo: partNo, |
|
|
|
warehouseId: this.getCurrentWarehouse() |
|
|
|
}; |
|
|
|
|
|
|
|
getInventoryStock(params).then(({ data }) => { |
|
|
|
this.stockLoading = false; |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.stockList = data.data || []; |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '获取可用库存失败'); |
|
|
|
this.stockList = []; |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.stockLoading = false; |
|
|
|
console.error('获取可用库存失败:', error); |
|
|
|
this.$message.error('获取可用库存失败'); |
|
|
|
this.stockList = []; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 关闭可用库存弹窗 |
|
|
|
closeStockDialog() { |
|
|
|
this.showStockDialog = false; |
|
|
|
this.stockList = []; |
|
|
|
this.currentPartNo = ''; |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取当前仓库 |
|
|
|
getCurrentWarehouse() { |
|
|
|
return localStorage.getItem('warehouseId') || ''; |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载退货单详情 |
|
|
|
loadReturnDetails() { |
|
|
|
const params = { |
|
|
|
@ -1187,6 +1287,31 @@ export default { |
|
|
|
word-break: break-all; |
|
|
|
} |
|
|
|
|
|
|
|
/* 可点击的物料编码样式 */ |
|
|
|
.clickable-part { color: #17B3A3; font-weight: 500; cursor: pointer; text-decoration: underline; } |
|
|
|
.clickable-part:hover { color: #0d8f7f; } |
|
|
|
|
|
|
|
/* 可用库存弹窗样式 */ |
|
|
|
.stock-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; } |
|
|
|
.stock-modal { background: white; border-radius: 12px; width: 100%; max-width: 800px; max-height: 80vh; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); overflow: hidden; display: flex; flex-direction: column; } |
|
|
|
.stock-modal .modal-header { background: #17B3A3; color: white; padding: 5px 16px; display: flex; justify-content: space-between; align-items: center; min-height: 28px; } |
|
|
|
.stock-modal .modal-body { flex: 1; overflow: auto; padding: 0; } |
|
|
|
.stock-table { width: 100%; } |
|
|
|
.stock-table .table-header { display: flex; background: #f8f9fa; padding: 10px 6px; border-bottom: 2px solid #17B3A3; font-size: 12px; color: #333; font-weight: 600; position: sticky; top: 0; z-index: 1; } |
|
|
|
.stock-table .table-body { max-height: 400px; overflow-y: auto; } |
|
|
|
.stock-table .table-row { display: flex; padding: 10px 6px; border-bottom: 1px solid #f0f0f0; font-size: 12px; color: #333; } |
|
|
|
.stock-table .table-row:hover { background-color: #f8f9fa; } |
|
|
|
.stock-table .col-roll-no { flex: 1.5; text-align: center; min-width: 100px; font-size: 12px; } |
|
|
|
.stock-table .col-qty { flex: 0.8; text-align: center; min-width: 60px; font-size: 12px; } |
|
|
|
.unit-text { color: #999; font-size: 11px; margin-left: 2px; } |
|
|
|
.stock-table .col-location { flex: 0.8; text-align: center; min-width: 60px; font-size: 12px; } |
|
|
|
.stock-table .col-batch { flex: 1; text-align: center; min-width: 80px; font-size: 12px; } |
|
|
|
.stock-table .col-date { flex: 1; text-align: center; min-width: 80px; font-size: 12px; } |
|
|
|
.stock-modal .modal-footer { padding: 15px 20px; display: flex; justify-content: center; border-top: 1px solid #f0f0f0; } |
|
|
|
.empty-stock { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: #999; } |
|
|
|
.empty-stock i { font-size: 48px; margin-bottom: 16px; color: #ddd; } |
|
|
|
.empty-stock p { margin: 0; font-size: 14px; } |
|
|
|
|
|
|
|
.material-table .col-required-qty { |
|
|
|
flex: 0.8; |
|
|
|
text-align: center; |
|
|
|
|