diff --git a/src/components/recharge/type/index.vue b/src/components/recharge/type/index.vue
index ee61f8b..9ae5351 100644
--- a/src/components/recharge/type/index.vue
+++ b/src/components/recharge/type/index.vue
@@ -1,42 +1,133 @@
-
-
+
+
-
+
{{ "" }}
-
-
-
+
+
+
- {{scope.row.type==0?'赠送卡':scope.row.type==1?'折扣卡':'活动卡'}}
+ {{
+ scope.row.type == 0
+ ? "赠送卡"
+ : scope.row.type == 1
+ ? "折扣卡"
+ : "活动卡"
+ }}
-
- {{scope.row.firstAmount?scope.row.firstAmount:'无首充'}}
+
+ {{
+ scope.row.firstAmount ? scope.row.firstAmount : "无首充"
+ }}
-
-
-
+
+
+
- 固
- 比
- {{scope.row.giftMoney}}
- %
+ 固
+ 比
+ {{ scope.row.giftMoney }}
+ %
-
- {{scope.row.discountFreeAmount?scope.row.discountFreeAmount:'无折扣'}}
+
+ {{
+ scope.row.discountFreeAmount ? scope.row.discountFreeAmount : "无折扣"
+ }}
-
-
+
+
@@ -55,6 +146,7 @@ export default {
listLoading: false, //list加载提示开启动画
selectNumber: null, //充值类别类型0 赠送卡 1 折扣卡 2活动卡
selcetList: [], //已经选择的充值类别列表
+ format: "YYYY-MM-DD hh:mm:ss"
};
},
methods: {
@@ -84,26 +176,60 @@ export default {
this.listLoading = true;
let form = {
id: "",
- storeId: sessionStorage.getItem("parentId"),
+ storeId: sessionStorage.getItem("parentId")
};
if (this.selectNumber != null) {
form.type = this.selectNumber;
}
- recTypeList(form).then((res) => {
+ recTypeList(form).then(res => {
this.listLoading = false;
if (res.code === "000000") {
if (this.selcetList.length == 0) {
this.list = res.rows;
+ console.log(
+ "🚀 ~ file: index.vue ~ line 108 ~ recTypeList ~ this.list",
+ this.list
+ );
+
+ var date = new Date();
+ var obj = {
+ YYYY: date.getFullYear(),
+ MM: date.getMonth() + 1,
+ DD: date.getDate(),
+ hh: date.getHours(),
+ mm: date.getMinutes(),
+ ss: date.getSeconds()
+ };
+
+ // 定义改变后的格式
+ for (var x in obj) {
+ // 遍历对象 x为key
+ if (obj[x] < 10) {
+ // 当获取的值小于10 加一个0在前面
+ obj[x] = "0" + obj[x];
+ }
+ this.format = this.format.replace([x], obj[x]);
+ // x 为键 replace[x]值,replace[x]替换成obj[x]
+ }
+
+ console.log(this.format);
+
+ this.list.forEach((item, index) => {
+ if (item.unifiedDue < this.format) {
+ this.list.splice(index, 1);
+ }
+ });
} else {
var list = [];
- this.selcetList.forEach((item) => {
- res.rows.forEach((items) => {
+ this.selcetList.forEach(item => {
+ res.rows.forEach(items => {
if (item.newRechargeTypeId == items.id) {
list.push(items);
}
});
});
this.list = list;
+
}
} else {
this.$alert("查询充值列表 : " + res.message, "提示", {
@@ -111,7 +237,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
- callback: (action) => {},
+ callback: action => {}
});
}
});
@@ -120,10 +246,9 @@ export default {
confirms() {
this.$emit("recTypeData", this.radioForm);
this.dialogVisible = false;
- },
- },
+ }
+ }
};
-
+
diff --git a/src/pages/eashier/collectionList/collectionList.vue b/src/pages/eashier/collectionList/collectionList.vue
index 9768dfa..73d5fc1 100644
--- a/src/pages/eashier/collectionList/collectionList.vue
+++ b/src/pages/eashier/collectionList/collectionList.vue
@@ -568,7 +568,10 @@ export default {
if (v != 0) {
this.getRecList();
}
-
+ if(this.form.rechargeTypeName){
+ this.form.rechargeTypeName=""
+ }
+
if(this.sessionStorageData.recDebt&&this.debtMoneys){
this.$alert("存在欠款不允许升降级", "提示", {
confirmButtonText: "确定",
@@ -741,6 +744,8 @@ export default {
let form = { ...this.form };
this.form = {};
this.form = form;
+ // console.log("🚀 ~ file: collectionList.vue ~ line 747 ~ recAccountOne ~ this.form", this.form)
+
});
},
//打开选择会员弹窗
@@ -1187,6 +1192,7 @@ export default {
}
});
} else {
+
upgrade(this.form).then((res) => {
this.saveloading = false;
if (res.code == "000000") {
@@ -1366,6 +1372,7 @@ export default {
if (this.form.memberId) {
recAccountList({
memberId: this.form.memberId,
+
}).then((res) => {
if (res.code == "000000") {
this.recList = res.rows;
diff --git a/src/pages/eashier/service/service.vue b/src/pages/eashier/service/service.vue
index 3174a44..5aa3ff6 100644
--- a/src/pages/eashier/service/service.vue
+++ b/src/pages/eashier/service/service.vue
@@ -504,9 +504,8 @@ export default {
} else {
if (this.recForm.noDiscount == 0) {
// 可以打折
-
form.discoutMoney =
- ((form.spendMoney * form.discount) / 100).toFixed(2) * 1;
+ (form.spendMoney /( form.discount / 100)).toFixed(2) * 1;
} else {
不可以打折
form.discoutMoney = form.spendMoney;
diff --git a/src/pages/statistics/storeDaily/storeDaily.vue b/src/pages/statistics/storeDaily/storeDaily.vue
index 060176c..6b2b7bd 100644
--- a/src/pages/statistics/storeDaily/storeDaily.vue
+++ b/src/pages/statistics/storeDaily/storeDaily.vue
@@ -18,23 +18,23 @@
- {{scope.row.rechargeNum?scope.row.rechargeNum:'--'}}
+ {{scope.row.rechargeNum?scope.row.rechargeNum:'0'}}
- {{scope.row.courseOrderNum?scope.row.courseOrderNum:'--'}}
+ {{scope.row.courseOrderNum?scope.row.courseOrderNum:'0'}}
- {{scope.row.cashPeopleNum?scope.row.cashPeopleNum:'--'}}
+ {{scope.row.cashPeopleNum?scope.row.cashPeopleNum:'0'}}
- {{scope.row.rechargeMoney?scope.row.rechargeMoney:'--'}}
+ {{scope.row.rechargeMoney?scope.row.rechargeMoney:'0'}}
- {{scope.row.courseMoney?scope.row.courseMoney:'--'}}
+ {{scope.row.courseMoney?scope.row.courseMoney:'0'}}
-
+
-
+
- 启用中
- 已停用
+ 启用中
+ 已停用
-
+
以下导入 充值名称 存在重复 , 请检查修改后重新导入
-
+
-
+
{{
scope.row.type == 1 ? "折扣卡" : "赠送卡"
}}
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
@@ -143,13 +421,14 @@ import {
recTypeStates,
recTypeDownload,
recTypeImport,
- recTypeExport,
+ recTypeExport
} from "@/api/storeManage.js";
+import { date } from "../../../../partten/partten";
export default {
components: {
excel,
edit,
- detail,
+ detail
},
data() {
return {
@@ -161,7 +440,7 @@ export default {
searchForm: {
//搜索表单
rechargeTypeName: "",
- state: 1,
+ state: 1
},
sessionStorageData: {}, //门店参数集合
input: "", //当前页面搜索输入值
@@ -169,9 +448,10 @@ export default {
pageNum: 1,
pageInfo: {
total: 0, //分页总条数
- tableList: [],
+ tableList: []
},
infoDialog: false, //上传文件弹窗开关
+ format: "YYYY-MM-DD hh:mm:ss"
};
},
methods: {
@@ -183,7 +463,7 @@ export default {
detailData(v) {},
//下载模板方法
download() {
- recTypeDownload().then((res) => {
+ recTypeDownload().then(res => {
let blob = new Blob([res]);
console.log(blob);
var a = document.createElement("a");
@@ -201,7 +481,7 @@ export default {
if (this.searchForm.rechargeTypeName == "") {
delete this.searchForm.rechargeTypeName;
}
- recTypeExport(this.searchForm).then((res) => {
+ recTypeExport(this.searchForm).then(res => {
let blob = new Blob([res]);
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
@@ -221,18 +501,18 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
- callback: (action) => {},
+ callback: action => {}
});
} else {
fileData.append("multipartFile", v);
- recTypeImport(fileData).then((res) => {
+ recTypeImport(fileData).then(res => {
if (res.rows != undefined) {
this.infoList = res.rows;
this.infoErrorDialog = true;
} else {
if (res.code == "000000") {
this.$message.success({
- message: res.message,
+ message: res.message
});
this.getData();
} else {
@@ -241,7 +521,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
- callback: (action) => {},
+ callback: action => {}
});
}
}
@@ -256,14 +536,14 @@ export default {
search() {
//条件搜索
this.searchForm.storeId = sessionStorage.getItem("parentId");
- recTypePage(this.searchForm).then((res) => {
+ recTypePage(this.searchForm).then(res => {
if (res.code == "000000") {
this.searchTrue = true;
res.pageInfo.tableList = res.pageInfo.list;
this.pageInfo = res.pageInfo;
if (res.pageInfo.total == 0) {
this.$message.warning({
- message: "没有找到符合条件的充值类别",
+ message: "没有找到符合条件的充值类别"
});
}
} else {
@@ -272,7 +552,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
- callback: (action) => {},
+ callback: action => {}
});
}
});
@@ -290,13 +570,13 @@ export default {
cancelButtonText: "取消",
type: "warning",
cancelButtonClass: "cancelbtnFalses",
- confirmButtonClass: "confirmbtnFalses",
+ confirmButtonClass: "confirmbtnFalses"
})
.then(() => {
var id = {
- id: row.id,
+ id: row.id
};
- delrecType(id).then((res) => {
+ delrecType(id).then(res => {
//console.log(res);
if (res.code == "000000") {
if (this.pageInfo.total % this.pageSize == 1) {
@@ -304,7 +584,7 @@ export default {
}
this.getData();
this.$message.success({
- message: "删除成功!",
+ message: "删除成功!"
});
} else {
this.$alert(res.message, "提示", {
@@ -312,18 +592,18 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
- callback: (action) => {},
+ callback: action => {}
});
}
});
})
.catch(() => {
this.$message.info({
- message: "已取消操作!",
+ message: "已取消操作!"
});
});
},
- //添加/修改
+ //添加/修改this.getData
edit(form) {
if (form == "添加") {
this.$refs.edit.show("添加");
@@ -343,27 +623,43 @@ export default {
state(row) {
var state = {
id: row.id,
- state: row.state,
+ state: row.state
};
- recTypeStates(state)
- .then((res) => {
- //console.log(res);
- this.getData();
- if (res.code == "000000") {
- if (row.state == 1) {
- this.$message.success({
- message: "状态启用!",
- });
- } else {
- this.$message.success({
- message: "状态停用!",
- });
- }
+
+ if (row.unifiedDue < this.format) {
+ this.$alert(
+ "过期时间小于当前时间,请修改过期时间,再进行启用操作",
+ "提示",
+ {
+ confirmButtonText: "确定",
+ confirmButtonClass: "confirmbtnFalses",
+ type: "warning",
+ center: true,
+ callback: action => {}
}
- })
- .catch((err) => {
- //console.log(err);
- });
+ );
+ row.state = 0;
+ } else {
+ recTypeStates(state)
+ .then(res => {
+ //console.log(res);
+ this.getData();
+ if (res.code == "000000") {
+ if (row.state == 1) {
+ this.$message.success({
+ message: "状态启用!"
+ });
+ } else {
+ this.$message.success({
+ message: "状态停用!"
+ });
+ }
+ }
+ })
+ .catch(err => {
+ //console.log(err);
+ });
+ }
},
//分页方法
handleSizeChange(val) {
@@ -387,24 +683,49 @@ export default {
var page = {
pageSize: this.pageSize,
pageNum: this.pageNum,
- storeId: sessionStorage.getItem("parentId"),
+ storeId: sessionStorage.getItem("parentId")
};
- recTypePage(page)
- .then((res) => {
- if (this.refreshtext == true) {
- this.$message.success({
- message: "已刷新最新数据",
- });
- this.refreshtext = false;
- this.searchTrue = false;
+ recTypePage(page).then(res => {
+ if (this.refreshtext == true) {
+ this.$message.success({
+ message: "已刷新最新数据"
+ });
+ this.refreshtext = false;
+ this.searchTrue = false;
+ }
+ var date = new Date();
+ var obj = {
+ YYYY: date.getFullYear(),
+ MM: date.getMonth() + 1,
+ DD: date.getDate(),
+ hh: date.getHours(),
+ mm: date.getMinutes(),
+ ss: date.getSeconds()
+ };
+
+ // 定义改变后的格式
+ for (var x in obj) {
+ // 遍历对象 x为key
+ if (obj[x] < 10) {
+ // 当获取的值小于10 加一个0在前面
+ obj[x] = "0" + obj[x];
+ }
+ this.format = this.format.replace([x], obj[x]);
+ // x 为键 replace[x]值,replace[x]替换成obj[x]
+ }
+
+ console.log(this.format);
+
+ res.pageInfo.list.forEach(item => {
+ if (item.unifiedDue < this.format) {
+ item.state = 0;
}
- res.pageInfo.tableList = res.pageInfo.list;
- this.pageInfo = res.pageInfo;
- })
- .catch((err) => {
- //console.log(err);
});
- },
+
+ res.pageInfo.tableList = res.pageInfo.list;
+ this.pageInfo = res.pageInfo;
+ });
+ }
},
created() {
this.headOffice =
@@ -414,7 +735,7 @@ export default {
this.sessionStorageData = JSON.parse(
sessionStorage.getItem("sessionStorageData")
);
- list.forEach((item) => {
+ list.forEach(item => {
if (item.id == 4006001) {
this.getData();
}
@@ -425,15 +746,19 @@ export default {
tableData() {
var search = this.input.toString().toLowerCase(); //将用户输入的值变字符串并小写
if (search) {
- return this.pageInfo.tableList.filter(function (dataNews) {
- return Object.keys(dataNews).some(function (key) {
- return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
+ return this.pageInfo.tableList.filter(function(dataNews) {
+ return Object.keys(dataNews).some(function(key) {
+ return (
+ String(dataNews[key])
+ .toLowerCase()
+ .indexOf(search) > -1
+ );
});
});
}
return this.pageInfo.tableList;
- },
- },
+ }
+ }
};