浏览代码

已购套餐 使用记录 字段更改

chenrui 4 年之前
父节点
当前提交
6d92dd82c9

+ 1 - 1
src/views/SetmealSales/PurchasedSetmeal.vue

@@ -61,7 +61,7 @@
       </a-form>
     </div>
     <!-- 新建 -->
-    <div class="table-operator"><a-button type="primary" id="purchasedSetmeal-buy" icon="plus" @click="goBuy()">购买套餐</a-button></div>
+    <div class="table-operator"><a-button type="primary" v-if="$hasPermissions('M_buy_bundel')" id="purchasedSetmeal-buy" icon="plus" @click="goBuy()">购买套餐</a-button></div>
     <!-- 合计 -->
     <div class="total">
       <a-icon type="info-circle" class="iconImg" />

+ 11 - 11
src/views/SetmealSales/SetmealDetailModal.vue

@@ -75,9 +75,9 @@
             :pagination="false"
             bordered>
             <!-- 车牌号 -->
-            <span slot="vehicleNumber" slot-scope="text, record">{{ record.orderBundle.vehicleNumber || '--' }}</span>
+            <span slot="vehicleNum" slot-scope="text, record">{{ record.vehicleNum || '--' }}</span>
             <!-- 服务门店 -->
-            <span slot="dataSourceName" slot-scope="text, record">{{ record.orderBundle.dataSourceName || '--' }}</span>
+            <span slot="usedStoreName" slot-scope="text, record">{{ record.usedStoreName || '--' }}</span>
           </a-table>
         </a-tab-pane>
       </a-tabs>
@@ -114,12 +114,12 @@ export default {
       ],
       recordColumns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
-        { title: '使用时间', dataIndex: 'createDate', width: 100, align: 'center' },
-        { title: '车牌号', scopedSlots: { customRender: 'vehicleNumber' }, width: 100, align: 'center' },
-        { title: '服务内容', dataIndex: 'itemName', width: 100, align: 'center' },
-        { title: '服务门店', scopedSlots: { customRender: 'dataSourceName' }, width: 100, align: 'center' },
-        { title: '使用数量', dataIndex: 'times', width: 100, align: 'center' },
-        { title: '工单', dataIndex: 'orderBundle.number', width: 100, align: 'center' }
+        { title: '使用时间', dataIndex: 'usedTime', width: 100, align: 'center' },
+        { title: '车牌号', scopedSlots: { customRender: 'vehicleNum' }, width: 100, align: 'center' },
+        { title: '服务内容', dataIndex: 'bundItemName', width: 100, align: 'center' },
+        { title: '服务门店', scopedSlots: { customRender: 'usedStoreName' }, width: 100, align: 'center' },
+        { title: '使用数量', dataIndex: 'customerBundleItemTimes', width: 100, align: 'center' },
+        { title: '工单', dataIndex: 'orderNo', width: 100, align: 'center' }
       ],
       setMealData: [], //  套餐内容
       recordData: [], //  使用记录
@@ -151,11 +151,11 @@ export default {
       customerBundleUseHistory({ id: id }).then(res => {
         console.log(res)
         if (res.status == 200) {
-          if (res.data.customerBundleItemList && res.data.customerBundleItemList.length > 0) {
-            res.data.customerBundleItemList.map((item, index) => {
+          if (res.data && res.data.length > 0) {
+            res.data.map((item, index) => {
               item.no = index + 1
             })
-            this.recordData = res.data.customerBundleItemList
+            this.recordData = res.data
           } else {
             this.recordData = []
           }

+ 38 - 40
src/views/SetmealSales/SetmealPayMoney.vue

@@ -5,7 +5,7 @@
     width="60%"
     :footer="null"
     :destroyOnClose="true"
-    @cancel="isShow=false"
+    @cancel="isShow = false"
     v-model="isShow">
     <!-- 表单 -->
     <a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
@@ -15,15 +15,14 @@
       <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="custName">
-        <a-input v-model.trim="form.custName" :maxLength="30" placeholder="请输入客户姓名(最多30个字符)" />
-      </a-form-model-item>
+      <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" 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>
+        <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></a-form-model-item>
       <a-form-model-item label="" class="btn-cont" :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }">
         <a-button type="primary" id="setmealPayMoney-submit" @click="onSubmit">确认收款</a-button>
         <a-button id="setmealPayMoney-cancel" class="setmealPayMoney-cancel" @click="cancel">取消</a-button>
@@ -86,14 +85,8 @@ export default {
         custId: null
       },
       rules: {
-        custMobile: [
-          { required: true, message: '请输入手机号', trigger: 'blur' },
-          { validator: isMobileValid, trigger: 'blur' }
-        ],
-        vehicleNumber: [
-          { required: true, message: '请输入车牌号', trigger: 'blur' },
-          { validator: isLicensePlateValid, trigger: 'blur' }
-        ]
+        custMobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: isMobileValid, trigger: 'blur' }],
+        vehicleNumber: [{ required: true, message: '请输入车牌号', trigger: 'blur' }, { validator: isLicensePlateValid, trigger: 'blur' }]
       },
       setmealData: null //  套餐数据
     }
@@ -102,15 +95,18 @@ export default {
     //  手机号输入监听
     mobileInput () {
       if (this.form.custMobile.length == 11) {
-        if (isMobile(this.form.custMobile)) { //  校验手机号
+        if (isMobile(this.form.custMobile)) {
+          //  校验手机号
           //  根据手机号去查询是否已绑定车牌
           bundleFindByMobile({ mobile: this.form.custMobile }).then(res => {
             if (res.status == 200) {
-              if (res.data) { //  查到客户信息
+              if (res.data) {
+                //  查到客户信息
                 this.form.vehicleNumber = ''
                 this.form.custName = res.data.name
                 this.form.custId = res.data.id
-              } else { //  未查到客户信息
+              } else {
+                //  未查到客户信息
                 this.form.vehicleNumber = ''
                 this.form.custName = ''
                 this.form.custId = null
@@ -138,13 +134,15 @@ export default {
               vehicleNumber: this.form.vehicleNumber,
               totalAmount: this.setmealData.price
             },
-            paymentDetailList: [
-              { payType: 10001 }
-            ]
+            paymentDetailList: [{ payType: 10001 }]
           }
           bundleBuy(params).then(res => {
             if (res.status == 200) {
-              this.$router.push({ path: '/SetmealSales/PurchasedSetmeal' })
+              if (this.$hasPermissions('M_bundel_buyRecord')) {
+                this.$router.push({ path: '/SetmealSales/PurchasedSetmeal' })
+              } else {
+                this.cancel()
+              }
             }
           })
         } else {
@@ -191,25 +189,25 @@ export default {
 </script>
 
 <style lang="less">
-  .setmealPayMoneyModal{
-    .item-con{
-      .item-main{
-        margin: 0;
-        .item-price{
-          font-size: 24px;
-          color: red;
-          margin-right: 5px;
-        }
+.setmealPayMoneyModal {
+  .item-con {
+    .item-main {
+      margin: 0;
+      .item-price {
+        font-size: 24px;
+        color: red;
+        margin-right: 5px;
       }
     }
-    .btn-cont{
-      text-align: center;
-      .setmealPayMoney-cancel{
-        margin-left: 30px;
-      }
-    }
-    .text-center{
-      text-align: center;
+  }
+  .btn-cont {
+    text-align: center;
+    .setmealPayMoney-cancel {
+      margin-left: 30px;
     }
   }
+  .text-center {
+    text-align: center;
+  }
+}
 </style>