1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312 |
- <template>
- <div class="order">
- <div class="warp">
- <div class="refreshBtn">
- <el-button
- class="refresh"
- type="primary"
- @click="refreshList"
- :loading="refresh"
- >{{ refresh ? "加载中..." : "刷新" }}</el-button>
- </div>
- <el-tabs type="border-card" @tab-click="changeTab" v-model="activeName">
- <el-tab-pane label="项目订单" name="first">
- <div class="user-list">
- <el-table
- ref="multipleTable"
- :data="projectData"
- tooltip-effect="dark"
- height="354"
- style="width: 100%; border-radius: 8px"
- @row-click="handleSelectionChange"
- >
- <el-table-column prop="goods" label="项目名称" width="200">
- <template slot-scope="scope">
- <div v-for="(val, index) in scope.row.goods" :key="index">
- <div>{{ val.name }}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="goods" label="数量" show-overflow-tooltip>
- <template slot-scope="scope">
- <div>{{ scope.row.goods.length }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="总价格" show-overflow-tooltip></el-table-column>
- <el-table-column prop="order_time" label="预约时间" width="180" show-overflow-tooltip></el-table-column>
- <el-table-column prop="store_name" label="预约店铺" show-overflow-tooltip></el-table-column>
- <el-table-column prop="status" label="状态" show-overflow-tooltip>
- <template slot-scope="scope">
- <div :class="'color' + scope.row.status">
- <!-- 状态:0已预约,未支付,1已支付,待使用,2正在使用,3已结算,-1已取消,-2退款审核中,-3已退款 -->
- {{
- scope.row.status == 0
- ? "已预约"
- : scope.row.status == 1
- ? "待使用"
- : scope.row.status == 2
- ? "正在使用"
- : scope.row.status == 3
- ? "已结算"
- : scope.row.status == -1
- ? "已取消"
- : scope.row.status == -2
- ? "退款审核中"
- : "已退款"
- }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagin">
- <el-pagination
- background
- layout="prev, pager, next"
- @current-change="handleCurrentChange"
- :current-page.sync="currentPage1"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="次卡订单" name="second">
- <div class="user-list">
- <el-table
- ref="multipleTable"
- :data="cardListData"
- tooltip-effect="dark"
- height="354"
- @row-click="openDetail"
- style="width: 100%; border-radius: 8px"
- >
- <el-table-column prop="card_name" label="卡券名称" width="200">
- <template slot-scope="scope">
- <div>{{ scope.row.card_name | ellipsis(8) }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="total_num" label="总次数" show-overflow-tooltip align="center">
- <template slot-scope="{ row }" v-if="row.card_type == 1">
- {{
- row.total_num
- }}
- </template>
- </el-table-column>
- <el-table-column prop="num" label="剩余次数" show-overflow-tooltip align="center">
- <template slot-scope="{ row }" v-if="row.card_type == 1">
- {{
- row.num
- }}
- </template>
- </el-table-column>
- <el-table-column
- prop="used_num"
- label="已用次数"
- width="180"
- show-overflow-tooltip
- align="center"
- ></el-table-column>
- <el-table-column prop="expir_time" label="过期时间" width="180" show-overflow-tooltip>
- <template slot-scope="{ row }">
- <div class="expir_time" @click.stop="amendCardTime(row)">{{ row.expir_time }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="create_time" label="创建时间" width="180" show-overflow-tooltip></el-table-column>
- <el-table-column prop="status" label="状态" show-overflow-tooltip>
- <template slot-scope="scope">
- <div :class="'colorB' + scope.row.status">
- {{
- scope.row.status == -2
- ? "已注销"
- : scope.row.status == -1
- ? "已过期"
- : scope.row.status == -0
- ? "已使用"
- : "待使用"
- }}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop label="操作" width="100" show-overflow-tooltip>
- <template slot-scope="scope" v-if="scope.row.status == 1">
- <div class="cancleCoupon" @click.stop="cancleCard(scope.row)">操作</div>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagin">
- <el-pagination
- background
- layout="prev, pager, next"
- @current-change="handleCurrentChange"
- :current-page.sync="currentPage1"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="商品订单" name="third">
- <div class="user-list">
- <el-table
- ref="multipleTable"
- :data="goodData"
- tooltip-effect="dark"
- height="354"
- style="width: 100%; border-radius: 8px"
- >
- <!-- create_time: "2022-03-19 22:53:40"
- goods: [{order_id: 47, name: "润百颜玻尿酸屏障调理面膜", num: 1}]
- id: 47
- price: "0.01"
- status: 5-->
- <el-table-column prop="goods" label="商品名称" width="200">
- <template slot-scope="scope">
- <div v-for="(val, index) in scope.row.goods" :key="index">
- <div>{{ val.name }}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="goods" label="数量" show-overflow-tooltip>
- <template slot-scope="scope">
- <div>{{ scope.row.goods.length }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="实付款" show-overflow-tooltip></el-table-column>
- <el-table-column prop="create_time" label="下单时间" width="180" show-overflow-tooltip></el-table-column>
- <el-table-column prop="status" label="状态" show-overflow-tooltip>
- <template slot-scope="scope">
- <div :class="'color' + scope.row.status">
- {{
- scope.row.status == 0
- ? "未支付"
- : scope.row.status == 1
- ? "待取货"
- : scope.row.status == 2
- ? "已取货"
- : scope.row.status == -1
- ? "已取消"
- : scope.row.status == -2
- ? "退款审核中"
- : "已退款"
- }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagin">
- <el-pagination
- background
- layout="prev, pager, next"
- @current-change="handleCurrentChange"
- :current-page.sync="currentPage1"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="优惠券" name="fourth">
- <div class="user-list">
- <el-table
- ref="multipleTable"
- :data="couponData"
- tooltip-effect="dark"
- height="354"
- style="width: 100%; border-radius: 8px"
- >
- <!-- create_time: "2022-03-10 10:39:19"
- ex_time: "2022.03.17 23:59"
- id: 2517
- name: "新人体验券"
- status: 2
- type: "全额券"-->
- <el-table-column prop="name" label="卡卷名称" width="200"></el-table-column>
- <el-table-column prop="type" label="卡卷类型" show-overflow-tooltip></el-table-column>
- <el-table-column prop="create_time" label="到期时间" width="180" show-overflow-tooltip></el-table-column>
- <el-table-column prop="create_time" label="创建时间" width="180" show-overflow-tooltipA></el-table-column>
- <el-table-column prop="status" label="状态" show-overflow-tooltip>
- <template slot-scope="scope">
- <div :class="'colorA' + scope.row.status">{{ couponStatus[scope.row.status] }}</div>
- </template>
- </el-table-column>
- <el-table-column prop label="备注" width="90" show-overflow-tooltip>
- <template slot-scope="scope" v-if="scope.row.is_send == 1">
- <button class="examineCoupon" @click.stop="cancleCoupon(scope.row,true)">查看</button>
- </template>
- </el-table-column>
- <el-table-column prop label="操作" width="80" show-overflow-tooltip>
- <template slot-scope="scope" v-if="scope.row.status == 0">
- <div class="cancleCoupon" @click.stop="cancleCoupon(scope.row,false)">操作</div>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagin">
- <el-pagination
- background
- layout="prev, pager, next"
- @current-change="handleCurrentChange"
- :current-page.sync="currentPage1"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="余额记录" name="five">
- <div class="user-list">
- <el-table
- ref="multipleTable"
- :data="balanceListData"
- tooltip-effect="dark"
- height="354"
- style="width: 100%; border-radius: 8px"
- >
- <el-table-column prop="goods" label="变更时间" width="200">
- <template slot-scope="scope">
- <div>{{ scope.row.create_time }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="goods" label="变更前金额">
- <template slot-scope="scope">
- <div>{{ scope.row.before_amount }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="goods" label="变更后金额" show-overflow-tooltip>
- <template slot-scope="scope">
- <div>{{ scope.row.after_amount }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="变更金额" show-overflow-tooltip>
- <template slot-scope="scope">
- <div>
- {{ scope.row.is_add == 1 ? "+" : "-"
- }}{{ scope.row.amount }}
- </div>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="status" label="状态" show-overflow-tooltip>
- <template slot-scope="scope">
- <div>{{ scope.row.msg }}</div>
- </template>
- </el-table-column>-->
- <!-- 余额类型(记录类型,1充值,2充值赠送,3订单退款,5提现驳回,-1消费,-2提现冻结,10客服添加,-10客服扣除) -->
- <el-table-column prop="status" label="类型" show-overflow-tooltip>
- <template slot-scope="scope">
- <div>
- {{
- scope.row.type == 1
- ? "充值"
- : scope.row.type == 2
- ? "充值赠送"
- : scope.row.type == 3
- ? "订单退款"
- : scope.row.type == 5
- ? "提现驳回"
- : scope.row.type == -1
- ? "消费"
- : scope.row.type == -2
- ? "提现冻结"
- : scope.row.type == 10
- ? "客服添加"
- : scope.row.type == -10
- ? "客服扣除"
- : ""
- }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagin">
- <el-pagination
- background
- layout="prev, pager, next"
- @current-change="handleCurrentChange"
- :current-page.sync="currentPage1"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- <!-- 次卡详情 -->
- <mine-pupop :show="isPore">
- <div class="pore-block">
- <div class="delete-pupop" @click="isPore = false">
- <img
- src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
- alt
- />
- </div>
- <div class="pore-content">
- <div class="card-title">订单详情</div>
- <div class="project">
- <div class="project-title">项目名称:</div>
- <div class="project-list">
- <div class="project-info" v-for="(item, index) in cardInfo.project_list" :key="index">
- <div class="name-text">{{ item.project_name }}</div>
- <div class="change-num" v-if="cardInfo.card_type == 1">
- <div class="num-content">
- <div class="content-left" @click="reduce(index)">-</div>
- <div class="content-num">{{ item.num || 0 }}</div>
- <div class="content-right" @click="item.num++">+</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="common">
- <span class="common-title">支付方式:</span>
- <span>{{ cardInfo.pay_way }}</span>
- </div>
- <div class="common">
- <span class="common-title">有效期限:</span>
- <span>{{ cardInfo.ex_time }}</span>
- </div>
- <div class="common">
- <span class="common-title">实付金额:</span>
- <span>¥{{ cardInfo.price }}</span>
- </div>
- <div class="consume-list">
- <div class="consume-title">消耗信息:</div>
- <div class="consume-info min-size" v-for="(item, index) in cardLogList" :key="index">
- <div class="shop">{{ item.store_name }}</div>
- <div class="project-tips">{{ item.remark }}</div>
- <div class="project-ts">{{ item.create_time }}</div>
- </div>
- </div>
- </div>
- <div v-if="cardInfo.card_type == 1" class="confirm" @click="confirm">确定</div>
- </div>
- </mine-pupop>
- <!-- 修改次卡时间 -->
- <mine-pupop :show="isAmend">
- <div class="amendTime">
- <div class="image">
- <img
- src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
- alt
- @click="closeAmend"
- />
- </div>
- <div class="admendTime-content">
- <div class="oldTime">
- 次卡过期时间 :
- <span>{{ amendCardInfo.expir_time }}</span>
- </div>
- <div class="newTime">
- 选择更改日期:
- <el-date-picker
- class="date"
- v-model="cardTime"
- type="date"
- placeholder="选择日期"
- value-format="yyyy-MM-dd"
- @focus="forbid"
- ></el-date-picker>
- </div>
- <div class="radio">
- <button class="cancelBtn" @click="cancel">取消</button>
- <button class="affirmBtn" @click="affirm">确定</button>
- </div>
- </div>
- </div>
- </mine-pupop>
- <!-- 操作核销优惠券 -->
- <mine-pupop :show="isCancelCoupon">
- <div class="CouponPop">
- <div class="image">
- <img
- src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
- alt
- @click="closeCouponPop"
- />
- </div>
- <div class="title">{{examineCoupon?'发券备注信息':'核销优惠券'}}</div>
- <div class="couponName">
- <div class="one">{{examineCoupon?'发券人:':'优惠券名称:'}}</div>
- <div>{{ examineCoupon?cancelCouponInfo.send_name:cancelCouponInfo.name }}</div>
- </div>
- <div class="couponRemark">
- <div class="one">备注信息:</div>
- <el-input v-if="!examineCoupon" v-model.trim="couponRemark"></el-input>
- <div v-else>{{cancelCouponInfo.send_remark}}</div>
- </div>
- <div class="radio">
- <button class="affirmBtn" @click="checkCoupon">确定</button>
- </div>
- </div>
- </mine-pupop>
- <!-- 操作核销次卡 -->
- <mine-pupop :show="isCancelCard">
- <div class="CancelCard">
- <div class="image">
- <img
- src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
- alt
- @click="closeCardPop"
- />
- </div>
- <div class="title">核销次卡</div>
- <div class="CardName">
- <div class="one">次卡名称:</div>
- <div>{{ cancelCardInfo.card_name }}</div>
- </div>
- <div class="cardRemark">
- <div class="one">备注信息:</div>
- <el-input v-model.trim="cardRemark"></el-input>
- </div>
- <div class="radio">
- <button class="affirmBtn" @click="checkCard">确定</button>
- </div>
- </div>
- </mine-pupop>
- </div>
- </template>
- <script>
- import api from "../../../server/home";
- import minePupop from "../../../components/minePupop/index.vue";
- import { log } from "console";
- export default {
- components: {
- minePupop
- },
- data() {
- return {
- couponList: [
- {
- value: "选项1",
- label: "黄金糕"
- },
- {
- value: "选项2",
- label: "双皮奶"
- }
- ],
- tableData: [
- {
- date: "2022.04.25 14:30",
- name: "滴滴滴",
- headImg:
- "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
- phone: "13346783645",
- numberList: 2,
- price: 100,
- shop: "运用店",
- status: 2
- },
- {
- date: "2022.04.25 14:30",
- name: "滴滴滴",
- headImg:
- "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
- phone: "13346783645",
- numberList: 5,
- price: 800,
- shop: "武昌店",
- status: 1
- }
- ],
- couponStatus: ["待使用", "已使用", "已过期"],
- goodStatus: ["未支付", "已支付", "已取货"],
- activeName: "first",
- currentPage1: 1,
- couponData: [],
- goodData: [],
- projectData: [],
- cardOrderData: [],
- total: 100,
- limit: 10,
- isPore: false,
- cardInfo: {}, //订单详情
- cardLogList: [], //次卡消耗记录
- cardListData: [], //用户次卡列表
- balanceListData: [], //用户余额变更记录
- isAmend: false, //修改次卡时间弹窗
- amendCardInfo: "", // 要修改次卡的信息
- cardTime: "", //次卡修改时间(年月日)
- isCancelCoupon: false, //核销优惠券界面
- cancelCouponInfo: "", //核销优惠券信息
- couponRemark: "", //核销优惠券备注信息
- refresh: false, //刷新页面数据
- isCancelCard: false, //核销次卡界面
- cancelCardInfo: "", //核销次卡信息
- cardRemark: "", //核销次卡备注信息
- examineCoupon: false //是否是查看优惠券
- };
- },
- computed: {},
- watch: {},
- methods: {
- // 刷新页面数据
- refreshList() {
- this.currentPage1 = 1;
- this.refresh = true;
- if (this.activeName == "first") {
- this.getUserProject();
- } else if (this.activeName == "second") {
- this.getCardList();
- } else if (this.activeName == "third") {
- this.getUserGoods();
- } else if (this.activeName == "fourth") {
- this.getUserCoupon();
- } else if (this.activeName == "five") {
- this.getBalanceRecord();
- }
- },
- // 打开核销优惠券界面
- cancleCoupon(e, examineCoupon) {
- this.examineCoupon = examineCoupon;
- this.isCancelCoupon = true;
- this.cancelCouponInfo = e;
- },
- // 关闭核销优惠券页面
- closeCouponPop() {
- this.isCancelCoupon = false;
- this.couponRemark = "";
- },
- // 核销优惠券
- checkCoupon() {
- if (this.examineCoupon) {
- this.isCancelCoupon = false;
- return;
- }
- if (this.couponRemark == "") {
- this.$message.error("请填写备注信息");
- return;
- }
- api
- .checkCoupon({
- id: this.cancelCouponInfo.id,
- remark: this.couponRemark
- })
- .then(res => {
- if (res.code == 200) {
- this.$message.success("核销成功");
- this.isCancelCoupon = false;
- // 刷新优惠券列表
- this.getUserCoupon();
- }
- });
- },
- // 打开次卡弹窗
- cancleCard(e) {
- this.isCancelCard = true;
- this.cancelCardInfo = e;
- },
- // 关闭次卡弹窗
- closeCardPop() {
- this.isCancelCard = false;
- },
- // 核销次卡
- checkCard() {
- if (this.cardRemark == "") {
- this.$message.error("请填写备注信息");
- return;
- }
- api
- .checkCard({
- id: this.cancelCardInfo.id,
- remark: this.cardRemark
- })
- .then(res => {
- if (res.code == 200) {
- this.$message.success("核销成功");
- this.isCancelCard = false;
- // 刷新次卡列表
- this.getCardList();
- }
- });
- },
- // 阻止修改次卡时间时键盘弹出
- forbid() {
- //禁止软键盘弹出
- document.activeElement.blur();
- },
- // 修改次卡时间取消
- cancel() {
- this.isAmend = false;
- this.cardTime = "";
- },
- // 修改次卡时间确定
- affirm() {
- this.amendCardTimeApi();
- },
- // 修改次卡时间
- amendCardTime(e) {
- if (e.status == -2) {
- this.$message({
- message: "该次卡已注销",
- type: "error"
- });
- return;
- }
- this.isAmend = true;
- this.amendCardInfo = e;
- console.log(e);
- },
- // 关闭修改次卡时间弹窗
- closeAmend() {
- this.isAmend = false;
- this.cardTime = "";
- },
- // 发起修改次卡订单请求
- amendCardTimeApi() {
- api
- .amendCardTime({
- id: this.amendCardInfo.id,
- expire_date: this.cardTime
- })
- .then(res => {
- if (res.code == 200) {
- this.$message({
- message: res.msg,
- type: "success"
- });
- this.isAmend = false;
- // 更新次卡列表
- this.getCardList();
- }
- });
- },
- // 获取优惠券订单
- getUserCoupon() {
- let params = {
- page: this.currentPage1,
- limit: this.limit,
- id: this.id
- };
- api.getUserCoupon(params).then(res => {
- this.couponData = res.data.list;
- this.total = res.data.total;
- // 关闭刷新动画
- this.refresh = false;
- });
- },
- reduce(index) {
- this.cardInfo.project_list[index].num--;
- if (this.cardInfo.project_list[index].num < 0) {
- this.cardInfo.project_list[index].num = 0;
- }
- },
- //次卡订单详情
- openDetail(row, column, event) {
- if (row.status == -2) {
- this.$message({
- message: "该次卡已注销",
- type: "error"
- });
- return;
- }
- this.isPore = true;
- api.cardInfo({ id: row.id }).then(res => {
- if (res.code == 200) {
- res.data.card_type = row.card_type;
- this.cardInfo = res.data;
- }
- });
- api.cardLog({ id: row.id }).then(res => {
- if (res.code == 200) {
- this.cardLogList = res.data.list;
- }
- });
- },
- confirm() {
- // 项目ID,json字符,格式如:[{"project_id":"10","num":5}],project_id:适用项目ID,num:剩余次数
- let project_data = [],
- project_info = {};
- this.cardInfo.project_list.forEach(res => {
- project_info = {
- project_id: res.id,
- num: res.num
- };
- project_data.push(project_info);
- });
- api
- .cardUpdate({
- id: this.cardInfo.id,
- project_data: JSON.stringify(project_data)
- })
- .then(res => {
- if (res.code == 200) {
- this.$message.success("更改成功!");
- this.isPore = false;
- // 刷新次卡列表
- this.getCardList();
- }
- });
- },
- // 获取商品订单
- getUserGoods() {
- let params = {
- page: this.currentPage1,
- limit: this.limit,
- id: this.id
- };
- api.getUserGoods(params).then(res => {
- this.goodData = res.data.list;
- this.total = res.data.total;
- // 关闭刷新动画
- this.refresh = false;
- });
- },
- // 获取获取项目订单
- getUserProject() {
- let params = {
- page: this.currentPage1,
- limit: this.limit,
- id: this.id
- };
- api.getUserProject(params).then(res => {
- this.projectData = res.data.list;
- this.total = res.data.total;
- // 关闭刷新动画
- this.refresh = false;
- });
- },
- // 获取卡券订单
- // async getCardOrders() {
- // let params = {
- // page: this.currentPage1,
- // limit: this.limit,
- // id: this.id,
- // };
- // let resp = await api.getCardOrders(params);
- // if (resp.code === 200) {
- // console.log(resp, "adadasdasdadsadsadasd");
- // this.cardOrderData = resp.data.list;
- // this.total = resp.data.total;
- // }
- // },
- //获取用户次卡列表
- async getCardList() {
- let params = {
- page: this.currentPage1,
- limit: this.limit,
- id: this.id
- };
- let resp = await api.getCardList(params);
- if (resp.code === 200) {
- this.cardListData = resp.data.list;
- this.total = resp.data.total;
- // 关闭刷新动画
- this.refresh = false;
- }
- },
- // 获取余额变更记录
- async getBalanceRecord() {
- let params = {
- page: this.currentPage1,
- limit: this.limit,
- id: this.id
- };
- let resp = await api.getBalanceRecord(params);
- if (resp.code === 200) {
- this.balanceListData = resp.data.list;
- this.total = resp.data.count;
- // 关闭刷新动画
- this.refresh = false;
- }
- },
- handleCurrentChange(val) {
- this.currentPage1 = val;
- if (this.activeName == "first") {
- this.getUserProject();
- } else if (this.activeName == "second") {
- // this.getCardOrders();
- this.getCardList();
- } else if (this.activeName == "third") {
- this.getUserGoods();
- } else if (this.activeName == "fourth") {
- this.getUserCoupon();
- } else if (this.activeName == "five") {
- this.getBalanceRecord();
- }
- },
- handleSelectionChange(row, column, event) {
- this.$router.push({
- path: "/historicalOrder/details",
- query: {
- id: row.id
- }
- });
- },
- onSubmit() {},
- submitFrequency() {},
- changeTab(e) {
- this.currentPage1 = 1;
- console.log(this.currentPage1);
- if (e.index == 0) {
- this.getUserProject();
- } else if (e.index == 1) {
- // this.getCardOrders();
- this.getCardList();
- } else if (e.index == 2) {
- this.getUserGoods();
- } else if (e.index == 3) {
- this.getUserCoupon();
- } else if (e.index == 4) {
- this.getBalanceRecord();
- }
- }
- },
- created() {
- let id = this.$route.query.id;
- let activeName = this.$route.query.activeName;
- this.activeName = activeName;
- this.id = id;
- if (this.activeName == "first") {
- this.getUserProject();
- } else if (this.activeName == "second") {
- // this.getCardOrders();
- this.getCardList();
- } else if (this.activeName == "third") {
- this.getUserGoods();
- } else if (this.activeName == "fourth") {
- this.getUserCoupon();
- } else if (this.activeName == "five") {
- this.getBalanceRecord();
- }
- },
- activated() {
- let id = this.$route.query.id;
- let activeName = this.$route.query.activeName;
- this.activeName = activeName;
- this.id = id;
- if (this.activeName == "first") {
- this.getUserProject();
- } else if (this.activeName == "second") {
- this.getCardList();
- } else if (this.activeName == "third") {
- this.getUserGoods();
- } else if (this.activeName == "fourth") {
- this.getUserCoupon();
- } else if (this.activeName == "five") {
- this.getBalanceRecord();
- }
- },
- mounted() {}
- };
- </script>
- <style lang='less' scoped>
- .order {
- height: 100%;
- width: 100%;
- .refreshBtn {
- width: 100%;
- display: flex;
- justify-content: flex-end;
- margin-bottom: 10px;
- .refresh {
- width: 100px;
- background: #fa7d22;
- border-radius: 2px;
- border-color: #fa7d22;
- }
- }
- .cancleCoupon {
- width: 50px;
- height: 25px;
- background: #fa7d22;
- border-radius: 2px;
- line-height: 25px;
- text-align: center;
- color: #fff;
- }
- .examineCoupon {
- width: 50px;
- height: 25px;
- }
- .pagin {
- padding: 20px 0;
- .el-pagination {
- text-align: center;
- }
- }
- .colorList {
- color: green;
- }
- }
- .color0 {
- color: #3ef3ed;
- }
- .color1 {
- color: #61d09d;
- }
- .color2 {
- color: #00eeee;
- }
- .color3 {
- color: #a999ea;
- }
- .color-2 {
- color: #3115cc;
- }
- .color-1 {
- color: #fc3019;
- }
- .color-3 {
- color: #fc3019;
- }
- .colorA1 {
- color: #333;
- }
- .colorA2 {
- color: #fc3019;
- }
- .colorA0 {
- color: #61d09d;
- }
- .colorB0 {
- color: #3ef3ed;
- }
- .colorB1 {
- color: #61d09d;
- }
- .colorB-1 {
- color: #fc3019;
- }
- .colorB-2 {
- color: #333;
- }
- .priceColor {
- color: #ff3007;
- }
- .pore-block {
- width: 540px;
- height: 400px;
- background: #ffffff;
- border-radius: 8px;
- position: relative;
- padding: 26px 72px 80px 30px;
- .delete-pupop {
- width: 32px;
- position: absolute;
- right: 5px;
- top: 5px;
- img {
- width: 100%;
- }
- }
- .pore-content {
- overflow: scroll;
- height: 310px;
- .card-title {
- font-size: 14px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 20px;
- text-align: center;
- }
- .project {
- display: flex;
- font-size: 13px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 18px;
- .project-title {
- color: #999999;
- }
- .project-list {
- flex: 1;
- .project-info {
- flex: 1;
- .change-num {
- margin-top: 6px;
- width: 100%;
- display: flex;
- justify-content: end;
- .num-content {
- width: 104px;
- height: 28px;
- background: #ffffff;
- border-radius: 2px;
- border: 1px solid #fa7d22;
- display: flex;
- align-items: center;
- .content-left,
- .content-right {
- width: 28px;
- height: 100%;
- background: #fa7d22;
- font-size: 20px;
- line-height: 24px;
- color: #ffffff;
- text-align: center;
- }
- .content-num {
- flex: 1;
- font-size: 12px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: rgba(0, 0, 0, 0.65);
- text-align: center;
- }
- }
- }
- }
- }
- }
- .common {
- margin-top: 6px;
- font-size: 13px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 18px;
- .common-title {
- color: #999999;
- }
- }
- .consume-list {
- margin-top: 6px;
- .consume-title {
- font-size: 13px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #999999;
- line-height: 18px;
- }
- .consume-info {
- margin-top: 6px;
- font-size: 10px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 14px;
- display: flex;
- justify-content: space-between;
- .shop {
- }
- .project-tips {
- flex: 1;
- margin: 0 10px;
- }
- .project-ts {
- }
- }
- }
- }
- .confirm {
- background: #fa7d22;
- border-radius: 14px;
- position: absolute;
- bottom: 42px;
- left: 50%;
- transform: translateX(-50%);
- width: 176px;
- height: 28px;
- font-size: 14px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #ffffff;
- line-height: 28px;
- text-align: center;
- }
- }
- // 修改次卡时间
- .amendTime {
- width: 440px;
- height: 300px;
- background-color: #fff;
- border-radius: 12px;
- padding: 15px;
- .image {
- height: 30px;
- width: 30px;
- img {
- width: 100%;
- }
- }
- .oldTime {
- color: #333;
- margin-left: 20px;
- margin-top: 30px;
- span {
- margin-left: 20px;
- }
- }
- .newTime {
- margin-left: 20px;
- margin-top: 10px;
- .time {
- margin-top: 20px;
- margin-left: 110px;
- }
- .date {
- margin-top: 20px;
- margin-left: 20px;
- }
- }
- .radio {
- width: 100%;
- display: flex;
- justify-content: space-evenly;
- button {
- width: 176px;
- height: 28px;
- border-radius: 14px;
- background-color: #fff;
- border: none;
- margin-top: 90px;
- }
- .cancelBtn {
- border: 1px solid #fa7d22;
- color: #fa7d22;
- }
- .affirmBtn {
- background-color: #fa7d22;
- color: #fff;
- margin-left: 15px;
- }
- }
- }
- // 核销优惠券
- .CouponPop {
- width: 440px;
- height: 300px;
- background-color: #fff;
- border-radius: 12px;
- padding: 15px;
- .image {
- height: 30px;
- width: 30px;
- img {
- width: 100%;
- }
- }
- .title {
- text-align: center;
- font-weight: 700;
- font-size: 16px;
- margin-bottom: 40px;
- }
- .couponName {
- display: flex;
- margin-bottom: 40px;
- .one {
- font-weight: 600;
- margin-right: 20px;
- width: 90px;
- }
- }
- .couponRemark {
- display: flex;
- align-items: center;
- .one {
- margin-right: 22px;
- font-weight: 600;
- width: 90px;
- }
- .el-input {
- width: 300px;
- /deep/.el-input__inner:focus {
- // el-input输入时设置边框颜色
- border: #fa7d22 1px solid;
- }
- }
- }
- .radio {
- width: 100%;
- display: flex;
- justify-content: space-evenly;
- button {
- width: 176px;
- height: 28px;
- border-radius: 14px;
- background-color: #fff;
- border: none;
- margin-top: 50px;
- }
- .affirmBtn {
- background-color: #fa7d22;
- color: #fff;
- margin-left: 15px;
- }
- }
- }
- // 核销次卡界面
- .CancelCard {
- width: 440px;
- height: 300px;
- background-color: #fff;
- border-radius: 12px;
- padding: 15px;
- .image {
- height: 30px;
- width: 30px;
- img {
- width: 100%;
- }
- }
- .title {
- text-align: center;
- font-weight: 700;
- font-size: 16px;
- margin-bottom: 40px;
- }
- .CardName {
- display: flex;
- margin-bottom: 40px;
- .one {
- font-weight: 600;
- margin-right: 10px;
- width: 90px;
- }
- }
- .cardRemark {
- display: flex;
- align-items: center;
- .one {
- margin-right: 22px;
- font-weight: 600;
- width: 90px;
- }
- .el-input {
- width: 300px;
- /deep/.el-input__inner:focus {
- // el-input输入时设置边框颜色
- border: #fa7d22 1px solid;
- }
- }
- }
- .radio {
- width: 100%;
- display: flex;
- justify-content: space-evenly;
- button {
- width: 176px;
- height: 28px;
- border-radius: 14px;
- background-color: #fff;
- border: none;
- margin-top: 50px;
- }
- .affirmBtn {
- background-color: #fa7d22;
- color: #fff;
- margin-left: 15px;
- }
- }
- }
- .expir_time {
- color: #3115cc;
- }
- </style>
|