فهرست منبع

订单发货页面

yangg 1 سال پیش
والد
کامیت
56c89a546d

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 311 - 993
package-lock.json


+ 2 - 2
package.json

@@ -19,7 +19,7 @@
     "@fullcalendar/timegrid": "^5.11.0",
     "@fullcalendar/vue3": "^5.11.1",
     "@headlessui/vue": "^1.7.3",
-    "@intlify/unplugin-vue-i18n": "^4.0.0",
+    "@intlify/vite-plugin-vue-i18n": "^7.0.0",
     "@suadelabs/vue3-multiselect": "^1.0.2",
     "@vuelidate/core": "^2.0.0",
     "@vuelidate/validators": "^2.0.0",
@@ -27,7 +27,6 @@
     "@vueuse/head": "^0.9.7",
     "apexcharts": "^3.35.5",
     "axios": "^1.6.8",
-    "capacitor-pda-scanner": "file:y",
     "dotenv": "^16.4.5",
     "easymde": "^2.18.0",
     "element-plus": "^2.7.3",
@@ -55,6 +54,7 @@
     "vue-router": "^4.1.5",
     "vue-simple-range-slider": "^1.0.0",
     "vue3-apexcharts": "^1.4.1",
+    "vue3-barcode": "^1.0.1",
     "vue3-easymde": "^1.0.0",
     "vue3-form-wizard": "^0.1.6",
     "vue3-json-excel": "^1.0.10-alpha",

+ 2 - 1
src/App.vue

@@ -2,7 +2,8 @@
     <div class="main-section antialiased relative font-nunito text-sm font-normal "
         :class="[store.sidebar ? 'toggle-sidebar' : '', store.menu, store.layout, store.rtlClass]">
         <component v-bind:is="mainLayout"></component>
-        <div class="absolute inline-flex align-middle fixed-bottom button-group">
+        <div v-if="!$route.meta.hideButtonGroup"  class="absolute inline-flex align-middle fixed-bottom button-group">
+
             <main-tab-bar></main-tab-bar>
            <!--  <button type="button" @click="godashbord"
                 class="btn btn-dark ltr:rounded-r-none rtl:rounded-l-none">Left</button>

+ 53 - 1
src/api/api.ts

@@ -27,6 +27,58 @@ export class orderApi {     // 订单接口
      * @return {HttpResponse} result
      */
     static async orderList(params) {
-        return request('/admin/erp/order', params, 'get')
+        return request('/admin/erp/order/saleOrder/list', params, 'get')
     }
+    ///admin/erp/order/getSendOrderDetail/${order_id}
+    static async getSendOrderDetail(order_id) {
+        return request(`/admin/erp/order/getSendOrderDetail/${order_id}`,'', 'get')
+    }
+}
+
+export class infoApi {     // 字典,仓库,客户
+    /**
+     * @description 获取地列表
+     * @return {HttpResponse} result
+     */
+    static async warehouseList(params) {//仓库列表
+        return request('admin/erp/warehouse/list-all', params, 'get')
+    }
+    static async customer(params) {//客户列表
+        return request('/admin/erp/customer', params, 'get')
+    }
+    //
+    static async collectingAccount(params) {//支付方式列表
+        return request('/admin/erp/collectingAccount', params, 'get')
+    }
+}
+export class dictionaryAPI {
+    static async getPage(params) {//字典
+            return request('/admin/systems/dict-data/page', params, 'get')
+        }
+        /*  */
+    static async getExpressList(params) {//配送方式
+        return request('/admin/systems/logi-companies', params, 'get')
+    }
+}
+
+export class allocationAPI {
+    static async stockTransfer(params) {//字典
+            return request('/admin/erp/stockTransfer', params, 'get')
+        }
+}
+/* /admin/erp/warehouseEntry */
+export class entryOutAPI {
+    static async getWarehouseEntry(params) {//入库列表
+            return request('/admin/erp/warehouseEntry', params, 'get')
+        }
+    static async getWarehouseOut(params) {//出库列表
+        return request('/admin/erp/warehouseOut', params, 'get')
+    }
+}
+/* 盘点列表 */
+export class inventoryAPI {
+    static async getInventory(params) {//入库列表
+            return request('/admin/stock/inventory', params, 'get')
+        }
+   
 }

+ 3 - 3
src/components/taber/mainTaberItem.vue

@@ -23,7 +23,7 @@
                     <div>订单</div>
                 </template>
             </tab-bar-item>
-            <tab-bar-item path="/profile" activeColor="purple">
+            <tab-bar-item path="/allocation/index" activeColor="purple">
                 <template v-slot:item-icon>
                     <img src="../../assets/images/u40.png" alt="">
                 </template>
@@ -34,7 +34,7 @@
                     <div>调拨</div>
                 </template>
             </tab-bar-item>
-            <tab-bar-item path="/cart" activeColor="purple">
+            <tab-bar-item path="/InoutStorage/index" activeColor="purple">
                 <template v-slot:item-icon>
                     <img src="../../assets/images/u42.png" alt="">
                 </template>
@@ -45,7 +45,7 @@
                     <div>出入库</div>
                 </template>
             </tab-bar-item>
-            <tab-bar-item path="/index" activeColor="purple">
+            <tab-bar-item path="/Inventory/index" activeColor="purple">
                 <template v-slot:item-icon>
                     <img src="../../assets/images/u38.png" alt="">
                 </template>

+ 51 - 12
src/router/index.ts

@@ -1,4 +1,4 @@
-import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
+import { createRouter,createWebHashHistory, createWebHistory, RouteRecordRaw } from 'vue-router';
 import { useAppStore } from '@/stores/index';
 import appSetting from '@/app-setting';
 
@@ -27,11 +27,57 @@ const routes: RouteRecordRaw[] = [
         path: '/login',
         name: 'login',
         meta: {
-            requiresAuth: false
+            requiresAuth: false,
+            hideButtonGroup: true
         },
         component: () => import(/* webpackChunkName: "apps-scrumboard" */ '../views/auth/boxed-signin.vue'),
     },
-
+    //订单页面
+    {
+        path: '/apps/order',
+        name: 'order',
+        meta: {
+            requiresAuth: true
+        },
+        component: () => import(/* webpackChunkName: "apps-chat" */ '../views/apps/order.vue'),
+    },
+    //调拨单
+    {
+        path: '/allocation/index',
+        name: 'allocation',
+        meta: {
+            requiresAuth: true
+        },
+        component: () => import(/* webpackChunkName: "apps-chat" */ '../views/allocation/index.vue'),
+    },
+    //出入库
+    {
+        path: '/InoutStorage/index',
+        name: 'InoutStorage',
+        meta: {
+            requiresAuth: true
+        },
+        component: () => import(/* webpackChunkName: "apps-chat" */ '../views/InoutStorage/index.vue'),
+    },
+     //盘点
+     {
+        path: '/Inventory/index',
+        name: 'Inventory',
+        meta: {
+            requiresAuth: true
+        },
+        component: () => import(/* webpackChunkName: "apps-chat" */ '../views/Inventory/index.vue'),
+    },
+    //发货页面
+    {
+        path: '/apps/shippingPage/:id',
+        name: 'shippingPage',
+        meta: {
+            requiresAuth: false,
+            hideButtonGroup: true
+        },
+        component: () => import(/* webpackChunkName: "apps-scrumboard" */ '../views/apps/shippingPage.vue'),
+    },
     // apps
     {
         path: '/apps/applist',
@@ -57,14 +103,7 @@ const routes: RouteRecordRaw[] = [
         },
         component: () => import(/* webpackChunkName: "apps-chat" */ '../views/apps/stock.vue'),
     },
-    {
-        path: '/apps/order',
-        name: 'order',
-        meta: {
-            requiresAuth: true
-        },
-        component: () => import(/* webpackChunkName: "apps-chat" */ '../views/apps/order.vue'),
-    },
+    
     {
         path: '/apps/goods',
         name: 'goods',
@@ -274,7 +313,7 @@ const routes: RouteRecordRaw[] = [
 ];
 
 const router = createRouter({
-    history: createWebHistory(),
+    history: createWebHistory(),//createWebHistory(),
     //linkExactActiveClass: 'active',
     routes,
     /* scrollBehavior(to, from, savedPosition) {

+ 1 - 1
src/utils/axios.ts

@@ -9,7 +9,7 @@ axios.defaults.timeout = 60000;
 
 // 请求地址,这里是动态赋值的的环境变量,下一篇会细讲,这里跳过
 // @ts-ignore
-axios.defaults.baseURL = 'http://192.168.8.103:9999'//import.meta.env.VITE_API_URL;   
+axios.defaults.baseURL = 'https://apidoc.raycos.net'//import.meta.env.VITE_API_URL;   
 
 // 请求拦截器
 axios.interceptors.request.use(function (config) {

+ 294 - 0
src/views/InoutStorage/index.vue

@@ -0,0 +1,294 @@
+<template>
+    <div>
+        <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick">
+            <el-tab-pane label="入库明细" name="first"></el-tab-pane>
+            <el-tab-pane label="出库明细" name="second"></el-tab-pane>
+        </el-tabs>
+        <!--   <ul class="flex space-x-2 rtl:space-x-reverse">
+            <li>
+                <a href="javascript:;" class="text-primary hover:underline">首页</a>
+            </li>
+            <li class="before:content-['/'] ltr:before:mr-2 rtl:before:ml-2">
+                <span>订单列表</span>
+            </li>
+        </ul> -->
+
+        <div v-if="activeName == 'first'" class="panel pb-0 mt-6">
+
+            <div class="flex md:items-center md:flex-row flex-col mb-5 gap-5">
+
+                <div class="flex items-center gap-5 ltr:ml-auto rtl:mr-auto">
+                    <div class="dropdown">
+                        <Popper :placement="store.rtlClass === 'rtl' ? 'bottom-end' : 'bottom-start'" offsetDistance="0"
+                            class="align-middle">
+                            <button type="button"
+                                class="flex items-center border font-semibold border-[#e0e6ed] dark:border-[#253b5c] rounded-md px-4 py-2 text-sm dark:bg-[#1b2e4b] dark:text-white-dark">
+                                <span class="ltr:mr-1 rtl:ml-1">Columns</span>
+                                <icon-caret-down class="w-5 h-5" />
+                            </button>
+                            <template #content>
+                                <ul class="whitespace-nowrap">
+                                    <template v-for="(col, i) in cols" :key="i">
+                                        <li>
+                                            <div class="flex items-center px-4 py-1">
+                                                <label class="cursor-pointer mb-0">
+                                                    <input type="checkbox" class="form-checkbox" :id="`chk-${i}`"
+                                                        :value="col.field" @change="col.hide = !$event.target.checked"
+                                                        :checked="!col.hide" />
+                                                    <span :for="`chk-${i}`" class="ltr:ml-2 rtl:mr-2">{{ col.title
+                                                        }}</span>
+                                                </label>
+                                            </div>
+                                        </li>
+                                    </template>
+                                </ul>
+                            </template>
+                        </Popper>
+                    </div>
+                    <div>
+                        <input v-model="search" type="text" class="form-input" placeholder="Search..." />
+                    </div>
+                </div>
+            </div>
+
+            <div class="datatable">
+                <vue3-datatable :rows="rows" :columns="cols" :totalRows="rows?.length" :sortable="true" :search="search"
+                    skin="whitespace-nowrap bh-table-hover"
+                    firstArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M13 19L7 12L13 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M16.9998 19L10.9998 12L16.9998 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    lastArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M11 19L17 12L11 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M6.99976 19L12.9998 12L6.99976 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> '
+                    previousArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M15 5L9 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    nextArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M9 5L15 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'>
+                    <template #in_warehouse_id="data">
+                        {{ warehouseName(data.value.in_warehouse_id) }}
+                    </template>
+                    <template #warehouse_id="data">
+                        {{ warehouseName(data.value.warehouse_id) }}
+                    </template>
+                    <template #type="data">
+                        {{ typeName(data.value.type) }}
+                    </template>
+                    <template #has_submit="data">
+                        {{ deliveryName(data.value.has_submit) }}
+                    </template>
+                    <!-- 定义操作栏的模板 -->
+                    <!--  <template #actions="{ row }">
+                        <button @click="deliveryOrder(row)" class="btn btn-primary">发货</button>
+                    </template> -->
+                    <template #isActive="data">
+                        <!--  <span class="capitalize" :class="data.value.isActive ? 'text-success' : 'text-danger'">{{
+                            data._rawValue }}</span> -->
+                    </template>
+                </vue3-datatable>
+            </div>
+        </div>
+        <div v-else class="panel pb-0 mt-6">
+
+            <div class="flex md:items-center md:flex-row flex-col mb-5 gap-5">
+
+                <div class="flex items-center gap-5 ltr:ml-auto rtl:mr-auto">
+                    <div class="dropdown">
+                        <Popper :placement="store.rtlClass === 'rtl' ? 'bottom-end' : 'bottom-start'" offsetDistance="0"
+                            class="align-middle">
+                            <button type="button"
+                                class="flex items-center border font-semibold border-[#e0e6ed] dark:border-[#253b5c] rounded-md px-4 py-2 text-sm dark:bg-[#1b2e4b] dark:text-white-dark">
+                                <span class="ltr:mr-1 rtl:ml-1">Columns</span>
+                                <icon-caret-down class="w-5 h-5" />
+                            </button>
+                            <template #content>
+                                <ul class="whitespace-nowrap">
+                                    <template v-for="(col, i) in outcols" :key="i">
+                                        <li>
+                                            <div class="flex items-center px-4 py-1">
+                                                <label class="cursor-pointer mb-0">
+                                                    <input type="checkbox" class="form-checkbox" :id="`chk-${i}`"
+                                                        :value="col.field" @change="col.hide = !$event.target.checked"
+                                                        :checked="!col.hide" />
+                                                    <span :for="`chk-${i}`" class="ltr:ml-2 rtl:mr-2">{{ col.title
+                                                        }}</span>
+                                                </label>
+                                            </div>
+                                        </li>
+                                    </template>
+                                </ul>
+                            </template>
+                        </Popper>
+                    </div>
+                    <div>
+                        <input v-model="search" type="text" class="form-input" placeholder="Search..." />
+                    </div>
+                </div>
+            </div>
+
+            <div class="datatable">
+                <vue3-datatable :rows="outrows" :columns="outcols" :totalRows="rows?.length" :sortable="true"
+                    :search="search" skin="whitespace-nowrap bh-table-hover"
+                    firstArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M13 19L7 12L13 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M16.9998 19L10.9998 12L16.9998 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    lastArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M11 19L17 12L11 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M6.99976 19L12.9998 12L6.99976 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> '
+                    previousArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M15 5L9 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    nextArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M9 5L15 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'>
+                    <template #warehouse_id="data">
+                        {{ warehouseName(data.value.warehouse_id) }}
+                    </template>
+                    <template #has_submit="data">
+                        {{ outName(data.value.has_submit) }}
+                    </template>
+                    <template #type="data">
+                        {{ typeOutName(data.value.type) }}
+                    </template>
+                    <!-- 定义操作栏的模板 -->
+                    <!--  <template #actions="{ row }">
+                        <button @click="deliveryOrder(row)" class="btn btn-primary">发货</button>
+                    </template> -->
+                    <template #isActive="data">
+                        <!--  <span class="capitalize" :class="data.value.isActive ? 'text-success' : 'text-danger'">{{
+                            data._rawValue }}</span> -->
+                    </template>
+                </vue3-datatable>
+            </div>
+        </div>
+    </div>
+</template>
+<script setup lang="ts">
+import { ref, onMounted } from 'vue';
+import Vue3Datatable from '@bhplugin/vue3-datatable';
+import { useAppStore } from '@/stores/index';
+import { useRouter } from 'vue-router';
+import { useMeta } from '@/composables/use-meta';
+import { entryOutAPI, infoApi, dictionaryAPI } from '@/api/api'
+import IconBell from '@/components/icon/icon-bell.vue';
+import IconCaretDown from '@/components/icon/icon-caret-down.vue';
+import type { TabsPaneContext } from 'element-plus'
+
+
+useMeta({ title: 'Column Chooser Table' });
+const router = useRouter();
+const store = useAppStore();
+const search = ref('');
+const rows = ref([]); // 初始化rows为响应式引用
+const outrows = ref([]);
+const customerList = ref([])//初始化客户列表
+const warehouseList = ref([])//初始化客户列表
+const collectingAccountList = ref([])//初始化客户列表
+const deliveryList = ref([])//初始化客户列表
+const entryTypeList = ref([])//初始化入库状态列表
+const outTypeList = ref([])//初始化出库状态列表
+//入库列表
+const cols = ref([
+    { field: 'sn', title: '入库单号', isUnique: true, hide: false },
+    { field: 'warehouse_id', title: '仓库名称', hide: false },
+    { field: 'type', title: '入库类型', hide: false },
+    { field: 'order_id_list', title: '订单编号', hide: false },
+    { field: 'has_submit', title: '状态', hide: false },
+    { field: 'memo', title: '备注', hide: false },
+    { field: 'actions', title: '操作', hide: true }
+]);
+//出库列表
+const outcols = ref([
+    { field: 'sn', title: '出库单号', isUnique: true, hide: false },
+    { field: 'warehouse_id', title: '仓库名称', hide: false },
+    { field: 'type', title: '出库类型', hide: false },
+    { field: 'order_id_list', title: '订单编号', hide: false },
+    { field: 'has_submit', title: '状态', hide: false },
+    { field: 'notes', title: '备注', hide: false },
+    { field: 'actions', title: '操作', hide: true }
+]);
+const params = ref([
+    { page_no: 1, page_size: 10 }
+])
+let activeName = ref('first')
+const handleClick = (tab: TabsPaneContext, event: Event) => {
+    if (tab.props.name == 'first') {
+        getentryList()
+    } else {
+        getoutList()
+    }
+    //activeName = tab.props.name
+}
+/* 处理订单时间格式 */
+const formatDate = (date) => {
+    if (date) {
+        const dt = new Date(date * 1000);
+        const month = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1;
+        const day = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate();
+        return dt.getFullYear() + '/' + month + '/' + day;
+    }
+    return '';
+};
+/* 处理客户名称 */
+const customerName = (value) => {
+    if (value && customerList.value && customerList.value.data && customerList.value.data.data) {
+        const type = customerList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 仓库名称 */
+const warehouseName = (value) => {
+    if (value && warehouseList.value && warehouseList.value.data) {
+        const type = warehouseList.value.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 状态*/
+const deliveryName = (value) => {
+    if (value) {
+        return value === 'Y' ? '已入库' : '未入库';
+    }
+}
+/* 出库状态 */
+const outName = (value) => {
+    if (value) {
+        return value === 'Y' ? '已入库' : '未入库';
+    }
+}
+/* 入库类型*/
+const typeName = (value) => {
+    if (value && entryTypeList.value && entryTypeList.value.data && entryTypeList.value.data.data) {
+        const type = entryTypeList.value.data.data.find(type => type.value === value);
+        return type ? type.label : '';
+    }
+}
+/* 出库类型*/
+const typeOutName = (value) => {
+    if (value && outTypeList.value && outTypeList.value.data && outTypeList.value.data.data) {
+        const type = outTypeList.value.data.data.find(type => type.value === value);
+        return type ? type.label : '';
+    }
+}
+onMounted(() => {
+    getentryList()
+    getInforList()
+});
+/* 获取入库列表 */
+const getentryList = async () => {
+    entryOutAPI.getWarehouseEntry(params).then((res: any) => {
+        rows.value = res.data.data; // 更新rows的值
+    });
+};
+/* 获取出库列表 */
+const getoutList = async () => {
+    entryOutAPI.getWarehouseOut(params).then((res: any) => {
+        outrows.value = res.data.data; // 更新rows的值
+    });
+};
+/* 获取仓库,字典,客户信息 */
+const getInforList = async () => {
+    warehouseList.value = await infoApi.warehouseList({})//获取仓库列表
+    deliveryList.value = await dictionaryAPI.getExpressList(params)//获取配送方式
+    /*  customerList.value = await infoApi.customer({})//获取客户列表
+     collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表
+      //入库类型 
+     API_Setting.getPage({ dictType: "warehouse_entry_type" }).then((res) => {
+        this.entryList = res.data;
+      });
+       出库类型 
+      API_Setting.getPage({ dictType: "out_warehouse_type" }).then((res) => {
+        this.outList = res.data;
+      });
+     */
+    entryTypeList.value = await dictionaryAPI.getPage({ dictType: "warehouse_entry_type" })//获取入库类型 
+    outTypeList.value = await dictionaryAPI.getPage({ dictType: "out_warehouse_type" })//获取出库类型
+}
+const deliveryOrder = async (row?: any) => {
+
+}
+</script>

+ 180 - 0
src/views/Inventory/index.vue

@@ -0,0 +1,180 @@
+<template>
+    <div>
+        <!--   <ul class="flex space-x-2 rtl:space-x-reverse">
+            <li>
+                <a href="javascript:;" class="text-primary hover:underline">首页</a>
+            </li>
+            <li class="before:content-['/'] ltr:before:mr-2 rtl:before:ml-2">
+                <span>订单列表</span>
+            </li>
+        </ul> -->
+
+        <div class="panel pb-0 mt-6">
+
+            <div class="flex md:items-center md:flex-row flex-col mb-5 gap-5">
+
+                <div class="flex items-center gap-5 ltr:ml-auto rtl:mr-auto">
+                    <div class="dropdown">
+                        <Popper :placement="store.rtlClass === 'rtl' ? 'bottom-end' : 'bottom-start'" offsetDistance="0"
+                            class="align-middle">
+                            <button type="button"
+                                class="flex items-center border font-semibold border-[#e0e6ed] dark:border-[#253b5c] rounded-md px-4 py-2 text-sm dark:bg-[#1b2e4b] dark:text-white-dark">
+                                <span class="ltr:mr-1 rtl:ml-1">Columns</span>
+                                <icon-caret-down class="w-5 h-5" />
+                            </button>
+                            <template #content>
+                                <ul class="whitespace-nowrap">
+                                    <template v-for="(col, i) in cols" :key="i">
+                                        <li>
+                                            <div class="flex items-center px-4 py-1">
+                                                <label class="cursor-pointer mb-0">
+                                                    <input type="checkbox" class="form-checkbox" :id="`chk-${i}`"
+                                                        :value="col.field" @change="col.hide = !$event.target.checked"
+                                                        :checked="!col.hide" />
+                                                    <span :for="`chk-${i}`" class="ltr:ml-2 rtl:mr-2">{{ col.title
+                                                        }}</span>
+                                                </label>
+                                            </div>
+                                        </li>
+                                    </template>
+                                </ul>
+                            </template>
+                        </Popper>
+                    </div>
+                    <div>
+                        <input v-model="search" type="text" class="form-input" placeholder="Search..." />
+                    </div>
+                </div>
+            </div>
+
+            <div class="datatable">
+                <vue3-datatable :rows="rows" :columns="cols" :totalRows="rows?.length" :sortable="true" :search="search"
+                    skin="whitespace-nowrap bh-table-hover"
+                    firstArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M13 19L7 12L13 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M16.9998 19L10.9998 12L16.9998 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    lastArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M11 19L17 12L11 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M6.99976 19L12.9998 12L6.99976 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> '
+                    previousArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M15 5L9 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    nextArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M9 5L15 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'>
+                   <!--  <template #transfer_time="data">
+                        {{ formatDate(data.value.transfer_time) }}
+                    </template> -->
+                    <template #warehouse_id="data">
+                        {{ warehouseName(data.value.warehouse_id) }}
+                    </template>
+                    <!-- <template #out_warehouse_id="data">
+                        {{ warehouseName(data.value.out_warehouse_id) }}
+                    </template> -->
+                    <template #send_type="data">
+                        {{ deliveryName(data.value.send_type) }}
+                    </template>
+                    <!-- <template #order_vo.pay_type="data">
+                        {{ collectingAccountName(data.value.order_vo.pay_type) }}
+                    </template>-->
+                    
+                    <template #status="data">
+                        {{ typeName(data.value.status) }}
+                    </template> 
+                    <!-- 定义操作栏的模板 -->
+                   <!--  <template #actions="{ row }">
+                        <button @click="deliveryOrder(row)" class="btn btn-primary">发货</button>
+                    </template> -->
+                    <template #isActive="data">
+                        <!--  <span class="capitalize" :class="data.value.isActive ? 'text-success' : 'text-danger'">{{
+                            data._rawValue }}</span> -->
+                    </template>
+                </vue3-datatable>
+            </div>
+        </div>
+    </div>
+</template>
+<script setup lang="ts">
+import { ref, onMounted } from 'vue';
+import Vue3Datatable from '@bhplugin/vue3-datatable';
+import { useAppStore } from '@/stores/index';
+import { useRouter } from 'vue-router';
+import { useMeta } from '@/composables/use-meta';
+import { inventoryAPI, infoApi, dictionaryAPI } from '@/api/api'
+import IconBell from '@/components/icon/icon-bell.vue';
+import IconCaretDown from '@/components/icon/icon-caret-down.vue';
+
+
+useMeta({ title: 'Column Chooser Table' });
+const router = useRouter();
+const store = useAppStore();
+const search = ref('');
+const rows = ref([]); // 初始化rows为响应式引用
+const customerList = ref([])//初始化客户列表
+const warehouseList = ref([])//初始化客户列表
+const collectingAccountList = ref([])//初始化客户列表
+const deliveryList = ref([])//初始化客户列表
+const orderTypeList = ref([])//初始化客户列表
+const cols = ref([
+    { field: 'sn', title: '盘点单编号', isUnique: true, hide: false },
+    { field: 'inventory_time', title: '盘点日期', hide: false },
+    { field: 'warehouse_id', title: '仓库', hide: false },
+    { field: 'status', title: '状态', hide: false },
+   /*  { field: 'send_type', title: '配送方式', hide: false },
+    { field: 'status', title: '状态', hide: false }, */
+    { field: 'actions', title: '操作', hide: true }
+]);
+const params = ref([
+    { page_no: 1, page_size: 10 }
+])
+/* 处理订单时间格式 */
+const formatDate = (date) => {
+    if (date) {
+        const dt = new Date(date * 1000);
+        const month = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1;
+        const day = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate();
+        return dt.getFullYear() + '/' + month + '/' + day;
+    }
+    return '';
+};
+/* 处理客户名称 */
+const customerName = (value) => {
+    if (value && customerList.value && customerList.value.data && customerList.value.data.data) {
+        const type = customerList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 仓库名称 */
+const warehouseName = (value) => {
+    if (value && warehouseList.value && warehouseList.value.data) {
+        const type = warehouseList.value.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 配送方式*/
+const deliveryName = (value) => {
+    if (value && deliveryList.value && deliveryList.value.data && deliveryList.value.data.data) {
+        const type = deliveryList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 状态*/
+const typeName = (value) => {
+    if (value ) {
+        return value=='HAS_HANDLE' ? '已处理' : '未处理';
+    }
+}
+onMounted(() => {
+    getOrderList()
+    getInforList()
+});
+/* 获取调拨列表 */
+const getOrderList = async () => {
+    inventoryAPI.getInventory(params).then((res: any) => {
+        rows.value = res.data.data; // 更新rows的值
+    });
+};
+/* 获取仓库,字典,客户信息 */
+const getInforList = async () => {
+    warehouseList.value = await infoApi.warehouseList({})//获取仓库列表
+    deliveryList.value = await dictionaryAPI.getExpressList(params)//获取配送方式
+   /*  customerList.value = await infoApi.customer({})//获取客户列表
+    collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表*/
+    orderTypeList.value = await dictionaryAPI.getPage({ dictType: "transfer_status" })//获取状态 
+}
+const deliveryOrder = async (row?: any) => {
+   
+}
+</script>

+ 181 - 0
src/views/allocation/index.vue

@@ -0,0 +1,181 @@
+<template>
+    <div>
+        <!--   <ul class="flex space-x-2 rtl:space-x-reverse">
+            <li>
+                <a href="javascript:;" class="text-primary hover:underline">首页</a>
+            </li>
+            <li class="before:content-['/'] ltr:before:mr-2 rtl:before:ml-2">
+                <span>订单列表</span>
+            </li>
+        </ul> -->
+
+        <div class="panel pb-0 mt-6">
+
+            <div class="flex md:items-center md:flex-row flex-col mb-5 gap-5">
+
+                <div class="flex items-center gap-5 ltr:ml-auto rtl:mr-auto">
+                    <div class="dropdown">
+                        <Popper :placement="store.rtlClass === 'rtl' ? 'bottom-end' : 'bottom-start'" offsetDistance="0"
+                            class="align-middle">
+                            <button type="button"
+                                class="flex items-center border font-semibold border-[#e0e6ed] dark:border-[#253b5c] rounded-md px-4 py-2 text-sm dark:bg-[#1b2e4b] dark:text-white-dark">
+                                <span class="ltr:mr-1 rtl:ml-1">Columns</span>
+                                <icon-caret-down class="w-5 h-5" />
+                            </button>
+                            <template #content>
+                                <ul class="whitespace-nowrap">
+                                    <template v-for="(col, i) in cols" :key="i">
+                                        <li>
+                                            <div class="flex items-center px-4 py-1">
+                                                <label class="cursor-pointer mb-0">
+                                                    <input type="checkbox" class="form-checkbox" :id="`chk-${i}`"
+                                                        :value="col.field" @change="col.hide = !$event.target.checked"
+                                                        :checked="!col.hide" />
+                                                    <span :for="`chk-${i}`" class="ltr:ml-2 rtl:mr-2">{{ col.title
+                                                        }}</span>
+                                                </label>
+                                            </div>
+                                        </li>
+                                    </template>
+                                </ul>
+                            </template>
+                        </Popper>
+                    </div>
+                    <div>
+                        <input v-model="search" type="text" class="form-input" placeholder="Search..." />
+                    </div>
+                </div>
+            </div>
+
+            <div class="datatable">
+                <vue3-datatable :rows="rows" :columns="cols" :totalRows="rows?.length" :sortable="true" :search="search"
+                    skin="whitespace-nowrap bh-table-hover"
+                    firstArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M13 19L7 12L13 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M16.9998 19L10.9998 12L16.9998 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    lastArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M11 19L17 12L11 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M6.99976 19L12.9998 12L6.99976 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> '
+                    previousArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M15 5L9 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
+                    nextArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M9 5L15 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'>
+                   <!--  <template #transfer_time="data">
+                        {{ formatDate(data.value.transfer_time) }}
+                    </template> -->
+                    <template #in_warehouse_id="data">
+                        {{ warehouseName(data.value.in_warehouse_id) }}
+                    </template>
+                    <template #out_warehouse_id="data">
+                        {{ warehouseName(data.value.out_warehouse_id) }}
+                    </template>
+                    <template #send_type="data">
+                        {{ deliveryName(data.value.send_type) }}
+                    </template>
+                    <!-- <template #order_vo.pay_type="data">
+                        {{ collectingAccountName(data.value.order_vo.pay_type) }}
+                    </template>-->
+                    
+                    <template #status="data">
+                        {{ typeName(data.value.status) }}
+                    </template> 
+                    <!-- 定义操作栏的模板 -->
+                   <!--  <template #actions="{ row }">
+                        <button @click="deliveryOrder(row)" class="btn btn-primary">发货</button>
+                    </template> -->
+                    <template #isActive="data">
+                        <!--  <span class="capitalize" :class="data.value.isActive ? 'text-success' : 'text-danger'">{{
+                            data._rawValue }}</span> -->
+                    </template>
+                </vue3-datatable>
+            </div>
+        </div>
+    </div>
+</template>
+<script setup lang="ts">
+import { ref, onMounted } from 'vue';
+import Vue3Datatable from '@bhplugin/vue3-datatable';
+import { useAppStore } from '@/stores/index';
+import { useRouter } from 'vue-router';
+import { useMeta } from '@/composables/use-meta';
+import { allocationAPI, infoApi, dictionaryAPI } from '@/api/api'
+import IconBell from '@/components/icon/icon-bell.vue';
+import IconCaretDown from '@/components/icon/icon-caret-down.vue';
+
+
+useMeta({ title: 'Column Chooser Table' });
+const router = useRouter();
+const store = useAppStore();
+const search = ref('');
+const rows = ref([]); // 初始化rows为响应式引用
+const customerList = ref([])//初始化客户列表
+const warehouseList = ref([])//初始化客户列表
+const collectingAccountList = ref([])//初始化客户列表
+const deliveryList = ref([])//初始化客户列表
+const orderTypeList = ref([])//初始化客户列表
+const cols = ref([
+    { field: 'sn', title: '调拨单编号', isUnique: true, hide: false },
+    { field: 'transfer_time', title: '调拨时间', hide: false },
+    { field: 'out_warehouse_id', title: '调出仓库', hide: false },
+    { field: 'in_warehouse_id', title: '调入仓库', hide: false },
+    { field: 'send_type', title: '配送方式', hide: false },
+    { field: 'status', title: '状态', hide: false },
+    { field: 'actions', title: '操作', hide: true }
+]);
+const params = ref([
+    { page_no: 1, page_size: 10 }
+])
+/* 处理订单时间格式 */
+const formatDate = (date) => {
+    if (date) {
+        const dt = new Date(date * 1000);
+        const month = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1;
+        const day = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate();
+        return dt.getFullYear() + '/' + month + '/' + day;
+    }
+    return '';
+};
+/* 处理客户名称 */
+const customerName = (value) => {
+    if (value && customerList.value && customerList.value.data && customerList.value.data.data) {
+        const type = customerList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 仓库名称 */
+const warehouseName = (value) => {
+    if (value && warehouseList.value && warehouseList.value.data) {
+        const type = warehouseList.value.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 配送方式*/
+const deliveryName = (value) => {
+    if (value && deliveryList.value && deliveryList.value.data && deliveryList.value.data.data) {
+        const type = deliveryList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 状态*/
+const typeName = (value) => {
+    if (value && orderTypeList.value && orderTypeList.value.data && orderTypeList.value.data.data) {
+        const type = orderTypeList.value.data.data.find(type => type.value === value);
+        return type ? type.label : '';
+    }
+}
+onMounted(() => {
+    getOrderList()
+    getInforList()
+});
+/* 获取调拨列表 */
+const getOrderList = async () => {
+    allocationAPI.stockTransfer(params).then((res: any) => {
+        rows.value = res.data.data; // 更新rows的值
+    });
+};
+/* 获取仓库,字典,客户信息 */
+const getInforList = async () => {
+    warehouseList.value = await infoApi.warehouseList({})//获取仓库列表
+    deliveryList.value = await dictionaryAPI.getExpressList(params)//获取配送方式
+   /*  customerList.value = await infoApi.customer({})//获取客户列表
+    collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表*/
+    orderTypeList.value = await dictionaryAPI.getPage({ dictType: "transfer_status" })//获取状态 
+}
+const deliveryOrder = async (row?: any) => {
+   
+}
+</script>

+ 95 - 523
src/views/apps/order.vue

@@ -54,12 +54,31 @@
                     lastArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M11 19L17 12L11 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path opacity="0.5" d="M6.99976 19L12.9998 12L6.99976 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> '
                     previousArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M15 5L9 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'
                     nextArrow='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 rtl:rotate-180"> <path d="M9 5L15 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg>'>
-                    <template #dob="data">
-                        {{ formatDate(data._rawValue.order_time) }}
+                    <template #order_vo.order_time="data">
+                        {{ formatDate(data.value.order_vo.order_time) }}
+                    </template>
+                    <template #order_vo.member_id="data">
+                        {{ customerName(data.value.order_vo.member_id) }}
+                    </template>
+                    <template #warehouse_id="data">
+                        {{ warehouseName(data.value.warehouse_id) }}
+                    </template>
+                    <template #order_vo.pay_type="data">
+                        {{ collectingAccountName(data.value.order_vo.pay_type) }}
+                    </template>
+                    <template #order_vo.send_type="data">
+                        {{ deliveryName(data.value.order_vo.send_type) }}
+                    </template>
+                    <template #order_vo.status="data">
+                        {{ orderTypeName(data.value.order_vo.status) }}
+                    </template>
+                    <!-- 定义操作栏的模板 -->
+                    <template #actions="data">
+                        <button @click="deliveryOrder(data)" class="btn btn-primary">发货</button>
                     </template>
                     <template #isActive="data">
-                        <span class="capitalize" :class="data.value.isActive ? 'text-success' : 'text-danger'">{{
-                            data._rawValue }}</span>
+                        <!--  <span class="capitalize" :class="data.value.isActive ? 'text-success' : 'text-danger'">{{
+                            data._rawValue }}</span> -->
                     </template>
                 </vue3-datatable>
             </div>
@@ -70,550 +89,103 @@
 import { ref, onMounted } from 'vue';
 import Vue3Datatable from '@bhplugin/vue3-datatable';
 import { useAppStore } from '@/stores/index';
+import { useRouter } from 'vue-router';
 import { useMeta } from '@/composables/use-meta';
-import { orderApi } from '@/api/api'
+import { orderApi, infoApi, dictionaryAPI } from '@/api/api'
 import IconBell from '@/components/icon/icon-bell.vue';
 import IconCaretDown from '@/components/icon/icon-caret-down.vue';
 
 
 useMeta({ title: 'Column Chooser Table' });
+const router = useRouter();
 const store = useAppStore();
 const search = ref('');
 const rows = ref([]); // 初始化rows为响应式引用
+const customerList = ref([])//初始化客户列表
+const warehouseList = ref([])//初始化客户列表
+const collectingAccountList = ref([])//初始化客户列表
+const deliveryList = ref([])//初始化客户列表
+const orderTypeList = ref([])//初始化客户列表
 const cols = ref([
     { field: 'sn', title: '订单编号', isUnique: true, hide: false },
-    { field: 'member_id', title: '客户', hide: false },
-    { field: 'order_time', title: '下单时间', hide: false },
+    { field: 'order_vo.member_id', title: '客户', hide: false },
+    { field: 'order_vo.order_time', title: '下单时间', hide: false },
     { field: 'warehouse_id', title: '仓库名称', hide: false },
-    { field: 'send_type', title: '配送方式', hide: false },
-    { field: 'pay_type', title: '付款方式', hide: false },
-    { field: 'pay_price', title: '实付金额', hide: false },
-    { field: 'status', title: '订单状态', type: '', hide: true },
-    { field: 'extension', title: '延期次数', type: '', hide: true },
-    { field: 'type', title: '订单类型', type: '', hide: true },
+    { field: 'order_vo.send_type', title: '配送方式', hide: false },
+    { field: 'order_vo.pay_type', title: '付款方式', hide: false },
+    /* { field: 'pay_price', title: '实付金额', hide: false }, */
+    { field: 'order_vo.status', title: '订单状态', type: '', hide: true },
+    /* { field: 'extension', title: '延期次数', type: '', hide: true },
+    { field: 'type', title: '订单类型', type: '', hide: true }, */
+    { field: 'actions', title: '操作', hide: false }
 ]);
-/* const rows = ref(
-    [
-        {
-            id: 1,
-            firstName: 'Caroline',
-            lastName: 'Jensen',
-            email: 'carolinejensen@zidant.com',
-            dob: '2004-05-28',
-            address: {
-                street: '529 Scholes Street',
-                city: 'Temperanceville',
-                zipcode: 5235,
-                geo: {
-                    lat: 23.806115,
-                    lng: 164.677197,
-                },
-            },
-            phone: '+1 (821) 447-3782',
-            isActive: true,
-            age: 39,
-            company: 'POLARAX',
-        },
-        {
-            id: 2,
-            firstName: 'Celeste',
-            lastName: 'Grant',
-            email: 'celestegrant@polarax.com',
-            dob: '1989-11-19',
-            address: {
-                street: '639 Kimball Street',
-                city: 'Bascom',
-                zipcode: 8907,
-                geo: {
-                    lat: 65.954483,
-                    lng: 98.906478,
-                },
-            },
-            phone: '+1 (838) 515-3408',
-            isActive: false,
-            age: 32,
-            company: 'MANGLO',
-        },
-        {
-            id: 3,
-            firstName: 'Tillman',
-            lastName: 'Forbes',
-            email: 'tillmanforbes@manglo.com',
-            dob: '2016-09-05',
-            address: {
-                street: '240 Vandalia Avenue',
-                city: 'Thynedale',
-                zipcode: 8994,
-                geo: {
-                    lat: -34.949388,
-                    lng: -82.958111,
-                },
-            },
-            phone: '+1 (969) 496-2892',
-            isActive: false,
-            age: 26,
-            company: 'APPLIDECK',
-        },
-        {
-            id: 4,
-            firstName: 'Daisy',
-            lastName: 'Whitley',
-            email: 'daisywhitley@applideck.com',
-            dob: '1987-03-23',
-            address: {
-                street: '350 Pleasant Place',
-                city: 'Idledale',
-                zipcode: 9369,
-                geo: {
-                    lat: -54.458809,
-                    lng: -127.476556,
-                },
-            },
-            phone: '+1 (861) 564-2877',
-            isActive: true,
-            age: 21,
-            company: 'VOLAX',
-        },
-        {
-            id: 5,
-            firstName: 'Weber',
-            lastName: 'Bowman',
-            email: 'weberbowman@volax.com',
-            dob: '1983-02-24',
-            address: {
-                street: '154 Conway Street',
-                city: 'Broadlands',
-                zipcode: 8131,
-                geo: {
-                    lat: 54.501351,
-                    lng: -167.47138,
-                },
-            },
-            phone: '+1 (962) 466-3483',
-            isActive: false,
-            age: 26,
-            company: 'ORBAXTER',
-        },
-        {
-            id: 6,
-            firstName: 'Buckley',
-            lastName: 'Townsend',
-            email: 'buckleytownsend@orbaxter.com',
-            dob: '2011-05-29',
-            address: {
-                street: '131 Guernsey Street',
-                city: 'Vallonia',
-                zipcode: 6779,
-                geo: {
-                    lat: -2.681655,
-                    lng: 3.528942,
-                },
-            },
-            phone: '+1 (884) 595-2643',
-            isActive: true,
-            age: 40,
-            company: 'OPPORTECH',
-        },
-        {
-            id: 7,
-            firstName: 'Latoya',
-            lastName: 'Bradshaw',
-            email: 'latoyabradshaw@opportech.com',
-            dob: '2010-11-23',
-            address: {
-                street: '668 Lenox Road',
-                city: 'Lowgap',
-                zipcode: 992,
-                geo: {
-                    lat: 36.026423,
-                    lng: 130.412198,
-                },
-            },
-            phone: '+1 (906) 474-3155',
-            isActive: true,
-            age: 24,
-            company: 'GORGANIC',
-        },
-        {
-            id: 8,
-            firstName: 'Kate',
-            lastName: 'Lindsay',
-            email: 'katelindsay@gorganic.com',
-            dob: '1987-07-02',
-            address: {
-                street: '773 Harrison Avenue',
-                city: 'Carlton',
-                zipcode: 5909,
-                geo: {
-                    lat: 42.464724,
-                    lng: -12.948403,
-                },
-            },
-            phone: '+1 (930) 546-2952',
-            isActive: true,
-            age: 24,
-            company: 'AVIT',
-        },
-        {
-            id: 9,
-            firstName: 'Marva',
-            lastName: 'Sandoval',
-            email: 'marvasandoval@avit.com',
-            dob: '2010-11-02',
-            address: {
-                street: '200 Malta Street',
-                city: 'Tuskahoma',
-                zipcode: 1292,
-                geo: {
-                    lat: -52.206169,
-                    lng: 74.19452,
-                },
-            },
-            phone: '+1 (927) 566-3600',
-            isActive: false,
-            age: 28,
-            company: 'QUILCH',
-        },
-        {
-            id: 10,
-            firstName: 'Decker',
-            lastName: 'Russell',
-            email: 'deckerrussell@quilch.com',
-            dob: '1994-04-21',
-            address: {
-                street: '708 Bath Avenue',
-                city: 'Coultervillle',
-                zipcode: 1268,
-                geo: {
-                    lat: -41.550295,
-                    lng: -146.598075,
-                },
-            },
-            phone: '+1 (846) 535-3283',
-            isActive: false,
-            age: 27,
-            company: 'MEMORA',
-        },
-        {
-            id: 11,
-            firstName: 'Odom',
-            lastName: 'Mills',
-            email: 'odommills@memora.com',
-            dob: '2010-01-24',
-            address: {
-                street: '907 Blake Avenue',
-                city: 'Churchill',
-                zipcode: 4400,
-                geo: {
-                    lat: -56.061694,
-                    lng: -130.238523,
-                },
-            },
-            phone: '+1 (995) 525-3402',
-            isActive: true,
-            age: 34,
-            company: 'ZORROMOP',
-        },
-        {
-            id: 12,
-            firstName: 'Sellers',
-            lastName: 'Walters',
-            email: 'sellerswalters@zorromop.com',
-            dob: '1975-11-12',
-            address: {
-                street: '978 Oakland Place',
-                city: 'Gloucester',
-                zipcode: 3802,
-                geo: {
-                    lat: 11.732587,
-                    lng: 96.118099,
-                },
-            },
-            phone: '+1 (830) 430-3157',
-            isActive: true,
-            age: 28,
-            company: 'ORBOID',
-        },
-        {
-            id: 13,
-            firstName: 'Wendi',
-            lastName: 'Powers',
-            email: 'wendipowers@orboid.com',
-            dob: '1979-06-02',
-            address: {
-                street: '376 Greenpoint Avenue',
-                city: 'Elliott',
-                zipcode: 9149,
-                geo: {
-                    lat: -78.159578,
-                    lng: -9.835103,
-                },
-            },
-            phone: '+1 (863) 457-2088',
-            isActive: true,
-            age: 31,
-            company: 'SNORUS',
-        },
-        {
-            id: 14,
-            firstName: 'Sophie',
-            lastName: 'Horn',
-            email: 'sophiehorn@snorus.com',
-            dob: '2018-09-20',
-            address: {
-                street: '343 Doughty Street',
-                city: 'Homestead',
-                zipcode: 330,
-                geo: {
-                    lat: 65.484087,
-                    lng: 137.413998,
-                },
-            },
-            phone: '+1 (885) 418-3948',
-            isActive: true,
-            age: 22,
-            company: 'XTH',
-        },
-        {
-            id: 15,
-            firstName: 'Levine',
-            lastName: 'Rodriquez',
-            email: 'levinerodriquez@xth.com',
-            dob: '1973-02-08',
-            address: {
-                street: '643 Allen Avenue',
-                city: 'Weedville',
-                zipcode: 8931,
-                geo: {
-                    lat: -63.185586,
-                    lng: 117.327808,
-                },
-            },
-            phone: '+1 (999) 565-3239',
-            isActive: true,
-            age: 27,
-            company: 'COMTRACT',
-        },
-        {
-            id: 16,
-            firstName: 'Little',
-            lastName: 'Hatfield',
-            email: 'littlehatfield@comtract.com',
-            dob: '2012-01-03',
-            address: {
-                street: '194 Anthony Street',
-                city: 'Williston',
-                zipcode: 7456,
-                geo: {
-                    lat: 47.480837,
-                    lng: 6.085909,
-                },
-            },
-            phone: '+1 (812) 488-3011',
-            isActive: false,
-            age: 33,
-            company: 'ZIDANT',
-        },
-        {
-            id: 17,
-            firstName: 'Larson',
-            lastName: 'Kelly',
-            email: 'larsonkelly@zidant.com',
-            dob: '2010-06-14',
-            address: {
-                street: '978 Indiana Place',
-                city: 'Innsbrook',
-                zipcode: 639,
-                geo: {
-                    lat: -71.766732,
-                    lng: 150.854345,
-                },
-            },
-            phone: '+1 (892) 484-2162',
-            isActive: true,
-            age: 20,
-            company: 'SUREPLEX',
-        },
-        {
-            id: 18,
-            firstName: 'Kendra',
-            lastName: 'Molina',
-            email: 'kendramolina@sureplex.com',
-            dob: '2002-07-19',
-            address: {
-                street: '567 Charles Place',
-                city: 'Kimmell',
-                zipcode: 1966,
-                geo: {
-                    lat: 50.765816,
-                    lng: -117.106499,
-                },
-            },
-            phone: '+1 (920) 528-3330',
-            isActive: false,
-            age: 31,
-            company: 'DANJA',
-        },
-        {
-            id: 19,
-            firstName: 'Ebony',
-            lastName: 'Livingston',
-            email: 'ebonylivingston@danja.com',
-            dob: '1994-10-18',
-            address: {
-                street: '284 Cass Place',
-                city: 'Navarre',
-                zipcode: 948,
-                geo: {
-                    lat: 65.271256,
-                    lng: -83.064729,
-                },
-            },
-            phone: '+1 (970) 591-3039',
-            isActive: false,
-            age: 33,
-            company: 'EURON',
-        },
-        {
-            id: 20,
-            firstName: 'Kaufman',
-            lastName: 'Rush',
-            email: 'kaufmanrush@euron.com',
-            dob: '2011-07-10',
-            address: {
-                street: '408 Kingsland Avenue',
-                city: 'Beaulieu',
-                zipcode: 7911,
-                geo: {
-                    lat: 41.513153,
-                    lng: 54.821641,
-                },
-            },
-            phone: '+1 (924) 463-2934',
-            isActive: false,
-            age: 39,
-            company: 'ILLUMITY',
-        },
-        {
-            id: 21,
-            firstName: 'Frank',
-            lastName: 'Hays',
-            email: 'frankhays@illumity.com',
-            dob: '2005-06-15',
-            address: {
-                street: '973 Caton Place',
-                city: 'Dargan',
-                zipcode: 4104,
-                geo: {
-                    lat: 63.314988,
-                    lng: -138.771323,
-                },
-            },
-            phone: '+1 (930) 577-2670',
-            isActive: false,
-            age: 31,
-            company: 'SYBIXTEX',
-        },
-        {
-            id: 22,
-            firstName: 'Carmella',
-            lastName: 'Mccarty',
-            email: 'carmellamccarty@sybixtex.com',
-            dob: '1980-03-06',
-            address: {
-                street: '919 Judge Street',
-                city: 'Canby',
-                zipcode: 8283,
-                geo: {
-                    lat: 9.198597,
-                    lng: -138.809971,
-                },
-            },
-            phone: '+1 (876) 456-3218',
-            isActive: true,
-            age: 21,
-            company: 'ZEDALIS',
-        },
-        {
-            id: 23,
-            firstName: 'Massey',
-            lastName: 'Owen',
-            email: 'masseyowen@zedalis.com',
-            dob: '2012-03-01',
-            address: {
-                street: '108 Seaview Avenue',
-                city: 'Slovan',
-                zipcode: 3599,
-                geo: {
-                    lat: -74.648318,
-                    lng: 99.620699,
-                },
-            },
-            phone: '+1 (917) 567-3786',
-            isActive: false,
-            age: 40,
-            company: 'DYNO',
-        },
-        {
-            id: 24,
-            firstName: 'Lottie',
-            lastName: 'Lowery',
-            email: 'lottielowery@dyno.com',
-            dob: '1982-10-10',
-            address: {
-                street: '557 Meserole Avenue',
-                city: 'Fowlerville',
-                zipcode: 4991,
-                geo: {
-                    lat: 54.811546,
-                    lng: -20.996515,
-                },
-            },
-            phone: '+1 (912) 539-3498',
-            isActive: true,
-            age: 36,
-            company: 'MULTIFLEX',
-        },
-        {
-            id: 25,
-            firstName: 'Addie',
-            lastName: 'Luna',
-            email: 'addieluna@multiflex.com',
-            dob: '1988-05-01',
-            address: {
-                street: '688 Bulwer Place',
-                city: 'Harmon',
-                zipcode: 7664,
-                geo: {
-                    lat: -12.762766,
-                    lng: -39.924497,
-                },
-            },
-            phone: '+1 (962) 537-2981',
-            isActive: true,
-            age: 32,
-            company: 'PHARMACON',
-        },
-    ] || []
-); */
-
+/* 处理订单时间格式 */
 const formatDate = (date) => {
     if (date) {
         const dt = new Date(date * 1000);
         const month = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1;
         const day = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate();
-        return day + '/' + month + '/' + dt.getFullYear();
+        return dt.getFullYear() + '/' + month + '/' + day;
     }
     return '';
 };
+/* 处理客户名称 */
+const customerName = (value) => {
+    if (value && customerList.value && customerList.value.data && customerList.value.data.data) {
+        const type = customerList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 仓库名称 */
+const warehouseName = (value) => {
+    if (value && warehouseList.value && warehouseList.value.data) {
+        const type = warehouseList.value.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 支付列表*/
+const collectingAccountName = (value) => {
+    if (value && collectingAccountList.value && collectingAccountList.value.data && collectingAccountList.value.data.data) {
+        const type = collectingAccountList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 配送方式*/
+const deliveryName = (value) => {
+    if (value && deliveryList.value && deliveryList.value.data && deliveryList.value.data.data) {
+        const type = deliveryList.value.data.data.find(type => type.value === value);
+        return type ? type.label : '';
+    }
+}
+/* 订单状态*/
+const orderTypeName = (value) => {
+    if (value && orderTypeList.value && orderTypeList.value.data && orderTypeList.value.data.data) {
+        const type = orderTypeList.value.data.data.find(type => type.value === value);
+        return type ? type.label : '';
+    }
+}
 onMounted(() => {
     getOrderList()
+    getInforList()
 });
+/* 获取订单列表的值 */
 const getOrderList = async () => {
-    orderApi.orderList({ page_no: 1, page_size: 10 }).then((res:any) => {
-        rows.value = res.data.data; // 更新rows的值
+    orderApi.orderList({ page_no: 1, page_size: 10, selectType: 'to_be_send' }).then((res: any) => {
+        rows.value = res.data.records; // 更新rows的值
+    });
+};
+/* 获取仓库,字典,客户信息 */
+const getInforList = async () => {
+    warehouseList.value = await infoApi.warehouseList({})//获取仓库列表
+    customerList.value = await infoApi.customer({})//获取客户列表
+    collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表
+    deliveryList.value = await dictionaryAPI.getPage({ dictType: "order_send_type" })//获取配送方式
+    orderTypeList.value = await dictionaryAPI.getPage({ dictType: "Sale_order_send_status" })//获取订单状态
+}
+const deliveryOrder = async (row) => {
+    router.replace({
+        name: 'shippingPage',
+        params: { id: row.value.id }
     });
-
 }
-
 </script>

+ 171 - 0
src/views/apps/shippingPage.vue

@@ -0,0 +1,171 @@
+<template>
+    <div class="p-4">
+        <el-button type="text" @click="goBack">返回</el-button>
+        <!-- <h2 class="text-center my-4">发货管理</h2> -->
+        <div class="text-center my-4">
+            <Vue3Barcode v-if="barcodeValue"  :value='barcodeValue' width="1" height='30'></Vue3Barcode >
+           <!--  <p>RYKS_DDD-20240527-00201</p> -->
+        </div>
+        <el-tabs v-model="activeTab">
+            <el-tab-pane label="商品信息" name="product-info">
+                
+            </el-tab-pane>
+            <el-tab-pane label="基本信息" name="basic-info">
+                <div class="p-4">
+                    <p>订单状态:{{ orderTypeName(shippingForm.order_vo.status) }}</p>
+                    <p>订单类型:{{ shippingForm.order_vo.type=='TO_B'?'销售订单':'租赁订单' }}</p>
+                    <p>下单客户:{{ customerName(shippingForm.order_vo.member_id) }}</p>
+                    <p>付款方式:{{ collectingAccountName(shippingForm.order_vo.pay_type) }}</p>
+                    <p>实付金额:{{ shippingForm.order_vo.pay_price }}</p>
+                    <p>仓库:{{ warehouseName(shippingForm.warehouse_id) }}</p>
+                    <p>收货人:{{ shippingForm.order_vo.customer_name }}</p>
+                    <p>联系电话:{{ shippingForm.order_vo.customer_phone }}</p>
+                    <p>地址:{{  shippingForm.order_vo.province_city_area_address}}</p>
+                    <p>客户备注:{{ shippingForm.order_vo.remark }}</p>
+                    <p>运单号:</p>
+                </div>
+                <!-- <div class="p-4">
+                    <p>3.12 快递已收货</p>
+                    <p>3.13 快递已到达中转站</p>
+                </div> -->
+            </el-tab-pane>
+        </el-tabs>
+        <div class="flex justify-center mt-4">
+            <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>
+        </div>
+    </div>
+</template>
+
+<script lang="ts" setup>
+import { ref,onMounted,watch} from 'vue';
+import { useRouter,useRoute } from 'vue-router';
+import { orderApi, infoApi, dictionaryAPI } from '@/api/api'
+//引入
+import Vue3Barcode from 'vue3-barcode'
+//定义要生成条形码的值
+let barcodeValue = ref('')
+const router = useRouter();
+const route=useRoute()
+const activeTab = ref('product-info');
+const id=ref(route.params.id);
+let shippingForm=ref({
+    order_vo: {
+        status: '',
+        type: '',
+        member_id: '',
+        pay_type: '',
+        pay_price: '',
+        customer_name: '',
+        customer_phone: '',
+        province_city_area_address: '',
+        remark: ''
+    }
+});
+const customerList = ref([])//初始化客户列表
+const warehouseList = ref([])//初始化客户列表
+const collectingAccountList = ref([])//初始化客户列表
+const deliveryList = ref([])//初始化客户列表
+const orderTypeList = ref([])//初始化客户列表
+watch(activeTab, (newValue, oldValue) => {
+    console.log(`Tab changed from ${oldValue} to ${newValue}`);
+    // 这里可以添加一些逻辑,但要确保不会再次修改 activeTab
+});
+onMounted(() => {
+   init()
+   getInforList()
+});
+const goBack = () => {
+    router.push({ name: 'order' });
+};
+
+const scanCode = () => {
+    console.log('扫码出库');
+};
+
+const getOrderNumber = () => {
+    console.log('获取运单号');
+};
+
+const ship = () => {
+    console.log('发货');
+};
+const init= async()=>{
+    try {
+        const res = await orderApi.getSendOrderDetail(id.value);
+        if (res && res.data && res.data.order_vo && res.data.order_vo.sn) {
+            barcodeValue.value = res.data.order_vo.sn;
+            shippingForm.value = res.data;
+            console.log("Barcode value set to:", barcodeValue.value);
+        } else {
+            console.error("Invalid response structure:", res);
+        }
+    } catch (error) {
+        console.error("Failed to fetch order details:", error);
+    }
+}
+/* 处理客户名称 */
+const customerName = (value) => {
+    if (value && customerList.value && customerList.value.data && customerList.value.data.data) {
+        const type = customerList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 仓库名称 */
+const warehouseName = (value) => {
+    if (value && warehouseList.value && warehouseList.value.data) {
+        const type = warehouseList.value.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 支付列表*/
+const collectingAccountName = (value) => {
+    if (value && collectingAccountList.value && collectingAccountList.value.data && collectingAccountList.value.data.data) {
+        const type = collectingAccountList.value.data.data.find(type => type.id === value);
+        return type ? type.name : '';
+    }
+}
+/* 配送方式*/
+const deliveryName = (value) => {
+    if (value && deliveryList.value && deliveryList.value.data && deliveryList.value.data.data) {
+        const type = deliveryList.value.data.data.find(type => type.value === value);
+        return type ? type.label : '';
+    }
+}
+/* 订单状态*/
+const orderTypeName = (value) => {
+    if (value && orderTypeList.value && orderTypeList.value.data && orderTypeList.value.data.data) {
+        const type = orderTypeList.value.data.data.find(type => type.value === value);
+        return type ? type.label : '';
+    }
+}
+/* 获取仓库,字典,客户信息 */
+const getInforList = async () => {
+    warehouseList.value = await infoApi.warehouseList({})//获取仓库列表
+    customerList.value = await infoApi.customer({})//获取客户列表
+    collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表
+    deliveryList.value = await dictionaryAPI.getPage({ dictType: "order_send_type" })//获取配送方式
+    orderTypeList.value = await dictionaryAPI.getPage({ dictType: "Sale_order_send_status" })//获取订单状态
+}
+</script>
+
+<style scoped>
+.text-center {
+    text-align: center;
+}
+
+.my-4 {
+    margin-top: 1rem;
+    margin-bottom: 1rem;
+}
+
+.mx-auto {
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.p-4 {
+    padding: 1rem;
+}
+</style>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 292 - 405
yarn.lock


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است