YY 2 rokov pred
rodič
commit
c5d2d55507

+ 68 - 0
src/components/orderParts/card-4.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="card-1">
+    <el-row>
+      <el-col :span="24" class="main">
+        <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>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'card-1',
+  props: { statusList: { type: Array } },
+  components: {
+    detail1: () => import('./parts/detail-3.vue'),
+    detail2: () => import('./parts/detail-4.vue'),
+  },
+  data: function () {
+    return {
+      num: '1',
+      list: [],
+    };
+  },
+  async created() {},
+  methods: {
+    // 生成发货清单
+    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');
+    },
+    toDetails(val) {
+      this.$emit('toDetails', val);
+    },
+    toSaless(val) {
+      this.$emit('toSaless', val);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.one {
+  margin: 0 0 10px 0;
+}
+</style>

+ 153 - 0
src/components/orderParts/detail/group_order.vue

@@ -0,0 +1,153 @@
+<template>
+  <div id="form-1">
+    <el-row>
+      <el-col :span="24" class="top-btn">
+        <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
+      </el-col>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loadings"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <el-tabs type="border-card">
+          <el-tab-pane label="订单详情">
+            <card-1 :address="address" :shop="shop" :goods="goods" :spec="spec" :form="form" :pay="pay" :total_detail="total_detail"></card-1>
+          </el-tab-pane>
+          <el-tab-pane label="发货信息">
+            <card-2
+              :transport="transport"
+              :address="address"
+              :form="form"
+              :list="list"
+              :activities="activities"
+              :shop_transport_typeList="shop_transport_typeList"
+              :transport_typeList="transport_typeList"
+              @querySearch="querySearch"
+              @search="search"
+            ></card-2>
+          </el-tab-pane>
+        </el-tabs>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+const moment = require('moment');
+import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('groupOrder');
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
+const { mapActions: groupTransport } = createNamespacedHelpers('groupTransport');
+
+export default {
+  name: 'form-1',
+  props: { id: { type: String } },
+  components: {
+    card1: () => import('./parts/card-3.vue'),
+    card2: () => import('./parts/card-4.vue'),
+  },
+  data: function () {
+    return {
+      loadings: true,
+      form: {},
+      // 地址
+      address: {},
+      // 商铺
+      shop: {},
+      goods: {}, //商品信息
+      spec: {}, //规格信息
+      pay: {}, //支付信息
+      total_detail: [],
+      // 运单号
+      transport: [],
+      // 快递公司
+      shop_transport_typeList: [],
+      // 快递类型
+      transport_typeList: [],
+      activities: [], //物流信息
+      list: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...dictData({ dictQuery: 'query' }),
+    ...groupTransport({ sotCreate: 'create' }),
+    ...mapActions(['query', 'fetch', 'create', 'update']),
+    // 查询
+    async search() {
+      let res;
+      res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `address`, res.data.address);
+        this.$set(this, `shop`, res.data.shop);
+        this.$set(this, `goods`, res.data.goods);
+        this.$set(this, `spec`, res.data.goodsSpec);
+        this.$set(this, `pay`, res.data.pay);
+        this.$set(this, `total_detail`, res.data.total_detail);
+        if (res.data.transport_type) {
+          let name = this.transport_typeList.find((i) => i.value == res.data.transport_type);
+          if (name) res.data.transport_type_name = name.label;
+        }
+        this.$set(this, `form`, res.data);
+        if (res.data.transport && res.data.transport.length > 0) {
+          for (const p1 of res.data.transport) {
+            let arr = await this.dictQuery({ code: 'transport_company', value: p1.shop_transport_type });
+            if (this.$checkRes(arr)) {
+              let type = arr.data.find((i) => i.value == p1.shop_transport_type);
+              if (type) {
+                p1.shop_transport_name = type.label;
+                this.querySearch(type.label);
+              }
+            }
+          }
+          this.$set(this, `transport`, res.data.transport);
+          let info = { order: this.id };
+          res = await this.sotCreate(info);
+          if (this.$checkRes(res)) {
+            if (res.errcode == '0') this.$set(this, `activities`, res.data);
+          }
+        }
+      }
+      this.loadings = false;
+    },
+    async querySearch(value) {
+      let res = await this.dictQuery({ code: 'transport_company', label: value });
+      if (this.$checkRes(res)) this.$set(this, 'shop_transport_typeList', res.data);
+    },
+    // 返回
+    toBack() {
+      this.$emit('toBack');
+    },
+    // 查询其他信息
+    async searchOther() {
+      let res;
+      // 快递类型
+      res = await this.dictQuery({ code: 'transport_type' });
+      if (this.$checkRes(res)) this.$set(this, `transport_typeList`, res.data);
+    },
+  },
+  computed: {},
+  metaform() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top-btn {
+  margin: 20px 0;
+}
+</style>

+ 408 - 0
src/components/orderParts/detail/group_sales.vue

@@ -0,0 +1,408 @@
+<template>
+  <div id="form-1">
+    <el-row>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loadings"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <el-col class="top-btn">
+          <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
+        </el-col>
+        <el-col :span="9" class="one">
+          <el-col :span="24" class="add">
+            <el-col :span="2">
+              <i class="el-icon-location"></i>
+            </el-col>
+            <el-col :span="22">
+              <el-col :span="24"> {{ address.name }},{{ address.phone }} </el-col>
+              <el-col :span="24"> {{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }} </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="shop"> <i class="el-icon-s-shop"></i>{{ shop.name }}</el-col>
+          <el-col :span="24">
+            <el-col :span="24" class="goods bode">
+              <el-col :span="6" class="image"><el-image :src="getFile()"></el-image></el-col>
+              <el-col :span="18">
+                <el-col :span="12">
+                  <el-col :span="24"> {{ goods.name }} </el-col>
+                  <el-col :span="24"> 规格:{{ spec.name }} </el-col>
+                </el-col>
+                <el-col :span="12" class="money">
+                  <el-col :span="24" style="color: red; font-size: 20px">
+                    <p>¥{{ spec.price }}</p>
+                  </el-col>
+                  <el-col :span="24"> X{{ spec.num }} </el-col>
+                  <el-col :span="24">
+                    <span class="spanfour" style="color: blue" @click="toUrl(goods.url)"> 查看商品来源:{{ goods.source }}</span>
+                  </el-col>
+                  <el-col :span="24"> {{ info.is_afterSale == true ? '已申请售后' : '未申请售后' }} </el-col>
+                </el-col>
+              </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="bode">
+            <el-col :span="6">下单时间</el-col>
+            <el-col :span="18" class="other">{{ info.buy_time }}</el-col>
+          </el-col>
+          <el-col :span="24" class="bode">
+            <el-col :span="6">订单备注</el-col>
+            <el-col :span="18" class="other">{{ info.remarks || '' }}</el-col>
+          </el-col>
+          <el-col :span="24" class="bode">
+            <el-col :span="6">配送方式</el-col>
+            <el-col :span="18" class="other">{{ info.transport_type_name || '待填写' }}</el-col>
+          </el-col>
+          <el-col :span="24" class="goods_total bode">
+            <el-col :span="24" v-for="(item, index) in total_detail" :key="index">
+              <el-col :span="8">{{ item.zh }}</el-col>
+              <el-col :span="16" class="other">
+                <p>¥{{ item.money }}</p>
+              </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="goods_total bode">
+            <el-col :span="8">实付金额</el-col>
+            <el-col :span="16" class="other">
+              <p>¥{{ pay.pay_money }} 元</p>
+            </el-col>
+          </el-col>
+          <el-col :span="24" v-for="(transport, index) in transport" :key="index">
+            <el-col :span="24" class="bode" v-if="info.status == '3'">
+              <el-col :span="6">寄出运单号</el-col>
+              <el-col :span="18" class="other">{{ transport.shop_transport_no || '暂无单号' }}</el-col>
+            </el-col>
+            <el-col :span="24" class="bode" v-if="info.status == '3'">
+              <el-col :span="6">寄出快递公司</el-col>
+              <el-col :span="18" class="other">{{ transport.shop_transport_name || '暂无快递信息' }}</el-col>
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="9" class="one">
+          <el-button type="danger" @click="toSales('1')" v-if="this.status == '1'"> 取消订单 </el-button>
+          <el-button type="danger" @click="toSales('2')" v-if="this.status == '2'"> 拒收 </el-button>
+          <el-col v-if="this.status == '3'">
+            <el-form :model="form" :rules="rules" ref="form" label-width="180px">
+              <!-- <el-col :span="24">
+                <el-form-item label="售后商品" prop="goods">
+                  <el-select v-model="form.goods" clearable filterable placeholder="请选择售后商品" size="small" style="width: 100%" @change="goodsChange">
+                    <el-option v-for="i in list" :key="i.goods.name" :label="i.goods.name" :value="i.id"> </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col> -->
+              <el-col :span="24">
+                <el-form-item label="售后类型" prop="type">
+                  <el-select v-model="form.type" clearable filterable placeholder="请选择售后类型" size="small" style="width: 100%" @change="typeChange">
+                    <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"> </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24" v-if="this.form.type == '1' || this.form.type == '2'">
+                <el-form-item label="退款金额" prop="money">
+                  <el-input v-model="form.money" placeholder="请输入退款金额" size="small" type="Number" @input="toMoney"></el-input>
+                  <p>
+                    退款金额不得超过<span style="color: red">{{ payMoney.payTotal || '' }}</span
+                    >元
+                    <span @click="allMoney" style="color: blue; margin: 0 0 0 10px">全部退款</span>
+                  </p>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="申请理由" prop="reason">
+                  <el-select v-model="form.reason" clearable filterable placeholder="请选择申请理由" size="small" style="width: 100%">
+                    <el-option v-for="i in reasonList" :key="i.value" :label="i.label" :value="i.value"> </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="售后描述" prop="desc">
+                  <el-input v-model="form.desc" placeholder="请输入售后描述" size="small" type="textarea"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="附件" prop="file">
+                  <c-upload :url="url" v-model="form.file" :limit="6"></c-upload>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24" class="btn">
+                <el-button type="primary" size="mini" @click="onSubmit('form')">提交</el-button>
+                <el-button type="danger" size="mini" @click="toBack()">取消</el-button>
+              </el-col>
+            </el-form>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+const moment = require('moment');
+
+import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
+const { mapActions: groupOrder } = createNamespacedHelpers('groupOrder');
+const { mapActions } = createNamespacedHelpers('groupAfterSale');
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
+const { mapActions: sot } = createNamespacedHelpers('sot');
+
+export default {
+  name: 'form-1',
+  props: { id: { type: String }, status: { type: String } },
+  components: { cUpload: () => import('@/components/usual/c-upload.vue') },
+  data: function () {
+    return {
+      info: {},
+      goods: {},
+      spec: {},
+      // 地址
+      address: {},
+      // 实付金额
+      total_detail: {},
+      // 商铺
+      shop: {},
+      // 运单号
+      transport: [],
+      pay: {},
+      // 商品列表
+      list: [],
+      // 物流
+      reverse: false,
+      activities: [],
+      activit: {},
+      // 订单状态
+      order_processList: [],
+      // 快递公司
+      shop_transport_typeList: [],
+      loading: false,
+      rules: {
+        goods: [{ required: true, message: '请选择商品', trigger: 'change' }],
+        type: [{ required: true, message: '请选择售后类型', trigger: 'change' }],
+        money: [{ required: true, message: '请输入金额', trigger: 'blur' }],
+      },
+      // 售后表单
+      form: {},
+      // 售后类型
+      typeList: [],
+      // 售后申请理由
+      reasonList: [],
+      // 退款金额
+      payMoney: '',
+      url: '/files/point/afterSale/upload',
+      loadings: true,
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...dictData({ dictQuery: 'query' }),
+    ...groupOrder({ orderFetch: 'fetch' }),
+    ...sot({ sotFetch: 'fetch' }),
+    ...mapActions(['query', 'cgfr', 'fetch', 'create', 'update']),
+    // 查询
+    async search() {
+      let res;
+      res = await this.orderFetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `address`, res.data.address);
+        this.$set(this, `shop`, res.data.shop);
+        this.$set(this, `goods`, res.data.goods);
+        this.$set(this, `spec`, res.data.goodsSpec);
+        this.$set(this, `pay`, res.data.pay);
+        this.$set(this, `total_detail`, res.data.total_detail);
+        this.$set(this, `info`, res.data);
+        if (res.data.transport && res.data.transport.length > 0) {
+          for (const p1 of res.data.transport) {
+            let arr = await this.dictQuery({ code: 'transport_company', value: p1.shop_transport_type });
+            if (this.$checkRes(arr)) {
+              let type = arr.data.find((i) => i.value == p1.shop_transport_type);
+              if (type) {
+                p1.shop_transport_name = type.label;
+                this.querySearch(type.label);
+              }
+            }
+          }
+          this.$set(this, `transport`, res.data.transport);
+        }
+      }
+      this.loadings = false;
+    },
+    async querySearch(value) {
+      let res = await this.dictQuery({ code: 'transport_company', label: value });
+      if (this.$checkRes(res)) this.$set(this, 'shop_transport_typeList', res.data);
+    },
+    toUrl(url) {
+      if (url) {
+        window.open(url, '_blank');
+      } else {
+        this.$message.error('该商品还未添加来源网址,无法跳转');
+      }
+    },
+    // 选择商品
+    getFile(value) {
+      let name;
+      if (this.spec.file && this.spec.file.length != 0) name = this.spec.file[0].url;
+      else if (this.goods.file && this.goods.file.length != 0) name = this.goods.file[0].url;
+      return name;
+    },
+    handleSelect(value) {},
+    async toSales(status) {
+      if (status == '1') var info = { order: this.id, type: '4' };
+      else if (status == '2') var info = { order: this.id, type: '5' };
+      this.$confirm('是否确认申请售后', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async () => {
+        let res = await this.create(info);
+        if (this.$checkRes(res)) {
+          this.$message({ type: `success`, message: `申请售后成功` });
+          this.search();
+        }
+      });
+    },
+    // 选择商品
+    goodsChange(value) {
+      this.$set(this.form, `goods`, value);
+      this.typeChange(this.form.type || '');
+    },
+    // 选择类型
+    async typeChange(value) {
+      this.$set(this.form, `type`, value);
+      if (value != '3') {
+        this.$set(this, `payMoney`, this.pay.pay_money);
+        this.allMoney();
+      }
+    },
+    // 全部退款
+    allMoney() {
+      this.$set(this.form, `money`, this.payMoney);
+    },
+    // 输入金额
+    toMoney(val) {
+      if (val > this.payMoney) {
+        this.$message.error('超过退款最大金额');
+        this.$set(this.form, `money`, '');
+      }
+    },
+    // 提交
+    async onSubmit(formName, val) {
+      this.$refs[formName].validate(async (valid) => {
+        if (valid) {
+          this.$confirm('是否确认保存', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          }).then(async () => {
+            let form = this.form;
+            form.order = this.id;
+            let res = await this.create(form);
+            if (this.$checkRes(res)) {
+              this.$message({ type: `success`, message: `申请售后成功` });
+              this.search();
+            }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    // 返回
+    toBack() {
+      this.$emit('toBack');
+    },
+    // 查询其他信息
+    async searchOther() {
+      let res;
+      // 减免方式
+      res = await this.dictQuery({ code: 'order_process' });
+      if (this.$checkRes(res)) this.$set(this, `order_processList`, res.data);
+      // 售后类型
+      res = await this.dictQuery({ code: 'afterSale_type' });
+      if (this.$checkRes(res)) {
+        let type = res.data.filter((i) => i.value != '4' && i.value != '5');
+        this.$set(this, `typeList`, type);
+      }
+      // 售后申请理由
+      res = await this.dictQuery({ code: 'afterSale_reason' });
+      if (this.$checkRes(res)) {
+        let type = res.data.filter((i) => i.value != '4' && i.value != '5');
+        this.$set(this, `reasonList`, res.data);
+      }
+    },
+  },
+  computed: {},
+  metaform() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    margin: 10px 0 0 5%;
+    padding: 5px;
+    .add {
+      border-bottom: 2px dashed #ccc;
+      margin: 0 0 5px 0;
+      padding: 5px 0;
+    }
+    .shop {
+      padding: 4px 0;
+      font-size: 18px;
+      border-bottom: 1px solid #ccc;
+    }
+    .goods {
+      padding: 10px 0;
+      .image {
+        padding: 0 10px 0 0;
+      }
+      .money {
+        text-align: right;
+      }
+    }
+    .other {
+      text-align: right;
+      word-break: break-all;
+      p {
+        color: red;
+      }
+      .spanfour {
+        color: blue;
+      }
+    }
+    .el-col {
+      margin: 3px 0;
+    }
+    .bode {
+      border-bottom: 1px solid rgb(238, 237, 237);
+    }
+    .form {
+      margin: 20px 0 0 0;
+    }
+  }
+}
+.btn {
+  text-align: center;
+}
+
+/deep/.el-timeline {
+  margin: 20px 0 0 0;
+  font-size: 16px;
+}
+/deep/.el-timeline-item__node:nth-child(1) {
+  background-color: green;
+}
+</style>

+ 181 - 0
src/components/orderParts/detail/parts/card-3.vue

@@ -0,0 +1,181 @@
+<template>
+  <div id="card-1">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="12" class="main_one">
+          <el-col :span="24" class="add">
+            <el-col :span="2">
+              <i class="el-icon-location"></i>
+            </el-col>
+            <el-col :span="22">
+              <el-col :span="24"> {{ address.name }},{{ address.phone }} </el-col>
+              <el-col :span="24"> {{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }} </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="shop"> <i class="el-icon-s-shop"></i>{{ shop.name }}</el-col>
+          <el-col :span="24">
+            <el-col :span="24" class="goods bode">
+              <el-col :span="6" class="image"><el-image :src="getFile()"></el-image></el-col>
+              <el-col :span="18">
+                <el-col :span="12">
+                  <el-col :span="24"> {{ goods.name }} </el-col>
+                  <el-col :span="24"> 规格:{{ spec.name }} </el-col>
+                </el-col>
+                <el-col :span="12" class="money">
+                  <el-col :span="24" style="color: red; font-size: 20px">
+                    <p>¥{{ spec.price }}</p>
+                  </el-col>
+                  <el-col :span="24"> X{{ spec.num }} </el-col>
+                  <el-col :span="24">
+                    <span class="spanfour" style="color: blue" @click="toUrl(goods.url)"> 查看商品来源:{{ goods.source }}</span>
+                  </el-col>
+                  <el-col :span="24"> {{ form.is_afterSale == true ? '已申请售后' : '未申请售后' }} </el-col>
+                </el-col>
+              </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="bode">
+            <el-col :span="6">下单时间</el-col>
+            <el-col :span="18" class="other">{{ form.buy_time }}</el-col>
+          </el-col>
+          <el-col :span="24" class="bode">
+            <el-col :span="6">订单备注</el-col>
+            <el-col :span="18" class="other">{{ form.remarks || '' }}</el-col>
+          </el-col>
+          <el-col :span="24" class="bode">
+            <el-col :span="6">配送方式</el-col>
+            <el-col :span="18" class="other">{{ form.transport_type_name || '待填写' }}</el-col>
+          </el-col>
+          <el-col :span="24" class="goods_total bode">
+            <el-col :span="24" v-for="(item, index) in total_detail" :key="index">
+              <el-col :span="8">{{ item.zh }}</el-col>
+              <el-col :span="16" class="other">
+                <p>¥{{ item.money }}</p>
+              </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="goods_total bode">
+            <el-col :span="8">实付金额</el-col>
+            <el-col :span="16" class="other">
+              <p>¥{{ pay.pay_money }} 元</p>
+            </el-col>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'card-1',
+  props: {
+    address: { type: Object },
+    shop: { type: Object },
+    goods: { type: Object },
+    spec: { type: Object },
+    form: { type: Object },
+    pay: { type: Object },
+    total_detail: { type: Array },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    search() {},
+    toUrl(url) {
+      if (url) window.open(url, '_blank');
+      else this.$message.error('该商品还未添加来源网址,无法跳转');
+    },
+    getActLength() {
+      return _.get(this.total_detail, 'act.length');
+    },
+    // 选择商品
+    getFile(value) {
+      let name;
+      if (this.spec.file && this.spec.file.length != 0) name = this.spec.file[0].url;
+      else if (this.goods.file && this.goods.file.length != 0) name = this.goods.file[0].url;
+      return name;
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  // padding: 0 5%;
+  .main_one {
+    padding: 0 5%;
+  }
+  .add {
+    border-bottom: 2px dashed #ccc;
+    margin: 0 0 5px 0;
+    padding: 5px 0;
+  }
+  .shop {
+    padding: 4px 0;
+    font-size: 18px;
+    border-bottom: 1px solid #ccc;
+  }
+  .goods {
+    padding: 10px 0;
+    .image {
+      padding: 0 10px 0 0;
+    }
+    .money {
+      text-align: right;
+    }
+  }
+  .transport {
+    margin: 50px;
+    padding: 5px;
+    border: 1px solid rgb(254, 195, 195);
+  }
+  .other {
+    text-align: right;
+    word-break: break-all;
+    p {
+      color: red;
+      font-size: 20px;
+    }
+    .spanfour {
+      color: blue;
+    }
+  }
+  .el-col {
+    margin: 3px 0;
+  }
+  .bode {
+    border-bottom: 1px solid rgb(238, 237, 237);
+  }
+  .form {
+    margin: 20px 0 0 0;
+  }
+}
+
+/deep/.el-timeline {
+  margin: 20px 0 0 0;
+  font-size: 16px;
+}
+/deep/.el-timeline-item__node:nth-child(1) {
+  background-color: green;
+}
+</style>

+ 284 - 0
src/components/orderParts/detail/parts/card-4.vue

@@ -0,0 +1,284 @@
+<template>
+  <div id="card-2">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="9" class="one">
+          <!-- 快递列表 -->
+          <el-col :span="24" v-if="form.transport_type == '0'">
+            <el-col v-for="(item, index) in transport" :key="index" class="transport">
+              <el-col :span="24" class="bode">
+                <el-col :span="6">寄出运单号</el-col>
+                <el-col :span="18" class="other">{{ item.shop_transport_no || '暂无单号' }}</el-col>
+              </el-col>
+              <el-col :span="24" class="bode">
+                <el-col :span="6">寄出快递公司</el-col>
+                <el-col :span="18" class="other">{{ item.shop_transport_name || '暂无快递信息' }}</el-col>
+              </el-col>
+              <el-col :span="24" style="text-align: center">
+                <el-button type="danger" @click="toDel(item)" v-if="form.status == '1' || form.status == '2' || form.status == '2-' || form.status == '3'">
+                  删除
+                </el-button>
+                <el-button type="primary" @click="toLog(item)"> 查看物流 </el-button>
+              </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="form" v-if="form.status == '1' || form.status == '2'">
+            <el-form :model="form" ref="form" :rules="rules" label-width="100px" class="demo-ruleForm">
+              <el-form-item label="快递类型" prop="transport_type">
+                <el-select v-model="form.transport_type" clearable filterable placeholder="请选择快递类型" size="small" style="width: 100%">
+                  <el-option v-for="i in transport_typeList" :key="i.label" :label="i.label" :value="i.value"> </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="寄出运单号" prop="shop_transport_no" v-if="form.transport_type == '0'">
+                <el-input v-model="form.shop_transport_no" placeholder="请输入运单号" size="small"></el-input>
+              </el-form-item>
+              <el-form-item label="快递公司" prop="shop_transport_type" v-if="form.transport_type == '0'">
+                <el-select
+                  v-model="form.shop_transport_type"
+                  filterable
+                  remote
+                  reserve-keyword
+                  placeholder="请选择快递公司"
+                  :remote-method="querySearch"
+                  :loading="loading"
+                  @change="handleSelect"
+                  size="small"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in shop_transport_typeList" :key="item.id" :label="item.label" :value="item.value"> </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item>
+                <el-col>
+                  <el-button type="primary" @click="onSubmit('form', '2')" v-if="(form.status == '1' || form.status == '2-') && status == '0'">
+                    保存
+                  </el-button>
+                  <el-button type="primary" @click="onSubmit('form', '2')" v-if="form.status == '2'"> 保存 </el-button>
+                  <el-button type="warning" @click="onConfirm('3', '是否确认收货')" v-if="form.status == '2'"> 确认收货 </el-button>
+                </el-col>
+              </el-form-item>
+            </el-form>
+          </el-col>
+        </el-col>
+        <!-- 物流信息 -->
+        <el-col :span="9" class="one" v-if="form.transport_type == '0' && logList.length != 0">
+          <el-col :span="24">{{ activit.is_check || '暂无快递信息' }}</el-col>
+          <el-col :span="24">{{ shop.shop_transport_name || '暂无快递信息' }}: {{ activit.no || '暂无快递信息' }}</el-col>
+          <el-col :span="24">
+            <p>收货地址:{{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }}</p>
+          </el-col>
+          <el-col :span="24">
+            <el-timeline :reverse="reverse">
+              <el-timeline-item v-for="(activity, index) in logList" :key="index" :timestamp="activity.time" :color="activity.color">
+                {{ activity.context }}
+              </el-timeline-item>
+            </el-timeline>
+          </el-col>
+        </el-col>
+        <el-col :span="9" class="one" v-else-if="form.transport_type == '1'"> 本单由商家派送 </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const moment = require('moment');
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('groupOrder');
+export default {
+  name: 'card-2',
+  props: {
+    transport: { type: Array },
+    shop_transport_typeList: { type: Array },
+    activities: { type: Array },
+    transport_typeList: { type: Array },
+    form: { type: Object },
+    address: { type: Object },
+  },
+  components: {},
+  data: function () {
+    return {
+      activit: {},
+      logList: [],
+      shop: {},
+      status: 0,
+      // 物流
+      reverse: false,
+      // 加载
+      loading: false,
+      rules: {
+        shop_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
+        shop_transport_type: [{ required: true, message: '请选择快递公司', trigger: 'change' }],
+        transport_type: [{ required: true, message: '请选择快递类型', trigger: 'change' }],
+      },
+    };
+  },
+  created() {},
+  methods: {
+    ...mapActions(['query', 'fetch', 'create', 'update']),
+    search() {
+      this.$emit('search');
+    },
+    // 远程查询
+    async querySearch(value) {
+      this.loading = true;
+      this.$emit('querySearch', value);
+      this.loading = false;
+    },
+    handleSelect(value) {},
+    // 查看物流
+    toLog(value) {
+      this.$set(this, `shop`, value);
+      let info = this.activities.find((f) => f.no == value.shop_transport_no);
+      if (info) {
+        info.list[0].color = '#0bbd87';
+        this.$set(this, `logList`, info.list);
+        this.$set(this, `activit`, info);
+      }
+    },
+    // 删除快递信息
+    toDel(val) {
+      this.$confirm('是否确认删除快递信息', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async () => {
+        let form = this.form;
+        let data = { _id: form._id, transport: [] };
+        let res;
+        if (data.id) res = await this.update(data);
+        if (this.$checkRes(res)) this.$message({ type: `success`, message: `维护信息成功` });
+      });
+    },
+    // 确认收货-确认全部发货
+    async onConfirm(val, text = '是否确认') {
+      this.$confirm(text, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async () => {
+        var res;
+        let data = { _id: this.form._id, status: val };
+        if (data._id) res = await this.update(data);
+        if (this.$checkRes(res)) {
+          this.$message({ type: `success`, message: `维护信息成功` });
+          this.search();
+        }
+      });
+    },
+    // 提交
+    async onSubmit(formName, val) {
+      this.$refs[formName].validate(async (valid) => {
+        if (valid) {
+          this.$confirm('是否确认保存', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          }).then(async () => {
+            var form = this.form;
+            if (form.transport_type == '0') {
+              var shop_transport_no = form.shop_transport_no;
+              var shop_transport_type = form.shop_transport_type;
+              if (val == '2' && !form.transport && form.transport_type == '0') {
+                let transport = [];
+                transport.push({ shop_transport_no, shop_transport_type });
+                form.transport = transport;
+              } else if (val == '2' && form.transport && form.transport_type == '0' && this.status == '0') {
+                let transport = [];
+                transport.push({ shop_transport_no, shop_transport_type });
+                form.transport = transport;
+              }
+            } else if (form.transport_type == '1' && form.transport) delete form.transport;
+            var res;
+            let data;
+            if (val) {
+              if (val == '2') data = { _id: form._id, status: val, transport: form.transport, transport_type: form.transport_type };
+              else data = { _id: form._id, status: val, transport_type: form.transport_type };
+            }
+            if (data._id) res = await this.update(data);
+            if (this.$checkRes(res)) {
+              this.$message({ type: `success`, message: `维护信息成功` });
+              this.search();
+            }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  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: 10px 0 0 2%;
+    padding: 5px;
+    .add {
+      border-bottom: 2px dashed #ccc;
+      margin: 0 0 5px 0;
+      padding: 5px 0;
+    }
+    .shop {
+      padding: 4px 0;
+      font-size: 18px;
+      border-bottom: 1px solid #ccc;
+    }
+    .goods {
+      padding: 10px 0;
+      .money {
+        text-align: right;
+      }
+    }
+    .transport {
+      margin: 50px;
+      padding: 5px;
+      border: 1px solid rgb(254, 195, 195);
+    }
+    .other {
+      text-align: right;
+      word-break: break-all;
+      p {
+        color: red;
+      }
+      .spanfour {
+        color: blue;
+      }
+    }
+    .el-col {
+      margin: 3px 0;
+    }
+    .bode {
+      border-bottom: 1px solid rgb(238, 237, 237);
+    }
+    .form {
+      margin: 20px 0 0 0;
+    }
+  }
+}
+
+.el-radio.is-bordered.is-checked {
+  border-color: rgb(24, 145, 243);
+}
+/deep/.el-timeline {
+  margin: 20px 0 0 0;
+  font-size: 16px;
+}
+/deep/.el-timeline-item__node:nth-child(1) {
+  background-color: green;
+}
+</style>

+ 2 - 14
src/components/orderParts/parts/detail-2.vue

@@ -71,20 +71,6 @@ export default {
               for (let p3 of p2.goods) {
                 // _.pick(p3, ['goods', 'name', 'buy_num']);
                 // let p3_2 = (({ goods, name, buy_num }) => ({ goods, name, buy_num }))(p3);
-                delete p3.flow_money;
-                delete p3.freight;
-                delete p3.id;
-                delete p3.status;
-                delete p3._id;
-                delete p3.meta;
-                delete p3.num;
-                delete p3.sell_money;
-                delete p3.__v;
-                delete p3.tags;
-                delete p3.cart_id;
-                delete p3.can_group;
-                delete p3.group_config;
-                delete p3.url;
                 let good = (({ name }) => ({ name }))(p3.goods);
                 p3.goods = good;
                 p3.order_no = p2.no;
@@ -101,6 +87,8 @@ export default {
           // let address = (({ name, phone, province, city, area, address, _id }) => ({ name, phone, province, city, area, address, _id }))(p1[0].address);
           list.push({ goodsList, address });
         }
+        console.log(list);
+
         this.$set(this, 'list', list);
       }
     },

+ 150 - 0
src/components/orderParts/parts/detail-3.vue

@@ -0,0 +1,150 @@
+<template>
+  <div id="card-1">
+    <el-row>
+      <el-col :span="24" class="main" v-loading="loadings" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
+        <el-col :span="24" v-if="num == '1'">
+          <el-col :span="24" class="one">
+            <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
+          </el-col>
+          <el-col :span="24" class="one">
+            <el-button type="primary" size="mini" @click="toDeliver()">生成发货清单</el-button>
+            <p>(发货清单里不显示售后的订单)</p>
+          </el-col>
+          <data-table
+            :select="true"
+            :selected="selected"
+            @handleSelect="handleSelect"
+            :fields="fields"
+            :opera="opera"
+            @query="search"
+            :data="list"
+            :total="total"
+            @detail="toDetail"
+            @sales="toSales"
+          >
+            <template #is_afterSale="{ row }">
+              <span :style="{ color: row.is_afterSale === true ? 'red' : '' }"> {{ row.is_afterSale === true ? '该订单有商品申请售后' : '未申请售后' }}</span>
+            </template>
+          </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('groupOrder');
+const { mapActions: shop } = createNamespacedHelpers('shop');
+export default {
+  name: 'card-1',
+  props: { statusList: { type: Array } },
+  components: { search1: () => import('../search-2.vue') },
+  data: function () {
+    return {
+      loadings: true,
+      num: '1',
+      searchForm: {},
+      list: [],
+      total: 0,
+      opera: [
+        { label: '详情', method: 'detail' },
+        { label: '售后', method: 'sales', type: 'danger' },
+      ],
+      fields: [
+        { label: '订单号', model: 'no', showTip: false },
+        { label: '下单时间', model: 'buy_time' },
+        { label: '顾客', model: 'customer' },
+        { label: '收货人', model: 'address', showTip: false },
+        { label: '商品名称', model: 'goods' },
+        { label: '规格名称', model: 'spec' },
+        { label: '支付金额', model: 'pay' },
+        { label: '购买数量', model: 'num' },
+        { label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后'), custom: true },
+      ],
+      // 多选值
+      selected: [],
+      shopList: [],
+      // 发货清单
+      deliverList: [],
+      deliver: '0',
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...shop({ shopQuery: 'query' }),
+    ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
+    // 查询
+    async search({ skip = 0, limit = this.$limit, ...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;
+      }
+      info.status = '1';
+      let res = await this.query({ skip, limit, ...condition, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, 'list', res.data);
+        this.$set(this, 'total', res.total);
+      }
+      this.loadings = false;
+    },
+    getAddress(i) {
+      let name = i.name + ',' + i.phone;
+      return name;
+    },
+    // 详情
+    toDetail({ data }) {
+      this.$emit('toDetails', data._id);
+    },
+    toSales({ data }) {
+      this.$emit('toSaless', { id: data._id, status: '1' });
+    },
+    toClose() {
+      this.searchForm = {};
+      this.search();
+    },
+    // 多选
+    handleSelect(data) {
+      this.$set(this, 'deliverList', data);
+    },
+    // 生成发货清单
+    toDeliver() {
+      this.$emit('toDeliver', { data: this.deliverList });
+    },
+    // 店铺名称远程查询
+    async querySearch(value) {
+      let res = await this.shopQuery({ name: value });
+      if (this.$checkRes(res)) this.$set(this, 'shopList', 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>
+.one {
+  margin: 0 0 10px 0;
+  p {
+    font-size: 12px;
+    color: #777;
+  }
+}
+</style>

+ 210 - 0
src/components/orderParts/parts/detail-4.vue

@@ -0,0 +1,210 @@
+<template>
+  <div id="form-1">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col class="top_btn"><el-button type="primary" size="mini" @click="toBack()">返回</el-button></el-col>
+        <el-col :span="24" class="one"> <span>发货清单</span> </el-col>
+        <el-col class="top_btn"> <el-button type="primary" @click="toFile()">导出清单</el-button></el-col>
+        <el-col :span="24" class="two">
+          <el-col :span="15" v-for="(item, index) in list" :key="index">
+            <el-card class="box-card">
+              <el-col class="clearfix">
+                <el-col>收货人:{{ item.address.name }},{{ item.address.phone }}</el-col>
+                <el-col>收货人地址:{{ item.address.province }},{{ item.address.city }},{{ item.address.area }},{{ item.address.address }}</el-col>
+              </el-col>
+              <el-col class="two_1">
+                <data-table
+                  :select="true"
+                  :selected="selected"
+                  @handleSelect="(e) => handleSelect(e, item.address)"
+                  rowKey="index"
+                  :usePage="false"
+                  :fields="fields"
+                  :data="item.goodsList"
+                >
+                </data-table>
+              </el-col>
+            </el-card>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import FileSaver from 'file-saver';
+const ExcelJS = require('exceljs');
+import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'form-1',
+  props: { deliverList: { type: Array } },
+  components: {},
+  data: function () {
+    return {
+      list: [],
+      fields: [
+        { label: '订单编号', model: 'order_no' },
+        { label: '商品名称', model: 'goods_name' },
+        { label: '商品规格', model: 'spec_name' },
+        { label: '商品数量', model: 'buy_num' },
+      ],
+      selected: [],
+      fileList: [],
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    // 查询
+    async search() {
+      let data = this.deliverList;
+      if (data) {
+        let test = _(data).groupBy('address._id').values().value();
+        let list = [];
+        for (const p1 of test) {
+          let goodsList = [];
+          for (const p2 of p1) {
+            let obj = { goods_name: p2.goods.name, spec_name: p2.goodsSpec.name, order_no: p2.no, buy_num: p2.num };
+            goodsList.push({ ...obj });
+            let i = 0;
+            for (const p4 of goodsList) {
+              p4.index = i;
+              i++;
+            }
+          }
+          let address = _.pick(p1[0].address, ['name', 'phone', 'province', 'city', 'area', 'address', '_id']);
+          list.push({ goodsList, address });
+        }
+        this.$set(this, 'list', list);
+      }
+    },
+    // 选中要导出的商品
+    handleSelect(goodsList, address) {
+      let fileList = this.fileList;
+      if (fileList.length == 0) {
+        fileList.push({ goodsList, address });
+      } else {
+        if (goodsList.length > 0) {
+          for (const val of fileList) {
+            if (address._id == val.address._id) val.goodsList = goodsList;
+            else fileList.push({ goodsList, address });
+          }
+        } else {
+          let p1 = fileList.filter((i) => i.address._id != address._id);
+          fileList = p1;
+        }
+      }
+      let list = _.uniqBy(fileList, 'address._id');
+      this.$set(this, 'fileList', list);
+    },
+    // 导出清单
+    toFile() {
+      const workbook = new ExcelJS.Workbook();
+      let list = this.fileList;
+      for (let [index, p1] of list.entries()) {
+        let name = p1.address.name + index;
+        const worksheet = workbook.addWorksheet(name);
+        // 设置标题-start
+        // 获取单元格位置
+        let titleCell = worksheet.getCell('A1');
+        // 合并单元格
+        worksheet.mergeCells('A1:D1');
+        // 单元格内容
+        titleCell.value = '发货清单';
+        worksheet.columns.forEach(function (column, i) {
+          column.font = { size: 14 };
+          column.width = 38;
+          column.alignment = { wrapText: true, vertical: 'middle', horizontal: 'left' };
+          column.border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
+        });
+        // 单元格内容样式
+        titleCell.style = {
+          alignment: { vertical: 'middle', horizontal: 'center' },
+          font: { size: 20, bold: true },
+          border: { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } },
+        };
+        // 设置标题-end
+        let data = [
+          ['收获人', p1.address.name],
+          ['联系电话', p1.address.phone],
+          ['收货地址', p1.address.province + p1.address.city + p1.address.area + p1.address.address],
+          ['订单号', '产品名称', '产品规格', '购买数量'],
+        ];
+        for (const p2 of p1.goodsList) {
+          let p4 = [[p2.order_no, p2.goods.name, p2.name, p2.buy_num]];
+          data.push(...p4);
+        }
+        const row = worksheet.getRow(1);
+        row.height = 40;
+        for (const val of data) {
+          worksheet.addRow(val);
+        }
+      }
+      workbook.xlsx.writeBuffer().then((buffer) => {
+        FileSaver.saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `发货清单.xlsx`);
+      });
+    },
+    // 返回
+    toBack() {
+      this.$emit('toBack');
+    },
+  },
+  computed: {
+    data() {
+      return this.$route.query.data;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .top_btn {
+    margin: 0 0 10px 0;
+  }
+  .one {
+    margin: 0 0 10px 0;
+    span:nth-child(1) {
+      font-size: 20px;
+      font-weight: 700;
+      margin-right: 10px;
+    }
+  }
+  .two {
+    margin: 5px 10%;
+    .data-table {
+      margin: 5px 0;
+    }
+    .clearfix {
+      margin: 4px 0;
+      .el-col {
+        margin: 4px 0;
+      }
+    }
+    .box-card {
+      margin: 5px;
+      padding: 5px 0 20px 0;
+    }
+    .shop {
+      text-align: center;
+      font-size: 18px;
+    }
+    .item {
+      margin-bottom: 18px;
+    }
+  }
+}
+</style>

+ 462 - 0
src/components/salesParts/guide_detail.vue

@@ -0,0 +1,462 @@
+<template>
+  <div id="form-1">
+    <el-row>
+      <el-col
+        :span="24"
+        class="main animate__animated animate__backInRight"
+        v-loading="loading"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+      >
+        <el-col class="top-btn">
+          <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
+        </el-col>
+        <el-col :span="8" class="one">
+          <el-col :span="24" class="add">
+            <el-col :span="4">买家:</el-col>
+            <el-col :span="20"> {{ customers.name }},{{ customers.phone }} </el-col>
+          </el-col>
+          <el-col :span="24" class="add">
+            <el-col :span="2">
+              <i class="el-icon-location"></i>
+            </el-col>
+            <el-col :span="22">
+              <el-col :span="24"> {{ address.name }},{{ address.phone }} </el-col>
+              <el-col :span="24"> {{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }} </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="shop"> <i class="el-icon-s-shop"></i>{{ shop.name }}</el-col>
+          <el-col v-if="info.type == '1' || info.type == '2' || info.type == '3'">
+            <el-col :span="24" class="goods">
+              <el-col :span="6"><el-image class="image" :src="file"></el-image></el-col>
+              <el-col :span="18">
+                <el-col :span="12">
+                  <p>{{ goods.name }}</p>
+                  <p>规格:{{ good.name }}</p>
+                </el-col>
+                <el-col :span="12" class="money">
+                  <p>¥{{ good.sell_money }}</p>
+                  <p>X{{ good.buy_num }}</p>
+                </el-col>
+              </el-col>
+            </el-col>
+          </el-col>
+          <el-col v-if="info.type == '4' || info.type == '5'">
+            <el-col :span="24" v-for="(item, index) in list" :key="index">
+              <el-col :span="24" class="goods bode">
+                <el-col :span="6" v-if="item.goods.file"><el-image class="image" :src="item.goods.file[0].url"></el-image></el-col>
+                <el-col :span="6" v-else-if="item.url"><el-image class="image" :src="item.url"></el-image></el-col>
+                <el-col :span="18">
+                  <el-col :span="12">
+                    <el-col>
+                      <p>{{ item.goods.name }}</p>
+                    </el-col>
+                    <el-col>
+                      <p>规格:{{ item.name }}</p>
+                    </el-col>
+                  </el-col>
+                  <el-col :span="12" class="money">
+                    <el-col>
+                      <p>¥{{ item.sell_money }}</p>
+                    </el-col>
+                    <el-col>
+                      <p>X{{ item.buy_num }}</p>
+                    </el-col>
+                  </el-col>
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="bode">
+                <el-col :span="6">运费</el-col>
+                <el-col :span="18" class="other" v-if="!item.goods.freight == '0'">{{ item.goods.freight }}</el-col>
+                <el-col :span="18" class="other" v-else>包邮</el-col>
+              </el-col>
+            </el-col>
+          </el-col>
+          <el-col :span="24">
+            <el-col :span="6">申请时间</el-col>
+            <el-col :span="18" class="other">{{ info.apply_time }}</el-col>
+          </el-col>
+          <el-col :span="24">
+            <el-col :span="6">结束时间</el-col>
+            <el-col :span="18" class="other">{{ info.end_time || '暂无' }}</el-col>
+          </el-col>
+          <el-col :span="24">
+            <el-col :span="6">售后类型</el-col>
+            <el-col :span="18" class="other">{{ info.zhType }}</el-col>
+          </el-col>
+          <el-col :span="24" v-if="info.type == '1' || info.type == '2' || info.type == '4' || info.type == '5'">
+            <el-col :span="6">退款金额</el-col>
+            <el-col :span="18" class="other">{{ info.money || '' }}</el-col>
+          </el-col>
+          <el-col :span="24">
+            <el-col :span="6">售后状态</el-col>
+            <el-col :span="18" class="other">{{ info.zhStatus }}</el-col>
+          </el-col>
+          <el-col :span="24" v-if="info.type == '2' || info.type == '3'">
+            <el-col :span="6">退回运单号</el-col>
+            <el-col :span="18" class="other">{{ transport.customer_transport_no || '暂无单号' }}</el-col>
+          </el-col>
+          <el-col :span="24" v-if="info.type == '3'">
+            <el-col :span="6">寄出运单号</el-col>
+            <el-col :span="18" class="other">{{ transport.shop_transport_no || '暂无单号' }}</el-col>
+          </el-col>
+          <el-col :span="24" v-if="info.type == '1' || info.type == '2' || info.type == '3'">
+            <el-col :span="6">售后描述</el-col>
+            <el-col :span="18" class="other">{{ info.desc }}</el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="12" class="two">
+          <steps-1 v-if="info.type == '1'" @exam="exam" :active="active" :form="form" :info="info"></steps-1>
+          <steps-2
+            v-if="info.type == '2'"
+            @exam="exam"
+            @exam_one="exam_one"
+            :active="active"
+            :customer="customer"
+            :activit="activit"
+            :form="form"
+            :info="info"
+            :customerForm="customerForm"
+            :shop_transport_typeList="shop_transport_typeList"
+            @querySearch="querySearch"
+            @customerSubmit="customerSubmit"
+          ></steps-2>
+          <steps-3
+            v-if="info.type == '3'"
+            @exam="exam"
+            :active="active"
+            @onSubmit="onSubmit"
+            :form="form"
+            :shop_transport_typeList="shop_transport_typeList"
+            :activit="activit"
+            @querySearch="querySearch"
+            :customer="customer"
+            :shopList="shopList"
+            :transport="transport"
+            :customerForm="customerForm"
+            @customerSubmit="customerSubmit"
+          ></steps-3>
+          <steps-4 v-if="info.type == '4'" @exam="exam" :active="active"></steps-4>
+          <steps-5 v-if="info.type == '5'" @exam="exam" :active="active"></steps-5>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+const moment = require('moment');
+import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('groupAfterSale');
+const { mapActions: dictData } = createNamespacedHelpers('dictData');
+const { mapActions: sot } = createNamespacedHelpers('sot');
+const { mapActions: getTransportInfo } = createNamespacedHelpers('getTransportInfo');
+
+export default {
+  name: 'form-1',
+  props: { id: { type: String } },
+  components: {
+    steps1: () => import('./parts/steps-1.vue'),
+    steps2: () => import('./parts/steps-2.vue'),
+    steps3: () => import('./parts/steps-3.vue'),
+    steps4: () => import('./parts/steps-4.vue'),
+    steps5: () => import('./parts/steps-5.vue'),
+  },
+  data: function () {
+    return {
+      // 商品
+      shop: {},
+      // 状态4,5商品
+      list: [],
+      // 图片
+      file: '',
+      // 商品
+      goods: {},
+      // 规格
+      good: {},
+      // 地址
+      address: {},
+      // 购买人
+      customers: {},
+      transport: {},
+      typeList: [],
+      statusList: [],
+      status: [],
+      form: {},
+      info: {},
+      // 物流
+      shop_transport_typeList: [],
+      customer: [],
+      shopList: [],
+      activit: {},
+      active: 1,
+      loading: true,
+      // 买家快递信息
+      customerForm: {},
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...sot({ sotFetch: 'fetch' }),
+    ...dictData({ dictQuery: 'query' }),
+    ...getTransportInfo({ getFetch: 'fetch' }),
+    ...mapActions(['fetch', 'create', 'update']),
+    // 查询
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        let type = this.typeList.find((i) => i.value == res.data.type);
+        if (type) res.data.zhType = type.label;
+        let status = this.statusList.find((i) => i.value == res.data.status);
+        if (status) res.data.zhStatus = status.label;
+        this.$set(this, `info`, res.data);
+        this.$set(this, `shop`, res.data.shop);
+        this.$set(this, `address`, res.data.order_detail.address);
+        this.$set(this, `customers`, res.data.order_detail.customer);
+        if (res.data.type == '4' || res.data.type == '5') this.$set(this, `list`, res.data.order_detail.goods); // 商品
+        else if (res.data.type == '1' || res.data.type == '2' || res.data.type == '3') {
+          if (res.data.transport) this.$set(this, `transport`, res.data.transport);
+          // 图片
+          if (res.data.goods.file && res.data.goods.file.length != 0) this.$set(this, `file`, res.data.goods.file[0].url);
+          else if (res.data.goods.goods.file) this.$set(this, `file`, res.data.goods.goods.file[0].url);
+          else this.$set(this, `file`, res.data.goods.url);
+          // 商品
+          this.$set(this, `goods`, res.data.goods.goods);
+          // 规格
+          this.$set(this, `good`, res.data.goods);
+        }
+        // 仅退款
+        if (res.data.status == '-1') this.$set(this, `active`, 3);
+        else if (res.data.status == '!1') this.$set(this, `active`, 4);
+        // 退货
+        else if (res.data.status == '2') this.$set(this, `active`, 2);
+        else if (res.data.status == '-2') this.$set(this, `active`, 4);
+        else if (res.data.status == '!2') this.$set(this, `active`, 5);
+        // 换货
+        else if (res.data.status == '3') this.$set(this, `active`, 2);
+        else if (res.data.status == '-3') this.$set(this, `active`, 6);
+        else if (res.data.status == '!3') this.$set(this, `active`, 7);
+        // 取消订单
+        else if (res.data.status == '-4') this.$set(this, `active`, 3);
+        else if (res.data.status == '!4') this.$set(this, `active`, 4);
+        // 拒收
+        else if (res.data.status == '5') this.$set(this, `active`, 3);
+        else if (res.data.status == '!5') this.$set(this, `active`, 5);
+        else if (res.data.status == '-5') this.$set(this, `active`, 4);
+        // 查询物流
+        if (res.data.transport) this.toLog(res.data.transport);
+        this.loading = false;
+      }
+    },
+    async toLog(e) {
+      // 快递数据回显
+      if (e.customer_transport_type) {
+        let arr = await this.dictQuery({ code: 'transport_company', value: e.customer_transport_type });
+        if (this.$checkRes(arr)) {
+          let type = arr.data.find((i) => i.value == e.customer_transport_type);
+          if (type) {
+            e.customer_transport_name = type.label;
+            this.querySearch(type.label);
+          }
+          this.$set(this, `transport`, e);
+          this.$set(this.customerForm, `customer_transport_type`, this.transport.customer_transport_type);
+          this.$set(this.customerForm, `customer_transport_no`, this.transport.customer_transport_no);
+        }
+      }
+      if (e.shop_transport_type) {
+        let aee = await this.dictQuery({ code: 'transport_company', value: e.shop_transport_type });
+        if (this.$checkRes(aee)) {
+          let type = aee.data.find((i) => i.value == e.shop_transport_type);
+          if (type) {
+            e.shop_transport_name = type.label;
+            this.querySearch(type.label);
+          }
+          this.$set(this, `transport`, e);
+          this.$set(this.form, `shop_transport_type`, this.transport.shop_transport_type);
+          this.$set(this.form, `shop_transport_no`, this.transport.shop_transport_no);
+        }
+      }
+      // 显示物流
+      let res = await this.getFetch(this.id);
+      if (this.$checkRes(res)) {
+        if (res.errcode == '0') {
+          if (res.data.customer) {
+            let customer = res.data.customer.list;
+            this.$set(this, `customer`, customer);
+            customer[0].color = '#0bbd87';
+            if (res.data.customer.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 3);
+            if (res.data.customer.is_check == '已签收' && this.info.status == '2') this.$set(this, `active`, 3);
+          }
+          if (res.data.shop) {
+            if (this.info.status == '3') this.$set(this, `active`, 4);
+            let shopList = res.data.shop.list;
+            this.$set(this, `shopList`, shopList);
+            shopList[0].color = '#0bbd87';
+            if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
+          }
+          this.$set(this, `activit`, res.data);
+        }
+      }
+    },
+    // 审核
+    async exam(status, form) {
+      let info = this.info;
+      info.status = status;
+      if (status == '-2' && info.transport) info.transport.shop_receive = true;
+      else if (status == '-2' && !info.transport) {
+        let transport = {};
+        transport.shop_receive = true;
+        info.transport = transport;
+      }
+      if (status == '-3' && info.transport) info.transport.customer_receive = true;
+      else if (status == '-3' && !info.transport) {
+        let transport = {};
+        transport.customer_receive = true;
+        info.transport = transport;
+      }
+      if (form != undefined && form.money != undefined && (status == '2' || status == '1')) info.money = form.money;
+      let res;
+      this.$confirm('是否确认修改售后状态', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async () => {
+        if (info.id) res = await this.update(info);
+        if (this.$checkRes(res)) {
+          this.$message({ type: `success`, message: `维护信息成功` });
+          this.search();
+        }
+      });
+    },
+    async exam_one(status) {
+      let info = this.info;
+      info.status = status;
+      let res;
+      this.$confirm('是否确认不填写单号修改售后状态', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(async () => {
+        if (info.id) res = await this.update(info);
+        if (this.$checkRes(res)) {
+          this.$message({ type: `success`, message: `维护信息成功` });
+          this.search();
+        }
+      });
+    },
+    // 远程查询快递公司
+    async querySearch(value) {
+      let res = await this.dictQuery({ code: 'transport_company', label: value });
+      if (this.$checkRes(res)) this.$set(this, 'shop_transport_typeList', res.data);
+    },
+    // 买家快递填写保存
+    async customerSubmit(val) {
+      let info = this.info;
+      let res;
+      if (info.transport) {
+        info.transport = {
+          ...info.transport,
+          customer_transport_no: val.customer_transport_no,
+          customer_transport_type: val.customer_transport_type,
+        };
+      } else {
+        let transport = { customer_transport_no: val.customer_transport_no, customer_transport_type: val.customer_transport_type };
+        info.transport = transport;
+      }
+      if (info.id) res = await this.update(info);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `维护信息成功` });
+        this.search();
+      }
+    },
+    // 保存
+    async onSubmit(val) {
+      let info = this.info;
+      let res;
+      if (info.transport) {
+        info.transport = { ...info.transport, shop_transport_no: val.shop_transport_no, shop_transport_type: val.shop_transport_type, shop_receive: true };
+      } else {
+        let transport = { shop_transport_no: val.shop_transport_no, shop_transport_type: val.shop_transport_type, shop_receive: true };
+        info.transport = transport;
+      }
+      if (info.id) res = await this.update(info);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `维护信息成功` });
+        this.search();
+      }
+    },
+    // 查询其他信息
+    async searchOther() {
+      let res;
+      // 类型
+      res = await this.dictQuery({ code: 'afterSale_type' });
+      if (this.$checkRes(res)) this.$set(this, `typeList`, res.data);
+      res = await this.dictQuery({ code: 'afterSale_status' });
+      if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
+    },
+    // 返回
+    toBack() {
+      this.$emit('toBack');
+    },
+  },
+
+  computed: {
+    ...mapState(['user']),
+  },
+  metaform() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    font-size: 16px;
+    margin: 10px 4% 0 8%;
+    padding: 5px;
+    .add {
+      border-bottom: 2px dashed #ccc;
+      margin: 0 0 5px 0;
+      padding: 5px 0;
+    }
+    .shop {
+      padding: 4px 0;
+      font-size: 22px;
+      border-bottom: 1px solid #ccc;
+    }
+    .goods {
+      padding: 10px 0;
+      .image {
+        padding: 0 10px 0 0;
+      }
+      .money {
+        text-align: right;
+      }
+    }
+    .other {
+      text-align: right;
+      p {
+        color: red;
+      }
+    }
+    .el-col {
+      margin: 4px 0;
+    }
+  }
+  .two {
+    margin: 0 0 0 20px;
+  }
+}
+</style>

+ 3 - 0
src/store/index.js

@@ -60,6 +60,8 @@ import groupOrder from './module/group/groupOrder';
 import goodsConfig from './module/group/goodsConfig';
 // 团表
 import group from './module/group/group';
+// 快递
+import groupTransport from './module/group/groupTransport';
 
 Vue.use(Vuex);
 
@@ -105,5 +107,6 @@ export default new Vuex.Store({
     groupOrder,
     goodsConfig,
     group,
+    groupTransport,
   },
 });

+ 44 - 0
src/store/module/group/groupTransport.js

@@ -0,0 +1,44 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+const _ = require('lodash');
+Vue.use(Vuex);
+const api = {
+  url: '/point/group/v1/api//orderOthers/transport',
+};
+
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.url}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.url}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.url}/${payload}`);
+    return res;
+  },
+  async update({ commit }, payload) {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await this.$axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.url}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 57 - 21
src/views/platGroup/order/index.vue

@@ -14,22 +14,30 @@
             <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
               <el-tab-pane name="1" label="待付款"> </el-tab-pane>
               <el-tab-pane name="2" label="待发货"> </el-tab-pane>
-              <el-tab-pane name="3" label="部分发货"> </el-tab-pane>
-              <el-tab-pane name="4" label="收货"> </el-tab-pane>
-              <el-tab-pane name="5" label="已收货"> </el-tab-pane>
-              <el-tab-pane name="6" label="取消订单"> </el-tab-pane>
-              <el-tab-pane name="7" label="申请售后"> </el-tab-pane>
-              <el-tab-pane name="8" label="正在处理售后"> </el-tab-pane>
-              <el-tab-pane name="9" label="售后结束"> </el-tab-pane>
-              <el-col :span="24">
+              <el-tab-pane name="3" label="待收货"> </el-tab-pane>
+              <el-tab-pane name="4" label="收货"> </el-tab-pane>
+              <el-tab-pane name="5" label="取消订单"> </el-tab-pane>
+              <!-- 待发货 -->
+              <el-col :span="24" v-if="activeName == '2'">
+                <card-2 :statusList="statusList" @toDetails="toDetail_t" @toSaless="toSaless_t"></card-2>
+              </el-col>
+              <el-col :span="24" v-else-if="activeName != '2'">
                 <el-col :span="24" class="one">
                   <search-1 :form="searchForm" @onSubmit="search" @querySearch="querySearch" @toReset="toClose" :shopList="shopList"> </search-1>
                 </el-col>
-                <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @> </data-table>
+                <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @detail="toDetails" @sales="toSaless">
+                  <template #is_afterSale="{ row }">
+                    <span :style="{ color: row.is_afterSale === true ? 'red' : '' }">
+                      {{ row.is_afterSale === true ? '该订单有商品申请售后' : '未申请售后' }}
+                    </span>
+                  </template>
+                </data-table>
               </el-col>
             </el-tabs>
           </el-col>
         </span>
+        <group_order v-if="view === 'card_detail'" :id="order_id" @toBack="toBack"></group_order>
+        <group_sales v-else-if="view === 'card_sales'" :id="sales_id" :status="status" @toBack="toBack"></group_sales>
       </el-col>
     </el-row>
   </div>
@@ -45,10 +53,12 @@ export default {
   name: 'index',
   props: {},
   components: {
+    card2: () => import('@/components/orderParts/card-4.vue'),
+    group_order: () => import('@/components/orderParts/detail/group_order.vue'),
+    group_sales: () => import('@/components/orderParts/detail/group_sales.vue'),
     search1: () => import('@/components/orderParts/search-2.vue'),
   },
   data: function () {
-    const that = this;
     return {
       loadings: true,
       view: 'list',
@@ -65,15 +75,17 @@ export default {
       total: 0,
       opera: [
         { label: '详情', method: 'detail' },
-        { label: '售后', method: 'sales', type: 'danger', display: (i) => i.status == '1' || i.status == '2' || i.status == '2-' || i.status == '3' },
+        { label: '售后', method: 'sales', type: 'danger', display: (i) => this.activeName == '1' || this.activeName == '3' || this.activeName == '4' },
       ],
       fields: [
         { label: '订单号', model: 'no', showTip: false },
         { label: '下单时间', model: 'buy_time' },
-        { label: '顾客', model: 'customer.name' },
-        { label: '收货人', model: 'address', showTip: false, format: (i) => this.getAddress(i) },
-        { label: '支付金额', model: 'real_pay' },
-        { label: '商品数量', model: 'buy_num_total' },
+        { label: '顾客', model: 'customer' },
+        { label: '收货人', model: 'address', showTip: false },
+        { label: '商品名称', model: 'goods' },
+        { label: '规格名称', model: 'spec' },
+        { label: '支付金额', model: 'pay' },
+        { label: '购买数量', model: 'num' },
         { label: '是否售后', model: 'is_afterSale', format: (i) => (i === true ? '该订单有商品申请售后' : '未申请售后'), custom: true },
       ],
     };
@@ -89,18 +101,42 @@ export default {
     // 查询
     async search({ skip = 0, limit = this.$limit, ...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;
-      // }
+      if (condition.buy_time) {
+        condition[`buy_time@start`] = _.head(condition.buy_time);
+        condition[`buy_time@end`] = _.last(condition.buy_time);
+        delete condition.buy_time;
+      }
+      if (this.activeName == '1') info.status = '0';
+      else if (this.activeName == '3') info.status = '2';
+      else if (this.activeName == '4') info.status = '3';
+      else if (this.activeName == '5') info.status = '-1';
       let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
+        this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);
       }
       this.loadings = false;
     },
+    // 待收货,已收货
+    toDetails({ data }) {
+      this.$set(this, `order_id`, data._id);
+      this.$set(this, `view`, 'card_detail');
+    },
+    toSaless({ data }) {
+      this.$set(this, `sales_id`, data._id);
+      this.$set(this, `status`, data.status);
+      this.$set(this, `view`, 'card_sales');
+    },
+    // 待发货
+    toDetail_t(data) {
+      this.$set(this, `order_id`, data);
+      this.$set(this, `view`, 'card_detail');
+    },
+    toSaless_t(data) {
+      this.$set(this, `sales_id`, data.id);
+      this.$set(this, `status`, data.status);
+      this.$set(this, `view`, 'card_sales');
+    },
     handleClick(tab) {
       this.loadings = true;
       this.search();

+ 5 - 4
src/views/platGroup/sales/index.vue

@@ -17,7 +17,7 @@
             <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @exam="toExam"> </data-table>
           </el-col>
         </span>
-        <!-- <detail v-if="view === 'order'" :id="id" @toBack="toBack"></detail> -->
+        <guide_detail v-if="view === 'order'" :id="id" @toBack="toBack"></guide_detail>
       </el-col>
     </el-row>
   </div>
@@ -33,7 +33,7 @@ export default {
   props: {},
   components: {
     search1: () => import('@/components/salesParts/parts/search-1.vue'),
-    // detail: () => import('@/components/salesParts/detail.vue'),
+    guide_detail: () => import('@/components/salesParts/guide_detail.vue'),
   },
   data: function () {
     const that = this;
@@ -46,7 +46,7 @@ export default {
       opera: [{ label: '审核', method: 'exam' }],
       fields: [
         { label: '顾客', model: 'customer.name', showTip: false },
-        { label: '订单号', model: 'order_detail.no', showTip: false },
+        { label: '订单号', model: 'order.no', showTip: false },
         { label: '商品名称', model: 'goods.goods.name', showTip: false },
         {
           label: '售后类型',
@@ -85,6 +85,7 @@ export default {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
+      info.shop = this.user.shop.id;
       let condition = _.cloneDeep(this.searchForm);
       let res = await this.query({ skip, limit, ...condition, ...info });
       if (this.$checkRes(res)) {
@@ -94,7 +95,7 @@ export default {
       this.loadings = false;
     },
     toExam({ data }) {
-      this.$set(this, `id`, data.id);
+      this.$set(this, `id`, data._id);
       this.$set(this, `view`, 'order');
     },
     toBack() {