zhangdan 4 년 전
부모
커밋
af8915e244
5개의 변경된 파일319개의 추가작업 그리고 433개의 파일을 삭제
  1. 4 2
      src/config/router.config.js
  2. 51 271
      src/views/Service/PurchasedServiceDetail.vue
  3. 103 158
      src/views/Service/PurchasedServiceList.vue
  4. 159 0
      src/views/Service/yanQiModal.vue
  5. 2 2
      vue.config.js

+ 4 - 2
src/config/router.config.js

@@ -95,7 +95,8 @@ export const asyncRouterMap = [{
     component: PageView,
     meta: {
       title: '服务',
-      icon: 'profile'
+      icon: 'profile',
+			permission: 'M_Service'
     },
     children: [
       {
@@ -105,7 +106,8 @@ export const asyncRouterMap = [{
         component: RouteView,
         meta: {
           title: '已购服务',
-          icon: 'profile'
+          icon: 'profile',
+					permission: 'M_Service_list'
         },
         hideChildrenInMenu: true,
         children: [

+ 51 - 271
src/views/Service/PurchasedServiceDetail.vue

@@ -6,28 +6,12 @@
         <detail-list-item term="订单来源">{{ dataSourceName ? dataSourceName : '--' }}</detail-list-item>
         <detail-list-item term="下单时间">{{ orderBundle.orderDate ? orderBundle.orderDate : '--' }}</detail-list-item>
         <detail-list-item term="订单状态">{{ palyStatus ? palyStatus :'--' }}</detail-list-item>
-        <!-- <detail-list-item term="订单来源">{{ palyStatus ? palyStatus :'--' }}</detail-list-item> -->
         <detail-list-item term="客户信息">{{ custInfo ? custInfo : '--' }}</detail-list-item>
-        <!-- <detail-list-item term="套餐名称">{{ orderBundle.bundleName ? orderBundle.bundleName : '--' }}</detail-list-item> -->
         <detail-list-item term="应付金额">{{ orderBundle.totalAmount ? orderBundle.totalAmount :'--' }}</detail-list-item>
-
         <detail-list-item term="支付时间" v-if="isPay">{{ payDate ? payDate : '--' }}</detail-list-item>
-        <!-- <detail-list-item term="支付方式">{{ payDetail.payType }}</detail-list-item> -->
         <detail-list-item term="支付金额" v-if="isPay">¥{{ orderBundle.payedAmount ? orderBundle.payedAmount : '--' }}</detail-list-item>
-
       </detail-list>
     </a-card>
-   <!-- <a-card class="detail-card" :bordered="false" title="优惠券">
-      <detail-list v-if="coupon">
-        <detail-list-item term="优惠券名称">{{ coupon.name ? coupon.name : '--' }}</detail-list-item>
-        <detail-list-item term="发放/领取时间">{{ customerCoupon.createDate ? customerCoupon.createDate : '--' }}</detail-list-item>
-        <detail-list-item term="使用有效期">{{ coupon.validTime ? Math.round(coupon.validTime/60/24) : '-' }} 天</detail-list-item>
-      </detail-list>
-      <div class="detail-card-info" v-if="!coupon">
-        此订单没有使用优惠券
-      </div>
-    </a-card> -->
-    <!-- <a-card class="detail-card" :bordered="false" title="套餐内容" v-if="isPay"> -->
 	<a-card class="detail-card" :bordered="false" title="服务内容" >
       <a-table :columns="columns" rowKey="id" :dataSource="customerBundleItemList" bordered :pagination="false">
         <span slot="no" slot-scope="text, record, index">
@@ -37,16 +21,14 @@
         </span>
         <span slot="hexiao" slot-scope="text, record, index">
           <template>
-            <!-- <a-button :disabled="!record.expiryDate" type="primary"  @click="hexiao(record)">延期</a-button> -->
-			<a-button  type="primary"  @click="hexiao(record)">延期</a-button>
-            <!-- <span v-if="!$hasPermissions('B_customerBundle_hexiao')" style="text-align: center;font-size: 20px;">--</span> -->
+			<a-button  type="primary" v-if="record.isDelay" @click="yanQi(record)">延期</a-button>
+			<span v-else>--</span>
           </template>
         </span>
       </a-table>
     </a-card>
 	<!-- 使用记录 -->
     <a-card class="detail-card" :bordered="false" title="使用记录">
-		<!-- <a-card class="detail-card" :bordered="false" title="使用记录" v-if="isPay"> -->
       <a-table :columns="usedColumns" rowKey="id" :dataSource="verificationList" bordered v-if="verificationList && verificationList.length > 0" :pagination="false">
         <span slot="no" slot-scope="text, record, index">
           <template>
@@ -58,124 +40,21 @@
         此订单没有使用记录
       </div>
     </a-card>
-    <!-- <a-card class="detail-card" :bordered="false" title="订单取消信息" v-if="isCancel">
-      <detail-list>
-        <detail-list-item term="取消原因">{{ palyStatusStr }}</detail-list-item>
-        <detail-list-item term="取消时间">{{ orderBundle.cancleTime }}</detail-list-item>
-      </detail-list>
-    </a-card>
-    <a-card class="detail-card" :bordered="false" title="付款期限" v-if="orderBundle.orderFlag === 'UNPA' ">
-      <div class="detail-card-info">
-        {{ orderBundle.expiryDate }}  点前未支付, 系统将自动取消订单
-      </div>
-    </a-card> -->
+	<!-- 取消购买 -->
 	<a-card class="detail-card" :bordered="false" style="text-align: center;" >
 		<a-button :disabled="verificationList && verificationList.length > 0" type="primary" @click="canselBuy">取消购买</a-button>
 	</a-card>
 	<!-- 延期弹窗 -->
-    <a-modal title="服务延期" :footer="null" v-model="yanqiModal" @cancel="canselYq" @ok="handleYanqiOk" width="50%" :centered='true'>
-      <!-- <StoreSearch ref="storeSearch" @storeChange="storeChange" placeholder="搜索并选择核销门店"></StoreSearch> -->
-	  <a-form :form="form">
-	      <a-col :span="24">
-	        <!-- 用户名称 -->
-	        <a-form-item label="服务名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-	          <span>{{}}</span>
-	        </a-form-item>
-	      </a-col>
-	      <a-col :span="24">
-	        <!-- 手机号码 -->
-	        <a-form-item label="到期时间" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-	          <span>{{}}</span>
-	        </a-form-item>
-	      </a-col>
-			<a-col :span="24">
-			  <!-- 手机号码 -->
-			  <a-form-item label="过期次数" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-			    <span>{{}}</span>
-			  </a-form-item>
-			</a-col>
-			<a-col :span="24">
-				<a-form-item label="新到期时间" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-				  <a-date-picker style="width: 60%;"
-				        format="YYYY-MM-DD"
-				        :disabled-date="disabledDate"
-						v-decorator="[
-						  'formData.loginFlag',
-						  {
-						    initialValue: formData.loginFlag,
-						    rules: [{ required: true, message: '请选择新的到期时间!' }] },
-						]"
-				      />
-				</a-form-item>
-			</a-col>
-	      <!-- 状态 -->
-	      <a-col :span="24">
-	        <a-form-item label="是否返回已过期服务" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
-	          <a-radio-group
-	            id="user-add-loginFlag"
-	            name="radioGroup"
-				@change="changeStatus"
-	            v-decorator="[
-	              'formData.loginFlag',
-	              {
-	                initialValue: formData.loginFlag,
-	                rules: [] },
-	            ]"
-	          >
-	            <a-radio :value="1">是</a-radio>
-	            <a-radio :value="0">否</a-radio>
-	          </a-radio-group>
-	  
-	        </a-form-item>
-	      </a-col>
-	      <a-col :span="24">
-	        <a-form-item label="返还次数" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" v-if="showBackNum">
-	          <!-- <a-input placeholder="请输入" style="width: 60%;" /> -->
-			  <a-input-number id="inputNumber" :min="0" :max="999999" :precision="0"  placeholder="请输入返还次数(0~999999)" style="width: 60%;" v-decorator="['formData.validityTermValue',{
-			    initialValue: formData.validityTermValue,
-			    rules: []
-			  }]"/>
-	        </a-form-item>
-	      </a-col>
-			<div class="button-row">
-			  <a-button key="back" @click="canselYq">
-			    取消
-			  </a-button>
-			  <a-button key="submit" type="primary" :loading="loading" @click="handleYanqiOk">
-			    确定
-			  </a-button>
-			</div>
-	      <!-- <a-button id="user-add-btn-save" type="primary" @click="handleSubmit()">
-	        保存
-	      </a-button>
-	      <a-button id="user-add-btn-cancel" :style="{ marginLeft: '8px' }" @click="handleCancel()">
-	        取消
-	      </a-button> -->
-	    </a-form-item>
-	  </a-form>
-    </a-modal>
-	<!-- 取消购买弹窗 -->
-	<a-modal title="取消购买" v-model="buyModal" @cancel="canselBuy" :bodyStyle="{textAlign:'center'}" :centered='true' :footer="null">
-		<p>取消购买后,服务的剩余次数变为0,用户无法再使用服务</p>
-		<p>确认取消购买吗?</p>
-		<div class="button-row">
-		  <a-button key="back" @click="canselHx">
-		    取消
-		  </a-button>
-		  <a-button key="submit" type="primary" :loading="loading" @click="handleHexiaoOk">
-		    确定
-		  </a-button>
-		</div>
-	</a-modal>
+	<yanQi-modal :yanQiData="yanQiData" :yanqiModal="yanqiModal" @close="canselYq"></yanQi-modal>
   </a-card>
 </template>
 
 <script>
-import { customerBundleDetail, verificationHexiao } from '@/api/customerBundle'
+import { customerBundleDetail, verificationHexiao,orderCancel } from '@/api/customerBundle'
 import { getLookUpDataBy } from '@/api/data'
 import { PageView } from '@/layouts'
 import { STable } from '@/components'
-// import StoreSearch from '@/components/QueryStore/StoreSearch'
+import yanQiModal from './yanQiModal.vue'
 import DetailList from '@/components/tools/DetailList'
 import _ from 'lodash'
 import moment from 'moment';
@@ -186,7 +65,8 @@ export default {
     PageView,
     DetailList,
     DetailListItem,
-    STable
+    STable,
+	yanQiModal
   },
   computed: {
     palyStatus () {
@@ -241,113 +121,27 @@ export default {
     return {
 	form: this.$form.createForm(this),
       loading: false,
-	  showBackNum:true,
+	  // showBackNum:true,
       customerCoupon: {},
       palyStatusList: [],
 	  yanqiModal:false,
       hexiaoModal: false,
 	  buyModal:false,
-      hxStoreId: '',
+	  orderBundleId:"",
+	  yanQiData:null,
       hxCustomerBundleItemId: '',
 	  dataSourceName: '',
       customer: null,
-	  formData:{
-		  loginFlag:1,
-	  },
-      orderBundle: {
-        // bundleId: 10000,
-        // bundleName: '测试套餐',
-        // cancleTime: 1561304318000,
-        // cancleType: '1',
-        // couponAmount: 1,
-        // couponId: 10001,
-        // couponType: '1',
-        // custId: 10000,
-        // custMobile: '15811111111',
-        // custName: 'guoguoguo',
-        // id: 10001,
-        // number: '1112',
-        // orderDate: 1561132800000,
-        // orderFlag: '2',
-        // payedAmount: 1,
-        // totalAmount: 1,
-        // typeId: '1',
-        // typeLabel: '套餐购买'
-      },
-
-      payDetail: {
-        // billNo: '1233',
-        // bizId: 10000,
-        // bizType: '1',
-        // createDate: '2019-06-22 23:44:21',
-        // id: 1,
-        // operId: 1,
-        // operName: '1',
-        // payCategory: '1',
-        // payDate: 1561218251000,
-        // payDesc: '1111',
-        // payNo: '1',
-        // payType: '1',
-        // sort: 0,
-        // totalAmount: 100,
-        // type: '1'
-      },
-      verificationList: [
-        // {
-        //   bundId: 1,
-        //   bundItemId: 1,
-        //   bundItemName: '1',
-        //   bundItemTimes: 1561219124000,
-        //   bundName: '1',
-        //   createDate: '2019-06-22 23:57:51',
-        //   custId: 1,
-        //   custMobile: '1',
-        //   customerBundleId: 10000,
-        //   id: 1,
-        //   sort: 0,
-        //   storeId: 1,
-        //   storeName: '1'
-        // }
-      ],
+	  
+      orderBundle: {},
+      payDetail: {},
+      verificationList: [],
 
-      customerBundleItemList: [
-        // {
-        //   customerBundleId: 10000,
-        //   id: 1,
-        //   itemClsName: '1',
-        //   itemId: 1,
-        //   itemName: '1',
-        //   itemPrice: 1,
-        //   lastUsedStoreId: 1,
-        //   lastUsedTime: 1561139801000,
-        //   lastUsedWeekNum: 1,
-        //   times: 1
-        // }
-      ],
-      coupon: {
-        // amount: 2,
-        // createDate: '2019-06-23 00:21:15',
-        // id: 10001,
-        // limitAmount: 2,
-        // limitCnt: 2,
-        // limitIsAmount: '2',
-        // limitProduct: '2',
-        // limitReceive: 2,
-        // limitStoreId: 2,
-        // limitStrategy: '2',
-        // name: 2,
-        // receivedQty: 2,
-        // remarks: '2',
-        // status: '2',
-        // typeId: '2',
-        // typeName: '2',
-        // usedQty: 2,
-        // validTime: 2
-      },
+      customerBundleItemList: [],
+      coupon: {},
       columns: [
         {
           title: '序号',
-          // dataIndex: 'no',
           scopedSlots: { customRender: 'no' },
 		  width: 60,
 		  align:'center'
@@ -357,9 +151,9 @@ export default {
           dataIndex: 'expiryDate',
 		  width: 100,
 		  align:'center',
-		  customRender: function (text) {
-		    return (text || '永久有效')
-		  }
+		  // customRender: function (text) {
+		  //   return (text || '永久有效')
+		  // }
         },
 		{
 		  title: '购买数量',
@@ -471,7 +265,8 @@ export default {
       }).then(res => {
         if (res.status + '' === '200') {
           const _data = res.data
-          console.log(_data)
+		  _this.orderBundleId=_data.orderBundleId
+          console.log(_data,_this.orderBundleId)
           _this.customer = _data.customer
 		  _this.dataSourceName = _data.dataSourceName
           _this.orderBundle = _data.orderBundle
@@ -483,62 +278,47 @@ export default {
             _this.customerCoupon = _data.customerCoupon
           }
           _this.customerBundleItemList = _data.customerBundleItemList
+		  _this.customerBundleItemList.map((item, index) => {
+		    // item.no = index + 1
+		    item.isDelay =item.expiryDate ? item.expiryDate.substr(0, 10) != '2099-01-01' : false
+		  })
           _this.verificationList = _data.verificationList
         }
       })
     },
     // 延期
-    hexiao (row) {
-      this.yanqiModal = true
-      this.hxCustomerBundleItemId = row.id
+    yanQi(row) {
+		this.yanQiData=row
+		this.yanqiModal = true
+		console.log(this.yanQiData,'-----------延期')
     },
 	// 关闭延期弹窗
 	canselYq(){
+		this.initPage()
+		this.yanQiData=null
 		this.yanqiModal = false
-		this.formData={
-		  loginFlag:1,
-	  }
-	},
-    // 关闭
-    canselHx () {
-      // this.$refs.storeSearch.setVal(undefined)
-      this.hexiaoModal = false
-      this.loading = false
-      this.hxStoreId = ''
-      this.hxCustomerBundleItemId = ''
-    },
-	// 确定
-    handleYanqiOk () {
-      // if (this.hxStoreId == '') {
-      //   this.$message.warning('请选择门店')
-      //   return
-      // }
-      this.loading = true
-      verificationHexiao({
-        usedStoreId: this.hxStoreId,
-        customerBundleItemId: this.hxCustomerBundleItemId
-      }).then(res => {
-        console.log(res)
-        if (res.status == 200) {
-          this.$message.info('核销成功')
-          this.initPage()
-        }
-        this.canselHx()
-      })
-    },
-	// 是否返还已过期服务 状态
-	changeStatus(e){
-		console.log(e.target.value)
-		this.showBackNum=e.target.value ==1
 	},
-	handleHexiaoOk(){},
-    storeChange (data) {
-      this.hxStoreId = data ? data.id : ''
-    },
 	// 取消购买
 	canselBuy(){
-		this.buyModal=true
-	}
+		this.$confirm({
+		  title: '取消购买',
+		  content: '取消购买后,套餐内所有服务的剩余次数变为0,用户无法再使用套餐。确认取消购买吗?',
+		  onOk: () => {
+		    orderCancel({ id: this.$route.params.id }).then(res => {
+		      if (res.status == 200) {
+				this.$message.info(res.message)
+		        // this.isShow = false
+		      }
+		    })
+		  },
+		  onCancel () {}
+		})
+	},
+	// quxiao
+	canselGM(){
+		this.buyModal=false
+		this.hxCustomerBundleItemId=''
+	},
   }
 }
 </script>

+ 103 - 158
src/views/Service/PurchasedServiceList.vue

@@ -1,5 +1,11 @@
 <template>
   <a-card :bordered="false">
+	  <v-select
+	    v-show="false"
+	    ref="orderFlag"
+	    code="PAY_STATUS"
+	    placeholder="请选择订单状态"
+	    allowClear></v-select>
     <div class="table-page-search-wrapper">
       <a-form layout="inline" :form="form" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="48">
@@ -9,10 +15,6 @@
             </a-form-item>
           </a-col>
           <a-col :lg="6" :sm="12">
-            <!-- <a-form-item label="下单时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-range-picker style="width:100%" :disabledDate="disabledDate" v-model="queryOrderDate" format="YYYY-MM-DD"
-                              :placeholder="['开始时间', '结束时间']" id="SettlementRecordsList-queryOrderDate" />
-            </a-form-item> -->
 			<a-form-item label="下单时间:" :label-col="{ span: 7 }" :wrapper-col="{ span: 17}">
 			  <a-range-picker
 			    style="width:100%"
@@ -25,16 +27,19 @@
           </a-col>
           <a-col :lg="6" :sm="12">
             <a-form-item label="结算状态:" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <v-select ref="payStatus" code="SETTLE_STATUS_ALL" v-model="queryParam.orderFlag" allowClear></v-select>
+              <v-select code="SETTLE_STATUS_ALL" ref="salesChannelSettleStatus" v-model="queryParam.salesChannelSettleStatus" allowClear></v-select>
             </a-form-item>
           </a-col>
           <a-col :lg="6" :sm="12">
             <a-form-item label="销售合作商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <!-- <salesSearch ref="salesSearch" @salesChange="salesChange" placeholder="订单来源"></salesSearch> -->
-              <a-select placeholder="请选择" allowClear v-model="queryParam.dataSourceNo" mode="multiple" :showSearch="true" option-filter-prop="children"
-                        :filter-option="filterOption"  @change="handleChange">
-                <a-select-option v-for="item in optionData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
-              </a-select>
+				<a-select
+				  id="purchasedSetmeal-dataSourceNo"
+				  allowClear
+				  option-filter-prop="children"
+				  placeholder="请选择销售合作商"
+				  v-model="queryParam.dataSourceNo">
+				  <a-select-option v-for="(item,index) in dataSourceNoList" :key="index" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+				</a-select>
             </a-form-item>
           </a-col>
         </a-row>
@@ -47,15 +52,9 @@
           </a-col>
           <a-col :lg="6" :sm="12">
             <a-form-item label="服务名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input class="full-width" v-model.trim="queryParam.vehicleNumber" placeholder="服务名称" allowClear />
+              <a-input class="full-width" v-model.trim="queryParam.bundleName" placeholder="服务名称" allowClear />
             </a-form-item>
           </a-col>
-          <!-- <a-col :lg="6" :sm="12">
-            <a-form-item label="套餐名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input class="full-width" v-model.trim="queryParam.bundleName" placeholder="套餐名称" allowClear />
-            </a-form-item>
-          </a-col> -->
-
           <a-col :lg="6" :sm="12">
             <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
@@ -66,10 +65,14 @@
     </div>
 	<!-- 合计 -->
 	<a-alert type="info" showIcon style="margin-bottom:15px">
-	  <div class="ftext" slot="message">共<span>{{ 0 }}</span>单,收款金额<span>¥{{ 0 }}</span>元</div>
+	  <div class="ftext" slot="message">共<span>{{ orderTotal || 0 }}</span>单,收款金额<span>¥{{ totalAmounts || 0 }}</span>元</div>
 	</a-alert>
     <div class="card-container">
       <s-table ref="table" size="default" rowKey="id" bordered :columns="columns" :data="loadData">
+		  <span slot="orderFlag" slot-scope="text, record">{{ $refs.orderFlag.getNameByCode(record.orderFlag) }}</span>
+		  <!-- 结算状态 -->
+		  <span slot="salesChannelSettleStatus" slot-scope="text, record">{{ $refs.salesChannelSettleStatus.getNameByCode(record.salesChannelSettleStatus) }}</span>
+		  <!-- 操作 -->
         <span slot="action" slot-scope="text, record">
             <a-button type="primary"  style="margin: 5px;" @click="handleDetail(record)">详情</a-button>
             <!-- <span v-if="!$hasPermissions('CustomerBundleDetail_1')">--</span> -->
@@ -90,13 +93,8 @@ import {
   STable,
   VSelect
 } from '@/components'
-import {
-  listCustomerBundle,
-  queryBankPayStatus,
-  salesChannelList,
-	countListBundle,
-	exportBundle
-} from '@/api/customerBundle'
+import { salesChannelList } from '@/api/FinancialManagement'
+import {listCustomerBundle,queryBankPayStatus,countListBundle,exportBundle} from '@/api/customerBundle'
 // import salesSearch from '@/components/salesQuery/salesSearch'
 export default {
   name: 'OrderList',
@@ -135,16 +133,18 @@ export default {
       ],
       dateFormat: 'YYYY-MM-DD',
       queryParam: {
-        number: '',
+		number:'', // 订单编号
+        bundleName: '', // 服务名称
         beginDate: null,
         endDate: null,
-        orderFlag: '',
-        custMobile: '',
-        bundleName: '',
-        vehicleNumber: '',
-        dataSourceNo: undefined
+        custMobile: '', // 用户信息
+        bundleName: '', // 套餐名称
+        dataSourceNo: undefined, // 合作商
+		salesChannelSettleStatus:"" // 结算状态
       },
-      optionData: [],
+      dataSourceNoList: [],
+	  orderTotal:'', // 订单总数
+	  totalAmounts:'',
       columns: [{
         title: '序号',
         dataIndex: 'no',
@@ -183,15 +183,21 @@ export default {
       },
       {
         title: '服务名称',
-        dataIndex: 'bundleName',
+        dataIndex: 'itemName',
         align: 'center',
-        width: 100
+        width: 100,
+      	customRender: function (text) {
+      	  return (text || '--')
+      	}
       },
 	  {
 	    title: '购买数量',
-	    dataIndex: '',
+	    dataIndex: 'times',
 	    align: 'center',
-	    width: 100
+	    width: 100,
+		customRender: function (text) {
+		  return (text || '--')
+		}
 	  },
       {
         title: '收款金额',
@@ -204,30 +210,18 @@ export default {
         dataIndex: 'orderFlag',
         width: 100,
         align: 'center',
-        customRender: (text) => {
-          const payStatus = this.$refs.payStatus.getOptionDatas()
-          if (payStatus) {
-            if (_.find(payStatus, ['code', text])) {
-              return _.find(payStatus, ['code', text]).dispName
-            }
-          }
-          return text
-        }
+       scopedSlots: {
+         customRender: 'orderFlag'
+       }
       },
 	  {
 	    title: '结算状态',
 	    dataIndex: '',
 	    width: 100,
 	    align: 'center',
-	    // customRender: (text) => {
-	    //   const payStatus = this.$refs.payStatus.getOptionDatas()
-	    //   if (payStatus) {
-	    //     if (_.find(payStatus, ['code', text])) {
-	    //       return _.find(payStatus, ['code', text]).dispName
-	    //     }
-	    //   }
-	    //   return text
-	    // }
+		scopedSlots: {
+		  customRender: 'salesChannelSettleStatus'
+		}
 	  },
       {
         title: '操作',
@@ -240,6 +234,9 @@ export default {
       ]
     }
   },
+  mounted () {
+    this.getSalesChannel()
+  },
   methods: {
     // 禁止不可选日期
     disabledDate (current) {
@@ -252,6 +249,17 @@ export default {
 	    this.queryParam.endDate = dateStrings[1]
 	  }
 	},
+	//  获取渠道商下的合作商信息
+	getSalesChannel () {
+	  salesChannelList().then(res => {
+	    if (res.status == 200) {
+			console.log(res,'-=--销售商')
+	      this.dataSourceNoList = res.data
+	    } else {
+	      this.dataSourceNoList = []
+	    }
+	  })
+	},
     handleChange (value) {
       console.log(`selected ${value}`)
     },
@@ -266,51 +274,41 @@ export default {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
 	  )
     },
-		// 合计
-		getTotal () {
-		  const params = {
-		    beginDate: this.searchForm.beginDate,
-		    endDate: this.searchForm.endDate,
-		    bundleName: this.searchForm.bundleName,
-		    number: this.searchForm.number,
-		    custMobile: this.searchForm.custMobile,
-		    orderFlag: this.searchForm.orderFlag,
-		    salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus,
-		    partner: this.searchForm.partner
+	// 合计
+	getTotal () {
+	  const params = {
+		beginDate: this.queryParam.beginDate,
+		endDate: this.queryParam.endDate,
+		bundleName: this.queryParam.bundleName,
+		number: this.queryParam.number,
+		custMobile: this.queryParam.custMobile,
+		dataSourceNo: this.queryParam.dataSourceNo,
+		salesChannelSettleStatus: this.queryParam.salesChannelSettleStatus,
+		freeChoiceFlag: 1
+	  }
+	  params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
+	  params.endDate == null ? params.endDate = getDate.getToday().endtime : null
+	  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
 		  }
-		  params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
-		  params.endDate == null ? params.endDate = getDate.getToday().endtime : null
-		  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
-		    }
-		  })
-		},
+		} else {
+		  this.orderTotal = 0
+		  this.totalAmounts = 0
+		}
+	  })
+	},
 	// 查看详情、
 	handleDetail(row){
 		this.$router.push({
 		  path: `/Service/PurchasedService/detail/${row.id}`
 		})
 	},
-   //  getSalesListData () {
-	  // salesChannelList().then(res => {
-   //      if (res.status == 200) {
-			//  this.optionData = res.data || []
-			//  const obj = { salesChannelName: '自有', salesChannelNo: 0 }
-			//   const a = this.optionData.unshift(obj)
-			//   console.log(this.optionData, '---------------添加自有')
-   //      }
-	  // })
-   //  },
     reloadRow (row) {
       queryBankPayStatus({
         tradeNo: row.tradeNo
@@ -321,7 +319,7 @@ export default {
         }
       })
     },
-		// 重置
+	// 重置
     resetSearchForm () {
       this.queryOrderDate = undefined
 	  this.queryOrderDate = [
@@ -329,22 +327,21 @@ export default {
 	    moment(getDate.getRecentday().endtime, this.dateFormat)
 	  ]
       this.queryParam = {
-        number: '',
         beginDate: '',
         endDate: '',
-        orderFlag: '',
+        dataSourceNo: '',
         custMobile: '',
         bundleName: '',
-        vehicleNumber: '',
-        dataSourceNo: undefined
+        dataSourceNo: undefined,
+		salesChannelSettleStatus: ''
       }
       // this.$refs.salesSearch.setVal(undefined)
       this.$refs.table.refresh(true)
     },
-    // 来源change
-    salesChange (data) {
-      this.queryParam.dataSourceNo = data ? data.salesChannelNo : ''
-    },
+    // // 来源change
+    // salesChange (data) {
+    //   this.queryParam.dataSourceNo = data ? data.salesChannelNo : ''
+    // },
 	// 导出
 	handleExport () {
 	  const params = {
@@ -353,9 +350,9 @@ export default {
 	    bundleName: this.queryParam.bundleName,
 	    number: this.queryParam.number,
 	    custMobile: this.queryParam.custMobile,
-	    orderFlag: this.queryParam.orderFlag,
-	    vehicleNumber: this.queryParam.vehicleNumber,
-	    dataSourceNo: this.queryParam.dataSourceNo
+	    dataSourceNo: this.queryParam.dataSourceNo,
+		salesChannelSettleStatus: this.queryParam.salesChannelSettleStatus,
+		freeChoiceFlag: 1
 	  }
 	  if (!params.beginDate && !params.endDate) {
 	    this.$message.error('请先选择需要导出的下单时间区间再进行导出!')
@@ -384,64 +381,12 @@ export default {
 	  document.body.appendChild(link)
 	  link.click()
 	}
-	
-	// 导出
-	// handleExport () {
-	//   this.form.validateFields((err, values) => {
-	//     if (!err) {
-	//       this.queryParam = values.queryParam
-	//       this.queryOrderDate = values.queryOrderDate
-	//       this.queryParam.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
-	//       this.queryParam.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
-	//       // 获取距开始日期3个月后的时间戳
-	//       const tVal = getThreeMonthsAfter(this.queryParam.beginDate)
-	//       // 获取结束时间时间戳
-	//       const endVal = new Date(this.queryParam.endDate.replace(/-/g, '/'))
-	//       if (endVal.valueOf() > tVal - 86400000) {
-	//         return this.$message.warning('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
-	//       }
-	//       const params = _.cloneDeep(this.queryParam)
-	//       let requestObj = null
-	//       // 按核销服务量进行结算
-	//       if (this.settleType == 'ITEM_VERIFY') {
-	//         params.bundName = params.bundleName
-	//         params.bizNum = params.orderBundleNo
-	//         delete params.bundleName
-	//         delete params.orderBundleNo
-	//         requestObj = exportByItem
-	//       } else {
-	//         requestObj = exportByBundle
-	//       }
-	//       this.exportLoading = true
-	//       exportBundle(params).then(res => {
-	//         console.log(res, 'rrrrrrrrrrr')
-	//         this.exportLoading = false
-	//         this.download(res)
-	//       })
-	//     }
-	//   })
-	// },
-	// download (data) {
-	//   if (!data) {
-	//     return
-	//   }
-	//   const url = window.URL.createObjectURL(new Blob([data]))
-	//   const link = document.createElement('a')
-	
-	//   link.style.display = 'none'
-	//   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()
-	// },
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.resetSearchForm()
-      // vm.getSalesListData()
+      vm.getSalesChannel()
+	  vm.getTotal()
     })
   }
 }

+ 159 - 0
src/views/Service/yanQiModal.vue

@@ -0,0 +1,159 @@
+<template>
+	<!-- 延期弹窗 -->
+	<a-modal title="服务延期" :footer="null" v-model="isShow" @cancel="canselYq" @ok="handleYanqiOk" width="50%" :centered='true'>
+		<a-form :form="form" ref="form">
+			<a-col :span="24">
+				<!-- 服务名称 -->
+				<a-form-item label="服务名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+					<span>{{this.yanQiData ? this.yanQiData.itemName : '--'}}</span>
+				</a-form-item>
+			</a-col>
+			<a-col :span="24">
+				<!-- 到期时间 -->
+				<a-form-item label="到期时间" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+					<span>{{this.yanQiData ? this.yanQiData.expiryDate : '--'}}</span>
+				</a-form-item>
+			</a-col>
+			<a-col :span="24">
+				<!-- 剩余次数 -->
+				<a-form-item label="剩余次数" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+					<span>{{this.yanQiData ? this.yanQiData.remainTimes : '--'}}</span>
+				</a-form-item>
+			</a-col>
+			<a-col :span="24">
+				<!-- 过期次数 -->
+				<a-form-item label="过期次数" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+					<span>{{this.yanQiData ? this.yanQiData.expiryTimes : '--'}}</span>
+				</a-form-item>
+			</a-col>
+			<a-col :span="24">
+				<a-form-item label="新到期时间" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+					<a-date-picker style="width: 60%;"
+				        format="YYYY-MM-DD"
+						placeholder="请选择新的到期时间"
+				        :disabled-date="disabledDate"
+						v-decorator="[
+						  'formData.expiryDate',
+						  {
+						    initialValue: formData.expiryDate,
+						    rules: [{ required: true, message: '请选择新的到期时间!' }] },
+						]"
+				      />
+				</a-form-item>
+			</a-col>
+			<a-col :span="24">
+				<a-form-item label="返还次数" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+					<a-input-number id="inputNumber" :disabled="isDisabled" :min="0" :max="this.yanQiData ? this.yanQiData.expiryTimes : this.formData.returnTimes" :precision="0"  placeholder="请输入返还次数" style="width: 60%;" v-decorator="['formData.returnTimes',{initialValue: formData.returnTimes,rules: []}]"/>
+				</a-form-item>
+			</a-col>
+			<div class="button-row">
+				<a-button key="back" @click="canselYq">取消</a-button>
+				<a-button key="submit" type="primary"  @click="handleYanqiOk">确定</a-button>
+			</div>
+	    </a-form-item>
+	  </a-form>
+	</a-modal>
+</template>
+<script>
+	import moment from 'moment'
+	import { customerBundleItemDelay } from '@/api/customerBundle.js'
+	export default{
+		name:'yanQiModal',
+		props:{
+			yanqiModal:{
+				type:Boolean,
+				default:false
+			},
+			yanQiData: {
+			  //  服务数据
+			  type: Object,
+			  default: () => {
+			    return {}
+			  }
+			}
+		},
+		data(){
+			return{
+				form: this.$form.createForm(this),
+				isShow:this.yanqiModal,
+				formData:{
+					returnTimes:'',
+					expiryDate:''
+				},
+				isDisabled:false
+			}
+		},
+		methods:{
+			moment,
+			 // 不可选日期
+			disabledDate(current){
+				return current && current < moment().subtract(1, "days");
+			},
+			// 重置表单
+			resetForm(){
+				this.formData.returnTimes=''
+				this.formData.expiryDate=''
+			},
+			// 取消
+			canselYq(){
+				this.resetForm() //  重置表单数据
+				this.isShow = false
+			},
+			// 保存
+			handleYanqiOk () {
+				this.form.validateFields((err, values) => {
+					if (!err) {
+						const formData = values.formData
+						const params={
+							expiryDate: moment(formData.expiryDate).format('YYYY-MM-DD'),
+							returnTimes: formData.returnTimes == '' ? 0 : formData.returnTimes,
+							id: this.yanQiData.id  
+						}
+						console.log(params,this.formData)
+						customerBundleItemDelay(params).then(res => {
+						  console.log(res)
+						  if (res.status == 200) {
+						    this.$message.info(res.message)
+						    this.canselYq()
+						  }
+						})
+					}
+				})
+			},
+		},
+		watch: {
+		  //  父页面传过来的弹框状态
+		  yanqiModal (newValue, oldValue) {
+		    this.isShow = newValue
+			console.log(this.yanQiData)
+			if(this.yanQiData){
+				if(this.yanQiData.expiryTimes == 0){
+					 this.isDisabled=true 
+				}
+			}
+		  },
+		  //  重定义的弹框状态
+		  isShow (val) {
+		    if (!val) {
+		      this.$emit('close')
+		    } else {
+				//  重置表单数据
+		      this.resetForm()
+		    }
+		  },
+		  yanQiData (val) {
+		    console.log(val)
+		  }
+		}
+	}
+</script>
+
+<style lang="less">
+	.button-row{
+	  padding-top: 20px;
+	  text-align: center;
+	  button{
+		  margin: 0 10px;
+	  }
+	}
+</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.102:7103/zyyc-channel/',
+        // target: 'https://channel.test.zyucgj.com/zyyc-channel/',
+        target: 'http://192.168.16.103:7103/zyyc-channel/',
         ws: false,
         changeOrigin: true,
         pathRewrite: {