Bläddra i källkod

修改-详情返回不刷新

YY 2 år sedan
förälder
incheckning
24e10fe813

+ 3 - 7
src/views/platmanag/order/detail_order.vue

@@ -96,7 +96,7 @@ import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('order');
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {},
   data: function () {
     return {
@@ -139,14 +139,10 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
-    },
-  },
-  computed: {
-    id() {
-      return this.$route.query.id;
+      this.$emit('toBack');
     },
   },
+  computed: {},
   metaInfo() {
     return { title: this.$route.meta.title };
   },

+ 3 - 7
src/views/platmanag/order/detail_orderDetail.vue

@@ -169,7 +169,7 @@ const { mapActions: sot } = createNamespacedHelpers('sot');
 
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {},
   data: function () {
     return {
@@ -322,7 +322,7 @@ export default {
 
     // 返回
     toBack() {
-      window.history.go('-1');
+      this.$emit('toBack');
     },
     // 查询其他信息
     async searchOther() {
@@ -339,11 +339,7 @@ export default {
       }
     },
   },
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-  },
+  computed: {},
   metaform() {
     return { title: this.$route.meta.title };
   },

+ 3 - 7
src/views/platmanag/order/detail_sales_order.vue

@@ -97,7 +97,7 @@ import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('order');
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {},
   data: function () {
     return {
@@ -154,14 +154,10 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
-    },
-  },
-  computed: {
-    id() {
-      return this.$route.query.id;
+      this.$emit('toBack');
     },
   },
+  computed: {},
   metaInfo() {
     return { title: this.$route.meta.title };
   },

+ 3 - 10
src/views/platmanag/order/detail_sales_orderDetail.vue

@@ -172,7 +172,7 @@ const { mapActions: sot } = createNamespacedHelpers('sot');
 
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String }, status: { type: String } },
   components: { cUpload: () => import('@/components/usual/c-upload.vue') },
   data: function () {
     return {
@@ -323,7 +323,7 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
+      this.$emit('toBack');
     },
     // 查询其他信息
     async searchOther() {
@@ -347,14 +347,7 @@ export default {
       }
     },
   },
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-    status() {
-      return this.$route.query.status;
-    },
-  },
+  computed: {},
   metaform() {
     return { title: this.$route.meta.title };
   },

+ 63 - 18
src/views/platmanag/order/index.vue

@@ -2,23 +2,39 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
-        <el-col :span="24" class="one"> <span>订单管理</span> </el-col>
-        <el-col :span="24" class="four">
-          <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
-            <el-tab-pane label="待付款" name="1">
-              <card-1 :statusList="statusList"></card-1>
-            </el-tab-pane>
-            <el-tab-pane label="待发货" name="2">
-              <card-2 :statusList="statusList"></card-2>
-            </el-tab-pane>
-            <el-tab-pane label="待收货" name="3">
-              <card-3 :statusList="statusList"></card-3>
-            </el-tab-pane>
-            <el-tab-pane label="已收货" name="4">
-              <card-4 :statusList="statusList"></card-4>
-            </el-tab-pane>
-          </el-tabs>
-        </el-col>
+        <template v-if="view === 'list'">
+          <el-col :span="24" class="one"> <span>订单管理</span> </el-col>
+          <el-col :span="24" class="four">
+            <el-tabs v-model="activeName" type="border-card">
+              <el-tab-pane label="待付款" name="1">
+                <card-1 :statusList="statusList" @toDetail="toDetail" @toSales="toSales"></card-1>
+              </el-tab-pane>
+              <el-tab-pane label="待发货" name="2">
+                <card-2 :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></card-2>
+              </el-tab-pane>
+              <el-tab-pane label="待收货" name="3">
+                <card-3 :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></card-3>
+              </el-tab-pane>
+              <el-tab-pane label="已收货" name="4">
+                <card-4 :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></card-4>
+              </el-tab-pane>
+            </el-tabs>
+          </el-col>
+        </template>
+        <!--  -->
+        <template v-else-if="view === 'card1_detail'">
+          <detail_order :id="order_id" @toBack="toBack"></detail_order>
+        </template>
+        <template v-else-if="view === 'card1_sales'">
+          <detail_sales_order :id="sales_id" @toBack="toBack"></detail_sales_order>
+        </template>
+        <!--  -->
+        <template v-else-if="view === 'card_detail'">
+          <detail_orderDetail :id="order_id" @toBack="toBack"></detail_orderDetail>
+        </template>
+        <template v-else-if="view === 'card_sales'">
+          <detail_sales_orderDetail :id="sales_id" :status="status" @toBack="toBack"></detail_sales_orderDetail>
+        </template>
       </el-col>
     </el-row>
   </div>
@@ -37,15 +53,23 @@ export default {
     card2: () => import('./parts/card-2.vue'),
     card3: () => import('./parts/card-3.vue'),
     card4: () => import('./parts/card-4.vue'),
+    detail_order: () => import('./detail_order.vue'),
+    detail_orderDetail: () => import('./detail_orderDetail.vue'),
+    detail_sales_order: () => import('./detail_sales_order.vue'),
+    detail_sales_orderDetail: () => import('./detail_sales_orderDetail.vue'),
   },
   data: function () {
     const that = this;
     return {
+      view: 'list',
       activeName: '2',
       // 类型列表
       statusList: [],
       // 店铺列表
       shopList: [],
+      order_id: '',
+      sales_id: '',
+      status: '',
     };
   },
   async created() {
@@ -54,7 +78,28 @@ export default {
   methods: {
     ...dictData({ dictQuery: 'query' }),
     ...shop({ shopQuery: 'query' }),
-    handleClick(tab, event) {},
+    // 未付款
+    toDetail(val) {
+      this.$set(this, `order_id`, val);
+      this.$set(this, `view`, 'card1_detail');
+    },
+    toSales(val) {
+      this.$set(this, `sales_id`, val);
+      this.$set(this, `view`, 'card1_sales');
+    },
+    // 待发货,待收货,已收货
+    toDetails(val) {
+      this.$set(this, `order_id`, val);
+      this.$set(this, `view`, 'card_detail');
+    },
+    toSaless(val) {
+      this.$set(this, `sales_id`, val.id);
+      this.$set(this, `status`, val.status);
+      this.$set(this, `view`, 'card_sales');
+    },
+    toBack() {
+      this.view = 'list';
+    },
     // 查询其他信息
     async searchOther() {
       let res;

+ 5 - 3
src/views/platmanag/order/parts/card-1.vue

@@ -52,6 +52,7 @@ export default {
       // 多选值
       selected: [],
       shopList: [],
+      skip: 0,
     };
   },
   async created() {
@@ -61,7 +62,7 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -71,6 +72,7 @@ export default {
       info.status = '0';
       let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
@@ -82,10 +84,10 @@ export default {
     },
     // 详情
     toDetail({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_order', query: { id: data.id } });
+      this.$emit('toDetail', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_sales_order', query: { id: data.id } });
+      this.$emit('toSales', data._id);
     },
     // 重置
     toClose() {

+ 5 - 3
src/views/platmanag/order/parts/card-2.vue

@@ -54,6 +54,7 @@ export default {
       // 多选值
       selected: [],
       shopList: [],
+      skip: 0,
     };
   },
   async created() {
@@ -63,7 +64,7 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -73,16 +74,17 @@ export default {
       info.status = '1';
       let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     // 详情
     toDetail({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_orderDetail', query: { id: data._id } });
+      this.$emit('toDetails', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_sales_orderDetail', query: { id: data._id, status: '1' } });
+      this.$emit('toSaless', { id: data._id, status: '1' });
     },
     toClose() {
       this.searchForm = {};

+ 5 - 3
src/views/platmanag/order/parts/card-3.vue

@@ -54,6 +54,7 @@ export default {
       // 多选值
       selected: [],
       shopList: [],
+      skip: 0,
     };
   },
   async created() {
@@ -63,7 +64,7 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -73,15 +74,16 @@ export default {
       info.status = '2';
       let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     toDetail({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_orderDetail', query: { id: data._id } });
+      this.$emit('toDetails', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_sales_orderDetail', query: { id: data._id, status: '2' } });
+      this.$emit('toSaless', { id: data._id, status: '2' });
     },
     toClose() {
       this.searchForm = {};

+ 5 - 3
src/views/platmanag/order/parts/card-4.vue

@@ -54,6 +54,7 @@ export default {
       // 多选值
       selected: [],
       shopList: [],
+      skip: 0,
     };
   },
   async created() {
@@ -63,7 +64,7 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -73,15 +74,16 @@ export default {
       info.status = '3';
       let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     toDetail({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_orderDetail', query: { id: data._id } });
+      this.$emit('toDetails', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/platmanag/order/detail_sales_orderDetail', query: { id: data._id, status: '3' } });
+      this.$emit('toSaless', { id: data._id, status: '3' });
     },
     toClose() {
       this.searchForm = {};

+ 2 - 5
src/views/platmanag/sales/detail.vue

@@ -140,7 +140,7 @@ const { mapActions: getTransportInfo } = createNamespacedHelpers('getTransportIn
 
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {
     steps1: () => import('./parts/steps-1.vue'),
     steps2: () => import('./parts/steps-2.vue'),
@@ -371,15 +371,12 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
+      this.$emit('toBack');
     },
   },
 
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
-    },
   },
   metaform() {
     return { title: this.$route.meta.title };

+ 34 - 21
src/views/platmanag/sales/index.vue

@@ -2,24 +2,29 @@
   <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>
-        <el-col :span="24" class="two">
-          <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="search" @toReset="toClose"> </search-1>
-        </el-col>
-        <el-col :span="24" class="four">
-          <data-table
-            :select="true"
-            :selected="selected"
-            @handleSelect="handleSelect"
-            :fields="fields"
-            :opera="opera"
-            @query="search"
-            :data="list"
-            :total="total"
-            @exam="toExam"
-          >
-          </data-table>
-        </el-col>
+        <template v-if="view === 'list'">
+          <el-col :span="24" class="one"> <span>售后管理</span> </el-col>
+          <el-col :span="24" class="two">
+            <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="search" @toReset="toClose"> </search-1>
+          </el-col>
+          <el-col :span="24" class="four">
+            <data-table
+              :select="true"
+              :selected="selected"
+              @handleSelect="handleSelect"
+              :fields="fields"
+              :opera="opera"
+              @query="search"
+              :data="list"
+              :total="total"
+              @exam="toExam"
+            >
+            </data-table>
+          </el-col>
+        </template>
+        <template v-else-if="view === 'order'">
+          <detail :id="id" @toBack="toBack"></detail>
+        </template>
       </el-col>
     </el-row>
   </div>
@@ -33,10 +38,11 @@ const { mapActions: dictData } = createNamespacedHelpers('dictData');
 export default {
   name: 'card-1',
   props: {},
-  components: { search1: () => import('./parts/search-1.vue') },
+  components: { search1: () => import('./parts/search-1.vue'), detail: () => import('./detail.vue') },
   data: function () {
     const that = this;
     return {
+      view: 'list',
       searchForm: {},
       list: [],
       total: 0,
@@ -71,6 +77,8 @@ export default {
       selected: [],
       typeList: [],
       statusList: [],
+      skip: 0,
+      id: '',
     };
   },
   async created() {
@@ -81,16 +89,21 @@ export default {
     ...dictData({ dictQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, 'skip');
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     toExam({ data }) {
-      this.$router.push({ path: '/platmanag/sales/detail', query: { id: data.id } });
+      this.$set(this, `id`, data.id);
+      this.$set(this, `view`, 'order');
+    },
+    toBack() {
+      this.view = 'list';
     },
     toClose() {
       this.searchForm = {};

+ 3 - 1
src/views/selfShop/goods/index.vue

@@ -156,6 +156,7 @@ export default {
       statusList: [],
       // 返现金额类型
       typeList: [{ label: '固定金额' }, { label: '百分比' }],
+      skip: 0,
     };
   },
   created() {
@@ -169,11 +170,12 @@ export default {
     ...goods(['copy', 'query', 'delete', 'fetch', 'update', 'create']),
     ...methodsUtil,
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...others } = {}) {
+    async search({ skip = this.skip, 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, `skip`, skip);
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
       }

+ 3 - 7
src/views/selfShop/order/detail_order.vue

@@ -96,7 +96,7 @@ import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('order');
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {},
   data: function () {
     return {
@@ -139,14 +139,10 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
-    },
-  },
-  computed: {
-    id() {
-      return this.$route.query.id;
+      this.$emit('toBack');
     },
   },
+  computed: {},
   metaInfo() {
     return { title: this.$route.meta.title };
   },

+ 3 - 7
src/views/selfShop/order/detail_orderDetail.vue

@@ -169,7 +169,7 @@ const { mapActions: sot } = createNamespacedHelpers('sot');
 
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {},
   data: function () {
     return {
@@ -322,7 +322,7 @@ export default {
 
     // 返回
     toBack() {
-      window.history.go('-1');
+      this.$emit('toBack');
     },
     // 查询其他信息
     async searchOther() {
@@ -339,11 +339,7 @@ export default {
       }
     },
   },
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-  },
+  computed: {},
   metaform() {
     return { title: this.$route.meta.title };
   },

+ 3 - 7
src/views/selfShop/order/detail_sales_order.vue

@@ -97,7 +97,7 @@ import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('order');
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {},
   data: function () {
     return {
@@ -154,14 +154,10 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
-    },
-  },
-  computed: {
-    id() {
-      return this.$route.query.id;
+      this.$emit('toBack');
     },
   },
+  computed: {},
   metaInfo() {
     return { title: this.$route.meta.title };
   },

+ 3 - 10
src/views/selfShop/order/detail_sales_orderDetail.vue

@@ -172,7 +172,7 @@ const { mapActions: sot } = createNamespacedHelpers('sot');
 
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String }, status: { type: String } },
   components: { cUpload: () => import('@/components/usual/c-upload.vue') },
   data: function () {
     return {
@@ -323,7 +323,7 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
+      this.$emit('toBack');
     },
     // 查询其他信息
     async searchOther() {
@@ -347,14 +347,7 @@ export default {
       }
     },
   },
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-    status() {
-      return this.$route.query.status;
-    },
-  },
+  computed: {},
   metaform() {
     return { title: this.$route.meta.title };
   },

+ 69 - 18
src/views/selfShop/order/index.vue

@@ -2,23 +2,39 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
-        <el-col :span="24" class="one"> <span>订单管理</span> </el-col>
-        <el-col :span="24" class="four">
-          <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
-            <el-tab-pane label="待付款" name="1">
-              <card-1 :statusList="statusList"></card-1>
-            </el-tab-pane>
-            <el-tab-pane label="待发货" name="2">
-              <card-2 :statusList="statusList"></card-2>
-            </el-tab-pane>
-            <el-tab-pane label="待收货" name="3">
-              <card-3 :statusList="statusList"></card-3>
-            </el-tab-pane>
-            <el-tab-pane label="已收货" name="4">
-              <card-4 :statusList="statusList"></card-4>
-            </el-tab-pane>
-          </el-tabs>
-        </el-col>
+        <template v-if="view === 'list'">
+          <el-col :span="24" class="one"> <span>订单管理</span> </el-col>
+          <el-col :span="24" class="four">
+            <el-tabs v-model="activeName" type="border-card">
+              <el-tab-pane label="待付款" name="1">
+                <card-1 :statusList="statusList" @toDetail="toDetail" @toSales="toSales"></card-1>
+              </el-tab-pane>
+              <el-tab-pane label="待发货" name="2">
+                <card-2 :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></card-2>
+              </el-tab-pane>
+              <el-tab-pane label="待收货" name="3">
+                <card-3 :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></card-3>
+              </el-tab-pane>
+              <el-tab-pane label="已收货" name="4">
+                <card-4 :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></card-4>
+              </el-tab-pane>
+            </el-tabs>
+          </el-col>
+        </template>
+        <!--  -->
+        <template v-else-if="view === 'card1_detail'">
+          <detail_order :id="order_id" @toBack="toBack"></detail_order>
+        </template>
+        <template v-else-if="view === 'card1_sales'">
+          <detail_sales_order :id="sales_id" @toBack="toBack"></detail_sales_order>
+        </template>
+        <!--  -->
+        <template v-else-if="view === 'card_detail'">
+          <detail_orderDetail :id="order_id" @toBack="toBack"></detail_orderDetail>
+        </template>
+        <template v-else-if="view === 'card_sales'">
+          <detail_sales_orderDetail :id="sales_id" :status="status" @toBack="toBack"></detail_sales_orderDetail>
+        </template>
       </el-col>
     </el-row>
   </div>
@@ -28,6 +44,7 @@
 const _ = require('lodash');
 import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
 const { mapActions: dictData } = createNamespacedHelpers('dictData');
+const { mapActions: shop } = createNamespacedHelpers('shop');
 export default {
   name: 'index',
   props: {},
@@ -36,13 +53,23 @@ export default {
     card2: () => import('./parts/card-2.vue'),
     card3: () => import('./parts/card-3.vue'),
     card4: () => import('./parts/card-4.vue'),
+    detail_order: () => import('./detail_order.vue'),
+    detail_orderDetail: () => import('./detail_orderDetail.vue'),
+    detail_sales_order: () => import('./detail_sales_order.vue'),
+    detail_sales_orderDetail: () => import('./detail_sales_orderDetail.vue'),
   },
   data: function () {
     const that = this;
     return {
+      view: 'list',
       activeName: '2',
       // 类型列表
       statusList: [],
+      // 店铺列表
+      shopList: [],
+      order_id: '',
+      sales_id: '',
+      status: '',
     };
   },
   async created() {
@@ -50,7 +77,29 @@ export default {
   },
   methods: {
     ...dictData({ dictQuery: 'query' }),
-    handleClick(tab, event) {},
+    ...shop({ shopQuery: 'query' }),
+    // 未付款
+    toDetail(val) {
+      this.$set(this, `order_id`, val);
+      this.$set(this, `view`, 'card1_detail');
+    },
+    toSales(val) {
+      this.$set(this, `sales_id`, val);
+      this.$set(this, `view`, 'card1_sales');
+    },
+    // 待发货,待收货,已收货
+    toDetails(val) {
+      this.$set(this, `order_id`, val);
+      this.$set(this, `view`, 'card_detail');
+    },
+    toSaless(val) {
+      this.$set(this, `sales_id`, val.id);
+      this.$set(this, `status`, val.status);
+      this.$set(this, `view`, 'card_sales');
+    },
+    toBack() {
+      this.view = 'list';
+    },
     // 查询其他信息
     async searchOther() {
       let res;
@@ -59,6 +108,8 @@ export default {
       if (this.$checkRes(res)) {
         this.$set(this, `statusList`, res.data);
       }
+      res = await this.shopQuery();
+      if (this.$checkRes(res)) this.$set(this, `shopList`, res.data);
     },
   },
   computed: {

+ 26 - 5
src/views/selfShop/order/parts/card-1.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="main">
         <el-col :span="24" class="one">
-          <search-1 :form="searchForm" @onSubmit="search" @toReset="toClose"> </search-1>
+          <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
         </el-col>
         <data-table
           :select="true"
@@ -27,6 +27,7 @@
 const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('order');
+const { mapActions: shop } = createNamespacedHelpers('shop');
 export default {
   name: 'card-1',
   props: { statusList: { type: Array } },
@@ -44,20 +45,24 @@ export default {
         { label: '订单号', model: 'no' },
         { label: '下单时间', model: 'buy_time' },
         { label: '顾客', model: 'customer.name' },
+        { label: '店铺名称', model: 'goods', format: (i) => this.getShopName(i) },
         { label: '需支付金额', model: 'real_pay' },
         { label: '商品数量', model: 'buy_num_total' },
       ],
       // 多选值
       selected: [],
+      shopList: [],
+      skip: 0,
     };
   },
   async created() {
     await this.search();
   },
   methods: {
+    ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -65,18 +70,27 @@ export default {
         delete condition.buy_time;
       }
       info.status = '0';
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
+      info.shop = this.user.shop.id;
+      let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
+    // 店铺名称
+    getShopName(i) {
+      let shopname = i.map((e) => e.shop_name);
+      return shopname.join(',');
+    },
+    // 详情
     toDetail({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_order', query: { id: data.id } });
+      this.$emit('toDetail', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_sales_order', query: { id: data.id } });
+      this.$emit('toSales', data._id);
     },
+    // 重置
     toClose() {
       this.searchForm = {};
       this.search();
@@ -85,6 +99,13 @@ export default {
     handleSelect(data) {
       this.$emit('handleSelect');
     },
+    // 店铺名称远程查询
+    async querySearch(value) {
+      let res = await this.shopQuery({ name: value });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'shopList', res.data);
+      }
+    },
   },
   computed: {
     ...mapState(['user']),

+ 7 - 1
src/views/selfShop/order/parts/card-2.vue

@@ -2,7 +2,7 @@
   <div id="card-1">
     <el-row>
       <el-col :span="24" class="main">
-        <detail-1 v-if="num == '1'" @toDeliver="toDeliver" :statusList="statusList"></detail-1>
+        <detail-1 v-if="num == '1'" @toDeliver="toDeliver" :statusList="statusList" @toDetails="toDetails" @toSaless="toSaless"></detail-1>
         <detail-2 v-else-if="num == '2'" :deliverList="list" @toBack="toBack"></detail-2>
       </el-col>
     </el-row>
@@ -36,6 +36,12 @@ export default {
     toBack() {
       this.$set(this, 'num', '1');
     },
+    toDetails(val) {
+      this.$emit('toDetails', val);
+    },
+    toSaless(val) {
+      this.$emit('toSaless', { id: val.id, status: val.status });
+    },
   },
   computed: {
     ...mapState(['user']),

+ 5 - 3
src/views/selfShop/order/parts/card-3.vue

@@ -51,6 +51,7 @@ export default {
       ],
       // 多选值
       selected: [],
+      skip: 0,
     };
   },
   async created() {
@@ -59,7 +60,7 @@ export default {
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -69,15 +70,16 @@ export default {
       info.status = '2';
       let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     toDetail({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_orderDetail', query: { id: data._id } });
+      this.$emit('toDetails', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_sales_orderDetail', query: { id: data._id, status: '2' } });
+      this.$emit('toSaless', { id: data._id, status: '2' });
     },
     toClose() {
       this.searchForm = {};

+ 5 - 5
src/views/selfShop/order/parts/card-4.vue

@@ -25,7 +25,6 @@
 
 <script>
 const _ = require('lodash');
-
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('orderDetail');
 
@@ -52,6 +51,7 @@ export default {
       ],
       // 多选值
       selected: [],
+      skip: 0,
     };
   },
   async created() {
@@ -59,9 +59,8 @@ export default {
   },
   methods: {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
-
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -71,15 +70,16 @@ export default {
       info.status = '3';
       let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     toDetail({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_orderDetail', query: { id: data._id } });
+      this.$emit('toDetails', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_sales_orderDetail', query: { id: data._id, status: '3' } });
+      this.$emit('toSaless', { id: data._id, status: '3' });
     },
     toClose() {
       this.searchForm = {};

+ 5 - 3
src/views/selfShop/order/parts/parts/detail-1.vue

@@ -64,6 +64,7 @@ export default {
       // 发货清单
       deliverList: [],
       deliver: '0',
+      skip: 0,
     };
   },
   async created() {
@@ -73,7 +74,7 @@ export default {
     ...shop({ shopQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
       if (condition.buy_time) {
         condition[`buy_time@start`] = _.head(condition.buy_time);
@@ -83,16 +84,17 @@ export default {
       info.status = '1';
       let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, skip);
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     // 详情
     toDetail({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_orderDetail', query: { id: data._id } });
+      this.$emit('toDetails', data._id);
     },
     toSales({ data }) {
-      this.$router.push({ path: '/selfShop/order/detail_sales_orderDetail', query: { id: data._id, status: '1' } });
+      this.$emit('toSaless', { id: data._id, status: '1' });
     },
     toClose() {
       this.searchForm = {};

+ 2 - 5
src/views/selfShop/sales/detail.vue

@@ -140,7 +140,7 @@ const { mapActions: getTransportInfo } = createNamespacedHelpers('getTransportIn
 
 export default {
   name: 'form-1',
-  props: {},
+  props: { id: { type: String } },
   components: {
     steps1: () => import('./parts/steps-1.vue'),
     steps2: () => import('./parts/steps-2.vue'),
@@ -371,15 +371,12 @@ export default {
     },
     // 返回
     toBack() {
-      window.history.go('-1');
+      this.$emit('toBack');
     },
   },
 
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
-    },
   },
   metaform() {
     return { title: this.$route.meta.title };

+ 36 - 22
src/views/selfShop/sales/index.vue

@@ -2,24 +2,29 @@
   <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>
-        <el-col :span="24" class="two">
-          <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="search" @toReset="toClose"> </search-1>
-        </el-col>
-        <el-col :span="24" class="four">
-          <data-table
-            :select="true"
-            :selected="selected"
-            @handleSelect="handleSelect"
-            :fields="fields"
-            :opera="opera"
-            @query="search"
-            :data="list"
-            :total="total"
-            @exam="toExam"
-          >
-          </data-table>
-        </el-col>
+        <template v-if="view === 'list'">
+          <el-col :span="24" class="one"> <span>售后管理</span> </el-col>
+          <el-col :span="24" class="two">
+            <search-1 :form="searchForm" :statusList="statusList" :typeList="typeList" @onSubmit="search" @toReset="toClose"> </search-1>
+          </el-col>
+          <el-col :span="24" class="four">
+            <data-table
+              :select="true"
+              :selected="selected"
+              @handleSelect="handleSelect"
+              :fields="fields"
+              :opera="opera"
+              @query="search"
+              :data="list"
+              :total="total"
+              @exam="toExam"
+            >
+            </data-table>
+          </el-col>
+        </template>
+        <template v-else-if="view === 'order'">
+          <detail :id="id" @toBack="toBack"></detail>
+        </template>
       </el-col>
     </el-row>
   </div>
@@ -33,10 +38,11 @@ const { mapActions: dictData } = createNamespacedHelpers('dictData');
 export default {
   name: 'card-1',
   props: {},
-  components: { search1: () => import('./parts/search-1.vue') },
+  components: { search1: () => import('./parts/search-1.vue'), detail: () => import('./detail.vue') },
   data: function () {
     const that = this;
     return {
+      view: 'list',
       searchForm: {},
       list: [],
       total: 0,
@@ -71,6 +77,8 @@ export default {
       selected: [],
       typeList: [],
       statusList: [],
+      skip: 0,
+      id: '',
     };
   },
   async created() {
@@ -81,16 +89,22 @@ export default {
     ...dictData({ dictQuery: 'query' }),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
-    async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+    async search({ skip = this.skip, limit = this.$limit, ...info } = {}) {
+      info.shop = this.user.shop.id;
       let condition = _.cloneDeep(this.searchForm);
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
+      let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
+        this.$set(this, `skip`, 'skip');
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
     },
     toExam({ data }) {
-      this.$router.push({ path: '/selfShop/sales/detail', query: { id: data.id } });
+      this.$set(this, `id`, data.id);
+      this.$set(this, `view`, 'order');
+    },
+    toBack() {
+      this.view = 'list';
     },
     toClose() {
       this.searchForm = {};