Bladeren bron

Merge branch 'dev' of mangpiao/mp-ui-pc into test

lsx 2 jaren geleden
bovenliggende
commit
e510de515b

+ 28 - 0
src/api/business/inventory.js

@@ -0,0 +1,28 @@
+import request from '@/utils/request'
+
+//列表
+export function getInventoryList(urlParams, data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/goods/list',
+    method: 'post',
+    data,
+    urlParams
+  })
+}
+
+//详情
+export function getInventoryDetail(orderId) {
+  return request({
+    url: `/api/v1/mp/admin/channel/goods/detail/${orderId}`,
+    method: 'post',
+  })
+}
+
+//推送结算订单
+export function storeInventory(data) {
+  return request({
+    url: `/api/v1/mp/admin/channel/goods/push/settle/order`,
+    method: 'post',
+    data
+  })
+}

+ 37 - 0
src/api/business/order.js

@@ -210,3 +210,40 @@ export function setBatchShip(data, config = {}) {
     }
   })
 }
+
+// 采购订单
+export function getStoreList(urlParams, data) {
+  return request({
+      url: '/api/v1/mp/admin/channel/goods/order/list',
+      method: 'post',
+      data,
+      urlParams
+  })
+}
+
+// 采购订单导出
+export function storeOrderExport(data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/goods/order/export',
+    method: 'post',
+    data
+  })
+}
+
+// 用户订单详情
+export function storeDetail(data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/goods/order/detail',
+    method: 'post',
+    data
+  })
+}
+
+// 采购订单发货
+export function storeOrderShip(data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/goods/order/ship',
+    method: 'post',
+    data
+  })
+}

+ 19 - 0
src/router/index.js

@@ -192,6 +192,19 @@ export const constantRoutes = [
       }
     ],
   },
+  {
+    path: '/inventory',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'detail',
+        component: (resolve) => require(['@/views/business/inventory/detail'], resolve),
+        name: 'InventoryDetail',
+        meta: { title: '库存订单查看', activeMenu: '/goods/inventory' }
+      }
+    ],
+  },
   {
     path: '/exchange',
     component: Layout,
@@ -326,6 +339,12 @@ export const constantRoutes = [
         component: (resolve) => require(['@/views/order/userTicket/detail'], resolve),
         name: 'UserTicketDetail',
         meta: { title: '盲票销售订单查看' , activeMenu: '/order/userTicket', noCache: true }
+      },
+      {
+        path: 'store/query',
+        component: (resolve) => require(['@/views/order/store/detail'], resolve),
+        name: 'StoreDetail',
+        meta: { title: '采购订单查看' , activeMenu: '/order/store', noCache: true }
       }
     ]
   },

+ 13 - 3
src/views/business/exchange/components/GoodsAdd.vue

@@ -27,6 +27,7 @@
           <el-option label="全部" value=""/>
           <el-option label="实物商品" value="1"/>
           <el-option label="卡密商品" value="2"/>
+          <el-option label="采购商品" value="3"/>
         </el-select>
         <div class="ge"></div>
         <el-button
@@ -66,14 +67,23 @@
           </template>
         </el-table-column>
         <el-table-column label="商品名称" prop="title" min-width="85" />
+        <el-table-column label="商品价格" min-width="85">
+          <template slot-scope="scope">
+            <div>¥{{ $numberFormat(scope.row.value) }}</div>
+          </template>
+        </el-table-column>
         <el-table-column label="商品类型" min-width="85">
           <template slot-scope="scope">
-            <div>{{ scope.row.type == 1 ? '实物商品':'卡密商品' }}</div>
+            <div v-if="scope.row.type == 1">实物商品</div>
+            <div v-if="scope.row.type == 2">卡密商品</div>
+            <div v-if="scope.row.type == 3">采购商品</div>
           </template>
         </el-table-column>
-        <el-table-column label="商品价格" min-width="85">
+        <el-table-column label="是否支持兑换" prop="exchangeShow" min-width="85">
           <template slot-scope="scope">
-            <div>¥{{ $numberFormat(scope.row.value) }}</div>
+            <div v-if="scope.row.exchangeShow == 1">支持兑换</div>
+            <div v-else-if="scope.row.exchangeShow == 0">不支持兑换</div>
+            <div v-else-if="scope.row.exchangeShow == 2">盲票商品</div>
           </template>
         </el-table-column>
         <el-table-column label="商品库存" prop="quantity" width="80" />

+ 1 - 1
src/views/business/goods/index.vue

@@ -172,7 +172,7 @@
       </el-table-column>
       <el-table-column fixed="right" align="center" label="操作" width="140">
         <template slot-scope="{row}">
-          <el-button  v-hasPermi="['business:goods:edit']" type="text" @click="toAssociation(row.goodsId)">查看关联盲票</el-button>
+          <el-button  v-hasPermi="['business:goods:edit']" type="text" v-if="row.type != 3" @click="toAssociation(row.goodsId)">查看关联盲票</el-button>
           <!-- <el-button v-hasPermi="['business:goods:query']" type="text">查看</el-button> -->
           <el-button v-hasPermi="['business:goods:edit']" type="text" @click="handleCamilo(row.goodsId)" v-if="row.type === 2">
             查看卡密

+ 114 - 0
src/views/business/inventory/components/InventoryGoods.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <el-dialog title="结算采购订单" :visible.sync="inventoryShow" width="500px" :before-close="close">
+      <el-form :model="form" ref="form" :rules="rules" label-width="150px">
+        <el-form-item label="订单号:">
+          <span>{{ inventoryInfo.orderId }}</span>
+        </el-form-item>
+        <el-form-item label="总库存:">
+          <span>{{ inventoryInfo.totalQuantity }}件</span>
+        </el-form-item>
+        <el-form-item label="已核销:">
+          <span>{{ inventoryInfo.totalVerifyQty }}件</span>
+        </el-form-item>
+        <el-form-item label="需结算:">
+          <span>{{ inventoryInfo.totalRemainQty }}件</span>
+        </el-form-item>
+        <el-form-item label="采购成本:">
+          <span>¥{{ $numberFormat(inventoryInfo.totalPurchaseCost) }}</span>
+        </el-form-item>
+        <!-- <el-form-item label="门店应付金额:">
+          <span>¥{{ $numberFormat(inventoryInfo.totalPurchaseCost) }}</span>
+        </el-form-item> -->
+        <el-form-item label="实际结算金额:" prop="settleAmt">
+          <el-input v-model="form.settleAmt" type="number" style="width: 180px" placeholder="请输入金额">
+              <template slot="append">元</template>
+            </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" :disabled="loading" @click="saveClick">向门店发送订单</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import {accDiv, accMul} from '@/utils/util'
+import { storeInventory } from "@/api/business/inventory";
+export default {
+  props: {
+    // 弹框显示
+    inventoryShow: {
+      type: Boolean,
+      default: false,
+    },
+    // 订单详情
+    inventoryInfo: {
+      type: Object,
+      default: {},
+    },
+  },
+  created() {
+    console.log(this.inventoryInfo)
+  },
+  data() {
+    return {
+      info: {},
+      loading: false,
+      form: {
+        settleAmt: "",
+      },
+      rules: {
+        settleAmt: [
+          { required: true, message: "请输入金额", trigger: "blur" },
+          {
+            pattern: /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/,
+            message: "请输入正确的金额,最多两位小数",
+            trigger: ["blur", "change"]
+          }
+        ],
+      },
+    };
+  },
+  methods: {
+    // 关闭发货弹框
+    close() {
+      this.$emit("close");
+      this.loading = false;
+    },
+
+    // 确认
+    saveClick() {
+      this.loading = true;
+      const form = this.$refs["form"];
+      form.validate((valid) => {
+        if (valid) {
+          let data = {
+            settleAmt: accMul(this.form.settleAmt, 100),
+            orderId: this.inventoryInfo.orderId,
+          };
+          storeInventory(data)
+            .then((res) => {
+              if (res.code == 0) {
+                this.msgSuccess("发送成功");
+                this.close();
+              }
+            })
+            .catch(() => {
+              this.loading = false;
+            });
+        } else {
+          this.loading = false;
+          // 提示第一个error
+          this.getFormErrorMessage(form);
+          return false;
+        }
+      });
+    },
+
+  },
+};
+</script>
+<style>
+</style>

+ 264 - 0
src/views/business/inventory/detail.vue

@@ -0,0 +1,264 @@
+<template>
+  <div class="app-container">
+    <!-- 基本信息 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+        <div class="info-title">基本信息</div>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">手机号码:{{ info.tel }}</div>
+        </el-col>
+        <el-col :span="8" :xs="{span: 24, offset: 0}">
+          <div class="title">门店名称:{{ info.channelName }}</div>
+        </el-col>
+      </el-col>
+    </el-row>
+
+    <!-- 库存信息 -->
+    <el-row :gutter="10" >
+      <el-col :span="22" :offset="1">
+        <div class="info-title">库存信息</div>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">总库存:{{ info.totalQuantity }}</div>
+        </el-col>
+        <el-col :span="7" :xs="{span: 24, offset: 0}">
+          <div class="title">已核销:{{ info.totalVerifyQty }}</div>
+        </el-col>
+        <el-col :span="8" :xs="{span: 24, offset: 0}">
+          <div class="title">剩余库存:{{ info.totalRemainQty }}</div>
+        </el-col>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">采购成本:¥{{ $numberFormat(info.totalPurchaseCost) }}</div>
+        </el-col>
+      </el-col>
+    </el-row>
+
+    <!-- 订单状态 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+        <div class="info-title">状态</div>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">订单状态:{{ status.desc }}</div>
+        </el-col>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}" v-if="status && status.value == 2">
+          <div class="title">支付金额:¥{{ $numberFormat(info.payAmount) }}</div>
+        </el-col>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}" v-if="(status && status.value == 2) || (status && status.value == 3)">
+          <div class="title">发起结算时间:{{ parseTime(info.pushTime) }}</div>
+        </el-col>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}" v-if="status && status.value == 2">
+          <div class="title">结算时间:{{ parseTime(info.settleTime) || '--' }}</div>
+        </el-col>
+        <el-button
+        v-if="status && status.value == 1"
+          v-hasPermi="['business:ticket:on']"
+          type="primary"
+          @click="toInventory()"
+        >去结算</el-button
+        >
+      </el-col>
+    </el-row>
+
+        <!-- 商品信息 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+         <div class="info">
+      <div class="info-title">商品信息</div>
+      <div class="info-table">
+        <el-table :data="list">
+          <el-table-column label="商品信息" min-width="200">
+            <div slot-scope="{ row }" class="flex">
+              <el-image
+                style="width: 100px; height: 100px"
+                :src="row.picUrl"
+                :preview-src-list="[row.picUrl]"
+              />
+              <div class="txt">{{ row.title }}</div>
+            </div>
+          </el-table-column>
+          <el-table-column label="规格" min-width="100">
+            <template slot-scope="{ row }">
+              <div>{{ row.properties || "--" }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="采购成本(元)" prop="purchaseCost" min-width="80">
+            <template slot-scope="{ row }">
+              <div>{{ $numberFormat(row.purchaseCost) }}</div>
+            </template>
+          </el-table-column>
+            <el-table-column label="库存" prop="quantity" min-width="80"/>
+            <el-table-column label="已核销" prop="verifyQty" min-width="80"/>
+            <el-table-column label="剩余库存" prop="remainQty" min-width="80"/>
+        </el-table>
+      </div>
+    </div>
+      </el-col>
+    </el-row>
+    <!-- 结算 -->
+    <inventory-goods :inventory-show="inventoryShow" :inventory-info="info" @close="close" v-if="inventoryShow"/>
+  </div>
+</template>
+<script>
+import { getInventoryDetail } from "@/api/business/inventory";
+import { publicFileGetUrl } from "@/api/common";
+import InventoryGoods from "./components/InventoryGoods";
+export default {
+  name: "InventoryDetail",
+  components: {
+    InventoryGoods,
+  },
+  data() {
+    return {
+      // 订单ID
+      orderId: "",
+      // 订单详情
+      info: {},
+      // 订单状态
+      status: {},
+      // 商品信息列表
+      list: [],
+      // 结算显示
+      inventoryShow: false,
+    };
+  },
+  created() {
+    this.orderId = this.$route.query.id;
+    this.getDetail();
+  },
+  activated() {
+    const orderId = this.$route.query.id;
+    if (orderId != null && orderId != this.orderId) {
+      this.orderId = orderId;
+      this.getDetail();
+    }
+  },
+  methods: {
+    // 订单详情
+    getDetail() {
+      getInventoryDetail(this.orderId).then((res) => {
+        if (res.code == 0) {
+          this.info = res.data;
+          this.status = JSON.parse(res.data.status);
+          res.data.items &&
+            res.data.items.forEach((item) => {
+              let picUrlArr = item.picUrl.split(",");
+              item.picUrl = publicFileGetUrl + picUrlArr[0];
+            });
+          this.list = res.data.items;
+        }
+      });
+    },
+
+    // 点击发货
+    toInventory() {
+      this.inventoryShow = true;
+    },
+
+    // 发货关闭
+    close() {
+      this.inventoryShow = false;
+      this.getDetail();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.title {
+  line-height: 30px;
+  text-align: left;
+}
+.edit-express {
+  color: #409eff;
+  cursor: pointer;
+}
+
+.info {
+  margin-bottom: 10px;
+  &-title {
+    font-size: 14px;
+    margin-bottom: 20px;
+    font-weight: bold;
+  }
+  &-item {
+    padding-left: 50px;
+    &-content {
+      display: flex;
+
+      &-one {
+        display: flex;
+        margin-bottom: 10px;
+
+        .title {
+          //width: 100px;
+        }
+
+        .txt {
+          //width: 200px;
+        }
+      }
+    }
+
+    &-logistics {
+      margin-bottom: 20px;
+      .logistics-title {
+        text-align: left;
+        font-weight: bold;
+        margin-bottom: 20px;
+      }
+      .info {
+        display: flex;
+        margin-bottom: 10px;
+        &-one {
+          display: flex;
+        }
+        .tit {
+          line-height: 22px;
+          //width: 100px;
+        }
+        .txt {
+          line-height: 22px;
+          //width: 200px;
+        }
+        .edit-express{
+          color: #409eff;
+          cursor: pointer;
+        }
+      }
+      .goods {
+        margin: 10px 0;
+        &-item {
+          display: flex;
+          border-bottom: 1px solid #f3eeee;
+          img {
+            width: 100px;
+            height: 100px;
+          }
+          .info {
+            padding-left: 20px;
+            display: flex;
+            flex-direction: column;
+            height: 100px;
+            justify-content: space-between;
+          }
+        }
+      }
+    }
+  }
+  &-amt {
+    margin-top: 10px;
+    &-price {
+      span {
+        display: inline-block;
+        width: 80px;
+        margin-bottom: 20px;
+      }
+    }
+  }
+}
+.flex {
+  display: flex;
+  align-items: center;
+  .txt {
+    margin-left: 20px;
+  }
+}
+</style>

+ 323 - 0
src/views/business/inventory/index.vue

@@ -0,0 +1,323 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="门店" prop="channelId">
+        <el-select v-model="queryParams.channelId" placeholder="请选择门店" style="width: 100%;" filterable clearable :filter-method="dataFilter" @change="pageParams.pageNum = 1;handleQuery()">
+          <el-option v-for="(item) in siteList" :key="item.channelId" :label="item.name" :value="item.channelId">
+            <div>
+              <span style="float: left;">{{item.name}} </span>
+              <span style="float: right;">{{item.mobile}}</span>
+            </div>
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="商品名称">
+        <el-input v-model="queryParams.title" placeholder="请输入商品名称" clearable size="small" style="width: 240px" @change="pageParams.pageNum = 1;handleQuery()" />
+      </el-form-item>
+      <el-form-item label="订单号">
+        <el-input v-model="queryParams.orderId" placeholder="输入订单编号" clearable size="small" style="width: 240px" @change="pageParams.pageNum = 1;handleQuery()" />
+      </el-form-item>
+      <el-form-item label="下单时间">
+        <el-date-picker v-model="tradeTimeArr" type="datetimerange" size="small" value-format="timestamp" range-separator="至" start-placeholder="时间选择" end-placeholder="时间选择" @change="tardeTime">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="手机号码">
+        <el-input v-model="queryParams.tel" placeholder="输入手机号" clearable size="small" style="width: 240px" @change="pageParams.pageNum = 1;handleQuery()" />
+      </el-form-item>
+      <el-form-item label="状态">
+        <el-select v-model="queryParams.settleStatus" placeholder="请选择" clearable @change="pageParams.pageNum = 1;handleQuery()">
+          <el-option label="全部" value="" />
+          <el-option label="未结算" value="1" />
+          <el-option label="结算中" value="3" />
+          <el-option label="已结算" value="2" />
+          <el-option label="核销完成" value="4" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="剩余库存">
+        <el-input v-model="queryParams.minStock" placeholder="最小值" @change="pageParams.pageNum = 1;handleQuery()" clearable @keyup.enter.native="pageParams.pageNum = 1;handleQuery()" />
+      </el-form-item>
+      <el-form-item label="-" label-width="6px">
+        <el-input v-model="queryParams.maxStock" placeholder="最大值" @change="pageParams.pageNum = 1;handleQuery()" clearable @keyup.enter.native="pageParams.pageNum = 1;handleQuery()" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="pageParams.pageNum = 1;handleQuery()">搜索
+        </el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置
+        </el-button>
+      </el-form-item>
+    </el-form>
+    <!-- 导出、刷新 -->
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <!-- 列表 -->
+    <el-table ref="table" v-loading="loading" :data="list">
+      <!-- 展开盲票组列表 -->
+      <el-table-column type="expand">
+        <template slot-scope="{ row }">
+          <el-table :data="row.items" row-key="itemId">
+            <el-table-column label="商品图片" min-width="80">
+              <div slot-scope="{ row }">
+                <el-image style="width: 100px; height: 100px" :src="row.picUrl" :preview-src-list="[row.picUrl]" />
+              </div>
+            </el-table-column>
+            <el-table-column label="商品名称" prop="title" min-width="80" />
+            <el-table-column label="规格" min-width="100">
+              <template slot-scope="{ row }">
+                <div>{{ row.properties || "--" }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column label="采购成本(元)" prop="purchaseCost" min-width="80" >
+              <template slot-scope="{ row }">
+                <div>{{ $numberFormat(row.purchaseCost) }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column label="库存" prop="quantity" min-width="80" />
+            <el-table-column label="已核销" prop="verifyQty" min-width="80" />
+            <el-table-column label="剩余库存" prop="remainQty" min-width="80" />
+          </el-table>
+        </template>
+      </el-table-column>
+      <!-- 不展开列表 -->
+      <el-table-column label="订单号" prop="orderId" min-width="80" />
+      <el-table-column label="下单时间" min-width="100">
+        <template slot-scope="{ row }">
+          <div>{{ parseTime(row.createdTime) }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="门店" prop="channelName" min-width="80" />
+      <el-table-column label="总库存" prop="totalQuantity" min-width="80" />
+      <el-table-column label="总已核销" prop="totalVerifyQty" min-width="80" />
+      <el-table-column label="剩余总库存" prop="totalRemainQty" min-width="80" />
+      <el-table-column label="总采购成本(元)" min-width="85">
+        <template slot-scope="{ row }">
+          <div>{{ $numberFormat(row.totalPurchaseCost) }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="结算库存" prop="totalSettleQty" min-width="80" />
+
+      <el-table-column label="收货手机号" prop="tel" min-width="120" />
+      
+      <el-table-column label="订单状态" align="center">
+        <template slot-scope="{ row }">
+          <div>
+            <el-tag :type="row.status.value == 1? 'success' : 'info'" v-if="row.status">{{
+                row.status.desc
+              }}
+            </el-tag>
+            <el-tag type="info" v-else>--</el-tag>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="80">
+        <template slot-scope="{ row }">
+          <div>
+            <el-button v-hasPermi="['order:store:query']" type="text" @click="getDetail(row)">查看详情
+            </el-button>
+            <el-button v-hasPermi="['order:store:ship']" v-if="row.status && row.status.value == 1" type="text" @click="toInventory(row)">去结算
+            </el-button>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-dialog title="提示" :visible.sync="dialogVisible" width="60%" :before-close="handleClose">
+      <div v-html="responseData"></div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 分页 -->
+    <pagination v-show="total > 0" :total="total" :page.sync="pageParams.pageNum" :limit.sync="pageParams.pageSize" @pagination="getList" />
+
+    <!-- 结算 -->
+    <inventory-goods :inventory-show="inventoryShow" :inventory-info="info" @close="close" v-if="inventoryShow"/>
+  </div>
+</template>
+<script>
+import { getInventoryList } from "@/api/business/inventory";
+import { listAllSaleSite } from "@/api/admin/salesite";
+import { publicFileGetUrl } from "@/api/common";
+import InventoryGoods from "./components/InventoryGoods";
+export default {
+  name: "Inventory",
+  components: {
+    InventoryGoods,
+  },
+  data() {
+    return {
+      loading: false,
+      showSearch: true,
+      dialogVisible: false,
+      // 筛选
+      queryParams: {
+        minStock: "",
+        maxStock: "",
+        channelId: "",
+        title: "",
+        orderId: "",
+        startTime: "",
+        endTime: "",
+        settleStatus: "",
+        tel: "",
+      },
+      // 分页
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 总条数
+      total: 0,
+      list: [],
+      // 门店
+      merchantArr: [],
+      // 下单时间
+      tradeTimeArr: [],
+      // 结算弹窗显示
+      inventoryShow: false,
+      // 订单详情
+      info: {},
+      fileSaveUrl: '',
+      reqData: {},
+      responseData: '',
+      siteList: [],
+      siteCopyList: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getSaleSiteList()
+  },
+  methods: {
+    // 获取门店下拉列表
+    getSaleSiteList() {
+      listAllSaleSite({}).then(response => {
+        this.siteList = response.data || [];
+        this.siteCopyList = response.data || [];
+      });
+    },
+    dataFilter(val) {
+      if (val) { //val存在
+        this.siteList = this.siteCopyList.filter((item) => {
+          if (!!~item.mobile.indexOf(val) || !!~item.mobile.toUpperCase().indexOf(val.toUpperCase())
+            || !!~item.name.indexOf(val) || !!~item.name.indexOf(val)) {
+            return true
+          }
+        })
+      } else { //val为空时,还原数组
+        this.siteList = this.siteCopyList;
+      }
+    },
+    handleClose(done) {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+          done();
+        })
+        .catch(_ => {
+        });
+    },
+    // 订单列表
+    getList() {
+      let data = {
+        ...this.queryParams,
+      }
+      this.loading = true;
+      getInventoryList(
+        "pageNum=" +
+        this.pageParams.pageNum +
+        "&pageSize=" +
+        this.pageParams.pageSize +
+        "&",
+        data
+      )
+        .then((res) => {
+          this.loading = false;
+          if (res.code == 0) {
+            res.rows.forEach((item) => {
+              let items = item.items;
+              items.forEach((item) => {
+                let picUrlArr = item.picUrl.split(",");
+                item.picUrl = publicFileGetUrl + picUrlArr[0];
+              });
+              item.status = JSON.parse(item.status);
+            });
+            this.total = res.total;
+            this.list = res.rows;
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+
+    //搜索
+    handleQuery() {
+      this.siteList = this.siteCopyList;
+      this.pageParams.pageNum = 1;
+      this.getList();
+    },
+
+    // 重置
+    resetQuery() {
+      this.queryParams = {
+        minStock: "",
+        maxStock: "",
+        channelId: "",
+        title: "",
+        orderId: "",
+        startTime: "",
+        endTime: "",
+        settleStatus: "",
+        tel: "",
+      };
+      this.tradeTimeArr = [];
+      this.getList();
+    },
+
+    // 选择下单时间
+    tardeTime(e) {
+      if (e) {
+        this.queryParams.startTime = e[0];
+        this.queryParams.endTime = e[1];
+        this.pageParams.pageNum = 1
+        this.handleQuery();
+      } else {
+        this.queryParams.startTime = "";
+        this.queryParams.endTime = "";
+        this.pageParams.pageNum = 1
+        this.handleQuery();
+      }
+    },
+
+    // 查看详情
+    getDetail(row) {
+      this.$router.push({ name: "InventoryDetail", query: { id: row.orderId } });
+    },
+
+    // 点击去结算
+    toInventory(row) {
+      this.info = row;
+      this.inventoryShow = true;
+    },
+
+    // 关闭结算
+    close() {
+      this.inventoryShow = false;
+      this.getList();
+    },
+
+  },
+};
+</script>
+<style lang="scss" scoped>
+::v-deep .el-tabs--border-card > .el-tabs__content {
+  padding: 0;
+}
+</style>
+<style  lang="scss">
+.msgbox {
+  width: 60%;
+}
+</style>

+ 14 - 0
src/views/business/marketing/components/GoodsAdd.vue

@@ -67,6 +67,20 @@
             <div>¥{{ $numberFormat(scope.row.value) }}</div>
           </template>
         </el-table-column>
+        <el-table-column label="商品类型" prop="type" min-width="85">
+          <template slot-scope="scope">
+            <div v-if="scope.row.type == 1">实物商品</div>
+            <div v-else-if="scope.row.type == 2">卡密商品</div>
+            <div v-else-if="scope.row.type == 3">采购商品</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="是否支持兑换" prop="exchangeShow" min-width="85">
+          <template slot-scope="scope">
+            <div v-if="scope.row.exchangeShow == 1">支持兑换</div>
+            <div v-else-if="scope.row.exchangeShow == 0">不支持兑换</div>
+            <div v-else-if="scope.row.exchangeShow == 2">盲票商品</div>
+          </template>
+        </el-table-column>
         <el-table-column label="商品库存" prop="quantity" width="80" />
       </el-table>
       <pagination

+ 7 - 1
src/views/business/ticket/components/GoodsAdd.vue

@@ -91,7 +91,13 @@
             <div>¥{{ $numberFormat(scope.row.cost) }}</div>
           </template>
         </el-table-column>
-
+        <el-table-column label="商品类型" prop="type" min-width="85">
+          <template slot-scope="scope">
+            <div v-if="scope.row.type == 1">实物商品</div>
+            <div v-else-if="scope.row.type == 2">卡密商品</div>
+            <div v-else-if="scope.row.type == 3">采购商品</div>
+          </template>
+        </el-table-column>
         <el-table-column label="是否支持兑换" prop="exchangeShow" min-width="85">
           <template slot-scope="scope">
             <div v-if="scope.row.exchangeShow == 1">支持兑换</div>

+ 180 - 0
src/views/order/store/components/ExpressEdit.vue

@@ -0,0 +1,180 @@
+<template>
+  <div>
+    <el-dialog
+      title="修改快递信息"
+      :visible.sync="editShow"
+      width="500px"
+      :before-close="close"
+    >
+      <el-form
+        :model="shipForm"
+        ref="shipForm"
+        :rules="rules"
+        label-width="100px"
+      >
+        <el-form-item label="配送方式:" prop="deliveryId">
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="1">快递发货</el-radio>
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="2">无需物流</el-radio>
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1" label="快递单号:" prop="deliveryFlowId">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            @blur="InputBlur()"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1" label="快递公司:" prop="deliveryId">
+          <el-select
+            v-model="shipForm.deliveryId"
+            placeholder="请选择快递公司"
+            clearable
+            size="small"
+            style="width: 300px"
+          >
+            <el-option
+              v-for="item in companyData"
+              :key="item.areaId"
+              :label="item.companyName"
+              :value="item.deliveryId"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <!-- 按钮 -->
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" :disabled="loading" @click="saveClick"
+          >确 定</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import CustomFieldsMixin from "@/mixins/CustomFields";
+import { companyList, deliverOrderShipUpdate, automaticRecognition} from "@/api/business/order";
+export default {
+  mixins: [CustomFieldsMixin],
+  props: {
+    // 发货弹框显示
+    editShow: {
+      type: Boolean,
+      default: false,
+    },
+    // 订单详情
+    goodsInfo: {
+      type: Object,
+      default: {},
+    },
+    // 订单ID
+    orderId: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      loading: false,
+      shipForm: {
+        deliveryId: "",
+        deliveryFlowId: "",
+        deliveryType: "1",//配送方式
+      },
+      // 快递下拉列表
+      companyData: [],
+      rules: {
+        deliveryId: [
+          { required: false, message: "请选择快递公司", trigger: "change" },
+        ],
+        deliveryFlowId: [
+          { required: false, message: "请输入快递单号", trigger: "blur" },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getCompanyList();
+    this.getFormData()
+  },
+  methods: {
+    getFormData(){
+      this.shipForm.deliveryId = this.goodsInfo.deliveryId
+      this.shipForm.deliveryFlowId = this.goodsInfo.deliveryFlowId
+      this.shipForm.deliveryType = this.goodsInfo.deliveryFlowId?"1":"2"
+    },
+
+    // 关闭发货弹框
+    close() {
+      this.$emit("close");
+      this.loading = false;
+      this.$refs["shipForm"].resetFields();
+    },
+
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+      }
+    },
+
+    // 快递下拉列表
+    getCompanyList() {
+      companyList({}).then((res) => {
+        this.companyData = res.data;
+      });
+    },
+
+    //快递单号失去焦点时
+    InputBlur(){
+      if (this.shipForm.deliveryFlowId){
+        automaticRecognition(this.shipForm.deliveryFlowId).then((res)=>{
+          if (res.code == 0 && res.data){
+            this.shipForm.deliveryId = res.data.deliveryId
+          }
+        })
+      }
+    },
+
+    // 确认
+    saveClick() {
+      this.loading = true;
+      const subForm = this.$refs["shipForm"];
+      subForm.validate((valid) => {
+        if (valid) {
+          this.submitForm(this.shipForm);
+        } else {
+          this.loading = false;
+          // 提示第一个error
+          this.getFormErrorMessage(subForm);
+          return false;
+        }
+      });
+    },
+
+    // 提交
+    submitForm(form) {
+      let data = {
+        ...form,
+        orderId: this.orderId,
+        itemIds: this.goodsInfo.items.map( item => item.itemId)
+      };
+      deliverOrderShipUpdate(data)
+        .then((res) => {
+          if (res.code == 0) {
+            this.msgSuccess("修改成功");
+            this.close();
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+  },
+};
+</script>
+<style scoped>
+</style>

+ 241 - 0
src/views/order/store/components/SendGoods.vue

@@ -0,0 +1,241 @@
+<template>
+  <div>
+    <el-dialog
+      title="订单发货"
+      :visible.sync="sendShow"
+      width="1000px"
+      :before-close="close"
+    >
+      <el-form
+        :model="shipForm"
+        ref="shipForm"
+        :rules="rules"
+        label-width="100px"
+      >
+        <el-form-item label="订单号:">
+          <span>{{ goodsInfo.orderId }}</span>
+        </el-form-item>
+        <el-form-item label="收货地址:">
+          <span>{{
+            `${goodsInfo.receiver},${goodsInfo.tel},${goodsInfo.province}${goodsInfo.city}${goodsInfo.area}${goodsInfo.address}`
+          }}</span>
+        </el-form-item>
+        <el-form-item label="配送方式:">
+          <!--单选框-->
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="1">快递发货</el-radio>
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="2">无需物流</el-radio>
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1" label="快递单号:" prop="deliveryFlowId">
+          <el-input
+            @blur="InputBlur()"
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1" label="快递公司:" prop="deliveryId">
+          <el-select
+            v-model="shipForm.deliveryId"
+            placeholder="请选择快递公司"
+            clearable
+            size="small"
+            style="width: 300px"
+          >
+            <el-option
+              v-for="item in companyData"
+              :key="item.areaId"
+              :label="item.companyName"
+              :value="item.deliveryId"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <!-- 商品 -->
+      <el-table
+        ref="table"
+        :data="goodsInfo.items"
+        @selection-change="handleSelectionGoods"
+        class="ticket-table"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+          fixed="left"
+        />
+        <el-table-column label="商品名称" prop="title" />
+        <el-table-column label="规格">
+          <template slot-scope="{ row }">
+            <div>{{ row.properties || "--" }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="数量">
+          <template slot-scope="{ row }">
+            <div>{{ row.goodsNum }}件</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="快递公司">
+          <template slot-scope="{ row }">
+            <div>{{ row.companyName || "--" }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="快递单号">
+          <template slot-scope="{ row }">
+            <div>{{ row.deliveryFlowId || "--" }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="发货状态">
+          <template slot-scope="{ row }">
+            <div>{{ row.deliveryTime ? "已发货" : "未发货" }}</div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" :disabled="loading" @click="saveClick"
+          >确 定</el-button
+        >
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import CustomFieldsMixin from "@/mixins/CustomFields";
+import { companyList, storeOrderShip, automaticRecognition} from "@/api/business/order";
+export default {
+  mixins: [CustomFieldsMixin],
+  props: {
+    // 弹框显示
+    sendShow: {
+      type: Boolean,
+      default: false,
+    },
+    // 订单详情
+    goodsInfo: {
+      type: Object,
+      default: {},
+    },
+  },
+  created() {
+    this.getCompanyList();
+  },
+  data() {
+    return {
+      loading: false,
+      shipForm: {
+        deliveryId: "",
+        deliveryFlowId: "",
+        deliveryType: "1",
+      },
+      // 快递下拉列表
+      companyData: [],
+      // 选中sp
+      goodsList: [],
+      // 选中商品ID
+      ids: [],
+      rules: {
+        deliveryId: [
+          { required: true, message: "请选择快递公司", trigger: "change" },
+        ],
+        deliveryFlowId: [
+          { required: true, message: "请输入快递单号", trigger: "blur" },
+        ],
+      },
+    };
+  },
+  methods: {
+    // 关闭发货弹框
+    close() {
+      this.shipForm.deliveryType = "1";
+      this.$emit("close");
+      this.loading = false;
+      this.ids = [];
+      this.$refs["shipForm"].resetFields();
+    },
+
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+      }
+    },
+
+    // 快递下拉列表
+    getCompanyList() {
+      companyList({}).then((res) => {
+        this.companyData = res.data;
+      });
+    },
+
+    //快递单号失去焦点时
+    InputBlur(){
+      if (this.shipForm.deliveryFlowId){
+        automaticRecognition(this.shipForm.deliveryFlowId).then((res)=>{
+          if (res.code == 0 && res.data){
+            this.shipForm.deliveryId = res.data.deliveryId
+          }
+        })
+      }
+    },
+
+    // 选中商品
+    handleSelectionGoods(e) {
+      this.goodsList = e
+    },
+
+    // 确认
+    saveClick() {
+      this.loading = true;
+      const subForm = this.$refs["shipForm"];
+      subForm.validate((valid) => {
+        if (valid) {
+          this.submitForm(this.shipForm);
+        } else {
+          this.loading = false;
+          // 提示第一个error
+          this.getFormErrorMessage(subForm);
+          return false;
+        }
+      });
+    },
+
+    // 提交
+    submitForm(form) {
+      if (!this.goodsList.length) {
+        this.msgError("请选择发货的商品");
+        this.loading = false;
+        return;
+      }
+      let index = this.goodsList.findIndex(item=>{
+        return item.deliveryTime
+      })
+      if(index != -1){
+        this.msgError(`${ this.goodsList[index].title }已发货!`);
+        this.loading = false;
+        return
+      }
+      this.ids = this.goodsList.map((item) => item.itemId);
+      let data = {
+        ...form,
+        orderId: this.goodsInfo.orderId,
+        itemIds: this.ids,
+      };
+      storeOrderShip(data)
+        .then((res) => {
+          if (res.code == 0) {
+            this.msgSuccess("发货成功");
+            this.close();
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+  },
+};
+</script>
+<style>
+</style>

+ 366 - 0
src/views/order/store/detail.vue

@@ -0,0 +1,366 @@
+<template>
+  <div class="app-container">
+    <!-- 订单信息 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+        <div class="info-title">订单信息</div>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">订单编号:{{ info.orderId }}</div>
+        </el-col>
+        <el-col :span="7" :xs="{span: 24, offset: 0}">
+          <div class="title">订单类型:门店采购订单</div>
+        </el-col>
+        <el-col :span="8" :xs="{span: 24, offset: 0}">
+          <div class="title">下单时间:{{ parseTime(info.createdTime) }}</div>
+        </el-col>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">付款方式:{{ info.payType == 1 || info.payType == 10 ? '支付宝支付': info.payType == 2 ? '微信支付': '--' }}</div>
+        </el-col>
+      </el-col>
+    </el-row>
+
+    <!-- 买家信息 -->
+    <el-row :gutter="10" >
+      <el-col :span="22" :offset="1">
+        <div class="info-title">买家信息</div>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">门店名称:{{ info.channelName || "--" }}</div>
+        </el-col>
+        <el-col :span="7" :xs="{span: 24, offset: 0}">
+          <div class="title">收货人:{{ info.receiver || "--" }}</div>
+        </el-col>
+        <el-col :span="8" :xs="{span: 24, offset: 0}">
+          <div class="title">联系电话:{{ info.tel || "--" }}</div>
+        </el-col>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">收货地址:{{
+              `${info.province || "--"}${info.city || "--"}${
+                info.area || "--"
+              }${info.address || "--"}`
+            }}</div>
+        </el-col>
+      </el-col>
+    </el-row>
+
+    <!-- 买家留言 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+        <div class="info-title">备注信息</div>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">买家留言:{{ info.memo || "--" }}</div>
+        </el-col>
+      </el-col>
+    </el-row>
+
+    <!-- 订单状态 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+        <div class="info-title">订单状态</div>
+        <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
+          <div class="title">订单状态:{{ status.value == 2 ? "已发货" : (status.desc || "--") }}</div>
+        </el-col>
+        <el-button
+          v-if="status.value === 1 || status.value === 4"
+          v-hasPermi="['business:ticket:on']"
+          type="primary"
+          @click="toGoods()"
+        >发货</el-button
+        >
+      </el-col>
+    </el-row>
+
+    <!-- 物流信息 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+        <div class="info" v-if="status.value === 2 || status.value === 3 || status.value === 4">
+      <div class="info-title">物流信息</div>
+      <el-col :span="24" :offset="1">
+        <div
+          class="info-item-logistics"
+          v-for="(item, index) in deliverList"
+          :key="index"
+        >
+          <div class="logistics-title">包裹{{ index + 1 }}</div>
+          <div class="info">
+            <el-col :span="5" :xs="{span: 24, offset: 0}">
+              <div class="tit">配送方式:{{ item.companyName || item.deliveryFlowId ? "快递发货":"无需物流" }}</div>
+            </el-col>
+            <el-col :span="5" :xs="{span: 24, offset: 0}">
+              <div class="tit" v-if="item.companyName">快递公司:{{ item.companyName || "--" }}</div>
+              <div class="tit" v-else></div>
+            </el-col>
+            <el-col :span="5" :xs="{span: 24, offset: 0}">
+              <div class="tit" v-if="item.deliveryFlowId">快递单号:{{ item.deliveryFlowId || "--" }}</div>
+              <div class="tit" v-else></div>
+            </el-col>
+            <el-col :span="7" :xs="{span: 24, offset: 0}">
+              <div class="tit">发货时间:{{ parseTime(item.deliveryTime) || "--" }}</div>
+            </el-col>
+            <el-col :span="2" :xs="{span: 24, offset: 0}">
+              <div class="edit-express" @click="editExpress(item)" v-if="status.value === 2 || status.value === 4">修改</div>
+            </el-col>
+          </div>
+          <div class="goods">
+            <div class="goods-item" v-for="(ele, ins) in item.items" :key="ins">
+              <img :src="ele.picUrl" alt="" />
+              <div class="info">
+                <div>{{ ele.title || "--" }}</div>
+                <div>{{ ele.properties || "--" }}</div>
+                <div>{{ ele.goodsNum }}件</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-col>
+
+      </div>
+      </el-col>
+    </el-row>
+
+        <!-- 商品信息 -->
+    <el-row :gutter="10">
+      <el-col :span="22" :offset="1">
+         <div class="info">
+      <div class="info-title">商品信息</div>
+      <div class="info-table">
+        <el-table :data="list">
+          <el-table-column label="商品信息" min-width="200">
+            <div slot-scope="{ row }" class="flex">
+              <el-image
+                style="width: 100px; height: 100px"
+                :src="row.picUrl"
+                :preview-src-list="[row.picUrl]"
+              />
+              <div class="txt">{{ row.title }}</div>
+            </div>
+          </el-table-column>
+          <el-table-column label="规格" min-width="100">
+            <template slot-scope="{ row }">
+              <div>{{ row.properties || "--" }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="数量" prop="orderNum">
+            <template slot-scope="{ row }">
+              <div>{{ row.goodsNum }}件</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="状态">
+            <template slot-scope="{ row }">
+              <div>{{ row.deliveryTime ? "已发货" : "未发货" }}</div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!-- 按钮 -->
+      <div class="info-amt">
+        <div class="info-amt-price">
+          <span>运费:</span>{{ $numberFormat(info.freightAmt) }}元
+        </div>
+        <div class="info-amt-price">
+          <span>共计金额:</span>{{ $numberFormat(info.payAmt) }}元
+        </div>
+      </div>
+    </div>
+      </el-col>
+    </el-row>
+    <!-- 发货 -->
+    <send-goods :send-show="goodsShow" :goods-info="info" @close="close" />
+
+    <!-- 修改快递信息 -->
+    <express-edit
+      v-if="editShow"
+      :edit-show="editShow"
+      :goods-info="expressInfo"
+      :order-id="info.orderId"
+      @close="close"
+    />
+  </div>
+</template>
+<script>
+import { storeDetail } from "@/api/business/order";
+import { publicFileGetUrl } from "@/api/common";
+import SendGoods from "./components/SendGoods";
+import ExpressEdit from "./components/ExpressEdit";
+export default {
+  name: "StoreDetail",
+  components: {
+    SendGoods,
+    ExpressEdit,
+  },
+  data() {
+    return {
+      // 订单ID
+      orderId: "",
+      // 订单详情
+      info: {},
+      // 订单状态
+      status: {},
+      // 商品信息列表
+      list: [],
+      // 物流信息性别
+      deliverList: [],
+      // 发货显示
+      goodsShow: false,
+      // 修改快递信息弹框
+      editShow: false,
+      // 快递信息
+      expressInfo: {}
+    };
+  },
+  created() {
+    this.orderId = this.$route.query.id;
+    this.getDetail();
+  },
+  activated() {
+    const orderId = this.$route.query.id;
+    if (orderId != null && orderId != this.orderId) {
+      this.orderId = orderId;
+      this.getDetail();
+    }
+  },
+  methods: {
+    // 订单详情
+    getDetail() {
+      storeDetail({ orderId: this.orderId }).then((res) => {
+        if (res.code == 0) {
+          this.info = res.data;
+          this.status = JSON.parse(res.data.status);
+          res.data.deliverList &&
+            res.data.deliverList.forEach((item) => {
+              item.channelGoodsOrderItem.forEach((ele) => {
+                let picUrlArr = ele.picUrl.split(",");
+                ele.picUrl = publicFileGetUrl + picUrlArr[0];
+              });
+            });
+          this.deliverList = res.data.deliverList;
+          res.data.channelGoodsOrderItem &&
+            res.data.channelGoodsOrderItem.forEach((item) => {
+              let picUrlArr = item.picUrl.split(",");
+              item.picUrl = publicFileGetUrl + picUrlArr[0];
+            });
+          this.list = res.data.channelGoodsOrderItem;
+        }
+      });
+    },
+
+    // 点击发货
+    toGoods() {
+      this.goodsShow = true;
+    },
+
+    // 发货关闭
+    close() {
+      this.goodsShow = false;
+      this.editShow = false;
+      this.getDetail();
+    },
+
+    // 修改快递信息
+    editExpress(item) {
+      this.expressInfo = item
+      this.editShow = true;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.title {
+  line-height: 30px;
+  text-align: left;
+}
+.edit-express {
+  color: #409eff;
+  cursor: pointer;
+}
+
+.info {
+  margin-bottom: 10px;
+  &-title {
+    font-size: 14px;
+    margin-bottom: 20px;
+    font-weight: bold;
+  }
+  &-item {
+    padding-left: 50px;
+    &-content {
+      display: flex;
+
+      &-one {
+        display: flex;
+        margin-bottom: 10px;
+
+        .title {
+          //width: 100px;
+        }
+
+        .txt {
+          //width: 200px;
+        }
+      }
+    }
+
+    &-logistics {
+      margin-bottom: 20px;
+      .logistics-title {
+        text-align: left;
+        font-weight: bold;
+        margin-bottom: 20px;
+      }
+      .info {
+        display: flex;
+        margin-bottom: 10px;
+        &-one {
+          display: flex;
+        }
+        .tit {
+          line-height: 22px;
+          //width: 100px;
+        }
+        .txt {
+          line-height: 22px;
+          //width: 200px;
+        }
+        .edit-express{
+          color: #409eff;
+          cursor: pointer;
+        }
+      }
+      .goods {
+        margin: 10px 0;
+        &-item {
+          display: flex;
+          border-bottom: 1px solid #f3eeee;
+          img {
+            width: 100px;
+            height: 100px;
+          }
+          .info {
+            padding-left: 20px;
+            display: flex;
+            flex-direction: column;
+            height: 100px;
+            justify-content: space-between;
+          }
+        }
+      }
+    }
+  }
+  &-amt {
+    margin-top: 10px;
+    &-price {
+      span {
+        display: inline-block;
+        width: 80px;
+        margin-bottom: 20px;
+      }
+    }
+  }
+}
+.flex {
+  display: flex;
+  align-items: center;
+  .txt {
+    margin-left: 20px;
+  }
+}
+</style>

+ 460 - 0
src/views/order/store/index.vue

@@ -0,0 +1,460 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="90px"
+    >
+      <el-form-item label="门店" prop="channelId">
+        <el-select
+          v-model="queryParams.channelId"
+          placeholder="请选择门店"
+          style="width: 100%;"
+          filterable
+          clearable
+          :filter-method="dataFilter"
+          @change="pageParams.pageNum = 1;handleQuery()"
+        >
+          <el-option
+            v-for="(item) in siteList"
+            :key="item.channelId"
+            :label="item.name"
+            :value="item.channelId">
+            <div>
+              <span style="float: left;">{{item.name}} </span>
+              <span style="float: right;">{{item.mobile}}</span>
+            </div>
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="商品名称">
+        <el-input
+          v-model="queryParams.title"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @change="pageParams.pageNum = 1;handleQuery()"
+        />
+      </el-form-item>
+      <el-form-item label="订单号">
+        <el-input
+          v-model="queryParams.orderId"
+          placeholder="输入订单编号"
+          clearable
+          size="small"
+          style="width: 240px"
+          @change="pageParams.pageNum = 1;handleQuery()"
+        />
+      </el-form-item>
+      <el-form-item label="下单时间">
+        <el-date-picker
+          v-model="tradeTimeArr"
+          type="datetimerange"
+          size="small"
+          value-format="timestamp"
+          range-separator="至"
+          start-placeholder="时间选择"
+          end-placeholder="时间选择"
+          @change="tardeTime"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="收货人手机">
+        <el-input
+          v-model="queryParams.tel"
+          placeholder="输入手机号"
+          clearable
+          size="small"
+          style="width: 240px"
+          @change="pageParams.pageNum = 1;handleQuery()"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="pageParams.pageNum = 1;handleQuery()"
+        >搜索
+        </el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+        >重置
+        </el-button
+        >
+      </el-form-item>
+    </el-form>
+    <!-- 导出、刷新 -->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="infor"
+          plain
+          icon="el-icon-download"
+          size="small"
+          @click="handleExportDraw"
+          v-hasPermi="['order:store:export']"
+        >导出订单
+        </el-button
+        >
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+    <!-- 订单状态 -->
+    <el-tabs type="card" v-model="state" @tab-click="handleClick">
+      <el-tab-pane label="全部订单" name="no"></el-tab-pane>
+      <el-tab-pane label="待付款" name="0"></el-tab-pane>
+      <el-tab-pane label="待发货" name="1"></el-tab-pane>
+      <el-tab-pane label="已发货" name="2"></el-tab-pane>
+      <!-- <el-tab-pane label="部分发货" name="4"></el-tab-pane> -->
+      <el-tab-pane label="已完成" name="3"></el-tab-pane>
+      <el-tab-pane label="已取消" name="-1"></el-tab-pane>
+    </el-tabs>
+    <!-- 列表 -->
+    <el-table ref="table" v-loading="loading" :data="list">
+      <!-- 展开盲票组列表 -->
+      <el-table-column type="expand">
+        <template slot-scope="{ row }">
+          <el-table :data="row.items" row-key="itemId">
+            <el-table-column label="商品图片" min-width="80">
+              <div slot-scope="{ row }">
+                <el-image
+                  style="width: 100px; height: 100px"
+                  :src="row.picUrl"
+                  :preview-src-list="[row.picUrl]"
+                />
+              </div>
+            </el-table-column>
+            <el-table-column label="商品名称" prop="title" min-width="80"/>
+            <el-table-column label="规格" min-width="100">
+              <template slot-scope="{ row }">
+                <div>{{ row.properties || "--" }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column label="数量" prop="orderNum" min-width="85">
+              <template slot-scope="{ row }">
+                <div>{{ row.goodsNum }}件</div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+      </el-table-column>
+      <!-- 不展开列表 -->
+      <el-table-column label="订单号" prop="orderId" min-width="80"/>
+      <el-table-column label="下单时间" min-width="100">
+        <template slot-scope="{ row }">
+          <div>
+            {{ parseTime(row.createdTime) }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="数量" prop="pkgNum" min-width="85">
+        <template slot-scope="{ row }">
+          <div>{{ row.orderNum }}件</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="实付金额(元)" min-width="85">
+        <template slot-scope="{ row }">
+          <div>{{ $numberFormat(row.payAmt) }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="门店" prop="channelName" min-width="80"/>
+      <el-table-column label="收货人/收货地址" prop="addr" min-width="120">
+        <template slot-scope="{ row }">
+          <div>
+            {{
+              `${row.receiver},${row.tel},${row.province}${row.city}${row.area}${row.address}`
+            }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="订单状态" align="center">
+        <template slot-scope="{ row }">
+          <div>
+            <el-tag :type="row.status.value === 1 ? 'success' : 'info'" v-if="row.status.value !== 2">{{
+                row.status.desc
+              }}
+            </el-tag>
+            <el-tag type="info" v-else>已发货</el-tag>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="80">
+        <template slot-scope="{ row }">
+          <div>
+            <el-button
+              v-hasPermi="['order:store:query']"
+              type="text"
+              @click="getDetail(row)"
+            >查看详情
+            </el-button
+            >
+            <el-button
+              v-if="row.status.value === 1 || row.status.value === 4"
+              v-hasPermi="['order:store:ship']"
+              type="text"
+              @click="toGoods(row)"
+            >发货
+            </el-button
+            >
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-dialog
+      title="提示"
+      :visible.sync="dialogVisible"
+      width="60%"
+      :before-close="handleClose">
+      <div v-html="responseData"></div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 分页 -->
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="pageParams.pageNum"
+      :limit.sync="pageParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 发货 -->
+    <send-goods :send-show="goodsShow" :goods-info="goodsInfo" @close="close"/>
+  </div>
+</template>
+<script>
+import {
+  getStoreList,
+  storeOrderExport,
+} from "@/api/business/order";
+import { listAllSaleSite} from "@/api/admin/salesite";
+import {publicFileGetUrl} from "@/api/common";
+import SendGoods from "./components/SendGoods";
+export default {
+  name: "Store",
+  components: {
+    SendGoods,
+  },
+  data() {
+    return {
+      loading: false,
+      showSearch: true,
+      dialogVisible: false,
+      // 筛选
+      queryParams: {
+        channelId: "",
+        title: "",
+        orderId: "",
+        startTime: "",
+        endTime: "",
+        status: "",
+        tel: "",
+      },
+      // 分页
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 总条数
+      total: 0,
+      list: [],
+      // 门店
+      merchantArr: [],
+      // 下单时间
+      tradeTimeArr: [],
+      // 订单列表状态
+      state: "no",
+      // 发货显示
+      goodsShow: false,
+      // 订单详情
+      goodsInfo: {},
+      fileSaveUrl: '',
+      reqData: {},
+      responseData:'',
+      siteList:[],
+      siteCopyList: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getSupplierItems()
+    this.getSaleSiteList()
+  },
+  methods: {
+     // 获取门店下拉列表
+     getSaleSiteList(){
+      listAllSaleSite({}).then(response => {
+         this.siteList = response.data || [];
+         this.siteCopyList = response.data || [];
+      });
+    },
+    dataFilter(val) {
+      if (val) { //val存在
+        this.siteList = this.siteCopyList.filter((item) => {
+          if (!!~item.mobile.indexOf(val) || !!~item.mobile.toUpperCase().indexOf(val.toUpperCase())
+                 || !!~item.name.indexOf(val) || !!~item.name.indexOf(val)) {
+             return true
+          }
+        })
+      } else { //val为空时,还原数组
+        this.siteList = this.siteCopyList;
+      }
+    },
+    handleClose(done) {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+          done();
+        })
+        .catch(_ => {
+        });
+    },
+      // 订单列表
+    getList() {
+      let data = {
+        ...this.queryParams,
+      }
+      this.loading = true;
+      getStoreList(
+        "pageNum=" +
+        this.pageParams.pageNum +
+        "&pageSize=" +
+        this.pageParams.pageSize +
+        "&",
+        data
+      )
+        .then((res) => {
+          this.loading = false;
+          if (res.code == 0) {
+            res.rows.forEach((item) => {
+              let items = item.items;
+              items.forEach((item) => {
+                let picUrlArr = item.picUrl.split(",");
+                item.picUrl = publicFileGetUrl + picUrlArr[0];
+              });
+              item.status = JSON.parse(item.status);
+            });
+            this.total = res.total;
+            this.list = res.rows;
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+
+    //搜索
+    handleQuery() {
+      this.siteList = this.siteCopyList;
+      this.pageParams.pageNum = 1;
+      this.getList();
+    },
+
+    // 重置
+    resetQuery() {
+      this.queryParams = {
+        channelId: "",
+        title: "",
+        orderId: "",
+        startTime: "",
+        endTime: "",
+        status: "",
+        tel: "",
+      };
+      this.state = "no"
+      this.tradeTimeArr = [];
+      this.getList();
+    },
+
+    // 选择下单时间
+    tardeTime(e) {
+      if (e) {
+        this.queryParams.startTime = e[0];
+        this.queryParams.endTime = e[1];
+        this.pageParams.pageNum = 1
+        this.handleQuery();
+      } else {
+        this.queryParams.startTime = "";
+        this.queryParams.endTime = "";
+        this.pageParams.pageNum = 1
+        this.handleQuery();
+      }
+    },
+
+    // 订单切换
+    handleClick(e) {
+      if (e.name == "no") {
+        this.queryParams.status = "";
+      } else {
+        this.queryParams.status = Number(e.name);
+      }
+      this.getList();
+    },
+
+    // 查看详情
+    getDetail(row) {
+      this.$router.push({name: "StoreDetail", query: {id: row.orderId}});
+    },
+
+    // 点击发货
+    toGoods(row) {
+      this.goodsShow = true;
+      this.goodsInfo = row;
+    },
+
+    // 关闭发货
+    close() {
+      this.goodsShow = false;
+      this.getList();
+    },
+   
+    // 导出订单
+    handleExportDraw() {
+      let data = {
+        ...this.queryParams,
+      }
+      this.$confirm("是否确认导出订单?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.vloading = this.$loading({
+            lock: true,
+            text: "正在导出订单.....",
+            background: "rgba(0, 0, 0, 0.7)",
+          });
+          return storeOrderExport(data);
+        })
+        .then((response) => {
+          this.vloading.close();
+          this.download(response.msg);
+        })
+        .catch(() => {
+          this.vloading.close();
+        });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+::v-deep .el-tabs--border-card > .el-tabs__content {
+  padding: 0;
+}
+
+</style>
+<style  lang="scss">
+.msgbox {
+  width: 60%;
+}
+</style>