Explorar el Código

Merge branch 'dev' into 'test'

Dev

See merge request quanshu/mp-ui-pc!2
zhong chunping hace 3 años
padre
commit
a68b2d090d

+ 2 - 0
.env.development

@@ -7,5 +7,7 @@ ENV = 'development'
 # 云管铺/开发环境
 VUE_APP_BASE_API = '/dev-api'
 
+VUE_APP_IMG_URL = 'https://mp-public-test-1307117429.cos.ap-shanghai.myqcloud.com/'
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 2 - 0
.env.production

@@ -6,3 +6,5 @@ ENV = 'production'
 
 # 云管铺/生产环境
 VUE_APP_BASE_API = '/prod-api'
+
+VUE_APP_IMG_URL = 'https://mp-public-test-1307117429.cos.ap-shanghai.myqcloud.com/'

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 17064
package-lock.json


+ 20 - 0
src/api/business/ticket.js

@@ -0,0 +1,20 @@
+import request from '@/utils/request'
+
+// 盲票列表
+export function getTicketList(urlParams, data) {
+    return request({
+      url: '/api/v1/mp/admin/ticket/box/list',
+      method: 'post',
+      data,
+      urlParams
+    })
+  }
+
+// 创建盲票组
+export function ticketBoxCreate(data) {
+    return request({
+      url: '/api/v1/mp/admin/ticket/box/create',
+      method: 'post',
+      data
+    })
+  }

+ 6 - 6
src/api/common.js

@@ -4,15 +4,15 @@ import request from '@/utils/request'
  * 附件
  * @param {*} data
  */
-export const privateFileSaveUrl = '/api/v1/ygp/image/remote/upload/1'
+export const privateFileSaveUrl = '/api/v1/mp/image/remote/upload/1'
 
-export const publicFileSaveUrl = '/api/v1/ygp/image/remote/upload/0'
+export const publicFileSaveUrl = '/api/v1/mp/image/remote/upload/0'
 
 // 云端非公开可访问的BaseUrl
-export const privateFileGetUrl = '/api/v1/ygp/file/remote/download?name='
+export const privateFileGetUrl = '/api/v1/mp/file/remote/download?name='
 
 // 云端公开可访问的BaseUrl
-export const publicFileGetUrl = process.env.NODE_ENV === "production" ? 'https://ygp-public-1307117429.cos.ap-shanghai.myqcloud.com/':'https://ygp-public-test-1307117429.cos.ap-shanghai.myqcloud.com/'
+export const publicFileGetUrl = process.env.NODE_ENV === "production" ? 'https://mp-public-1307117429.cos.ap-shanghai.myqcloud.com/':'https://mp-public-test-1307117429.cos.ap-shanghai.myqcloud.com/'
 
 /**
  * Put 方式上传图片
@@ -61,7 +61,7 @@ export function uploadFileRequest(data, bizType, config = {}) {
     formData.append(key, data[key])
   })
   return request({
-    url: '/api/v1/ygp/file/remote/upload/' + bizType,
+    url: '/api/v1/mp/file/remote/upload/' + bizType,
     method: 'put',
     data: formData ,
     ...config,
@@ -90,7 +90,7 @@ export function importFileSaveAPI(data, config = {}) {
     formData.append(key, data[key])
   })
   return request({
-    url: '/api/v1/ygp/meter/importData',
+    url: '/api/v1/mp/meter/importData',
     method: 'post',
     data: formData ,
     ...config,

+ 5 - 1
src/assets/styles/index.scss

@@ -213,4 +213,8 @@ aside {
 ::-webkit-scrollbar-track-piece { background-color: #f5f5f5; border-radius: 6px; }
 ::-webkit-scrollbar-thumb { background-color: #cccccc; border-radius: 6px; }
 ::-webkit-scrollbar-corner { background-color: #f5f5f5; }
-::-webkit-resizer { background-repeat: no-repeat; background-position: bottom right; }
+::-webkit-resizer { background-repeat: no-repeat; background-position: bottom right; }
+
+.del {
+  color: #F56C6C;
+}

+ 2 - 1
src/main.js

@@ -16,7 +16,7 @@ import './assets/icons' // icon
 import './permission' // permission control
 import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/util";
+import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree, numberFormat } from "@/utils/util";
 import Pagination from "@/components/Pagination";
 // 自定义表格工具组件
 import RightToolbar from "@/components/RightToolbar"
@@ -43,6 +43,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
 Vue.prototype.selectDictLabels = selectDictLabels
 Vue.prototype.download = download
 Vue.prototype.handleTree = handleTree
+Vue.prototype.$numberFormat = numberFormat
 
 // 处理时间的过滤器
 Vue.use(require('vue-moment'))

+ 15 - 1
src/router/index.js

@@ -149,7 +149,21 @@ 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/utils/util.js

@@ -175,7 +175,7 @@ export function accMul(arg1, arg2) {
 	return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
 }
 
-export function numberFormat(number, decimals, dec_point, thousands_sep) {
+export function numberFormat(number, decimals = 2, dec_point = '.', thousands_sep = ',') {
   /*
     * 参数说明:
     * number:要格式化的数字

+ 13 - 26
src/views/business/channel/components/Create.vue

@@ -24,7 +24,7 @@
          <el-input v-model="form.mobile" placeholder="请输入手机号码" />
        </el-form-item>
     </flexbox>
-      <flexbox class="ygp-form-items" align="flex-start" justify="flex-start">
+      <!-- <flexbox class="ygp-form-items" align="flex-start" justify="flex-start">
         <el-form-item label="上级渠道" prop="parentId" style="width: 50%;">
           <el-select
             v-model="form.parentId"
@@ -46,11 +46,11 @@
             </el-option>
           </el-select>
         </el-form-item>
-       <el-form-item label="联系人" prop="contact" style="width: 50%;">
-         <el-input v-model="form.contact" placeholder="联系人" />
-       </el-form-item>
-      </flexbox>
+      </flexbox> -->
       <flexbox class="ygp-form-items" align="flex-start" justify="flex-start">
+        <el-form-item label="联系人" prop="contact" style="width: 50%;">
+          <el-input v-model="form.contact" placeholder="联系人" />
+        </el-form-item>
         <el-form-item label="佣金比例" prop="commRate" style="width: 50%;">
           <el-input v-model="form.commRate" placeholder="请输入佣金比例" />
         </el-form-item>
@@ -157,7 +157,7 @@ export default {
           { required: true, message: "请输入手机号码", trigger: "blur" },
           {pattern: /^((\+?86)|(\(\+86\)))?1\d{10}$/, message: "请输入正确的手机号码", trigger: "blur" }
         ],
-        parentId: [{ required: true, message: "请选择上级渠道", trigger: "change" }],
+        // parentId: [{ required: true, message: "请选择上级渠道", trigger: "change" }],
         contact: [
           { required: true, message: "请输入联系人", trigger: "blur" }
         ],
@@ -178,7 +178,7 @@ export default {
   computed: {
     ...mapGetters(["userInfo"]),
     title() {
-      return this.editId ? "编辑渠道" : "添加渠道";
+      return this.editId ? "编辑一级渠道" : "添加一级渠道";
     }
   },
 
@@ -190,7 +190,7 @@ export default {
     if (this.editId) {
      // this.getDetail();
     }
-    this.getChannelList()
+    // this.getChannelList()
     this.getProvinceList()
   },
 
@@ -215,7 +215,7 @@ export default {
           name:'无(新建一级渠道)'
           }
           this.channelList.push(noneObj)
-        console.log("getChannelList == "+ JSON.stringify(response.data))
+        // console.log("getChannelList == "+ JSON.stringify(response.data))
          this.channelList = this.channelList.concat(response.data || []);
          this.channelCopyList = this.channelList;
       });
@@ -227,7 +227,7 @@ export default {
       this.form.cityId = ""
       this.form.areaId = ""
       listAreaByPid(0).then(response => {
-        console.log("getProvinceList"+JSON.stringify(response))
+        // console.log("getProvinceList"+JSON.stringify(response))
          this.provinceList = response || [];
       });
     },
@@ -254,7 +254,7 @@ export default {
       var provinceId = this.form.provinceId
       this.form.province = this.getProvinceName()
       listAreaByPid(provinceId).then(response => {
-        console.log("getCityList"+JSON.stringify(response))
+        // console.log("getCityList"+JSON.stringify(response))
          this.cityList = response || [];
       });
 
@@ -275,7 +275,7 @@ export default {
       var cityId = this.form.cityId
       this.form.city = this.getCityName();
       listAreaByPid(cityId).then(response => {
-        console.log("getAreaList"+JSON.stringify(response))
+        // console.log("getAreaList"+JSON.stringify(response))
          this.areaList = response || [];
       });
     },
@@ -307,19 +307,6 @@ export default {
     },
 
 
-    // /** 查询可分配的门店 */
-    getCustItems() {
-      this.custOptions = [];
-      itemCustomer({})
-        .then(res => {
-          const resData = res.data || [];
-          this.custOptions = resData;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
-    },
-
     /**
      * 获取项目详情
      */
@@ -366,7 +353,7 @@ export default {
      * 保存
      */
     submitForm(params) {
-       console.log("submitForm =============")
+      //  console.log("submitForm =============")
       if (this.editId) {
         params.channelId = this.editId;
       }

+ 6 - 6
src/views/business/channel/index.vue

@@ -98,7 +98,7 @@
               size="mini"
               @click="handleAdd"
               v-hasPermi="['system:user:add']"
-            >添加渠道</el-button>
+            >添加一级渠道</el-button>
           </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
@@ -155,14 +155,14 @@
               <span v-if="getValue(scope.row.status) == 1"> 停用</span>
               <span v-if="getValue(scope.row.status) == 2"> 启用</span>
               </el-button>
-              <el-button
+             <!-- <el-button
                 size="mini"
                 type="text"
                 disabled
                 icon="el-icon-plus"
                 @click="handleAdd(scope.row)"
                 v-hasPermi="['admin:channel:add']"
-              >添加子渠道</el-button>
+              >添加子渠道</el-button> -->
             </template>
           </el-table-column>
         </el-table>
@@ -310,7 +310,7 @@ export default {
       this.queryParams.cityId = ""
       this.queryParams.areaId = ""
       listAreaByPid(0).then(response => {
-        console.log("getProvinceList"+JSON.stringify(response))
+        // console.log("getProvinceList"+JSON.stringify(response))
          this.provinceList = response || [];
       });
     },
@@ -322,7 +322,7 @@ export default {
       this.queryParams.areaId = ""
       var provinceId = this.queryParams.provinceId
       listAreaByPid(provinceId).then(response => {
-        console.log("getCityList"+JSON.stringify(response))
+        // console.log("getCityList"+JSON.stringify(response))
          this.cityList = response || [];
       });
     },
@@ -330,7 +330,7 @@ export default {
     getAreaList(){
       var cityId = this.queryParams.cityId
       listAreaByPid(cityId).then(response => {
-        console.log("getAreaList"+JSON.stringify(response))
+        // console.log("getAreaList"+JSON.stringify(response))
          this.areaList = response || [];
       });
     },

+ 41 - 19
src/views/business/coupon/add.vue

@@ -1,41 +1,52 @@
 <template>
   <div class="app-container coupon-add">
+    <br>
     <el-row>
       <el-col :span="23">
         <el-form ref="addItem" :model="addData" :rules="rules" label-width="160px">
           <el-form-item label="代金券名称:" prop="title">
             <el-input v-model="addData.title" placeholder="请输入代金券名称" :maxlength="32" show-word-limit />
           </el-form-item>
-          <!-- <el-form-item label="主图:" prop="mainImg">
-            <Upload v-model="addData.mainImg" :accept="accept" :limit="isVideoMode? 1:3" :type="4"/>
-            <div class="tip" style="font-size: 12px;color: #777"> 可选上传3张图片 或 1个视频(限.mp4格式)。</div>
-          </el-form-item> -->
+          <el-form-item label="使用场景:" prop="type">
+            <el-radio-group v-model="addData.type">
+              <el-radio :label="1">门店消费</el-radio>
+              <el-radio :label="2">盲票购买</el-radio>
+            </el-radio-group>
+          </el-form-item>
           <el-form-item label="面值:" prop="discount">
             <el-input v-model.number="addData.discount" type="number" placeholder="请输入代金券面值">
               <template slot="append">元</template>
             </el-input>
           </el-form-item>
-          <el-form-item label="门店默认承担比例:" prop="bili">
-            <el-input v-model.number="addData.amount" type="number" placeholder="请输入面值">
+          <el-form-item label="数量:" prop="quantity">
+            <el-input v-model.number="addData.quantity" type="number" placeholder="请输入代金券数量">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+          <el-form-item label="图片:" prop="picUrl">
+            <Upload :value="addData.picUrl ? [{ fileName: addData.picUrl }] : []" @input="addData.picUrl = $event[0] ? $event[0].fileName : ''" :limit="1" />
+          </el-form-item>
+          <el-form-item label="门店默认承担比例:" prop="channelSharedRate">
+            <el-input v-model.number="addData.channelSharedRate" type="number" placeholder="请输入面值">
               <template slot="append">%</template>
             </el-input>
           </el-form-item>
-          <el-form-item label="最低消费金额:" prop="discount">
-            <el-input v-model.number="addData.discount" type="number" placeholder="请输入可使用的最低消费金额">
+          <el-form-item label="最低消费金额:" prop="minOrderAmt">
+            <el-input v-model.number="addData.minOrderAmt" type="number" placeholder="请输入可使用的最低消费金额">
               <template slot="append">元</template>
             </el-input>
           </el-form-item>
-          <el-form-item label="有效期类型:" prop="contactTel">
-            <el-input v-model="addData.contactTel" placeholder="请输入有效期类型">
+          <el-form-item label="有效期:" prop="dueDays">
+            <el-input v-model.number="addData.dueDays" placeholder="请输入有效期">
               <template slot="prepend">领取之日起</template>
               <template slot="append">天有效</template>
             </el-input>
           </el-form-item>
-          <el-form-item label="使用说明:" prop="detailAddress">
-            <el-input type="textarea" rows="4" v-model="addData.detailAddress" placeholder="使用说明仅用户可见"/>
+          <el-form-item label="使用说明:" prop="description">
+            <el-input type="textarea" rows="4" v-model="addData.description" placeholder="请输入使用说明 对用户可见"/>
           </el-form-item>
-          <el-form-item label="使用范围:" prop="detailAddress">
-            <el-radio-group v-model="radio">
+          <el-form-item label="使用范围:" prop="boxIds">
+            <el-radio-group v-model="addData.boxIds">
               <el-radio :label="1">进票门店</el-radio>
               <el-radio :label="2">所有盲票</el-radio>
               <el-radio :label="3">制定盲票</el-radio>
@@ -53,18 +64,29 @@
   </div>
 </template>
 <script>
-
+import Upload from '@/components/ImageUpload'
+import { getCouponDetail, addCoupon } from '@/api/business/coupon'
 export default {
   name: 'CouponAdd',
+  components: {
+    Upload
+  },
   data() {
     return {
       id: this.$route.query.id,
       addData: {},
       addIng: false,
       rules: {
-        title: [
-          { required: true, message: '请输入代金券名称', trigger: 'blur' }
-        ],
+        title: [{ required: true, message: '请输入代金券名称', trigger: 'blur' }],
+        type: [{ required: true, message: '请输入代金券类型', trigger: 'blur' }],
+        quantity: [{ required: true, message: '请输入代金券类型', trigger: 'blur' }],
+        picUrl: [{ required: true, message: '请输入代金券类型', trigger: 'blur' }],
+        discount: [{ required: true, message: '请输入代金券面值', trigger: 'blur' }],
+        channelSharedRate: [{ required: true, message: '请输入门店默认承担比例', trigger: 'blur' }],
+        minOrderAmt: [{ required: true, message: '请输入最低消费金额', trigger: 'blur' }],
+        dueDays: [{ required: true, message: '请输入有效期', trigger: 'blur' }],
+        description: [{ required: true, message: '请输入使用说明', trigger: 'blur' }],
+        boxIds: [{ required: true, message: '请选择使用范围', trigger: 'blur' }]
       }
     }
   },
@@ -80,7 +102,7 @@ export default {
       this.$refs.addItem.validate((valid, items) => {
         if (valid) {
           this.addIng = true
-          action(this.addData).then(res => {
+          addCoupon(this.addData).then(res => {
             this.addIng = false
             if (res.code === 0) {
               this.$message({

+ 56 - 17
src/views/business/coupon/index.vue

@@ -1,18 +1,18 @@
 <template>
   <div class="app-container coupon-list">
     <el-form v-show="showSearch" :model="queryParams" ref="queryForm" :inline="true" size="small">
-      <el-form-item label="代金券名称" prop="title">
+      <el-form-item label="优惠券名称" prop="title">
         <el-input
           v-model="queryParams.title"
-          placeholder="请输入代金券名称"
+          placeholder="请输入优惠券名称"
           clearable
           @keyup.enter.native="queryParams.pageNum = 1;getList()"
         />
       </el-form-item>
       <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择代金券状态" clearable>
-          <el-option label="上架" value="1" />
-          <el-option label="下架" value="2" />
+        <el-select v-model="queryParams.status" placeholder="请选择优惠券状态" clearable>
+          <el-option label="上架" value="on" />
+          <el-option label="下架" value="off" />
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -28,26 +28,33 @@
           size="mini"
           @click="$router.push('/coupon/add')"
           v-hasPermi="['business:coupon:add']"
-        >添加门店代金券</el-button>
+        >添加门店优惠券</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" :data="tableData">
-      <el-table-column label="代金券ID" prop="id" min-width="70" />
-      <el-table-column label="代金券名称" prop="title" />
-      <el-table-column label="代金券金额" prop="amount" />
-      <el-table-column label="已领取数量" prop="quiety" />
-      <el-table-column label="有效期限" prop="lastMessageTime" />
+      <el-table-column label="优惠券ID" prop="couponId" width="80" />
+      <el-table-column label="优惠券名称" prop="title" />
+      <el-table-column label="优惠券金额" prop="discount" />
+      <el-table-column label="优惠券类型" prop="type">
+        <template slot-scope="{row}">
+          <span v-if="row.type === 1">门店消费</span>
+          <span v-if="row.type === 2">盲票购买</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="已领取数量" prop="quantity" />
+      <el-table-column label="有效期限(天)" prop="dueDays" />
       <el-table-column label="状态" prop="status">
         <template slot-scope="{row}">
-          {{ JSON.parse(row.status).desc }}
+          <el-tag :type="JSON.parse(row.status).value === 'on' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
         </template>
       </el-table-column>
-      <el-table-column fixed="right" align="right" label="操作" width="120">
+      <el-table-column fixed="right" align="right" label="操作" width="150">
         <template slot-scope="{row}">
-          <el-button type="text">查看</el-button>
-          <el-button type="text">下架</el-button>
-          <!-- <el-button type="text">门店承担比例</el-button> -->
+          <el-button v-hasPermi="['business:coupon:edit']" type="text" @click="$router.push('/coupon/edit?id=' + row.couponId)">编辑</el-button>
+          <el-button v-if="JSON.parse(row.status).value === 'off'" v-hasPermi="['business:coupon:on']" type="text" @click="setStatus(row, 'on')">上架</el-button>
+          <el-button v-if="JSON.parse(row.status).value === 'on'" v-hasPermi="['business:coupon:off']" type="text" @click="setStatus(row, 'off')">下架</el-button>
+          <el-button v-if="JSON.parse(row.status).value === 'off'" v-hasPermi="['business:coupon:remove']" class="del" type="text" @click="del(row)">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -55,13 +62,14 @@
   </div>
 </template>
 <script>
-import { getCouponList } from '@/api/business/coupon'
+import { getCouponList, delCoupon, setCouponStatus } from '@/api/business/coupon'
 export default {
   name: 'CouponList',
   data() {
     return {
       loading: false,
       showSearch: true,
+      tableData: [],
       queryParams: {},
       total: 0
     }
@@ -87,6 +95,37 @@ export default {
       }).catch(() => {
         this.loading = false
       })
+    },
+    setStatus(item, status) {
+      this.$confirm(`确认${status === 'on' ? '上架' : '下架'}代金券 “${item.title}” 吗?`, `${status === 'on' ? '上架' : '下架'}代金券`, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        setCouponStatus({
+          couponId: item.couponId,
+          status
+        }).then(res => {
+          if (res.code === 0) {
+            this.$message.success('操作已完成!')
+            this.getList()
+          }
+        })
+      })
+    },
+    del(item) {
+      this.$confirm(`确认删除代金券 “${item.title}” 吗?`, '删除代金券', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delCoupon(item.couponId).then(res => {
+          if (res.code === 0) {
+            this.$message.success('操作已完成!')
+            this.getList()
+          }
+        })
+      })
     }
   }
 }

+ 459 - 0
src/views/business/goods/add.vue

@@ -0,0 +1,459 @@
+<template>
+  <div class="app-container goods-add">
+    <el-divider content-position="left">商品信息</el-divider>
+    <el-form ref="addItem" :rules="rules" :model="addData" label-width="120px">
+      <el-row :gutter="40">
+        <el-col :span="23">
+          <el-form-item label="商品名称:" prop="title">
+            <el-input v-model="addData.title" placeholder="请输入商品名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="23">
+          <el-form-item label="商品主图:" prop="picUrl">
+            <Upload v-model="mainPicUrl" :limit="8" />
+            <br>
+            <div class="tip">支持jpg、png格式上传,建议使用尺寸800x800像素以上、大小不超过1M的正方形图片;</div>
+          </el-form-item>
+        </el-col>
+        <el-col :span="23">
+          <el-form-item label="支持盲豆兑换:" prop="exchangeShow">
+            <el-switch
+              v-model="addData.exchangeShow"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+              :active-value="1"
+              :inactive-value="0"
+              active-text="支持"
+              inactive-text="不支持">
+            </el-switch>
+            <div class="tip">关闭则不再兑换大厅显示,不支持盲豆兑换。</div>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider content-position="left">价格库存</el-divider>
+      <el-row :gutter="40">
+        <el-col :span="23">
+          <el-form-item label="启用多SKU:" prop="multiSku">
+            <!-- <el-switch
+              v-model="addData.multiSku"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+              :active-value="1"
+              :inactive-value="0"
+              active-text="是"
+              inactive-text="否"
+            /> -->
+            <el-radio-group v-model="addData.multiSku">
+              <el-radio-button :label="0">单规格</el-radio-button>
+              <el-radio-button :label="1">多规格</el-radio-button>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row v-if="!multipleSpec" :gutter="40">
+        <el-col :span="11">
+          <el-form-item label="价格:" prop="value">
+            <el-input v-model="addData.value" type="number" placeholder="请输入商品价格">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="成本:" prop="cost">
+            <el-input v-model.number="addData.cost" type="number" placeholder="请输入商品成本">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="11">
+          <el-form-item label="原兑换价格:" prop="originPrice">
+            <el-input v-model="addData.originPrice" type="number" placeholder="请输入原兑换价格">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="现兑换价格:" prop="exchangePrice">
+            <el-input v-model="addData.exchangePrice" type="number" placeholder="请输入现兑换价格">
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="11">
+          <el-form-item label="库存:" prop="quantity">
+            <el-input-number v-model="addData.quantity" placeholder="请输入商品库存" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div v-if="multipleSpec">
+      <div style="margin-bottom: 16px">
+        <el-button :plain="true" type="primary" size="small" @click="handleSpecificationShow">添加规格</el-button>
+      </div>
+      <el-table :data="specifications">
+        <el-table-column property="specification" label="规格名"/>
+        <el-table-column property="value" label="规格值">
+          <template slot-scope="scope">
+            <el-tag type="primary">
+              {{ scope.row.value }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="120">
+          <template slot-scope="scope">
+            <el-button type="danger" size="small" @click="handleSpecificationDelete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <el-dialog :visible.sync="specVisiable" title="设置规格" :close-on-click-modal="false" width="400px">
+      <el-form ref="specForm" :model="specForm" label-width="80px">
+        <el-form-item label="规格名:" prop="specification">
+          <el-input v-model="specForm.specification"/>
+        </el-form-item>
+        <el-form-item label="规格值:" prop="value">
+          <el-input v-model="specForm.value"/>
+          <div class="tip">多个规格值请用逗号隔开</div>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="specVisiable = false">取消</el-button>
+        <el-button type="primary" @click="handleSpecificationAdd">确定</el-button>
+      </div>
+    </el-dialog>
+    <br>
+    <el-table v-if="multipleSpec" :data="products">
+      <el-table-column property="name" label="sku名称" />
+      <el-table-column property="picUrl" width="100" label="商品图片">
+        <template slot-scope="scope">
+          <img v-if="scope.row.picUrl" :src="IMG_URL+scope.row.picUrl" width="40">
+        </template>
+      </el-table-column>
+      <el-table-column property="value" label="价格"/>
+      <el-table-column property="originPrice" label="原兑换价格"/>
+      <el-table-column property="exchangePrice" label="现兑换价格"/>
+      <el-table-column property="cost" label="成本"/>
+      <el-table-column property="quantity" label="库存数量"/>
+      <el-table-column align="center" label="操作" width="120">
+        <template slot-scope="scope">
+          <el-button type="primary" size="mini" @click="handleProductShow(scope.row)">设置</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-dialog :visible.sync="productVisiable" title="设置商品" :close-on-click-modal="false" width="400px">
+      <el-form ref="productForm" :model="productForm" label-width="100px">
+        <el-form-item label="sku名称:" prop="name">
+          <el-input v-model="productForm.name" />
+        </el-form-item>
+        <el-form-item label="价格:" prop="value">
+          <el-input-number v-model="productForm.value" />
+        </el-form-item>
+        <el-form-item label="原兑换价格:" prop="originPrice">
+          <el-input-number v-model="productForm.originPrice"/>
+        </el-form-item>
+        <el-form-item label="现兑换价格:" prop="exchangePrice">
+          <el-input-number v-model="productForm.exchangePrice"/>
+        </el-form-item>
+        <el-form-item label="成本:" prop="cost">
+          <el-input-number v-model="productForm.cost"/>
+        </el-form-item>
+        <el-form-item label="库存数量:" prop="quantity">
+          <el-input-number v-model="productForm.quantity"/>
+        </el-form-item>
+        <el-form-item label="商品图片:" prop="picUrl">
+          <Upload :value="productForm.picUrl ? [{ fileName: productForm.picUrl }] : []" @input="productForm.picUrl = $event[0] ? $event[0].fileName : ''" :limit="1" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="productVisiable = false">取消</el-button>
+        <el-button type="primary" @click="handleProductEdit">确定</el-button>
+      </div>
+    </el-dialog>
+    <br>
+    <el-row>
+      <el-col :span="24" style="text-align: right">
+        <el-button type="primary" @click="updateItem()">发布</el-button>
+        <el-button type="info" @click="$router.replace('/goods/list')">取消</el-button>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script>
+import Upload from '@/components/ImageUpload'
+import { getGoodsDetail, addGoods } from '@/api/business/goods'
+export default {
+  components: {
+    Upload
+  },
+  data() {
+    return {
+      IMG_URL: process.env.VUE_APP_IMG_URL,
+      id: this.$route.query.id,
+      addData: {
+        multiSku: 0
+      },
+      rules: {
+        title: [{ required: true, message: '请输入商品名称', trigger: 'blur' }]
+      },
+      dragOptions: {
+        animation: 100,
+      },
+      specifications: [],
+      products: [],
+      specVisiable: false, // 规格弹窗
+      specForm: {}, // 规格暂存
+      productVisiable: false,
+      productForm: {},
+    }
+  },
+  computed: {
+    multipleSpec() {
+      return this.addData.multiSku === 1
+    },
+    mainPicUrl: {
+      get() {
+        return this.addData.picUrl ? this.addData.picUrl.split(',').map(item => {
+          return {
+            fileName: item
+          }
+        }) : []
+      },
+      set(val) {
+        this.addData.picUrl = val.map(item => { return item.fileName }).toString()
+      }
+    }
+  },
+  created() {
+    if (this.id) {
+      getGoodsDetail(this.id).then(res => {
+        this.addData = res.data
+      })
+    }
+  },
+  methods: {
+    beforeUpload(e) {
+      if (e.size > 1024000) {
+        this.$message({
+          message: '图片过大,请调整大小确保不超过1M!',
+          type: 'warning'
+        });
+        return false
+      }
+    },
+    handleSpecificationShow() {
+      this.specForm = {}
+      this.specVisiable = true
+    },
+    handleSpecificationDelete(row) {
+      const index = this.specifications.indexOf(row)
+      this.specifications.splice(index, 1)
+      this.specToProduct()
+    },
+    specToProduct() {
+      if (this.specifications.length === 0) {
+        return
+      }
+      // 根据specifications创建临时规格列表
+      var specValues = []
+      var spec = this.specifications[0].specification
+      var values = []
+      values.push(0)
+
+      for (var i = 1; i < this.specifications.length; i++) {
+        const aspec = this.specifications[i].specification
+
+        if (aspec === spec) {
+          values.push(i)
+        } else {
+          specValues.push(values)
+          spec = aspec
+          values = []
+          values.push(i)
+        }
+      }
+      specValues.push(values)
+
+      // 根据临时规格列表生产商品规格
+      // 算法基于 https://blog.csdn.net/tyhj_sf/article/details/53893125
+      var productsIndex = 0
+      var products = []
+      var combination = []
+      var n = specValues.length
+      for (var s = 0; s < n; s++) {
+        combination[s] = 0
+      }
+      var index = 0
+      var isContinue = false
+      do {
+        var specifications = []
+        var properties = ''
+        for (var x = 0; x < n; x++) {
+          var z = specValues[x][combination[x]]
+          specifications.push(this.specifications[z].value)
+          properties = `${properties ? (properties + ';') : ''}${this.specifications[z].specification}:${this.specifications[z].value}`
+        }
+        products[productsIndex] = {
+          idx: productsIndex,
+          name: specifications.toString(),
+          picUrl: '',
+          originPrice: 0.00,
+          exchangePrice: 0.00,
+          value: 0.00,
+          cost: 0.00,
+          quantity: 0,
+          properties
+        }
+        productsIndex++
+
+        index++
+        combination[n - 1] = index
+        for (var j = n - 1; j >= 0; j--) {
+          if (combination[j] >= specValues[j].length) {
+            combination[j] = 0
+            index = 0
+            if (j - 1 >= 0) {
+              combination[j - 1] = combination[j - 1] + 1
+            }
+          }
+        }
+        isContinue = false
+        for (var p = 0; p < n; p++) {
+          if (combination[p] !== 0) {
+            isContinue = true
+          }
+        }
+      } while (isContinue)
+
+      this.products = products
+    },
+    handleSpecificationAdd() {
+      const valueArr = this.specForm.value.replace(/,/ig,',').replace(/\s*/g,"").split(',') // 替换所有的中文逗号为英文逗号并去空格
+      valueArr.forEach(element => {
+        let index = this.specifications.length - 1
+        for (var i = 0; i < this.specifications.length; i++) {
+          const v = this.specifications[i]
+          if (v.specification === this.specForm.specification) {
+            if (v.value !== element) {
+              index = i
+            }
+          }
+        }
+        this.specifications.splice(index + 1, 0, {
+          specification: this.specForm.specification,
+          value: element
+        })
+        
+      });
+      this.specToProduct()
+      this.specVisiable = false
+    },
+    handleProductShow(row) {
+      this.productForm = Object.assign({}, row)
+      this.productVisiable = true
+    },
+    handleProductEdit() {
+      for (var i = 0; i < this.products.length; i++) {
+        const v = this.products[i]
+        if (v.idx === this.productForm.idx) {
+          this.products.splice(i, 1, this.productForm)
+          break
+        }
+      }
+      this.productVisiable = false
+    },
+    updateItem() {
+      this.$refs.addItem.validate((valid, items) => {
+        if (valid) {
+          this.addData.skuList = this.products
+          addGoods(this.addData).then(res => {
+            if (res.code === 0) {
+              this.$message({
+                message: this.addData.goodsId ? '修改成功!' : '添加成功!',
+                type: 'success'
+              })
+              this.$router.go(-1)
+            }
+          })
+        } else {
+          if (items && Object.keys(items).length>0) {
+            this.$message({
+              message: items[Object.keys(items)[0]][0].message,
+              type: 'warning'
+            })
+          }
+          
+        }
+      })
+    },
+
+    
+  }
+}
+</script>
+<style lang="scss">
+.goods-add {
+  .tip {
+    font-size: 12px;
+    color: #999;
+  }
+  .el-divider {
+    .is-left {
+      color: #409EFF;
+      font-size: 20px;
+      font-weight: bolder;
+      left: 10px;
+    }
+  }
+  .flip-list-move {
+    transition: transform 0.5s;
+  }
+  .no-move {
+    transition: transform 0s;
+  }
+  .ghost {
+    opacity: 0.5;
+    background: #c8ebfb;
+  }
+  .list-group {
+    min-height: 120px;
+    padding: 20px;
+    border: 1px solid #EEE;
+  }
+  .list-empty {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 14px;
+    color: #888;
+    height: 100px;
+  }
+  .list-group-item, .list-group-header {
+    padding: 0 16px;
+    height: 40px;
+    border-bottom: 1px solid #EBEEF5;
+    cursor: move;
+    display: flex;
+    align-items: center;
+    font-size: 14px;
+    color: #606266;
+    justify-content: space-between;
+    .f1 {
+      flex: 1;
+    }
+    .f2 {
+      flex: 2;
+    }
+    .tr {
+      text-align: right;
+    }
+  }
+  .list-group-header {
+    cursor: default;
+    background: #EBEEF5;
+  }
+  .list-group-item:hover {
+    background: #F3F6F9;
+  }
+}
+</style>

+ 58 - 17
src/views/business/goods/index.vue

@@ -19,8 +19,8 @@
       </el-form-item>
       <el-form-item label="上架状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable>
-          <el-option label="上架" value="1" />
-          <el-option label="下架" value="2" />
+          <el-option label="上架" value="on" />
+          <el-option label="下架" value="off" />
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -31,31 +31,39 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="10">
         <el-button v-hasPermi="['business:goods:add']" type="primary" icon="el-icon-plus" size="mini" @click="$router.push('/goods/add')">添加商品</el-button>
-        <el-button v-hasPermi="['business:goods:on']" type="primary" plain size="mini">上架</el-button>
-        <el-button v-hasPermi="['business:goods:off']" type="primary" plain size="mini">下架</el-button>
-        <el-button v-hasPermi="['business:goods:remove']" type="danger" plain size="mini">删除</el-button>
+        <!-- <el-button v-hasPermi="['business:goods:on']" type="primary" plain size="mini">上架</el-button> -->
+        <!-- <el-button v-hasPermi="['business:goods:off']" type="primary" plain size="mini">下架</el-button> -->
+        <!-- <el-button v-hasPermi="['business:goods:remove']" type="danger" plain size="mini">删除</el-button> -->
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" :data="tableData">
-      <el-table-column label="商品ID" prop="id" min-width="70" />
-      <el-table-column label="商品图片" prop="title" />
+      <el-table-column label="商品ID" prop="goodsId" width="60" />
+      <el-table-column label="商品图片" prop="picUrl" align="center" width="80">
+        <template slot-scope="{row}">
+          <a target="_black" v-if="row.picUrl && row.picUrl.split(',').length > 0" :href="`${IMG_URL + row.picUrl}`"><img :src="`${IMG_URL + row.picUrl.split(',')[0]}`" style="max-height: 37px;max-width: 54px"></a>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
       <el-table-column label="商品名称" prop="title" />
-      <el-table-column label="价格" prop="amount" />
-      <el-table-column label="兑换盲豆" prop="quiety" />
-      <el-table-column label="销量" prop="lastMessageTime" />
-      <el-table-column label="库存" prop="lastMessageTime" />
+      <el-table-column label="价格" prop="value" />
+      <el-table-column label="兑换盲豆" prop="exchangePrice" />
+      <el-table-column label="销量" prop="exchangedQty" />
+      <el-table-column label="库存" prop="quantity" />
       <el-table-column label="状态" prop="status">
         <template slot-scope="{row}">
-          {{ JSON.parse(row.status).desc }}
+          <el-tag v-if="row.status === 'on'" type="success">上架</el-tag>
+          <el-tag v-else-if="row.status === 'off'" type="info">下架</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="排序" prop="lastMessageTime" />
+      <el-table-column label="排序" prop="sort" />
       <el-table-column fixed="right" align="right" label="操作" width="140">
         <template slot-scope="{row}">
-          <el-button v-hasPermi="['business:goods:query']" type="text">查看</el-button>
-          <el-button v-hasPermi="['business:goods:edit']" type="text">编辑</el-button>
-          <el-button v-hasPermi="['business:goods:off']" type="text">下架</el-button>
+          <!-- <el-button v-hasPermi="['business:goods:query']" type="text">查看</el-button> -->
+          <el-button v-hasPermi="['business:goods:edit']" type="text" @click="$router.push('/goods/edit?id=' + row.goodsId)">编辑</el-button>
+          <el-button v-if="row.status === 'off'" v-hasPermi="['business:goods:on']" type="text" @click="setStatus(row, 'on')">上架</el-button>
+          <el-button v-if="row.status === 'on'" v-hasPermi="['business:goods:off']" type="text" @click="setStatus(row, 'off')">下架</el-button>
+          <el-button v-if="row.status === 'off'" v-hasPermi="['business:coupon:remove']" class="del" type="text" @click="del(row)">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -63,14 +71,16 @@
   </div>
 </template>
 <script>
-import { getGoodsList } from '@/api/business/goods'
+import { getGoodsList, delGoods, setGoodsStatus } from '@/api/business/goods'
 export default {
   name: 'GoodsList',
   data() {
     return {
+      IMG_URL: process.env.VUE_APP_IMG_URL,
       loading: false,
       showSearch: true,
       queryParams: {},
+      tableData: [],
       total: 0
     }
   },
@@ -95,6 +105,37 @@ export default {
       }).catch(() => {
         this.loading = false
       })
+    },
+    setStatus(item, status) {
+      this.$confirm(`确认${status === 'on' ? '上架' : '下架'}商品 “${item.title}” 吗?`, `${status === 'on' ? '上架' : '下架'}商品`, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        setGoodsStatus({
+          goodsId: item.goodsId,
+          status
+        }).then(res => {
+          if (res.code === 0) {
+            this.$message.success('操作已完成!')
+            this.getList()
+          }
+        })
+      })
+    },
+    del(item) {
+      this.$confirm(`确认删除商品 “${item.title}” 吗?`, '删除商品', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delGoods(item.goodsId).then(res => {
+          if (res.code === 0) {
+            this.$message.success('操作已完成!')
+            this.getList()
+          }
+        })
+      })
     }
   }
 }

+ 3 - 3
src/views/business/salesite/index.vue

@@ -287,7 +287,7 @@ export default {
       this.queryParams.cityId = ""
       this.queryParams.areaId = ""
       listAreaByPid(0).then(response => {
-        console.log("getProvinceList"+JSON.stringify(response))
+        // console.log("getProvinceList"+JSON.stringify(response))
          this.provinceList = response || [];
       });
     },
@@ -299,7 +299,7 @@ export default {
       this.queryParams.areaId = ""
       var provinceId = this.queryParams.provinceId
       listAreaByPid(provinceId).then(response => {
-        console.log("getCityList"+JSON.stringify(response))
+        // console.log("getCityList"+JSON.stringify(response))
          this.cityList = response || [];
       });
     },
@@ -307,7 +307,7 @@ export default {
     getAreaList(){
       var cityId = this.queryParams.cityId
       listAreaByPid(cityId).then(response => {
-        console.log("getAreaList"+JSON.stringify(response))
+        // console.log("getAreaList"+JSON.stringify(response))
          this.areaList = response || [];
       });
     },

+ 832 - 0
src/views/business/ticket/create.vue

@@ -0,0 +1,832 @@
+<template>
+  <div class="app-container">
+    <div class="base-info">
+      <div class="base-info-title">基础信息</div>
+      <!-- 基础信息 -->
+      <div class="base-info-form">
+        <el-form :model="form" :rules="rules" ref="form" label-width="100px">
+          <el-form-item label="盲票类型" prop="type">
+            <el-radio-group v-model="form.type" size="small">
+              <el-radio label="online">线上盲票</el-radio>
+              <el-radio label="offline">线下盲票</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="盲票组名称" prop="title">
+            <el-input
+              v-model="form.title"
+              style="width: 587px"
+              size="small"
+              placeholder="请输入盲票组名称"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="图片" prop="picUrl">
+            <image-upload
+              :limit="1"
+              :value="form.picUrl"
+              :file-size="50"
+              :is-public="true"
+              @input="pictureSelect"
+            />
+          </el-form-item>
+          <div class="tip">
+            上传1张图片,支持jpg、png格式上传,建议使用尺寸800x800像素以上、大小不超过1M的正方形图片;
+          </div>
+          <el-form-item label="面值" prop="facePrice">
+            <el-input
+              v-model="form.facePrice"
+              style="width: 240px"
+              size="small"
+              placeholder="请输入面值"
+            >
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+          <el-form-item label="售价" prop="salePrice">
+            <el-input
+              v-model="form.salePrice"
+              style="width: 240px"
+              size="small"
+              placeholder="请输入售价"
+            >
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+          <el-form-item label="数量" prop="quantity">
+            <el-input
+              v-model="form.quantity"
+              style="width: 240px"
+              size="small"
+              placeholder="请输入数量"
+            >
+              <template slot="append">张</template>
+            </el-input>
+          </el-form-item>
+          <el-form-item
+            label="每包张数"
+            prop="pkgUnit"
+            v-if="form.type == 'offline'"
+          >
+            <el-input
+              v-model="form.pkgUnit"
+              style="width: 240px"
+              size="small"
+              placeholder="请输入每包张数"
+            >
+              <template slot="append">张</template>
+            </el-input>
+          </el-form-item>
+          <el-form-item
+            label="采购单价"
+            prop="pkgSalePrice"
+            v-if="form.type == 'offline'"
+          >
+            <el-input
+              v-model="form.pkgSalePrice"
+              style="width: 240px"
+              size="small"
+              placeholder="请输入采购单价"
+            >
+              <template slot="append">元/包</template>
+            </el-input>
+          </el-form-item>
+          <el-form-item label="分佣基数" prop="saleCommRate">
+            <el-input
+              v-model="form.saleCommRate"
+              style="width: 240px"
+              size="small"
+              placeholder="请输入分佣基数"
+            >
+              <template slot="append">%</template>
+            </el-input>
+          </el-form-item>
+          <div class="tip">
+            例如:盲票面值10元,分佣基数90%,经销商佣金比例20%,那么每卖一张票,经销商佣金为10元*90%*20%=1.8元
+          </div>
+        </el-form>
+      </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>奖级数量:{{ item.quantity }}</div>
+        </div>
+        <div class="prize-table">
+          <el-table :data="item.prizeList" class="el-table">
+            <el-table-column label="奖品图片" prop="storeName">
+              <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"
+                    :max="100"
+                    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 class="save-btn">
+        <el-button size="small" @click="back"> 取 消 </el-button>
+        <div class="ge"></div>
+        <el-button type="primary" size="small" @click="submitForm">
+          保 存
+        </el-button>
+      </div>
+    </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="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>¥{{ $numberFormat(scope.row.exchangePrice) }}</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>
+    <!-- 添加盲豆 -->
+    <el-dialog
+      title="添加盲豆奖品"
+      :visible.sync="coinTableVisible"
+      :before-close="close"
+    >
+      <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="请输入盲豆数量"
+          />
+        </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 { 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";
+export default {
+  name: "TicketCreate",
+  data() {
+    return {
+      loading: false,
+      form: {
+        type: "online", //盲票类型
+        title: "", // 盲票名称
+        picUrl: [], // 图片
+        facePrice: "", // 面值
+        salePrice: "", // 售价
+        quantity: "", // 数量
+        pkgUnit: "", // 张数
+        pkgSalePrice: "", // 单价
+        saleCommRate: "", // 基数
+      },
+      rules: {
+        type: [
+          { required: true, message: "请选择盲票类型", trigger: "change" },
+        ],
+        title: [
+          { required: true, message: "请输入盲票组名称", trigger: "blur" },
+        ],
+        picUrl: [
+          {
+            type: "array",
+            required: true,
+            message: "请上传盲票图片",
+            trigger: "change",
+          },
+        ],
+        facePrice: [
+          { required: true, message: "请输入面值", trigger: "blur" },
+          {
+            pattern:
+              /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/,
+            message: "请输入合法的金额数字,最多两位小数",
+            trigger: ["blur", "change"],
+          },
+        ],
+        salePrice: [
+          { required: true, message: "请输入售价", trigger: "blur" },
+          {
+            pattern:
+              /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/,
+            message: "请输入合法的金额数字,最多两位小数",
+            trigger: ["blur", "change"],
+          },
+        ],
+        quantity: [
+          { required: true, message: "请输入数量", trigger: "blur" },
+          {
+            pattern: /^([1-9]\d*)$/,
+            message: "请输入合法的数字",
+            trigger: ["blur", "change"],
+          },
+        ],
+        pkgUnit: [
+          { required: true, message: "请输入每包张数", trigger: "blur" },
+          {
+            pattern: /^([1-9]\d*)$/,
+            message: "请输入合法的数字",
+            trigger: ["blur", "change"],
+          },
+        ],
+        pkgSalePrice: [
+          { required: true, message: "请输入采购单价", trigger: "blur" },
+          {
+            pattern:
+              /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/,
+            message: "请输入合法的金额数字,最多两位小数",
+            trigger: ["blur", "change"],
+          },
+        ],
+        saleCommRate: [
+          { required: true, message: "请输入分佣基数", trigger: "blur" },
+          {
+            pattern:
+              /^([1-9]\d*(\.\d{1,2})?|([0](\.([0][1-9]|[1-9]\d{0,1}))))$/,
+            message: "请输入合法的数字,最多两位小数",
+            trigger: ["blur", "change"],
+          },
+        ],
+      },
+      // 奖级列表
+      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: [],
+        },
+      ],
+
+      prizeIndex: null, // 奖级下标
+
+      goodsTitle: "", // 商品名称
+      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: 5,
+      },
+    };
+  },
+  created() {
+    this.getGoodsList();
+    this.getCouponList();
+  },
+  methods: {
+    // 商品列表
+    getGoodsList(title) {
+      this.loading = true;
+      getGoodsList(
+        "pageNum=" +
+          this.pageParams.pageNum +
+          "&pageSize=" +
+          this.pageParams.pageSize +
+          "&",
+        { title: title }
+      ).then((res) => {
+        this.goodsList = res.rows.map((item) => {
+          return {
+            ...item,
+            picUrl: publicFileGetUrl + item.picUrl,
+          };
+        });
+        this.goodsTotal = res.total;
+        this.loading = false;
+      });
+    },
+
+    // 卡券列表
+    getCouponList(title) {
+      this.loading = true;
+      getCouponList(
+        "pageNum=" +
+          this.pageParams.pageNum +
+          "&pageSize=" +
+          this.pageParams.pageSize +
+          "&",
+        { title: title }
+      ).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() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          let prizeIndex = this.awardsList.findIndex((item) => {
+            return !item.prizeList.length;
+          });
+          // 判断没有设置奖品的奖级
+          if (prizeIndex != -1) {
+            this.$message.error(
+              `请设置${this.awardsList[prizeIndex].name}的奖品!`
+            );
+            return;
+          }
+          this.awardsList.forEach((item) => {
+            item.prizeList = item.prizeList.map((ele) => {
+              return {
+                // ...ele,
+                refId: ele.goodsId || ele.couponId,
+                prizeType: ele.prizeType,
+                quantity: ele.quantity,
+                value: Number(ele.coinValue),
+              };
+            });
+          });
+          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),
+            awardsList: this.awardsList,
+          };
+          const loading = this.$loading({
+            lock: true,
+            text: "保存中",
+            spinner: "el-icon-loading",
+            background: "rgba(0, 0, 0, 0.4)",
+          });
+          ticketBoxCreate(data)
+            .then((res) => {
+              if (res.code == 0) {
+                this.msgSuccess("保存成功");
+                this.$store.dispatch("tagsView/delView", this.$route);
+                this.$router.go(-1);
+                loading.close();
+              } else {
+                this.$message.error("保存失败,请重新添加!");
+                this.$store.dispatch("tagsView/delView", this.$route);
+                this.$router.go(-1);
+                loading.close();
+              }
+            })
+            .catch(() => {
+              this.$message.error("保存失败,请重新添加!");
+              this.$store.dispatch("tagsView/delView", this.$route);
+              this.$router.go(-1);
+              loading.close();
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+
+    // 添加图片
+    pictureSelect(data) {
+      this.form.picUrl = data;
+    },
+
+    // 改变奖品数量
+    handleChange(e, index) {
+      this.prizeIndex = index;
+      this.$forceUpdate();
+      this.getQuantity();
+    },
+
+    // 奖级商品删除
+    handleDel(e, item) {
+      let list = item.prizeList;
+      list.splice(0, 1);
+      this.$set(item, "prizeList", list);
+    },
+
+    // 关闭弹框
+    close() {
+      this.goodsTableVisible = false;
+      this.couponTableVisible = false;
+      this.coinTableVisible = false;
+      this.coinForm.quantity = "";
+    },
+
+    // 添加奖品种类
+    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;
+      }
+    },
+
+    // 查询商品
+    handleQueryGoods() {
+      this.getGoodsList(this.goodsTitle);
+    },
+
+    // 查询代金券
+    handleQueryCoupon() {
+      this.getCouponList(this.couponTitle);
+    },
+
+    // 选中商品
+    handleSelectionGoods(e) {
+      this.selectGoodsList = e;
+      this.selectGoodsList.forEach((item) => {
+        item.prizeType = "goods";
+        item.quantity = 1;
+      });
+    },
+
+    // 选中卡券
+    handleSelectionCoupon(e) {
+      this.selectCouponList = e;
+      this.selectCouponList.forEach((item) => {
+        item.prizeType = "coupon";
+        item.quantity = 1;
+      });
+    },
+
+    // 确认选中商品
+    confirmGoods() {
+      this.awardsList[this.prizeIndex].prizeList = this.awardsList[
+        this.prizeIndex
+      ].prizeList.concat(this.selectGoodsList);
+      this.getQuantity();
+      this.getGoodsList();
+      this.close();
+    },
+
+    // 确认选中卡券
+    confirmCoupon() {
+      this.awardsList[this.prizeIndex].prizeList = this.awardsList[
+        this.prizeIndex
+      ].prizeList.concat(this.selectCouponList);
+      this.getQuantity();
+      this.getCouponList();
+      this.close();
+    },
+
+    // 确认输入盲豆
+    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;
+    },
+
+    // 取消
+    back() {
+      this.$store.dispatch("tagsView/delView", this.$route);
+      this.$router.go(-1);
+    },
+  },
+};
+</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;
+    }
+  }
+  &-btn {
+    border-top: 1px solid #bbbbbb;
+    padding: 10px;
+  }
+}
+
+.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>

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


+ 254 - 0
src/views/business/ticket/index.vue

@@ -0,0 +1,254 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="90px"
+    >
+      <el-form-item label="盲票组名称">
+        <el-input
+          v-model="queryParams.title"
+          placeholder="请输入盲票组名称"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="盲票组类型">
+        <el-select
+          v-model="queryParams.ticketType"
+          placeholder="请选择盲票组类型"
+          clearable
+          size="small"
+          @change="handleQuery"
+        >
+          <el-option
+            v-for="item in ticketTypeArr"
+            :key="item.areaId"
+            :label="item.areaName"
+            :value="item.areaId"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="盲票组状态">
+        <el-select
+          v-model="queryParams.ticketState"
+          placeholder="请选择盲票组状态"
+          clearable
+          size="small"
+          @change="handleQuery"
+        >
+          <el-option
+            v-for="item in ticketStateArr"
+            :key="item.areaId"
+            :label="item.areaName"
+            :value="item.areaId"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['business:ticket:add']"
+          >添加盲票组</el-button
+        >
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="list"
+      @selection-change="handleSelectionChange"
+      class="el-table"
+    >
+      <el-table-column
+        type="selection"
+        width="55"
+        align="center"
+        fixed="left"
+      />
+      <el-table-column label="盲票组ID" prop="boxId" min-width="80" />
+      <el-table-column label="盲票图片" prop="picUrl" min-width="100">
+        <template slot-scope="scope">
+          <div>
+            <el-image
+              style="width: 100px; height: 100px"
+              :src="scope.row.picUrl"
+              :preview-src-list="[scope.row.picUrl]"
+            />
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="盲票组名称" prop="title" min-width="85" />
+      <el-table-column label="盲票组面值" prop="facePrice" min-width="85">
+        <template slot-scope="scope">
+          <div>¥{{ $numberFormat(scope.row.facePrice) }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="盲票总数" prop="quantity" width="90">
+        <template slot-scope="scope">
+          <div>{{ scope.row.quantity }}张</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="已售张数" prop="saleQty" min-width="90">
+        <template slot-scope="scope">
+          <div>{{ scope.row.saleQty }}张</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="盲票类型" prop="type" min-width="80">
+        <template slot-scope="scope">
+          {{ scope.row.type.desc }}
+        </template>
+      </el-table-column>
+      <el-table-column label="采购单价" prop="pkgSalePrice" min-width="90">
+        <template slot-scope="scope">
+          <div>¥{{ $numberFormat(scope.row.pkgSalePrice) }}/包</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="已采购数量" prop="salePkgQty" min-width="90">
+        <template slot-scope="scope">
+          <div>{{ scope.row.salePkgQty }}张</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" prop="status" min-width="80">
+        <template slot-scope="scope">
+          {{ scope.row.status.desc }}
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="操作"
+        align="center"
+        show-overflow-tooltip
+        class-name="small-padding  fixed-width"
+        min-width="150"
+        fixed="right"
+      >
+        <template>
+          <div>
+            <el-button
+              size="mini"
+              type="text"
+              disabled
+              @click="handleDetail(scope.row)"
+              v-hasPermi="['']"
+              >查看</el-button
+            >
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="pageParams.pageNum"
+      :limit.sync="pageParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+<script>
+import { getTicketList } from "@/api/business/ticket";
+import { publicFileGetUrl } from "@/api/common";
+export default {
+  name: "Ticket",
+  data() {
+    return {
+      loading: false,
+      showSearch: true,
+      queryParams: {
+        title: "",
+        ticketType: "",
+        ticketState: "",
+      },
+      pageParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      ticketTypeArr: [],
+      ticketStateArr: [],
+      // 总条数
+      total: 10,
+      list: [],
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    // 盲票组列表
+    getList() {
+      this.loading = true;
+      getTicketList(
+        "pageNum=" +
+          this.pageParams.pageNum +
+          "&pageSize=" +
+          this.pageParams.pageSize +
+          "&",
+        this.queryParams
+      )
+        .then((res) => {
+          this.loading = false;
+          if (res.code == 0) {
+            res.rows.forEach((item) => {
+              let picUrlArr = item.picUrl.split(",");
+              item.picUrl = publicFileGetUrl + picUrlArr[0];
+              item.status = JSON.parse(item.status);
+              item.type = JSON.parse(item.type);
+            });
+            this.total = res.total;
+            this.list = res.rows;
+          }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    // 搜索
+    handleQuery() {
+      this.getList()
+    },
+    // 重置
+    resetQuery() {},
+    // 添加盲票组
+    handleAdd() {
+      this.$router.push({ name: "TicketCreate" });
+    },
+    // 表格多选
+    handleSelectionChange() {},
+
+    handleDetail() {},
+  },
+  components: {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio