|
@@ -1,56 +1,137 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="p-4">
|
|
|
|
|
|
|
+ <div class="p-4 bg-white">
|
|
|
<el-button type="text" @click="goBack">返回</el-button>
|
|
<el-button type="text" @click="goBack">返回</el-button>
|
|
|
<!-- <h2 class="text-center my-4">发货管理</h2> -->
|
|
<!-- <h2 class="text-center my-4">发货管理</h2> -->
|
|
|
<div class="text-center my-4">
|
|
<div class="text-center my-4">
|
|
|
- <Vue3Barcode v-if="barcodeValue" :value='barcodeValue' width="1" height='30'></Vue3Barcode >
|
|
|
|
|
- <!-- <p>RYKS_DDD-20240527-00201</p> -->
|
|
|
|
|
|
|
+ <Vue3Barcode v-if="barcodeValue" :value='barcodeValue' width="1" height='30'></Vue3Barcode>
|
|
|
|
|
+ <!-- <p>RYKS_DDD-20240527-00201</p> -->
|
|
|
</div>
|
|
</div>
|
|
|
<el-tabs v-model="activeTab">
|
|
<el-tabs v-model="activeTab">
|
|
|
- <el-tab-pane label="商品信息" name="product-info">
|
|
|
|
|
-
|
|
|
|
|
- </el-tab-pane>
|
|
|
|
|
<el-tab-pane label="基本信息" name="basic-info">
|
|
<el-tab-pane label="基本信息" name="basic-info">
|
|
|
<div class="p-4">
|
|
<div class="p-4">
|
|
|
|
|
+ <span>预约类型:</span>
|
|
|
|
|
+ <el-select v-model="shippingForm.appointment_type" clearable placeholder="Select" size="small"
|
|
|
|
|
+ style="width: 100px">
|
|
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <p class="mt-1 mb-1" v-if="shippingForm.appointment_type !== 0"><span>上门时间:</span>
|
|
|
|
|
+ <el-date-picker v-model="shippingForm.appointment_time" style="width: 170px" size="small"
|
|
|
|
|
+ type="datetime" placeholder="Select date and time" :default-time="defaultTime" />
|
|
|
|
|
+ </p>
|
|
|
<p>订单状态:{{ orderTypeName(shippingForm.order_vo.status) }}</p>
|
|
<p>订单状态:{{ orderTypeName(shippingForm.order_vo.status) }}</p>
|
|
|
- <p>订单类型:{{ shippingForm.order_vo.type=='TO_B'?'销售订单':'租赁订单' }}</p>
|
|
|
|
|
|
|
+ <p>订单类型:{{ shippingForm.order_vo.type == 'TO_B' ? '销售订单' : '租赁订单' }}</p>
|
|
|
<p>下单客户:{{ customerName(shippingForm.order_vo.member_id) }}</p>
|
|
<p>下单客户:{{ customerName(shippingForm.order_vo.member_id) }}</p>
|
|
|
<p>付款方式:{{ collectingAccountName(shippingForm.order_vo.pay_type) }}</p>
|
|
<p>付款方式:{{ collectingAccountName(shippingForm.order_vo.pay_type) }}</p>
|
|
|
<p>实付金额:{{ shippingForm.order_vo.pay_price }}</p>
|
|
<p>实付金额:{{ shippingForm.order_vo.pay_price }}</p>
|
|
|
<p>仓库:{{ warehouseName(shippingForm.warehouse_id) }}</p>
|
|
<p>仓库:{{ warehouseName(shippingForm.warehouse_id) }}</p>
|
|
|
<p>收货人:{{ shippingForm.order_vo.customer_name }}</p>
|
|
<p>收货人:{{ shippingForm.order_vo.customer_name }}</p>
|
|
|
<p>联系电话:{{ shippingForm.order_vo.customer_phone }}</p>
|
|
<p>联系电话:{{ shippingForm.order_vo.customer_phone }}</p>
|
|
|
- <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>运单号:</p>
|
|
|
|
|
|
|
+ <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>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <div v-else>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 快递公司: <el-select v-model="params.logistics_type" clearable>
|
|
|
|
|
+ <el-option v-for="(item, index) in deliveryTypeList" :key="index" :label="item.name"
|
|
|
|
|
+ :value="item.code"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 物流单号: <el-input v-model="params.logistics_code" :minlength="1" :maxlength="20"
|
|
|
|
|
+ placeholder="请输入物流单号"></el-input>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 寄件人手机号: <el-input v-model="params.logistics_phone" :minlength="1" :maxlength="20"
|
|
|
|
|
+ placeholder="请输入寄件人手机号后四位"></el-input>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <p class="mt-1 mb-1">物品总重量:<el-input v-model.number="params.total_weight" size="small"
|
|
|
|
|
+ :minlength="1" style="width: 170px" :maxlength="20" type="number" max="50" clearable
|
|
|
|
|
+ placeholder="请输入物品总重量"><template #append>KG</template></el-input>
|
|
|
|
|
+ </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>
|
|
|
|
|
+ <p>物品价格: <el-input v-model="params.declared_value" size="small" :minlength="1" style="width: 170px"
|
|
|
|
|
+ :maxlength="20" clearable placeholder="请输入物品价格"><template #append>元</template></el-input>
|
|
|
|
|
+ </p>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
<!-- <div class="p-4">
|
|
<!-- <div class="p-4">
|
|
|
<p>3.12 快递已收货</p>
|
|
<p>3.12 快递已收货</p>
|
|
|
<p>3.13 快递已到达中转站</p>
|
|
<p>3.13 快递已到达中转站</p>
|
|
|
</div> -->
|
|
</div> -->
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="商品信息" name="product-info">
|
|
|
|
|
+ <el-table :data="shippingForm.order_item_vos" style="width: 100%">
|
|
|
|
|
+ <el-table-column prop="goods_vo.name" label="商品名称" />
|
|
|
|
|
+ <el-table-column prop="product_vo.sku" label="SKU" />
|
|
|
|
|
+ <el-table-column prop="num" label="数量" />
|
|
|
|
|
+ <el-table-column prop="orderNum" label="出库数量" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
- <div class="flex justify-center mt-4">
|
|
|
|
|
|
|
+ <el-dialog v-model="dialogVisible" :modal=false title="扫码出库" :close-on-click-modal="false" width="80%"
|
|
|
|
|
+ :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" @keyup.enter="toSearch()" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="序列号">
|
|
|
|
|
+ <el-input v-model="snCodeForm.sn_code" ref="snInputRef" @keyup.enter="toSnCode()" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <!-- <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button @click="dialogVisible = false"></el-button>
|
|
|
|
|
+ <el-button type="primary" @click="dialogVisible = false">
|
|
|
|
|
+ Confirm
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template> -->
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <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'">
|
|
|
|
|
+ <el-button type="primary" size="large" @click="scanCode">扫码出库</el-button>
|
|
|
|
|
+ <el-button type="primary" size="large"
|
|
|
|
|
+ v-if="shippingForm.kdn_order_code == '' || shippingForm.kdn_order_code == undefined"
|
|
|
|
|
+ @click="getOrderNumber">获取运单号</el-button>
|
|
|
|
|
+ <el-button type="primary" size="large" v-if="shippingForm.kdn_order_code !== undefined"
|
|
|
|
|
+ @click="ship">发货</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <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>
|
|
|
- <el-button type="primary" size="large" @click="getOrderNumber">获取运单号</el-button>
|
|
|
|
|
<el-button type="primary" size="large" @click="ship">发货</el-button>
|
|
<el-button type="primary" size="large" @click="ship">发货</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { ref,onMounted,watch} from 'vue';
|
|
|
|
|
-import { useRouter,useRoute } from 'vue-router';
|
|
|
|
|
|
|
+import { ref, onMounted, watch, reactive, nextTick } from 'vue';
|
|
|
|
|
+import { useRouter, useRoute } from 'vue-router';
|
|
|
import { orderApi, infoApi, dictionaryAPI } from '@/api/api'
|
|
import { orderApi, infoApi, dictionaryAPI } from '@/api/api'
|
|
|
|
|
+import { regionData, codeToText } from 'element-china-area-data'
|
|
|
//引入
|
|
//引入
|
|
|
import Vue3Barcode from 'vue3-barcode'
|
|
import Vue3Barcode from 'vue3-barcode'
|
|
|
//定义要生成条形码的值
|
|
//定义要生成条形码的值
|
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
+
|
|
|
|
|
+const appointment_time = ref('')
|
|
|
|
|
+const defaultTime = new Date(2000, 1, 1, 12, 0, 0)
|
|
|
|
|
+let dialogVisible = ref(false)
|
|
|
|
|
+const tableData = ref([])
|
|
|
let barcodeValue = ref('')
|
|
let barcodeValue = ref('')
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
-const route=useRoute()
|
|
|
|
|
-const activeTab = ref('product-info');
|
|
|
|
|
-const id=ref(route.params.id);
|
|
|
|
|
-let shippingForm=ref({
|
|
|
|
|
|
|
+const route = useRoute()
|
|
|
|
|
+const activeTab = ref('basic-info');
|
|
|
|
|
+const id = ref(route.params.id);
|
|
|
|
|
+const send_type = ref(route.params.send_type);
|
|
|
|
|
+let shippingForm: any = ref({
|
|
|
order_vo: {
|
|
order_vo: {
|
|
|
status: '',
|
|
status: '',
|
|
|
type: '',
|
|
type: '',
|
|
@@ -61,41 +142,300 @@ let shippingForm=ref({
|
|
|
customer_phone: '',
|
|
customer_phone: '',
|
|
|
province_city_area_address: '',
|
|
province_city_area_address: '',
|
|
|
remark: ''
|
|
remark: ''
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ warehouse_id: '',
|
|
|
|
|
+ appointment_type: 0,
|
|
|
|
|
+ order_item_vos: []
|
|
|
});
|
|
});
|
|
|
-const customerList = ref([])//初始化客户列表
|
|
|
|
|
-const warehouseList = ref([])//初始化客户列表
|
|
|
|
|
-const collectingAccountList = ref([])//初始化客户列表
|
|
|
|
|
-const deliveryList = ref([])//初始化客户列表
|
|
|
|
|
-const orderTypeList = ref([])//初始化客户列表
|
|
|
|
|
|
|
+const options = [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "立即单",
|
|
|
|
|
+ value: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "预约上门",
|
|
|
|
|
+ value: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+]
|
|
|
|
|
+//表单
|
|
|
|
|
+const snCodeForm = reactive({
|
|
|
|
|
+ bar_code: "",
|
|
|
|
|
+ sn_code: '',
|
|
|
|
|
+})
|
|
|
|
|
+const inputRef = ref<any>(null);
|
|
|
|
|
+const snInputRef = ref<any>(null)
|
|
|
|
|
+const customerList: any = ref([])//初始化客户列表
|
|
|
|
|
+const warehouseList: any = ref([])//初始化客户列表
|
|
|
|
|
+const collectingAccountList: any = ref([])//初始化客户列表
|
|
|
|
|
+const deliveryList: any = ref([])//初始化客户列表
|
|
|
|
|
+const orderTypeList: any = ref([])//初始化客户列表
|
|
|
|
|
+const index = ref(-1);
|
|
|
|
|
+const deliveryTypeList: any = ref([])
|
|
|
|
|
+const params: any = ref({
|
|
|
|
|
+ logistics_type: "",
|
|
|
|
|
+ logistics_code: "",
|
|
|
|
|
+ logistics_phone: "",
|
|
|
|
|
+ send_type: '',
|
|
|
|
|
+ selfPickupNum: '',
|
|
|
|
|
+ remark: "",//备注
|
|
|
|
|
+ declared_value: "",//物品价格
|
|
|
|
|
+ appointment_type: 0,
|
|
|
|
|
+ total_weight: "",//物品总重量
|
|
|
|
|
+ total_volume: "",//物品总体积
|
|
|
|
|
+ //发货人
|
|
|
|
|
+ sender: {
|
|
|
|
|
+ name: "",
|
|
|
|
|
+ phone: "",
|
|
|
|
|
+ address: "",
|
|
|
|
|
+ province_city_area_address: ""
|
|
|
|
|
+ },
|
|
|
|
|
+ //收货人
|
|
|
|
|
+ receiver: {
|
|
|
|
|
+ name: "",
|
|
|
|
|
+ phone: "",
|
|
|
|
|
+ address: "",
|
|
|
|
|
+ province_city_area_address: ""
|
|
|
|
|
+ },
|
|
|
|
|
+ //商品信息列表
|
|
|
|
|
+ order_item_vos: [],
|
|
|
|
|
+ goods_list:[]
|
|
|
|
|
+})
|
|
|
|
|
+let sku = ref('');
|
|
|
watch(activeTab, (newValue, oldValue) => {
|
|
watch(activeTab, (newValue, oldValue) => {
|
|
|
console.log(`Tab changed from ${oldValue} to ${newValue}`);
|
|
console.log(`Tab changed from ${oldValue} to ${newValue}`);
|
|
|
// 这里可以添加一些逻辑,但要确保不会再次修改 activeTab
|
|
// 这里可以添加一些逻辑,但要确保不会再次修改 activeTab
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+/* 扫sku */
|
|
|
|
|
+const toSearch = async () => {
|
|
|
|
|
+ activeTab.value = 'product-info'
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res: any = await orderApi.getProduct(
|
|
|
|
|
+ shippingForm.value.warehouse_id,
|
|
|
|
|
+ snCodeForm.bar_code.replace(/\s+/g, '')
|
|
|
|
|
+ );
|
|
|
|
|
+ res.data.sn_code_list = [];
|
|
|
|
|
+ sku.value = res.data.product_vo.sku;
|
|
|
|
|
+
|
|
|
|
|
+ let indexs = shippingForm.value.order_item_vos.findIndex(el => (
|
|
|
|
|
+ el.goods_vo.id === res.data.goods_id &&
|
|
|
|
|
+ el.product_id === res.data.product_id &&
|
|
|
|
|
+ el.product_vo.sku === res.data.product_vo.sku
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ if (indexs === -1) {
|
|
|
|
|
+ let existingProduct = shippingForm.value.order_item_vos.find(el => (
|
|
|
|
|
+ el.goods_vo.id === res.data.goods_id &&
|
|
|
|
|
+ el.product_id === res.data.product_id &&
|
|
|
|
|
+ el.product_vo.sku === res.data.product_vo.sku
|
|
|
|
|
+ ));
|
|
|
|
|
+ console.log(existingProduct);
|
|
|
|
|
+ if (!existingProduct) {
|
|
|
|
|
+ //ElMessageBox.error('订单内没有该商品,请重新录入');
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ inputRef.value.focus();
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ index.value = shippingForm.value.order_item_vos.length;
|
|
|
|
|
+ shippingForm.value.order_item_vos.push(res.data);
|
|
|
|
|
+ console.log(res.data, shippingForm.value.order_item_vos);
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ index.value = indexs;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (res.data.product_vo.have_sn) {
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ // Assuming there's a ref named snInputRef
|
|
|
|
|
+ snInputRef.value.focus();
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dialogVisible.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('Error fetching product:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+//扫描序列号
|
|
|
|
|
+const toSnCode = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res: any = await orderApi.getsnCode(
|
|
|
|
|
+ "out",
|
|
|
|
|
+ sku.value,
|
|
|
|
|
+ snCodeForm.sn_code.replace(/\s+/g, '')
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ snCodeForm.sn_code = "";
|
|
|
|
|
+ const exists = shippingForm.value.order_item_vos[index.value].sn_code_list.find(
|
|
|
|
|
+ item => item.sn_code === res.sn_code && item.sku === res.sku
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ if (!exists) {
|
|
|
|
|
+ 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;
|
|
|
|
|
+ const indexs = shippingForm.value.order_item_vos.findIndex(el => (
|
|
|
|
|
+ el.goods_id === res.goods_id &&
|
|
|
|
|
+ el.product_id === res.product_id &&
|
|
|
|
|
+ el.product_vo.sku === res.sku
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ //shippingForm.value.order_item_vos[index.value].id = shippingForm.value.order_item_vos[indexs].id;
|
|
|
|
|
+ if (shippingForm.value.order_item_vos[index.value].num === shippingForm.value.order_item_vos[index.value].orderNum) {
|
|
|
|
|
+ snCodeForm.bar_code = "";
|
|
|
|
|
+ dialogVisible.value = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ snCodeForm.bar_code = "";
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ inputRef.value.focus();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('Error fetching SN code:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//关闭弹窗
|
|
|
|
|
+const handleClose = (done: () => void) => {
|
|
|
|
|
+ done()
|
|
|
|
|
+}
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- init()
|
|
|
|
|
- getInforList()
|
|
|
|
|
|
|
+ console.log(send_type);
|
|
|
|
|
+ init()
|
|
|
|
|
+ getInforList()
|
|
|
});
|
|
});
|
|
|
const goBack = () => {
|
|
const goBack = () => {
|
|
|
router.push({ name: 'order' });
|
|
router.push({ name: 'order' });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const scanCode = () => {
|
|
const scanCode = () => {
|
|
|
- console.log('扫码出库');
|
|
|
|
|
|
|
+ dialogVisible.value = true
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ if (inputRef.value && inputRef.value.focus) {
|
|
|
|
|
+ inputRef.value.focus();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error('Input reference is not available');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const getOrderNumber = () => {
|
|
const getOrderNumber = () => {
|
|
|
- console.log('获取运单号');
|
|
|
|
|
|
|
+ //发货详细地址
|
|
|
|
|
+ params.value.receiver.province_city_area_address =
|
|
|
|
|
+ params.value.receiver.province_name +
|
|
|
|
|
+ params.value.receiver.city_name +
|
|
|
|
|
+ params.value.receiver.area_name +
|
|
|
|
|
+ params.value.receiver.address;
|
|
|
|
|
+ //收货详细地址
|
|
|
|
|
+ params.value.sender.province_city_area_address =
|
|
|
|
|
+ params.value.sender.province_name +
|
|
|
|
|
+ params.value.sender.city_name +
|
|
|
|
|
+ params.value.sender.area_name +
|
|
|
|
|
+ params.value.sender.address;
|
|
|
|
|
+ params.value.order_item_vos = shippingForm.value.order_item_vos
|
|
|
|
|
+ if (shippingForm.appointment_type !== 0) {
|
|
|
|
|
+ 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; */
|
|
|
|
|
+ orderApi.getkdShip(id.value, params.value).then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ })
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const ship = () => {
|
|
const ship = () => {
|
|
|
- console.log('发货');
|
|
|
|
|
|
|
+ //发货详细地址
|
|
|
|
|
+ params.value.receiver.province_city_area_address =
|
|
|
|
|
+ params.value.receiver.province_name +
|
|
|
|
|
+ params.value.receiver.city_name +
|
|
|
|
|
+ params.value.receiver.area_name +
|
|
|
|
|
+ params.value.receiver.address;
|
|
|
|
|
+ //收货详细地址
|
|
|
|
|
+ params.value.sender.province_city_area_address =
|
|
|
|
|
+ params.value.sender.province_name +
|
|
|
|
|
+ params.value.sender.city_name +
|
|
|
|
|
+ params.value.sender.area_name +
|
|
|
|
|
+ params.value.sender.address;
|
|
|
|
|
+ params.value.order_item_vos = shippingForm.value.order_item_vos
|
|
|
|
|
+ if (shippingForm.appointment_type !== 0) {
|
|
|
|
|
+ params.value.appointment_time = shippingForm.appointment_time
|
|
|
|
|
+ }
|
|
|
|
|
+ const item = {
|
|
|
|
|
+ goods_name: "",
|
|
|
|
|
+ quantity: '',
|
|
|
|
|
+ unit: "",
|
|
|
|
|
+ };
|
|
|
|
|
+ params.value.goods_list.map((el) => {
|
|
|
|
|
+ item.goods_name = el.goods_vo.name;
|
|
|
|
|
+ item.quantity = el.num;
|
|
|
|
|
+ item.unit = el.product_vo.unit;
|
|
|
|
|
+ return params.value.goods_list.push(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ orderApi.orderSend(id.value, params.value).then(res => {
|
|
|
|
|
+ ElMessage.success("发货成功!");
|
|
|
|
|
+ router.push({ name: 'order' });
|
|
|
|
|
+ })
|
|
|
|
|
+ orderApi.queryLogistics({ shipper_code: params.value.logistics_type, logistic_code: params.value.logistics_code, customer_name: params.value.logistics_phone }).then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
-const init= async()=>{
|
|
|
|
|
|
|
+const init = async () => {
|
|
|
try {
|
|
try {
|
|
|
- const res = await orderApi.getSendOrderDetail(id.value);
|
|
|
|
|
|
|
+ const res: any = await orderApi.getSendOrderDetail(id.value);
|
|
|
if (res && res.data && res.data.order_vo && res.data.order_vo.sn) {
|
|
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 = []
|
|
|
|
|
+ })
|
|
|
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) {
|
|
|
|
|
+ params.value.total_volume = Number(res.data.total_volume)
|
|
|
|
|
+ }
|
|
|
|
|
+ params.value.declared_value = Number(res.data.order_vo.real_price)
|
|
|
|
|
+ res.data.appointment_type = 0
|
|
|
|
|
+ /* 发货人地址 */
|
|
|
|
|
+ const addressLiat = res.data.warehouse_vo.ware_pro_city_area.split(",")
|
|
|
|
|
+ params.value.sender.name = res.data.warehouse_vo.user_name;
|
|
|
|
|
+ params.value.sender.phone = res.data.warehouse_vo.phone;
|
|
|
|
|
+ params.value.sender.province_name = codeToText[addressLiat[0]]
|
|
|
|
|
+ params.value.sender.city_name = codeToText[addressLiat[1]]
|
|
|
|
|
+ params.value.sender.area_name = codeToText[addressLiat[2]]
|
|
|
|
|
+ params.value.sender.address = res.data.warehouse_vo.warehouse_address;
|
|
|
|
|
+ /* 收货地址 */
|
|
|
|
|
+ const receiverList = res.data.order_vo.province_city_area.split(",")
|
|
|
|
|
+ params.value.receiver.name = res.data.order_vo.customer_name;
|
|
|
|
|
+ params.value.receiver.phone = res.data.order_vo.customer_phone;
|
|
|
|
|
+ params.value.receiver.province_name = codeToText[receiverList[0]];
|
|
|
|
|
+ params.value.receiver.city_name = codeToText[receiverList[1]];
|
|
|
|
|
+ params.value.receiver.area_name = codeToText[receiverList[2]];
|
|
|
|
|
+ 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:", barcodeValue.value);
|
|
|
} else {
|
|
} else {
|
|
@@ -147,6 +487,11 @@ const getInforList = async () => {
|
|
|
collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表
|
|
collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表
|
|
|
deliveryList.value = await dictionaryAPI.getPage({ dictType: "order_send_type" })//获取配送方式
|
|
deliveryList.value = await dictionaryAPI.getPage({ dictType: "order_send_type" })//获取配送方式
|
|
|
orderTypeList.value = await dictionaryAPI.getPage({ dictType: "Sale_order_send_status" })//获取订单状态
|
|
orderTypeList.value = await dictionaryAPI.getPage({ dictType: "Sale_order_send_status" })//获取订单状态
|
|
|
|
|
+ const expressList: any = await infoApi.getExpressList({//获取物流公司
|
|
|
|
|
+ page_no: 1,
|
|
|
|
|
+ page_size: 9999,
|
|
|
|
|
+ })
|
|
|
|
|
+ deliveryTypeList.value = expressList.data.data
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|