|
@@ -2,7 +2,7 @@
|
|
|
<PermissionContainer
|
|
<PermissionContainer
|
|
|
:jiBieArr="[2]"
|
|
:jiBieArr="[2]"
|
|
|
:type="4"
|
|
:type="4"
|
|
|
- :tipArr="[, '标签配置只对站点级别开放', '', , '您没有开启标签功能']"
|
|
|
|
|
|
|
+ :tipArr="[, '数据导入只对站点级别开放', '', , '']"
|
|
|
>
|
|
>
|
|
|
<el-form
|
|
<el-form
|
|
|
:model="queryForm"
|
|
:model="queryForm"
|
|
@@ -42,8 +42,16 @@
|
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="batchAdd"
|
|
@click="batchAdd"
|
|
|
- >导入Excel批量新增</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ >导入Excel批量新增
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="file"
|
|
|
|
|
+ accept=".xls,.xlsx"
|
|
|
|
|
+ class="upload_file"
|
|
|
|
|
+ @change="handleUpload($event)"
|
|
|
|
|
+ style="display: none"
|
|
|
|
|
+ id="upload_file"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-button>
|
|
|
|
|
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -62,8 +70,18 @@
|
|
|
@selection-change="selectionChange"
|
|
@selection-change="selectionChange"
|
|
|
class="mt-5"
|
|
class="mt-5"
|
|
|
>
|
|
>
|
|
|
- <af-table-column align="center" prop="id" type="selection" />
|
|
|
|
|
- <af-table-column label="手机" align="center" prop="phoneNumber" />
|
|
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="id"
|
|
|
|
|
+ type="selection"
|
|
|
|
|
+ fixed="left"
|
|
|
|
|
+ />
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ label="手机"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="phoneNumber"
|
|
|
|
|
+ fixed="left"
|
|
|
|
|
+ />
|
|
|
<af-table-column label="积分" align="center" prop="integral" />
|
|
<af-table-column label="积分" align="center" prop="integral" />
|
|
|
<af-table-column
|
|
<af-table-column
|
|
|
label="电子卡类型"
|
|
label="电子卡类型"
|
|
@@ -72,7 +90,7 @@
|
|
|
width="160px"
|
|
width="160px"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{ translateCardToName(scope.row.cardType) }}
|
|
|
|
|
|
|
+ {{ translateCardToName(scope.row) }}
|
|
|
</template>
|
|
</template>
|
|
|
</af-table-column>
|
|
</af-table-column>
|
|
|
<af-table-column label="电子卡余额" align="center" prop="balance" />
|
|
<af-table-column label="电子卡余额" align="center" prop="balance" />
|
|
@@ -83,7 +101,7 @@
|
|
|
width="160px"
|
|
width="160px"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{ translateGradeToName(scope.row.memberGrade) }}
|
|
|
|
|
|
|
+ {{ translateGradeToName(scope.row) }}
|
|
|
</template>
|
|
</template>
|
|
|
</af-table-column>
|
|
</af-table-column>
|
|
|
<af-table-column label="等级操作" align="center">
|
|
<af-table-column label="等级操作" align="center">
|
|
@@ -102,7 +120,7 @@
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
|
- title="此操作会将选中用户强制列为无标签状态,是否继续?"
|
|
|
|
|
|
|
+ title="将用户强制列为无等级状态,是否继续?"
|
|
|
confirm-button-text="删除"
|
|
confirm-button-text="删除"
|
|
|
@onConfirm="toUnGrade(scope.row.phoneNumber)"
|
|
@onConfirm="toUnGrade(scope.row.phoneNumber)"
|
|
|
>
|
|
>
|
|
@@ -124,7 +142,7 @@
|
|
|
width="160px"
|
|
width="160px"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{ translateLabelToName(scope.row.labelId) }}
|
|
|
|
|
|
|
+ {{ translateLabelToName(scope.row) }}
|
|
|
</template>
|
|
</template>
|
|
|
</af-table-column>
|
|
</af-table-column>
|
|
|
<af-table-column label="标签操作" align="center">
|
|
<af-table-column label="标签操作" align="center">
|
|
@@ -143,7 +161,7 @@
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
|
- title="此操作会将选中用户强制列为无标签状态,是否继续?"
|
|
|
|
|
|
|
+ title="将用户强制列为无标签状态,是否继续?"
|
|
|
confirm-button-text="删除"
|
|
confirm-button-text="删除"
|
|
|
@onConfirm="toUnLabel(scope.row.phoneNumber)"
|
|
@onConfirm="toUnLabel(scope.row.phoneNumber)"
|
|
|
>
|
|
>
|
|
@@ -165,7 +183,7 @@
|
|
|
width="160px"
|
|
width="160px"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{ translateIssueToName(scope.row.couponIssueId) }}
|
|
|
|
|
|
|
+ {{ translateIssueToName(scope.row) }}
|
|
|
</template>
|
|
</template>
|
|
|
</af-table-column>
|
|
</af-table-column>
|
|
|
<af-table-column label="领取方式操作" align="center">
|
|
<af-table-column label="领取方式操作" align="center">
|
|
@@ -184,7 +202,7 @@
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
|
- title="此操作会将选中用户强制列为无标签状态,是否继续?"
|
|
|
|
|
|
|
+ title="将选中用户拉取领取方式,是否继续?"
|
|
|
confirm-button-text="删除"
|
|
confirm-button-text="删除"
|
|
|
@onConfirm="toUnIssue(scope.row.phoneNumber)"
|
|
@onConfirm="toUnIssue(scope.row.phoneNumber)"
|
|
|
>
|
|
>
|
|
@@ -199,6 +217,33 @@
|
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
|
</template>
|
|
</template>
|
|
|
</af-table-column>
|
|
</af-table-column>
|
|
|
|
|
+ <af-table-column label="操作" align="center" width="200px">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ class="underline btn24"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="upImport(scope.row)"
|
|
|
|
|
+ >修改</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ title="确认删除选中的记录?"
|
|
|
|
|
+ confirm-button-text="删除"
|
|
|
|
|
+ @onConfirm="delImport(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ class="underline btn24"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ slot="reference"
|
|
|
|
|
+ >删除</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-popconfirm>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </af-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<pagination
|
|
<pagination
|
|
|
v-show="total > 1"
|
|
v-show="total > 1"
|
|
@@ -236,6 +281,7 @@
|
|
|
width="600px"
|
|
width="600px"
|
|
|
append-to-body
|
|
append-to-body
|
|
|
status-icon
|
|
status-icon
|
|
|
|
|
+ @close="getList"
|
|
|
>
|
|
>
|
|
|
<div v-html="tipContent">
|
|
<div v-html="tipContent">
|
|
|
{{ tipContent }}
|
|
{{ tipContent }}
|
|
@@ -337,31 +383,111 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!--多条导入的弹窗-->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="由Excel导入的数据"
|
|
|
|
|
+ :visible.sync="tempImportDialog"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ status-icon
|
|
|
|
|
+ width="80vw"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table :data="tempImportList" class="mt-5" style="margin-bottom: 10px">
|
|
|
|
|
+ <af-table-column label="手机" align="center" prop="phoneNumber" />
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ label="积分"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="integral"
|
|
|
|
|
+ width="160px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ translateIntegralToInt(scope.row) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </af-table-column>
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ label="电子卡类型"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="memberGrade"
|
|
|
|
|
+ width="160px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ translateCardToName(scope.row) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </af-table-column>
|
|
|
|
|
+ <af-table-column label="电子卡余额" align="center" prop="balance" />
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ label="电子卡余额"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="balance"
|
|
|
|
|
+ width="160px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ translateBalanceToFloat(scope.row) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </af-table-column>
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ label="会员等级"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="memberGrade"
|
|
|
|
|
+ width="160px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ translateGradeToName(scope.row) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </af-table-column>
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ label="标签"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="labelId"
|
|
|
|
|
+ width="160px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ translateLabelToName(scope.row) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </af-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <af-table-column
|
|
|
|
|
+ label="优惠券领取方式"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="couponIssueId"
|
|
|
|
|
+ width="160px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{ translateIssueToName(scope.row) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </af-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitExcel">确 定</el-button>
|
|
|
|
|
+ <el-button @click="cancelExcel">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</PermissionContainer>
|
|
</PermissionContainer>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import {
|
|
|
|
|
- getLabelUser,
|
|
|
|
|
- // getLabelList,
|
|
|
|
|
- delUserLabel,
|
|
|
|
|
-} from "@/api/label/label";
|
|
|
|
|
-
|
|
|
|
|
|
|
+import excel from "@/utils/excel";
|
|
|
import {
|
|
import {
|
|
|
getIssueList,
|
|
getIssueList,
|
|
|
getGradeList,
|
|
getGradeList,
|
|
|
getLabelList,
|
|
getLabelList,
|
|
|
importExcel,
|
|
importExcel,
|
|
|
getImportList,
|
|
getImportList,
|
|
|
|
|
+ updateImportList,
|
|
|
|
|
+ delImportList,
|
|
|
|
|
+ upImport,
|
|
|
} from "@/api/preData";
|
|
} from "@/api/preData";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- name: "Dzk_Bill",
|
|
|
|
|
|
|
+ name: "PreData_DataEntry",
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
queryForm: {
|
|
queryForm: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
|
|
+ phoneNumber: "",
|
|
|
|
|
+ importFlag:"0"
|
|
|
},
|
|
},
|
|
|
tipOpen: false,
|
|
tipOpen: false,
|
|
|
tipContent: "",
|
|
tipContent: "",
|
|
@@ -369,9 +495,11 @@ export default {
|
|
|
open: false,
|
|
open: false,
|
|
|
// 总条数
|
|
// 总条数
|
|
|
total: 0,
|
|
total: 0,
|
|
|
- importList: [],
|
|
|
|
|
|
|
+ importList: [],
|
|
|
|
|
+ tempImportList: [],
|
|
|
selectedImport: [],
|
|
selectedImport: [],
|
|
|
confirmDialog: false,
|
|
confirmDialog: false,
|
|
|
|
|
+ tempImportDialog: false,
|
|
|
createForm: {
|
|
createForm: {
|
|
|
phoneNumber: "",
|
|
phoneNumber: "",
|
|
|
integral: 0,
|
|
integral: 0,
|
|
@@ -393,12 +521,11 @@ export default {
|
|
|
computed: {},
|
|
computed: {},
|
|
|
created() {
|
|
created() {
|
|
|
this.init();
|
|
this.init();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
init() {
|
|
init() {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
|
|
+
|
|
|
getIssueList()
|
|
getIssueList()
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -445,34 +572,61 @@ export default {
|
|
|
this.msgError("拉取等级列表失败~");
|
|
this.msgError("拉取等级列表失败~");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- translateIssueToName(id) {
|
|
|
|
|
|
|
+ translateIntegralToInt(row) {
|
|
|
|
|
+ const integral = parseInt(row.integral);
|
|
|
|
|
+ if (isNaN(integral)) {
|
|
|
|
|
+ row.integral = 0;
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.integral = integral;
|
|
|
|
|
+ return integral;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ translateBalanceToFloat(row) {
|
|
|
|
|
+ const balance = parseFloat(row.balance);
|
|
|
|
|
+ if (isNaN(balance)) {
|
|
|
|
|
+ row.balance = 0;
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.balance = balance;
|
|
|
|
|
+ return balance;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ translateIssueToName(row) {
|
|
|
|
|
+ const id = row.couponIssueId;
|
|
|
const issue = this.issueList.find((ele) => {
|
|
const issue = this.issueList.find((ele) => {
|
|
|
return ele.id == id;
|
|
return ele.id == id;
|
|
|
});
|
|
});
|
|
|
if (issue == undefined) {
|
|
if (issue == undefined) {
|
|
|
|
|
+ row.couponIssueId = undefined;
|
|
|
return "----";
|
|
return "----";
|
|
|
}
|
|
}
|
|
|
return issue.issueRemark;
|
|
return issue.issueRemark;
|
|
|
},
|
|
},
|
|
|
- translateGradeToName(id) {
|
|
|
|
|
|
|
+ translateGradeToName(row) {
|
|
|
|
|
+ const id = row.memberGrade;
|
|
|
const grade = this.gradeList.find((ele) => {
|
|
const grade = this.gradeList.find((ele) => {
|
|
|
return ele.id == id;
|
|
return ele.id == id;
|
|
|
});
|
|
});
|
|
|
if (grade == undefined) {
|
|
if (grade == undefined) {
|
|
|
|
|
+ row.memberGrade = undefined;
|
|
|
return "----";
|
|
return "----";
|
|
|
}
|
|
}
|
|
|
return grade.grade;
|
|
return grade.grade;
|
|
|
},
|
|
},
|
|
|
- translateLabelToName(id) {
|
|
|
|
|
|
|
+ translateLabelToName(row) {
|
|
|
|
|
+ const id = row.labelId;
|
|
|
const label = this.labelList.find((ele) => {
|
|
const label = this.labelList.find((ele) => {
|
|
|
return ele.id == id;
|
|
return ele.id == id;
|
|
|
});
|
|
});
|
|
|
if (label == undefined) {
|
|
if (label == undefined) {
|
|
|
|
|
+ row.labelId = undefined;
|
|
|
return "----";
|
|
return "----";
|
|
|
}
|
|
}
|
|
|
return label.labelName;
|
|
return label.labelName;
|
|
|
},
|
|
},
|
|
|
- translateCardToName(id) {
|
|
|
|
|
|
|
+ translateCardToName(row) {
|
|
|
|
|
+ const id = row.cardType;
|
|
|
const typeObj = {
|
|
const typeObj = {
|
|
|
1: "汽油卡",
|
|
1: "汽油卡",
|
|
|
2: "柴油卡",
|
|
2: "柴油卡",
|
|
@@ -482,6 +636,7 @@ export default {
|
|
|
|
|
|
|
|
const type = typeObj[id];
|
|
const type = typeObj[id];
|
|
|
if (type == undefined) {
|
|
if (type == undefined) {
|
|
|
|
|
+ row.cardType = "";
|
|
|
return "----";
|
|
return "----";
|
|
|
}
|
|
}
|
|
|
return type;
|
|
return type;
|
|
@@ -489,18 +644,32 @@ export default {
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
this.$refs["createForm"].validate((valid) => {
|
|
this.$refs["createForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- importExcel([this.createForm]).then((res) => {
|
|
|
|
|
- console.log("res111111111", res);
|
|
|
|
|
- this.tipOpen = true;
|
|
|
|
|
- this.tipContent = res.msg;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (!this.createForm.excelId) {
|
|
|
|
|
+ importExcel([this.createForm])
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.tipOpen = true;
|
|
|
|
|
+ this.tipContent = res.msg;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.msgError("导入失败,请刷新重试~");
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ upImport(this.createForm).then((res) => {
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
cancel() {
|
|
cancel() {
|
|
|
this.open = false;
|
|
this.open = false;
|
|
|
},
|
|
},
|
|
|
- batchAdd() {},
|
|
|
|
|
|
|
+ batchAdd() {
|
|
|
|
|
+ let upBut = document.getElementById("upload_file");
|
|
|
|
|
+ upBut.click();
|
|
|
|
|
+ },
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
this.title = "新增数据";
|
|
this.title = "新增数据";
|
|
|
this.createForm = {
|
|
this.createForm = {
|
|
@@ -514,12 +683,19 @@ export default {
|
|
|
};
|
|
};
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
handleSubmitLable() {
|
|
handleSubmitLable() {
|
|
|
- const subArr = [];
|
|
|
|
|
- console.log("拉入的type", this.handleType);
|
|
|
|
|
- console.log("拉入的id", this.tempId);
|
|
|
|
|
- console.log("拉入的人员", this.tempArr);
|
|
|
|
|
|
|
+ updateImportList({
|
|
|
|
|
+ type: this.handleType,
|
|
|
|
|
+ id: this.tempId,
|
|
|
|
|
+ phoneArr: this.tempArr,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((r) => {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.confirmDialog = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ this.msgError("操作失败,请刷新后重试~");
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
cancelSubmitLabel() {
|
|
cancelSubmitLabel() {
|
|
|
this.getList();
|
|
this.getList();
|
|
@@ -534,10 +710,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
return label.labelName;
|
|
return label.labelName;
|
|
|
},
|
|
},
|
|
|
- toUnGrade(phone) {
|
|
|
|
|
|
|
+ toUnGrade(phoneNumber) {
|
|
|
const delArr = [];
|
|
const delArr = [];
|
|
|
if (this.selectedImport.length == 0) {
|
|
if (this.selectedImport.length == 0) {
|
|
|
- delArr.push(phone);
|
|
|
|
|
|
|
+ delArr.push(phoneNumber);
|
|
|
} else {
|
|
} else {
|
|
|
this.selectedImport.map((ele) => {
|
|
this.selectedImport.map((ele) => {
|
|
|
if (!!ele.phoneNumber) {
|
|
if (!!ele.phoneNumber) {
|
|
@@ -545,20 +721,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- 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("删除用户标签状态失败,请刷新后重试~");
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ this.handleType = 0;
|
|
|
|
|
+ this.tempArr = delArr;
|
|
|
|
|
+ this.delHandle();
|
|
|
},
|
|
},
|
|
|
toUnLabel(phone) {
|
|
toUnLabel(phone) {
|
|
|
const delArr = [];
|
|
const delArr = [];
|
|
@@ -571,8 +736,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- console.log("删除的类型", 1);
|
|
|
|
|
- console.log("删除的人的手机号", delArr);
|
|
|
|
|
|
|
+ this.handleType = 1;
|
|
|
|
|
+ this.tempArr = delArr;
|
|
|
|
|
+ this.delHandle();
|
|
|
},
|
|
},
|
|
|
toUnIssue(phone) {
|
|
toUnIssue(phone) {
|
|
|
const delArr = [];
|
|
const delArr = [];
|
|
@@ -585,50 +751,80 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- console.log("删除的类型", 2);
|
|
|
|
|
- console.log("删除的人的手机号", delArr);
|
|
|
|
|
|
|
+ this.handleType = 2;
|
|
|
|
|
+ this.tempArr = delArr;
|
|
|
|
|
+ this.delHandle();
|
|
|
|
|
+ },
|
|
|
|
|
+ upImport(row) {
|
|
|
|
|
+ this.createForm = row;
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ delImport(row){
|
|
|
|
|
+ const delArr = [];
|
|
|
|
|
+ if (this.selectedImport.length == 0) {
|
|
|
|
|
+ delArr.push(row.excelId);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.selectedImport.map((ele) => {
|
|
|
|
|
+ if (!!ele.excelId) {
|
|
|
|
|
+ delArr.push(ele.excelId);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ delImportList(delArr).then(res=>{
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ this.msgSuccess("删除成功!")
|
|
|
|
|
+ }).catch(err=>{
|
|
|
|
|
+ this.msgError("删除失败,请刷新后重试~")
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ delHandle() {
|
|
|
|
|
+ updateImportList({
|
|
|
|
|
+ type: this.handleType,
|
|
|
|
|
+ phoneArr: this.tempArr,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((r) => {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.confirmDialog = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ this.msgError("操作失败,请刷新后重试~");
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
selectionChange(selection) {
|
|
selectionChange(selection) {
|
|
|
console.log("selectionChange", selection);
|
|
console.log("selectionChange", selection);
|
|
|
|
|
|
|
|
this.selectedImport = 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() {
|
|
getList() {
|
|
|
- getImportList()
|
|
|
|
|
|
|
+ getImportList(this.queryForm)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.rows == null) {
|
|
if (res.rows == null) {
|
|
|
this.importList = [];
|
|
this.importList = [];
|
|
|
|
|
+ this.total = 0;
|
|
|
} else {
|
|
} else {
|
|
|
this.importList = res.rows;
|
|
this.importList = res.rows;
|
|
|
|
|
+ this.total = res.total;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
this.msgError("拉取导入的数据列表失败");
|
|
this.msgError("拉取导入的数据列表失败");
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- /** 搜索按钮操作 */
|
|
|
|
|
|
|
+ submitExcel() {
|
|
|
|
|
+ importExcel(this.tempImportList)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.tempImportDialog = false;
|
|
|
|
|
+ this.tipOpen = true;
|
|
|
|
|
+ this.tipContent = res.msg;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.tempImportDialog = false;
|
|
|
|
|
+ this.msgError("导入失败,请刷新后重试");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ cancelExcel() {
|
|
|
|
|
+ this.tempImportDialog = false;
|
|
|
|
|
+ },
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
this.queryForm.pageNum = 1;
|
|
this.queryForm.pageNum = 1;
|
|
|
this.getList();
|
|
this.getList();
|
|
@@ -710,6 +906,49 @@ export default {
|
|
|
|
|
|
|
|
this.confirmDialog = true;
|
|
this.confirmDialog = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ handleUpload(e) {
|
|
|
|
|
+ const files = e.target.files;
|
|
|
|
|
+ let file = files[0];
|
|
|
|
|
+ if(!file){
|
|
|
|
|
+ document.getElementById("upload_file").value = null;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const fileExt = file.name.split(".").pop().toLocaleLowerCase();
|
|
|
|
|
+ if (fileExt === "xlsx" || fileExt === "xls") {
|
|
|
|
|
+ document.getElementById("upload_file").value = null;
|
|
|
|
|
+ this.readFile(file);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.msgError("请选择后缀为.xlsx或者.xls的EXCEL文件");
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ },
|
|
|
|
|
+ readFile(file) {
|
|
|
|
|
+ const reader = new FileReader();
|
|
|
|
|
+ reader.readAsArrayBuffer(file);
|
|
|
|
|
+ reader.onloadstart = (e) => {
|
|
|
|
|
+ console.log("onloadstart");
|
|
|
|
|
+ };
|
|
|
|
|
+ reader.onprogress = (e) => {
|
|
|
|
|
+ console.log("onprogress");
|
|
|
|
|
+ this.progressPercent = Math.round((e.loaded / e.total) * 100);
|
|
|
|
|
+ };
|
|
|
|
|
+ reader.onerror = (e) => {
|
|
|
|
|
+ this.msgError("文件读取出错");
|
|
|
|
|
+ };
|
|
|
|
|
+ reader.onload = (e) => {
|
|
|
|
|
+ console.log("onload");
|
|
|
|
|
+ const data = e.target.result;
|
|
|
|
|
+ const { header, results } = excel.read(data, "array");
|
|
|
|
|
+ //验证excel导入的有效性
|
|
|
|
|
+ if (!header.includes("phoneNumber")) {
|
|
|
|
|
+ this.msgError("请使用官方Excel模板导入数据");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.tempImportList = results;
|
|
|
|
|
+ this.tempImportDialog = true;
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|