فهرست منبع

统计修改,跳转

YY 2 سال پیش
والد
کامیت
ddf1f72784

+ 19 - 7
src/views/index.vue

@@ -4,8 +4,8 @@
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col :span="24" class="two">
           <el-col :span="24">
-            <el-col :span="5">
-              <el-card class="box-card">
+            <el-col :span="5" @click="toUrl('notPay')">
+              <el-card class="box-card" @click.native="toUrl('notPay')">
                 <el-col :span="8">
                   <i class="icon_1 el-icon-box"></i>
                 </el-col>
@@ -19,7 +19,7 @@
               </el-card>
             </el-col>
             <el-col :span="5">
-              <el-card class="box-card">
+              <el-card class="box-card" @click.native="toUrl('notSend')">
                 <el-col :span="8">
                   <i class="icon_2 el-icon-truck"></i>
                 </el-col>
@@ -33,7 +33,7 @@
               </el-card>
             </el-col>
             <el-col :span="5">
-              <el-card class="box-card">
+              <el-card class="box-card" @click.native="toUrl('notDealAfterSale')">
                 <el-col :span="8">
                   <i class="icon_3 el-icon-sell"></i>
                 </el-col>
@@ -62,10 +62,10 @@
             </el-col>
           </el-col>
           <el-col :span="11">
-            <el-card class="box-card"><card-1 :list="data.sMarkOrder"></card-1></el-card>
+            <el-card class="box-card" @click.native="toUrl('sMarkOrder')"><card-1 :list="data.sMarkOrder"></card-1></el-card>
           </el-col>
           <el-col :span="11">
-            <el-card class="box-card"><card-2 :list="data.sAfterSale"></card-2></el-card>
+            <el-card class="box-card" @click.native="toUrl('sAfterSale')"><card-2 :list="data.sAfterSale"></card-2></el-card>
           </el-col>
           <el-col :span="11" style="display: none">
             <el-card class="box-card"><card-3></card-3> </el-card>
@@ -108,10 +108,22 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      // info.shop = this.user.shop.id;
+      info.shop = this.user.shop.id;
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) this.$set(this, 'data', res.data);
     },
+    toUrl(value) {
+      // 未付款
+      if (value == 'notPay') this.$router.push({ path: `/selfShop/order`, query: { activeName: '1' } });
+      // 未发货
+      else if (value == 'notSend') this.$router.push({ path: `/selfShop/order`, query: { activeName: '2' } });
+      // 未处理售后
+      else if (value == 'notDealAfterSale') this.$router.push({ path: `/selfShop/sales` });
+      // 下单数
+      else if (value == 'sMarkOrder') this.$router.push({ path: `/platfinance/statistics`, query: { activeName: '2' } });
+      // 售后数
+      else if (value == 'sAfterSale') this.$router.push({ path: `/platfinance/statistics`, query: { activeName: '4' } });
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };

+ 19 - 9
src/views/platfinance/statistics/index.vue

@@ -4,13 +4,13 @@
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col :span="24" class="one"> <span>统计</span> </el-col>
         <el-col :span="24">
-          <el-tabs type="border-card">
-            <el-tab-pane label="年度销售额"><card-1></card-1> </el-tab-pane>
-            <el-tab-pane label="年度下单数"><card-2></card-2></el-tab-pane>
-            <el-tab-pane label="年度付款数"><card-3></card-3></el-tab-pane>
-            <el-tab-pane label="年度退货数"><card-4></card-4></el-tab-pane>
-            <el-tab-pane label="年度退款数"><card-5></card-5></el-tab-pane>
-            <el-tab-pane label="年度换货数"><card-6></card-6></el-tab-pane>
+          <el-tabs type="border-card" v-model="activeName">
+            <el-tab-pane label="年度销售额" name="1"><card-1></card-1> </el-tab-pane>
+            <el-tab-pane label="年度下单数" name="2"><card-2></card-2></el-tab-pane>
+            <el-tab-pane label="年度付款数" name="3"><card-3></card-3></el-tab-pane>
+            <el-tab-pane label="年度退货数" name="4"><card-4></card-4></el-tab-pane>
+            <el-tab-pane label="年度退款数" name="5"><card-5></card-5></el-tab-pane>
+            <el-tab-pane label="年度换货数" name="6"><card-6></card-6></el-tab-pane>
           </el-tabs>
         </el-col>
       </el-col>
@@ -35,12 +35,22 @@ export default {
   data: function () {
     return {
       data: {},
+      activeName: '1',
     };
   },
-  async created() {},
-  methods: {},
+  async created() {
+    this.search();
+  },
+  methods: {
+    search() {
+      if (this.active) this.$set(this, 'activeName', this.active);
+    },
+  },
   computed: {
     ...mapState(['user']),
+    active() {
+      return this.$route.query.activeName;
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };

+ 1 - 1
src/views/platfinance/statistics/parts/card-1.vue

@@ -53,7 +53,7 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, type: info.time, start: info.start, end: info.end });
+      let res = await this.query({ skip, limit, type: info.time, start: info.start, end: info.end, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         let list = res.data;
         let xAxisList = [];

+ 1 - 1
src/views/platfinance/statistics/parts/card-2.vue

@@ -53,7 +53,7 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, status: '1', type: info.time, start: info.start, end: info.end });
+      let res = await this.query({ skip, limit, status: '1', type: info.time, start: info.start, end: info.end, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         let list = res.data.sMarkOrder;
         let xAxisList = [];

+ 1 - 1
src/views/platfinance/statistics/parts/card-3.vue

@@ -53,7 +53,7 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, status: '1', type: info.time, start: info.start, end: info.end });
+      let res = await this.query({ skip, limit, status: '1', type: info.time, start: info.start, end: info.end, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         let list = res.data.sMarkOrder;
         let xAxisList = [];

+ 1 - 1
src/views/platfinance/statistics/parts/card-4.vue

@@ -53,7 +53,7 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, status: '-2', type: info.time, start: info.start, end: info.end });
+      let res = await this.query({ skip, limit, status: '-2', type: info.time, start: info.start, end: info.end, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         let list = res.data.sAfterSale;
         let xAxisList = [];

+ 1 - 1
src/views/platfinance/statistics/parts/card-5.vue

@@ -53,7 +53,7 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, status: '-1', type: info.time, start: info.start, end: info.end });
+      let res = await this.query({ skip, limit, status: '-1', type: info.time, start: info.start, end: info.end, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         let list = res.data.sAfterSale;
         let xAxisList = [];

+ 1 - 1
src/views/platfinance/statistics/parts/card-6.vue

@@ -55,7 +55,7 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, status: '-3', type: info.time, start: info.start, end: info.end });
+      let res = await this.query({ skip, limit, status: '-3', type: info.time, start: info.start, end: info.end, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         let list = res.data.sAfterSale;
         let xAxisList = [];

+ 4 - 0
src/views/selfShop/order/index.vue

@@ -124,6 +124,7 @@ export default {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+      if (this.active) this.$set(this, 'activeName', this.active);
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -215,6 +216,9 @@ export default {
   },
   computed: {
     ...mapState(['user']),
+    active() {
+      return this.$route.query.activeName;
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };