Browse Source

Merge branch 'test' into 'master'

Test

See merge request quanshu/mp-ui-pc!118
zhong chunping 3 years ago
parent
commit
3ddb87d90a

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

@@ -55,6 +55,15 @@ export function channelOrderShip(data) {
   })
 }
 
+// 修改经销商发货信息
+export function channelOrderShipUpdate(data) {
+  return request({
+    url: '/api/v1/mp/admin/channel/order/ship/update',
+    method: 'post',
+    data
+  })
+}
+
 // 用户订单
 export function getDeliverList(urlParams, data) {
   return request({
@@ -83,6 +92,15 @@ export function deliverOrderShip(data) {
   })
 }
 
+// 用户订单发货
+export function deliverOrderShipUpdate(data) {
+  return request({
+    url: '/api/v1/mp/admin/deliver/order/ship/update',
+    method: 'post',
+    data
+  })
+}
+
 // 用户订单导出
 export function deliverOrderExport(data) {
   return request({

+ 10 - 1
src/api/business/ticket.js

@@ -19,7 +19,16 @@ export function ticketBoxCreate(data) {
   })
 }
 
-// /api/v1/mp/wx/urlschema/generate
+// 盲票组详情
+export function ticketBoxDetail(data) {
+  return request({
+    url: '/api/v1/mp/admin/ticket/box/detail',
+    method: 'post',
+    data
+  })
+}
+
+// 
 export function urlschemaGeneratee(data) {
   return request({
     url: '/api/v1/mp/wx/urlschema/generate',

+ 1 - 15
src/router/index.js

@@ -154,21 +154,7 @@ export const constantRoutes = [
         meta: { title: '修改生成配置', activeMenu: '/tool/gen'}
       }
     ]
-  },
-  {
-    path: '/ticket',
-    component: Layout,
-    hidden: true,
-    children: [
-      {
-        path: 'create',
-        component: (resolve) => require(['@/views/business/ticket/create'], resolve),
-        name: 'TicketCreate',
-        meta: { title: '添加盲票组' ,activeMenu: '/business/ticket'}
-      },
-    ]
-  },
-
+  }
 ]
 
 export default new Router({

+ 1 - 1
src/views/business/ticket/create.vue

@@ -119,7 +119,7 @@
         </div>
         <div class="prize-table">
           <el-table :data="item.prizeList" class="el-table">
-            <el-table-column label="奖品图片" prop="storeName">
+            <el-table-column label="奖品图片">
               <template slot-scope="scope">
                 <el-image
                   style="width: 70px; height: 70px"

+ 175 - 0
src/views/business/ticket/detail.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="app-container">
+    <div class="base-info">
+      <div class="base-info-title">基础信息</div>
+      <el-form label-width="100px">
+        <el-form-item label="盲票类型:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.type && info.type.desc }}
+        </el-form-item>
+        <el-form-item label="盲票组名称:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.title }}
+        </el-form-item>
+        <el-form-item label="图片:">
+          <el-image
+            style="width: 110px; height: 150px"
+            :src="info && info.picUrl"
+            :preview-src-list="[info && info.picUrl]"
+          />
+        </el-form-item>
+        <el-form-item label="面值:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.facePrice && $numberFormat(info.facePrice) }}元
+        </el-form-item>
+        <el-form-item label="售价:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.salePrice && $numberFormat(info.salePrice) }}元
+        </el-form-item>
+        <el-form-item label="盲票总数:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.quantity }}张
+        </el-form-item>
+        <el-form-item label="每包张数:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.pkgUnit }}张
+        </el-form-item>
+        <el-form-item label="采购单价:" v-if="info.type == 'offline'">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.pkgSalePrice && $numberFormat(info.pkgSalePrice) }}元
+        </el-form-item>
+        <el-form-item label="佣金系数:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.saleCommRate }}%
+        </el-form-item>
+        <el-form-item label="序列号:">
+          <span :class="loading ? 'el-icon-loading' : ''"></span>
+          {{ info && info.boxNo }}
+        </el-form-item>
+      </el-form>
+      <div class="base-info-title">奖级设置</div>
+      <!-- 奖级设置 -->
+      <div class="prize" v-for="(item, index) in awardsList" :key="index">
+        <div class="prize-top">
+          <div>奖级名称:{{ item.name }}</div>
+          <div>奖级:{{ item.sort }}</div>
+          <div>奖级数量:{{ item.quantity }}</div>
+        </div>
+        <div class="prize-table">
+          <el-table :data="item.prizeList" class="el-table">
+            <el-table-column label="奖品图片">
+              <template slot-scope="{ row }">
+                <el-image
+                  style="width: 70px; height: 70px"
+                  :src="row.picUrl"
+                  :preview-src-list="[row.picUrl]"
+                >
+                </el-image>
+              </template>
+            </el-table-column>
+            <el-table-column label="奖品名称" prop="title" />
+            <el-table-column label="奖品类型" align="center">
+              <template slot-scope="{ row }">
+                <div v-if="row.prizeType.value == 'goods'">商品</div>
+                <div v-if="row.prizeType.value == 'coupon'">券</div>
+                <div v-if="row.prizeType.value == 'coin'">盲豆</div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { publicFileGetUrl } from "@/api/common";
+import { ticketBoxDetail } from "@/api/business/ticket";
+export default {
+  components: {},
+  data() {
+    return {
+      loading: false,
+      // 盲票组ID
+      boxId: "",
+      // 盲票组详情
+      info: {},
+      // 奖品
+      awardsList: [],
+    };
+  },
+  created() {
+    this.boxId = this.$route.query.id;
+    this.getDetail();
+  },
+  methods: {
+    // 获取详情
+    getDetail() {
+      this.loading = true;
+      ticketBoxDetail({ boxId: this.boxId })
+        .then((res) => {
+          this.loading = false;
+          console.log("res", res);
+          if (res.code == 0) {
+            let data = res.data;
+            this.info = {
+              ...data,
+              type: JSON.parse(data.type),
+              picUrl: publicFileGetUrl + data.picUrl,
+            };
+            data.awardsList.forEach((item) => {
+              item.prizeList.forEach((ele) => {
+                (ele.picUrl = publicFileGetUrl + ele.picUrl.split(',')[0]),
+                  (ele.prizeType = JSON.parse(ele.prizeType));
+              });
+            });
+            this.awardsList = data.awardsList;
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.base-info-title {
+  padding: 10px;
+  border-bottom: 1px solid #eaeaea;
+  margin-bottom: 20px;
+}
+.tip {
+  padding-left: 100px;
+  height: 32px;
+  margin-bottom: 20px;
+  color: #828282;
+  font-size: 14px;
+}
+.save-btn {
+  display: flex;
+  align-content: center;
+  justify-content: center;
+  margin-bottom: 100px;
+  .ge {
+    width: 100px;
+  }
+}
+.prize {
+  width: 1000px;
+  margin-bottom: 50px;
+  background: #f9f9f9;
+  border: 1px solid #bbbbbb;
+  font-size: 14px;
+  &-top {
+    padding: 10px 20px;
+    margin-bottom: 10px;
+    display: flex;
+    align-content: center;
+    justify-content: space-around;
+    border-bottom: 1px solid #bbbbbb;
+    div {
+      line-height: 36px;
+    }
+  }
+}
+</style>

+ 16 - 3
src/views/business/ticket/index.vue

@@ -129,11 +129,11 @@
         fixed="left"
       />
       <el-table-column label="盲票组ID" prop="boxId" min-width="80" />
-      <el-table-column label="盲票图片" prop="picUrl" min-width="100">
+      <el-table-column label="盲票图片" prop="picUrl" min-width="120">
         <template slot-scope="scope">
           <div>
             <el-image
-              style="width: 100px; height: 100px"
+              style="width: 110px; height: 150px"
               :src="scope.row.picUrl"
               :preview-src-list="[scope.row.picUrl]"
             />
@@ -190,6 +190,12 @@
       >
         <template slot-scope="scope">
           <div>
+            <el-button
+              v-hasPermi="['business:ticket:query']"
+              type="text"
+              @click="getDetail(scope.row)"
+              >查看</el-button
+            >
             <el-button
               v-if="
                 scope.row.status.value === 'off' ||
@@ -363,10 +369,12 @@ export default {
     },
     // 重置
     resetQuery() {},
+
     // 添加盲票组
     handleAdd() {
-      this.$router.push({ name: "TicketCreate" });
+      this.$router.push({ name: "Create" });
     },
+
     handleSelect(selection, row) {
       const isSelect = selection.find((item) => item.boxId === row.boxId);
       this.$refs.table.clearSelection();
@@ -378,6 +386,11 @@ export default {
       }
     },
 
+    // 查看详情
+    getDetail(row) {
+      this.$router.push({ name: "TicketDetail", query: { id: row.boxId } });
+    },
+
     handleDetail() {},
 
     handleImport() {

+ 2 - 2
src/views/index.vue

@@ -27,8 +27,8 @@ export default {
   },
 
   created() {
-    //this.getPayAmtList()
-    // this.getPayUserCntList()
+    this.getPayAmtList()
+    this.getPayUserCntList()
     this.getSiteIncreaseList()
   },
   methods: {

+ 150 - 0
src/views/order/channel/components/ExpressEdit.vue

@@ -0,0 +1,150 @@
+<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-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="快递单号:" prop="deliveryFlowId">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </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,
+  channelOrderShipUpdate,
+} from "@/api/business/order";
+export default {
+  mixins: [CustomFieldsMixin],
+  props: {
+    // 发货弹框显示
+    editShow: {
+      type: Boolean,
+      default: false,
+    },
+    // 订单详情
+    goodsInfo: {
+      type: Object,
+      default: {},
+    },
+  },
+  data() {
+    return {
+      loading: false,
+      shipForm: {
+        deliveryId: "",
+        deliveryFlowId: "",
+      },
+      // 快递下拉列表
+      companyData: [],
+      rules: {
+        deliveryId: [
+          { required: true, message: "请选择快递公司", trigger: "change" },
+        ],
+        deliveryFlowId: [
+          { required: true, message: "请输入快递单号", trigger: "blur" },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getCompanyList();
+    this.getFormData()
+  },
+  methods: {
+    getFormData(){
+      this.shipForm.deliveryId = this.goodsInfo.deliveryId
+      this.shipForm.deliveryFlowId = this.goodsInfo.deliveryFlowId
+    },
+    // 关闭发货弹框
+    close() {
+      this.$emit("close");
+      this.loading = false;
+      this.$refs["shipForm"].resetFields();
+    },
+
+    // 快递下拉列表
+    getCompanyList() {
+      companyList({}).then((res) => {
+        this.companyData = res.data;
+      });
+    },
+
+    // 确认
+    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.goodsInfo.orderId,
+      };
+      channelOrderShipUpdate(data)
+        .then((res) => {
+          if (res.code == 0) {
+            this.msgSuccess("修改成功");
+            this.close();
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+  },
+};
+</script>
+<style scoped>
+</style>

+ 49 - 3
src/views/order/channel/detail.vue

@@ -31,6 +31,12 @@
             <div class="title">经销商:</div>
             <div class="txt">{{ info.channel && info.channel.name }}</div>
           </div>
+          <div class="info-item-content-one">
+            <div class="title">上级渠道:</div>
+            <div class="txt">{{ info.channel && info.channel.parentName }}</div>
+          </div>
+        </div>
+        <div class="info-item-content">
           <div class="info-item-content-one">
             <div class="title">收货人:</div>
             <div class="txt">{{ info.receiver || "--" }}</div>
@@ -39,8 +45,6 @@
             <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="">
@@ -68,6 +72,9 @@
             <div class="title">发货时间:</div>
             <div class="txt">{{ parseTime(info.deliveryTime) || "--" }}</div>
           </div>
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="edit-express" @click="editExpress">修改</div>
+          </div>
         </div>
         <div class="info-item-content">
           <el-button
@@ -79,7 +86,9 @@
           >
           <div class="info-item-content-one" v-if="status.value === 2">
             <div class="title">快递公司:</div>
-            <div class="txt">{{ (delivery && delivery.companyName) || "--" }}</div>
+            <div class="txt">
+              {{ (delivery && delivery.companyName) || "--" }}
+            </div>
           </div>
           <div class="info-item-content-one" v-if="status.value === 2">
             <div class="title">快递单号:</div>
@@ -118,6 +127,20 @@
               <div>{{ $numberFormat(row.pkgSalePrice * row.orderNum) }}</div>
             </template>
           </el-table-column>
+          <el-table-column
+            v-if="status.value === 2 || status.value === 3"
+            label="附加信息"
+            min-width="150"
+          >
+            <template slot-scope="{ row }">
+              <div>
+                序列号:
+                <div v-for="(item, index) in row.detailList" :key="index">
+                  {{ item.startSn }} 至 {{ item.endSn }}
+                </div>
+              </div>
+            </template>
+          </el-table-column>
         </el-table>
       </div>
       <div class="info-amt">
@@ -137,6 +160,14 @@
       :channel-list="boxData"
       @close="close"
     />
+
+    <!-- 修改快递信息 -->
+    <express-edit
+      v-if="editShow"
+      :edit-show="editShow"
+      :goods-info="info"
+      @close="close"
+    />
   </div>
 </template>
 <script>
@@ -144,10 +175,12 @@ import { orderDetail, channelList } from "@/api/business/order";
 import { publicFileGetUrl } from "@/api/common";
 import { accMul } from "@/utils/util";
 import SendGoods from "./components/SendGoods";
+import ExpressEdit from "./components/ExpressEdit";
 export default {
   name: "Detail",
   components: {
     SendGoods,
+    ExpressEdit,
   },
   data() {
     return {
@@ -165,6 +198,8 @@ export default {
       goodsShow: false,
       // 盲票组列表
       boxData: [],
+      // 修改快递信息弹框
+      editShow: false,
     };
   },
   created() {
@@ -212,8 +247,14 @@ export default {
     // 发货弹框关闭
     close() {
       this.goodsShow = false;
+      this.editShow = false;
       this.getDetail();
     },
+
+    // 修改快递信息
+    editExpress() {
+      this.editShow = true;
+    },
   },
 };
 </script>
@@ -238,6 +279,11 @@ export default {
           width: 100px;
         }
 
+        .edit-express {
+          color: #409eff;
+          cursor: pointer;
+        }
+
         .txt {
           width: 200px;
         }

+ 4 - 3
src/views/order/channel/index.vue

@@ -123,17 +123,18 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="数量" prop="pkgNum" min-width="85">
+      <el-table-column label="数量" prop="pkgNum" min-width="65">
         <template slot-scope="{ row }">
           <div>{{ row.pkgNum }}包</div>
         </template>
       </el-table-column>
-      <el-table-column label="实付金额(元)" min-width="85">
+      <el-table-column label="实付金额(元)" min-width="65">
         <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="parentName" min-width="80" />
       <el-table-column label="收货人/收货地址" prop="addr" min-width="120">
         <template slot-scope="{ row }">
           <div>
@@ -341,4 +342,4 @@ export default {
 ::v-deep .el-tabs--border-card > .el-tabs__content {
   padding: 0;
 }
-</style>
+</style>

+ 156 - 0
src/views/order/deliver/components/ExpressEdit.vue

@@ -0,0 +1,156 @@
+<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-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="快递单号:" prop="deliveryFlowId">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </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,
+} 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: "",
+      },
+      // 快递下拉列表
+      companyData: [],
+      rules: {
+        deliveryId: [
+          { required: true, message: "请选择快递公司", trigger: "change" },
+        ],
+        deliveryFlowId: [
+          { required: true, message: "请输入快递单号", trigger: "blur" },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getCompanyList();
+    this.getFormData()
+  },
+  methods: {
+    getFormData(){
+      this.shipForm.deliveryId = this.goodsInfo.deliveryId
+      this.shipForm.deliveryFlowId = this.goodsInfo.deliveryFlowId
+    },
+    // 关闭发货弹框
+    close() {
+      this.$emit("close");
+      this.loading = false;
+      this.$refs["shipForm"].resetFields();
+    },
+
+    // 快递下拉列表
+    getCompanyList() {
+      companyList({}).then((res) => {
+        this.companyData = res.data;
+      });
+    },
+
+    // 确认
+    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>

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

@@ -99,6 +99,9 @@
               <div class="tit">发货时间:</div>
               <div class="txt">{{ parseTime(item.deliveryTime) || "--" }}</div>
             </div>
+            <div class="info-one">
+              <div class="edit-express" @click="editExpress(item)">修改</div>
+            </div>
           </div>
           <div class="goods">
             <div class="goods-item" v-for="(ele, ins) in item.items" :key="ins">
@@ -158,16 +161,27 @@
 
     <!-- 发货 -->
     <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 { deliverDetail } from "@/api/business/order";
 import { publicFileGetUrl } from "@/api/common";
 import SendGoods from "./components/SendGoods";
+import ExpressEdit from "./components/ExpressEdit";
 export default {
   name: "UserDetail",
   components: {
     SendGoods,
+    ExpressEdit,
   },
   data() {
     return {
@@ -183,6 +197,10 @@ export default {
       deliverList: [],
       // 发货显示
       goodsShow: false,
+      // 修改快递信息弹框
+      editShow: false,
+      // 快递信息
+      expressInfo: {}
     };
   },
   created() {
@@ -229,8 +247,15 @@ export default {
     // 发货关闭
     close() {
       this.goodsShow = false;
+      this.editShow = false;
       this.getDetail();
     },
+
+    // 修改快递信息
+    editExpress(item) {
+      this.expressInfo = item
+      this.editShow = true;
+    },
   },
 };
 </script>
@@ -280,6 +305,10 @@ export default {
         .txt {
           width: 200px;
         }
+        .edit-express{
+          color: #409eff;
+          cursor: pointer;
+        }
       }
       .goods {
         margin: 10px 0;