| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="main_app"> |
| | | <Breadcrumb /> |
| | | <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clearQueryForm"> |
| | | </QueryForm> |
| | | <div class="table_btns"> |
| | | <el-button plain type="primary" @click="handleEx">导åº</el-button> |
| | | <el-button plain type="danger" @click="openModal('zuofei')">ä½åº</el-button> |
| | | <el-button plain @click="openModal('tiaozheng')">å¥é¤è°æ´</el-button> |
| | | </div> |
| | | <el-table v-loading="loading" :data="list" stripe border @selection-change="handleSelectionChange"> |
| | | <el-table-column fixed="left" align="center" type="selection" :selectable="handleDisable" width="55" /> |
| | | <el-table-column align="center" label="å¥é¤ç¥¨å·" min-width="160" show-overflow-tooltip> |
| | | <template v-slot="scope"> |
| | | <span class="primaryColor pointer" @click="comboDetail(scope.row)">{{ |
| | | scope.row.code |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="å¥é¤ç±»å" min-width="80"> |
| | | <template v-slot="scope"> |
| | | <span v-if="scope.row.type == '0'">æéå¡</span> |
| | | <span v-if="scope.row.type == '1'">次å¡</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="å¥é¤åç§°" show-overflow-tooltip min-width="100" prop="name" /> |
| | | <el-table-column align="center" label="ç¨æ·ä¿¡æ¯" min-width="100" prop="openid" show-overflow-tooltip /> |
| | | <el-table-column align="center" label="ä½¿ç¨æ¬¡æ°" min-width="80" prop="useTimes"> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="æææ¥æ" min-width="200" prop="remainCount"> |
| | | <template v-slot="scope"> |
| | | <span>{{ scope.row.useStartDate }}è³{{ scope.row.useEndDate }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="å¥é¤ç¶æ" min-width="80"> |
| | | <template v-slot="scope"> |
| | | <span v-if="scope.row.status == '0'" class="text_success">æ£å¸¸</span> |
| | | <span v-if="scope.row.status == '1'" class="text_warning">ä½åº</span> |
| | | <span v-if="scope.row.status == '2'" class="text-danger">å¾
æ¯ä»</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="æä½" fixed="right" min-width="150"> |
| | | <template v-slot="scope"> |
| | | <template> |
| | | <el-button v-if="scope.row.status == '0'" type="text" @click="openCan(scope.row)">ä½åº</el-button> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="table_btns"> |
| | | <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> |
| | | </div> |
| | | |
| | | <el-dialog title="å¥é¤è°æ´" :visible.sync="isShowAdjust" width="500px"> |
| | | <div class="adjust_modal"> |
| | | <div style="margin-top: -30px; margin-bottom: 10px;"> |
| | | <el-radio v-model="adjustData.flag" label="0">å·²é{{ selList.length }}æ¡æ°æ®</el-radio> |
| | | </div> |
| | | <div style="margin-bottom: 16px;"> |
| | | <el-radio v-model="adjustData.flag" label="1">éç°æç鿡件ä¸å
¨é¨ç{{ pagination.total }}æ¡æ°æ®</el-radio> |
| | | </div> |
| | | <div class="df_ac mb5"> |
| | | <span class="key">æææå¢å ï¼</span> |
| | | <el-input v-model="adjustData.addNum" oninput="value=value.replace(/[^\d]/g,'')" class="flex1 mr10" /> |
| | | <span>天</span> |
| | | </div> |
| | | <div class="df_ac mb20"> |
| | | <span class="key" /> |
| | | <span class="text_warning">ä¿®æ¹åå¥é¤æææå¢å 以ä¸å¤©æ°</span> |
| | | </div> |
| | | <div class="df_ac mt20"> |
| | | <span class="key">è°æ´å¤æ³¨ï¼</span> |
| | | <el-input v-model="ModelRemark" style="width: 356px" placeholder="请æè¦æ±è¾å
¥å¤æ³¨è¯´æï¼éå¿
å¡«" /> |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="isShowAdjust = false">åæ¶</el-button> |
| | | <el-button type="primary" :loading="subLoading" @click="handleModelEnter">ç¡®å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="å¥é¤ä½åº" :visible.sync="isShowCan" width="500px"> |
| | | <div class="adjust_modal" style="margin-top: -30px;"> |
| | | <div class="red" style="font-size: 16px;">ç¡®å®ä½åºéä¸å¥é¤åï¼ä½åºåï¼å¥é¤ä¸å¯ä½¿ç¨</div> |
| | | <div class="df_ac mt10"> |
| | | <el-input type="textarea" v-model="remarkCan" placeholder="请æè¦æ±è¾å
¥å¤æ³¨è¯´æï¼éå¿
å¡«" /> |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="isShowCan = false">åæ¶</el-button> |
| | | <el-button type="primary" :loading="subLoading" @click="handleCan">ç¡®å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <Refund v-if="isShowRefund" ref="RefundRef" @close="isShowRefund = false" @success="refundSuccess" /> |
| | | <Detail v-if="isShowDetail" ref="detailRef" /> |
| | | <Detail ref="DetailRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import BasePageTemp from '@/components/base/BasePageTemp' |
| | | import Breadcrumb from '@/layouts/Breadcrumb' |
| | | import Detail from './components/SaleDetail.vue' |
| | | import { Message } from 'element-ui' |
| | | import { |
| | | comboSalePage, |
| | | comboSaleEx, |
| | | comboSaleCancel, |
| | | comboSaleAdjust, |
| | | } from '@/api/business/combo.js' |
| | | export default { |
| | | name: 'SalesRecord', |
| | | extends: BasePageTemp, |
| | | components: { Breadcrumb, Detail }, |
| | | data() { |
| | | return { |
| | | exportLoading: false, |
| | | isShowDetail: false, |
| | | isShowRefund: false, |
| | | queryFormConfig: { |
| | | formItems: [{ |
| | | filed: 'code', |
| | | type: 'input', |
| | | label: 'å¥é¤ç¥¨å·', |
| | | placeholder: '请è¾å
¥å¥é¤å·', |
| | | clearable: true |
| | | }, { |
| | | filed: 'name', |
| | | type: 'input', |
| | | label: 'å¥é¤åç§°', |
| | | placeholder: '请è¾å
¥å¥é¤åç§°', |
| | | clearable: true |
| | | }, { |
| | | filed: 'openid', |
| | | type: 'input', |
| | | label: 'ç¨æ·ä¿¡æ¯', |
| | | clearable: true |
| | | }, { |
| | | filed: 'status', |
| | | type: 'select', |
| | | label: 'ç¶æ', |
| | | placeholder: 'è¯·éæ©ç¶æ', |
| | | clearable: true, |
| | | options: [ |
| | | { value: '0', label: 'æ£å¸¸' }, |
| | | { value: '1', label: 'ä½åº' }, |
| | | // { value: '2', label: 'å¾
æ¯ä»' } |
| | | ] |
| | | }], |
| | | online: true |
| | | }, |
| | | querys: { |
| | | id: '', |
| | | mealsName: '', |
| | | memberSearchValue: '', |
| | | status: '', |
| | | indate: [] |
| | | }, |
| | | |
| | | saleRecordList: [], |
| | | saleRecordTotal: 0, |
| | | selList: [], |
| | | saleRecordLoading: false, |
| | | subLoading: false, |
| | | |
| | | isShowCan: false, |
| | | ModalTitle: '', |
| | | ModalText: '', |
| | | ModelRemark: '', |
| | | remarkCan: '', |
| | | // â¬ï¸adjustè°æ´ç¸å
³ |
| | | isShowAdjust: false, |
| | | isShowCan: false, |
| | | canList: [], |
| | | adjustData: { |
| | | flag: 0, |
| | | addNum: '', |
| | | addTime: '' |
| | | }, |
| | | serviceChargePrice: '', |
| | | serviceChargeId: '' |
| | | } |
| | | }, |
| | | created() { |
| | | // this.meta = this.$route.meta.buttons || [] |
| | | this.getList(1) |
| | | }, |
| | | methods: { |
| | | rowClickRefund(row) { |
| | | this.isShowRefund = true |
| | | this.$nextTick(() => { |
| | | this.$refs.RefundRef.getPrice(row) |
| | | this.$refs.RefundRef.isShow = true |
| | | }) |
| | | }, |
| | | refundSuccess() { |
| | | this.isShowRefund = false |
| | | this.getList() |
| | | }, |
| | | handleEx() { |
| | | const { pagination, filters } = this |
| | | this.$dialog.exportConfirm('确认导åºåï¼') |
| | | .then(() => { |
| | | this.loading = true |
| | | comboSaleEx({ |
| | | page: 1, |
| | | capacity: 1000000, |
| | | model: filters |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }) |
| | | .catch(() => { }) |
| | | }, |
| | | openCan(row) { |
| | | this.isShowCan = true |
| | | this.canList = [row] |
| | | }, |
| | | handleDisable(row) { |
| | | // return row.status == 0 |
| | | return true |
| | | }, |
| | | // æ¥è¯¢è¡¨æ ¼æ°æ® |
| | | getList(page) { |
| | | const { pagination, filters } = this |
| | | this.loading = true |
| | | if (page) { pagination.page = page } |
| | | comboSalePage({ |
| | | model: { |
| | | ...filters |
| | | }, |
| | | capacity: pagination.pageSize, |
| | | page: pagination.page, |
| | | }).then(res => { |
| | | this.loading = false |
| | | this.list = res.records || [] |
| | | this.pagination.total = res.total || 0 |
| | | }, () => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | clearQueryForm() { |
| | | // eslint-disable-next-line no-unused-vars |
| | | this.filters = {} |
| | | this.getList(1) |
| | | }, |
| | | // æå¼modal å»ç» è§£å» ä½åº |
| | | openModal(type) { |
| | | const { selList } = this |
| | | this.ModelRemark = '' |
| | | this.adjustData.addNum = '' |
| | | this.adjustData.addTime = '' |
| | | switch (type) { |
| | | case 'zuofei': |
| | | this.ModalTitle = 'å¥é¤ä½åº' |
| | | this.ModalText = 'ç¡®å®ä½åºéä¸å¥é¤åï¼ä½åºåï¼å¥é¤ä¸å¯ä½¿ç¨' |
| | | break |
| | | case 'tiaozheng': |
| | | this.ModalTitle = 'å¥é¤è°æ´' |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | if (selList.length === 0 && type == 'zuofei') { |
| | | return Message.warning(`请å
éæ©è¦${this.ModalTitle.slice(2)}çå¥é¤`) |
| | | } |
| | | if (this.ModalTitle === 'å¥é¤è°æ´') { |
| | | this.isShowAdjust = true |
| | | this.adjustData = { |
| | | flag: '0' |
| | | } |
| | | } else { |
| | | this.isShowCan = true |
| | | } |
| | | }, |
| | | // ç¡®å® å»ç» è§£å» ä½åº |
| | | handleModelEnter() { |
| | | switch (this.ModalTitle) { |
| | | case 'å¥é¤ä½åº': |
| | | this.cancellation() |
| | | break |
| | | case 'å¥é¤è°æ´': |
| | | this.handleAdjust() |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | }, |
| | | // è°æ´ |
| | | async handleAdjust() { |
| | | if (!this.adjustData.addNum && !this.adjustData.addTime) { |
| | | return Message.warning('请è¾å
¥è¦è°æ´çæææå¤©æ°æè
ä½é次æ°') |
| | | } |
| | | const data = { |
| | | info: this.ModelRemark, |
| | | addDays: this.adjustData.addNum || 0, |
| | | choseIdList: this.adjustData.flag == 0 ? this.selList.map(i => i.id) : [], |
| | | ...this.filters |
| | | } |
| | | |
| | | this.subLoading = true |
| | | const res = await comboSaleAdjust({ ...data }).catch(() => { |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | }) |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | if (res) { |
| | | Message.success('å¥é¤è°æ´æå') |
| | | this.getList() |
| | | this.isShowAdjust = false |
| | | } |
| | | }, |
| | | // ä½åº |
| | | async cancellation() { |
| | | const data = { |
| | | handleRemake: this.remarkCan, |
| | | choseIdList: this.selList.map(i => i.id) |
| | | } |
| | | this.subLoading = true |
| | | const res = await comboSaleCancel({ ...data }).catch(() => { |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | }) |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | if (res) { |
| | | Message.success('ä½åºæå') |
| | | this.getList() |
| | | } |
| | | }, |
| | | async handleCan() { |
| | | const data = { |
| | | handleRemake: this.remarkCan, |
| | | choseIdList: this.canList.map(i => i.id) |
| | | } |
| | | this.subLoading = true |
| | | const res = await comboSaleCancel({ ...data }).catch(() => { |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | }) |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | if (res) { |
| | | Message.success('ä½åºæå') |
| | | this.getList() |
| | | } |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.selList = val |
| | | }, |
| | | comboDetail(item) { |
| | | this.$nextTick(() => { |
| | | this.$refs.DetailRef.isShowModal = true |
| | | this.$refs.DetailRef.getDetail(item) |
| | | }) |
| | | }, |
| | | pageSizeChange(val) { |
| | | this.pagination.rows = val |
| | | this.getList(1) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .adjust_modal { |
| | | .df_ac { |
| | | .key { |
| | | width: 92px; |
| | | text-align: right; |
| | | } |
| | | } |
| | | |
| | | .el-dialog__body {} |
| | | |
| | | .text_warning { |
| | | color: #e89e42; |
| | | } |
| | | } |
| | | </style> |