ソースを参照

cp方增加发货管理

zhanghe 7 年 前
コミット
26543a8855
40 ファイル変更141 行追加2000 行削除
  1. 1 13
      src/common/menu.js
  2. 9 31
      src/common/router.js
  3. 1 1
      src/components/SiderMenu/SiderMenu.js
  4. 1 1
      src/index.ejs
  5. 2 2
      src/layouts/BasicLayout.js
  6. 3 3
      src/layouts/UserLayout.js
  7. 0 85
      src/models/campus.js
  8. 0 63
      src/models/goods.js
  9. 0 50
      src/models/mproduct/detail.js
  10. 0 55
      src/models/mproduct/mproduct.js
  11. 1 7
      src/models/order/detail.js
  12. 2 2
      src/models/order/order.js
  13. 17 3
      src/models/product.js
  14. 0 80
      src/models/terminal/detail.js
  15. 0 70
      src/models/terminal/terminal.js
  16. 0 132
      src/routes/Campus/index.js
  17. 0 113
      src/routes/Campus/modal.js
  18. 0 38
      src/routes/Campus/search.js
  19. 0 68
      src/routes/Campus/table.js
  20. 0 211
      src/routes/MProduct/View/index.js
  21. 0 95
      src/routes/MProduct/View/price.js
  22. 0 97
      src/routes/MProduct/View/tags.js
  23. 12 12
      src/routes/Order/Edit/SubOrderProfile.js
  24. 6 16
      src/routes/Order/List/index.js
  25. 8 43
      src/routes/Order/List/table.js
  26. 13 27
      src/routes/MProduct/List/index.js
  27. 6 7
      src/routes/MProduct/List/search.js
  28. 15 27
      src/routes/MProduct/List/table.js
  29. 0 67
      src/routes/Terminal/Edit/campus.js
  30. 0 192
      src/routes/Terminal/Edit/index.js
  31. 0 121
      src/routes/Terminal/List/index.js
  32. 0 45
      src/routes/Terminal/List/search.js
  33. 0 96
      src/routes/Terminal/List/table.js
  34. 0 86
      src/routes/Terminal/List/table.less
  35. 1 1
      src/services/mproduct.js
  36. 4 0
      src/services/order.js
  37. 2 2
      src/theme.js
  38. 3 4
      src/utils/api.js
  39. 31 31
      src/utils/city.js
  40. 3 3
      src/utils/helper.js

+ 1 - 13
src/common/menu.js

@@ -4,22 +4,10 @@ const menuData = [
     icon: 'shop',
     path: 'products',
   }, {
-    name: '订单管理',
+    name: '发货管理',
     icon: 'trademark',
     path: 'order',
   }, {
-    name: '销售统计',
-    icon: 'area-chart',
-    path: 'sold',
-  }, {
-    name: '校区管理',
-    icon: 'home',
-    path: 'campus',
-  }, {
-    name: '终端管理',
-    icon: 'desktop',
-    path: 'terminal',
-  }, {
     name: '账户信息',
     icon: 'user',
     path: 'merchant',

+ 9 - 31
src/common/router.js

@@ -40,45 +40,23 @@ export const getRouterData = (app) => {
       component: dynamicWrapper(app, ['merchant'], () => import('../routes/Merchant')),
       name: '修改厂商信息',
     },
-    '/campus': {
-      component: dynamicWrapper(app, ['campus'], () => import('../routes/Campus')),
-    },
-    '/terminal': {
-      component: dynamicWrapper(app, ['terminal/terminal'], () => import('../routes/Terminal/List')),
-    },
-    '/terminal/add': {
-      component: dynamicWrapper(app, ['terminal/detail', 'campus'], () => import('../routes/Terminal/Edit')),
-      name: '添加终端',
-    },
-    '/terminal/edit/:id': {
-      component: dynamicWrapper(app, ['terminal/detail', 'campus'], () => import('../routes/Terminal/Edit')),
-      name: '编辑终端',
-    },
     '/products': {
-      component: dynamicWrapper(app, ['mproduct/mproduct'], () => import('../routes/MProduct/List')),
-    },
-    '/products/view': {
-      component: dynamicWrapper(app, ['mproduct/detail'], () => import('../routes/MProduct/View')),
-      name: '产品详情',
+      component: dynamicWrapper(app, ['product'], () => import('../routes/Product/List')),
     },
     '/order': {
       component: dynamicWrapper(app, ['order/order'], () => import('../routes/Order/List')),
     },
-    '/order/add': {
-      component: dynamicWrapper(app, ['order/detail', 'terminal/terminal', 'mproduct/mproduct'], () => import('../routes/Order/Add')),
-      name: '新建订单',
-    },
     '/order/profile/:id': {
-      component: dynamicWrapper(app, ['order/detail'], () => import('../routes/Order/Edit/OrderProfile')),
-      name: '订单详情',
-    },
-    '/order/sub/profile/:id': {
       component: dynamicWrapper(app, ['order/detail'], () => import('../routes/Order/Edit/SubOrderProfile')),
-      name: '子订单详情',
-    },
-    '/sold': {
-      component: dynamicWrapper(app, ['soldProduct', 'merchant'], () => import('../routes/SoldProduct')),
+      name: '订单详情',
     },
+    // '/products/view': {
+    //   component: dynamicWrapper(app, ['product'], () => import('../routes/MProduct/View')),
+    //   name: '产品详情',
+    // },
+    // '/sold': {
+    //   component: dynamicWrapper(app, ['soldProduct', 'merchant'], () => import('../routes/SoldProduct')),
+    // },
     '/user': {
       component: dynamicWrapper(app, [], () => import('../layouts/UserLayout')),
     },

+ 1 - 1
src/components/SiderMenu/SiderMenu.js

@@ -143,7 +143,7 @@ export default class SiderMenu extends PureComponent {
         <div className={styles.logo}>
           <Link to="/">
             <img src={logo} alt="logo" />
-            <h1>渠道管理平台</h1>
+            <h1>供应商管理平台</h1>
           </Link>
         </div>
         <Menu

+ 1 - 1
src/index.ejs

@@ -4,7 +4,7 @@
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
-  <title>渠道管理平台</title>
+  <title>供应商管理平台</title>
   <link rel="icon" href="/favicon.png" type="image/x-icon">
 </head>
 <body>

+ 2 - 2
src/layouts/BasicLayout.js

@@ -86,9 +86,9 @@ class BasicLayout extends React.PureComponent {
   getPageTitle() {
     const { routerData, location } = this.props;
     const { pathname } = location;
-    let title = '渠道管理平台';
+    let title = '供应商管理平台';
     if (routerData[pathname] && routerData[pathname].name) {
-      title = `${routerData[pathname].name} - 渠道管理平台`;
+      title = `${routerData[pathname].name} - 供应商管理平台`;
     }
     return title;
   }

+ 3 - 3
src/layouts/UserLayout.js

@@ -24,9 +24,9 @@ class UserLayout extends React.PureComponent {
   getPageTitle() {
     const { routerData, location } = this.props;
     const { pathname } = location;
-    let title = '渠道管理平台';
+    let title = '供应商管理平台';
     if (routerData[pathname] && routerData[pathname].name) {
-      title = `${routerData[pathname].name} - 渠道管理平台`;
+      title = `${routerData[pathname].name} - 供应商管理平台`;
     }
     return title;
   }
@@ -44,7 +44,7 @@ class UserLayout extends React.PureComponent {
                     <span className={styles.title}>CMS Browser</span>
                   </Link>
                 </div>
-                <div className={styles.desc}>CMSBrowser - 渠道管理平台</div>
+                <div className={styles.desc}>CMSBrowser - 供应商管理平台</div>
               </div>
               {
                 getRoutes(match.path, routerData).map(item =>

+ 0 - 85
src/models/campus.js

@@ -1,85 +0,0 @@
-import { query, create, update } from '../services/campus';
-import { message } from 'antd';
-import modelExtend from 'dva-model-extend';
-import queryString from 'query-string';
-import { pageModel } from './common';
-import { pageSize } from '../utils/config';
-import { checkSearchParams } from '../utils/utils';
-import { getLocalUser } from '../utils/helper';
-
-export default modelExtend(pageModel, {
-  namespace: 'campus',
-
-  state: {
-    currentItem: {},
-    listLoading: false,
-    modalVisible: false,
-    modalType: 'create',
-  },
-
-  subscriptions: {
-    setup({ dispatch, history }) {
-      history.listen((location) => {
-        if (location.pathname === '/campus') {
-          const params = checkSearchParams(queryString.parse(location.search));
-          dispatch({
-            type: 'query',
-            payload: params,
-          });
-        }
-      });
-    },
-  },
-
-  effects: {
-    * query({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true } });
-      const { merchantId } = getLocalUser();
-      const { data, success } = yield call(query, { ...payload, merchantId });
-      if (success) {
-        yield put({
-          type: 'querySuccess',
-          payload: {
-            list: data.list,
-            pagination: {
-              current: Number(payload.pageNo) || 1,
-              pageSize: Number(payload.pageSize) || pageSize,
-              total: data.totalSize,
-            },
-          },
-        });
-      }
-      yield put({ type: 'changeLoading', payload: { listLoading: false } });
-    },
-    * create({ payload, callback }, { call, put }) {
-      const { merchantId } = getLocalUser();
-      const { data, success } = yield call(create, { ...payload, merchantId });
-      if (success) {
-        message.success('创建成功!');
-        yield put({ type: 'hideModal' });
-        if (callback) callback();
-      }
-    },
-    * update({ payload, callback }, { call, put }) {
-      const { merchantId } = getLocalUser();
-      const { data, success } = yield call(update, { ...payload, merchantId });
-      if (success) {
-        message.success('修改成功!');
-        yield put({ type: 'hideModal' });
-        if (callback) callback();
-      }
-    },
-  },
-
-  reducers: {
-    changeLoading(state, { payload }) {
-      return { ...state, ...payload };
-    },
-    showModal(state, { payload }) {
-      return { ...state, ...payload, modalVisible: true };
-    },
-    hideModal(state) {
-      return { ...state, modalVisible: false };
-    },
-  },
-});

+ 0 - 63
src/models/goods.js

@@ -1,63 +0,0 @@
-import { create, update, remove, bundleTags } from '../services/goods';
-import { message } from 'antd';
-import { Codes } from '../utils/config';
-
-export default {
-  namespace: 'goodsModel',
-
-  state: {
-    goodsItem: {},
-    modalShow: false,
-    tagModalShow: false,
-    operation: 'create',
-  },
-
-  effects: {
-    * createItem({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(create, { ...payload, status: Codes.CODE_NORMAL });
-      if (success) {
-        message.success('创建成功!');
-        yield put({ type: 'hideModal' });
-        if (callback) callback();
-      }
-    },
-    * updateItem({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(update, { ...payload });
-      if (success) {
-        message.success('修改成功!');
-        yield put({ type: 'hideModal' });
-        if (callback) callback();
-      }
-    },
-    * removeItem({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(remove, { ...payload });
-      if (success) {
-        message.success('删除成功!');
-        if (callback) callback();
-      }
-    },
-    * bundleTags({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(bundleTags, { ...payload });
-      if (success) {
-        message.success('操作成功!');
-        yield put({ type: 'hideTagModal' });
-        if (callback) callback();
-      }
-    },
-  },
-
-  reducers: {
-    showModal(state, action) {
-      return { ...state, ...action.payload, modalShow: true };
-    },
-    showTagModal(state, action) {
-      return { ...state, ...action.payload, tagModalShow: true };
-    },
-    hideModal(state, action) {
-      return { ...state, ...action.payload, modalShow: false };
-    },
-    hideTagModal(state, action) {
-      return { ...state, ...action.payload, tagModalShow: false };
-    },
-  },
-};

+ 0 - 50
src/models/mproduct/detail.js

@@ -1,50 +0,0 @@
-import pathToRegexp from 'path-to-regexp';
-import queryString from 'query-string';
-import { queryOne } from '../../services/mproduct';
-
-export default {
-  namespace: 'mproductDetail',
-
-  state: {
-    filters: {},
-    currentItem: {},
-    itemLoading: false,
-  },
-
-  subscriptions: {
-    setup({ dispatch, history }) {
-      history.listen(({ pathname, state, search }) => {
-        const match = pathToRegexp('/products/view').exec(pathname);
-        if (match) {
-          const params = queryString.parse(search);
-          dispatch({ type: 'queryOne', payload: { ...params } });
-          dispatch({ type: 'saveFilters', payload: state });
-        }
-      });
-    },
-  },
-
-  effects: {
-    // 查询一条渠道方产品详情 /merchant/product/detail?pid=xxx&merchantId=xxx
-    * queryOne({ payload }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { itemLoading: true } });
-      const { data, success } = yield call(queryOne, payload);
-      if (success) {
-        yield put({ type: 'querySuccess', payload: { ...data } });
-      }
-      yield put({ type: 'changeLoading', payload: { itemLoading: false } });
-    },
-  },
-
-  reducers: {
-    changeLoading(state, { payload }) {
-      return { ...state, ...payload };
-    },
-    querySuccess(state, { payload }) {
-      return { ...state, currentItem: payload };
-    },
-    saveFilters(state, { payload: filters }) {
-      return { ...state, filters };
-    },
-  },
-};

+ 0 - 55
src/models/mproduct/mproduct.js

@@ -1,55 +0,0 @@
-import modelExtend from 'dva-model-extend';
-import queryString from 'query-string';
-import { query } from '../../services/mproduct';
-import { pageModel } from '../common';
-import { pageSize } from '../../utils/config';
-import { checkSearchParams } from '../../utils/utils';
-import { getLocalUser } from '../../utils/helper';
-
-export default modelExtend(pageModel, {
-  namespace: 'mproduct',
-
-  state: { listLoading: false },
-
-  subscriptions: {
-    setup({ dispatch, history }) {
-      history.listen((location) => {
-        if (location.pathname === '/products') {
-          const payload = checkSearchParams(queryString.parse(location.search));
-          dispatch({
-            type: 'query',
-            payload,
-          });
-        }
-      });
-    },
-  },
-
-  effects: {
-    * query({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true } });
-      const { merchantId } = getLocalUser();
-      const { data, success } = yield call(query, { ...payload, merchantId });
-      if (success) {
-        yield put({
-          type: 'querySuccess',
-          payload: {
-            list: data.list,
-            pagination: {
-              current: Number(payload.pageNo) || 1,
-              pageSize: Number(payload.pageSize) || pageSize,
-              total: data.totalSize,
-            },
-          },
-        });
-      }
-      yield put({ type: 'changeLoading', payload: { listLoading: false } });
-    },
-  },
-
-  reducers: {
-    changeLoading(state, action) {
-      return { ...state, ...action.payload };
-    },
-  },
-});

+ 1 - 7
src/models/order/detail.js

@@ -19,13 +19,8 @@ export default {
     setup({ dispatch, history }) {
       history.listen(({ pathname, state }) => {
         const match = pathToRegexp('/order/profile/:id').exec(pathname);
-        const sub = pathToRegexp('/order/sub/profile/:id').exec(pathname);
         if (match) {
-          dispatch({ type: 'query', payload: { id: match[1] } });
-          dispatch({ type: 'saveFilters', payload: state });
-          dispatch({ type: 'saveOperType', payload: { operType: 'view' } });
-        } else if (sub) {
-          dispatch({ type: 'querySubOrder', payload: { id: sub[1] } });
+          dispatch({ type: 'querySubOrder', payload: { id: match[1] } });
           dispatch({ type: 'saveFilters', payload: state });
           dispatch({ type: 'saveOperType', payload: { operType: 'view' } });
         }
@@ -59,7 +54,6 @@ export default {
       }
     },
     * remove({ payload, callback }, { call }) {
-      console.log(payload);
       const { success } = yield call(remove, payload);
       if (success) {
         message.success('操作成功!');

+ 2 - 2
src/models/order/order.js

@@ -1,6 +1,6 @@
 import modelExtend from 'dva-model-extend';
 import queryString from 'query-string';
-import { query, create, update, remove } from '../../services/order';
+import { querySubOrders, create, update, remove } from '../../services/order';
 import { pageModel } from '../common';
 import { pageSize } from '../../utils/config';
 import { checkSearchParams } from '../../utils/utils';
@@ -35,7 +35,7 @@ export default modelExtend(pageModel, {
     * query({ payload = {} }, { call, put }) {
       yield put({ type: 'changeLoading', payload: { listLoading: true } });
       const { merchantId } = getLocalUser();
-      const { data, success } = yield call(query, { ...payload, merchantId });
+      const { data, success } = yield call(querySubOrders, { ...payload, cpId: merchantId });
       if (success) {
         yield put({
           type: 'querySuccess',

+ 17 - 3
src/models/product.js

@@ -1,19 +1,33 @@
-import { query } from '../services/product';
 import modelExtend from 'dva-model-extend';
+import queryString from 'query-string';
 import { pageModel } from './common';
+import { query } from '../services/product';
 import { pageSize } from '../utils/config';
 import { checkSearchParams } from '../utils/utils';
 import { Codes } from '../utils/config';
+import { getLocalUser } from '../utils/helper';
 
 export default modelExtend(pageModel, {
   namespace: 'product',
 
   state: { listLoading: false },
 
+  subscriptions: {
+    setup({ dispatch, history }) {
+      history.listen(({ pathname }) => {
+        if (pathname === '/products') {
+          const payload = checkSearchParams(queryString.parse(location.search));
+          dispatch({ type: 'query', payload });
+        }
+      });
+    },
+  },
+
   effects: {
-    * query({ payload = {} }, { call, put }) {
+    * query({ payload }, { call, put }) {
       yield put({ type: 'changeLoading', payload: { listLoading: true } });
-      const { data, success } = yield call(query, payload);
+      const { merchantId } = getLocalUser();
+      const { data, success } = yield call(query, { ...payload, cpId: merchantId });
       if (success) {
         yield put({
           type: 'querySuccess',

+ 0 - 80
src/models/terminal/detail.js

@@ -1,80 +0,0 @@
-import { create, update } from '../../services/terminal';
-import pathToRegexp from 'path-to-regexp';
-import { message } from 'antd';
-
-export default {
-  namespace: 'terminalDetail',
-
-  state: {
-    filters: {},
-    operType: 'create',
-    currentItem: {},
-    modalShow: false,
-  },
-
-  subscriptions: {
-    setup({ dispatch, history }) {
-      history.listen(({ pathname, state, record }) => {
-        const match = pathToRegexp('/terminal/edit/:id').exec(pathname);
-        if (match && record) {
-          dispatch({
-            type: 'saveOuterData',
-            payload: { filters: state, operType: 'update', currentItem: record },
-          });
-        } else if (pathname === '/terminal/add') {
-          dispatch({
-            type: 'saveOuterData',
-            payload: { filters: state, operType: 'create', currentItem: {} },
-          });
-        }
-      });
-    },
-  },
-
-  effects: {
-    * create({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(create, payload);
-      if (success) {
-        message.success('创建成功!');
-        yield put({ type: 'initState' });
-        if (callback) callback();
-      }
-    },
-    * update({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(update, payload);
-      if (success) {
-        message.success('修改成功!');
-        yield put({ type: 'initState' });
-        if (callback) callback();
-      }
-    },
-  },
-
-  reducers: {
-    saveOuterData(state, action) {
-      return { ...state, ...action.payload };
-    },
-    saveCampus(state, action) {
-      const { code, name, id } = action.payload;
-      return {
-        ...state,
-        modalShow: false,
-        currentItem: {
-          ...state.currentItem,
-          campusId: id,
-          campusName: name,
-          campusCode: code,
-        },
-      };
-    },
-    showModal(state) {
-      return { ...state, modalShow: true };
-    },
-    hideModal(state) {
-      return { ...state, modalShow: false };
-    },
-    initState(state) {
-      return { ...state, currentItem: {} };
-    },
-  },
-};

+ 0 - 70
src/models/terminal/terminal.js

@@ -1,70 +0,0 @@
-import { query, create, update, remove } from '../../services/terminal';
-import modelExtend from 'dva-model-extend';
-import { message } from 'antd';
-import queryString from 'query-string';
-import { pageModel } from '../common';
-import { pageSize } from '../../utils/config';
-import { checkSearchParams } from '../../utils/utils';
-import { getLocalUser } from '../../utils/helper';
-
-export default modelExtend(pageModel, {
-  namespace: 'terminal',
-
-  state: { listLoading: false },
-
-  subscriptions: {
-    setup({ dispatch, history }) {
-      history.listen((location) => {
-        if (location.pathname === '/terminal') {
-          const params = checkSearchParams(queryString.parse(location.search));
-          dispatch({
-            type: 'query',
-            payload: params,
-          });
-        }
-      });
-    },
-  },
-
-  effects: {
-    * query({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true } });
-      const { merchantId } = getLocalUser();
-      const { data, success } = yield call(query, { ...payload, merchantId });
-      if (success) {
-        yield put({
-          type: 'querySuccess',
-          payload: {
-            list: data.list,
-            pagination: {
-              current: Number(payload.pageNo) || 1,
-              pageSize: Number(payload.pageSize) || pageSize,
-              total: data.totalSize,
-            },
-          },
-        });
-      }
-      yield put({ type: 'changeLoading', payload: { listLoading: false } });
-    },
-    * delete({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(remove, payload);
-      if (success) {
-        message.success('禁用成功!');
-        if (callback) callback();
-      }
-    },
-    * recover({ payload, callback }, { call, put }) {
-      const { data, success } = yield call(update, payload);
-      if (success) {
-        message.success('解禁成功!');
-        if (callback) callback();
-      }
-    },
-  },
-
-  reducers: {
-    changeLoading(state, { payload }) {
-      return { ...state, ...payload };
-    },
-  },
-});

+ 0 - 132
src/routes/Campus/index.js

@@ -1,132 +0,0 @@
-import React, { Component } from 'react';
-import queryString from 'query-string';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card } from 'antd';
-import CampusTableList from './table';
-import CampusModalForm from './modal';
-import Search from './search';
-import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-
-@connect(state => ({
-  campus: state.campus,
-}))
-export default class CampusList extends Component {
-  render() {
-    const { location, dispatch, campus } = this.props;
-    const {
-      list,
-      listLoading,
-      pagination,
-      currentItem,
-      modalVisible,
-      modalType,
-    } = campus;
-
-    location.query = queryString.parse(location.search);
-    const { query, pathname } = location;
-    const { field, keyword, ...filters } = query;
-
-    // 把携带的参数中空值项删除
-    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
-    // 如果搜索内容不为空则添加进filters中
-    if (field && keyword) {
-      filters.field = field;
-      filters.keyword = keyword;
-    }
-
-    const modalProps = {
-      item: modalType === 'create' ? {} : currentItem,
-      visible: modalVisible,
-      maskClosable: false,
-      title: `${modalType === 'create' ? '添加校区' : '编辑校区'}`,
-      wrapClassName: 'vertical-center-modal',
-      onOk(data) {
-        dispatch({
-          type: `campus/${modalType}`,
-          payload: data,
-          callback: () => {
-            dispatch(routerRedux.push({
-              pathname: '/campus',
-              search: queryString.stringify(filters),
-            }));
-          },
-        });
-      },
-      onCancel() {
-        dispatch({
-          type: 'campus/hideModal',
-        });
-      },
-    };
-
-    const searchProps = {
-      field,
-      keyword,
-      onSearch: (payload) => {
-        if (!payload.keyword.length) {
-          delete payload.field;
-          delete payload.keyword;
-        }
-        dispatch(routerRedux.push({
-          pathname,
-          search: queryString.stringify({
-            ...payload,
-          }),
-        }));
-      },
-      onAdd: () => {
-        dispatch({
-          type: 'campus/showModal',
-          payload: { modalType: 'create' },
-        });
-      },
-    };
-
-    const listProps = {
-      dataSource: list,
-      loading: listLoading,
-      pagination,
-      location,
-      onChange: (pagination, filterArgs) => {
-        const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
-        const tableFilters = Object.keys(filterArgs).reduce((obj, key) => {
-          const newObj = { ...obj };
-          newObj[key] = getValue(filterArgs[key]);
-          return newObj;
-        }, {});
-        const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
-        dispatch(routerRedux.push({
-          pathname,
-          search: queryString.stringify({
-            ...data,
-            pageNo: pagination.current,
-            pageSize: pagination.pageSize,
-          }),
-        }));
-      },
-      onEditItem: (item) => {
-        dispatch({
-          type: 'campus/showModal',
-          payload: {
-            modalType: 'update',
-            currentItem: item,
-          },
-        });
-      },
-      onDeleteItem: () => {
-        // TODO: 暂不提供删除校区功能
-      },
-    };
-    return (
-      <PageHeaderLayout>
-        <Card>
-          <Search {...searchProps} />
-          <CampusTableList {...listProps} />
-          {modalVisible && <CampusModalForm {...modalProps} />}
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 113
src/routes/Campus/modal.js

@@ -1,113 +0,0 @@
-import React, { Component } from 'react';
-import { Form, Cascader, Input, Modal } from 'antd';
-import * as city from '../../utils/city';
-
-@Form.create()
-export default class CampusModalForm extends Component {
-  handleOnOk = () => {
-    const { onOk, form, item } = this.props;
-    const { validateFields, getFieldsValue } = form;
-    validateFields((errors) => {
-      if (errors) return;
-      const data = { ...getFieldsValue() };
-
-      data.provinceCode = city.provNameToCode(data.cascader[0]);
-      data.cityName = data.cascader.slice(1, 3).join(' ');
-      delete data.cascader;
-      if (item.id) {
-        data.id = item.id;
-      }
-
-      onOk(data);
-    });
-  }
-
-  render() {
-    const { item, onOk, form, ...modalProps } = this.props;
-    const { getFieldDecorator } = form;
-
-    const formItemLayout = {
-      labelCol: { span: 7 },
-      wrapperCol: { span: 14 },
-    };
-
-    const modalOpts = { ...modalProps, onOk: this.handleOnOk };
-
-    return (
-      <Modal {...modalOpts}>
-        <Form layout="horizontal">
-          <Form.Item label="校区地址" hasFeedback {...formItemLayout}>
-            {getFieldDecorator('cascader', {
-              rules: [
-                {
-                  required: true,
-                  message: '校区地址为必选项!',
-                },
-              ],
-              initialValue: item.provinceCode && [city.provCodeToName(item.provinceCode), ...(item.cityName || '').split(' ')],
-            })(<Cascader
-              style={{ width: '100%' }}
-              options={city.DICT_FIXED}
-              placeholder="请选择"
-            />)}
-          </Form.Item>
-          {/* 校区编号暂不显示
-          <Form.Item label="校区编号:" {...formItemLayout}>
-            {getFieldDecorator('code', {
-              initialValue: item.code,
-            })(<Input disabled={true} placeholder="提交后根据校区地址自动生成"/>)}
-          </Form.Item>
-          */}
-          <Form.Item label="校区名称:" hasFeedback {...formItemLayout}>
-            {getFieldDecorator('zoneName', {
-              initialValue: item.zoneName,
-              rules: [
-                {
-                  required: true,
-                  message: '校区名称为必填项!',
-                },
-              ],
-            })(<Input placeholder="请填写" />)}
-          </Form.Item>
-          <Form.Item label="联系人:" hasFeedback {...formItemLayout}>
-            {getFieldDecorator('contactName', {
-              initialValue: item.contactName,
-              rules: [
-                {
-                  required: true,
-                  message: '联系人为必填项!',
-                },
-              ],
-            })(<Input placeholder="请填写" />)}
-          </Form.Item>
-          <Form.Item label="联系电话:" hasFeedback {...formItemLayout}>
-            {getFieldDecorator('mobile', {
-              initialValue: item.mobile,
-              rules: [
-                {
-                  required: true,
-                  message: '联系电话为必填项!',
-                },
-              ],
-            })(<Input placeholder="请填写" />)}
-          </Form.Item>
-          <Form.Item label="收货地址" hasFeedback {...formItemLayout}>
-            {getFieldDecorator('address', {
-              initialValue: item.address,
-            })(<Input />)}
-          </Form.Item>
-          <Form.Item label="银行账户" hasFeedback {...formItemLayout}>
-            {getFieldDecorator('bankAccount', {
-              initialValue: item.bankAccount,
-            })(<Input />)}
-          </Form.Item>
-          <Form.Item label="开户行名称" hasFeedback {...formItemLayout}>
-            {getFieldDecorator('depositBank', {
-              initialValue: item.depositBank,
-            })(<Input />)}
-          </Form.Item>
-        </Form>
-      </Modal>
-    );
-  }
-}

+ 0 - 38
src/routes/Campus/search.js

@@ -1,38 +0,0 @@
-import React from 'react';
-import { Button, Form, Row, Col, Icon } from 'antd';
-import DataSearch from '../../components/DataSearch';
-
-const Search = ({
-  field,
-  keyword,
-  onSearch,
-  onAdd,
-}) => {
-  const searchGroupProps = {
-    field,
-    keyword,
-    size: 'default',
-    select: true,
-    selectOptions: [{
-      value: 'name', name: '校区名称',
-    }, {
-      value: 'code', name: '校区编号',
-    }],
-    selectProps: {
-      defaultValue: field || 'code',
-    },
-    onSearch: value => onSearch(value),
-  };
-  return (
-    <Row gutter={24}>
-      <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-        <DataSearch {...searchGroupProps} />
-      </Col>
-      <Col lg={{ offset: 7, span: 7 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
-        <Button type="primary" onClick={onAdd}><Icon type="plus-circle" />添加校区</Button>
-      </Col>
-    </Row>
-  );
-};
-
-export default Form.create()(Search);

+ 0 - 68
src/routes/Campus/table.js

@@ -1,68 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { Table } from 'antd';
-
-export default class CampusTableList extends Component {
-  render() {
-    const {
-      onDeleteItem,
-      onEditItem,
-      location,
-      pagination,
-      ...tableProps
-    } = this.props;
-
-    const columns = [{
-      title: '校区编号',
-      dataIndex: 'code',
-      key: 'code',
-      width: '15%',
-    }, {
-      title: '校区名称',
-      dataIndex: 'name',
-      key: 'name',
-      width: '40%',
-    }, {
-      title: '联系人',
-      dataIndex: 'contactName',
-      key: 'contactName',
-      width: '10%',
-    }, {
-      title: '电话',
-      dataIndex: 'mobile',
-      key: 'mobile',
-      width: '13%',
-    }, {
-      title: '修改时间',
-      dataIndex: 'gmtModified',
-      key: 'gmtModified',
-      render: text => (
-        <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
-      ),
-      width: '17%',
-    }, {
-      title: '操作',
-      dataIndex: 'operation',
-      key: 'operation',
-      render: (text, record) => (
-        <div>
-          <a onClick={() => onEditItem(record)}>编辑</a>
-        </div>
-      ),
-      width: '5%',
-    }];
-
-    // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
-
-    return (
-      <Table
-        simple
-        bordered
-        {...tableProps}
-        columns={columns}
-        rowKey={record => record.id}
-      />
-    );
-  }
-}

+ 0 - 211
src/routes/MProduct/View/index.js

@@ -1,211 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Divider, Table, Form, Card, Button, Tag } from 'antd';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import queryString from 'query-string';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-import FooterToolbar from '../../../components/FooterToolbar';
-import DescriptionList from '../../../components/DescriptionList';
-import NewPriceModal from './price';
-import TagSelectModal from './tags';
-import { pageSize, productType, Codes } from '../../../utils/config';
-
-const { Description } = DescriptionList;
-
-@Form.create()
-@connect(state => ({ mproductDetail: state.mproductDetail }))
-export default class MerchantProductEdit extends PureComponent {
-  handleAddPriceClick = () => {
-    this.props.dispatch({
-      type: 'goodsModel/showModal',
-      payload: { operation: 'createItem' },
-    });
-  }
-
-  handleEditPriceClick = (record) => {
-    this.props.dispatch({
-      type: 'goodsModel/showModal',
-      payload: {
-        operation: 'updateItem',
-        goodsItem: record,
-      },
-    });
-  }
-
-  handleDelPriceClick = (record) => {
-    const { dispatch, location } = this.props;
-    const { search } = location;
-    confirm({
-      title: '您确定要删除此定价?',
-      onOk() {
-        dispatch({
-          type: 'goodsModel/removeItem',
-          payload: { id: record.id },
-          callback: () => {
-            dispatch(routerRedux.push({
-              pathname: '/goods/edit',
-              search,
-            }));
-          },
-        });
-      },
-    });
-  }
-
-  handleEditTagClick = () => {
-    const { location } = this.props;
-    const { search } = location;
-    const { merchantId, pid } = queryString.parse(search);
-    this.props.dispatch({
-      type: 'goodsModel/showTagModal',
-    });
-    this.props.dispatch({
-      type: 'tagModel/query',
-      payload: {
-        pageNo: 1,
-        pageSize,
-        status: Codes.CODE_NORMAL,
-        merchantId,
-      },
-    });
-  }
-
-  handleTagModalCancel = () => {
-    this.props.dispatch({
-      type: 'goodsModel/hideTagModal',
-    });
-  }
-
-  handleTagModalOk = (data) => {
-    const { location } = this.props;
-    const { search } = location;
-    const { merchantId, pid } = queryString.parse(search);
-    this.props.dispatch({
-      type: 'goodsModel/bundleTags',
-      payload: { pid, merchantId, tags: data.map(item => item.id) },
-      callback: () => {
-        this.props.dispatch(routerRedux.push({
-          pathname: '/goods/edit',
-          search,
-        }));
-      },
-    });
-  }
-
-  handleTagModalSearch = (data) => {
-    const { location } = this.props;
-    const { search } = location;
-    const { merchantId, pid } = queryString.parse(search);
-    const newData = { ...data };
-    if (newData.keyword) {
-      newData[newData.field] = newData.keyword;
-    }
-    delete newData.field;
-    delete newData.keyword;
-
-    this.props.dispatch({
-      type: 'tagModel/query',
-      payload: {
-        ...newData,
-        pageNo: 1,
-        pageSize,
-        status: Codes.CODE_NORMAL,
-        merchantId,
-      },
-    });
-  }
-
-  handlePageExit = () => {
-    const { dispatch, mproductDetail } = this.props;
-    const { filters } = mproductDetail;
-    dispatch(routerRedux.push({
-      pathname: '/products',
-      search: queryString.stringify(filters),
-    }));
-  }
-
-  handleTagModalTableChange = (pagination) => {
-    const { location, dispatch, mproductDetail } = this.props;
-    const { filters } = mproductDetail;
-    const { search } = location;
-    const { merchantId, pid } = queryString.parse(search);
-
-    const newFilters = { ...filters };
-    if (newFilters.keyword) {
-      newFilters[newFilters.field] = newFilters.keyword;
-    }
-    delete newFilters.field;
-    delete newFilters.keyword;
-
-    const data = {
-      ...newFilters,
-      pageNo: pagination.current,
-      pageSize: pagination.pageSize,
-      status: Codes.CODE_NORMAL,
-      merchantId,
-    };
-
-    Object.keys(data).map(key => (data[key] ? null : delete data[key]));
-    dispatch({ type: 'tagModel/query', payload: { ...data } });
-  }
-
-  render() {
-    const { mproductDetail } = this.props;
-    const { currentItem } = mproductDetail;
-    const { goods, tags, type, code, name, merchantName } = currentItem;
-
-    const listTableProps = {
-      simple: true,
-      bordered: true,
-      pagination: false,
-      rowKey: record => record.id,
-      dataSource: goods,
-      columns: [{
-        title: '计价单位',
-        dataIndex: 'chargeUnit',
-        key: 'chargeUnit',
-      }, {
-        title: '渠道售卖价格(¥)',
-        dataIndex: 'merchantPrice',
-        key: 'merchantPrice',
-      }, {
-        title: '终端显示价格(¥)',
-        dataIndex: 'terminalPrice',
-        key: 'terminalPrice',
-      }],
-    };
-
-    return (
-      <PageHeaderLayout>
-        <Card
-          bordered={false}
-          title="产品详情"
-          style={{ marginBottom: 15 }}
-        >
-          <DescriptionList size="large" col={3} style={{ marginBottom: 32 }}>
-            <Description term="商品编号">{code}</Description>
-            <Description term="商品名称">{name}</Description>
-            <Description term="商品类型">{productType[type]}</Description>
-          </DescriptionList>
-        </Card>
-        <Card
-          bordered={false}
-          title="价格类型"
-          style={{ marginBottom: 15 }}
-        >
-          <Table {...listTableProps} />
-        </Card>
-        <Card
-          bordered={false}
-          title="已上架标签"
-          style={{ marginBottom: 15 }}
-        >
-          {tags ? tags.map(item => <Tag color="#f50">{item.name}</Tag>) : null}
-        </Card>
-        <FooterToolbar>
-          <Button onClick={this.handlePageExit} type="primary">返回产品列表</Button>
-        </FooterToolbar>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 95
src/routes/MProduct/View/price.js

@@ -1,95 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Modal, Form, Select, InputNumber } from 'antd';
-import { chargeUnit } from '../../../utils/config';
-
-const Option = Select.Option;
-
-@Form.create()
-export default class NewPriceModal extends PureComponent {
-  handleModalOnOk = () => {
-    const {
-      form: {
-        validateFields,
-        getFieldsValue,
-        resetFields,
-      },
-      data,
-      onSubmit,
-    } = this.props;
-    validateFields((errors) => {
-      if (errors) return;
-      const formData = getFieldsValue();
-      const newData = { ...formData };
-      newData.duration = chargeUnit[formData.chargeUnit];
-      data.id ? newData.id = data.id : null;
-      onSubmit(newData);
-      resetFields();
-    });
-  }
-
-  render() {
-    const { form, data, onSubmit, ...modalProps } = this.props;
-    const { getFieldDecorator } = form;
-
-    const formItemLayout = {
-      labelCol: { span: 9 },
-      wrapperCol: { span: 10 },
-    };
-
-    return (
-      <Modal {...modalProps} onOk={this.handleModalOnOk} >
-        <Form layout="horizontal" >
-          <Form.Item label="计价单位" {...formItemLayout}>
-            {getFieldDecorator('chargeUnit', {
-              rules: [{ required: true, type: 'string', message: '请选择一种计价单位!' }],
-              initialValue: data.chargeUnit,
-            })(
-              <Select placeholder="请选择" style={{ width: '80%' }}>
-                {Object.keys(chargeUnit).map(key => <Option value={key} key={key}>{key}</Option>)}
-              </Select>
-            )}
-          </Form.Item>
-          <Form.Item label="供应商价格" {...formItemLayout}>
-            {getFieldDecorator('cpPrice', {
-              initialValue: data.cpPrice,
-            })(
-              <InputNumber
-                min={0}
-                style={{ width: '80%' }}
-                placeholder="请填写"
-                formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-                parser={value => value.replace(/\¥\s?|(,*)/g, '')}
-              />
-            )}
-          </Form.Item>
-          <Form.Item label="渠道方价格" {...formItemLayout}>
-            {getFieldDecorator('merchantPrice', {
-              initialValue: data.merchantPrice,
-            })(
-              <InputNumber
-                min={0}
-                style={{ width: '80%' }}
-                placeholder="请填写"
-                formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-                parser={value => value.replace(/\¥\s?|(,*)/g, '')}
-              />
-            )}
-          </Form.Item>
-          <Form.Item label="终端价格" {...formItemLayout}>
-            {getFieldDecorator('terminalPrice', {
-              initialValue: data.terminalPrice,
-            })(
-              <InputNumber
-                min={0}
-                style={{ width: '80%' }}
-                placeholder="请填写"
-                formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-                parser={value => value.replace(/\¥\s?|(,*)/g, '')}
-              />
-            )}
-          </Form.Item>
-        </Form>
-      </Modal>
-    );
-  }
-}

+ 0 - 97
src/routes/MProduct/View/tags.js

@@ -1,97 +0,0 @@
-import React, { PureComponent } from 'react';
-import PropTypes from 'prop-types';
-import SelectModal from '../../../components/SelectModal';
-import { Codes } from '../../../utils/config';
-
-export default class TagSelectModal extends PureComponent {
-  render() {
-    const {
-      rowKeyName,
-      selTableData,
-      modalVisible,
-      onCancel,
-      onOk,
-      onSearch,
-      ...fsTableOpts
-    } = this.props;
-
-    const modalProps = {
-      title: '选择标签',
-      maskClosable: false,
-      visible: modalVisible,
-      onCancel,
-      onOk,
-    };
-
-    const searchProps = {
-      searchField: 'name',
-      searchKeyWord: '',
-      searchSize: 'default',
-      searchSelect: true,
-      searchSelectOptions: [{
-        value: 'name', name: '标签名称', mode: 'input',
-      }],
-      searchSelectProps: {
-        defaultValue: 'name',
-      },
-      onSearch: (value) => {
-        onSearch(value);
-      },
-    };
-
-    // 已选资源列表
-    const selTableProps = {
-      operDel: true,
-      tablePagination: false,
-      tableDataSource: selTableData,
-      rowKeyName,
-      tableColumns: [{
-        title: '标签名称',
-        dataIndex: 'name',
-        key: 'name',
-        width: '26%',
-      }, {
-        title: '标签组名称',
-        dataIndex: 'groupName',
-        key: 'groupName',
-        width: '26%',
-      }, {
-        title: '渠道名称',
-        dataIndex: 'merchantName',
-        key: 'merchantName',
-        width: '26%',
-      }],
-    };
-
-    // 待选资源Table属性
-    const fsTableProps = {
-      fsTableColumns: [{
-        title: '标签名称',
-        dataIndex: 'name',
-        key: 'name',
-        width: '26%',
-      }, {
-        title: '标签组名称',
-        dataIndex: 'groupName',
-        key: 'groupName',
-        width: '26%',
-      }, {
-        title: '渠道名称',
-        dataIndex: 'merchantName',
-        key: 'merchantName',
-        width: '26%',
-      }],
-      ...fsTableOpts,
-    };
-
-    return (
-      <SelectModal
-        mode="multiple"
-        {...searchProps}
-        {...selTableProps}
-        {...fsTableProps}
-        {...modalProps}
-      />
-    );
-  }
-}

+ 12 - 12
src/routes/Order/Edit/SubOrderProfile.js

@@ -51,12 +51,12 @@ export default class SubOrderProfile extends Component {
     const { id } = currentItem;
     validateFields((errors) => {
       if (!errors) {
-        const trackNo = getFieldsValue(['tracKNo']);
+        const { trackNo } = getFieldsValue();
         dispatch({
           type: 'orderDetail/orderSend',
           payload: { id, trackNo },
           callback: () => dispatch(routerRedux.push({
-            pathname: `/order/sub/profile/${id}`,
+            pathname: `/order/profile/${id}`,
             search: queryString.stringify(filters),
           })),
         });
@@ -75,7 +75,7 @@ export default class SubOrderProfile extends Component {
       type: 'orderDetail/orderReceive',
       payload: { id },
       callback: () => dispatch(routerRedux.push({
-        pathname: `/order/sub/profile/${id}`,
+        pathname: `/order/profile/${id}`,
         search: queryString.stringify(filters),
       })),
     });
@@ -87,14 +87,14 @@ export default class SubOrderProfile extends Component {
   renderFooter = (status) => {
     switch (status) {
       // 待发货订单
-      // case Codes.CODE_FORSEND:
-      //   return (
-      //     <FooterToolbar>
-      //       <Button onClick={this.handlePageCancel}>返回订单列表</Button>
-      //       <Button onClick={this.showSendModal} type="primary">立即发货</Button>
-      //     </FooterToolbar>
-      //   );
-      // // 待收货订单
+      case Codes.CODE_FORSEND:
+        return (
+          <FooterToolbar>
+            <Button onClick={this.handlePageCancel}>返回订单列表</Button>
+            <Button onClick={this.showSendModal} type="primary">立即发货</Button>
+          </FooterToolbar>
+        );
+      // 待收货订单
       // case Codes.CODE_SENT:
       //   return (
       //     <FooterToolbar>
@@ -269,7 +269,7 @@ export default class SubOrderProfile extends Component {
     };
 
     return (
-      <PageHeaderLayout title="子订单详情">
+      <PageHeaderLayout>
         {type === Codes.CODE_ENTITY ?
           (
             <Card title="订单状态" bordered={false} style={{ marginBottom: 20 }}>

+ 6 - 16
src/routes/Order/List/index.js

@@ -82,28 +82,18 @@ export default class Order extends PureComponent {
         }));
       },
       onViewItem: (item) => {
-        if (item.flag) {
-          dispatch(
-            routerRedux.push({
-              pathname: `/order/sub/profile/${item.id}`,
-              state: filters,
-            })
-          );
-        } else {
-          dispatch(
-            routerRedux.push({
-              pathname: `/order/profile/${item.id}`,
-              state: filters,
-            })
-          );
-        }
+        dispatch(
+          routerRedux.push({
+            pathname: `/order/profile/${item.id}`,
+            state: filters,
+          })
+        );
       },
     };
 
     return (
       <PageHeaderLayout>
         <Card>
-          <Search {...searchProps} />
           <TableList {...listProps} />
         </Card>
       </PageHeaderLayout>

+ 8 - 43
src/routes/Order/List/table.js

@@ -12,32 +12,12 @@ export default class TableList extends PureComponent {
 
   render() {
     const { dataSource, pagination, ...tableProps } = this.props;
-    const newDataSource = [...dataSource];
-    newDataSource.forEach((item) => {
-      if (Array.isArray(item.detailList) && item.detailList.length) {
-        item.children = item.detailList.map(one => (
-          {
-            ...one,
-            flag: true,
-            userCode: item.userCode,
-            provinceCode: item.provinceCode,
-            cityName: item.cityName,
-            zoneName: item.zoneName,
-          })
-        );
-      }
-    });
 
     const columns = [{
       title: '订单编号',
       dataIndex: 'id',
       key: 'id',
-      fixed: 'left',
-      width: 330,
-    }, {
-      title: '终端编号',
-      dataIndex: 'userCode',
-      key: 'userCode',
+      width: '28%',
     }, {
       title: '校区',
       dataIndex: 'campusName',
@@ -45,30 +25,20 @@ export default class TableList extends PureComponent {
       render: (text, record) => (
         <span>{`${provCodeToName(record.provinceCode)}-${record.cityName}-${record.zoneName}`}</span>
       ),
-    }, {
-      title: '商品总价(元)',
-      dataIndex: 'originPrice',
-      key: 'originPrice',
-    }, {
-      title: '优惠价格(元)',
-      dataIndex: 'adjustPrice',
-      key: 'adjustPrice',
-    }, {
-      title: '实际售价(元)',
-      dataIndex: 'finalPrice',
-      key: 'finalPrice',
+      width: '39%',
     }, {
       title: '状态',
       dataIndex: 'orderStatus',
       key: 'orderStatus',
       render: (text, record) => {
         const statusMap = {
-          [Codes.CODE_UNPAID]: 'default',
+          [Codes.CODE_FORSEND]: 'default',
           [Codes.CODE_COMPLETE]: 'success',
           [Codes.CODE_CANCEL]: 'error',
         };
         return (<Badge status={statusMap[record.orderStatus] || 'processing'} text={orderStatuses[record.orderStatus]} />);
       },
+      width: '8%',
     }, {
       title: '下单时间',
       dataIndex: 'gmtCreated',
@@ -76,17 +46,13 @@ export default class TableList extends PureComponent {
       render: text => (
         <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
       ),
+      width: '17%',
     }, {
       title: '操作',
       dataIndex: 'operation',
       key: 'operation',
-      render: (text, record) => (
-        record.flag ?
-          <a onClick={() => this.handleItemView(record)}>查看子订单</a> :
-          <a onClick={() => this.handleItemView(record)}>查看母订单</a>
-      ),
-      width: 100,
-      fixed: 'right',
+      render: (_, record) => <a onClick={() => this.handleItemView(record)}>查看详情</a>,
+      width: '8%',
     }];
 
     // 配置分页
@@ -96,11 +62,10 @@ export default class TableList extends PureComponent {
       <Table
         simple
         bordered
-        dataSource={newDataSource}
+        dataSource={dataSource}
         columns={columns}
         rowKey={record => record.id}
         {...tableProps}
-        scroll={{ x: 1500 }}
       />
     );
   }

+ 13 - 27
src/routes/MProduct/List/index.js

@@ -6,18 +6,19 @@ import { Card } from 'antd';
 import TableList from './table';
 import Search from './search';
 import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
+import { Codes } from '../../../utils/config';
 
-@connect(state => ({ mproduct: state.mproduct }))
-export default class MerchantProductList extends PureComponent {
+@connect(state => ({ product: state.product }))
+export default class ProductList extends PureComponent {
   render() {
-    const { location, dispatch, mproduct } = this.props;
+    const { location, dispatch, product } = this.props;
     location.query = queryString.parse(location.search);
     const { query, pathname } = location;
     const { field, keyword, ...filters } = query;
-    const { list, listLoading, pagination } = mproduct;
+    const { list, listLoading, pagination, currentItem, itemLoading, modalVisible, modalType } = product;
 
     // 把携带的参数中空值项删除
-    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
+    Object.keys(filters).map(key => { filters[key] ? null : delete filters[key] });
     // 如果搜索内容不为空则添加进filters中
     if (field && keyword) {
       filters.field = field;
@@ -34,9 +35,7 @@ export default class MerchantProductList extends PureComponent {
         }
         dispatch(routerRedux.push({
           pathname,
-          search: queryString.stringify({
-            ...payload,
-          }),
+          search: queryString.stringify(payload),
         }));
       },
     };
@@ -46,8 +45,7 @@ export default class MerchantProductList extends PureComponent {
       location,
       dataSource: list,
       loading: listLoading,
-      curStatus: filters.status,
-      onChange: (page, filterArgs) => {
+      onChange: (pagination, filterArgs) => {
         const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
         const tableFilters = Object.keys(filterArgs).reduce((obj, key) => {
           const newObj = { ...obj };
@@ -56,35 +54,23 @@ export default class MerchantProductList extends PureComponent {
         }, {});
 
         const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
+        Object.keys(data).map(key => data[key] ? null : delete data[key]);
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
             ...data,
-            pageNo: page.current,
-            pageSize: page.pageSize,
+            pageNo: pagination.current,
+            pageSize: pagination.pageSize,
           }),
         }));
       },
-      onViewItem: (item) => {
-        dispatch(
-          routerRedux.push({
-            pathname: '/products/view',
-            search: queryString.stringify({
-              merchantId: item.merchantId,
-              pid: item.pid,
-            }),
-            state: filters,
-          })
-        );
-      },
     };
 
     return (
       <PageHeaderLayout>
         <Card>
-          <Search {...searchProps} />
-          <TableList {...listProps} />
+          <Search { ...searchProps } />
+          <TableList { ...listProps } />
         </Card>
       </PageHeaderLayout>
     );

+ 6 - 7
src/routes/MProduct/List/search.js

@@ -1,11 +1,10 @@
-import React, { PureComponent } from 'react';
-import { Form, Row, Col } from 'antd';
+import react, { PureComponent } from 'react';
+import { Row, Col } from 'antd';
 import DataSearch from '../../../components/DataSearch';
 
-@Form.create()
 export default class Search extends PureComponent {
   render() {
-    const { field, keyword, onSearch } = this.props;
+    const { field, keyword, onSearch, onAdd } = this.props;
 
     const searchGroupProps = {
       field,
@@ -14,19 +13,19 @@ export default class Search extends PureComponent {
       select: true,
       selectOptions: [{
         value: 'name', name: '产品名称', mode: 'input',
-      }, {
+      },{
         value: 'code', name: '产品编号', mode: 'input',
       }],
       selectProps: {
         defaultValue: field || 'code',
       },
-      onSearch: value => onSearch(value),
+      onSearch: (value) => onSearch(value),
     };
 
     return (
       <Row gutter={24}>
         <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-          <DataSearch {...searchGroupProps} />
+          <DataSearch { ...searchGroupProps } />
         </Col>
       </Row>
     );

+ 15 - 27
src/routes/MProduct/List/table.js

@@ -1,20 +1,18 @@
 import React, { PureComponent } from 'react';
 import moment from 'moment';
-import { Table, Badge } from 'antd';
-import { itemStatuses, Codes, productType } from '../../../utils/config';
+import queryString from 'query-string';
+import { Modal, Table, Badge } from 'antd';
+import { statuses, productType, Codes } from '../../../utils/config';
 
 export default class TableList extends PureComponent {
   render() {
-    const {
-      onViewItem,
-      pagination,
-      ...tableProps
-    } = this.props;
+    const { onViewItem, pagination, ...tableProps } = this.props;
+
     const columns = [{
       title: '产品编号',
       dataIndex: 'code',
       key: 'code',
-      width: '25%',
+      width: '30%',
     }, {
       title: '产品名称',
       dataIndex: 'name',
@@ -24,43 +22,33 @@ export default class TableList extends PureComponent {
       title: '产品类型',
       dataIndex: 'type',
       key: 'type',
-      render: (text, record) => productType[record.type],
-      width: '10%',
+      render: text => productType[text],
+      width: '20%',
     }, {
-      title: '状态',
+      title: '产品状态',
       dataIndex: 'status',
       key: 'status',
       render: (text, record) => {
-        const statusMap = { [Codes.CODE_NORMAL]: 'success', [Codes.CODE_DELETE]: 'error' };
-        return (<Badge status={statusMap[record.status]} text={itemStatuses[record.status]} />);
+        const statusMap = {[Codes.CODE_NORMAL]: 'success', [Codes.CODE_DELETE]: 'error'};
+        return (<Badge status={statusMap[record.status]} text={statuses[record.status]} />);
       },
-      width: '10%',
-    }, {
-      title: '修改时间',
-      dataIndex: 'gmtModified',
-      key: 'gmtModified',
-      render: text => (
-        <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
-      ),
-      width: '20%',
+      width: '15%',
     }, {
       title: '操作',
       dataIndex: 'operation',
       key: 'operation',
-      render: (text, record) => (
-        <a onClick={() => onViewItem(record)}>查看</a>
-      ),
+      render: (text, record) => <a onClick={() => onViewItem(record)}>查看</a>,
       width: '5%',
     }];
 
     // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
+    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条`};
 
     return (
       <Table
         simple
         bordered
-        {...tableProps}
+        { ...tableProps }
         columns={columns}
         rowKey={record => record.id}
       />

+ 0 - 67
src/routes/Terminal/Edit/campus.js

@@ -1,67 +0,0 @@
-import React, { PureComponent } from 'react';
-import SelectModal from '../../../components/SelectModal';
-
-export default class CampusSelectModal extends PureComponent {
-  render() {
-    const {
-      modalVisible,
-      onCancel,
-      onOk,
-      onSearch,
-      ...fsTableOpts
-    } = this.props;
-
-    const modalProps = {
-      title: '选择校区',
-      maskClosable: false,
-      visible: modalVisible,
-      onCancel,
-      onOk,
-    };
-
-    const searchProps = {
-      searchField: 'name',
-      searchKeyWord: '',
-      searchSize: 'default',
-      searchSelect: true,
-      searchSelectOptions: [{
-        value: 'name', name: '校区名称', mode: 'input',
-      }, {
-        value: 'code', name: '校区编号', mode: 'input',
-      }],
-      searchSelectProps: {
-        defaultValue: 'code',
-      },
-      onSearch: value => onSearch(value),
-    };
-
-    const fsTableProps = {
-      fsTableColumns: [{
-        title: '校区编号',
-        dataIndex: 'code',
-        key: 'code',
-        width: '20%',
-      }, {
-        title: '校区名称',
-        dataIndex: 'name',
-        key: 'name',
-        width: '53%',
-      }, {
-        title: '渠道名称',
-        dataIndex: 'merchantName',
-        key: 'merchantName',
-        width: '15%',
-      }],
-      ...fsTableOpts,
-    };
-
-    return (
-      <SelectModal
-        mode="single"
-        {...searchProps}
-        {...fsTableProps}
-        {...modalProps}
-      />
-    );
-  }
-}

+ 0 - 192
src/routes/Terminal/Edit/index.js

@@ -1,192 +0,0 @@
-import React, { Component } from 'react';
-import { Card, Form, List, Input, Switch, Tooltip, Button, message } from 'antd';
-import { routerRedux } from 'dva/router';
-import { connect } from 'dva';
-import queryString from 'query-string';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-import CampusSelectModal from './campus';
-import { Codes, pageSize } from '../../../utils/config';
-
-@Form.create()
-@connect(state => ({
-  terminalDetail: state.terminalDetail,
-  campus: state.campus,
-}))
-export default class TerminalProfile extends Component {
-  handleCampusSelectClick = () => {
-    this.props.dispatch({ type: 'terminalDetail/showModal' });
-    this.props.dispatch({
-      type: 'campus/query',
-      payload: { pageNo: 1, pageSize },
-    });
-  }
-
-  handleCampusModalOk = (data) => {
-    this.props.dispatch({
-      type: 'terminalDetail/saveCampus',
-      payload: data,
-    });
-  }
-
-  handleCampusModalCancel = () => {
-    this.props.dispatch({ type: 'terminalDetail/hideModal' });
-  }
-
-  handleCampusModalSearch = () => {
-
-  }
-
-  handleCampusModalTableChange = () => {
-
-  }
-
-  handlePageCancel = () => {
-    const { dispatch, terminalDetail } = this.props;
-    const { filters } = terminalDetail;
-    dispatch(routerRedux.push({
-      pathname: '/terminal',
-      search: queryString.stringify(filters),
-    }));
-  }
-
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-
-    const { dispatch, form, terminalDetail } = this.props;
-    const { validateFields, getFieldsValue } = form;
-    const { currentItem, operType, filters } = terminalDetail;
-    const { campusId, id, status } = currentItem;
-
-    validateFields((errors) => {
-      if (errors) return;
-      if (!campusId) {
-        message.error('请选择校区!');
-        return;
-      }
-
-      const data = { ...getFieldsValue(), campusId };
-      if (operType === 'create') {
-        data.status = Codes.CODE_NORMAL;
-      } else if (operType === 'update') {
-        data.status = status;
-        data.id = id;
-      }
-
-      dispatch({
-        type: `terminalDetail/${operType}`,
-        payload: data,
-        callback: () => {
-          dispatch(routerRedux.push({
-            pathname: '/terminal',
-            search: queryString.stringify(filters),
-          }));
-        },
-      });
-    });
-  }
-
-  render() {
-    const { form, terminalDetail, campus } = this.props;
-    const { currentItem, modalShow, operType } = terminalDetail;
-    const { name, password, status, campusId, campusName, merchantName } = currentItem;
-    const { getFieldDecorator } = form;
-
-    const formItemLayout = {
-      labelCol: {
-        xs: { span: 24 },
-        sm: { span: 7 },
-        md: { span: 8 },
-      },
-      wrapperCol: {
-        xs: { span: 24 },
-        sm: { span: 12 },
-        md: { span: 10 },
-      },
-    };
-
-    const submitFormLayout = {
-      wrapperCol: {
-        xs: { span: 24, offset: 0 },
-        sm: { span: 10, offset: 8 },
-      },
-    };
-
-    return (
-      <PageHeaderLayout>
-        <Card title="终端用户">
-          <Form layout="horizontal" onSubmit={this.handlePageSubmit}>
-            <Form.Item hasFeedback label="所属校区" {...formItemLayout}>
-              <Tooltip placement="top" title="点击选择校区">
-                <Button disabled={operType === 'update'} style={{ marginRight: 20 }} type="primary" size="small" icon="select" onClick={this.handleCampusSelectClick}>选择</Button>
-              </Tooltip>
-              {operType === 'update' ?
-                (
-                  <List
-                    size="small"
-                    bordered
-                    dataSource={[
-                    `所属校区: ${campusName}`,
-                    `所属渠道: ${merchantName}`,
-                  ]}
-                    renderItem={item => <List.Item>{item}</List.Item>}
-                  />
-                ) : (
-                  campusId ? <List size="small" bordered dataSource={[`${campusName}`]} renderItem={item => <List.Item>{item}</List.Item>} /> : null)
-              }
-            </Form.Item>
-            <Form.Item label="终端名称:" hasFeedback {...formItemLayout}>
-              {getFieldDecorator('name', {
-                initialValue: name,
-              })(<Input placeholder="请输入(例: 教室三/教室四...)" />)}
-            </Form.Item>
-            {operType === 'create' ?
-              (
-                <Form.Item label="终端密码:" hasFeedback {...formItemLayout}>
-                  {getFieldDecorator('password', {
-                  rules: [{ required: true, type: 'string', message: '密码为必填项!' }],
-                  initialValue: password,
-                })(<Input placeholder="请输入" />)}
-                </Form.Item>
-              ) : (
-                <Form.Item label="终端密码:" hasFeedback {...formItemLayout}>
-                  {getFieldDecorator('password', {
-                  initialValue: password,
-                })(<Input placeholder="修改密码时填写" />)}
-                </Form.Item>
-              )
-            }
-            <Form.Item label="账号状态:" {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropsName: 'checked',
-            })(
-              <Switch
-                defaultChecked={status === Codes.CODE_NORMAL}
-                checkedChildren="使用中"
-                unCheckedChildren="禁用中"
-              />
-            )}
-            </Form.Item>
-            <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
-              <Button onClick={this.handlePageCancel}>取消</Button>
-              <Button type="primary" style={{ marginLeft: 35 }} htmlType="submit">提交</Button>
-            </Form.Item>
-          </Form>
-          {/* 校区模态选择框 */}
-          <CampusSelectModal
-            rowKeyName="id"
-            modalVisible={modalShow}
-            style={{ top: 20 }}
-            width={600}
-            onOk={this.handleCampusModalOk}
-            onCancel={this.handleCampusModalCancel}
-            onSearch={this.handleCampusModalSearch}
-            fsTableDataSource={campus.list || []}
-            fsTableLoading={campus.listLoading}
-            fsTablePagination={campus.pagination}
-            fsTableOnChange={this.handleCampusModalTableChange}
-          />
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 121
src/routes/Terminal/List/index.js

@@ -1,121 +0,0 @@
-import React, { Component } from 'react';
-import queryString from 'query-string';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card } from 'antd';
-import TerminalTableList from './table';
-import TerminalSearch from './search';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-
-@connect(state => ({ terminal: state.terminal }))
-export default class TerminalList extends Component {
-  render() {
-    const { dispatch, location, terminal } = this.props;
-
-    location.query = queryString.parse(location.search);
-    const { query, pathname } = location;
-    const { field, keyword, ...filters } = query;
-
-    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
-    if (field && keyword) {
-      filters.field = field;
-      filters.keyword = keyword;
-    }
-
-    const { list, listLoading, pagination } = terminal;
-
-    const searchProps = {
-      field,
-      keyword,
-      onSearch: (payload) => {
-        if (!payload.keyword.length) {
-          delete payload.field;
-          delete payload.keyword;
-        }
-        dispatch(routerRedux.push({
-          pathname,
-          search: queryString.stringify({
-            ...payload,
-          }),
-        }));
-      },
-      onAdd: () => {
-        dispatch(routerRedux.push({
-          pathname: '/terminal/add',
-          state: filters,
-        }));
-      },
-    };
-
-    const listProps = {
-      curStatus: filters.status,
-      dataSource: list,
-      loading: listLoading,
-      pagination,
-      location,
-      onChange: (pagination, filterArgs) => {
-        const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
-        const tableFilters = Object.keys(filterArgs).reduce((obj, key) => {
-          const newObj = { ...obj };
-          newObj[key] = getValue(filterArgs[key]);
-          return newObj;
-        }, {});
-
-        const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
-        dispatch(routerRedux.push({
-          pathname,
-          search: queryString.stringify({
-            ...data,
-            pageNo: pagination.current,
-            pageSize: pagination.pageSize,
-          }),
-        }));
-      },
-      onEditItem: (item) => {
-        dispatch(routerRedux.push({
-          pathname: `/terminal/edit/${item.id}`,
-          state: filters,
-          record: item,
-        }));
-      },
-      onDeleteItem: (id) => {
-        dispatch({
-          type: 'terminal/delete',
-          payload: id,
-          callback: () => {
-            dispatch(
-              routerRedux.push({
-                pathname,
-                search: queryString.stringify(filters),
-              })
-            );
-          },
-        });
-      },
-      onRecoverItem: (payload) => {
-        dispatch({
-          type: 'terminal/recover',
-          payload,
-          callback: () => {
-            dispatch(
-              routerRedux.push({
-                pathname,
-                search: queryString.stringify(filters),
-              })
-            );
-          },
-        });
-      },
-    };
-
-    return (
-      <PageHeaderLayout>
-        <Card>
-          <TerminalSearch {...searchProps} />
-          <TerminalTableList {...listProps} />
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 45
src/routes/Terminal/List/search.js

@@ -1,45 +0,0 @@
-import react, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { Row, Col, Button, Icon } from 'antd';
-import DataSearch from '../../../components/DataSearch';
-
-export default class TerminalSearch extends Component {
-  static propTypes = {
-    onSearch: PropTypes.func,
-    onAdd: PropTypes.func,
-    field: PropTypes.string,
-    keyword: PropTypes.string,
-  };
-
-  render() {
-    const { field, keyword, onSearch, onAdd } = this.props;
-    const searchGroupProps = {
-      field,
-      keyword,
-      size: 'default',
-      select: true,
-      selectOptions: [{
-        value: 'name', name: '终端名称', type: 'input',
-      }, {
-        value: 'code', name: '终端编号', type: 'input',
-      }],
-      selectProps: {
-        defaultValue: field || 'name',
-      },
-      onSearch: (value) => {
-        onSearch(value);
-      },
-    };
-
-    return (
-      <Row gutter={24}>
-        <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-          <DataSearch {...searchGroupProps} />
-        </Col>
-        <Col lg={{ offset: 7, span: 7 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
-          <Button type="primary" onClick={onAdd}><Icon type="plus-circle" />添加终端</Button>
-        </Col>
-      </Row>
-    );
-  }
-}

+ 0 - 96
src/routes/Terminal/List/table.js

@@ -1,96 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { Divider, Table, Modal, Badge } from 'antd';
-import { Codes, terminalStatuses } from '../../../utils/config';
-
-export default class TerminalTableList extends Component {
-  handleOperateItem = (record) => {
-    const { onDeleteItem, onRecoverItem } = this.props;
-    Modal.confirm({
-      title: `您确定要${record.status === Codes.CODE_NORMAL ? '禁用' : '解禁'}该终端账号?`,
-      onOk() {
-        if (record.status === Codes.CODE_NORMAL) {
-          onDeleteItem(record.id);
-        } else {
-          onRecoverItem({ id: record.id, status: Codes.CODE_NORMAL });
-        }
-      },
-    });
-  }
-
-  render() {
-    const { onDeleteItem, onEditItem, curStatus, pagination, ...tableProps } = this.props;
-
-    const columns = [{
-      title: '终端编号',
-      dataIndex: 'code',
-      key: 'code',
-      width: '14%',
-    }, {
-      title: '终端名称',
-      dataIndex: 'name',
-      key: 'name',
-      width: '11%',
-    }, {
-      title: '校区',
-      dataIndex: 'campusName',
-      key: 'campusName',
-      width: '30%',
-    }, {
-      title: '渠道名称',
-      dataIndex: 'merchantId',
-      key: 'merchantId',
-      render: (text, record) => record.merchantName,
-      width: '10%',
-    }, {
-      title: '状态',
-      dataIndex: 'status',
-      key: 'status',
-      render: (text, record) => {
-        const statusMap = { [Codes.CODE_NORMAL]: 'success', [Codes.CODE_DISABLE]: 'error' };
-        return (<Badge status={statusMap[record.status]} text={terminalStatuses[record.status]} />);
-      },
-      filters: Object.keys(terminalStatuses).map(key => ({ text: terminalStatuses[key], value: key })),
-      filterMultiple: false,
-      filteredValue: [curStatus],
-      width: '8%',
-    }, {
-      title: '修改时间',
-      dataIndex: 'gmtModified',
-      key: 'gmtModified',
-      render: text => (
-        <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
-      ),
-      width: '17%',
-    }, {
-      title: '操作',
-      dataIndex: 'operation',
-      key: 'operation',
-      render: (text, record) => (
-        <div>
-          <a onClick={() => onEditItem(record)}>编辑</a>
-          <Divider type="vertical" />
-          <a onClick={() => this.handleOperateItem(record)}>{record.status === Codes.CODE_NORMAL ? '禁用' : '解禁'}</a>
-        </div>
-      ),
-      width: '10%',
-    }];
-
-    columns.map((item) => {
-      item.dataIndex === 'status' && !curStatus ? delete item.filteredValue : null;
-    });
-
-    // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
-
-    return (
-      <Table
-        simple
-        bordered
-        {...tableProps}
-        columns={columns}
-        rowKey={record => record.id}
-      />
-    );
-  }
-}

+ 0 - 86
src/routes/Terminal/List/table.less

@@ -1,86 +0,0 @@
-@import "~antd/lib/style/themes/default.less";
-@import "../../../utils/utils.less";
-
-.table {
-  :global {
-    .ant-table-tbody > tr > td,
-    .ant-table-thead > tr > th {
-      height: 50px;
-    }
-  }
-
-  &.motion {
-    :global {
-      .ant-table-tbody > tr > td,
-      .ant-table-thead > tr > th {
-        &:nth-child(1) {
-          width: 16%;
-        }
-
-        &:nth-child(2) {
-          width: 12%;
-        }
-
-        &:nth-child(3) {
-          width: 22%;
-        }
-
-        &:nth-child(4) {
-          width: 10%;
-        }
-
-        &:nth-child(5) {
-          width: 10%;
-        }
-
-        &:nth-child(6) {
-          width: 18%;
-        }
-
-        &:nth-child(7) {
-          width: 12%;
-        }
-      }
-
-      .ant-table-thead {
-        & > tr {
-          transition: none;
-          display: block;
-
-          & > th {
-            display: inline-flex;
-            align-items: center;
-            justify-content: center;
-          }
-        }
-      }
-
-      .ant-table-tbody {
-        & > tr {
-          transition: none;
-          display: block;
-          border-bottom: 1px solid #f5f5f5;
-
-          & > td {
-            border-bottom: none;
-            display: inline-flex;
-            align-items: center;
-            justify-content: center;
-          }
-
-          &.ant-table-expanded-row-level-1 > td {
-            height: auto;
-          }
-        }
-      }
-    }
-  }
-}
-
-.splitLine {
-  background: @border-color-split;
-  display: inline-block;
-  margin: 0 8px;
-  width: 1px;
-  height: 12px;
-}

+ 1 - 1
src/services/mproduct.js

@@ -14,6 +14,6 @@ export async function createMerchantProduct(params) {
   const options = {
     method: 'PUT',
     body: JSON.stringify(params),
-  };
+  }
   return request(`${merchantProductCreate}`, options);
 }

+ 4 - 0
src/services/order.js

@@ -10,6 +10,10 @@ export async function queryOne({ id }) {
   return request(`${order}/${id}`);
 }
 
+export async function querySubOrders(params) {
+  return request(`${subOrder}?${stringify(params)}`);
+}
+
 export async function querySubOrder({ id }) {
   return request(`${subOrder}/${id}`);
 }

+ 2 - 2
src/theme.js

@@ -1,9 +1,9 @@
 // https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
 module.exports = {
   'layout-header-background': '#333744',
-  'primary-color': '#00c1de',
+  'primary-color': '#ff7a45',
   'card-actions-background': '#f5f8fa',
-  'table-header-bg': '#3eabe8',
+  'table-header-bg': '#ff7a45',
   'table-padding-vertical': '6px',
   'table-padding-horizontal': '6px',
 };

+ 3 - 4
src/utils/api.js

@@ -5,10 +5,7 @@ module.exports = {
   cmsUser: `${config.apiHost}/cms/user`,
   userLogin: `${config.apiHost}/login`,
   userLogout: `${config.apiHost}/logout`,
-  campuses: `${config.apiHost}/campus/list`,
-  campus: `${config.apiHost}/campus`,
-  terminals: `${config.apiHost}/user/list`,
-  terminal: `${config.apiHost}/user`,
+  product: `${config.apiHost}/product`,
   merchant: `${config.apiHost}/merchant`,
   merchantProducts: `${config.apiHost}/merchant/product`,
   merchantProduct: `${config.apiHost}/merchant/product/detail`,
@@ -16,5 +13,7 @@ module.exports = {
   order: `${config.apiHost}/order`,
   subOrder: `${config.apiHost}/order/detail`,
   orderPay: `${config.apiHost}/order/pay`,
+  orderSend: `${config.apiHost}/order/send`,
+  orderReceive: `${config.apiHost}/order/receive`,
   snapShot: `${config.apiHost}/order/snapshot`,
 };

+ 31 - 31
src/utils/city.js

@@ -21,7 +21,7 @@
     JSON.stringify(map)
     ```
 */
-const DICT = {
+let DICT = {
   110000: '北京',
   110100: '北京市',
   110101: '东城区',
@@ -4018,44 +4018,44 @@ const DICT = {
   820200: '离岛',
   990000: '海外',
   990100: '海外',
-};
+}
 
 // id pid/parentId name children
 const tree = (list) => {
-  const mapped = {};
-  let item;
+  let mapped = {}
+  let item
   for (let i = 0; i < list.length; i += 1) {
-    item = list[i];
-    if (!item || !item.id) continue;
-    mapped[item.id] = item;
+    item = list[i]
+    if (!item || !item.id) continue
+    mapped[item.id] = item
   }
 
-  const result = [];
+  let result = []
   for (let ii = 0; ii < list.length; ii += 1) {
-    item = list[ii];
+    item = list[ii]
 
-    if (!item) continue;
+    if (!item) continue
     /* jshint -W041 */
     if (item.pid === undefined && item.parentId === undefined) {
-      result.push(item);
-      continue;
+      result.push(item)
+      continue
     }
-    const parent = mapped[item.pid] || mapped[item.parentId];
-    if (!parent) continue;
-    if (!parent.children) parent.children = [];
-    parent.children.push(item);
+    let parent = mapped[item.pid] || mapped[item.parentId]
+    if (!parent) continue
+    if (!parent.children) parent.children = []
+    parent.children.push(item)
   }
-  return result;
-};
+  return result
+}
 
-const DICT_FIXED = (function () {
-  const fixed = [];
-  for (const id in DICT) {
+let DICT_FIXED = (function () {
+  let fixed = []
+  for (let id in DICT) {
     if ({}.hasOwnProperty.call(DICT, id)) {
-      let pid;
+      let pid
       if (id.slice(2, 6) !== '0000') {
         pid = id.slice(4, 6) === '00' ? (`${id.slice(0, 2)}0000`) :
-          `${id.slice(0, 4)}00`;
+          `${id.slice(0, 4)}00`
       }
       fixed.push({
         id,
@@ -4063,24 +4063,24 @@ const DICT_FIXED = (function () {
         name: DICT[id],
         value: DICT[id],
         label: DICT[id],
-      });
+      })
     }
   }
-  return tree(fixed);
-}());
+  return tree(fixed)
+}())
 
 function provCodeToName(provCode) {
-  for (const key in DICT) {
-    if (String(key).slice(0, 2) === provCode) {
+  for (let key in DICT) {
+    if (String(key).slice(0,2) === provCode) {
       return DICT[key];
     }
   }
 }
 
 function provNameToCode(provName) {
-  for (const key in DICT) {
+  for (let key in DICT) {
     if (provName === DICT[key]) {
-      return String(key).slice(0, 2);
+      return String(key).slice(0,2);
     }
   }
 }
@@ -4089,4 +4089,4 @@ module.exports = {
   DICT_FIXED,
   provCodeToName,
   provNameToCode,
-};
+}

+ 3 - 3
src/utils/helper.js

@@ -4,7 +4,7 @@
  * @param {object} value [登录接口返回内容]
  */
 export function addLocalUser(value) {
-  window.localStorage.setItem('PJ@2B#CMS!User', JSON.stringify(value));
+  window.localStorage.setItem('CP@2B#CMS!User', JSON.stringify(value));
 }
 
 /**
@@ -13,7 +13,7 @@ export function addLocalUser(value) {
  * @return {JSON} [用户信息]
  */
 export function getLocalUser() {
-  const localUser = window.localStorage.getItem('PJ@2B#CMS!User');
+  const localUser = window.localStorage.getItem('CP@2B#CMS!User');
   if (localUser && localUser !== 'undefined') {
     return JSON.parse(localUser);
   }
@@ -26,7 +26,7 @@ export function getLocalUser() {
  * @return {string} [token信息]
  */
 export function getLocalToken() {
-  const localUser = window.localStorage.getItem('PJ@2B#CMS!User');
+  const localUser = window.localStorage.getItem('CP@2B#CMS!User');
   if (localUser && localUser !== 'undefined') {
     return JSON.parse(localUser).token;
   }