浏览代码

修改核销记录页面

zhangdan 4 年之前
父节点
当前提交
9693cb9103
共有 1 个文件被更改,包括 57 次插入61 次删除
  1. 57 61
      src/views/SetmealSales/VerificationRecords.vue

+ 57 - 61
src/views/SetmealSales/VerificationRecords.vue

@@ -5,42 +5,41 @@
       <a-form ref="searchForm">
         <a-row :gutter="48">
           <a-col :span="6">
-            <a-form-item label="下单时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-range-picker v-model="time" :format="dateFormat" :placeholder="['开始时间','结束时间']" @change="onChange" />
+            <a-form-item label="核销时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-range-picker
+                v-model="time"
+                :format="dateFormat"
+                :placeholder="['开始时间','结束时间']"
+                :disabledDate="disabledDate"
+                @calendarChange="calendarChange"
+                @change="onChange" />
             </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}">
               <a-select placeholder="请选择" allowClear v-model="storeId" mode="multiple">
                 <a-select-option v-for="item in storeOptionData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="6">
-            <a-form-item label="单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input v-model.trim="searchForm.orderNo" placeholder="请输入" allowClear />
+            <a-form-item label="客户信息" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.orderNo" placeholder="请输入手机号/车牌号" allowClear />
             </a-form-item>
           </a-col>
           <a-col :span="6">
-            <a-form-item label="服务项目" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-select placeholder="请选择" allowClear v-model="searchForm.itemId">
-                <a-select-option v-for="item in itemOptionData" :key="item.id" :value="item.id">{{ item.itemName }}</a-select-option>
-              </a-select>
+            <a-form-item label="套餐名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-input v-model.trim="searchForm.customerMobile" placeholder="请输入" allowClear />
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="48">
           <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}">
               <a-input v-model.trim="searchForm.customerMobile" placeholder="请输入" allowClear :maxLength="11" />
             </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.orderStatus" ref="orderStatus" code="ORDER_STATUS" placeholder="请选择" allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
+          <a-col :span="18">
             <a-button style="margin-right: 10px;" type="primary" @click="handleSearch">查询</a-button>
             <a-button type="" @click="handleRest">重置</a-button>
             <a-button type="" :loading="loading" class="export-btn" @click="handleExport">导出</a-button>
@@ -51,7 +50,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
+      <strong>计:</strong><span v-model="orderTotal">{{ orderTotal || 0 }} 单</span><strong style="margin-left: 15px;">结算金额:</strong><span
         v-model="paymentAmountTotal">{{ paymentAmountTotal || 0 }} 元</span>
     </div>
     <!-- 列表 -->
@@ -136,79 +135,47 @@ export default {
         moment(getDate.getToday().endtime, this.dateFormat)
       ],
       dateFormat: 'YYYY-MM-DD',
+	  nowBeginDate: '',
       columns: [{
-        title: '下单时间',
+		    title: '序号',
+		    dataIndex: 'orderNo',
+		    minWidth: '40',
+		    align: 'center'
+		  }, {
+        title: '核销单号/关联订单号',
         dataIndex: 'orderTime',
         minWidth: '40',
         align: 'center'
       },
       {
-        title: '单号',
+        title: '核销时间',
         dataIndex: 'orderNo',
         minWidth: '40',
         align: 'center'
       },
       {
-        title: '网点名称',
+        title: '核销服务名称',
         dataIndex: 'storeName',
         minWidth: '40',
         align: 'center'
       },
       {
-        title: '服务项目',
+        title: '客户信息',
         dataIndex: 'itemName',
         minWidth: '40',
         align: 'center'
       },
       {
-        title: '手机号码',
+        title: '套餐名称',
         dataIndex: 'customerMobile',
         minWidth: '40',
         align: 'center'
       },
       {
-        title: '应收(¥)',
+        title: '结算金额(¥)',
         dataIndex: 'payableAmount',
         minWidth: '40',
         align: 'center'
-      },
-      {
-        title: '优惠(¥)',
-        dataIndex: 'couponAmount',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'couponAmount'
-        }
-      },
-      {
-        title: '实收(¥)',
-        dataIndex: 'paymentAmount',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'paymentAmount'
-        }
-
-      },
-      {
-        title: '状态',
-        dataIndex: 'orderStatus',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'orderStatus'
-        }
-      },
-      {
-        title: '操作',
-        dataIndex: 'action',
-        minWidth: '40',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'action'
-        }
-
       }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -228,6 +195,34 @@ export default {
   },
   methods: {
     moment,
+    calendarChange (date, dateStrings) {
+	  if (date[0]) {
+	    this.nowBeginDate = date[0].format('YYYY-MM-DD')
+	  }
+    },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+	  if (this.nowBeginDate) { //  有下单时间开始时间时
+	    const bVal = this.getThreeMonthsAfter(this.nowBeginDate, -3) //  三个月前时间戳
+	    const eVal = this.getThreeMonthsAfter(this.nowBeginDate, 3) //  三个月后时间戳
+	    if (Date.now() < eVal) { //  当前日期距起始日期不足三个月
+	      return date && date.valueOf() < bVal || date && date.valueOf() > Date.now()
+	    } else {
+	      return date && date.valueOf() < bVal || date && date.valueOf() > eVal
+	    }
+	  } else {
+	    return date && date.valueOf() > Date.now()
+	  }
+    },
+    //  获取month个月后的时间戳
+    getThreeMonthsAfter (dtstr, month) {
+	  var s = dtstr.split('-')
+	  var yy = parseInt(s[0])
+	  var mm = parseInt(s[1])
+	  var dd = parseInt(s[2])
+	  var dt = new Date(yy, mm + Number(month) - 1, dd)
+	  return dt.valueOf()
+    },
     // 创建时间change
     onChange (dates, dateStrings) {
       if ((dates, dateStrings)) {
@@ -312,6 +307,7 @@ export default {
     },
     // 重置
     handleRest () {
+      this.nowBeginDate = getDate.getToday().starttime
       this.searchForm.beginDate = getDate.getToday().starttime
       this.searchForm.endDate = getDate.getToday().endtime
       this.time = [