|
@@ -1,43 +1,25 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <PermissionContainer
|
|
|
+ :jiBieArr="[2]"
|
|
|
+ :type="4"
|
|
|
+ :tipArr="[, '标签配置只对站点级别开放', '', , '您没有开启标签功能']"
|
|
|
+ >
|
|
|
<el-form
|
|
|
- :model="queryParams"
|
|
|
+ :model="queryForm"
|
|
|
ref="queryForm"
|
|
|
:inline="true"
|
|
|
label-width="88px"
|
|
|
style="margin-top: 20px"
|
|
|
>
|
|
|
- <el-form-item label="使用状态" prop="couponIsUsed">
|
|
|
- <el-select
|
|
|
- v-model="queryParams.couponIsUsed"
|
|
|
- clearable
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option label="已使用" value="1"></el-option>
|
|
|
- <el-option label="未使用" value="0"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="核销手机号" prop="verificationUserPhone">
|
|
|
+ <el-form-item label="手机号" prop="phoneNumber">
|
|
|
<el-input
|
|
|
- v-model="queryParams.verificationUserPhone"
|
|
|
+ v-model="queryForm.phoneNumber"
|
|
|
placeholder="请输入手机号"
|
|
|
clearable
|
|
|
size="small"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="领取时间" prop="getCouponTime">
|
|
|
- <el-date-picker
|
|
|
- style="width: 350px"
|
|
|
- v-model="dateRangeCreatedDate"
|
|
|
- size="mini"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- type="datetimerange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
+
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
type="cyan"
|
|
@@ -46,6 +28,7 @@
|
|
|
@click="handleQuery"
|
|
|
>搜索</el-button
|
|
|
>
|
|
|
+
|
|
|
<el-button
|
|
|
type="info"
|
|
|
icon="el-icon-refresh"
|
|
@@ -53,192 +36,696 @@
|
|
|
@click="resetQuery"
|
|
|
>重置</el-button
|
|
|
>
|
|
|
+
|
|
|
<el-button
|
|
|
type="success"
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
- @click="handleUpdate"
|
|
|
- >导入</el-button
|
|
|
+ @click="batchAdd"
|
|
|
+ >导入Excel批量新增</el-button
|
|
|
>
|
|
|
|
|
|
<el-button
|
|
|
- type="danger"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- @click="handleDelete"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- icon="el-icon-download"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
- @click="handleExport"
|
|
|
- >导出</el-button
|
|
|
+ @click="handleAdd"
|
|
|
+ >单条新增</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-table :data="couponUserList">
|
|
|
- <af-table-column label="发放方式标识" align="left" prop="issueRemark" />
|
|
|
- <af-table-column label="活动名称" align="left" prop="issueName" />
|
|
|
-
|
|
|
- <af-table-column
|
|
|
- label="手机"
|
|
|
- align="left"
|
|
|
- prop="couponRemark"
|
|
|
- fixed="left"
|
|
|
- />
|
|
|
- <af-table-column label="等级" align="left">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.couponType == 1
|
|
|
- ? "现金劵" + "--面值:" + scope.row.couponAmt + "元"
|
|
|
- : ""
|
|
|
- }}
|
|
|
- {{
|
|
|
- scope.row.couponType == 2
|
|
|
- ? "折扣券" + "--折扣:" + scope.row.couponAmt + "% "
|
|
|
- : ""
|
|
|
- }}
|
|
|
- {{
|
|
|
- scope.row.couponType == 3
|
|
|
- ? "兑换券" + "--商品:" + scope.row.couponName
|
|
|
- : ""
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </af-table-column>
|
|
|
- <af-table-column label="标签" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.couponIsUsed == "0" ? "未使用" : "" }}
|
|
|
- {{ scope.row.couponIsUsed == "1" ? "已使用" : "" }}
|
|
|
- {{ scope.row.couponIsUsed == "2" ? "已核销" : "" }}
|
|
|
- </template>
|
|
|
- </af-table-column>
|
|
|
- <af-table-column label="优惠券" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.couponIsEffective == "0" ? "无效" : "" }}
|
|
|
- {{ scope.row.couponIsEffective == "1" ? "有效" : "" }}
|
|
|
- </template>
|
|
|
- </af-table-column>
|
|
|
- <af-table-column
|
|
|
- label="用户保存id"
|
|
|
- align="center"
|
|
|
- prop="userId"
|
|
|
- v-if="false"
|
|
|
- />
|
|
|
- <af-table-column label="电子卡余额" align="center" prop="mobilePhone" />
|
|
|
- <af-table-column label="积分余额" align="center" prop="blogNickName" />
|
|
|
- <af-table-column
|
|
|
- label="核销员手机号"
|
|
|
- align="center"
|
|
|
- prop="verificationUserPhone"
|
|
|
- />
|
|
|
- <af-table-column
|
|
|
- label="优惠券截止时间"
|
|
|
- align="center"
|
|
|
- prop="couponEffectiveTime"
|
|
|
+
|
|
|
+ <!--主要表格-->
|
|
|
+ <div>
|
|
|
+ <el-table
|
|
|
+ :data="importList"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ class="mt-5"
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{
|
|
|
- parseTime(scope.row.couponEffectiveTime, "{y}-{m}-{d} {h}:{i}:{s}")
|
|
|
- }}</span>
|
|
|
- </template>
|
|
|
- </af-table-column>
|
|
|
- </el-table>
|
|
|
- <pagination
|
|
|
- v-show="total > 0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <af-table-column align="center" prop="id" type="selection" />
|
|
|
+ <af-table-column label="手机" align="center" prop="phoneNumber" />
|
|
|
+ <af-table-column label="积分" align="center" prop="integral" />
|
|
|
+ <af-table-column
|
|
|
+ label="电子卡类型"
|
|
|
+ align="center"
|
|
|
+ prop="memberGrade"
|
|
|
+ width="160px"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ translateCardToName(scope.row.cardType) }}
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ <af-table-column label="电子卡余额" align="center" prop="balance" />
|
|
|
+ <af-table-column
|
|
|
+ label="会员等级"
|
|
|
+ align="center"
|
|
|
+ prop="memberGrade"
|
|
|
+ width="160px"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ translateGradeToName(scope.row.memberGrade) }}
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ <af-table-column label="等级操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-dropdown @command="toGrade">
|
|
|
+ <span class="el-dropdown-link" style="font-size: 12px">
|
|
|
+ 强拉到指定等级<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ :command="scope.row.phoneNumber + '.' + ele.id"
|
|
|
+ v-for="ele in gradeList"
|
|
|
+ :key="ele.id"
|
|
|
+ >{{ ele.grade }}</el-dropdown-item
|
|
|
+ >
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-popconfirm
|
|
|
+ title="此操作会将选中用户强制列为无标签状态,是否继续?"
|
|
|
+ confirm-button-text="删除"
|
|
|
+ @onConfirm="toUnGrade(scope.row.phoneNumber)"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ class="underline btn24"
|
|
|
+ size="mini"
|
|
|
+ slot="reference"
|
|
|
+ >拉出等级</el-button
|
|
|
+ >
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ <af-table-column
|
|
|
+ label="标签"
|
|
|
+ align="center"
|
|
|
+ prop="labelId"
|
|
|
+ width="160px"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ translateLabelToName(scope.row.labelId) }}
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ <af-table-column label="标签操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-dropdown @command="toLabel">
|
|
|
+ <span class="el-dropdown-link" style="font-size: 12px">
|
|
|
+ 强拉到指定标签<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ :command="scope.row.phoneNumber + '.' + ele.id"
|
|
|
+ v-for="ele in labelList"
|
|
|
+ :key="ele.id"
|
|
|
+ >{{ ele.labelName }}</el-dropdown-item
|
|
|
+ >
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-popconfirm
|
|
|
+ title="此操作会将选中用户强制列为无标签状态,是否继续?"
|
|
|
+ confirm-button-text="删除"
|
|
|
+ @onConfirm="toUnLabel(scope.row.phoneNumber)"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ class="underline btn24"
|
|
|
+ size="mini"
|
|
|
+ slot="reference"
|
|
|
+ >拉出标签</el-button
|
|
|
+ >
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ <af-table-column
|
|
|
+ label="优惠券领取方式"
|
|
|
+ align="center"
|
|
|
+ prop="couponIssueId"
|
|
|
+ width="160px"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ translateIssueToName(scope.row.couponIssueId) }}
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ <af-table-column label="领取方式操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-dropdown @command="toIssue">
|
|
|
+ <span class="el-dropdown-link" style="font-size: 12px">
|
|
|
+ 强拉到指定领取<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ :command="scope.row.phoneNumber + '.' + ele.id"
|
|
|
+ v-for="ele in issueList"
|
|
|
+ :key="ele.id"
|
|
|
+ >{{ ele.issueRemark }}</el-dropdown-item
|
|
|
+ >
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-popconfirm
|
|
|
+ title="此操作会将选中用户强制列为无标签状态,是否继续?"
|
|
|
+ confirm-button-text="删除"
|
|
|
+ @onConfirm="toUnIssue(scope.row.phoneNumber)"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ class="underline btn24"
|
|
|
+ size="mini"
|
|
|
+ slot="reference"
|
|
|
+ >拉出领取</el-button
|
|
|
+ >
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </af-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="total > 1"
|
|
|
+ :total="total"
|
|
|
+ :pageSizes="[10, 50, 100, 200]"
|
|
|
+ :page.sync="queryForm.pageNum"
|
|
|
+ :limit.sync="queryForm.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--拉入前提示框-->
|
|
|
+ <el-dialog
|
|
|
+ :title="'强拉入' + handleTypeName[handleType]"
|
|
|
+ :visible.sync="confirmDialog"
|
|
|
+ width="750px"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <div class="ml-5">
|
|
|
+ 无论当前用户此刻是否已经有{{ handleTypeName[handleType] }},
|
|
|
+ 点击确认按钮后,会立刻将选中用户拉入新的
|
|
|
+ {{ handleTypeName[handleType] }}~
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="handleSubmitLable" size="small"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="cancelSubmitLabel" size="small">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!--导入 表格反馈-->
|
|
|
+ <el-dialog
|
|
|
+ :title="'结果反馈'"
|
|
|
+ :visible.sync="tipOpen"
|
|
|
+ width="600px"
|
|
|
+ append-to-body
|
|
|
+ status-icon
|
|
|
+ >
|
|
|
+ <div v-html="tipContent">
|
|
|
+ {{ tipContent }}
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 新增单条导入 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ width="600px"
|
|
|
+ append-to-body
|
|
|
+ status-icon
|
|
|
+ >
|
|
|
+ <el-form ref="createForm" :model="createForm" label-width="180px">
|
|
|
+ <el-form-item
|
|
|
+ label="手机号"
|
|
|
+ prop="phoneNumber"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '手机号不能为空',
|
|
|
+ trigger: 'blur',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ class="form-control"
|
|
|
+ v-model="createForm.phoneNumber"
|
|
|
+ style="width: 180px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="积分余额" prop="integral">
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ class="form-control"
|
|
|
+ v-model.number="createForm.integral"
|
|
|
+ style="width: 180px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="电子卡类型" prop="cardType">
|
|
|
+ <el-radio-group v-model="createForm.cardType">
|
|
|
+ <div>
|
|
|
+ <el-radio label="1">汽油卡</el-radio>
|
|
|
+ <el-radio label="2">柴油卡</el-radio>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-radio label="3">LNG卡</el-radio>
|
|
|
+ <el-radio label="4">CNG卡</el-radio>
|
|
|
+ </div>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="电子卡余额" prop="balance">
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ class="form-control"
|
|
|
+ v-model.number="createForm.balance"
|
|
|
+ style="width: 180px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="等级" prop="memberGrade">
|
|
|
+ <el-select v-model="createForm.memberGrade" placeholder="请选择">
|
|
|
+ <el-option :label="'暂不选择'" :value="''"> </el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="ele in gradeList"
|
|
|
+ :key="ele.id"
|
|
|
+ :label="ele.grade"
|
|
|
+ :value="ele.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="标签" prop="labelId">
|
|
|
+ <el-select v-model="createForm.labelId" placeholder="请选择">
|
|
|
+ <el-option :label="'暂不选择'" :value="''"> </el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="ele in labelList"
|
|
|
+ :key="ele.id"
|
|
|
+ :label="ele.labelName"
|
|
|
+ :value="ele.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠券领取方式" prop="couponIssueId">
|
|
|
+ <el-select v-model="createForm.couponIssueId" placeholder="请选择">
|
|
|
+ <el-option :label="'暂不选择'" :value="''"> </el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="ele in issueList"
|
|
|
+ :key="ele.id"
|
|
|
+ :label="ele.issueRemark"
|
|
|
+ :value="ele.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </PermissionContainer>
|
|
|
</template>
|
|
|
+
|
|
|
<script>
|
|
|
-import { listOrder, exportOrder, printOrderInfo } from "@/api/station/order";
|
|
|
-import { stationinfo } from "@/api/station/gun";
|
|
|
-import { listPrice, getPrice } from "@/api/station/price";
|
|
|
-import { queryCouponUserList } from "@/api/coupon";
|
|
|
-import { listManage } from "@/api/station/manage";
|
|
|
+import {
|
|
|
+ getLabelUser,
|
|
|
+ // getLabelList,
|
|
|
+ delUserLabel,
|
|
|
+} from "@/api/label/label";
|
|
|
+
|
|
|
+import {
|
|
|
+ getIssueList,
|
|
|
+ getGradeList,
|
|
|
+ getLabelList,
|
|
|
+ importExcel,
|
|
|
+ getImportList,
|
|
|
+} from "@/api/preData";
|
|
|
|
|
|
export default {
|
|
|
- name: "coupon_user",
|
|
|
+ name: "Dzk_Bill",
|
|
|
data() {
|
|
|
return {
|
|
|
- //创建订单时间间隔
|
|
|
- dateRangeCreatedDate: [],
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 优惠券的信息
|
|
|
- couponUserList: [],
|
|
|
- oilNameOptions: [],
|
|
|
- // 字典
|
|
|
- payTypeOptions: [],
|
|
|
- // 下拉油站
|
|
|
- stationOptions: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- levelId: this.levelId,
|
|
|
+ queryForm: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- issueId: null,
|
|
|
- couponId: null,
|
|
|
- stationId: null,
|
|
|
- couponIsUsed: null,
|
|
|
- couponIsEffective: null,
|
|
|
- getCouponTime: null,
|
|
|
- verificationUserPhone: null,
|
|
|
},
|
|
|
- // 表单校验
|
|
|
- rules: {},
|
|
|
- reprint: false,
|
|
|
+ tipOpen: false,
|
|
|
+ tipContent: "",
|
|
|
+ title: "",
|
|
|
+ open: false,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ importList: [],
|
|
|
+ selectedImport: [],
|
|
|
+ confirmDialog: false,
|
|
|
+ createForm: {
|
|
|
+ phoneNumber: "",
|
|
|
+ integral: 0,
|
|
|
+ cardType: "1",
|
|
|
+ balance: 0,
|
|
|
+ memberGrade: "",
|
|
|
+ labelId: "",
|
|
|
+ couponIssueId: "",
|
|
|
+ },
|
|
|
+ issueList: [],
|
|
|
+ labelList: [],
|
|
|
+ gradeList: [],
|
|
|
+ handleTypeName: ["等级", "标签", "优惠券领取方式"],
|
|
|
+ handleType: 1, // 0 等级 1 标签 2 优惠券领取方式
|
|
|
+ tempId: "",
|
|
|
+ tempArr: [],
|
|
|
};
|
|
|
},
|
|
|
+ computed: {},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
- },
|
|
|
+ this.init();
|
|
|
|
|
|
+
|
|
|
+ },
|
|
|
methods: {
|
|
|
- /** 查询订单支付列表 */
|
|
|
- getList() {
|
|
|
- this.queryParams.levelId = this.levelId;
|
|
|
- queryCouponUserList(
|
|
|
- this.addDateRange(this.queryParams, this.dateRangeCreatedDate)
|
|
|
- ).then((response) => {
|
|
|
- this.couponUserList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
+ init() {
|
|
|
+ this.getList();
|
|
|
+ getIssueList()
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.rows == null) {
|
|
|
+ this.issueList = [];
|
|
|
+ } else {
|
|
|
+ this.issueList = res.rows;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new Error("");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.msgError("拉取优惠券领取方式失败~");
|
|
|
+ });
|
|
|
+ getLabelList()
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.rows == null) {
|
|
|
+ this.labelList = [];
|
|
|
+ } else {
|
|
|
+ this.labelList = res.rows;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new Error("");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.msgError("拉取标签列表失败~");
|
|
|
+ });
|
|
|
+ getGradeList()
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.rows == null) {
|
|
|
+ this.gradeList = [];
|
|
|
+ } else {
|
|
|
+ this.gradeList = res.rows;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new Error("");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.msgError("拉取等级列表失败~");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ translateIssueToName(id) {
|
|
|
+ const issue = this.issueList.find((ele) => {
|
|
|
+ return ele.id == id;
|
|
|
+ });
|
|
|
+ if (issue == undefined) {
|
|
|
+ return "----";
|
|
|
+ }
|
|
|
+ return issue.issueRemark;
|
|
|
+ },
|
|
|
+ translateGradeToName(id) {
|
|
|
+ const grade = this.gradeList.find((ele) => {
|
|
|
+ return ele.id == id;
|
|
|
+ });
|
|
|
+ if (grade == undefined) {
|
|
|
+ return "----";
|
|
|
+ }
|
|
|
+ return grade.grade;
|
|
|
+ },
|
|
|
+ translateLabelToName(id) {
|
|
|
+ const label = this.labelList.find((ele) => {
|
|
|
+ return ele.id == id;
|
|
|
+ });
|
|
|
+ if (label == undefined) {
|
|
|
+ return "----";
|
|
|
+ }
|
|
|
+ return label.labelName;
|
|
|
+ },
|
|
|
+ translateCardToName(id) {
|
|
|
+ const typeObj = {
|
|
|
+ 1: "汽油卡",
|
|
|
+ 2: "柴油卡",
|
|
|
+ 3: "LNG卡",
|
|
|
+ 4: "CNG卡",
|
|
|
+ };
|
|
|
+
|
|
|
+ const type = typeObj[id];
|
|
|
+ if (type == undefined) {
|
|
|
+ return "----";
|
|
|
+ }
|
|
|
+ return type;
|
|
|
+ },
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["createForm"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ importExcel([this.createForm]).then((res) => {
|
|
|
+ console.log("res111111111", res);
|
|
|
+ this.tipOpen = true;
|
|
|
+ this.tipContent = res.msg;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ },
|
|
|
+ batchAdd() {},
|
|
|
+ handleAdd() {
|
|
|
+ this.title = "新增数据";
|
|
|
+ this.createForm = {
|
|
|
+ phoneNumber: "",
|
|
|
+ integral: 0,
|
|
|
+ cardType: "1",
|
|
|
+ balance: 0,
|
|
|
+ memberGrade: "",
|
|
|
+ labelId: "",
|
|
|
+ couponIssueId: "",
|
|
|
+ };
|
|
|
+ this.open = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSubmitLable() {
|
|
|
+ const subArr = [];
|
|
|
+ console.log("拉入的type", this.handleType);
|
|
|
+ console.log("拉入的id", this.tempId);
|
|
|
+ console.log("拉入的人员", this.tempArr);
|
|
|
+ },
|
|
|
+ cancelSubmitLabel() {
|
|
|
+ this.getList();
|
|
|
+ this.confirmDialog = false;
|
|
|
+ },
|
|
|
+ translationLabel(id) {
|
|
|
+ const label = this.labelList.find((ele) => {
|
|
|
+ return id == ele.id;
|
|
|
});
|
|
|
+ if (label == undefined) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ return label.labelName;
|
|
|
+ },
|
|
|
+ toUnGrade(phone) {
|
|
|
+ const delArr = [];
|
|
|
+ if (this.selectedImport.length == 0) {
|
|
|
+ delArr.push(phone);
|
|
|
+ } else {
|
|
|
+ this.selectedImport.map((ele) => {
|
|
|
+ if (!!ele.phoneNumber) {
|
|
|
+ delArr.push(ele.phoneNumber);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log("删除的类型", 0);
|
|
|
+ console.log("删除的人的手机号", delArr);
|
|
|
+ // delUserLabel({ phoneList: delArr })
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.getList();
|
|
|
+ // this.msgSuccess("删除用户标签成功~");
|
|
|
+ // } else {
|
|
|
+ // throw new Error("");
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // this.msgError("删除用户标签状态失败,请刷新后重试~");
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ toUnLabel(phone) {
|
|
|
+ const delArr = [];
|
|
|
+ if (this.selectedImport.length == 0) {
|
|
|
+ delArr.push(phone);
|
|
|
+ } else {
|
|
|
+ this.selectedImport.map((ele) => {
|
|
|
+ if (!!ele.phoneNumber) {
|
|
|
+ delArr.push(ele.phoneNumber);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log("删除的类型", 1);
|
|
|
+ console.log("删除的人的手机号", delArr);
|
|
|
+ },
|
|
|
+ toUnIssue(phone) {
|
|
|
+ const delArr = [];
|
|
|
+ if (this.selectedImport.length == 0) {
|
|
|
+ delArr.push(phone);
|
|
|
+ } else {
|
|
|
+ this.selectedImport.map((ele) => {
|
|
|
+ if (!!ele.phoneNumber) {
|
|
|
+ delArr.push(ele.phoneNumber);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log("删除的类型", 2);
|
|
|
+ console.log("删除的人的手机号", delArr);
|
|
|
+ },
|
|
|
+
|
|
|
+ selectionChange(selection) {
|
|
|
+ console.log("selectionChange", selection);
|
|
|
+
|
|
|
+ this.selectedImport = selection;
|
|
|
+ },
|
|
|
+ usageTypeFotmat(row, column) {
|
|
|
+ if (row.usageType === "+") {
|
|
|
+ return "充值";
|
|
|
+ } else if (row.usageType === "-") {
|
|
|
+ return "消费";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cardOilsTypeFotmat(row, column) {
|
|
|
+ if (row.cardOilsType === "1") {
|
|
|
+ return "汽油";
|
|
|
+ } else if (row.cardOilsType === "2") {
|
|
|
+ return "柴油";
|
|
|
+ } else if (row.cardOilsType === "3") {
|
|
|
+ return "非油品";
|
|
|
+ } else if (row.cardOilsType === "4") {
|
|
|
+ return "LNG";
|
|
|
+ } else if (row.cardOilsType === "5") {
|
|
|
+ return "CNG";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 查询客户电子会员卡充值消费记录列表 */
|
|
|
+ getList() {
|
|
|
+ getImportList()
|
|
|
+ .then((res) => {
|
|
|
+ if (res.rows == null) {
|
|
|
+ this.importList = [];
|
|
|
+ } else {
|
|
|
+ this.importList = res.rows;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.msgError("拉取导入的数据列表失败");
|
|
|
+ });
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
+ this.queryForm.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.dateRangeCreatedDate = [];
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+ toGrade(phoneAndId) {
|
|
|
+ const phoneAndIdArr = phoneAndId.match(/\d{1,}/g);
|
|
|
+ const phone = phoneAndIdArr[0];
|
|
|
+ const id = phoneAndIdArr[1];
|
|
|
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
- this.$confirm("是否确认导出所有订单支付数据项?", "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(function () {
|
|
|
- return exportOrder(queryParams);
|
|
|
- })
|
|
|
- .then((response) => {
|
|
|
- this.download(response.msg);
|
|
|
+ if (!id || !phone) {
|
|
|
+ this.msgError("强拉等级失败,刷新重试~");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.selectedImport.length == 0) {
|
|
|
+ this.tempArr = [phone];
|
|
|
+ } else {
|
|
|
+ this.tempArr = [];
|
|
|
+ this.selectedImport.map((ele) => {
|
|
|
+ this.tempArr.push(ele.phoneNumber);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.handleType = 0;
|
|
|
+ this.tempId = id;
|
|
|
+
|
|
|
+ this.confirmDialog = true;
|
|
|
+ },
|
|
|
+ toLabel(phoneAndId) {
|
|
|
+ const phoneAndIdArr = phoneAndId.match(/\d{1,}/g);
|
|
|
+ const phone = phoneAndIdArr[0];
|
|
|
+ const id = phoneAndIdArr[1];
|
|
|
+
|
|
|
+ if (!id || !phone) {
|
|
|
+ this.msgError("强拉标签失败,刷新重试~");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.selectedImport.length == 0) {
|
|
|
+ this.tempArr = [phone];
|
|
|
+ } else {
|
|
|
+ this.tempArr = [];
|
|
|
+ this.selectedImport.map((ele) => {
|
|
|
+ this.tempArr.push(ele.phoneNumber);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.handleType = 1;
|
|
|
+ this.tempId = id;
|
|
|
+
|
|
|
+ this.confirmDialog = true;
|
|
|
+ },
|
|
|
+ toIssue(phoneAndId) {
|
|
|
+ const phoneAndIdArr = phoneAndId.match(/\d{1,}/g);
|
|
|
+ const phone = phoneAndIdArr[0];
|
|
|
+ const id = phoneAndIdArr[1];
|
|
|
+
|
|
|
+ if (!id || !phone) {
|
|
|
+ this.msgError("强拉标签失败,刷新重试~");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.selectedImport.length == 0) {
|
|
|
+ this.tempArr = [phone];
|
|
|
+ } else {
|
|
|
+ this.tempArr = [];
|
|
|
+ this.selectedImport.map((ele) => {
|
|
|
+ this.tempArr.push(ele.phoneNumber);
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
+ this.handleType = 2;
|
|
|
+ this.tempId = id;
|
|
|
+
|
|
|
+ this.confirmDialog = true;
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.app-container {
|
|
|
+ .container {
|
|
|
+ .row {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.el-dropdown-link {
|
|
|
+ cursor: pointer;
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
+.el-icon-arrow-down {
|
|
|
+ font-size: 12px;
|
|
|
+}
|
|
|
+</style>
|