Ver código fonte

feat 订单列表

Funny 3 anos atrás
pai
commit
9d7eab51fe

+ 13 - 0
src/api/index.ts

@@ -43,5 +43,18 @@ export const resetPassword = (params: any) => {
   return post('app/login/password/change', params)
 }
 
+// 获取店铺列表
+export const shopList = (params: any) => {
+  return get('app/shop/list', params)
+}
+
+// 删除店铺
+export const deleteShop = (params: any) => {
+  return post('app/shop/delete', params)
+}
 
+// 获取订单列表
+export const orderList = (params: any) => {
+  return get('app/order/listNew', params)
+}
 

+ 25 - 0
src/router/index.ts

@@ -30,6 +30,31 @@ const routes = [
         path: "/management/appInfo",
         name: "appInfo",
         component: () => import('@/views/management/userCenter/appInfo.vue'),
+      },
+      {
+        path: "/management/shop",
+        name: "shop",
+        component: () => import('@/views/management/shop/shop.vue'),
+      },
+      {
+        path: "/management/order",
+        name: "order",
+        component: () => import('@/views/management/order/order.vue'),
+      },
+      {
+        path: "/management/myWallet",
+        name: "myWallet",
+        component: () => import('@/views/management/account/myWallet.vue'),
+      },
+      {
+        path: "/management/rechargeRecord",
+        name: "rechargeRecord",
+        component: () => import('@/views/management/account/rechargeRecord.vue'),
+      },
+      {
+        path: "/management/flowDetail",
+        name: "flowDetail",
+        component: () => import('@/views/management/account/flowDetail.vue'),
       }
     ]
   }

+ 12 - 0
src/views/management/account/flowDetail.vue

@@ -0,0 +1,12 @@
+<script setup lang='ts'>
+import { onMounted,ref} from 'vue'
+
+onMounted(() => {
+
+})
+</script>
+<template>
+  <div>我的钱包</div>
+</template>
+<style lang='scss' scoped>
+</style>

+ 12 - 0
src/views/management/account/myWallet.vue

@@ -0,0 +1,12 @@
+<script setup lang='ts'>
+import { onMounted,ref} from 'vue'
+
+onMounted(() => {
+
+})
+</script>
+<template>
+  <div>我的钱包</div>
+</template>
+<style lang='scss' scoped>
+</style>

+ 12 - 0
src/views/management/account/rechargeRecord.vue

@@ -0,0 +1,12 @@
+<script setup lang='ts'>
+import { onMounted, ref } from 'vue'
+
+onMounted(() => {
+
+})
+</script>
+<template>
+  <div>我的钱包</div>
+</template>
+<style lang='scss' scoped>
+</style>

+ 42 - 8
src/views/management/index.vue

@@ -1,19 +1,46 @@
 <script setup lang='ts'>
 import { MenuProps } from 'ant-design-vue';
-import { onMounted, ref } from 'vue'
+import { onMounted, reactive, ref } from 'vue'
 import router from '@/router'
 const selectedKeys = ref<string[]>(['0-0']);
 const openKeys = ref<number[]>([0]);
-const menuList = ref([
+const menuList = reactive([
   {
     name: '用户中心',
+    path: '/management/appInfo',
     items: [
       {
         name: '应用信息',
         path: '/management/appInfo'
       }
     ]
-  }
+  },
+  {
+    name: '店铺管理',
+    path: '/management/shop'
+  },
+  {
+    name: '订单管理',
+    path: '/management/order'
+  },
+  {
+    name: '账户中心',
+    path: '/management/myWallet',
+    items: [
+      {
+        name: '我的钱包',
+        path: '/management/myWallet'
+      },
+      {
+        name: '充值记录',
+        path: '/management/rechargeRecord'
+      },
+      {
+        name: '收支明细',
+        path: '/management/flowDetail'
+      }
+    ]
+  },
 ])
 const handleClick: MenuProps['onClick'] = e => {
   console.log('click', e);
@@ -27,11 +54,18 @@ onMounted(() => {
     <div class="h-full bg-white w-256px">
       <a-menu id="dddddd" v-model:openKeys="openKeys" v-model:selectedKeys="selectedKeys" style="width: 256px"
         mode="inline" @click="handleClick">
-        <a-sub-menu :key="i" v-for="(v, i) in menuList">
-          <template #title>{{ v.name }}</template>
-          <a-menu-item @click="router.push(item.path)" v-if="v.items.length" v-for="(item, index) in v.items"
-            :key="`${i}-${index}`">应用信息</a-menu-item>
-        </a-sub-menu>
+        <template :key="i" v-for="(v, i) in menuList">
+          <a-sub-menu v-if="v.items && v.items.length" :key="i">
+            <template #title>{{ v.name }}</template>
+            <a-menu-item @click="router.push(item.path)" v-for="(item, index) in v.items" :key="`${i}-${index}`">
+              {{ item.name }}
+            </a-menu-item>
+          </a-sub-menu>
+          <a-menu-item v-else @click="router.push(v.path)" :key="`${i}`">
+            {{ v.name }}
+          </a-menu-item>
+        </template>
+
       </a-menu>
     </div>
     <div class="w-full h-full px-20px py-20px overflow-auto">

+ 203 - 0
src/views/management/order/order.vue

@@ -0,0 +1,203 @@
+<script setup lang='ts'>
+import { onMounted, reactive, ref } from 'vue'
+import { orderList } from '@/api'
+import { message } from 'ant-design-vue';
+import dayjs, { Dayjs } from 'dayjs';
+let time = ref<[Dayjs, Dayjs]>([
+  dayjs().subtract(7, 'day'),
+  dayjs(),
+])
+interface FormState {
+  searchType: number;
+  cityName: string;
+  shopId?: number;
+  deliveryId?: number;
+  status: number;
+  startDate?: string;
+  endDate?: string;
+  searchKey: string;
+  searchKeyType: number;
+  pageNum: number;
+  pageSize: number;
+
+}
+const formState = reactive<FormState>({
+  searchType: 1,
+  cityName: '',
+  status: 99,
+  searchKey: '',
+  searchKeyType: 5,
+  pageNum: 1,
+  pageSize: 10,
+});
+const columns = reactive([
+  {
+    title: '三方订单号',
+    dataIndex: 'outOrderId',
+    align: 'center',
+  },
+  {
+    title: '城市',
+    dataIndex: 'receiptCityName',
+    align: 'center',
+  },
+  {
+    title: '发件门店',
+    dataIndex: 'shopName',
+    align: 'center',
+  },
+  {
+    title: '收件地址',
+    dataIndex: 'receiptAddress',
+    align: 'center',
+  },
+  {
+    title: '配送平台',
+    dataIndex: 'deliveryName',
+    align: 'center',
+  },
+  {
+    title: '订单状态',
+    dataIndex: 'buttonStatus',
+    align: 'center',
+  },
+  {
+    title: '配送费',
+    dataIndex: 'payAmount',
+    align: 'center',
+  },
+  {
+    title: '优巨订单号',
+    dataIndex: 'orderSn',
+    align: 'center',
+  },
+  {
+    title: '操作',
+    dataIndex: 'operation',
+    fixed: 'right',
+    width: '10%',
+    align: 'center',
+  }
+])
+const pagination = reactive({
+  total: 0,
+  current: formState.pageNum,
+  pageSize: formState.pageSize,
+})
+let data = reactive({
+  arr: []
+})
+const getOrderList = () => {
+  orderList(formState).then((res: any) => {
+    console.log('res', res);
+    if (res.code === 200) {
+      data.arr = res.data.data
+      pagination.total = res.data.totalNums
+    } else {
+      message.error(res.msg)
+    }
+  })
+}
+getOrderList()
+const handleTableChange = (e: any) => {
+  console.log('改变参数:', e);
+  pagination.current = e.current
+  pagination.pageSize = e.pageSize
+  formState.pageNum = e.current
+  formState.pageSize = e.pageSize
+  getOrderList()
+}
+onMounted(() => {
+
+})
+</script>
+<template>
+  <div class="text-20px text-[#222222] font-bold mb-30px">订单管理</div>
+  <a-form :model="formState" name="horizontal_login" layout="inline" autocomplete="off" class="mb-20px">
+    <a-form-item label="城市" name="cityName">
+      <a-input v-model:value="formState.cityName">
+      </a-input>
+    </a-form-item>
+    <a-form-item label="店铺" name="name">
+      <a-input v-model:value="formState.shopId">
+      </a-input>
+    </a-form-item>
+    <a-form-item label="配送平台" name="mobile">
+      <a-input v-model:value="formState.deliveryId">
+      </a-input>
+    </a-form-item>
+    <a-form-item label="订单状态" name="name">
+      <a-input v-model:value="formState.status">
+      </a-input>
+    </a-form-item>
+    <a-form-item label="订单号" name="mobile">
+      <a-input v-model:value="formState.searchKey">
+      </a-input>
+    </a-form-item>
+    <a-form-item label="日期" name="mobile">
+      <a-range-picker v-model:value="time" format="YYYY/MM/DD" />
+    </a-form-item>
+    <a-form-item>
+      <a-button class="ml-20px" type="primary" @click="getOrderList">查 询</a-button>
+      <a-button class="ml-20px" type="primary" ghost html-type="submit">导 出</a-button>
+    </a-form-item>
+  </a-form>
+  <a-table :columns="columns" :data-source="data.arr" :pagination="pagination" bordered :scroll="true"
+    @change="handleTableChange">
+    <template #bodyCell="{ column, text, record }">
+      <template v-if="column.dataIndex === 'deliveries'">
+        <div class="flex justify-center">
+          <img :src="v.logo" alt="" v-for="(v, i) in text" :key="i" class="w-20px h-20px mr-10px">
+        </div>
+      </template>
+      <template v-if="column.dataIndex === 'operation'">
+        <a class="text-blue-500">详情</a>
+      </template>
+    </template>
+    <template #expandedRowRender="{ record }">
+      <div>
+        <div>
+          <div class="text-16px text-[#333333] leading-19px">
+            收发信息
+          </div>
+          <div class="flex ml-124px mt-10px">
+            <div>
+              <div class="flex items-center">
+                <div>发件门店:</div>
+                <div>{{ record.shopName }}</div>
+              </div>
+              <div class="flex items-center">
+                <div>发件人:</div>
+                <div>{{ record.sendContactName }}</div>
+              </div>
+              <div class="flex items-center">
+                <div>发件人电话:</div>
+                <div>{{ record.sendPhone }}</div>
+              </div>
+            </div>
+            <div>
+              <div class="flex items-center">
+                <div>收件地址:</div>
+                <div>{{ record.receiptAddress }}</div>
+              </div>
+              <div class="flex items-center">
+                <div>收件人:</div>
+                <div>{{ record.receiptContactName }}</div>
+              </div>
+              <div class="flex items-center">
+                <div>收件人电话:</div>
+                <div>{{ record.receiptPhone }}</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </template>
+  </a-table>
+
+</template>
+<style lang='scss' scoped>
+.ant-form-inline :deep(.ant-form-item) {
+  margin-bottom: 10px;
+}
+</style>

+ 121 - 0
src/views/management/shop/shop.vue

@@ -0,0 +1,121 @@
+<script setup lang='ts'>
+import { onMounted, reactive, ref } from 'vue'
+import { shopList, deleteShop } from '@/api'
+import { message } from 'ant-design-vue';
+interface FormState {
+  cityName: string;
+  name: string;
+  mobile?: number;
+}
+const formState = reactive<FormState>({
+  cityName: '',
+  name: '',
+});
+const columns = reactive([
+  {
+    title: '门店编号',
+    dataIndex: 'code',
+    align: 'center',
+  },
+  {
+    title: '店铺名称',
+    dataIndex: 'name',
+    align: 'center',
+  },
+  {
+    title: '联系人',
+    dataIndex: 'contactName',
+    align: 'center',
+  },
+  {
+    title: '联系电话',
+    dataIndex: 'mobile',
+    align: 'center',
+  },
+  {
+    title: '城市',
+    dataIndex: 'cityName',
+    align: 'center',
+  },
+  {
+    title: '地址',
+    dataIndex: 'address',
+    align: 'center',
+  },
+  {
+    title: '已获运力',
+    dataIndex: 'deliveries',
+    align: 'center',
+  },
+  {
+    title: '操作',
+    dataIndex: 'operation',
+    fixed: 'right',
+    width: '10%',
+    align: 'center',
+  }
+])
+const data = reactive([])
+const getShopList = () => {
+  shopList(formState).then((res: any) => {
+    console.log('res', res);
+    if (res.code) {
+      Object.assign(data, res.data)
+    }
+  })
+}
+getShopList()
+const onDelete = (shopId: number) => {
+  deleteShop({ shopId }).then((res: any) => {
+    if (res.code === 200) {
+      message.success('已经成功删除!')
+      getShopList()
+    } else {
+      message.error(res.msg)
+    }
+  })
+}
+onMounted(() => {
+
+})
+</script>
+<template>
+  <div class="text-20px text-[#222222] font-bold mb-30px">店铺管理</div>
+  <a-form :model="formState" name="horizontal_login" layout="inline" autocomplete="off" class="mb-20px">
+    <a-form-item label="城市" name="cityName">
+      <a-input v-model:value="formState.cityName">
+      </a-input>
+    </a-form-item>
+    <a-form-item label="店铺名称" name="name">
+      <a-input v-model:value="formState.name">
+      </a-input>
+    </a-form-item>
+    <a-form-item label="联系人电话" name="mobile">
+      <a-input v-model:value="formState.mobile">
+      </a-input>
+    </a-form-item>
+    <a-form-item>
+      <a-button class="ml-20px" type="primary" @click="getShopList">查 询</a-button>
+      <a-button class="ml-20px" type="primary" ghost html-type="submit">导 出</a-button>
+      <a-button class="ml-20px" type="primary" ghost html-type="submit">+新建门店</a-button>
+    </a-form-item>
+  </a-form>
+  <a-table :columns="columns" :data-source="data" :pagination="false" bordered :scroll="true">
+    <template #bodyCell="{ column, text,record  }">
+      <template v-if="column.dataIndex === 'deliveries'">
+        <div class="flex justify-center">
+          <img :src="v.logo" alt="" v-for="(v, i) in text" :key="i" class="w-20px h-20px mr-10px">
+        </div>
+      </template>
+      <template v-if="column.dataIndex === 'operation'">
+        <a class="text-blue-500">编辑</a>
+        <a-popconfirm v-if="data.length" title="确定删除该店铺?" ok-text="确定" cancel-text="取消" @confirm="onDelete(record.id)">
+          <a class="text-blue-500 ml-20px">删除</a>
+        </a-popconfirm>
+      </template>
+    </template>
+  </a-table>
+
+</template>
+<style lang='scss' scoped>
+</style>