|
|
@@ -72,19 +72,23 @@
|
|
|
<el-table-column prop="goods_vo.name" label="商品名称" />
|
|
|
<el-table-column prop="product_vo.sku" label="SKU" />
|
|
|
<el-table-column prop="orderNum" label="订单数量" />
|
|
|
- <el-table-column prop="num" :style="{ color: 'red' }" label="出库数量" />
|
|
|
+ <el-table-column prop="num" :style="{ color: 'red' }" label="出库数量" />
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
|
|
|
</el-tabs>
|
|
|
- <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" inputmode="none" ref="inputRef" @keyup.enter="toSearch()" />
|
|
|
+ <el-input v-model="snCodeForm.bar_code" :inputmode="inputmode" ref="inputRef"
|
|
|
+ @keyup.enter="toSearch()">
|
|
|
+ <template #append> <el-button @click="getInfo">搜索</el-button> </template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="序列号">
|
|
|
- <el-input v-model="snCodeForm.sn_code" inputmode="none" ref="snInputRef" @keyup.enter="toSnCode()" />
|
|
|
+ <el-input v-model="snCodeForm.sn_code" inputmode="none" ref="snInputRef"
|
|
|
+ @keyup.enter="toSnCode()" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- <template #footer>
|
|
|
@@ -126,6 +130,7 @@ const defaultTime = new Date(2000, 1, 1, 12, 0, 0)
|
|
|
let dialogVisible = ref(false)
|
|
|
const tableData = ref([])
|
|
|
let barcodeValue = ref('')
|
|
|
+let inputmode = ref('none')
|
|
|
const router = useRouter();
|
|
|
const route = useRoute()
|
|
|
const activeTab = ref('product-info');
|
|
|
@@ -202,7 +207,7 @@ const params: any = ref({
|
|
|
warehouse_id: '',
|
|
|
goods_num: '',
|
|
|
})
|
|
|
-let isReadOnly:any=ref(false)
|
|
|
+let isReadOnly: any = ref(false)
|
|
|
let sku = ref('');
|
|
|
watch(activeTab, (newValue, oldValue) => {
|
|
|
console.log(`Tab changed from ${oldValue} to ${newValue}`);
|
|
|
@@ -214,6 +219,10 @@ const toggleReadOnly = () => {
|
|
|
const enableVirtualKeyboard = (event) => {
|
|
|
event.target.readOnly = false;
|
|
|
};
|
|
|
+const getInfo = () => {
|
|
|
+ inputmode.value = 'text'
|
|
|
+ inputRef.value.focus();
|
|
|
+}
|
|
|
/* 扫sku */
|
|
|
const toSearch = async () => {
|
|
|
activeTab.value = 'product-info'
|
|
|
@@ -237,7 +246,6 @@ const toSearch = async () => {
|
|
|
el.product_id === res.data.product_id &&
|
|
|
el.product_vo.sku === res.data.product_vo.sku
|
|
|
));
|
|
|
- console.log(existingProduct);
|
|
|
if (!existingProduct) {
|
|
|
//ElMessageBox.error('订单内没有该商品,请重新录入');
|
|
|
nextTick(() => {
|
|
|
@@ -258,10 +266,12 @@ const toSearch = async () => {
|
|
|
});
|
|
|
} else {
|
|
|
shippingForm.value.order_item_vos[index.value].num += 1
|
|
|
+ snCodeForm.bar_code = ''
|
|
|
//dialogVisible.value = false;
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('Error fetching product:', error);
|
|
|
+ snCodeForm.bar_code = ''
|
|
|
}
|
|
|
};
|
|
|
//扫描序列号
|
|
|
@@ -279,7 +289,10 @@ const toSnCode = async () => {
|
|
|
);
|
|
|
|
|
|
if (!exists) {
|
|
|
- shippingForm.value.order_item_vos[index.value].sn_code_list.push(res.data);
|
|
|
+ /* 请求保存 */
|
|
|
+ infoApi.skuRedis({ send_order_id: id.value, item_id: shippingForm.value.order_item_vos[index.value].id, sku: res.data }).then((res: any) => {
|
|
|
+ shippingForm.value.order_item_vos[index.value].sn_code_list.push(res.data);
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
shippingForm.value.order_item_vos[index.value].num = shippingForm.value.order_item_vos[index.value].sn_code_list.length;
|
|
|
@@ -442,14 +455,27 @@ const init = async () => {
|
|
|
try {
|
|
|
const res: any = await orderApi.getSendOrderDetail(id.value);
|
|
|
if (res && res.data && res.data.order_vo && res.data.order_vo.sn) {
|
|
|
- res.data.order_item_vos.map(el => {
|
|
|
- params.value.total_weight = Number(
|
|
|
- el.product_vo.weight * el.num
|
|
|
- );
|
|
|
- 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.order_item_vos.map((el: any) => {
|
|
|
+ params.value.total_weight = Number(
|
|
|
+ el.product_vo.weight * el.num
|
|
|
+ );
|
|
|
+ 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 = []
|
|
|
+ } else {
|
|
|
+ /* el.num = el.sn_code_list.length */
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
+ console.log(params);
|
|
|
barcodeValue.value = res.data.order_vo.sn;
|
|
|
//物品价格
|
|
|
if (res.data.total_volume !== undefined) {
|