|
@@ -29,8 +29,9 @@
|
|
|
<p>地址:{{ shippingForm.order_vo.province_city_area_address }}</p>
|
|
<p>地址:{{ shippingForm.order_vo.province_city_area_address }}</p>
|
|
|
<p>客户备注:{{ shippingForm.order_vo.remark }}</p>
|
|
<p>客户备注:{{ shippingForm.order_vo.remark }}</p>
|
|
|
<p v-if="send_type.value !== 'EXPRESS_DELIVERY'">
|
|
<p v-if="send_type.value !== 'EXPRESS_DELIVERY'">
|
|
|
- <span v-if="shippingForm.order_vo.send_type !== 'SELF_PICKUP'">运单号:{{ shippingForm.kdn_order_code }}</span>
|
|
|
|
|
- <span v-else>自提单号:{{ shippingForm.self_pickup_num }}</span>
|
|
|
|
|
|
|
+ <span v-if="shippingForm.order_vo.send_type !== 'SELF_PICKUP'">运单号:{{
|
|
|
|
|
+ shippingForm.kdn_order_code }}</span>
|
|
|
|
|
+ <span v-else>自提单号:{{ shippingForm.self_pickup_num }}</span>
|
|
|
</p>
|
|
</p>
|
|
|
<div v-else>
|
|
<div v-else>
|
|
|
<p>
|
|
<p>
|
|
@@ -52,9 +53,9 @@
|
|
|
:minlength="1" style="width: 170px" :maxlength="20" type="number" max="50" clearable
|
|
:minlength="1" style="width: 170px" :maxlength="20" type="number" max="50" clearable
|
|
|
placeholder="请输入物品总重量"><template #append>KG</template></el-input>
|
|
placeholder="请输入物品总重量"><template #append>KG</template></el-input>
|
|
|
</p>
|
|
</p>
|
|
|
- <p class="mt-1 mb-1">物品总体积: <el-input v-model="params.total_volume" size="small" :minlength="1"
|
|
|
|
|
- style="width: 170px" :maxlength="20" clearable placeholder="请输入物品总体积"><template
|
|
|
|
|
- #append>m³</template></el-input>
|
|
|
|
|
|
|
+ <p class="mt-1 mb-1">物品总体积: <el-input v-model="params.total_volume" ref="totalInput" size="small"
|
|
|
|
|
+ :minlength="1" style="width: 170px" :maxlength="20" clearable
|
|
|
|
|
+ placeholder="请输入物品总体积"><template #append>m³</template></el-input>
|
|
|
</p>
|
|
</p>
|
|
|
<p>物品价格: <el-input v-model="params.declared_value" size="small" :minlength="1" style="width: 170px"
|
|
<p>物品价格: <el-input v-model="params.declared_value" size="small" :minlength="1" style="width: 170px"
|
|
|
:maxlength="20" clearable placeholder="请输入物品价格"><template #append>元</template></el-input>
|
|
:maxlength="20" clearable placeholder="请输入物品价格"><template #append>元</template></el-input>
|
|
@@ -96,13 +97,12 @@
|
|
|
</template> -->
|
|
</template> -->
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
<div class="flex justify-center pt-2 pb-2 mt-4 w-full fixed bottom-0 bg-white left-0"
|
|
<div class="flex justify-center pt-2 pb-2 mt-4 w-full fixed bottom-0 bg-white left-0"
|
|
|
- v-if="send_type.value == 'EXPRESS_DELIVERY'">
|
|
|
|
|
|
|
+ v-if="send_type.value !== 'EXPRESS_DELIVERY'">
|
|
|
<el-button type="primary" size="large" @click="scanCode">扫码出库</el-button>
|
|
<el-button type="primary" size="large" @click="scanCode">扫码出库</el-button>
|
|
|
<el-button type="primary" size="large"
|
|
<el-button type="primary" size="large"
|
|
|
v-if="shippingForm.kdn_order_code == '' || shippingForm.kdn_order_code == undefined"
|
|
v-if="shippingForm.kdn_order_code == '' || shippingForm.kdn_order_code == undefined"
|
|
|
@click="getOrderNumber">获取运单号</el-button>
|
|
@click="getOrderNumber">获取运单号</el-button>
|
|
|
- <el-button type="primary" size="large" v-if="shippingForm.kdn_order_code !== undefined"
|
|
|
|
|
- @click="ship">发货</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" size="large" v-else @click="ship">发货</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex justify-center pt-2 pb-2 mt-4 w-full fixed bottom-0 bg-white left-0" v-else>
|
|
<div class="flex justify-center pt-2 pb-2 mt-4 w-full fixed bottom-0 bg-white left-0" v-else>
|
|
|
<el-button type="primary" size="large" @click="scanCode">扫码出库</el-button>
|
|
<el-button type="primary" size="large" @click="scanCode">扫码出库</el-button>
|
|
@@ -128,7 +128,7 @@ const tableData = ref([])
|
|
|
let barcodeValue = ref('')
|
|
let barcodeValue = ref('')
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
-const activeTab = ref('basic-info');
|
|
|
|
|
|
|
+const activeTab = ref('product-info');
|
|
|
const id = ref(route.params.id);
|
|
const id = ref(route.params.id);
|
|
|
const send_type = ref(route.params.send_type);
|
|
const send_type = ref(route.params.send_type);
|
|
|
let shippingForm: any = ref({
|
|
let shippingForm: any = ref({
|
|
@@ -162,7 +162,7 @@ const snCodeForm = reactive({
|
|
|
bar_code: "",
|
|
bar_code: "",
|
|
|
sn_code: '',
|
|
sn_code: '',
|
|
|
})
|
|
})
|
|
|
-const inputRef = ref<any>(null);
|
|
|
|
|
|
|
+const inputRef = ref();
|
|
|
const snInputRef = ref<any>(null)
|
|
const snInputRef = ref<any>(null)
|
|
|
const customerList: any = ref([])//初始化客户列表
|
|
const customerList: any = ref([])//初始化客户列表
|
|
|
const warehouseList: any = ref([])//初始化客户列表
|
|
const warehouseList: any = ref([])//初始化客户列表
|
|
@@ -198,7 +198,9 @@ const params: any = ref({
|
|
|
},
|
|
},
|
|
|
//商品信息列表
|
|
//商品信息列表
|
|
|
order_item_vos: [],
|
|
order_item_vos: [],
|
|
|
- goods_list:[]
|
|
|
|
|
|
|
+ goods_list: [],
|
|
|
|
|
+ warehouse_id:'',
|
|
|
|
|
+ goods_num:'',
|
|
|
})
|
|
})
|
|
|
let sku = ref('');
|
|
let sku = ref('');
|
|
|
watch(activeTab, (newValue, oldValue) => {
|
|
watch(activeTab, (newValue, oldValue) => {
|
|
@@ -239,8 +241,6 @@ const toSearch = async () => {
|
|
|
}
|
|
}
|
|
|
index.value = shippingForm.value.order_item_vos.length;
|
|
index.value = shippingForm.value.order_item_vos.length;
|
|
|
shippingForm.value.order_item_vos.push(res.data);
|
|
shippingForm.value.order_item_vos.push(res.data);
|
|
|
- console.log(res.data, shippingForm.value.order_item_vos);
|
|
|
|
|
-
|
|
|
|
|
} else {
|
|
} else {
|
|
|
index.value = indexs;
|
|
index.value = indexs;
|
|
|
}
|
|
}
|
|
@@ -251,7 +251,8 @@ const toSearch = async () => {
|
|
|
snInputRef.value.focus();
|
|
snInputRef.value.focus();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- dialogVisible.value = false;
|
|
|
|
|
|
|
+ shippingForm.value.order_item_vos[index.value].num = 1
|
|
|
|
|
+ //dialogVisible.value = false;
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('Error fetching product:', error);
|
|
console.error('Error fetching product:', error);
|
|
@@ -302,21 +303,26 @@ const handleClose = (done: () => void) => {
|
|
|
done()
|
|
done()
|
|
|
}
|
|
}
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- console.log(send_type);
|
|
|
|
|
init()
|
|
init()
|
|
|
getInforList()
|
|
getInforList()
|
|
|
});
|
|
});
|
|
|
const goBack = () => {
|
|
const goBack = () => {
|
|
|
router.push({ name: 'order' });
|
|
router.push({ name: 'order' });
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
const scanCode = () => {
|
|
const scanCode = () => {
|
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
- if (inputRef.value && inputRef.value.focus) {
|
|
|
|
|
- inputRef.value.focus();
|
|
|
|
|
- } else {
|
|
|
|
|
- console.error('Input reference is not available');
|
|
|
|
|
|
|
+ if (inputRef.value) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ inputRef.value.focus(); // 先尝试聚焦 input 元素
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (inputRef.value) {
|
|
|
|
|
+ inputRef.value.select();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('Failed to select input:', error);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
@@ -334,32 +340,53 @@ const getOrderNumber = () => {
|
|
|
params.value.sender.city_name +
|
|
params.value.sender.city_name +
|
|
|
params.value.sender.area_name +
|
|
params.value.sender.area_name +
|
|
|
params.value.sender.address;
|
|
params.value.sender.address;
|
|
|
- params.value.order_item_vos = shippingForm.value.order_item_vos
|
|
|
|
|
|
|
+ /* params.value.order_item_vos = shippingForm.value.order_item_vos */
|
|
|
|
|
+ //商品信息
|
|
|
|
|
+ const item = {
|
|
|
|
|
+ goods_name:'',
|
|
|
|
|
+ quantity:'',
|
|
|
|
|
+ unit:''
|
|
|
|
|
+ };
|
|
|
|
|
+ shippingForm.value.order_item_vos.map((el) => {
|
|
|
|
|
+ item.goods_name = el.goods_vo.name;
|
|
|
|
|
+ /* item.goods_price = el.product_vo.price; */
|
|
|
|
|
+ item.quantity = el.orderNum;
|
|
|
|
|
+ item.unit = el.product_vo.unit;
|
|
|
|
|
+ return params.value.goods_list.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ params.value.goods_num = shippingForm.value.order_item_vos.reduce(
|
|
|
|
|
+ (sum, e) => sum + Number(e.orderNum || 0),
|
|
|
|
|
+ 0
|
|
|
|
|
+ );
|
|
|
if (shippingForm.appointment_type !== 0) {
|
|
if (shippingForm.appointment_type !== 0) {
|
|
|
params.value.appointment_time = shippingForm.appointment_time
|
|
params.value.appointment_time = shippingForm.appointment_time
|
|
|
}
|
|
}
|
|
|
- console.log(shippingForm);
|
|
|
|
|
- //商品信息
|
|
|
|
|
- /* const item = {};
|
|
|
|
|
- shippingForm.order_item_vos.map((el) => {
|
|
|
|
|
- item.goods_name = el.goods_vo.name;
|
|
|
|
|
- item.quantity = el.orderNum;
|
|
|
|
|
- item.unit = el.product_vo.unit;
|
|
|
|
|
- return params.goods_list.push(item);
|
|
|
|
|
- });
|
|
|
|
|
- params.goods_num = this.product_list.reduce(
|
|
|
|
|
- (sum, e) => sum + Number(e.orderNum || 0),
|
|
|
|
|
- 0
|
|
|
|
|
- );
|
|
|
|
|
- params.total_weight = Number(params.total_weight);
|
|
|
|
|
- params.total_volume = Number(params.total_volume);
|
|
|
|
|
- params.declared_value = Number(params.declared_value);
|
|
|
|
|
- //地址
|
|
|
|
|
- params.send_address = this.send_address;
|
|
|
|
|
- params.receive_address = this.receive_address;
|
|
|
|
|
- params.order_code = this.id; */
|
|
|
|
|
|
|
+ params.value.warehouse_id=shippingForm.value.warehouse_id
|
|
|
|
|
+ params.value.send_type=send_type.value
|
|
|
|
|
+ params.value.order_code = id.value
|
|
|
|
|
+
|
|
|
|
|
+ /*console.log(shippingForm);
|
|
|
|
|
+ //商品信息
|
|
|
|
|
+ const item = {};
|
|
|
|
|
+ shippingForm.order_item_vos.map((el) => {
|
|
|
|
|
+ item.goods_name = el.goods_vo.name;
|
|
|
|
|
+ item.quantity = el.orderNum;
|
|
|
|
|
+ item.unit = el.product_vo.unit;
|
|
|
|
|
+ return params.goods_list.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ params.goods_num = this.product_list.reduce(
|
|
|
|
|
+ (sum, e) => sum + Number(e.orderNum || 0),
|
|
|
|
|
+ 0
|
|
|
|
|
+ );
|
|
|
|
|
+ params.total_weight = Number(params.total_weight);
|
|
|
|
|
+ params.total_volume = Number(params.total_volume);
|
|
|
|
|
+ params.declared_value = Number(params.declared_value);
|
|
|
|
|
+ //地址
|
|
|
|
|
+ params.send_address = this.send_address;
|
|
|
|
|
+ params.receive_address = this.receive_address;
|
|
|
|
|
+ params.order_code = this.id; */
|
|
|
orderApi.getkdShip(id.value, params.value).then(res => {
|
|
orderApi.getkdShip(id.value, params.value).then(res => {
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ init()
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -400,6 +427,9 @@ const ship = () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
+const kdsShip = () => {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
const init = async () => {
|
|
const init = async () => {
|
|
|
try {
|
|
try {
|
|
|
const res: any = await orderApi.getSendOrderDetail(id.value);
|
|
const res: any = await orderApi.getSendOrderDetail(id.value);
|
|
@@ -414,7 +444,6 @@ const init = async () => {
|
|
|
})
|
|
})
|
|
|
barcodeValue.value = res.data.order_vo.sn;
|
|
barcodeValue.value = res.data.order_vo.sn;
|
|
|
//物品价格
|
|
//物品价格
|
|
|
- console.log(res.data.kdn_order_code);
|
|
|
|
|
if (res.data.total_volume !== undefined) {
|
|
if (res.data.total_volume !== undefined) {
|
|
|
params.value.total_volume = Number(res.data.total_volume)
|
|
params.value.total_volume = Number(res.data.total_volume)
|
|
|
}
|
|
}
|
|
@@ -437,7 +466,7 @@ const init = async () => {
|
|
|
params.value.receiver.area_name = codeToText[receiverList[2]];
|
|
params.value.receiver.area_name = codeToText[receiverList[2]];
|
|
|
params.value.receiver.address = res.data.order_vo.address;
|
|
params.value.receiver.address = res.data.order_vo.address;
|
|
|
shippingForm.value = res.data;
|
|
shippingForm.value = res.data;
|
|
|
- console.log("Barcode value set to:", barcodeValue.value);
|
|
|
|
|
|
|
+ console.log("Barcode value set to:", shippingForm);
|
|
|
} else {
|
|
} else {
|
|
|
console.error("Invalid response structure:", res);
|
|
console.error("Invalid response structure:", res);
|
|
|
}
|
|
}
|