From 9a525cb128b3b60eadae72f8ba589fa74acdad0a Mon Sep 17 00:00:00 2001 From: "wangxubin@yeah.net" Date: Wed, 31 Aug 2022 09:24:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=85=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 6 +-- src/api/eashier.js | 8 ++++ .../eashier/collectionList/collectionList.vue | 37 ++++++++++++++++++- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/config/index.js b/config/index.js index 5367816..9e5d49a 100644 --- a/config/index.js +++ b/config/index.js @@ -26,7 +26,7 @@ module.exports = { assetsPublicPath: "/", proxyTable: { "/api": { - //target: "http://192.168.31.209:8084/", //设置你调用的接口域名和端口号 别忘了加http 本地 + target: "http://192.168.31.127:8084/", //设置你调用的接口域名和端口号 别忘了加http 本地 // target: "http://192.168.31.201:8084/", //设置你调用的接口域名和端口号 别忘了加http 本地 // target: "http://139.9.185.131:8098/", //设置你调用的接口域名和端口号 别忘了加http 天懿达正式 // target: "http://139.9.58.205:8084/", //设置你调用的接口域名和端口号 别忘了加http 天懿达正式华为云 @@ -34,7 +34,7 @@ module.exports = { // target: "http://139.9.185.131:8084/", //设置你调用的接口域名和端口号 别忘了加http 天懿达正式 // target: "http://192.168.31.209:8084/", //设置你调用的接口域名和端口号 别忘了加http 天懿达线上 - target: "https://www.decaisoft.com/preferential", //设置你调用的接口域名和端口号 别忘了加http 天懿达线上 + // target: "https://www.decaisoft.com/preferential", //设置你调用的接口域名和端口号 别忘了加http 天懿达线上 // target: 'http://124.71.99.140:8084/', //设置你调用的接口域名和端口号 别忘了加http 线上 // target: 'http://124.71.99.140:8081/', //设置你调用的接口域名和端口号 别忘了加http 测试 // target: 'https://www.decaisoft.com:8088/', //设置你调用的接口域名和端口号 别忘了加http 测试 @@ -46,7 +46,7 @@ module.exports = { } }, // Various Dev Server settingsss - host: "192.168.31.35", // can be overwritten by process.env.HOST + host: "192.168.31.194", // can be overwritten by process.env.HOST port: 3000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, diff --git a/src/api/eashier.js b/src/api/eashier.js index 007871f..3b617a7 100644 --- a/src/api/eashier.js +++ b/src/api/eashier.js @@ -1,6 +1,14 @@ import { service } from "../utils/service"; import { localPath } from "./api.js"; +export function succsee() { + return service({ + url: "/api" + "/demay/ssm/cash/success", + method: "get", + + }); +} + // 门店明细查询 平台端-门店管理-门店审核-门店明细查询 export function storeOne(params) { return service({ diff --git a/src/pages/eashier/collectionList/collectionList.vue b/src/pages/eashier/collectionList/collectionList.vue index 2695d4b..9768dfa 100644 --- a/src/pages/eashier/collectionList/collectionList.vue +++ b/src/pages/eashier/collectionList/collectionList.vue @@ -36,8 +36,8 @@
标准 - - + +
@@ -379,6 +379,7 @@ import { recAccountList, recTypeOne, selectOne, + succsee, } from "@/api/eashier.js"; import addmember from "@/components/member/edit/index"; import admin from "@/components/staffList/admin/index"; @@ -387,6 +388,7 @@ import staffsles from "@/components/staffList/staff/index"; import member from "@/components/member/index"; import selec from "@/components/store/select/index"; import Template from "../../discount-coupon/issue/components/template.vue"; + export default { components: { member, @@ -491,6 +493,8 @@ export default { }; }, methods: { + + close() { this.listDialogVisible = false; }, @@ -564,6 +568,19 @@ export default { if (v != 0) { this.getRecList(); } + + if(this.sessionStorageData.recDebt&&this.debtMoneys){ + this.$alert("存在欠款不允许升降级", "提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => {}, + }); + this.liftType=0 + } + + }, openRec(number) { console.log(number); @@ -729,7 +746,22 @@ export default { //打开选择会员弹窗 openMember() { this.$refs.member.show(this.vip); + succsee().then((res) => { + if (res.code == "000000") { + this.$alert(res.message, "提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "info", + center: true, + callback: (action) => {}, + }); + } else { + + } + }); }, + + //选中会员返回方法 memberData(v) { this.form.mobilePhone = v.mobilePhone; @@ -910,6 +942,7 @@ export default { }, openAddMember() { this.$refs.addmember.show("添加"); + console.log("a") }, memberAdd(v) { this.form.mobilePhone = v.mobilePhone; From 84cee98de528868ad3989fe0f82a1b0e34e7bf4e Mon Sep 17 00:00:00 2001 From: "wangxubin@yeah.net" Date: Thu, 1 Sep 2022 16:21:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=85=E5=80=BC=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E4=B8=8E=E5=85=85=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/recharge/type/index.vue | 187 +++++- .../eashier/collectionList/collectionList.vue | 9 +- src/pages/eashier/service/service.vue | 3 +- .../statistics/storeDaily/storeDaily.vue | 30 +- .../storeManage/rechargeType/rechargeType.vue | 547 ++++++++++++++---- 5 files changed, 616 insertions(+), 160 deletions(-) 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 @@ @@ -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 @@ - +
- +
- 启用中 - 已停用 + 启用中 + 已停用
- 取 消 - 确 定 + 取 消 + 确 定
- + 以下导入 充值名称 存在重复 , 请检查修改后重新导入 - + - + - - + + - + - + - + - + - + - 关 闭 + 关 闭 - @@ -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; - }, - }, + } + } };