Sfoglia il codice sorgente

接口对接,菜单权限添加

chenrui 4 anni fa
parent
commit
d8f0637720

+ 64 - 2
src/api/customerBundle.js

@@ -11,12 +11,21 @@ export const listCustomerBundle = params => {
     method: 'post'
   }).then(res => res)
 }
-
+//  已购套餐 详情
 export const customerBundleDetail = (params) => {
   return axios.request({
     url: `customerBundle/detail/${params.id}`,
     method: 'get'
-  }).then(res => res.data)
+  }).then(res => res)
+}
+
+// 已购套餐   使用记录
+export const customerBundleUseHistory = params => {
+  const url = `customerBundle/useHistory/${params.id}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  }).then(res => res)
 }
 
 export const customerBundleHistory = (params) => {
@@ -33,3 +42,56 @@ export const cancelBuy = (params) => {
     method: 'get'
   }).then(res => res.data)
 }
+
+// 套餐列表
+export const getBundleList = params => {
+  const url = `bundle/query`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  }).then(res => res)
+}
+// 套餐   详情
+export const getBundleDetails = params => {
+  const url = `bundle/${params.id}`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'get'
+  }).then(res => res)
+}
+// 套餐  根据手机号查车牌号和客户信息
+export const bundleFindByMobile = params => {
+  const url = `customer/findByMobile/${params.mobile}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  })
+}
+// 套餐  确认收款
+export const bundleBuy = params => {
+  return axios.request({
+    url: `customerBundle/buy`,
+    data: params,
+    method: 'post'
+  }).then(res => res)
+}
+// 导出
+export const exportBundle = params => {
+  const url = 'customerBundle/export'
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+//  已购套餐 合计
+export const countListBundle = params => {
+  return axios.request({
+    url: `customerBundle/countList`,
+    data: params,
+    method: 'post'
+  }).then(res => res)
+}

+ 8 - 0
src/api/data.js

@@ -8,6 +8,14 @@ export function login (parameter) {
   })
 }
 
+// 根据字典code查询选项
+export const getLookUpDatas = (params) => {
+  return axios.request({
+    url: `lookup/findByLookup/${params.type}`,
+    method: 'get'
+  })
+}
+
 export const listLookUp = params => {
   const url = `/lookup/queryLike`
   return axios({

+ 2 - 2
src/api/report-charts.js

@@ -2,8 +2,8 @@ import { axios } from '@/utils/request'
 // 获取列表数据
 export const getOrderstatistics = params => {
   return axios({
-    url: 'order/statistics',
+    url: 'customerBundle/statistics',
     data: params,
-    method: 'POST'
+    method: 'post'
   })
 }

+ 1 - 0
src/components/Echarts/bar.vue

@@ -59,6 +59,7 @@ export default {
             this.xZoomEnd = 80
           } else {
             this.isShowZoom = false
+            this.xZoomEnd = 100
           }
           if (nVal.length > 30) {
             this.xZoomEnd = 70

+ 1 - 0
src/components/Echarts/line.vue

@@ -59,6 +59,7 @@ export default {
             this.xZoomEnd = 80
           } else {
             this.isShowZoom = false
+            this.xZoomEnd = 100
           }
           if (nVal.length > 30) {
             this.xZoomEnd = 70

+ 1 - 1
src/components/Echarts/pie.vue

@@ -87,7 +87,7 @@ export default {
             textStyle: {
               rich: {
                 name: {
-                  fontSize: 14,
+                  fontSize: 13,
                   fontWeight: 'normal',
                   color: '#666666',
                   padding: [10, 0]

+ 1 - 1
src/components/Select/index.js

@@ -58,7 +58,7 @@ export default {
       const a = this.dataList.find(item => {
         return item.code == code
       })
-      return a ? a.dispName : '-'
+      return a ? a.dispName : '--'
     },
     // 根据名称 获取code
     getCodeByName (dispName) {

+ 12 - 12
src/config/router.config.js

@@ -51,8 +51,8 @@ export const asyncRouterMap = [{
     component: PageView,
     meta: {
       title: '套餐销售',
-      icon: 'snippets'
-      // permission: 'M_order_0'
+      icon: 'snippets',
+      permission: 'M_bundel_saller'
     },
     children: [{
       path: '/SetmealSales/VerificationRecords',
@@ -70,8 +70,8 @@ export const asyncRouterMap = [{
       component: () => import('@/views/SetmealSales/BuySetmeal.vue'),
       meta: {
         title: '购买套餐',
-        icon: 'file-text'
-        // permission: 'M_order_list'
+        icon: 'file-text',
+        permission: 'M_buy_bundel'
       }
     },
     {
@@ -80,8 +80,8 @@ export const asyncRouterMap = [{
       component: () => import('@/views/SetmealSales/PurchasedSetmeal.vue'),
       meta: {
         title: '已购套餐',
-        icon: 'file-text'
-        // permission: 'M_order_list'
+        icon: 'file-text',
+        permission: 'M_bundel_buyRecord'
       }
     }
     ]
@@ -106,8 +106,8 @@ export const asyncRouterMap = [{
     component: PageView,
     meta: {
       title: '运营平台权限管理',
-      icon: 'apartment'
-      // permission: 'M_yyAuth_0'
+      icon: 'apartment',
+      permission: 'M_power_auth'
     },
     children: [
       {
@@ -116,8 +116,8 @@ export const asyncRouterMap = [{
         component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
         meta: {
           title: '用户管理',
-          icon: 'user'
-          // permission: 'M_auth_yyUser'
+          icon: 'user',
+          permission: 'M_power_user'
         }
       },
       {
@@ -126,8 +126,8 @@ export const asyncRouterMap = [{
         component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
         meta: {
           title: '角色管理',
-          icon: 'solution'
-          // permission: 'M_auth_yyRole'
+          icon: 'solution',
+          permission: 'M_power_role'
         }
       }
     ]

+ 61 - 61
src/libs/getDate.js

@@ -1,65 +1,65 @@
 // 引入 moment 时间插件
-import moment from "moment";
-//获取今日/昨日/本周/上周/本月/上月 时间
+import moment from 'moment'
+// 获取今日/昨日/本周/上周/本月/上月 时间
 export default {
-    // 获取今日的开始结束时间
-    getToday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().startOf("day").valueOf()).format("YYYY-MM-DD");
-        obj.endtime = moment(moment().valueOf()).format("YYYY-MM-DD");
-        return obj
-    },
-    // 获取昨日的开始结束时间
-    getYesterday() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().add(-1, 'days').startOf("day").valueOf()).format("YYYY-MM-DD");
-        obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前周的开始结束时间
-    getCurrWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week()).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week()).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一周的开始结束时间
-    getLastWeekDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD')
-        obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add(1, 'days').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取当前月的开始结束时间
-    getCurrMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month()).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
-    },
-    // 获取上一个月的开始结束时间
-    getLastMonthDays() {
-        let obj = {
-            starttime: '',
-            endtime: ''
-        }
-        obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD');
-        obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD');
-        return obj
+  // 获取今日的开始结束时间
+  getToday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
     }
+    obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取昨日的开始结束时间
+  getYesterday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前周的开始到当天结束时间
+  getCurrWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week()).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一周的开始结束时间
+  getLastWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始到当天结束时间
+  getCurrMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一个月的开始结束时间
+  getLastMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  }
 }

+ 46 - 43
src/views/Home.vue

@@ -11,6 +11,7 @@
                 <a-range-picker
                   style="width: 220px;"
                   @change="dateChange"
+                  id="statistics-queryWord"
                   v-model.trim="searchForm.queryWord"
                   :disabledDate="disabledDate"
                 />
@@ -19,6 +20,7 @@
                 快捷筛选:
                 <span
                   :class="['searchItem',curentType==item.type?'active':'']"
+                  id="statistics-quick"
                   v-for="(item,index) in tabList"
                   :key="index"
                   @click="getCurentSearchTime(item)">{{ item.name }}</span>
@@ -31,9 +33,9 @@
       <a-card class="panel" title="按业务量统计">
         <!-- 业务量趋势图表展示 -->
         <chart-line
-          style="height: 300px;"
+          style="height: 350px;"
           color="#6C6FBE"
-          :yMax="5000"
+          :yMax="200"
           yUnit="单"
           :xAxisRotate="resize"
           :xAxisData="XdaysData"
@@ -47,7 +49,7 @@
           <a-col :md="4" :lg="4">
             <a-card class="border-radius background-skyblue">
               <div class="module-list ">
-                <span>{{ chartData.KX }}</span>
+                <span>{{ chartData.xmbundleNum }}</span>
                 <p>洗美套餐</p>
               </div>
             </a-card>
@@ -55,7 +57,7 @@
           <a-col :md="4" :lg="4">
             <a-card class="border-radius background-greenBlue">
               <div class="module-list ">
-                <span>{{ chartData.JX }}</span>
+                <span>{{ chartData.bybundleNum }}</span>
                 <p>保养套餐</p>
               </div>
             </a-card>
@@ -63,7 +65,7 @@
           <a-col :md="4" :lg="4">
             <a-card class="border-radius background-blackGreen">
               <div class="module-list ">
-                <span>{{ chartData.DLX }}</span>
+                <span>{{ chartData.xtyhbundleNum }}</span>
                 <p>系统养护套餐</p>
               </div>
             </a-card>
@@ -79,10 +81,10 @@
           <a-col span="24" v-if="currentTabChart=='tab1'">
             <chart-bar
               ref="ChartBar"
-              style="height: 300px;"
+              style="height: 350px;"
               color="#6C6FBE"
               :xAxisRotate="resize"
-              :yMax="1000"
+              :yMax="200"
               yUnit="单"
               :xAxisData="XdaysData"
               :seriesData="washTypeBarData"
@@ -93,9 +95,9 @@
           <a-col span="24" v-if="currentTabChart=='tab2'">
             <chart-line
               ref="ChartLine"
-              style="height: 300px;"
+              style="height: 350px;"
               color="#6C6FBE"
-              :yMax="1000"
+              :yMax="200"
               yUnit="单"
               :xAxisRotate="resize"
               :xAxisData="XdaysData"
@@ -114,7 +116,7 @@
               :searchData="XdaysData"
               :value="washTypePieData"
               title="套餐销售量(单)"
-              :total="chartData.allOrderNum"
+              :total="chartData.bundleNum"
               :color="washTypePieColor"
               :xAxisRotate="resize"
               text="" />
@@ -127,7 +129,7 @@
               :searchData="XdaysData"
               :value="couponChartData"
               title="套餐内总服务项目数(次)"
-              :total="chartData.allOrderNum"
+              :total="chartData.itemNum"
               :color="couponColor"
               :xAxisRotate="resize"
               text="" />
@@ -183,24 +185,24 @@ export default {
     washTypePieData () {
       const data = [{
         'name': '洗美套餐',
-        'value': this.chartData.KX
+        'value': this.chartData.xmbundleNum
       }, {
         'name': '保养套餐',
-        'value': this.chartData.JX
+        'value': this.chartData.bybundleNum
       }, {
         'name': '系统养护套餐',
-        'value': this.chartData.DLX
+        'value': this.chartData.xtyhbundleNum
       }]
       return data
     },
-    // 洗车用券量占比数据
+    // 套餐内总服务项目数占比数据
     couponChartData () {
       const data = [{
         'name': '套餐服务核销量',
-        'value': this.chartData.notUseCouponOrderNum
+        'value': this.chartData.itemUsedNum
       }, {
         'name': '套餐服务未核销量',
-        'value': this.chartData.useCouponOrderNum
+        'value': this.chartData.itemUnUsedNum
       }]
       return data
     }
@@ -213,15 +215,16 @@ export default {
       form: this.$form.createForm(this, { name: 'searchForm' }),
       isNoData: false, // 是否有每天营业额及进店量数据
       searchForm: {
-        queryWord: null, // 时间查询条件,默认本周
+        queryWord: null // 时间查询条件,默认本周
       },
       chartData: {
-        KX: 0, // 快洗
-        JX: 0, // 精洗
-        DLX: 0, // 打蜡洗
-        allOrderNum: 0, // 洗车总量
-        useCouponOrderNum: 0, // 用券洗车量
-        notUseCouponOrderNum: 0 // 未用券洗车量
+        xmbundleNum: 0, // 洗美套餐
+        bybundleNum: 0, // 保养套餐
+        xtyhbundleNum: 0, // 系统养护套餐
+        itemNum: 0, // 服务数量
+        itemUsedNum: 0, // 已使用服务数量
+        itemUnUsedNum: 0, // 未使用服务数量
+        bundleNum: 0 //  套餐销售量
       },
       // 快速删选tab
       tabList: [{
@@ -258,7 +261,7 @@ export default {
       ],
       couponColor: ['#d48265', '#ff55ff'],
       // 套餐类型数据
-      currentTabChart: 'tab1', // 洗车类型详情数据与变化趋势的tab 默认展示详情数据
+      currentTabChart: 'tab1', // 套餐类型详情数据与变化趋势的tab 默认展示详情数据
       XdaysData: [], // 图表X轴时间集合
       // 套餐类型柱状图表数据
       washTypeBarData: [{
@@ -303,8 +306,6 @@ export default {
       }
     }
   },
-  created () {
-  },
   methods: {
     moment,
     // 时间改变
@@ -387,34 +388,36 @@ export default {
     // 整合图表每天数据
     filterData (data) {
       const days = [] // 日期合集
-      const kxData = [] // 快速洗车数据
-      const jxData = [] // 精致洗车数据
-      const dlxData = [] // 打蜡洗车数据
-      const totalData = [] // 全部洗车量数据
-      const useCouponData = [] // 用券洗车量数据
+      const kxData = [] // 洗美套餐数据
+      const jxData = [] // 保养套餐数据
+      const dlxData = [] // 系统养护套餐数据
+      const totalData = [] // 当日套餐销售量数据
+      const useCouponData = [] // 当日套餐使用量数据
+      console.log(data, '--data')
       data.map(item => {
         const itemDay = item.date.split('-')
         const month = Number(itemDay[1])
         const day = Number(itemDay[2])
         const time = month + '月' + day + '日'
         days.push(time)
-        kxData.push(item.KX)
-        jxData.push(item.JX)
-        dlxData.push(item.DLX)
-        totalData.push(item.allOrderNum)
-        useCouponData.push(item.useCouponOrderNum)
+        kxData.push(item.xmbundleNum)
+        jxData.push(item.bybundleNum)
+        dlxData.push(item.xtyhbundleNum)
+        totalData.push(item.bundleNum)
+        useCouponData.push(item.customerBundleUsedNum)
       })
       this.XdaysData = days
       const washTypeData = [kxData, jxData, dlxData]
-      // 洗车类型柱状图表数据
+      console.log(washTypeData, 'washTypeData')
+      // 套餐类型柱状图表数据
       this.washTypeBarData.map((item, index) => {
         item.data = washTypeData[index]
       })
-      // 洗车类型折线图表数据
+      // 套餐类型折线图表数据
       this.washTypeLineData.map((item, index) => {
         item.data = washTypeData[index]
       })
-      // 洗车量图表数据赋值
+      // 套餐量图表数据赋值
       this.washCarsChartData[0].data = totalData
       this.washCarsChartData[1].data = useCouponData
     }
@@ -484,7 +487,7 @@ export default {
         left: 40%;
       }
       .chartPie-box{
-        height: 300px;
+        height: 400px;
         width: 100%;
       }
       .panel-title {
@@ -525,7 +528,7 @@ export default {
       }
 
       .background-pop {
-        background-color: #8544e0;
+        background-color: #6C6FBE;
       }
 
       .background-black {
@@ -549,7 +552,7 @@ export default {
       }
 
       .background-orange {
-        background-color: #d2701b;
+        background-color: #ffaa00;
       }
     }
 

+ 37 - 32
src/views/SetmealSales/BuySetmeal.vue

@@ -18,7 +18,7 @@
         <!-- 分类 -->
         <a-tabs v-model="clsId" tabPosition="left" class="smenus" @change="tabChange">
           <a-tab-pane key="all" tab="全部"></a-tab-pane>
-          <a-tab-pane v-for="item in setmealType" :key="item.id" :tab="item.dispName"></a-tab-pane>
+          <a-tab-pane v-for="item in setmealType" :key="item.code" :tab="item.dispName"></a-tab-pane>
         </a-tabs>
         <!-- 套餐数据列表 -->
         <div class="itemBox" id="bundelScroll" :style="{height: winH - 356 + 'px'}">
@@ -30,7 +30,7 @@
                 <span style="margin-left: 15px;margin-right: 15px;color: red;"><b>现价:</b>¥{{ item.price }} </span>
               </p>
               <p>
-                <span><b>使用说明:</b>{{ item.remarks||'-' }}</span>
+                <span><b>使用说明:</b>{{ item.remarks || '-' }}</span>
               </p>
             </a-col>
             <a-col :span="1"></a-col>
@@ -51,11 +51,12 @@
                 shape="round">查看详细</a-button>
             </a-col>
           </a-row>
+          <a-empty v-if="listData.length == 0" class="noData" />
         </div>
       </div>
     </a-card>
     <!-- 下单弹框 -->
-    <SetmealPayMoney :openModal="openSetmealPay" :setmealId="setmealId" @close="closeModal" />
+    <SetmealPayMoney :openModal="openSetmealPay" :setmealInfo="setmealInfo" @close="closeModal" />
     <!-- 套餐详细 -->
     <SetmealItemDetailModal :openModal="openSetmealDetails" :setmealId="setmealId" @close="closeModal" />
   </div>
@@ -65,32 +66,23 @@
 <script>
 import SetmealPayMoney from './SetmealPayMoney.vue'
 import SetmealItemDetailModal from './SetmealItemDetailModal.vue'
+import { getLookUpDatas } from '@/api/data'
+import { getBundleList } from '@/api/customerBundle.js'
 export default {
   name: 'BuySetmeal',
   components: { SetmealPayMoney, SetmealItemDetailModal },
   data () {
     return {
-      listData: [
-        { 'id': 10322, 'createDate': '2020-10-14 09:31:30', 'updateDate': '2020-10-19 10:36:34', 'tenantId': 0, 'companyId': 10000, 'beginDate': '2020-10-18T16:00:00.000+0000', 'name': '套餐1-养护', 'clsId': '3', 'originalPrice': 30.00, 'price': 55.00, 'expiryDate': '2099-12-30T16:00:00.000+0000', 'status': '1', 'scope': '车领主总部门店,llei测试门店,测试门店,wj_test,碑林更新街店,名京店', 'scopeNo': '10040,10283,10284,10285,10288,10289', 'salesNumber': 0 },
-        { 'id': 10304, 'createDate': '2020-08-25 18:45:49', 'updateDate': '2020-09-25 18:11:57', 'tenantId': 0, 'companyId': 10000, 'beginDate': '2020-08-24T16:00:00.000+0000', 'name': 'xinzeng ', 'clsId': '3', 'originalPrice': 0.00, 'price': 30.00, 'expiryDate': '2099-12-30T16:00:00.000+0000', 'status': '1', 'scopeNo': '0', 'salesNumber': 8 },
-        { 'id': 10300, 'remarks': '撒旦发生范德萨反对', 'createDate': '2020-08-25 15:31:29', 'updateDate': '2020-09-04 13:52:44', 'tenantId': 0, 'companyId': 10000, 'beginDate': '2020-08-24T16:00:00.000+0000', 'name': '测试套餐li', 'clsId': '2', 'originalPrice': 0.00, 'price': 100.00, 'expiryDate': '2099-12-30T16:00:00.000+0000', 'status': '1', 'scope': 'llei测试门店,测试门店,wj_test,车箱箱,碑林更新街店,名京店', 'scopeNo': '10289,10288,10285,10287,10284,10283', 'salesNumber': 7 },
-        { 'id': 10297, 'createDate': '2020-08-25 13:52:32', 'updateDate': '2020-09-29 16:35:49', 'tenantId': 0, 'companyId': 10000, 'beginDate': '2020-08-24T16:00:00.000+0000', 'name': '222', 'clsId': '1', 'originalPrice': 0.00, 'price': 0.00, 'expiryDate': '2099-12-30T16:00:00.000+0000', 'status': '1', 'scopeNo': '0', 'salesNumber': 5 },
-        { 'id': 10290, 'createDate': '2020-08-24 11:33:43', 'updateDate': '2020-09-30 14:52:51', 'tenantId': 0, 'companyId': 10000, 'beginDate': '2020-08-23T16:00:00.000+0000', 'name': '维修', 'clsId': '3', 'originalPrice': 120.00, 'price': 100.00, 'expiryDate': '2099-12-30T16:00:00.000+0000', 'status': '1', 'scopeNo': '0', 'salesNumber': 8, remarks: '-数据库个人福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵福建省快递费冀凯股份是点检见风使舵' }
-      ], //  套餐数据
+      listData: [], //  套餐数据
       queryWord: '', //  关键词
       clsId: '',
       pageNo: 1,
       pageSize: 1000,
-      setmealType: [
-        { 'id': 186, 'sort': 1, 'createDate': '2019-09-29 20:23:07', 'updateDate': '2019-09-29 20:23:07', 'lookupCode': 'BUNDLE_CLS', 'dispName': '洗美套餐', 'code': '1', 'isEnable': '1' },
-        { 'id': 187, 'sort': 2, 'createDate': '2019-09-29 20:23:07', 'updateDate': '2019-09-29 20:23:07', 'lookupCode': 'BUNDLE_CLS', 'dispName': '保养套餐', 'code': '2', 'isEnable': '1' },
-        { 'id': 188, 'sort': 3, 'createDate': '2019-09-29 20:23:07', 'updateDate': '2019-09-29 20:23:07', 'lookupCode': 'BUNDLE_CLS', 'dispName': '系统养护套餐', 'code': '3', 'isEnable': '1' },
-        { 'id': 190, 'sort': 5, 'createDate': '2019-09-29 20:23:07', 'updateDate': '2019-12-19 15:12:48', 'lookupCode': 'BUNDLE_CLS', 'dispName': '赠送套餐', 'code': '99', 'isEnable': '1' },
-        { 'id': 189, 'sort': 98, 'createDate': '2019-09-29 20:23:07', 'updateDate': '2019-09-29 20:23:07', 'lookupCode': 'BUNDLE_CLS', 'dispName': '活动套餐', 'code': '98', 'isEnable': '1' }
-      ],
+      setmealType: [], //  套餐类型
       openSetmealPay: false, //  下单弹框是否显示
       openSetmealDetails: false, //  查看详细弹框是否显示
       setmealId: null, //  套餐id
+      setmealInfo: null, //  套餐信息
       winH: 0 //  浏览器高度
     }
   },
@@ -108,20 +100,16 @@ export default {
     },
     // 初始化数据
     initData () {
-      const _this = this
-      // getBundleList({
-      //   pageNo: this.pageNo,
-      //   pageSize: this.pageSize,
-      //   queryWord: this.queryWord,
-      //   clsId: this.clsId == 'all' ? '' : this.clsId
-      // }).then(res => {
-      //   if (res.status == 200) {
-      //     _this.listData = res.data.data.list.map(item => {
-      //       this.$set(item, 'num', 1)
-      //       return item
-      //     })
-      //   }
-      // })
+      getBundleList({
+        queryWord: this.queryWord,
+        clsId: this.clsId == 'all' ? '' : this.clsId
+      }).then(res => {
+        if (res.status == 200) {
+          this.listData = res.data
+        } else {
+          this.listData = []
+        }
+      })
     },
     //  tab 切换
     tabChange (v) {
@@ -137,22 +125,35 @@ export default {
     },
     // 下单
     openPay (data) {
-      this.setmealId = String(data.id)
+      this.setmealInfo = data
       this.openSetmealPay = true
     },
     closeModal () {
       this.setmealId = null
+      this.setmealInfo = null
       this.openSetmealPay = false
       this.openSetmealDetails = false
+      this.initData()
     },
     //  查看详细
     openDetails (data) {
       this.setmealId = String(data.id)
       this.openSetmealDetails = true
+    },
+    //  套餐分类  数据字典
+    getBundleClsDatas () {
+      getLookUpDatas({ type: 'BUNDLE_TYPE' }).then(res => {
+        if (res.status == 200) {
+          this.setmealType = res.data
+        } else {
+          this.setmealType = []
+        }
+      })
     }
   },
   mounted () {
     this.winH = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight // 浏览器高度
+    this.getBundleClsDatas()//  套餐分类  数据字典
     this.pageInit()
   }
 }
@@ -237,6 +238,10 @@ export default {
             margin-top: 15px;
           }
         }
+        .noData{
+          margin: 150px 0 0;
+          text-align: center;
+        }
       }
     }
   }

+ 56 - 34
src/views/SetmealSales/PurchasedSetmeal.vue

@@ -31,13 +31,24 @@
             </a-form-item>
           </a-col>
           <a-col :span="6">
-            <a-form-item label="状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+            <a-form-item label="单据状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
               <v-select
-                v-model="searchForm.refundFlag"
-                ref="refundFlag"
+                v-model="searchForm.orderFlag"
+                ref="orderFlag"
                 id="purchasedSetmeal-status"
-                code="REFUND_STATUS"
-                placeholder="请选择状态"
+                code="ORDER_TYPE"
+                placeholder="请选择单据状态"
+                allowClear></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="结算状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <v-select
+                v-model="searchForm.salesChannelSettleStatus"
+                ref="salesChannelSettleStatus"
+                id="purchasedSetmeal-status"
+                code="SETTLE_STATUS_ALL"
+                placeholder="请选择结算状态"
                 allowClear></v-select>
             </a-form-item>
           </a-col>
@@ -55,9 +66,7 @@
     <div class="total">
       <a-icon type="info-circle" class="iconImg" />
       <strong>总计:</strong><span v-model="orderTotal">{{ orderTotal || 0 }} 单</span>
-      <strong style="margin-left: 15px;">应收:</strong><span v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
-      <strong style="margin-left: 15px;">优惠:</strong><span v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
-      <strong style="margin-left: 15px;">实收:</strong><span v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
+      <strong style="margin-left: 15px;">收款金额:</strong><span v-model="totalAmounts">{{ totalAmounts || 0 }} 元</span>
     </div>
     <!-- 列表 -->
     <s-table
@@ -67,10 +76,15 @@
       :columns="columns"
       :data="loadData"
       bordered>
-      <!-- 状态 -->
-      <span slot="refundFlag" slot-scope="text">
-        {{ $refs.refundFlag.getNameByCode(text) }}
-      </span>
+      <!-- 客户信息 -->
+      <p slot="custInfo" slot-scope="text, record">
+        <span v-if="record.custMobile || record.vehicleNumber">{{ record.custMobile }} / {{ record.vehicleNumber }}</span>
+        <span v-else>--</span>
+      </p>
+      <!-- 单据状态 -->
+      <span slot="orderFlag" slot-scope="text">{{ $refs.orderFlag.getNameByCode(text) }}</span>
+      <!-- 结算状态 -->
+      <span slot="salesChannelSettleStatus" slot-scope="text">{{ $refs.salesChannelSettleStatus.getNameByCode(text) }}</span>
       <!-- 操作 -->
       <span slot="action" slot-scope="text, record">
         <a-button type="primary" id="purchasedSetmeal-look" @click="seeDetail(record)">详情</a-button>
@@ -87,7 +101,7 @@ import getDate from '@/libs/getDate.js'
 import { completeDate } from '@/libs/tools.js'
 import moment from 'moment'
 import SetmealDetailModal from './SetmealDetailModal.vue'
-import { listCustomerBundle } from '@/api/customerBundle.js'
+import { listCustomerBundle, exportBundle, countListBundle } from '@/api/customerBundle.js'
 export default {
   name: 'PurchasedSetmeal',
   components: { STable, VSelect, SetmealDetailModal },
@@ -100,11 +114,12 @@ export default {
         bundleName: '', // 套餐名称
         number: '', // 订单号
         queryWord: '', // 客户信息
-        refundFlag: '' // 状态
+        orderFlag: '', // 单据状态
+        salesChannelSettleStatus: '' // 结算状态
       },
       loading: false, // 导出loading
       orderTotal: '', // 合计开单数量
-      paymentAmountTotal: '', // 合计实收金额
+      totalAmounts: '', // 合计收款金额
       openDetailModal: false, // 查看详情弹窗 默认关闭
       detailId: null, // 初始化id
       // 将默认当天时间日期回显在时间选择框中
@@ -118,9 +133,10 @@ export default {
         { title: '订单号', dataIndex: 'number', width: 100, align: 'center' },
         { title: '下单时间', dataIndex: 'orderDate', width: 100, align: 'center' },
         { title: '套餐名称', dataIndex: 'bundleName', width: 100, align: 'center' },
-        { title: '客户信息', dataIndex: 'customerMobile', width: 100, align: 'center' },
-        { title: '应收金额(¥)', dataIndex: 'payedAmount', width: 80, align: 'center' },
-        { title: '单据状态', scopedSlots: { customRender: 'refundFlag' }, width: 80, align: 'center' },
+        { title: '客户信息', scopedSlots: { customRender: 'custInfo' }, width: 100, align: 'center' },
+        { title: '收款金额(¥)', dataIndex: 'payedAmount', width: 80, align: 'center' },
+        { title: '单据状态', scopedSlots: { customRender: 'orderFlag' }, width: 80, align: 'center' },
+        { title: '结算状态', scopedSlots: { customRender: 'salesChannelSettleStatus' }, width: 80, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -166,17 +182,25 @@ export default {
         bundleName: this.searchForm.bundleName,
         number: this.searchForm.number,
         queryWord: this.searchForm.queryWord,
-        refundFlag: this.searchForm.refundFlag
+        orderFlag: this.searchForm.orderFlag,
+        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
       }
       params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
       params.endDate == null ? params.endDate = getDate.getToday().endtime : null
-      // orderTotal(params).then(res => {
-      //   console.log(res, '--------')
-      //   if (res.status == 200) {
-      //     this.orderTotal = res.data.orderNum || 0
-      //     this.paymentAmountTotal = res.data.paymentAmount || 0
-      //   }
-      // })
+      countListBundle(params).then(res => {
+        if (res.status == 200) {
+          if (res.data) {
+            this.orderTotal = res.data.cnt || 0
+            this.totalAmounts = res.data.totalAmounts || 0
+          } else {
+            this.orderTotal = 0
+            this.totalAmounts = 0
+          }
+        } else {
+          this.orderTotal = 0
+          this.totalAmounts = 0
+        }
+      })
     },
     // 查看详情--跳转到对应的详情页
     seeDetail (record) {
@@ -187,7 +211,6 @@ export default {
     // 查询
     handleSearch () {
       this.$refs.table.refresh()
-      this.getTotal()
     },
     // 重置
     handleReset () {
@@ -200,28 +223,28 @@ export default {
       this.searchForm.bundleName = ''
       this.searchForm.number = ''
       this.searchForm.queryWord = ''
-      this.searchForm.refundFlag = null
+      this.searchForm.orderFlag = null
+      this.searchForm.salesChannelSettleStatus = null
       this.$refs.table.refresh(true)
-      this.getTotal()
     },
     // 导出
     handleExport () {
-      // this.loading = true
       const params = {
         beginDate: this.searchForm.beginDate == null ? getDate.getToday().starttime : this.searchForm.beginDate,
         endDate: this.searchForm.endDate == null ? getDate.getToday().endtime : this.searchForm.endDate,
         bundleName: this.searchForm.bundleName,
         number: this.searchForm.number,
         queryWord: this.searchForm.queryWord,
-        refundFlag: this.searchForm.refundFlag
+        orderFlag: this.searchForm.orderFlag,
+        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
       }
       // 判断两个时间段是否相差m个月
       if (!completeDate(params.beginDate, params.endDate, 3)) {
         this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
         return
       }
-      exportOrder(params).then(res => {
-        console.log(res)
+      this.loading = true
+      exportBundle(params).then(res => {
         this.loading = false
         this.download(res)
       })
@@ -234,7 +257,6 @@ export default {
       link.href = url
       const a = moment().format('YYYYMMDDhhmmss')
       const fname = '已购套餐记录-' + a
-      console.log(fname, '111111')
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()

+ 55 - 29
src/views/SetmealSales/SetmealDetailModal.vue

@@ -8,58 +8,46 @@
       :destroyOnClose="true"
       @cancel="isShow=false"
       v-model="isShow">
-      <a-row :gutter="20">
+      <a-row :gutter="20" v-if="detailsData">
         <a-col :span="8" class="item-cont">
           <p class="item-label">购买日期:</p>
-          <p class="item-main">2020-10-20 13:50</p>
+          <p class="item-main">{{ detailsData.orderDate || '--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
           <p class="item-label">工单号:</p>
-          <p class="item-main">100000135421356423651</p>
+          <p class="item-main">{{ detailsData.orderBundle.number || '--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
-          <p class="item-label">使用门店:</p>
-          <p class="item-main">测试验证门店</p>
-        </a-col>
-        <a-col :span="8" class="item-cont">
-          <p class="item-label">客户姓名:</p>
-          <p class="item-main">李四</p>
+          <p class="item-label">客户名称:</p>
+          <p class="item-main">{{ detailsData.orderBundle.custName || '--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
           <p class="item-label">手机号:</p>
-          <p class="item-main">15705254578</p>
+          <p class="item-main">{{ detailsData.orderBundle.custMobile || '--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
-          <p class="item-label">销售门店:</p>
-          <p class="item-main">测试验证门店</p>
+          <p class="item-label">销售合作商:</p>
+          <p class="item-main">{{ detailsData.orderBundle.useStoreName || '--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
           <p class="item-label">套餐名称:</p>
-          <p class="item-main">合成汽油机油KR7保养套餐</p>
+          <p class="item-main">{{ detailsData.orderBundle.bundleName || '--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
           <p class="item-label">套餐价格:</p>
-          <p class="item-main">399元</p>
+          <p class="item-main">{{ detailsData.orderBundle.totalAmount ? detailsData.orderBundle.totalAmount + '元' :'--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
           <p class="item-label">销售人员:</p>
-          <p class="item-main">张三</p>
-        </a-col>
-        <a-col :span="8" class="item-cont">
-          <p class="item-label">实际收款:</p>
-          <p class="item-main">399元</p>
+          <p class="item-main">{{ detailsData.sellerName || '--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
-          <p class="item-label">优惠金额:</p>
-          <p class="item-main">0元</p>
+          <p class="item-label">收款金额:</p>
+          <p class="item-main">{{ detailsData.orderBundle.payedAmount ? detailsData.orderBundle.payedAmount + '元' :'--' }}</p>
         </a-col>
         <a-col :span="8" class="item-cont">
           <p class="item-label">支付方式:</p>
-          <p class="item-main">现金</p>
-        </a-col>
-        <a-col :span="8" class="item-cont">
-          <p class="item-label">销售渠道:</p>
-          <p class="item-main">门店</p>
+          <p class="item-main">{{ detailsData.orderBundle.payType || '--' }}</p>
         </a-col>
       </a-row>
       <a-tabs type="card">
@@ -97,6 +85,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import { customerBundleDetail, customerBundleUseHistory } from '@/api/customerBundle.js'
 export default {
   name: 'SetmealDetailModal',
   components: { STable, VSelect },
@@ -115,8 +104,8 @@ export default {
       isShow: this.openModal, //  弹框是否展示
       setMealColumns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
-        { title: '内容', dataIndex: 'orderNo', width: 200, align: 'center' },
-        { title: '剩余数量', dataIndex: 'orderTime', width: 100, align: 'center' }
+        { title: '内容', dataIndex: 'itemName', width: 200, align: 'center' },
+        { title: '剩余数量', dataIndex: 'remainTimes', width: 100, align: 'center' }
       ],
       recordColumns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
@@ -128,13 +117,50 @@ export default {
         { title: '工单', dataIndex: 'orderTimessss', width: 100, align: 'center' }
       ],
       setMealData: [], //  套餐内容
-      recordData: [] //  使用记录
+      recordData: [], //  使用记录
+      detailsData: null //  套餐数据
     }
   },
   methods: {
     // 套餐详情
     getSetmealInfo (id) {
+      //  套餐详情
+      customerBundleDetail({ id: id }).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          this.detailsData = res.data
+          if (res.data && res.data.customerBundleItemList && res.data.customerBundleItemList.length > 0) {
+            res.data.customerBundleItemList.map((item, index) => {
+              item.no = index + 1
+            })
+            this.setMealData = res.data.customerBundleItemList
+          } else {
+            this.setMealData = []
+          }
+        } else {
+          this.detailsData = null
+          this.setMealData = []
+        }
+      })
+      //  使用记录
+      customerBundleUseHistory({ id: id }).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          // this.recordData = res.data.customerBundleItemList
+          const recordData = []
+          if (res.data.customerBundleItemList && res.data.customerBundleItemList.length > 0) {
+            res.data.customerBundleItemList.map((item, index) => {
+              recordData.push({
+                no: index + 1
 
+              })
+            })
+          }
+          this.recordData = recordData
+        } else {
+          this.recordData = []
+        }
+      })
     }
   },
   watch: {

+ 15 - 74
src/views/SetmealSales/SetmealItemDetailModal.vue

@@ -19,39 +19,11 @@
           :pagination="false"
           bordered>
           <!-- 工时费 -->
-          <template slot="priceL3" slot-scope="text, record">{{ record.priceL3 ? record.priceL3 : 0 }}元</template>
-          <!-- 优惠工时费 -->
-          <template slot="itemPrice" slot-scope="text, record">{{ record.itemPrice ? record.itemPrice : 0 }}元</template>
+          <template slot="priceL3" slot-scope="text, record">{{ record.itemPrice ? record.itemPrice : 0 }}元</template>
           <!-- 次数 -->
-          <template slot="itemTimes" slot-scope="text, record">{{ record.itemTimes ? record.itemTimes : '--' }}</template>
+          <template slot="itemTimes" slot-scope="text, record">{{ record.times ? record.times : '--' }}</template>
           <!-- 价值 -->
-          <template slot="worth" slot-scope="text, record">{{ (Number(record.priceL3 ? record.priceL3 : 0) - Number(record.itemPrice ? record.itemPrice : 0)) * (record.itemTimes ? record.itemTimes : 0) }}元</template>
-          <!-- 单次耗卡金额 -->
-          <template slot="allocationPrice" slot-scope="text, record">{{ record.allocationPrice ? record.allocationPrice : 0 }}元</template>
-        </a-table>
-      </div>
-      <div class="table-main" v-if="bundlePartList">
-        <p class="table-tit">配件:</p>
-        <a-table
-          ref="table-part"
-          size="middle"
-          :rowKey="(record) => record.id"
-          :columns="columns_part"
-          :dataSource="bundlePartList"
-          :pagination="false"
-          bordered>
-          <!-- 型号 -->
-          <template slot="type" slot-scope="text, record">{{ record.type ? record.type : '--' }}</template>
-          <!-- 规格 -->
-          <template slot="specNum" slot-scope="text, record">{{ record.specNum ? record.specNum : 0 }}{{ record.spec }}</template>
-          <!-- 价格 -->
-          <template slot="price" slot-scope="text, record">{{ record.price ? record.price : 0 }}元</template>
-          <!-- 数量 -->
-          <template slot="quantity" slot-scope="text, record">{{ record.quantity ? record.quantity : 1 }}</template>
-          <!-- 价值 -->
-          <template slot="worth" slot-scope="text, record">{{ (record.quantity ? record.quantity : 1) * (record.price ? record.price : 0) }}元</template>
-          <!-- 单次耗卡金额 -->
-          <template slot="allocationPrice" slot-scope="text, record">{{ record.allocationPrice ? record.allocationPrice : 0 }}元</template>
+          <template slot="worth" slot-scope="text, record">{{ Number(record.itemPrice ? record.itemPrice : 0) * (record.times ? record.times : 0) }}元</template>
         </a-table>
       </div>
       <div class="btn-cont">
@@ -63,6 +35,7 @@
 
 <script>
 import { STable } from '@/components'
+import { getBundleDetails } from '@/api/customerBundle.js'
 export default {
   name: 'SetmealItemDetailModal',
   components: { STable },
@@ -85,54 +58,23 @@ export default {
         { title: '服务名称', dataIndex: 'itemName', width: 120, align: 'center' },
         { title: '服务类别', dataIndex: 'itemClsName', width: 100, align: 'center' },
         { title: '工时费', scopedSlots: { customRender: 'priceL3' }, width: 100, align: 'center' },
-        { title: '优惠工时费', scopedSlots: { customRender: 'itemPrice' }, width: 100, align: 'center' },
         { title: '次数', scopedSlots: { customRender: 'itemTimes' }, width: 100, align: 'center' },
-        { title: '价值', scopedSlots: { customRender: 'worth' }, width: 100, align: 'center' },
-        { title: '单次耗卡金额', scopedSlots: { customRender: 'allocationPrice' }, width: 100, align: 'center' }
-      ],
-      bundleItemList: [],
-      columns_part: [
-        { title: '配件名称', dataIndex: 'partName', width: 120, align: 'center' },
-        { title: '型号', scopedSlots: { customRender: 'type' }, align: 'center', width: 100 },
-        { title: '规格', scopedSlots: { customRender: 'specNum' }, align: 'center', width: 100 },
-        { title: '价格', scopedSlots: { customRender: 'price' }, align: 'center', width: 100 },
-        { title: '数量', scopedSlots: { customRender: 'quantity' }, align: 'center', width: 100 },
-        { title: '价值', scopedSlots: { customRender: 'worth' }, align: 'center', width: 100 },
-        { title: '单次耗卡金额', scopedSlots: { customRender: 'allocationPrice' }, align: 'center', width: 150 }
+        { title: '价值', scopedSlots: { customRender: 'worth' }, width: 100, align: 'center' }
       ],
-      bundlePartList: []
+      bundleItemList: []
     }
   },
   methods: {
     //  套餐信息
-    getSetmealInfo () {
-      const data = {
-        'id': 10322,
-        'createDate': '2020-10-14 09:31:30',
-        'updateDate': '2020-10-21 11:02:49',
-        'tenantId': 0,
-        'companyId': 10000,
-        'beginDate': '2020-10-18T16:00:00.000+0000',
-        'name': '套餐1-养护',
-        'clsId': '3',
-        'originalPrice': 30.00,
-        'price': 55.00,
-        'expiryDate': '2099-12-30T16:00:00.000+0000',
-        'status': '1',
-        'scope': '车领主总部门店,llei测试门店,测试门店,wj_test,碑林更新街店,名京店',
-        'scopeNo': '10040,10283,10284,10285,10288,10289',
-        'salesNumber': 1,
-        'bundleItemList': [
-          { 'id': 11250, 'createDate': '2020-10-19 10:36:34', 'updateDate': '2020-10-19 10:36:34', 'tenantId': 0, 'companyId': 10000, 'bundleId': 10322, 'itemId': 18373, 'itemName': '精致洗车', 'itemPrice': 0.00, 'allocationPrice': 2.00, 'itemClsName': '洗车', 'priceL3': 0.00, 'itemTimes': 6 },
-          { 'id': 11251, 'createDate': '2020-10-19 10:36:34', 'updateDate': '2020-10-19 10:36:34', 'tenantId': 0, 'companyId': 10000, 'bundleId': 10322, 'itemId': 18285, 'itemName': '精致洗车111', 'itemPrice': 0.00, 'allocationPrice': 3.00, 'itemClsName': '洗车', 'priceL3': 30.00, 'itemTimes': 1 }
-        ],
-        'bundlePartList': [
-          { 'id': 10200, 'createDate': '2020-10-19 10:36:34', 'updateDate': '2020-10-19 10:36:34', 'tenantId': 0, 'companyId': 10000, 'bundleId': 10322, 'partId': 41941, 'partName': '123123444', 'unit': '个', 'price': 0.00, 'allocationPrice': 7.00, 'quantity': 2 }
-        ]
-      }
-      this.bundleItemList = data.bundleItemList || []
-      this.bundlePartList = data.bundlePartList || []
-      console.log(data, '---data', this.bundleItemList)
+    getSetmealInfo (id) {
+      getBundleDetails({ id: id }).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          this.bundleItemList = res.data.bundleItemList || []
+        } else {
+          this.bundleItemList = []
+        }
+      })
     }
   },
   watch: {
@@ -147,7 +89,6 @@ export default {
       }
     },
     setmealId (newValue, oldValue) {
-      console.log(newValue, '-newValue   详情', this.isShow)
       if (newValue && this.isShow) {
         this.getSetmealInfo(newValue)
       }

+ 68 - 29
src/views/SetmealSales/SetmealPayMoney.vue

@@ -9,17 +9,17 @@
     v-model="isShow">
     <!-- 表单 -->
     <a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
-      <a-form-model-item label="手机号" prop="customerMobile">
-        <a-input v-model.trim="form.customerMobile" @input="mobileInput" :maxLength="11" placeholder="支持新增和搜索" />
+      <a-form-model-item label="手机号" prop="custMobile">
+        <a-input v-model.trim="form.custMobile" @input="mobileInput" :maxLength="11" placeholder="支持新增和搜索" />
       </a-form-model-item>
-      <a-form-model-item label="车牌号" prop="vehicle">
-        <a-input v-model.trim="form.vehicle" :maxLength="8" placeholder="请输入车牌号(最多8个字符)" />
+      <a-form-model-item label="车牌号" prop="vehicleNumber">
+        <a-input v-model.trim="form.vehicleNumber" :maxLength="8" placeholder="请输入车牌号(最多8个字符)" />
       </a-form-model-item>
-      <a-form-model-item label="客户姓名" prop="name">
-        <a-input v-model.trim="form.name" :maxLength="30" placeholder="请输入客户姓名(最多30个字符)" />
+      <a-form-model-item label="客户姓名" prop="custName">
+        <a-input v-model.trim="form.custName" :maxLength="30" placeholder="请输入客户姓名(最多30个字符)" />
       </a-form-model-item>
       <a-form-model-item label="应收金额" class="item-con">
-        <p class="item-main"><span class="item-price">399.00</span>元</p>
+        <p class="item-main"><span class="item-price" v-if="setmealData">{{ setmealData.price || 0 }}</span>元</p>
       </a-form-model-item>
       <a-form-model-item label="收款方式" class="item-con">
         <p class="item-main">现金</p>
@@ -35,6 +35,7 @@
 
 <script>
 import { isLicensePlate, isMobile } from '@/libs/tools'
+import { bundleFindByMobile, bundleBuy } from '@/api/customerBundle.js'
 export default {
   name: 'SetmealPayMoney',
   props: {
@@ -43,10 +44,12 @@ export default {
       type: Boolean,
       default: false
     },
-    setmealId: {
-      //  套餐id
-      type: String,
-      default: ''
+    setmealInfo: {
+      //  套餐信息
+      type: Object,
+      default: () => {
+        return {}
+      }
     }
   },
   data () {
@@ -77,31 +80,47 @@ export default {
     return {
       isShow: this.openModal, //  弹框是否展示
       form: {
-        customerMobile: '',
-        vehicle: '',
-        name: ''
+        custMobile: '',
+        vehicleNumber: '',
+        custName: '',
+        custId: null
       },
       rules: {
-        customerMobile: [
+        custMobile: [
           { required: true, message: '请输入手机号', trigger: 'blur' },
           { validator: isMobileValid, trigger: 'blur' }
         ],
-        vehicle: [
+        vehicleNumber: [
           { required: true, message: '请输入车牌号', trigger: 'blur' },
           { validator: isLicensePlateValid, trigger: 'blur' }
         ]
-      }
+      },
+      setmealData: null //  套餐数据
     }
   },
   methods: {
-    //  套餐信息
-    getSetmealInfo () {},
     //  手机号输入监听
     mobileInput () {
-      if (this.form.customerMobile.length == 11) {
-        if (isMobile(this.form.customerMobile)) { //  校验手机号
+      if (this.form.custMobile.length == 11) {
+        if (isMobile(this.form.custMobile)) { //  校验手机号
           //  根据手机号去查询是否已绑定车牌
-          //  有车牌信息则需禁用掉车牌输入框
+          bundleFindByMobile({ mobile: this.form.custMobile }).then(res => {
+            if (res.status == 200) {
+              if (res.data) { //  查到客户信息
+                this.form.vehicleNumber = ''
+                this.form.custName = res.data.name
+                this.form.custId = res.data.id
+              } else { //  未查到客户信息
+                this.form.vehicleNumber = ''
+                this.form.custName = ''
+                this.form.custId = null
+              }
+            } else {
+              this.form.vehicleNumber = ''
+              this.form.custName = ''
+              this.form.custId = null
+            }
+          })
         }
       }
     },
@@ -109,7 +128,25 @@ export default {
     onSubmit () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-
+          const params = {
+            bundleId: this.setmealData.id,
+            orderBundle: {
+              bundleId: this.setmealData.id,
+              custId: this.form.custId,
+              custName: this.form.custName,
+              custMobile: this.form.custMobile,
+              vehicleNumber: this.form.vehicleNumber,
+              totalAmount: this.setmealData.price
+            },
+            paymentDetailList: [
+              { payType: 'PAY_CASH' }
+            ]
+          }
+          bundleBuy(params).then(res => {
+            if (res.status == 200) {
+              this.$emit('close')
+            }
+          })
         } else {
           console.log('error submit!!')
           return false
@@ -123,9 +160,10 @@ export default {
     },
     // 重置表单
     resetForm () {
-      this.form.customerMobile = ''
-      this.form.vehicle = ''
-      this.form.name = ''
+      this.form.custMobile = ''
+      this.form.vehicleNumber = ''
+      this.form.custName = ''
+      this.form.custId = null
     }
   },
   watch: {
@@ -141,10 +179,11 @@ export default {
         this.resetForm() //  重置表单数据
       }
     },
-    setmealId (newValue, oldValue) {
-      console.log(newValue, '-newValue   下单', this.isShow)
+    setmealInfo (newValue, oldValue) {
       if (newValue && this.isShow) {
-        this.getSetmealInfo(newValue)
+        this.setmealData = newValue
+      } else {
+        this.setmealData = null
       }
     }
   }

+ 1 - 1
src/views/power/role/roleList.vue

@@ -10,7 +10,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.isEnable" id="role-enable" allowClear placeholder="请选择状态" ></v-select>
+              <v-select code="ENABLE_STATE" v-model="queryParam.isEnable" id="role-enable" allowClear placeholder="请选择状态" ></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24" class="flex-sp">

+ 1 - 1
src/views/power/user/userList.vue

@@ -15,7 +15,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.loginFlag" id="user-loginFlag" allowClear placeholder="请选择状态"></v-select>
+              <v-select code="ENABLE_STATE" v-model="queryParam.loginFlag" id="user-loginFlag" allowClear placeholder="请选择状态"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24" class="flex-sp">