Quellcode durchsuchen

新增订单管理

hwb0 vor 3 Jahren
Ursprung
Commit
dda09f6d0b

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

@@ -0,0 +1,49 @@
+import request from '@/utils/request'
+
+// 经销商订单
+export function getOrderList(urlParams, data) {
+    return request({
+        url: '/api/v1/mp/admin/channel/order/list',
+        method: 'post',
+        data,
+        urlParams
+    })
+}
+
+// 快递下拉
+export function companyList(data) {
+  return request({
+    url: '/api/v1/mp/delivery/company/list',
+    method: 'post',
+    data
+  })
+}
+
+// 经销商订单详情
+export function orderDetail(data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/order/detail',
+    method: 'post',
+    data
+  })
+}
+
+// 用户订单
+// 
+export function getDeliverList(urlParams, data) {
+  return request({
+      url: '/api/v1/mp/admin/deliver/order/list',
+      method: 'post',
+      data,
+      urlParams
+  })
+}
+
+// 用户订单详情
+export function deliverDetail(data) {
+  return request({
+    url: '/api/v1/mp/admin/deliver/order/detail',
+    method: 'post',
+    data
+  })
+}

+ 214 - 0
src/views/order/channel/detail.vue

@@ -0,0 +1,214 @@
+<template>
+  <div class="app-container">
+    <div class="info">
+      <div class="info-title">订单信息</div>
+      <div class="info-item">
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">订单编号:</div>
+            <div class="txt">{{ info.orderId }}</div>
+          </div>
+          <div class="info-item-content-one">
+            <div class="title">订单类型:</div>
+            <div class="txt">经销商订单</div>
+          </div>
+        </div>
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">下单时间:</div>
+            <div class="txt">{{ parseTime(info.createdTime)}}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="info">
+      <div class="info-title">买家信息</div>
+      <div class="info-item">
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">经销商:</div>
+            <div class="txt">{{ info.receiver }}</div>
+          </div>
+          <div class="info-item-content-one">
+            <div class="title">收货人:</div>
+            <div class="txt">{{ info.receiver }}</div>
+          </div>
+          <div class="info-item-content-one">
+            <div class="title">联系电话:</div>
+            <div class="txt">{{ info.tel }}</div>
+          </div>
+        </div>
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">收货地址:</div>
+            <div class="">
+              {{ `${info.province}${info.city}${info.area}${info.address}` }}
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="info">
+      <div class="info-title">订单状态</div>
+      <div class="info-item">
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">订单状态:</div>
+            <div class="txt">{{ status.desc }}</div>
+          </div>
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">发货时间:</div>
+            <div class="txt">{{ '--' }}</div>
+          </div>
+        </div>
+        <div class="info-item-content">
+          <el-button
+            v-if="status.value === 1"
+            v-hasPermi="['business:ticket:on']"
+            type="primary"
+            @click="toGoods()"
+            >发货</el-button
+          >
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">快递公司:</div>
+            <div class="txt">{{ '--' }}</div>
+          </div>
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">快递单号:</div>
+            <div class="txt">{{ '--' }}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div class="info">
+      <div class="info-title">商品信息</div>
+      <div class="info-table">
+        <el-table :data="list">
+          <el-table-column label="商品信息">
+            <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="单价(元)">
+            <template slot-scope="{ row }">
+              <div>{{ $numberFormat(row.pkgSalePrice) }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="数量" prop="orderNum">
+            <template slot-scope="{ row }">
+              <div>{{ row.orderNum }}包</div>
+            </template>
+          </el-table-column>
+          <el-table-column label="小计(元)">
+            <template slot-scope="{ row }">
+              <div>{{ $numberFormat(row.pkgSalePrice * row.orderNum) }}</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.orderAmt) }}元
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { orderDetail } from "@/api/business/order";
+import { publicFileGetUrl } from "@/api/common";
+import { accMul } from "@/utils/util";
+export default {
+  name: "Detail",
+  data() {
+    return {
+      orderId: "",
+      info: {},
+      status: {},
+      list: [],
+    };
+  },
+  created() {
+    this.orderId = this.$route.query.id;
+    console.log(this.orderId);
+    this.getDetail();
+  },
+  methods: {
+    getDetail() {
+      orderDetail({ orderId: this.orderId }).then((res) => {
+        console.log("res", res);
+        if (res.code == 0) {
+          this.info = res.data;
+          this.status = JSON.parse(res.data.status);
+          res.data.items.forEach((item) => {
+            let picUrlArr = item.picUrl.split(",");
+            item.picUrl = publicFileGetUrl + picUrlArr[0];
+          });
+          this.list = res.data.items;
+        }
+      });
+    },
+
+    toGoods(){
+
+    }
+  },
+  components: {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style lang="scss" scoped>
+.info {
+  margin-bottom: 40px;
+  &-title {
+    font-size: 14px;
+    margin-bottom: 20px;
+    font-weight: bold;
+  }
+  &-item {
+    &-content {
+      display: flex;
+
+      &-one {
+        display: flex;
+        margin-bottom: 40px;
+
+        .title {
+          width: 100px;
+        }
+
+        .txt {
+          width: 200px;
+        }
+      }
+    }
+  }
+  &-amt {
+    margin-top: 20px;
+    &-price {
+      span {
+        display: inline-block;
+        width: 80px;
+        margin-bottom: 20px;
+      }
+    }
+  }
+}
+.flex {
+  display: flex;
+  align-items: center;
+  .txt {
+    margin-left: 20px;
+  }
+}
+</style>

+ 370 - 0
src/views/order/channel/index.vue

@@ -0,0 +1,370 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="90px"
+    >
+      <el-form-item label="盲票组名称">
+        <el-input
+          v-model="queryParams.title"
+          placeholder="请输入盲票组名称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="订单号">
+        <el-input
+          v-model="queryParams.orderId"
+          placeholder="输入订单编号"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="经销商">
+        <el-select
+          v-model="queryParams.channelId"
+          placeholder="可输入经销商名称/手机号码搜索"
+          clearable
+          size="small"
+          style="width: 240px"
+          @change="handleQuery"
+        >
+          <el-option
+            v-for="item in merchantArr"
+            :key="item.areaId"
+            :label="item.areaName"
+            :value="item.areaId"
+          />
+        </el-select>
+      </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>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10">
+      <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="null"></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="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">
+            <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>{{ $numberFormat(row.pkgSalePrice) }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column label="数量" prop="orderNum" min-width="85">
+              <template slot-scope="{ row }">
+                <div>{{ row.orderNum }}包</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.pkgNum }}包</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="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'">{{
+              row.status.desc
+            }}</el-tag>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="80">
+        <template slot-scope="{ row }">
+          <div>
+            <el-button
+              v-hasPermi="['business:ticket:on']"
+              type="text"
+              @click="getDetail(row)"
+              >查看详情</el-button
+            >
+            <el-button
+              v-if="row.status.value === 1"
+              v-hasPermi="['business:ticket:on']"
+              type="text"
+              @click="toGoods(row)"
+              >发货</el-button
+            >
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="pageParams.pageNum"
+      :limit.sync="pageParams.pageSize"
+      @pagination="getList"
+    />
+
+    <el-dialog
+      title="订单发货"
+      :visible.sync="goodsShow"
+      width="800px"
+      :before-close="close"
+    >
+      <el-form :model="shipForm" ref="queryForm" 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-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-item label="快递单号:">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+        <el-form-item label="盲票组:">
+          <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-item label="盲票包序号:">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入盲票包序号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { getOrderList, companyList } from "@/api/business/order";
+import { publicFileGetUrl } from "@/api/common";
+export default {
+  data() {
+    return {
+      loading: false,
+      showSearch: true,
+      queryParams: {
+        title: "",
+        orderId: "",
+        startTime: "",
+        endTime: "",
+        channelId: "",
+        status: null,
+      },
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 总条数
+      total: 0,
+      list: [],
+      // 经销商
+      merchantArr: [],
+      // 下单时间
+      tradeTimeArr: [],
+      // 订单列表状态
+      state: "null",
+
+      goodsShow: false,
+      goodsInfo: {},
+      shipForm: {
+        deliveryId: "",
+        deliveryFlowId: "",
+      },
+      companyData: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getCompanyList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      getOrderList(
+        "pageNum=" +
+          this.pageParams.pageNum +
+          "&pageSize=" +
+          this.pageParams.pageSize +
+          "&",
+        this.queryParams
+      )
+        .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;
+        });
+    },
+    getCompanyList() {
+      companyList({}).then((res) => {
+        this.companyData = res.data;
+      });
+    },
+    //搜索
+    handleQuery() {
+      this.getList()
+    },
+    // 重置
+    resetQuery() {},
+    // 选择下单时间
+    tardeTime(e) {
+      if (e) {
+        this.queryParams.startTime = e[0];
+        this.queryParams.endTime = e[1];
+        this.handleQuery();
+      } else {
+        this.queryParams.startTime = "";
+        this.queryParams.endTime = "";
+        this.handleQuery();
+      }
+    },
+    // 订单切换
+    handleClick(e) {
+      this.queryParams.status = Number(e.name)
+      this.getList()
+    },
+    // 查看详情
+    getDetail(row) {
+      this.$router.push({ name: "Detail", query: { id: row.orderId } });
+    },
+    toGoods(row) {
+      this.goodsShow = true;
+      this.goodsInfo = row;
+    },
+    close() {
+      this.goodsShow = false;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+::v-deep .el-tabs--border-card > .el-tabs__content {
+  padding: 0;
+}
+</style>

+ 113 - 0
src/views/order/deliver/components/SendGoods.vue

@@ -0,0 +1,113 @@
+<template>
+  <div>
+    <el-dialog
+      title="订单发货"
+      :visible.sync="sendShow"
+      width="800px"
+      :before-close="close"
+    >
+      <el-form :model="shipForm" ref="queryForm" 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-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-item label="快递单号:">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+        <el-form-item label="盲票组:">
+          <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-item label="盲票包序号:">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入盲票包序号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { companyList } from "@/api/business/order";
+export default {
+  props:{
+    sendShow: {
+      type: Boolean,
+      default: false
+    },
+    goodsInfo: {
+      type: Object,
+      default: {}
+    }
+  },
+  created() {
+    this.getCompanyList();
+  },
+  data() {
+    return {
+      shipForm: {
+        deliveryId: "",
+        deliveryFlowId: "",
+      },
+      companyData: [],
+    };
+  },
+  methods: {
+    close(){
+      this.$emit('close')
+    },
+    getCompanyList() {
+      companyList({}).then((res) => {
+        this.companyData = res.data;
+      });
+    },
+  },
+  components: {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style>
+</style>

+ 212 - 0
src/views/order/deliver/detail.vue

@@ -0,0 +1,212 @@
+<template>
+  <div class="app-container">
+    <div class="info">
+      <div class="info-title">订单信息</div>
+      <div class="info-item">
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">订单编号:</div>
+            <div class="txt">{{ info.orderId }}</div>
+          </div>
+          <div class="info-item-content-one">
+            <div class="title">订单类型:</div>
+            <div class="txt">用户提货订单</div>
+          </div>
+        </div>
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">下单时间:</div>
+            <div class="txt">{{ parseTime(info.createdTime) }}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="info">
+      <div class="info-title">买家信息</div>
+      <div class="info-item">
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">用户昵称:</div>
+            <div class="txt">{{ info.nickName }}</div>
+          </div>
+          <div class="info-item-content-one">
+            <div class="title">收货人:</div>
+            <div class="txt">{{ info.receiver }}</div>
+          </div>
+          <div class="info-item-content-one">
+            <div class="title">联系电话:</div>
+            <div class="txt">{{ info.tel }}</div>
+          </div>
+        </div>
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">收货地址:</div>
+            <div class="">
+              {{ `${info.province}${info.city}${info.area}${info.address}` }}
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="info">
+      <div class="info-title">订单状态</div>
+      <div class="info-item">
+        <div class="info-item-content">
+          <div class="info-item-content-one">
+            <div class="title">订单状态:</div>
+            <div class="txt">{{ status.desc }}</div>
+          </div>
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">发货时间:</div>
+            <div class="txt">{{ "--" }}</div>
+          </div>
+        </div>
+        <div class="info-item-content">
+          <el-button
+            v-if="status.value === 1"
+            v-hasPermi="['business:ticket:on']"
+            type="primary"
+            @click="toGoods()"
+            >发货</el-button
+          >
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">快递公司:</div>
+            <div class="txt">{{ "--" }}</div>
+          </div>
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">快递单号:</div>
+            <div class="txt">{{ "--" }}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <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.deliveryFlowId ? "已发货" : "未发货" }}</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.orderAmt) }}元
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { deliverDetail } from "@/api/business/order";
+import { publicFileGetUrl } from "@/api/common";
+import { accMul } from "@/utils/util";
+export default {
+  name: "Detail",
+  data() {
+    return {
+      orderId: "",
+      info: {},
+      status: {},
+      list: [],
+    };
+  },
+  created() {
+    this.orderId = this.$route.query.id;
+    console.log(this.orderId);
+    this.getDetail();
+  },
+  methods: {
+    getDetail() {
+      deliverDetail({ orderId: this.orderId }).then((res) => {
+        console.log("res", res);
+        if (res.code == 0) {
+          this.info = res.data;
+          this.status = JSON.parse(res.data.status);
+          res.data.items.forEach((item) => {
+            let picUrlArr = item.picUrl.split(",");
+            item.picUrl = publicFileGetUrl + picUrlArr[0];
+          });
+          this.list = res.data.items;
+        }
+      });
+    },
+
+    toGoods() {},
+  },
+  components: {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style lang="scss" scoped>
+.info {
+  margin-bottom: 40px;
+  &-title {
+    font-size: 14px;
+    margin-bottom: 20px;
+    font-weight: bold;
+  }
+  &-item {
+    &-content {
+      display: flex;
+
+      &-one {
+        display: flex;
+        margin-bottom: 40px;
+
+        .title {
+          width: 100px;
+        }
+
+        .txt {
+          width: 200px;
+        }
+      }
+    }
+  }
+  &-amt {
+    margin-top: 20px;
+    &-price {
+      span {
+        display: inline-block;
+        width: 80px;
+        margin-bottom: 20px;
+      }
+    }
+  }
+}
+.flex {
+  display: flex;
+  align-items: center;
+  .txt {
+    margin-left: 20px;
+  }
+}
+</style>

+ 374 - 0
src/views/order/deliver/index.vue

@@ -0,0 +1,374 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="90px"
+    >
+      <el-form-item label="用户昵称">
+        <el-input
+          v-model="queryParams.nickName"
+          placeholder="请输入用户昵称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商品名称">
+        <el-input
+          v-model="queryParams.title"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="订单号">
+        <el-input
+          v-model="queryParams.orderId"
+          placeholder="输入订单编号"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="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>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10">
+      <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">
+            <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="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'">{{
+              row.status.desc
+            }}</el-tag>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="80">
+        <template slot-scope="{ row }">
+          <div>
+            <el-button
+              v-hasPermi="['business:ticket:on']"
+              type="text"
+              @click="getDetail(row)"
+              >查看详情</el-button
+            >
+            <el-button
+              v-if="row.status.value === 1"
+              v-hasPermi="['business:ticket:on']"
+              type="text"
+              @click="toGoods(row)"
+              >发货</el-button
+            >
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="pageParams.pageNum"
+      :limit.sync="pageParams.pageSize"
+      @pagination="getList"
+    />
+
+    <el-dialog
+      title="订单发货"
+      :visible.sync="goodsShow"
+      width="800px"
+      :before-close="close"
+    >
+      <el-form :model="shipForm" ref="queryForm" 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-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-item label="快递单号:">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+        <el-form-item label="盲票组:">
+          <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-item label="盲票包序号:">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入盲票包序号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+
+    <send-goods :send-show="goodsShow" :goods-info="goodsInfo" @close="close" />
+  </div>
+</template>
+<script>
+import { getDeliverList, companyList } from "@/api/business/order";
+import { publicFileGetUrl } from "@/api/common";
+import SendGoods from "./components/SendGoods";
+export default {
+  components: {
+    SendGoods,
+  },
+  data() {
+    return {
+      loading: false,
+      showSearch: true,
+      queryParams: {
+        nickName: "",
+        title: "",
+        orderId: "",
+        startTime: "",
+        endTime: "",
+        status: "",
+      },
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 总条数
+      total: 0,
+      list: [],
+      // 经销商
+      merchantArr: [],
+      // 下单时间
+      tradeTimeArr: [],
+      // 订单列表状态
+      state: "no",
+
+      goodsShow: false,
+      goodsInfo: {},
+      shipForm: {
+        deliveryId: "",
+        deliveryFlowId: "",
+      },
+      companyData: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getCompanyList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      getDeliverList(
+        "pageNum=" +
+          this.pageParams.pageNum +
+          "&pageSize=" +
+          this.pageParams.pageSize +
+          "&",
+        this.queryParams
+      )
+        .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;
+        });
+    },
+    getCompanyList() {
+      companyList({}).then((res) => {
+        this.companyData = res.data;
+      });
+    },
+    //搜索
+    handleQuery() {
+      this.getList();
+    },
+    // 重置
+    resetQuery() {},
+    // 选择下单时间
+    tardeTime(e) {
+      if (e) {
+        this.queryParams.startTime = e[0];
+        this.queryParams.endTime = e[1];
+        this.handleQuery();
+      } else {
+        this.queryParams.startTime = "";
+        this.queryParams.endTime = "";
+        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: "UserDetail", query: { id: row.orderId } });
+    },
+    toGoods(row) {
+      this.goodsShow = true;
+      this.goodsInfo = row;
+    },
+    close() {
+      this.goodsShow = false;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+::v-deep .el-tabs--border-card > .el-tabs__content {
+  padding: 0;
+}
+</style>