chenrui 4 tahun lalu
induk
melakukan
67615f6dda

+ 35 - 25
src/config/router.config.js

@@ -56,26 +56,36 @@ export const asyncRouterMap = [{
       permission: 'M_bundel_saller'
     },
     children: [
-    {
-      path: '/SetmealSales/BuySetmeal',
-      name: 'BuySetmeal',
-      component: () => import('@/views/SetmealSales/BuySetmeal.vue'),
-      meta: {
-        title: '购买套餐',
-        icon: 'file-text',
-        permission: 'M_buy_bundel'
-      }
-    },
-    {
-      path: '/SetmealSales/PurchasedSetmeal',
-      name: 'PurchasedSetmeal',
-      component: () => import('@/views/SetmealSales/PurchasedSetmeal.vue'),
-      meta: {
-        title: '已购套餐',
-        icon: 'file-text',
-        permission: 'M_bundel_buyRecord'
+      {
+        path: '/SetmealSales/BuySetmeal',
+        name: 'BuySetmeal',
+        component: () => import('@/views/SetmealSales/BuySetmeal.vue'),
+        meta: {
+          title: '购买套餐',
+          icon: 'file-text',
+          permission: 'M_buy_bundel'
+        }
+      },
+      {
+        path: '/SetmealSales/PurchasedSetmeal',
+        name: 'PurchasedSetmeal',
+        component: () => import('@/views/SetmealSales/PurchasedSetmeal.vue'),
+        meta: {
+          title: '已购套餐',
+          icon: 'file-text',
+          permission: 'M_bundel_buyRecord'
+        }
+      },
+      {
+        path: '/SetmealSales/SetmealAttr',
+        name: 'SetmealAttr',
+        component: () => import('@/views/SetmealSales/SetmealAttr.vue'),
+        meta: {
+          title: '套餐属性',
+          icon: 'file-text'
+        // permission: 'M_bundel_buyRecord'
+        }
       }
-    }
     ]
   },
   // 服务
@@ -85,7 +95,7 @@ export const asyncRouterMap = [{
     component: PageView,
     meta: {
       title: '服务',
-      icon: 'profile',
+      icon: 'profile'
     },
     children: [
       {
@@ -95,7 +105,7 @@ export const asyncRouterMap = [{
         component: RouteView,
         meta: {
           title: '已购服务',
-          icon: 'profile',
+          icon: 'profile'
         },
         hideChildrenInMenu: true,
         children: [
@@ -106,7 +116,7 @@ export const asyncRouterMap = [{
             meta: {
               title: '服务列表',
               icon: 'shopping',
-              hidden: true,
+              hidden: true
             }
           },
           {
@@ -116,7 +126,7 @@ export const asyncRouterMap = [{
             meta: {
               title: '服务详情',
               icon: 'profile',
-              hidden: true,
+              hidden: true
             }
           }
         ]
@@ -129,7 +139,7 @@ export const asyncRouterMap = [{
 	  component: PageView,
 	  meta: { title: '财务管理', icon: 'account-book', permission: 'M_cwgn' },
 	  children: [
-			{
+      {
 			  path: '/SetmealSales/VerificationRecords',
 			  name: 'VerificationRecords',
 			  component: () => import('@/views/SetmealSales/VerificationRecords.vue'),
@@ -138,7 +148,7 @@ export const asyncRouterMap = [{
 			    icon: 'file-text',
 			    permission: 'M_hxjl_list'
 			  }
-			},
+      },
 	    {
 	      path: 'PaySettlementRecords/list',
 	      name: 'PaySettlementRecords',

+ 23 - 8
src/views/SetmealSales/PurchasedSetmeal.vue

@@ -30,8 +30,6 @@
               <a-input v-model.trim="searchForm.bundleName" id="purchasedSetmeal-bundleName" placeholder="请输入套餐名称" allowClear />
             </a-form-item>
           </a-col>
-          <!-- <a-col :span="6">
-            <a-form-item label="订单状态" :label-col="{ span:7 }" :wrapper-col="{ span:17}"> -->
           <v-select
             v-show="false"
             v-model="searchForm.orderFlag"
@@ -40,8 +38,6 @@
             code="PAY_STATUS"
             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
@@ -53,6 +49,19 @@
                 allowClear></v-select>
             </a-form-item>
           </a-col>
+          <a-col :span="6">
+            <a-form-item label="销售合作商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+              <a-select
+                id="purchasedSetmeal-partner"
+                allowClear
+                show-search
+                option-filter-prop="children"
+                placeholder="请选择销售合作商"
+                v-model="searchForm.partner">
+                <a-select-option v-for="(item,index) in partnerList" :key="index" :value="item.value">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
           <a-col :span="12">
             <a-button class="handle-btn serach-btn" id="purchasedSetmeal-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
             <a-button class="handle-btn" type="" id="purchasedSetmeal-reset" @click="handleReset">重置</a-button>
@@ -116,7 +125,8 @@ export default {
         number: '', // 订单号
         queryWord: '', // 客户信息
         orderFlag: '', // 订单状态
-        salesChannelSettleStatus: '' // 结算状态
+        salesChannelSettleStatus: '', // 结算状态
+        partner: undefined //  销售合作商
       },
       loading: false, // 导出loading
       orderTotal: '', // 合计开单数量
@@ -133,6 +143,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
         { title: '订单号', dataIndex: 'number', width: 100, align: 'center' },
         { title: '下单时间', dataIndex: 'orderDate', width: 100, align: 'center' },
+        { title: '销售合作商', dataIndex: 'partner', width: 100, align: 'center' },
         { title: '套餐名称', dataIndex: 'bundleName', width: 100, align: 'center' },
         { title: '客户信息', scopedSlots: { customRender: 'custInfo' }, width: 100, align: 'center' },
         { title: '收款金额(¥)', dataIndex: 'payedAmount', width: 80, align: 'center' },
@@ -155,7 +166,8 @@ export default {
             return res.data
           }
         })
-      }
+      },
+      partnerList: [] //  销售合作商  下拉数据
     }
   },
   methods: {
@@ -184,7 +196,8 @@ export default {
         number: this.searchForm.number,
         queryWord: this.searchForm.queryWord,
         orderFlag: this.searchForm.orderFlag,
-        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
+        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus,
+        partner: this.searchForm.partner
       }
       params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
       params.endDate == null ? params.endDate = getDate.getToday().endtime : null
@@ -222,6 +235,7 @@ export default {
       this.searchForm.queryWord = ''
       this.searchForm.orderFlag = null
       this.searchForm.salesChannelSettleStatus = null
+      this.searchForm.partner = undefined
       this.$refs.table.refresh(true)
     },
     // 导出
@@ -233,7 +247,8 @@ export default {
         number: this.searchForm.number,
         queryWord: this.searchForm.queryWord,
         orderFlag: this.searchForm.orderFlag,
-        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus
+        salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus,
+        partner: this.searchForm.partner
       }
       if (!params.beginDate && !params.endDate) {
         this.$message.error('请先选择需要导出的下单时间区间再进行导出!')

+ 169 - 0
src/views/SetmealSales/SetmealAttr.vue

@@ -0,0 +1,169 @@
+<template>
+  <a-card :bordered="false" class="setmealAttr-wrap">
+    <!-- 搜索条件 -->
+    <div class="setmealAttr-searchForm">
+      <a-form ref="searchForm" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="合作商" :label-col="{ span: 7 }" :wrapper-col="{ span: 17 }">
+              <a-select
+                id="setmealAttr-partner"
+                allowClear
+                show-search
+                option-filter-prop="children"
+                placeholder="请选择合作商"
+                v-model="searchForm.partner"
+                @change="pageInit">
+                <a-select-option v-for="(item, index) in partnerList" :key="index" :value="item.value">{{ 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.bundleName" id="setmealAttr-bundleName" placeholder="请输入套餐名称" allowClear />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-button class="handle-btn serach-btn" id="setmealAttr-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button class="handle-btn" type="" id="setmealAttr-reset" @click="handleReset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 未选择合作商 -->
+    <div class="unChoose" v-if="!searchForm.partner">
+      <a-icon type="exclamation-circle" theme="filled" :style="{ fontSize: '18px', color: '#ff9900', verticalAlign: 'sub', marginRight: '5px' }" />
+      <span>请先选择合作商</span>
+    </div>
+    <!-- 列表 -->
+    <a-table
+      v-if="searchForm.partner"
+      class="table"
+      ref="table"
+      size="default"
+      :rowKey="record => record.id"
+      :columns="columns"
+      :dataSource="loadData"
+      bordered>
+      <!-- 客户信息 -->
+      <p slot="custInfo" slot-scope="text, record">
+        <span v-if="record.custMobile">{{ record.custMobile }}</span>
+        <span v-else>--</span>
+      </p>
+      <!-- 操作 -->
+      <span slot="action" slot-scope="text, record"><a-button type="primary" id="purchasedSetmeal-look" @click="setAttr(record)">设置套餐属性</a-button></span>
+    </a-table>
+  </a-card>
+</template>
+
+<script>
+import { STable } from '@/components'
+export default {
+  components: { STable },
+  data () {
+    return {
+      // 查询参数
+      searchForm: {
+        bundleName: '', // 套餐名称
+        partner: undefined //  合作商
+      },
+      partnerList: [{ value: 1, name: '合作商1' }, { value: 2, name: '合作商2' }, { value: 3, name: '合作商3' }, { value: 4, name: '合作商4' }], //  合作商  下拉数据
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '合作商名称', dataIndex: 'partner', width: 100, align: 'center' },
+        { title: '套餐名称', dataIndex: 'bundleName', width: 100, align: 'center' },
+        { title: '套餐别名', dataIndex: 'bundleNames', width: 100, align: 'center' },
+        { title: '所属地区', dataIndex: 'number', width: 100, align: 'center' },
+        { title: '所属项目名称', dataIndex: 'orderDate', width: 100, align: 'center' },
+        { title: '分公司名称', dataIndex: 'payedAmount', width: 100, align: 'center' },
+        { title: '折扣比例', dataIndex: 'payedAmounts', width: 80, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
+      ],
+      loadData: [] //  表格数据
+    }
+  },
+  methods: {
+    //  页面初始化
+    pageInit () {
+      if (this.searchForm.partner) {
+        //  请求列表数据
+        this.loadData = [
+          {
+            id: 1,
+            no: 1,
+            partner: '合作商1',
+            bundleName: '车内精致洗护套餐',
+            bundleNames: '洗护套餐',
+            number: '陕西省西安市',
+            orderDate: '项目名称11',
+            payedAmount: '上海有限公司',
+            payedAmounts: '45%'
+          },
+          {
+            id: 2,
+            no: 2,
+            partner: '合作商2',
+            bundleName: '车内精致洗护套餐',
+            bundleNames: '洗护套餐',
+            number: '海南市',
+            orderDate: '项目名称22',
+            payedAmount: '海南有限公司',
+            payedAmounts: '5%'
+          },
+          {
+            id: 3,
+            no: 3,
+            partner: '合作商3',
+            bundleName: '车内精致洗护套餐',
+            bundleNames: '洗护套餐',
+            number: '省天津市',
+            orderDate: '项目名称33',
+            payedAmount: '天津有限公司',
+            payedAmounts: '80%'
+          }
+        ]
+      }
+    },
+    //  设置套餐属性
+    setAttr (row) {
+
+    },
+    // 重置
+    handleReset () {
+      this.searchForm.bundleName = ''
+      this.searchForm.partner = undefined
+      this.$refs.table.refresh(true)
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.pageInit()
+    })
+  }
+}
+</script>
+
+<style lang="less">
+.setmealAttr-wrap {
+  .setmealAttr-searchForm {
+    // 搜索框的下间距
+    .ant-form-item {
+      margin-bottom: 10px;
+    }
+    .handle-btn {
+      margin-top: 4px;
+    }
+    .serach-btn {
+      margin-right: 10px;
+    }
+  }
+  .table {
+    margin-top: 25px;
+  }
+  .unChoose {
+    text-align: center;
+    margin: 240px 0 300px;
+    font-size: 16px;
+  }
+}
+</style>

+ 39 - 7
src/views/SetmealSales/SetmealDetailModal.vue

@@ -70,7 +70,11 @@
             :columns="setMealColumns"
             :dataSource="setMealData"
             :pagination="false"
-            bordered></a-table>
+            bordered>
+            <span slot="action" slot-scope="text, record">
+              <a-button type="link" @click="setDelay=true">延期</a-button>
+            </span>
+          </a-table>
         </a-tab-pane>
         <a-tab-pane key="2" tab="使用记录">
           <!-- 使用记录列表 -->
@@ -89,17 +93,23 @@
           </a-table>
         </a-tab-pane>
       </a-tabs>
-      <div class="btn-cont"><a-button id="detailsSetmealModal-back" @click="isShow = false">返回列表</a-button></div>
+      <div class="btn-cont">
+        <a-button id="detailsSetmealModal-back" @click="isShow = false">返回列表</a-button>
+        <a-button id="detailsSetmealModal-cancel" type="primary" @click="cancelBuy">取消购买</a-button>
+      </div>
     </a-modal>
+    <!-- 延期 -->
+    <delay-modal :openModal="setDelay" :setmealId="setmealId" @close="setDelay=false" />
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 import { customerBundleDetail, customerBundleUseHistory } from '@/api/customerBundle.js'
+import DelayModal from './delayModal.vue'
 export default {
   name: 'SetmealDetailModal',
-  components: { STable, VSelect },
+  components: { STable, VSelect, DelayModal },
   props: {
     openModal: {
       //  弹框是否展示
@@ -117,8 +127,14 @@ export default {
       isShow: this.openModal, //  弹框是否展示
       setMealColumns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
-        { title: '内容', dataIndex: 'itemName', width: 200, align: 'center' },
-        { title: '剩余数量', dataIndex: 'remainTimes', width: 100, align: 'center' }
+        { title: '服务名称', dataIndex: 'itemName', width: 200, align: 'center' },
+        { title: '到期时间', dataIndex: 'times', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总次数', dataIndex: 'zcs', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '剩余次数', dataIndex: 'remainTimes', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '已用次数', dataIndex: 'yycs', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '过期次数', dataIndex: 'gqcs', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退款次数', dataIndex: 'tkcs', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
       ],
       recordColumns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
@@ -129,7 +145,8 @@ export default {
       ],
       setMealData: [], //  套餐内容
       recordData: [], //  使用记录
-      detailsData: null //  套餐数据
+      detailsData: null, //  套餐数据
+      setDelay: false //  延期设置
     }
   },
   methods: {
@@ -169,6 +186,18 @@ export default {
           this.recordData = []
         }
       })
+    },
+    //  取消购买
+    cancelBuy () {
+      const _this = this
+      this.$confirm({
+        title: '取消购买',
+        content: '取消购买后,套餐内所有服务的剩余次数变为0,用户无法再使用套餐。确认取消购买吗?',
+        onOk: () => {
+
+        },
+        onCancel () {}
+      })
     }
   },
   watch: {
@@ -242,7 +271,10 @@ export default {
 	}
 	.btn-cont {
 		text-align: center;
-		margin: 35px 0 10px;
+		margin: 50px 0 10px;
+    button{
+      margin: 0 20px;
+    }
 	}
 }
 </style>

+ 53 - 5
src/views/SetmealSales/SetmealPayMoney.vue

@@ -11,16 +11,45 @@
     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="custMobile">
-        <a-input v-model.trim="form.custMobile" @input="mobileInput" :maxLength="11" placeholder="请输入手机号" />
+        <a-input id="setmealPayMoney-custMobile" v-model.trim="form.custMobile" @input="mobileInput" :maxLength="11" placeholder="请输入手机号" />
       </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="partner">
+        <a-select id="setmealPayMoney-partner" v-model="form.partner" placeholder="请选择该套餐是由哪个合作商售出">
+          <a-select-option v-for="(item, index) in partnerList" :key="index" :value="item.value">{{ item.value }}</a-select-option>
+        </a-select>
+      </a-form-model-item>
+      <!-- 有效期 -->
+      <a-form-model-item label="有效期" prop="timeType">
+        <a-radio-group id="setmealPayMoney-timeType" v-model="form.timeType">
+          <a-radio :value="1">永久有效</a-radio>
+          <a-radio :value="0">设置有效时间</a-radio>
+        </a-radio-group>
+      </a-form-model-item>
+      <!-- 到期时间 -->
+      <a-form-model-item v-if="form.timeType==0" label="到期时间" prop="time">
+        <a-date-picker
+          type="date"
+          v-model="form.time"
+          id="setmealPayMoney-time"
+          placeholder="请选择到期时间,超过该时间,用户将无法再使用套餐"
+          :disabled-date="disabledDate"
+          style="width: 100%;" />
+      </a-form-model-item>
+      <!-- 客户姓名 -->
+      <a-form-model-item label="客户姓名" prop="custName">
+        <a-input id="setmealPayMoney-custName" 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></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>
@@ -34,6 +63,7 @@
 <script>
 import { isMobile } from '@/libs/tools'
 import { bundleFindByMobile, bundleBuy } from '@/api/customerBundle.js'
+import moment from 'moment'
 export default {
   name: 'SetmealPayMoney',
   props: {
@@ -68,15 +98,27 @@ export default {
       form: {
         custMobile: '',
         custName: '',
-        custId: null
+        custId: null,
+        partner: undefined, //  销售合作商
+        timeType: 1, //  有效期
+        time: null //  到期时间
       },
       rules: {
-        custMobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: isMobileValid, trigger: 'blur' }]
+        custMobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: isMobileValid, trigger: 'blur' }],
+        partner: [{ required: true, message: '请选择销售合作商', trigger: 'change' }],
+        timeType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
+        time: [{ required: true, message: '请选择到期时间', trigger: 'change' }]
       },
-      setmealData: null //  套餐数据
+      setmealData: null, //  套餐数据
+      partnerList: [] //  合作商  下拉数据
     }
   },
   methods: {
+    moment,
+    disabledDate (current) {
+      // return current && current < moment().endOf('day')  //  不包含当天
+      return current.valueOf() < moment().subtract(1, 'days').valueOf() //  包含当天
+    },
     //  手机号输入监听
     mobileInput () {
       if (this.form.custMobile.length == 11) {
@@ -108,6 +150,9 @@ export default {
             custId: this.form.custId,
             custName: this.form.custName,
             custMobile: this.form.custMobile,
+            partner: this.form.partner,
+            timeType: this.form.timeType,
+            time: this.form.time,
             totalAmount: this.setmealData.price,
             paymentDetail: { payType: 10001 }
           }
@@ -136,6 +181,9 @@ export default {
       this.form.custMobile = ''
       this.form.custName = ''
       this.form.custId = null
+      this.form.partner = undefined
+      this.form.timeType = 1
+      this.form.time = null
     }
   },
   watch: {

+ 160 - 0
src/views/SetmealSales/delayModal.vue

@@ -0,0 +1,160 @@
+<template>
+  <a-modal
+    class="delayModal"
+    title="套餐服务延期"
+    width="60%"
+    centered
+    :footer="null"
+    :maskClosable="false"
+    :destroyOnClose="true"
+    @cancel="isShow = false"
+    v-model="isShow">
+    <!-- 表单 -->
+    <a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+      <!-- 服务名称 -->
+      <a-form-model-item label="服务名称" class="item-con"><p class="item-main">清泉洗车(VIP)</p></a-form-model-item>
+      <!-- 到期时间 -->
+      <a-form-model-item label="到期时间" class="item-con"><p class="item-main">2020-11-28</p></a-form-model-item>
+      <!-- 过期次数 -->
+      <a-form-model-item label="过期次数" class="item-con"><p class="item-main">15次</p></a-form-model-item>
+      <!-- 新的到期时间 -->
+      <a-form-model-item label="新的到期时间" prop="time">
+        <a-date-picker
+          type="date"
+          v-model="form.time"
+          id="delay-time"
+          placeholder="请选择到期时间,超过该时间,用户将无法再使用套餐"
+          :disabled-date="disabledDate"
+          style="width: 80%;" />
+      </a-form-model-item>
+      <!-- 是否返还已过期服务 -->
+      <a-form-model-item label="是否返还已过期服务" prop="timeType">
+        <a-radio-group id="delay-timeType" v-model="form.timeType">
+          <a-radio :value="1">是</a-radio>
+          <a-radio :value="0">否</a-radio>
+        </a-radio-group>
+      </a-form-model-item>
+      <!-- 返还次数 -->
+      <a-form-model-item v-if="form.timeType==1" label="返还次数" prop="custMobile">
+        <a-input-number
+          id="delay-custMobile"
+          v-model="form.custMobile"
+          :precision="0"
+          :min="0"
+          :max="999999"
+          placeholder="请输入返还次数"
+          style="width: 80%;margin-right: 10px;" />次
+      </a-form-model-item>
+      <a-form-model-item label="" class="btn-cont" :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }">
+        <a-button id="delay-cancel" class="delay-cancel" @click="cancel">取消</a-button>
+        <a-button type="primary" id="delay-submit" @click="onSubmit">提交</a-button>
+      </a-form-model-item>
+    </a-form-model>
+  </a-modal>
+</template>
+
+<script>
+import moment from 'moment'
+export default {
+  name: 'DelayModal',
+  props: {
+    openModal: {
+      //  弹框是否展示
+      type: Boolean,
+      default: false
+    },
+    setmealId: {
+      //  套餐id
+      type: [String, Number],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  弹框是否展示
+      form: {
+        time: null, //  新的到期时间
+        timeType: 1, //  是否返还已过期服务
+        custMobile: null //  返还次数
+      },
+      rules: {
+        time: [{ required: true, message: '请选择新的到期时间', trigger: 'change' }],
+        timeType: [{ required: true, message: '请选择是否返还已过期服务', trigger: 'change' }],
+        custMobile: [{ required: true, message: '请输入返还次数', trigger: 'blur' }]
+      }
+    }
+  },
+  methods: {
+    moment,
+    disabledDate (current) {
+      // return current && current < moment().endOf('day')  //  不包含当天
+      return current.valueOf() < moment().subtract(1, 'days').valueOf() //  包含当天
+    },
+    //  取消
+    cancel () {
+      this.resetForm() //  重置表单数据
+      this.isShow = false
+    },
+    // 重置表单
+    resetForm () {
+      this.form.custMobile = null
+      this.form.timeType = 1
+      this.form.time = null
+    },
+    //  提交
+    onSubmit () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = {
+            bundleId: this.setmealId,
+            custMobile: this.form.custMobile,
+            timeType: this.form.timeType,
+            time: this.form.time
+          }
+          // bundleBuy(params).then(res => {
+          //   if (res.status == 200) {
+          //     this.cancel()
+          //   }
+          // })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+        this.resetForm() //  重置表单数据
+      }
+    },
+    setmealId (newValue, oldValue) {
+      if (newValue && this.isShow) {
+        // this.setmealData = newValue
+      } else {
+        // this.setmealData = null
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .delayModal{
+    .btn-cont {
+    	text-align: center;
+    	margin: 50px 0 10px;
+      button{
+        margin: 0 20px;
+      }
+    }
+  }
+</style>

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'https://channel.test.zyucgj.com/zyyc-channel/',
-        // target: 'http://192.168.16.104:8081/zyyc-channel/',
+        // target: 'https://channel.test.zyucgj.com/zyyc-channel/',
+        target: 'http://192.168.16.102:7103/zyyc-channel/',
         ws: false,
         changeOrigin: true,
         pathRewrite: {