Эх сурвалжийг харах

Merge branch 'test' into 'master'

Test

See merge request quanshu/mp-ui-pc!184
zhong chunping 3 жил өмнө
parent
commit
272a0e2a3b

+ 31 - 0
package-lock.json

@@ -1118,6 +1118,15 @@
         "regenerator-runtime": "^0.13.4"
       }
     },
+    "@babel/runtime-corejs3": {
+      "version": "7.17.9",
+      "resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.17.9.tgz",
+      "integrity": "sha512-WxYHHUWF2uZ7Hp1K+D1xQgbgkGUfA+5UPOegEXGt2Y5SMog/rYCVaifLZDbw8UkNXozEqqrZTy6bglL7xTaCOw==",
+      "requires": {
+        "core-js-pure": "^3.20.2",
+        "regenerator-runtime": "^0.13.4"
+      }
+    },
     "@babel/template": {
       "version": "7.14.5",
       "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz",
@@ -4020,6 +4029,11 @@
         }
       }
     },
+    "core-js-pure": {
+      "version": "3.22.1",
+      "resolved": "https://registry.npmmirror.com/core-js-pure/-/core-js-pure-3.22.1.tgz",
+      "integrity": "sha512-TChjCtgcMDc8t12RiwAsThjqrS/VpBlEvDgL009ot4HESzBo3h2FSZNa6ZS1nWKZEPDoulnszxUll9n0/spflQ=="
+    },
     "core-util-is": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@@ -12879,6 +12893,23 @@
       "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.0.tgz",
       "integrity": "sha512-W74OO2vCJPs9/YjNjW8lLbj+jzT24waTo2KShI8jLvJW8OaIkgb3wuAMA7D+ZiUxDOx3ubwSZTaJBip9G8a3aQ=="
     },
+    "wangeditor": {
+      "version": "4.7.15",
+      "resolved": "https://registry.npmmirror.com/wangeditor/-/wangeditor-4.7.15.tgz",
+      "integrity": "sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==",
+      "requires": {
+        "@babel/runtime": "^7.11.2",
+        "@babel/runtime-corejs3": "^7.11.2",
+        "tslib": "^2.1.0"
+      },
+      "dependencies": {
+        "tslib": {
+          "version": "2.3.1",
+          "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.1.tgz",
+          "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
+        }
+      }
+    },
     "watch-size": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/watch-size/-/watch-size-2.0.0.tgz",

+ 2 - 1
package.json

@@ -72,7 +72,8 @@
     "vue-moment": "^4.0.0",
     "vue-router": "3.4.9",
     "vuedraggable": "2.24.3",
-    "vuex": "3.6.0"
+    "vuex": "3.6.0",
+    "wangeditor": "^4.7.15"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "4.4.6",

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

@@ -19,6 +19,14 @@ export function companyList(data) {
   })
 }
 
+//快递单号自动识别
+export function automaticRecognition(data) {
+  return request({
+    url:`/api/v1/mp/logistics/autonumber/auto/${ data }`,
+    method:'post',
+  })
+}
+
 // 经销商盲票组列表
 export function boxList(data) {
   return request({

+ 1 - 1
src/components/DragImageUpload/index.vue

@@ -180,7 +180,7 @@ export default {
           var pitem = {
             name: item.fileName,
             url:  (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName,
-            thumbUrl:  (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName + "_s"
+            thumbUrl:  (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName + "?imageView2/2/w/375"
           };
           this.previewList.push(pitem)
           return item;

+ 1 - 1
src/components/ImageShow/index.vue

@@ -111,7 +111,7 @@
             var pitem = {
               name: item.fileName,
               url:  (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName,
-              thumbUrl: (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName + "_s",
+              thumbUrl: (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName + "?imageView2/2/w/375",
             };
             this.previewList.push(pitem)
             return item;

+ 1 - 1
src/components/ImageUpload/index.vue

@@ -158,7 +158,7 @@
             var pitem = {
               name: item.fileName,
               url:  (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName,
-              thumbUrl:  (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName + "_s"
+              thumbUrl:  (this.isPublic ? publicFileGetUrl : (this.baseUrl + privateFileGetUrl)) + item.fileName + "?imageView2/2/w/375"
             };
             this.previewList.push(pitem)
             return item;

+ 76 - 0
src/components/WangEditor/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <div>
+    <div id="editor"></div>
+  </div>
+</template>
+<script>
+import wangEditor from "@/utils/wangEditor.min";
+import { getToken } from "@/utils/auth";
+import { publicFileSaveAPI } from "@/api/common";
+import { publicFileGetUrl } from "@/api/common";
+export default {
+  name: "WangEditor",
+  props: {
+    value: {
+      default: "",
+      type: String,
+    },
+  },
+  data() {
+    return {
+      editor: null,
+    };
+  },
+  watch: {
+    value: "getdictionarylist", // 渲染数据的方法
+  },
+  methods: {
+    initEditor() {
+      this.editor = new wangEditor(`#editor`);
+      // 配置 onchange 回调函数,将数据同步到 提交表单 中
+      this.editor.config.onchange = (newHtml) => {
+        this.$emit("input", newHtml);
+      };
+      // 编辑器不需要的菜单
+      this.editor.config.excludeMenus = ["emoticon", "video", "code"];
+      this.editor.config.showLinkImg = false; //关闭网络路径图片方式
+      this.editor.config.customUploadImg = async (files, insert) => {
+        for (let item of files) {
+          let res = await publicFileSaveAPI(
+            { file: item },
+            {
+              Authorization: "Bearer " + getToken(),
+              "x-zz-timestamp": new Date().valueOf(),
+            }
+          );
+          let url = publicFileGetUrl + res.data.fileName;
+          // 在编辑器插入图片
+          insert(url);
+        }
+      };
+      this.editor.config.zIndex = 0;
+      // 创建编辑器
+      this.editor.create();
+      this.editor.$textContainerElem.css("height", "700px !important"); //设置高
+    },
+
+    setContent(val) {
+      this.editor.txt.html(val);
+    },
+
+    getdictionarylist() {
+      // this.editor.txt.html(this.value);
+    },
+  },
+  mounted() {
+    this.initEditor();
+  },
+  beforeDestroy() {
+    // 销毁编辑器
+    this.editor.destroy();
+    this.editor = null;
+  },
+};
+</script>
+<style scoped>
+</style>

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 15 - 0
src/utils/wangEditor.min.js


+ 20 - 8
src/views/business/channel/childs.vue

@@ -85,8 +85,8 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" :data="channelList">
-          <el-table-column label="渠道编号" prop="channelId" width="100px" />
+        <el-table v-loading="loading" :data="channelList" @sort-change="sortChannelId">
+          <el-table-column label="渠道编号" sortable="custom" prop="channelId" width="100px" />
           <el-table-column label="渠道名称" prop="name" show-overflow-tooltip  width="180px">
             <template slot-scope="scope">
               <el-button
@@ -101,7 +101,7 @@
             </template>
           </el-table-column>
           <el-table-column label="手机号码" prop="mobile" show-overflow-tooltip  width="120px"/>
-          <el-table-column label="佣金比例" prop="commRate">
+          <el-table-column label="佣金比例" sortable="custom" prop="commRate">
             <template slot-scope="scope">
               {{scope.row.commRate}}%
             </template>
@@ -111,8 +111,8 @@
               {{scope.row.level}}级渠道
             </template>
           </el-table-column>
-          <el-table-column label="经销商数" prop="siteCnt"  />
-          <el-table-column label="用户数" prop="userCnt"  />
+          <el-table-column label="经销商数" sortable="custom" prop="siteCnt"  />
+          <el-table-column label="用户数" sortable="custom" prop="userCnt"  />
           <el-table-column label="状态" key="statusV">
            <template slot-scope="{ row, column }">
                <el-tag :type="JSON.parse(row.status).value == '1' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
@@ -251,7 +251,9 @@ export default {
       },
       pageParams: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
+        orderByColumn: 'channelId',
+        isAsc: 'desc',
       }
     };
   },
@@ -268,7 +270,7 @@ export default {
     this.parentId = parentId
     this.queryParams.parentId = parentId
     this.queryParams.parentName = title
-    console.log("parentId == "+parentId+  "title == "+title)
+    // console.log("parentId == "+parentId+  "title == "+title)
    // this.$route.meta.title = title + " - 子渠道管理"
     if(parentId){
         this.initList();
@@ -284,7 +286,7 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      listChannel('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&', this.queryParams).then(response => {
+      listChannel('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&orderByColumn='+ this.pageParams.orderByColumn +'&isAsc='+ this.pageParams.isAsc +'&', this.queryParams).then(response => {
           this.channelList = response.rows;
           this.channelList.forEach(item => {
               item.statusV = JSON.parse(item.status).value+""
@@ -295,6 +297,16 @@ export default {
       );
     },
 
+    //切换排序
+    sortChannelId(row){
+      if (row){
+        let prop =  row.prop == 'commRate' ? ('t1.'+ row.prop) : row.prop;
+        this.pageParams.orderByColumn = prop
+        this.pageParams.isAsc = row.order=='ascending'?"asc":"desc";
+        this.getList()
+      }
+    },
+
     // 省
    /* getProvinceList(){
       this.cityList = []

+ 22 - 8
src/views/business/channel/index.vue

@@ -113,8 +113,8 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" :data="channelList">
-          <el-table-column label="渠道编号" prop="channelId" width="100px" />
+        <el-table v-loading="loading" :data="channelList" @sort-change="sortChannelId" >
+          <el-table-column label="渠道编号" sortable="custom" prop="channelId" width="100px" />
           <el-table-column label="渠道名称" prop="name" show-overflow-tooltip  width="180px">
             <template slot-scope="scope">
               <el-button
@@ -129,7 +129,7 @@
             </template>
           </el-table-column>
           <el-table-column label="手机号码" prop="mobile" show-overflow-tooltip  width="120px"/>
-          <el-table-column label="佣金比例" prop="commRate">
+          <el-table-column label="佣金比例" prop="commRate" sortable="custom">
             <template slot-scope="scope">
               {{scope.row.commRate}}%
             </template>
@@ -139,8 +139,8 @@
               {{scope.row.level}}级渠道
             </template>
           </el-table-column>
-          <el-table-column label="经销商数" prop="siteCnt"  />
-          <el-table-column label="用户数" prop="userCnt"  />
+          <el-table-column label="经销商数" sortable="custom" prop="siteCnt"  />
+          <el-table-column label="用户数" sortable="custom" prop="userCnt"  />
           <el-table-column label="状态" key="statusV">
            <template slot-scope="{ row, column }">
              <el-tag :type="JSON.parse(row.status).value == '1' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
@@ -233,7 +233,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import ChannelCreate from './components/Create'
 import ChannelDetail from './components/Detail'
 export default {
-  name: "ChannelIndex",
+  name: "Channel",
   components: {
     Treeselect,
     ChannelCreate,
@@ -282,7 +282,10 @@ export default {
       },
       pageParams: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
+        orderByColumn: 'channelId',
+        isAsc: 'desc',
+
       }
     };
   },
@@ -303,7 +306,7 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      listChannel('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&', this.queryParams).then(response => {
+      listChannel('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&orderByColumn='+ this.pageParams.orderByColumn +'&isAsc='+ this.pageParams.isAsc +'&', this.queryParams).then(response => {
           this.channelList = response.rows;
           this.channelList.forEach(item => {
               item.statusV = JSON.parse(item.status).value+""
@@ -334,6 +337,17 @@ export default {
       }
     },
 
+    //切换排序
+    sortChannelId(row){
+      if (row){
+        let prop =  row.prop == 'commRate' ? ('t1.'+ row.prop) : row.prop;
+        this.pageParams.orderByColumn = prop
+        this.pageParams.isAsc = row.order=='ascending'?"asc":"desc";
+        this.getList()
+      }
+
+    },
+
     refreshChannelTree(){
       treeChannel({}).then(response => {
          this.channelOptions = response.data

+ 7 - 2
src/views/business/goods/add.vue

@@ -58,7 +58,7 @@
       <el-divider content-position="left">价格库存</el-divider>
       <el-row>
         <el-col :span="23">
-          <el-form-item label="启用多SKU:" prop="multiSku">
+          <el-form-item label="启用多SKU:">
             <el-switch
               v-model="addData.multiSku"
               :active-value="1"
@@ -109,7 +109,7 @@
       <el-row>
         <el-col :span="22">
           <el-form-item label="商品详情" prop="description">
-            <TinyEditor v-model="addData.description" />
+            <wang-editor ref="editor" v-model="addData.description" />
           </el-form-item>
         </el-col>
       </el-row>
@@ -125,6 +125,7 @@
 </template>
 <script>
 import Upload from '@/components/DragImageUpload'
+import WangEditor from '@/components/WangEditor'
 import Spec from './components/spec'
 import TinyEditor from '@/components/TinyEditor'
 import { getGoodsDetail, addGoods } from '@/api/business/goods'
@@ -135,6 +136,7 @@ import { accDiv, accMul } from '@/utils/util'
 export default {
   components: {
     TinyEditor,
+    WangEditor,
     Upload,
     Spec
   },
@@ -199,6 +201,9 @@ export default {
           cost: cost == '' || cost == null ? '' : accDiv(cost, 100),
           goodsId, title, picUrl, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, tagIds
         }
+        if(description) {
+          this.$refs.editor.setContent(description)
+        }
         if (multiSku && skuList instanceof Array && skuList.length > 0) {
           this.$nextTick(() => {
             this.$refs.spec.setSkuList(skuList)

+ 32 - 27
src/views/business/salesite/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="app-container">
-    <el-form 
-      :model="queryParams" 
-      ref="queryForm" 
-      :inline="true" 
-      v-show="showSearch" 
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
       label-width="75px"
       >
       <el-form-item label="上级渠道" prop="parentId">
@@ -104,21 +104,21 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="siteList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="siteList" @sort-change="sortChannelId" @selection-change="handleSelectionChange">
      <!-- <el-table-column type="selection" width="55"  /> -->
-      <el-table-column label="经销商编号" prop="channelId" width="100px"/>
-      <el-table-column label="经销商名称" show-overflow-tooltip  prop="name" max-width="100px" />
+      <el-table-column label="经销商编号" sortable="custom" prop="channelId" width="110px"/>
+      <el-table-column label="经销商名称" show-overflow-tooltip  prop="name" min-width="110px" />
       <el-table-column label="手机号码"  prop="mobile" width="120px"/>
-      <el-table-column label="佣金比例" prop="commRate">
+      <el-table-column label="佣金比例" sortable="custom" prop="commRate" width="100px">
         <template slot-scope="{ row, column }">
            <span>{{row.commRate}}%</span>
         </template>
       </el-table-column>
-      <el-table-column label="上级渠道" prop="parentsName" min-width="170px" />
-      <el-table-column label="盲票库存" prop="offLineQtyCnt" />
-      <el-table-column label="线下销量" prop="offLineSaleCnt" />
-      <el-table-column label="线上销量" prop="onLineSaleCnt" />
-      <el-table-column label="用户数" prop="userCnt" />
+      <el-table-column label="上级渠道" prop="parentsName" min-width="100px" />
+      <el-table-column label="盲票库存" sortable="custom" prop="offLineQtyCnt" width="100px"/>
+      <el-table-column label="线下销量" sortable="custom" prop="offLineSaleCnt" width="100px"/>
+      <el-table-column label="线上销量" sortable="custom" prop="onLineSaleCnt" width="100px"/>
+      <el-table-column label="用户数" sortable="custom" prop="userCnt" width="100px"/>
       <el-table-column label="认证状态" prop="certifyStatus" >
         <template slot-scope="{ row, column }">
              <span v-if="getValue(row.certifyStatus) == 'y'" style="color: blue;"> {{getDesc(row.certifyStatus)}}</span>
@@ -209,7 +209,7 @@ import { listSaleSite, updateSaleSiteStatus} from "@/api/admin/salesite";
 import SiteCreate from './components/Create'
 import SiteDetail from './components/Detail'
 export default {
-  name: "SaleSiteIndex",
+  name: "Salesite",
   components: {
    SiteCreate,
    SiteDetail
@@ -261,7 +261,9 @@ export default {
       },
       pageParams: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
+        orderByColumn: 't1.channelId',
+        isAsc: 'desc',
       },
       // 表单参数
       form: {},
@@ -282,7 +284,7 @@ export default {
     /** 查询经销商列表 */
     getList() {
       this.loading = true;
-      listSaleSite('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&',this.queryParams).then(response => {
+      listSaleSite('pageNum='+this.pageParams.pageNum + '&pageSize='+this.pageParams.pageSize+'&orderByColumn='+ this.pageParams.orderByColumn +'&isAsc='+ this.pageParams.isAsc +'&',this.queryParams).then(response => {
         this.siteList = response.rows;
         this.siteList.forEach(item => {
             item.statusV = JSON.parse(item.status).value+""
@@ -291,6 +293,17 @@ export default {
         this.loading = false;
       });
     },
+
+    //切换排序
+    sortChannelId(row){
+      if (row){
+        let prop =  row.prop == 'channelId' || row.prop == 'commRate' ? ('t1.'+ row.prop) : row.prop;
+        this.pageParams.orderByColumn = prop
+        this.pageParams.isAsc = row.order=='ascending'?"asc":"desc";
+        this.getList()
+      }
+    },
+
     // 获取上级渠道下拉列表
     getChannelList(){
       listAllChannel().then(response => {
@@ -365,15 +378,6 @@ export default {
       return (dataObj && dataObj.value) || "";
     },
 
-    submitSuccess(){
-      this.getList();
-    },
-
-    hideDialog(){
-      this.createShow = false
-      this.detailShow = false
-    },
-
     /** 搜索按钮操作 */
     handleQuery() {
       this.channelList = this.channelCopyList;
@@ -384,7 +388,6 @@ export default {
     resetQuery() {
       this.queryParams= {
          parentId: "",
-         name: "",
          mobile: "",
          provinceId:"",
          cityId:"",
@@ -393,12 +396,14 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
+
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.postId)
       this.single = selection.length!=1
       this.multiple = !selection.length
     },
+
     handleDetail(row){
       this.detailShow = true
       this.editId = row.channelId

+ 236 - 0
src/views/business/ticket/components/AwardsList.vue

@@ -0,0 +1,236 @@
+<template>
+  <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>
+            奖级数量:
+            <el-input-number
+              v-model="item.quantity"
+              controls-position="right"
+              @change="handleChangeAll($event, item)"
+              :min="0"
+              size="small"
+            ></el-input-number>
+          </div>
+        </div>
+        <div class="prize-table">
+          <el-table :data="item.prizeList" class="el-table">
+            <el-table-column label="奖品图片">
+              <template slot-scope="scope">
+                <el-image
+                  style="width: 70px; height: 70px"
+                  :src="scope.row.picUrl"
+                  :preview-src-list="[scope.row.picUrl]"
+                >
+                </el-image>
+              </template>
+            </el-table-column>
+            <el-table-column label="奖品名称" prop="title" />
+            <el-table-column label="奖品类型">
+              <template slot-scope="scope">
+                <div v-if="scope.row.prizeType == 'goods'">商品</div>
+                <div v-if="scope.row.prizeType == 'coupon'">券</div>
+                <div v-if="scope.row.prizeType == 'coin'">盲豆</div>
+              </template>
+            </el-table-column>
+            <!-- <el-table-column label="奖品数量" prop="storeName">
+              <template slot-scope="scope">
+                <div>
+                  <el-input-number
+                    v-model="scope.row.quantity"
+                    controls-position="right"
+                    @change="handleChange($event, index)"
+                    :min="1"
+                    size="small"
+                  ></el-input-number>
+                </div>
+              </template>
+            </el-table-column> -->
+            <el-table-column label="操作" align="center">
+              <template slot-scope="scope">
+                <el-button
+                  size="mini"
+                  type="text"
+                  @click="handleDel(scope.$index, item)"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="prize-btn">
+          <el-dropdown @command="handleCommand($event, index)">
+            <el-button type="primary" size="small">
+              添加奖品<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="goods">商品</el-dropdown-item>
+              <el-dropdown-item command="coupon">券</el-dropdown-item>
+              <el-dropdown-item command="coin">盲豆</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </div>
+      </div>
+  </div>
+</template>
+<script>
+export default {
+  name: "AwardList",
+  props: {
+    value: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      prizeIndex: null, // 奖级下标
+      // 奖级列表
+      awardsList: [
+        {
+          name: "奖品一",
+          sort: 1,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品二",
+          sort: 2,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品三",
+          sort: 3,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品四",
+          sort: 4,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品五",
+          sort: 5,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品六",
+          sort: 6,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品七",
+          sort: 7,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品八",
+          sort: 8,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品九",
+          sort: 9,
+          quantity: 0,
+          prizeList: [],
+        },
+        {
+          name: "奖品十",
+          sort: 10,
+          quantity: 0,
+          prizeList: [],
+        },
+      ],
+    };
+  },
+  methods: {
+    // 添加奖品
+    add(type, item) {
+      if(type == 1) {
+        this.awardsList[this.prizeIndex].prizeList = this.awardsList[this.prizeIndex].prizeList.concat(item);
+      } else if (type == 2) {
+        this.awardsList[this.prizeIndex].prizeList.push(item);
+      }
+      this.$emit('input', this.awardsList)
+      this.$emit('close')
+    },
+
+    // 选择奖品种类
+    handleCommand(e, index) {
+      this.prizeIndex = index;
+      if (e == "goods") {
+        this.goodsTableVisible = true;
+      } else if (e == "coupon") {
+        this.couponTableVisible = true;
+      } else if (e == "coin") {
+        this.coinTableVisible = true;
+      }
+      this.$emit('handleCommand', e)
+    },
+    // 改变奖级数量
+    handleChangeAll(e, item) {
+      this.$set(item, "quantity", e);
+      this.$forceUpdate();
+      // this.getQuantity();
+    },
+
+    // 改变奖品数量
+    handleChange(e, index) {
+      this.prizeIndex = index;
+      this.$forceUpdate();
+      // this.getQuantity();
+    },
+
+    // 奖级商品删除
+    handleDel(index, item) {
+      this.prizeIndex = item.sort - 1;
+      let list = item.prizeList;
+      list.splice(index, 1);
+      this.$set(item, "prizeList", list);
+      // this.getQuantity();
+    },
+
+    // 计算奖级数量
+    getQuantity() {
+      let num = 0;
+      this.awardsList[this.prizeIndex].prizeList.forEach((item) => {
+        num += item.quantity;
+      });
+      this.awardsList[this.prizeIndex].quantity = num;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.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;
+    }
+  }
+  &-btn {
+    border-top: 1px solid #bbbbbb;
+    padding: 10px;
+  }
+}
+</style>

+ 93 - 0
src/views/business/ticket/components/CoinAdd.vue

@@ -0,0 +1,93 @@
+<template>
+  <div>
+    <el-dialog
+      title="添加盲豆奖品"
+      :visible.sync="dialogVisible"
+      :before-close="close"
+      width="500px"
+    >
+      <el-form
+        :model="coinForm"
+        :rules="coinRules"
+        ref="coinForm"
+        label-width="100px"
+      >
+        <el-form-item label="盲豆数量" prop="quantity">
+          <el-input
+            v-model="coinForm.quantity"
+            size="small"
+            placeholder="请输入盲豆数量"
+            style="width: 200px"
+          />
+        </el-form-item>
+      </el-form>
+      <div class="dialog-btn">
+        <el-button size="small" @click="close"> 取 消 </el-button>
+        <div class="ge"></div>
+        <el-button type="primary" size="small" @click="confirmCoin">
+          确 认
+        </el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { publicFileGetUrl } from "@/api/common";
+export default {
+  name: "CoinAdd",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      coinForm: { quantity: "" },
+      coinRules: {
+        quantity: [
+          { required: true, message: "请输入数量", trigger: "blur" },
+          {
+            pattern: /^([1-9]\d*)$/,
+            message: "请输入合法的数字",
+            trigger: ["blur", "change"],
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    // 确认输入盲豆
+    confirmCoin() {
+      let coin = {
+        prizeType: "coin",
+        // quantity: 1,
+        title: `盲豆 x${this.coinForm.quantity}`,
+        picUrl: publicFileGetUrl + "md.jpeg",
+        coinValue: this.coinForm.quantity,
+      };
+      this.$refs["coinForm"].validate((valid) => {
+        if (valid) {
+          this.$emit("confirmCoin", coin);
+        } else {
+          return false;
+        }
+      });
+    },
+    close() {
+      this.$emit("close");
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.dialog-btn {
+  display: flex;
+  align-content: center;
+  justify-content: flex-end;
+  padding: 40px 0 0;
+  .ge {
+    width: 40px;
+  }
+}
+</style>

+ 181 - 0
src/views/business/ticket/components/CouponAdd.vue

@@ -0,0 +1,181 @@
+<template>
+  <div>
+    <el-dialog
+      title="添加券奖品"
+      width="1000px"
+      :visible.sync="dialogVisible"
+      :before-close="close"
+    >
+      <div class="dialog-search">
+        <div>券名称:</div>
+        <el-input
+          v-model="couponTitle"
+          placeholder="请输入券名称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="getCouponList"
+        />
+        <div class="ge"></div>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="getCouponList"
+          >查询</el-button
+        >
+      </div>
+      <el-table
+        v-loading="loading"
+        :data="couponList"
+        @selection-change="handleSelectionCoupon"
+        class="el-table"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+          fixed="left"
+        />
+        <el-table-column label="券ID" prop="couponId" />
+        <el-table-column label="券图片">
+          <template slot-scope="scope">
+            <div>
+              <el-image
+                style="width: 100px; height: 100px"
+                :src="scope.row.picUrl"
+                :preview-src-list="[scope.row.picUrl]"
+              >
+              </el-image>
+            </div>
+          </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>{{ scope.row.type.desc }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="券价格" min-width="85">
+          <template slot-scope="scope">
+            <div>¥{{ $numberFormat(scope.row.discount) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column label="有效期限" min-width="85">
+          <template slot-scope="scope">
+            <div>领取后{{ scope.row.dueDays }}天有效</div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="couponTotal > 0"
+        :total="couponTotal"
+        :page.sync="pageParams.pageNum"
+        :limit.sync="pageParams.pageSize"
+        @pagination="getCouponList"
+      />
+      <div class="dialog-btn">
+        <el-button size="small" @click="close"> 取 消 </el-button>
+        <div class="ge"></div>
+        <el-button type="primary" size="small" @click="confirmCoupon">
+          确 认
+        </el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { publicFileGetUrl } from "@/api/common";
+import { getCouponList } from "@/api/business/coupon";
+export default {
+  name: "CouponAdd",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      loading: false,
+      couponTitle: "", // 券名称
+      couponList: [], // 卡券列表
+      couponTotal: 0, // 卡券总数
+      selectCouponList: [], // 选中卡券
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+    };
+  },
+  created() {
+    this.getCouponList();
+  },
+  methods: {
+    // 卡券列表
+    getCouponList() {
+      this.loading = true;
+      getCouponList(
+        "pageNum=" +
+          this.pageParams.pageNum +
+          "&pageSize=" +
+          this.pageParams.pageSize +
+          "&",
+        { title: this.couponTitle, status: "on" }
+      ).then((res) => {
+        this.couponList = res.rows.map((item) => {
+          return {
+            ...item,
+            type: JSON.parse(item.type),
+            useArea: JSON.parse(item.useArea),
+            picUrl: publicFileGetUrl + item.picUrl,
+          };
+        });
+        this.couponTotal = res.total;
+        this.loading = false;
+      });
+    },
+
+    // 选中卡券
+    handleSelectionCoupon(e) {
+      this.selectCouponList = e.map((item) => {
+        return {
+          prizeType: "coupon",
+          // quantity: 1,
+          couponId: item.couponId,
+          picUrl: item.picUrl,
+          title: item.title,
+        };
+      });
+    },
+
+    // 确认选中卡券
+    confirmCoupon() {
+      this.$emit("confirmCoupon", this.selectCouponList);
+    },
+
+    close() {
+      this.$emit("close");
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.dialog-search {
+  display: flex;
+  line-height: 32px;
+  margin-bottom: 20px;
+  .ge {
+    width: 40px;
+  }
+}
+.dialog-btn {
+  display: flex;
+  align-content: center;
+  justify-content: flex-end;
+  padding: 40px 0 0;
+  .ge {
+    width: 40px;
+  }
+}
+</style>

+ 172 - 0
src/views/business/ticket/components/GoodsAdd.vue

@@ -0,0 +1,172 @@
+<template>
+  <div>
+    <el-dialog
+      title="添加实物奖品"
+      width="1000px"
+      :visible.sync="dialogVisible"
+      :before-close="close"
+    >
+      <div class="dialog-search">
+        <div>商品名称:</div>
+        <el-input
+          v-model="goodsTitle"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="getGoodsList()"
+        />
+        <div class="ge"></div>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="getGoodsList()"
+          >查询</el-button
+        >
+      </div>
+      <el-table
+        v-loading="loading"
+        :data="goodsList"
+        @selection-change="handleSelectionGoods"
+        class="el-table"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+          fixed="left"
+        />
+        <el-table-column label="商品ID" prop="goodsId" />
+        <el-table-column label="商品图片">
+          <template slot-scope="{ row }">
+            <div v-if="row.picUrl">
+              <el-image
+                style="width: 100px; height: 100px"
+                :src="row.picUrl.split(',')[0]"
+                :preview-src-list="row.picUrl.split(',')"
+              >
+              </el-image>
+            </div>
+            <p v-else>-</p>
+          </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="商品库存" prop="quantity" width="80" />
+      </el-table>
+      <pagination
+        v-show="goodsTotal > 0"
+        :total="goodsTotal"
+        :page.sync="pageParams.pageNum"
+        :limit.sync="pageParams.pageSize"
+        @pagination="getGoodsList"
+      />
+      <div class="dialog-btn">
+        <el-button size="small" @click="close"> 取 消 </el-button>
+        <div class="ge"></div>
+        <el-button type="primary" size="small" @click="confirmGoods">
+          确 认
+        </el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { publicFileGetUrl } from "@/api/common";
+import { getGoodsList } from "@/api/business/goods";
+export default {
+  name: "GoodsAdd",
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      loading: false,
+      goodsTitle: "", // 商品名称
+      goodsList: [], // 商品列表
+      goodsTotal: 0, // 商品总数
+      selectGoodsList: [], // 选中商品
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+    };
+  },
+  created() {
+    this.getGoodsList();
+  },
+  methods: {
+    // 商品列表
+    getGoodsList() {
+      this.loading = true;
+      getGoodsList(
+        "pageNum=" +
+          this.pageParams.pageNum +
+          "&pageSize=" +
+          this.pageParams.pageSize +
+          "&",
+        { title: this.goodsTitle, status: "on" }
+      ).then((res) => {
+        this.goodsList = res.rows.map((item) => {
+          return {
+            ...item,
+            picUrl: publicFileGetUrl + item.picUrl.split(",")[0],
+          };
+        });
+        this.goodsTotal = res.total;
+        this.loading = false;
+      });
+    },
+
+    // 选中商品
+    handleSelectionGoods(e) {
+      this.selectGoodsList = e.map((item) => {
+        return {
+          prizeType: "goods",
+          // quantity: 1,
+          goodsId: item.goodsId,
+          picUrl: item.picUrl,
+          title: item.title,
+        };
+      });
+    },
+
+    // 确认选中商品
+    confirmGoods() {
+      this.$emit("confirmGoods", this.selectGoodsList);
+    },
+
+    close() {
+      this.$emit("close");
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.dialog-search {
+  display: flex;
+  line-height: 32px;
+  margin-bottom: 20px;
+  .ge {
+    width: 40px;
+  }
+}
+.dialog-btn {
+  display: flex;
+  align-content: center;
+  justify-content: flex-end;
+  padding: 40px 0 0;
+  .ge {
+    width: 40px;
+  }
+}
+</style>

+ 45 - 513
src/views/business/ticket/create.vue

@@ -21,14 +21,13 @@
           </el-form-item>
           <el-form-item label="图片" prop="picUrl">
             <image-upload
+              v-model="ticketPicUrl"
               :limit="1"
-              :value="form.picUrl"
-              :is-public="true"
-              @input="pictureSelect"
+              :file-size="0.2"
             />
           </el-form-item>
           <div class="tip">
-            上传1张图片,支持jpg、png格式上传;
+            上传1张图片,支持jpg、png格式上传,大小不超过200k
           </div>
           <el-form-item label="面值" prop="facePrice">
             <el-input
@@ -101,79 +100,9 @@
       </div>
       <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>
-            奖级数量:
-            <el-input-number
-              v-model="item.quantity"
-              controls-position="right"
-              @change="handleChangeAll($event, item)"
-              :min="0"
-              size="small"
-            ></el-input-number>
-          </div>
-        </div>
-        <div class="prize-table">
-          <el-table :data="item.prizeList" class="el-table">
-            <el-table-column label="奖品图片">
-              <template slot-scope="scope">
-                <el-image
-                  style="width: 70px; height: 70px"
-                  :src="scope.row.picUrl"
-                  :preview-src-list="[scope.row.picUrl]"
-                >
-                </el-image>
-              </template>
-            </el-table-column>
-            <el-table-column label="奖品名称" prop="title" />
-            <el-table-column label="奖品类型">
-              <template slot-scope="scope">
-                <div v-if="scope.row.prizeType == 'goods'">商品</div>
-                <div v-if="scope.row.prizeType == 'coupon'">券</div>
-                <div v-if="scope.row.prizeType == 'coin'">盲豆</div>
-              </template>
-            </el-table-column>
-            <!-- <el-table-column label="奖品数量" prop="storeName">
-              <template slot-scope="scope">
-                <div>
-                  <el-input-number
-                    v-model="scope.row.quantity"
-                    controls-position="right"
-                    @change="handleChange($event, index)"
-                    :min="1"
-                    size="small"
-                  ></el-input-number>
-                </div>
-              </template>
-            </el-table-column> -->
-            <el-table-column label="操作" align="center">
-              <template slot-scope="scope">
-                <el-button
-                  size="mini"
-                  type="text"
-                  @click="handleDel(scope.$index, item)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <div class="prize-btn">
-          <el-dropdown @command="handleCommand($event, index)">
-            <el-button type="primary" size="small">
-              添加奖品<i class="el-icon-arrow-down el-icon--right"></i>
-            </el-button>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item command="goods">商品</el-dropdown-item>
-              <el-dropdown-item command="coupon">券</el-dropdown-item>
-              <el-dropdown-item command="coin">盲豆</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </div>
-      </div>
+
+      <!-- 奖级列表 -->
+      <awards-list ref="awards" v-model="awardsList" @handleCommand="handleCommand" @close="close" />
       <!-- 保存 -->
       <div class="save-btn">
         <el-button size="small" @click="back"> 取 消 </el-button>
@@ -185,213 +114,37 @@
     </div>
 
     <!-- 添加商品 -->
-    <el-dialog
-      title="添加实物奖品"
-      width="1000px"
-      :visible.sync="goodsTableVisible"
-      :before-close="close"
-    >
-      <div class="dialog-search">
-        <div>商品名称:</div>
-        <el-input
-          v-model="goodsTitle"
-          placeholder="请输入商品名称"
-          clearable
-          size="small"
-          style="width: 240px"
-          @keyup.enter.native="handleQueryGoods"
-        />
-        <div class="ge"></div>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQueryGoods"
-          >查询</el-button
-        >
-      </div>
-      <el-table
-        v-loading="loading"
-        :data="goodsList"
-        @selection-change="handleSelectionGoods"
-        class="el-table"
-      >
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-          fixed="left"
-        />
-        <el-table-column label="商品ID" prop="goodsId" />
-        <el-table-column label="商品图片">
-          <template slot-scope="{ row }">
-            <div v-if="row.picUrl">
-              <el-image
-                style="width: 100px; height: 100px"
-                :src="row.picUrl.split(',')[0]"
-                :preview-src-list="row.picUrl.split(',')"
-              >
-              </el-image>
-            </div>
-            <p v-else>-</p>
-          </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="商品库存" prop="quantity" width="80" />
-      </el-table>
-      <pagination
-        v-show="goodsTotal > 0"
-        :total="goodsTotal"
-        :page.sync="pageParams.pageNum"
-        :limit.sync="pageParams.pageSize"
-        @pagination="getGoodsList"
-      />
-      <div class="dialog-btn">
-        <el-button size="small" @click="close"> 取 消 </el-button>
-        <div class="ge"></div>
-        <el-button type="primary" size="small" @click="confirmGoods">
-          确 认
-        </el-button>
-      </div>
-    </el-dialog>
-    <!-- 添加卡券 -->
-    <el-dialog
-      title="添加券奖品"
-      width="1000px"
-      :visible.sync="couponTableVisible"
-      :before-close="close"
-    >
-      <div class="dialog-search">
-        <div>券名称:</div>
-        <el-input
-          v-model="couponTitle"
-          placeholder="请输入券名称"
-          clearable
-          size="small"
-          style="width: 240px"
-          @keyup.enter.native="handleQueryCoupon"
-        />
-        <div class="ge"></div>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQueryCoupon"
-          >查询</el-button
-        >
-      </div>
-      <el-table
-        v-loading="loading"
-        :data="couponList"
-        @selection-change="handleSelectionCoupon"
-        class="el-table"
-      >
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-          fixed="left"
-        />
-        <el-table-column label="券ID" prop="couponId" />
-        <el-table-column label="券图片">
-          <template slot-scope="scope">
-            <div>
-              <el-image
-                style="width: 100px; height: 100px"
-                :src="scope.row.picUrl"
-                :preview-src-list="[scope.row.picUrl]"
-              >
-              </el-image>
-            </div>
-          </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>{{ scope.row.type.desc }}</div>
-          </template>
-        </el-table-column>
-        <el-table-column label="券价格" min-width="85">
-          <template slot-scope="scope">
-            <div>¥{{ $numberFormat(scope.row.discount) }}</div>
-          </template>
-        </el-table-column>
-        <el-table-column label="有效期限" min-width="85">
-          <template slot-scope="scope">
-            <div>{{ scope.row.useArea.desc }}</div>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination
-        v-show="couponTotal > 0"
-        :total="couponTotal"
-        :page.sync="pageParams.pageNum"
-        :limit.sync="pageParams.pageSize"
-        @pagination="getCouponList"
-      />
-      <div class="dialog-btn">
-        <el-button size="small" @click="close"> 取 消 </el-button>
-        <div class="ge"></div>
-        <el-button type="primary" size="small" @click="confirmCoupon">
-          确 认
-        </el-button>
-      </div>
-    </el-dialog>
+    <goods-add :dialog-visible="goodsTableVisible" @close="close" @confirmGoods="confirmGoods" v-if="goodsTableVisible" />
+    <!-- 添加券 -->
+    <coupon-add :dialog-visible="couponTableVisible" @close="close" @confirmCoupon="confirmCoupon" v-if="couponTableVisible" />
     <!-- 添加盲豆 -->
-    <el-dialog
-      title="添加盲豆奖品"
-      :visible.sync="coinTableVisible"
-      :before-close="close"
-      width="500px"
-    >
-      <el-form
-        :model="coinForm"
-        :rules="coinRules"
-        ref="coinForm"
-        label-width="100px"
-      >
-        <el-form-item label="盲豆数量" prop="quantity">
-          <el-input
-            v-model="coinForm.quantity"
-            size="small"
-            placeholder="请输入盲豆数量"
-            style="width: 200px"
-          />
-        </el-form-item>
-      </el-form>
-      <div class="dialog-btn">
-        <el-button size="small" @click="close"> 取 消 </el-button>
-        <div class="ge"></div>
-        <el-button type="primary" size="small" @click="confirmCoin">
-          确 认
-        </el-button>
-      </div>
-    </el-dialog>
+    <coin-add :dialog-visible="coinTableVisible" @close="close" @confirmCoin="confirmCoin" v-if="coinTableVisible" /> 
   </div>
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import { getGoodsList } from "@/api/business/goods";
-import { getCouponList } from "@/api/business/coupon";
 import { ticketBoxCreate } from "@/api/business/ticket";
-import { publicFileGetUrl } from "@/api/common";
 import { accMul } from "@/utils/util";
+import AwardsList from "./components/AwardsList"
+import GoodsAdd from "./components/GoodsAdd"
+import CouponAdd from "./components/CouponAdd"
+import CoinAdd from "./components/CoinAdd"
 export default {
   name: "TicketCreate",
   mixins: [CustomFieldsMixin],
+  components: {
+    AwardsList,
+    GoodsAdd,
+    CouponAdd,
+    CoinAdd,
+  },
   data() {
     return {
       loading: false,
       form: {
         type: "online", //盲票类型
         title: "", // 盲票名称
-        picUrl: [], // 图片
+        picUrl: "", // 图片
         facePrice: "", // 面值
         salePrice: "", // 售价
         quantity: "", // 数量
@@ -408,7 +161,6 @@ export default {
         ],
         picUrl: [
           {
-            type: "array",
             required: true,
             message: "请上传盲票图片",
             trigger: "change",
@@ -467,154 +219,35 @@ export default {
           },
         ],
       },
-      // 奖级列表
-      awardsList: [
-        {
-          name: "奖品一",
-          sort: 1,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品二",
-          sort: 2,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品三",
-          sort: 3,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品四",
-          sort: 4,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品五",
-          sort: 5,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品六",
-          sort: 6,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品七",
-          sort: 7,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品八",
-          sort: 8,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品九",
-          sort: 9,
-          quantity: 0,
-          prizeList: [],
-        },
-        {
-          name: "奖品十",
-          sort: 10,
-          quantity: 0,
-          prizeList: [],
-        },
-      ],
-
-      prizeIndex: null, // 奖级下标
 
-      goodsTitle: "", // 商品名称
+      // 奖级列表
+      awardsList: [],
       goodsTableVisible: false, // 添加商品弹框
-      goodsList: [], // 商品列表
-      goodsTotal: 0, // 商品总数
-      selectGoodsList: [], // 选中商品
-
       couponTitle: "", // 券名称
       couponTableVisible: false, // 添加卡券弹框
-      couponList: [], // 卡券列表
-      couponTotal: 0, // 卡券总数
-      selectCouponList: [], // 选中卡券
-
       coinTableVisible: false, // 添加盲豆弹框
-      coinForm: { quantity: "" },
-      coinRules: {
-        quantity: [
-          { required: true, message: "请输入数量", trigger: "blur" },
-          {
-            pattern: /^([1-9]\d*)$/,
-            message: "请输入合法的数字",
-            trigger: ["blur", "change"],
-          },
-        ],
-      },
-
       pageParams: {
         pageNum: 1,
         pageSize: 10,
       },
     };
   },
-  created() {
-    this.getGoodsList();
-    this.getCouponList();
+  computed: {
+    ticketPicUrl: {
+      get() {
+        return this.form.picUrl ? this.form.picUrl.split(',').map(item => {
+          return {
+            fileName: item
+          }
+        }) : []
+      },
+      set(val) {
+        console.log('val', val)
+        this.$set(this.form, 'picUrl', val.map(item => { return item.fileName }).toString())
+      }
+    }
   },
   methods: {
-    // 商品列表
-    getGoodsList() {
-      this.loading = true;
-      getGoodsList(
-        "pageNum=" +
-          this.pageParams.pageNum +
-          "&pageSize=" +
-          this.pageParams.pageSize +
-          "&",
-        { title: this.goodsTitle, status: "on" }
-      ).then((res) => {
-        this.goodsList = res.rows.map((item) => {
-          return {
-            ...item,
-            picUrl: publicFileGetUrl + item.picUrl.split(',')[0],
-          };
-        });
-        this.goodsTotal = res.total;
-        this.loading = false;
-      });
-    },
-
-    // 卡券列表
-    getCouponList() {
-      this.loading = true;
-      getCouponList(
-        "pageNum=" +
-          this.pageParams.pageNum +
-          "&pageSize=" +
-          this.pageParams.pageSize +
-          "&",
-        { title: this.couponTitle, status: "on" }
-      ).then((res) => {
-        this.couponList = res.rows.map((item) => {
-          return {
-            ...item,
-            type: JSON.parse(item.type),
-            useArea: JSON.parse(item.useArea),
-            picUrl: publicFileGetUrl + item.picUrl,
-          };
-        });
-        this.couponTotal = res.total;
-        this.loading = false;
-      });
-    },
-
     // 保存
     submitForm() {
       const subForm = this.$refs["form"];
@@ -684,7 +317,6 @@ export default {
 
           let data = {
             ...this.form,
-            picUrl: this.form.picUrl[0].fileName,
             facePrice: accMul(this.form.facePrice, 100),
             salePrice: accMul(this.form.salePrice, 100),
             pkgSalePrice: accMul(this.form.pkgSalePrice, 100),
@@ -717,45 +349,15 @@ export default {
       });
     },
 
-    // 添加图片
-    pictureSelect(data) {
-      this.form.picUrl = data;
-    },
-
-    // 改变奖级数量
-    handleChangeAll(e, item) {
-      this.$set(item, "quantity", e);
-      this.$forceUpdate();
-      // this.getQuantity();
-    },
-
-    // 改变奖品数量
-    handleChange(e, index) {
-      this.prizeIndex = index;
-      this.$forceUpdate();
-      // this.getQuantity();
-    },
-
-    // 奖级商品删除
-    handleDel(index, item) {
-      this.prizeIndex = item.sort - 1;
-      let list = item.prizeList;
-      list.splice(index, 1);
-      this.$set(item, "prizeList", list);
-      // this.getQuantity();
-    },
-
     // 关闭弹框
     close() {
       this.goodsTableVisible = false;
       this.couponTableVisible = false;
       this.coinTableVisible = false;
-      this.coinForm.quantity = "";
     },
 
     // 添加奖品种类
-    handleCommand(e, index) {
-      this.prizeIndex = index;
+    handleCommand(e) {
       if (e == "goods") {
         this.goodsTableVisible = true;
       } else if (e == "coupon") {
@@ -765,89 +367,19 @@ export default {
       }
     },
 
-    // 查询商品
-    handleQueryGoods() {
-      this.getGoodsList();
-    },
-
-    // 查询券
-    handleQueryCoupon() {
-      this.getCouponList();
-    },
-
-    // 选中商品
-    handleSelectionGoods(e) {
-      this.selectGoodsList = e.map((item) => {
-        return {
-          prizeType: "goods",
-          // quantity: 1,
-          goodsId: item.goodsId,
-          picUrl: item.picUrl,
-          title: item.title,
-        };
-      });
-    },
-
-    // 选中卡券
-    handleSelectionCoupon(e) {
-      this.selectCouponList = e.map((item) => {
-        return {
-          prizeType: "coupon",
-          // quantity: 1,
-          couponId: item.couponId,
-          picUrl: item.picUrl,
-          title: item.title,
-        };
-      });
-    },
-
     // 确认选中商品
-    confirmGoods() {
-      this.awardsList[this.prizeIndex].prizeList = this.awardsList[
-        this.prizeIndex
-      ].prizeList.concat(this.selectGoodsList);
-      // this.getQuantity();
-      this.getGoodsList();
-      this.close();
+    confirmGoods(arr) {
+      this.$refs.awards.add(1, arr)
     },
 
     // 确认选中卡券
-    confirmCoupon() {
-      this.awardsList[this.prizeIndex].prizeList = this.awardsList[
-        this.prizeIndex
-      ].prizeList.concat(this.selectCouponList);
-      // this.getQuantity();
-      this.getCouponList();
-      this.close();
+    confirmCoupon(arr) {;
+      this.$refs.awards.add(1, arr)
     },
 
     // 确认输入盲豆
-    confirmCoin() {
-      let coin = {
-        prizeType: "coin",
-        // quantity: 1,
-        title: `盲豆 x${this.coinForm.quantity}`,
-        picUrl: publicFileGetUrl + "md.jpeg",
-        coinValue: this.coinForm.quantity,
-      };
-      this.$refs["coinForm"].validate((valid) => {
-        if (valid) {
-          this.awardsList[this.prizeIndex].prizeList.push(coin);
-          // this.getQuantity();
-          this.close();
-        } else {
-          return false;
-        }
-      });
-    },
-
-    // 计算奖级数量
-    getQuantity() {
-      let num = 0;
-      this.awardsList[this.prizeIndex].prizeList.forEach((item) => {
-        num += item.quantity;
-      });
-      this.awardsList[this.prizeIndex].quantity = num;
+    confirmCoin(obj) {
+      this.$refs.awards.add(2, obj)
     },
 
     // 取消
@@ -921,4 +453,4 @@ export default {
     width: 40px;
   }
 }
-</style>
+</style>

+ 42 - 18
src/views/order/channel/components/ExpressEdit.vue

@@ -12,7 +12,22 @@
         :rules="rules"
         label-width="100px"
       >
-        <el-form-item label="快递公司:" prop="deliveryId">
+        <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="请选择快递公司"
@@ -28,15 +43,6 @@
             />
           </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">
@@ -50,10 +56,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import {
-  companyList,
-  channelOrderShipUpdate,
-} from "@/api/business/order";
+import { companyList, channelOrderShipUpdate, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -74,15 +77,16 @@ export default {
       shipForm: {
         deliveryId: "",
         deliveryFlowId: "",
+        deliveryType: "1",
       },
       // 快递下拉列表
       companyData: [],
       rules: {
         deliveryId: [
-          { required: true, message: "请选择快递公司", trigger: "change" },
+          { required: false, message: "请选择快递公司", trigger: "change" },
         ],
         deliveryFlowId: [
-          { required: true, message: "请输入快递单号", trigger: "blur" },
+          { required: false, message: "请输入快递单号", trigger: "blur" },
         ],
       },
     };
@@ -95,8 +99,9 @@ export default {
     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");
@@ -104,6 +109,14 @@ export default {
       this.$refs["shipForm"].resetFields();
     },
 
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+      }
+    },
+
     // 快递下拉列表
     getCompanyList() {
       companyList({}).then((res) => {
@@ -111,6 +124,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    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;
@@ -148,4 +172,4 @@ export default {
 };
 </script>
 <style scoped>
-</style>
+</style>

+ 46 - 16
src/views/order/channel/components/SendGoods.vue

@@ -20,7 +20,23 @@
             `${goodsInfo.receiver},${goodsInfo.tel},${goodsInfo.province}${goodsInfo.city}${goodsInfo.area}${goodsInfo.address}`
           }}</span>
         </el-form-item>
-        <el-form-item label="快递公司:" prop="deliveryId">
+        <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
+            v-model="shipForm.deliveryFlowId"
+            @blur="InputBlur()"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 500px"
+          />
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1"  label="快递公司:" prop="deliveryId">
           <el-select
             v-model="shipForm.deliveryId"
             placeholder="请选择快递公司"
@@ -36,15 +52,6 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="快递单号:" prop="deliveryFlowId">
-          <el-input
-            v-model="shipForm.deliveryFlowId"
-            placeholder="输入快递单号"
-            clearable
-            size="small"
-            style="width: 500px"
-          />
-        </el-form-item>
         <el-form-item label="盲票组:">
           <el-select
             v-model="shipForm.boxId"
@@ -123,11 +130,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import {
-  companyList,
-  ticketPkgList,
-  channelOrderShip,
-} from "@/api/business/order";
+import { companyList, ticketPkgList, channelOrderShip, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -157,6 +160,7 @@ export default {
         deliveryId: "",
         deliveryFlowId: "",
         boxId: "",
+        deliveryType:"1",//物流配送方式单选框
       },
       // 快递下拉列表
       companyData: [],
@@ -182,6 +186,21 @@ export default {
       this.list = [];
       this.shipForm.boxId = "";
       this.$refs["shipForm"].resetFields();
+      this.shipForm.deliveryType = "1";
+    },
+
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+        this.shipForm.boxId = "";
+        this.list = [];
+      }
+      if(this.shipForm.deliveryType == '1'){
+        this.shipForm.boxId = "";
+        this.list = [];
+      }
     },
 
     // 快递下拉列表
@@ -191,6 +210,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    InputBlur(){
+      if (this.shipForm.deliveryFlowId){
+        automaticRecognition(this.shipForm.deliveryFlowId).then((res)=>{
+          if (res.code == 0 && res.data){
+            this.shipForm.deliveryId = res.data.deliveryId
+          }
+        })
+      }
+    },
+
     // 查询盲票组序列号
     querySearch(queryString, cb) {
       ticketPkgList({
@@ -275,4 +305,4 @@ export default {
   align-items: center;
   justify-content: space-between;
 }
-</style>
+</style>

+ 10 - 2
src/views/order/channel/detail.vue

@@ -84,6 +84,13 @@
             @click="toGoods()"
             >发货</el-button
           >
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">配送方式:</div>
+            <div class="txt">
+<!--              {{ info.deliveryType || "&#45;&#45;" }}-->
+              {{ "快递发货" || "--" }}
+            </div>
+          </div>
           <div class="info-item-content-one" v-if="status.value === 2">
             <div class="title">快递公司:</div>
             <div class="txt">
@@ -168,10 +175,11 @@
       :goods-info="info"
       @close="close"
     />
+
   </div>
 </template>
 <script>
-import { orderDetail, channelList } from "@/api/business/order";
+import { orderDetail, boxList } from "@/api/business/order";
 import { publicFileGetUrl } from "@/api/common";
 import { accMul } from "@/utils/util";
 import SendGoods from "./components/SendGoods";
@@ -218,7 +226,7 @@ export default {
   methods: {
     // 盲票组列表
     getChannelList(row) {
-      channelList({ orderId: this.orderId }).then((res) => {
+      boxList({ orderId: this.orderId }).then((res) => {
         this.boxData = res.data;
       });
     },

+ 41 - 18
src/views/order/deliver/components/ExpressEdit.vue

@@ -12,7 +12,21 @@
         :rules="rules"
         label-width="100px"
       >
-        <el-form-item label="快递公司:" prop="deliveryId">
+        <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="请选择快递公司"
@@ -28,15 +42,6 @@
             />
           </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">
@@ -50,10 +55,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import {
-  companyList,
-  deliverOrderShipUpdate,
-} from "@/api/business/order";
+import { companyList, deliverOrderShipUpdate, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -79,15 +81,16 @@ export default {
       shipForm: {
         deliveryId: "",
         deliveryFlowId: "",
+        deliveryType: "1",//配送方式
       },
       // 快递下拉列表
       companyData: [],
       rules: {
         deliveryId: [
-          { required: true, message: "请选择快递公司", trigger: "change" },
+          { required: false, message: "请选择快递公司", trigger: "change" },
         ],
         deliveryFlowId: [
-          { required: true, message: "请输入快递单号", trigger: "blur" },
+          { required: false, message: "请输入快递单号", trigger: "blur" },
         ],
       },
     };
@@ -100,8 +103,9 @@ export default {
     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");
@@ -109,6 +113,14 @@ export default {
       this.$refs["shipForm"].resetFields();
     },
 
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+      }
+    },
+
     // 快递下拉列表
     getCompanyList() {
       companyList({}).then((res) => {
@@ -116,6 +128,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    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;
@@ -154,4 +177,4 @@ export default {
 };
 </script>
 <style scoped>
-</style>
+</style>

+ 41 - 14
src/views/order/deliver/components/SendGoods.vue

@@ -20,7 +20,22 @@
             `${goodsInfo.receiver},${goodsInfo.tel},${goodsInfo.province}${goodsInfo.city}${goodsInfo.area}${goodsInfo.address}`
           }}</span>
         </el-form-item>
-        <el-form-item label="快递公司:" prop="deliveryId">
+        <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="请选择快递公司"
@@ -36,15 +51,6 @@
             />
           </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>
       <!-- 商品 -->
       <el-table
@@ -82,7 +88,7 @@
         </el-table-column>
         <el-table-column label="发货状态">
           <template slot-scope="{ row }">
-            <div>{{ row.deliveryFlowId ? "已发货" : "未发货" }}</div>
+            <div>{{ row.deliveryTime ? "已发货" : "未发货" }}</div>
           </template>
         </el-table-column>
       </el-table>
@@ -97,7 +103,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import { companyList, deliverOrderShip } from "@/api/business/order";
+import { companyList, deliverOrderShip, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -121,6 +127,7 @@ export default {
       shipForm: {
         deliveryId: "",
         deliveryFlowId: "",
+        deliveryType: "1",
       },
       // 快递下拉列表
       companyData: [],
@@ -141,12 +148,21 @@ export default {
   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) => {
@@ -154,6 +170,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    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
@@ -183,7 +210,7 @@ export default {
         return;
       }
       let index = this.goodsList.findIndex(item=>{
-        return item.deliveryFlowId
+        return item.deliveryTime
       })
       if(index != -1){
         this.msgError(`${ this.goodsList[index].title }已发货!`);
@@ -211,4 +238,4 @@ export default {
 };
 </script>
 <style>
-</style>
+</style>

+ 15 - 3
src/views/order/deliver/detail.vue

@@ -85,16 +85,28 @@
           v-for="(item, index) in deliverList"
           :key="index"
         >
-          <div class="logistics-title">快递{{ index + 1 }}</div>
+          <div class="logistics-title">包裹{{ index + 1 }}</div>
           <div class="info">
             <div class="info-one">
+              <div class="tit">配送方式:</div>
+              <div class="txt">{{ item.companyName || item.deliveryFlowId ? "快递发货":"无需物流" }}</div>
+            </div>
+            <div class="info-one" v-if="item.companyName">
               <div class="tit">快递公司:</div>
               <div class="txt">{{ item.companyName || "--" }}</div>
             </div>
-            <div class="info-one">
+            <div class="info-one" v-else>
+              <div class="tit"></div>
+              <div class="txt"></div>
+            </div>
+            <div class="info-one" v-if="item.deliveryFlowId">
               <div class="tit">快递单号:</div>
               <div class="txt">{{ item.deliveryFlowId || "--" }}</div>
             </div>
+            <div class="info-one" v-else>
+              <div class="tit"></div>
+              <div class="txt"></div>
+            </div>
             <div class="info-one">
               <div class="tit">发货时间:</div>
               <div class="txt">{{ parseTime(item.deliveryTime) || "--" }}</div>
@@ -143,7 +155,7 @@
           </el-table-column>
           <el-table-column label="状态">
             <template slot-scope="{ row }">
-              <div>{{ row.deliveryFlowId ? "已发货" : "未发货" }}</div>
+              <div>{{ row.deliveryTime ? "已发货" : "未发货" }}</div>
             </template>
           </el-table-column>
         </el-table>

+ 13 - 1
src/views/order/deliver/index.vue

@@ -50,6 +50,16 @@
         >
         </el-date-picker>
       </el-form-item>
+      <el-form-item label="收货人手机">
+        <el-input
+          v-model="queryParams.tel"
+          placeholder="输入手机号"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button
           type="primary"
@@ -218,6 +228,7 @@ export default {
         startTime: "",
         endTime: "",
         status: "",
+        tel:"",
       },
       // 分页
       pageParams: {
@@ -288,6 +299,7 @@ export default {
         startTime: "",
         endTime: "",
         status: "",
+        tel: "",
       };
       this.state = "no"
       this.tradeTimeArr = [];
@@ -367,4 +379,4 @@ export default {
 .ge {
   height: 20px;
 }
-</style>
+</style>

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно