|
|
@@ -33,14 +33,15 @@
|
|
|
<el-table-column prop="orderNum" :style="{ color: 'red' }" label="待入库数量" />
|
|
|
</el-table>
|
|
|
</el-form>
|
|
|
- <el-dialog v-model="dialogVisible" :modal=false title="扫码入库" :close-on-click-modal="false" top="80px" width="90%" style="height: 200px"
|
|
|
- :before-close="handleClose">
|
|
|
+ <el-dialog v-model="dialogVisible" :modal=false title="扫码入库" :close-on-click-modal="false" top="80px"
|
|
|
+ width="90%" style="height: 200px" :before-close="handleClose">
|
|
|
<el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
|
|
|
<el-form-item label="SKU">
|
|
|
<el-input v-model="snCodeForm.bar_code" ref="inputRef" inputmode="none" @keyup.enter="toSearch()" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="序列号">
|
|
|
- <el-input v-model="snCodeForm.sn_code" ref="snInputRef" inputmode="none" @keyup.enter="toSnCode()" />
|
|
|
+ <el-input v-model="snCodeForm.sn_code" ref="snInputRef" inputmode="none"
|
|
|
+ @keyup.enter="toSnCode()" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- <template #footer>
|
|
|
@@ -179,7 +180,10 @@ const toSnCode = async () => {
|
|
|
);
|
|
|
|
|
|
if (!exists) {
|
|
|
- goodsExchangeAddForm.product_list[index.value].sn_code_list.push(res.data);
|
|
|
+ await infoApi.skuRedis({ send_order_id: id.value, item_id: goodsExchangeAddForm.product_list[index.value].id, sku: res.data }).then((respons: any) => {
|
|
|
+ /* shippingForm.value.order_item_vos[index.value].sn_code_list.push(res.data); */
|
|
|
+ goodsExchangeAddForm.product_list[index.value].sn_code_list.push(res.data);
|
|
|
+ })
|
|
|
}
|
|
|
goodsExchangeAddForm.product_list[index.value].num = goodsExchangeAddForm.product_list[index.value].sn_code_list.length;
|
|
|
snCodeForm.bar_code = "";
|
|
|
@@ -235,7 +239,7 @@ const getOrderNumber = async (formEl: FormInstance | undefined) => {
|
|
|
el.product_id = el.product_vo.id;
|
|
|
el.id = "";
|
|
|
});
|
|
|
- entryOutAPI.addWarehouseEntry(id.value,goodsExchangeAddForm).then(res => {
|
|
|
+ entryOutAPI.addWarehouseEntry(id.value, goodsExchangeAddForm).then(res => {
|
|
|
ElMessage.success("入库成功!");
|
|
|
router.replace({
|
|
|
name: 'InoutStorage',
|
|
|
@@ -261,7 +265,7 @@ const save = async (formEl: FormInstance | undefined) => {
|
|
|
el.product_id = el.product_vo.id;
|
|
|
el.id = "";
|
|
|
});
|
|
|
- entryOutAPI.addWarehouseEntry(id.value,goodsExchangeAddForm).then(res => {
|
|
|
+ entryOutAPI.addWarehouseEntry(id.value, goodsExchangeAddForm).then(res => {
|
|
|
ElMessage.success("保存成功!");
|
|
|
router.replace({
|
|
|
name: 'InoutStorage',
|
|
|
@@ -278,10 +282,20 @@ const ship = () => {
|
|
|
const init = async () => {
|
|
|
try {
|
|
|
const res: any = await entryOutAPI.warehouseEntry(id.value);
|
|
|
- res.data.product_list.map(el => {
|
|
|
- el.orderNum = el.num
|
|
|
- el.num=0
|
|
|
- el.sn_code_list = []
|
|
|
+ await infoApi.skuRedis({ send_order_id: id.value, type: 'enter' }).then((response: any) => {
|
|
|
+ res.data.product_list.map(el => {
|
|
|
+ el.orderNum = el.num
|
|
|
+ el.num = 0
|
|
|
+ Object.keys(response.data).map(item => {
|
|
|
+ if (el.id == item) {
|
|
|
+ el.sn_code_list = response.data[item]
|
|
|
+ el.num = el.sn_code_list.length
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (!el.sn_code_list) {
|
|
|
+ el.sn_code_list = []
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
goodsExchangeAddForm.warehouse_id = res.data.warehouse_id;
|
|
|
goodsExchangeAddForm.type = res.data.type;
|