|
@@ -0,0 +1,385 @@
|
|
|
+<template>
|
|
|
+ <a-card >
|
|
|
+ <a-card class="detail-card" :bordered="false" title="基本信息">
|
|
|
+ <detail-list >
|
|
|
+ <detail-list-item term="订单编号">{{ orderBundle.number ? orderBundle.number : '--' }}</detail-list-item>
|
|
|
+ <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-table :columns="columns" rowKey="id" :dataSource="customerBundleItemList" bordered :pagination="false">
|
|
|
+ <span slot="no" slot-scope="text, record, index">
|
|
|
+ <template>
|
|
|
+ {{ index + 1 }}
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ <span slot="hexiao" slot-scope="text, record, index">
|
|
|
+ <template>
|
|
|
+ <a-button :disabled="record.remainTimes<=0" type="primary" v-hasPermission="'B_customerBundle_hexiao'" @click="hexiao(record)">延期</a-button>
|
|
|
+ <span v-if="!$hasPermissions('B_customerBundle_hexiao')" style="text-align: center;font-size: 20px;">-</span>
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ </a-card>
|
|
|
+ <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>
|
|
|
+ {{ index + 1 }}
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
+ <div class="detail-card-info" v-else>
|
|
|
+ 此订单没有使用记录
|
|
|
+ </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-modal title="确定核销一次" :footer="null" v-model="hexiaoModal" @cancel="canselHx" @ok="handleHexiaoOk">
|
|
|
+ <!-- <StoreSearch ref="storeSearch" @storeChange="storeChange" placeholder="搜索并选择核销门店"></StoreSearch> -->
|
|
|
+ <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>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { customerBundleDetail, verificationHexiao } from '@/api/customerBundle'
|
|
|
+import { getLookUpDataBy } from '@/api/data'
|
|
|
+import { PageView } from '@/layouts'
|
|
|
+import { STable } from '@/components'
|
|
|
+// import StoreSearch from '@/components/QueryStore/StoreSearch'
|
|
|
+import DetailList from '@/components/tools/DetailList'
|
|
|
+import _ from 'lodash'
|
|
|
+const DetailListItem = DetailList.Item
|
|
|
+export default {
|
|
|
+ name: 'OrderAdd',
|
|
|
+ components: {
|
|
|
+ PageView,
|
|
|
+ DetailList,
|
|
|
+ DetailListItem,
|
|
|
+ STable
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ palyStatus () {
|
|
|
+ const _playStatus = _.find(this.palyStatusList, ['code', this.orderBundle.orderFlag])
|
|
|
+ if (_playStatus) {
|
|
|
+ if (_playStatus.code === 'CAEL' || _playStatus.code === 'SYCA') {
|
|
|
+ return '已取消'
|
|
|
+ }
|
|
|
+ return _playStatus.dispName
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
+ palyStatusStr () {
|
|
|
+ const _playStatus = _.find(this.palyStatusList, ['code', this.orderBundle.orderFlag])
|
|
|
+ if (_playStatus) {
|
|
|
+ if (_playStatus.code === 'SYCA') {
|
|
|
+ return '超时未支付自动取消'
|
|
|
+ }
|
|
|
+ return _playStatus.dispName
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
+ isPay () {
|
|
|
+ return this.orderBundle.orderFlag === 'PAED'
|
|
|
+ },
|
|
|
+ isCancel () {
|
|
|
+ return this.orderBundle.orderFlag === 'CAEL' || this.orderBundle.orderFlag === 'SYCA'
|
|
|
+ },
|
|
|
+ payDate () {
|
|
|
+ return _.get(this, 'paymentDetailList.payDate')
|
|
|
+ },
|
|
|
+ custInfo () {
|
|
|
+ let info = null
|
|
|
+ if (this.customer) {
|
|
|
+ info = this.customer.name
|
|
|
+ if (info) {
|
|
|
+ info = info + '-' + this.customer.mobile
|
|
|
+ } else {
|
|
|
+ info = this.customer.mobile
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ info = this.orderBundle.custMobile
|
|
|
+ if (this.orderBundle.vehicleNumber) {
|
|
|
+ info += '(' + this.orderBundle.vehicleNumber + ')'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return info
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ customerCoupon: {},
|
|
|
+ palyStatusList: [],
|
|
|
+ hexiaoModal: false,
|
|
|
+ hxStoreId: '',
|
|
|
+ hxCustomerBundleItemId: '',
|
|
|
+ dataSourceName: '',
|
|
|
+ customer: null,
|
|
|
+ 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'
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ // dataIndex: 'no',
|
|
|
+ scopedSlots: { customRender: 'no' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '服务项目',
|
|
|
+ dataIndex: 'itemName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '剩余数量',
|
|
|
+ dataIndex: 'remainTimes'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '核销操作',
|
|
|
+ width: 200,
|
|
|
+ scopedSlots: { customRender: 'hexiao' }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ usedColumns: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ scopedSlots: { customRender: 'no' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '服务项目',
|
|
|
+ dataIndex: 'bundItemName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '使用时间',
|
|
|
+ dataIndex: 'usedTime'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '使用门店',
|
|
|
+ dataIndex: 'usedStoreName'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.initPage()
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {
|
|
|
+ // vm.clear()
|
|
|
+ if (to.query.id) {
|
|
|
+ vm.initPage()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initPage () {
|
|
|
+ const _this = this
|
|
|
+ getLookUpDataBy({
|
|
|
+ type: 'PAY_STATUS'
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status === '200') {
|
|
|
+ _this.palyStatusList = res.data
|
|
|
+ }
|
|
|
+ return customerBundleDetail({
|
|
|
+ id: _this.$route.params.id
|
|
|
+ })
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status + '' === '200') {
|
|
|
+ const _data = res.data
|
|
|
+ console.log(_data)
|
|
|
+ _this.customer = _data.customer
|
|
|
+ _this.dataSourceName = _data.dataSourceName
|
|
|
+ _this.orderBundle = _data.orderBundle
|
|
|
+ if (_data.paymentDetailList && _data.paymentDetailList.length) {
|
|
|
+ _this.paymentDetailList = _data.paymentDetailList[0]
|
|
|
+ }
|
|
|
+ _this.coupon = _data.coupon
|
|
|
+ if (_data.customerCoupon) {
|
|
|
+ _this.customerCoupon = _data.customerCoupon
|
|
|
+ }
|
|
|
+ _this.customerBundleItemList = _data.customerBundleItemList
|
|
|
+ _this.verificationList = _data.verificationList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 核销
|
|
|
+ hexiao (row) {
|
|
|
+ this.hexiaoModal = true
|
|
|
+ this.hxCustomerBundleItemId = row.id
|
|
|
+ },
|
|
|
+ // 关闭
|
|
|
+ canselHx () {
|
|
|
+ this.$refs.storeSearch.setVal(undefined)
|
|
|
+ this.hexiaoModal = false
|
|
|
+ this.loading = false
|
|
|
+ this.hxStoreId = ''
|
|
|
+ this.hxCustomerBundleItemId = ''
|
|
|
+ },
|
|
|
+ handleHexiaoOk () {
|
|
|
+ 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()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ storeChange (data) {
|
|
|
+ this.hxStoreId = data ? data.id : ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .detail-card + .detail-card {
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .detail-card-info {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 1.1em;
|
|
|
+ }
|
|
|
+ .button-row{
|
|
|
+ padding-top: 20px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .button-row .ant-btn{
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+</style>
|