zyouan 2 weeks ago
parent
commit
96694bbbc4

+ 8 - 0
src/api/manage.js

@@ -6,6 +6,7 @@ const api = {
   memberList: 'api/admin/logistics/package/memberList',
   detail: 'api/admin/logistics/order/detail',
   packComplete: 'api/admin/logistics/order/packComplete',
+  orderStatusStat: 'api/admin/logistics/order/orderStatusStat',
   complete: 'api/admin/logistics/order/complete',
   img: 'api/admin/upload/image',
   delivery: 'api/admin/logistics/order/delivery',
@@ -79,6 +80,13 @@ export function packComplete (parameter) {
   })
 }
 
+export function orderStatusStatApi () {
+  return request({
+    url: api.orderStatusStat,
+    method: 'post'
+  })
+}
+
 // 完成订单
 export function complete (parameter) {
   return request({

+ 18 - 10
src/config/router.config.js

@@ -13,14 +13,23 @@ export const asyncRouterMap = [
     name: 'list',
     component: BasicLayout,
     meta: { title: '物流' },
-    redirect: '/manager/list/table-list',
+    redirect: '/manager/home',
     children: [
       {
-        path: '/list/member-list/:pageNo([1-9]\\d*)?',
-        name: 'logistics_memberList',
+        path: '/manager/home',
+        name: 'logistics_home',
         hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
-        component: () => import('@/views/list/MemberList'),
-        meta: { title: '唛头列表', keepAlive: true }
+        component: () => import('@/views/list/Home'),
+        meta: { title: '主页', keepAlive: true },
+        props: true
+      },
+      {
+        path: '/list/package-list/:pageNo([1-9]\\d*)?',
+        name: 'logistics_packageList',
+        hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
+        component: () => import('@/views/list/PackageList'),
+        meta: { title: '包裹列表', keepAlive: true },
+        props: true
       },
       {
         path: '/manager/list/table-list/:pageNo([1-9]\\d*)?',
@@ -31,12 +40,11 @@ export const asyncRouterMap = [
         props: true
       },
       {
-        path: '/list/package-list/:pageNo([1-9]\\d*)?',
-        name: 'logistics_packageList',
+        path: '/list/member-list/:pageNo([1-9]\\d*)?',
+        name: 'logistics_memberList',
         hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
-        component: () => import('@/views/list/PackageList'),
-        meta: { title: '包裹列表', keepAlive: true },
-        props: true
+        component: () => import('@/views/list/MemberList'),
+        meta: { title: '唛头列表', keepAlive: true }
       }
       // dashboard
       // {

+ 1 - 1
src/permission.js

@@ -11,7 +11,7 @@ NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
 const allowList = ['login', 'register', 'registerResult'] // no redirect allowList
 const loginRoutePath = '/manager/user/login'
-const defaultRoutePath = '/manager/list/table-list'
+const defaultRoutePath = '/manager/home'
 
 router.beforeEach((to, from, next) => {
   to.meta && typeof to.meta.title !== 'undefined' && setDocumentTitle(`${i18nRender(to.meta.title)} - ${domTitle}`)

+ 0 - 220
src/views/list/BasicList.vue

@@ -1,220 +0,0 @@
-<template>
-  <page-header-wrapper>
-    <a-card :bordered="false">
-      <a-row>
-        <a-col :sm="8" :xs="24">
-          <info title="我的待办" value="8个任务" :bordered="true" />
-        </a-col>
-        <a-col :sm="8" :xs="24">
-          <info title="本周任务平均处理时间" value="32分钟" :bordered="true" />
-        </a-col>
-        <a-col :sm="8" :xs="24">
-          <info title="本周完成任务数" value="24个" />
-        </a-col>
-      </a-row>
-    </a-card>
-
-    <a-card
-      style="margin-top: 24px"
-      :bordered="false"
-      title="标准列表">
-
-      <div slot="extra">
-        <a-radio-group v-model="status">
-          <a-radio-button value="all">全部</a-radio-button>
-          <a-radio-button value="processing">进行中</a-radio-button>
-          <a-radio-button value="waiting">等待中</a-radio-button>
-        </a-radio-group>
-        <a-input-search style="margin-left: 16px; width: 272px;" />
-      </div>
-
-      <div class="operate">
-        <a-button type="dashed" style="width: 100%" icon="plus" @click="add">添加</a-button>
-      </div>
-
-      <a-list size="large" :pagination="{showSizeChanger: true, showQuickJumper: true, pageSize: 5, total: 50}">
-        <a-list-item :key="index" v-for="(item, index) in data">
-          <a-list-item-meta :description="item.description">
-            <a-avatar slot="avatar" size="large" shape="square" :src="item.avatar"/>
-            <a slot="title">{{ item.title }}</a>
-          </a-list-item-meta>
-          <div slot="actions">
-            <a @click="edit(item)">编辑</a>
-          </div>
-          <div slot="actions">
-            <a-dropdown>
-              <a-menu slot="overlay">
-                <a-menu-item><a>编辑</a></a-menu-item>
-                <a-menu-item><a>删除</a></a-menu-item>
-              </a-menu>
-              <a>更多<a-icon type="down"/></a>
-            </a-dropdown>
-          </div>
-          <div class="list-content">
-            <div class="list-content-item">
-              <span>Owner</span>
-              <p>{{ item.owner }}</p>
-            </div>
-            <div class="list-content-item">
-              <span>开始时间</span>
-              <p>{{ item.startAt }}</p>
-            </div>
-            <div class="list-content-item">
-              <a-progress :percent="item.progress.value" :status="!item.progress.status ? null : item.progress.status" style="width: 180px" />
-            </div>
-          </div>
-        </a-list-item>
-      </a-list>
-    </a-card>
-  </page-header-wrapper>
-</template>
-
-<script>
-// 演示如何使用 this.$dialog 封装 modal 组件
-import TaskForm from './modules/TaskForm'
-import Info from './components/Info'
-
-const data = []
-data.push({
-  title: 'Alipay',
-  avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
-  description: '那是一种内在的东西, 他们到达不了,也无法触及的',
-  owner: '付晓晓',
-  startAt: '2018-07-26 22:44',
-  progress: {
-    value: 90
-  }
-})
-data.push({
-  title: 'Angular',
-  avatar: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
-  description: '希望是一个好东西,也许是最好的,好东西是不会消亡的',
-  owner: '曲丽丽',
-  startAt: '2018-07-26 22:44',
-  progress: {
-    value: 54
-  }
-})
-data.push({
-  title: 'Ant Design',
-  avatar: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
-  description: '生命就像一盒巧克力,结果往往出人意料',
-  owner: '林东东',
-  startAt: '2018-07-26 22:44',
-  progress: {
-    value: 66
-  }
-})
-data.push({
-  title: 'Ant Design Pro',
-  avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
-  description: '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆',
-  owner: '周星星',
-  startAt: '2018-07-26 22:44',
-  progress: {
-    value: 30
-  }
-})
-data.push({
-  title: 'Bootstrap',
-  avatar: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png',
-  description: '那时候我只会想自己想要什么,从不想自己拥有什么',
-  owner: '吴加好',
-  startAt: '2018-07-26 22:44',
-  progress: {
-    status: 'exception',
-    value: 100
-  }
-})
-
-export default {
-  name: 'StandardList',
-  components: {
-    TaskForm,
-    Info
-  },
-  data () {
-    return {
-      data,
-      status: 'all'
-    }
-  },
-  methods: {
-    add () {
-      this.$dialog(TaskForm,
-        // component props
-        {
-          record: {},
-          on: {
-            ok () {
-              console.log('ok 回调')
-            },
-            cancel () {
-              console.log('cancel 回调')
-            },
-            close () {
-              console.log('modal close 回调')
-            }
-          }
-        },
-        // modal props
-        {
-          title: '新增',
-          width: 700,
-          centered: true,
-          maskClosable: false
-        })
-    },
-    edit (record) {
-      console.log('record', record)
-      this.$dialog(TaskForm,
-        // component props
-        {
-          record,
-          on: {
-            ok () {
-              console.log('ok 回调')
-            },
-            cancel () {
-              console.log('cancel 回调')
-            },
-            close () {
-              console.log('modal close 回调')
-            }
-          }
-        },
-        // modal props
-        {
-          title: '操作',
-          width: 700,
-          centered: true,
-          maskClosable: false
-        })
-    }
-  }
-}
-</script>
-
-<style lang="less" scoped>
-.ant-avatar-lg {
-    width: 48px;
-    height: 48px;
-    line-height: 48px;
-}
-
-.list-content-item {
-    color: rgba(0, 0, 0, .45);
-    display: inline-block;
-    vertical-align: middle;
-    font-size: 14px;
-    margin-left: 40px;
-    span {
-        line-height: 20px;
-    }
-    p {
-        margin-top: 4px;
-        margin-bottom: 0;
-        line-height: 22px;
-    }
-}
-</style>

+ 100 - 0
src/views/list/Home.vue

@@ -0,0 +1,100 @@
+<template>
+  <page-header-wrapper>
+    <a-page-header
+      style="border: 1px solid rgb(235, 237, 240)"
+      title="订单状态数量统计"
+      sub-title='点击数字可以跳转到对应的订单列表'
+      @back="() => null"
+    />
+    <div style="padding: 10px">
+      <a-row :gutter="16">
+        <a-col :span="4" v-for="order in orderStatusList" :key="order.status" style='background: #ffffff;border: none'>
+          <a-card  :title="order.status_text" style='border: none '>
+            <router-link style='cursor: pointer;color: red;font-size: 40px;' :to="{ name: 'logistics_orderList', query: { order_status: order.status} }">{{ order.count }}单</router-link>
+          </a-card>
+        </a-col>
+      </a-row>
+    </div>
+    <a-page-header
+      style="border: 1px solid rgb(235, 237, 240)"
+      title="订单状态流程说明"
+      sub-title=''
+      @back="() => null"
+    />
+    <a-card :bordered="false">
+      <a-steps class="steps" :current="5" direction='vertical'>
+        <a-step title="拆包中" subTitle='触发条件:用户申请打包;' description="物流商需操作:拆包->打包->【物流商后台-订单列表】点击【打包完成】录入相关信息;" status='process' />
+        <a-step title="未付款" subTitle='触发条件:物流商录入打包信息' description="无需物流商操作,待用户付款通知发货" status='process' />
+        <a-step title="待发货" subTitle="触发条件:用户订单付完款" description="物流商需操作:发货->【物流商后台-订单列表】点击【已发货】录入相关信息;" status='process' />
+        <a-step title="已发货" subTitle="触发条件:物流商在订单列表点击已发货" description="物流商需操作:在用户收货后,在【物流商后台-订单列表】点击【完成】录入相关信息;" status='process' />
+        <a-step title="已完成" subTitle="触发条件:用户收货后,物流商在【物流商后台-订单列表】点击【完成】;" description="流程完成" status='process' />
+      </a-steps>
+    </a-card>
+    <a-page-header
+      style="border: 1px solid rgb(235, 237, 240)"
+      title="包裹状态流程说明"
+      sub-title=''
+      @back="() => null"
+    />
+    <a-card :bordered="false">
+      <a-steps class="steps" :current="5" direction='vertical'>
+        <a-step title="待入库" subTitle='触发条件:用户包裹报备入库;' description="物流商需操作:如果包裹已到仓库,需在【物流商后台-包裹列表】中点击【入库】的录入相关信息" status='process' />
+        <a-step title="运输中" subTitle='触发条件:用户录入物流单号,api查询物流信息' description="物流商需操作:如果包裹已到仓库,需在【物流商后台-包裹列表】中点击【入库】的录入相关信息" status='process' />
+        <a-step title="待认领" subTitle="触发条件:物流商录入包裹信息中,用户没有报备的包裹;" description="无需物流商操作" status='process' />
+        <a-step title="已入库" subTitle="触发条件:物流商录入包裹信息中,用户已报备(或已认领)的包裹;" description="无需物流商操作" status='process' />
+        <a-step title="申请打包" subTitle="触发条件:用户申请打包;" description="物流商需操作:拆包->打包->【物流商后台-订单列表】找到对应包裹的订单录入相关信息;" status='process' />
+        <a-step title="已发货" subTitle="触发条件:物流商在【物流商后台-订单列表】找到对应包裹的订单点击【已发货】;" description="" status='process' />
+        <a-step title="已完成" subTitle="触发条件:物流商在【物流商后台-订单列表】找到对应包裹的订单点击【完成】;" description="流程完成" status='process' />
+      </a-steps>
+    </a-card>
+  </page-header-wrapper>
+</template>
+
+<script>
+import { orderStatusStatApi } from '@/api/manage'
+export default {
+  name: 'StandardList',
+  data () {
+    return {
+      orderStatusList: []
+    }
+  },
+  methods: {
+    orderStatusStat () {
+      orderStatusStatApi().then(res => {
+        this.orderStatusList = res.data
+      })
+    }
+  },
+  created () {
+    this.orderStatusStat()
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.ant-avatar-lg {
+    width: 48px;
+    height: 48px;
+    line-height: 48px;
+}
+
+.list-content-item {
+    color: rgba(0, 0, 0, .45);
+    display: inline-block;
+    vertical-align: middle;
+    font-size: 14px;
+    margin-left: 40px;
+    span {
+        line-height: 20px;
+    }
+    p {
+        margin-top: 4px;
+        margin-bottom: 0;
+        line-height: 22px;
+    }
+}
+.steps {
+  max-width: 750px;
+}
+</style>

+ 12 - 11
src/views/list/PackageList.vue

@@ -18,16 +18,16 @@
               <a-form-item label="报备状态">
                 <!-- 5拆包中 10 未付款  20待发货  29已发货  30已完成 -->
                 <a-select v-model="queryParam.report_status" placeholder="请选择" default-value="0">
-                  <a-select-option value="0">全部</a-select-option>
-                  <a-select-option value="1">待入库</a-select-option>
-                  <a-select-option value="2">运输中</a-select-option>
-                  <a-select-option value="3">待认领</a-select-option>
-                  <a-select-option value="4">取消</a-select-option>
-                  <a-select-option value="5">已入库</a-select-option>
-                  <a-select-option value="6">申请打包</a-select-option>
-                  <a-select-option value="7">待发货</a-select-option>
-                  <a-select-option value="8">已发货</a-select-option>
-                  <a-select-option value="9">已完成</a-select-option>
+                  <a-select-option label="全部" value="0">全部</a-select-option>
+                  <a-select-option label="待入库" value="1">待入库</a-select-option>
+                  <a-select-option label="运输中" value="2">运输中</a-select-option>
+                  <a-select-option label="待认领" value="3">待认领</a-select-option>
+                  <a-select-option label="取消" value="4">取消</a-select-option>
+                  <a-select-option label="已入库" value="5">已入库</a-select-option>
+                  <a-select-option label="申请打包" value="6">申请打包</a-select-option>
+                  <a-select-option label="待发货" value="7">待发货</a-select-option>
+                  <a-select-option label="已发货" value="8">已发货</a-select-option>
+                  <a-select-option label="已完成" value="9">已完成</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -236,7 +236,8 @@ export default {
       this.columns = columns
       this.queryParam = queryParam.value
       this.queryParam.member_id = this.$route.query.member_id || null
-      this.queryParam.report_status = this.$route.query.report_status || null
+      const reportStatus = this.$route.query.report_status
+      this.queryParam.report_status = reportStatus !== null && reportStatus !== undefined ? reportStatus.toString() : null
       return {
         visibleDetail: false,
         // create model

+ 20 - 7
src/views/list/TableList.vue

@@ -28,12 +28,12 @@
               <a-form-item label="订单状态">
                 <!-- 5拆包中 10 未付款  20待发货  29已发货  30已完成 -->
                 <a-select v-model="queryParam.status" placeholder="请选择" default-value="0">
-                  <a-select-option value="0">全部</a-select-option>
-                  <a-select-option value="5">拆包中</a-select-option>
-                  <a-select-option value="10">未付款</a-select-option>
-                  <a-select-option value="20">待发货</a-select-option>
-                  <a-select-option value="29">已发货</a-select-option>
-                  <a-select-option value="30">已完成</a-select-option>
+                  <a-select-option label="全部" value="0">全部</a-select-option>
+                  <a-select-option label="拆包中" value="5">拆包中</a-select-option>
+                  <a-select-option label="未付款" value="10">未付款</a-select-option>
+                  <a-select-option label="待发货" value="20">待发货</a-select-option>
+                  <a-select-option label="已发货" value="29">已发货</a-select-option>
+                  <a-select-option label="已完成" value="30">已完成</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -68,6 +68,16 @@
         <span slot="description" slot-scope="text">
           <ellipsis :length="4" tooltip>{{ text }}</ellipsis>
         </span>
+        <span slot="order_status_text" slot-scope="text, record">
+          <template>
+            <a-tag color="#f50" v-if="record.order_status === 5">{{ text }}</a-tag>
+            <a-tag color="#2db7f5" v-else-if="record.order_status === 10">{{ text }}</a-tag>
+            <a-tag color="#f50" v-else-if="record.order_status === 20">{{ text }}</a-tag>
+            <a-tag color="#f50" v-else-if="record.order_status === 29">{{ text }}</a-tag>
+            <a-tag color="#87d068" v-else-if="record.order_status === 30">{{ text }}</a-tag>
+            <a-tag color="blue" v-else>{{ text }}</a-tag>
+          </template>
+        </span>
         <span slot="package" slot-scope="text, record">
           <template>
             <!-- 假设 text 是你传递的对象或数组 -->
@@ -192,7 +202,8 @@ const columns = [
   // },
   {
     title: '订单状态',
-    dataIndex: 'order_status_text'
+    dataIndex: 'order_status_text',
+    scopedSlots: { customRender: 'order_status_text' }
   },
   {
     title: '支付状态',
@@ -253,6 +264,8 @@ export default {
       this.columns = columns
       this.queryParam = queryParam.value
       this.queryParam.member_id = this.$route.query.member_id || null
+      const orderStatus = this.$route.query.order_status
+      this.queryParam.status = orderStatus !== null && orderStatus !== undefined ? orderStatus.toString() : null
       return {
         visibleDetail: false,
         // create model

+ 27 - 27
src/views/user/Login.vue

@@ -13,34 +13,34 @@
         @change="handleTabClick"
       >
         <a-tab-pane key="tab1" :tab="$t('user.login.tab-login-credentials')"> -->
-          <a-alert v-if="isLoginError" type="error" showIcon style="margin-bottom: 24px;" :message="$t('user.login.message-invalid-credentials')" />
-          <a-form-item>
-            <a-input
-              size="large"
-              type="text"
-              placeholder="请输入用户名"
-              v-decorator="[
-                'username',
-                {rules: [{ required: true, message: $t('user.userName.required') }, { validator: handleUsernameOrEmail }], validateTrigger: 'change'}
-              ]"
-            >
-              <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
-            </a-input>
-          </a-form-item>
+      <a-alert v-if="isLoginError" type="error" showIcon style="margin-bottom: 24px;" :message="$t('user.login.message-invalid-credentials')" />
+      <a-form-item>
+        <a-input
+          size="large"
+          type="text"
+          placeholder="请输入用户名"
+          v-decorator="[
+            'username',
+            {rules: [{ required: true, message: $t('user.userName.required') }, { validator: handleUsernameOrEmail }], validateTrigger: 'change'}
+          ]"
+        >
+          <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
+        </a-input>
+      </a-form-item>
 
-          <a-form-item>
-            <a-input-password
-              size="large"
-              placeholder="请输入密码"
-              v-decorator="[
-                'password',
-                {rules: [{ required: true, message: $t('user.password.required') }], validateTrigger: 'blur'}
-              ]"
-            >
-              <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
-            </a-input-password>
-          </a-form-item>
-        <!-- </a-tab-pane>
+      <a-form-item>
+        <a-input-password
+          size="large"
+          placeholder="请输入密码"
+          v-decorator="[
+            'password',
+            {rules: [{ required: true, message: $t('user.password.required') }], validateTrigger: 'blur'}
+          ]"
+        >
+          <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
+        </a-input-password>
+      </a-form-item>
+      <!-- </a-tab-pane>
         <a-tab-pane key="tab2" :tab="$t('user.login.tab-login-mobile')">
           <a-form-item>
             <a-input size="large" type="text" :placeholder="$t('user.login.mobile.placeholder')" v-decorator="['mobile', {rules: [{ required: true, pattern: /^1[34578]\d{9}$/, message: $t('user.login.mobile.placeholder') }], validateTrigger: 'change'}]">