YY 2 anni fa
parent
commit
33738de4f4

+ 12 - 4
src/layout/data/menu.js

@@ -167,17 +167,25 @@ export const adminMenu = [
         name: '账单管理',
         index: '6-6',
       },
+    ],
+  },
+  {
+    icon: 'icon-shouye',
+    name: '尊荣管理',
+    index: '7',
+    type: '0',
+    children: [
       {
         icon: 'icon-rencai',
-        path: '/selfShop/zrGoods',
+        path: '/zr/zrGoods',
         name: '尊荣商品',
-        index: '6-7',
+        index: '7-1',
       },
       {
         icon: 'icon-rencai',
-        path: '/selfShop/zrOrder',
+        path: '/zr/zrOrder',
         name: '尊荣订单',
-        index: '6-8',
+        index: '7-2',
       },
     ],
   },

+ 2 - 0
src/router/index.js

@@ -6,6 +6,7 @@ import platmanag from './module/platmanag';
 import platActivi from './module/platActivi';
 import platfinance from './module/platfinance';
 import platSettings from './module/platSettings';
+import zr from './module/zr';
 import dev from './module/dev';
 Vue.use(VueRouter);
 
@@ -35,6 +36,7 @@ const routes = [
       ...platSettings,
       ...platmanag,
       ...platfinance,
+      ...zr,
     ],
   },
 ];

+ 0 - 12
src/router/module/selfShop.js

@@ -65,16 +65,4 @@ export default [
     meta: { title: '自营店铺-账单管理' },
     component: () => import('@/views/selfShop/bill/index.vue'),
   },
-  {
-    path: '/selfShop/zrGoods',
-    name: 'selfShop_zrGoods',
-    meta: { title: '自营店铺-尊荣商品' },
-    component: () => import('@/views/selfShop/zrGoods/index.vue'),
-  },
-  {
-    path: '/selfShop/zrOrder',
-    name: 'selfShop_zrOrder',
-    meta: { title: '自营店铺-尊荣订单' },
-    component: () => import('@/views/selfShop/zrOrder/index.vue'),
-  },
 ];

+ 14 - 0
src/router/module/zr.js

@@ -0,0 +1,14 @@
+export default [
+  {
+    path: '/zr/zrGoods',
+    name: 'zr_zrGoods',
+    meta: { title: '自营店铺-尊荣商品' },
+    component: () => import('@/views/zr/zrGoods/index.vue'),
+  },
+  {
+    path: '/zr/zrOrder',
+    name: 'zr_zrOrder',
+    meta: { title: '自营店铺-尊荣订单' },
+    component: () => import('@/views/zr/zrOrder/index.vue'),
+  },
+];

+ 7 - 2
src/views/platmanag/storeAcc/detail.vue

@@ -31,6 +31,9 @@
             <template #role>
               <el-option v-for="i in roleList" :key="i._id" :label="i.name" :value="i._id"></el-option>
             </template>
+            <template #password v-if="!form.id">
+              <el-input v-model="form.password" type="password" placeholder="请输入密码"></el-input>
+            </template>
           </data-form>
         </el-col>
       </el-row>
@@ -74,9 +77,11 @@ export default {
         { label: '账号', model: 'account' },
         { label: '角色', model: 'role', type: 'select' },
         { label: '邮箱', model: 'email' },
-        { label: '密码', model: 'password', type: 'password', display: (i) => i.password == '' },
+        { label: '密码', model: 'password', custom: true },
       ],
-      rules: {},
+      rules: {
+        // password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
+      },
       form: {},
       roleList: [],
     };

+ 0 - 128
src/views/selfShop/zrOrder/index.vue

@@ -1,128 +0,0 @@
-<template>
-  <div id="card-1">
-    <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight">
-        <el-col :span="24" class="one"> <span>尊荣订单</span> </el-col>
-        <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"> </search-1>
-        <data-table
-          :select="true"
-          :selected="selected"
-          @handleSelect="handleSelect"
-          :fields="fields"
-          :opera="opera"
-          @query="search"
-          :data="list"
-          :total="total"
-          @detail="toDetail"
-        >
-        </data-table>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-const _ = require('lodash');
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('zrOrder');
-const { mapActions: dictData } = createNamespacedHelpers('dictData');
-
-export default {
-  name: 'card-1',
-  props: {},
-  components: { search1: () => import('./parts/search-1.vue') },
-  data: function () {
-    return {
-      searchForm: {},
-      list: [],
-      total: 0,
-      opera: [{ label: '详情', method: 'detail' }],
-      fields: [
-        { label: '订单号', model: 'no' },
-        { label: '下单时间', model: 'buy_time' },
-        { label: '顾客', model: 'customer.name' },
-        { label: '商品', model: 'goods' },
-        { label: '需支付金额', model: 'real_pay' },
-        { label: '商品数量', model: 'buy_num_total' },
-      ],
-      // 多选值
-      selected: [],
-      statusList: [],
-    };
-  },
-  async created() {
-    await this.search();
-    await this.searchOther();
-  },
-  methods: {
-    ...dictData({ dictQuery: 'query' }),
-    ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
-    // 查询
-    async search({ skip = 0, limit = 10, ...info } = {}) {
-      // let condition = _.cloneDeep(this.searchForm);
-      // if (condition.buy_time) {
-      //   condition[`buy_time@start`] = _.head(condition.buy_time);
-      //   condition[`buy_time@end`] = _.last(condition.buy_time);
-      //   delete condition.buy_time;
-      // }
-      // let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
-      // if (this.$checkRes(res)) {
-      //   this.$set(this, 'list', res.data);
-      //   this.$set(this, 'total', res.total);
-      // }
-    },
-    toDetail({ data }) {
-      this.$router.push({ path: '/selfShop/zrOrder/detail_orderDetail', query: { id: data.id } });
-    },
-    toClose() {
-      this.searchForm = {};
-      this.search();
-    },
-    // 多选
-    handleSelect(data) {
-      this.$emit('handleSelect');
-    },
-    // 查询其他信息
-    async searchOther() {
-      let res;
-      // 类型
-      res = await this.dictQuery({ code: 'order_process' });
-      if (this.$checkRes(res)) {
-        this.$set(this, `statusList`, res.data);
-      }
-    },
-  },
-  computed: {
-    ...mapState(['user']),
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.main {
-  .one {
-    margin: 0 0 10px 0;
-    span:nth-child(1) {
-      font-size: 20px;
-      font-weight: 700;
-      margin-right: 10px;
-    }
-  }
-  .two {
-    margin: 0 0 10px 0;
-  }
-  .thr {
-    margin: 0 0 10px 0;
-  }
-}
-</style>

+ 14 - 27
src/views/selfShop/zrGoods/index.vue

@@ -19,7 +19,6 @@
         @puton="toPuton"
         @lower="toLower"
         @delete="toDelete"
-        @copy="toCopy"
       ></data-table>
     </template>
     <template v-else>
@@ -60,13 +59,13 @@ export default {
         { label: '排序', model: 'sort' },
         { label: '商品名称', model: 'name' },
         { label: '店铺名称', model: 'shop.name' },
+        { label: '商品库存', model: 'num' },
         { label: '商品状态', model: 'status', format: (i) => this.getStatus(i) },
       ],
       opera: [
         { label: '修改', method: 'edit' },
         { label: '上架', method: 'puton', display: (i) => i.status == '0' },
         { label: '下架', method: 'lower', display: (i) => i.status == '1' },
-        { label: '复制', method: 'copy' },
         { label: '删除', method: 'delete', confirm: true, type: 'danger' },
       ],
       btnList: [{ label: '添加', method: 'add' }],
@@ -84,8 +83,7 @@ export default {
         { label: '简短简介', model: 'shot_brief', maxLength: 50 },
         { label: '预计发货时间', model: 'send_time' },
         { label: '商品状态', model: 'status', type: 'select' },
-        { label: '商品来源', model: 'source' },
-        { label: '网址', model: 'url' },
+        { label: '商品库存', model: 'num', type: 'number' },
         { label: '排序', model: 'sort', type: 'number' },
         { label: '消耗尊荣', model: 'cost', type: 'number' },
         { label: '商品图片', model: 'file', type: 'upload', url: '/files/point/zrGoods/upload' },
@@ -107,13 +105,18 @@ export default {
     ...methodsUtil,
     // 查询
     async search({ skip = 0, limit = this.limit, ...others } = {}) {
-      // let query = { skip, limit, ...others, shop: this.user.shop.id };
-      // if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
-      // const res = await this.query(query);
-      // if (this.$checkRes(res)) {
-      //   this.$set(this, `list`, res.data);
-      //   this.$set(this, `total`, res.total);
-      // }
+      if (this.user.role.code == 'sadmin') {
+        others.shop = '';
+      } else {
+        others.shop = this.user.shop.id;
+      }
+      let query = { skip, limit, ...others };
+      if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
+      const res = await this.query(query);
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
     },
     // 添加自定义
     initAddData() {
@@ -123,22 +126,6 @@ export default {
       };
       this.$set(this, 'form', obj);
     },
-    // 复制
-    async toCopy({ data }) {
-      this.$confirm('是否确认复制该商品?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      }).then(async () => {
-        let res;
-        res = await this.copy(data.id);
-        if (this.$checkRes(res)) {
-          this.$message({ type: `success`, message: `复制成功` });
-          this.toBack();
-          this.search();
-        }
-      });
-    },
     // 查询其他信息
     async searchOthers() {
       let res;

src/views/selfShop/zrOrder/detail_orderDetail.vue → src/views/zr/zrOrder/detail_orderDetail.vue


+ 91 - 0
src/views/zr/zrOrder/index.vue

@@ -0,0 +1,91 @@
+<template>
+  <div id="card-1">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one"> <span>尊荣订单</span> </el-col>
+        <detail-1 v-if="num == '1'" @toDeliver="toDeliver" :statusList="statusList"></detail-1>
+        <detail-2 v-else-if="num == '2'" :deliverList="list" @toBack="toBack"></detail-2>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
+
+export default {
+  name: 'card-1',
+  props: {},
+  components: { detail1: () => import('./parts/detail-1.vue'), detail2: () => import('./parts/detail-2.vue') },
+  data: function () {
+    return {
+      num: '1',
+      list: [],
+      // 订单状态
+      statusList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+  },
+  methods: {
+    ...dictData({ dictQuery: 'query' }),
+    // 查询其他信息
+    async searchOther() {
+      console.log(this.user);
+      let res;
+      // 类型
+      res = await this.dictQuery({ code: 'order_process' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `statusList`, res.data);
+      }
+    },
+    // 生成发货清单
+    toDeliver({ data }) {
+      if (data.length == '0') {
+        this.$message('请选择订单');
+      } else {
+        this.$set(this, 'list', data);
+        this.$set(this, 'num', '2');
+      }
+    },
+    toBack() {
+      this.$set(this, 'num', '1');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+    span:nth-child(1) {
+      font-size: 20px;
+      font-weight: 700;
+      margin-right: 10px;
+    }
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+  .thr {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 3 - 4
src/views/selfShop/zrOrder/parts/parts/detail-1.vue

@@ -32,12 +32,12 @@
 const _ = require('lodash');
 
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('orderDetail');
+const { mapActions } = createNamespacedHelpers('zrOrder');
 const { mapActions: shop } = createNamespacedHelpers('shop');
 export default {
   name: 'card-1',
   props: { statusList: { type: Array } },
-  components: { search1: () => import('../search-1.vue') },
+  components: { search1: () => import('./search-1.vue') },
   data: function () {
     return {
       num: '1',
@@ -76,7 +76,6 @@ export default {
         condition[`buy_time@end`] = _.last(condition.buy_time);
         delete condition.buy_time;
       }
-      info.status = '1';
       let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
@@ -85,7 +84,7 @@ export default {
     },
     // 详情
     toDetail({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_orderDetail', query: { id: data._id } });
+      this.$router.push({ path: '/selfShop/zrOrder/detail_orderDetail', query: { id: data._id } });
     },
     toClose() {
       this.searchForm = {};

+ 0 - 1
src/views/selfShop/zrOrder/parts/parts/detail-2.vue

@@ -98,7 +98,6 @@ export default {
             }
           }
           let address = _.pick(p1[0].address, ['name', 'phone', 'province', 'city', 'area', 'address', '_id']);
-          // let address = (({ name, phone, province, city, area, address, _id }) => ({ name, phone, province, city, area, address, _id }))(p1[0].address);
           list.push({ goodsList, address });
         }
         this.$set(this, 'list', list);

src/views/selfShop/zrOrder/parts/search-1.vue → src/views/zr/zrOrder/parts/search-1.vue


+ 5 - 0
vue.config.js

@@ -25,6 +25,11 @@ module.exports = {
         changeOrigin: true,
         ws: false,
       },
+      '/point/zr/v1/api': {
+        target: 'https://broadcast.waityou24.cn', // 127.0.0.1:13003
+        changeOrigin: true,
+        ws: false,
+      },
     },
   },
 };