From f6eaa90f9d8a802882d924fead98e38178eb5f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Fri, 7 Jun 2024 10:04:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8C=85=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bl/massage/massagePackage.vue | 988 +++++++++++++++++++++++- 1 file changed, 976 insertions(+), 12 deletions(-) diff --git a/src/views/bl/massage/massagePackage.vue b/src/views/bl/massage/massagePackage.vue index 2f4c0b5..e6bd354 100644 --- a/src/views/bl/massage/massagePackage.vue +++ b/src/views/bl/massage/massagePackage.vue @@ -11,7 +11,7 @@ v-for="item in typeDictData" :key="item.id" :label="item.value" - :value="item.code"> + :value="item.id">    @@ -180,6 +180,13 @@ @@ -549,7 +1006,6 @@ export default { labels: "",//标签 city: "",//城市 createTime: "",//创建时间 - size: 10, page: 1, limit: 10, dialogFormVisibleSales: false, @@ -567,11 +1023,39 @@ export default { packageImgPercentage:0,//封面图片上传进度 contentImgPercentage:0,//详情图片上传进度 quillOption: quillConfig, + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>服务项目>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + fwData: [], + dialogFormVisibleDetail:false, + detailTableDataLoading: false, + detailTableData: {}, + mainId: "",//主表ID + massageTypeId: "",//按摩类型ID + serviceCount: 1, + intervalDays: 0, + detailPage: 1, + detailLimit: 10, + massageImg:"", + isSex: "",//是否限制性别 + applyPeople: "",//适用人群 + duration: "",//时长 + jianjie: "",//简介 + dialogFormVisibleCount: false, + dialogFormVisibleIntervalDays: false, + dialogFormVisibleAddMassage: false, + dialogFormVisibleMassageList: false, + massageTableDataLoading: false, + massageData: {}, + massageType: "", + massageTitle: "", + massagePage: 1, + massageLimit: 10, + massageImgPercentage:0,//封面图片上传进度 + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<服务项目<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< }; }, methods: { showDictValue(data, datas){ - const dictItem = datas.find(item => data === item.code); + const dictItem = datas.find(item => data === item.id); return dictItem ? dictItem.value : ''; }, // 服务包类型 @@ -586,7 +1070,19 @@ export default { this.typeDictData = data.data; }); }, - + // 项目类型 + fwSelect() { + this.$http({ + url: this.$http.adornUrl("sys/dict/selectDictList"), + method: "get", + params: this.$http.adornParams({ + type: "服务类型", + }), + }).then(({ data }) => { + let returnData = data.data; + this.fwData = returnData; + }); + }, // 获取服务包列表数据 handleSelect() { this.tableDataLoading = true; @@ -604,7 +1100,6 @@ export default { }), }).then(({data}) => { if (data.code == 0) { - this.tableDataLoading = false; let returnData = data.data; this.tableData = returnData; for (var i in this.tableData.list) { @@ -621,6 +1116,7 @@ export default { type: "warning", }); } + this.tableDataLoading = false; }); }, // 重置 @@ -759,7 +1255,7 @@ export default { url: this.$http.adornUrl("massage/package/delete"), method: "post", params: this.$http.adornParams({ - // data: this.$http.adornData({ + // data: this.$http.adornData({ id: row.id, }), }).then(({data}) => { @@ -828,7 +1324,6 @@ export default { }, // 添加服务包 handleEdit(row) { - console.log("row", row); if (row != 0) { this.titles = "修改服务包"; this.id = row.id; @@ -880,7 +1375,7 @@ export default { this.dialogFormVisible = true; }, - // 提交修改、添加项目项目 + // 提交添加、修改服务包 handleSubmit() { if (this.type == "") { this.$notify({ @@ -1032,7 +1527,6 @@ export default { this.labels= "";//标签 this.city= "";//城市 this.createTime= "";//创建时间 - this.size= 10; this.page= 1; this.limit= 10; this.dialogFormVisibleSales= false; @@ -1046,11 +1540,481 @@ export default { this.storeAddress= []; this.storeAddre= "请选择城市"; this.province= ""; //省 - } + }, +//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>服务项目>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + showDetailView(row){ + this.mainId = row.id; + this.handleSelectDetail(); + this.dialogFormVisibleDetail = true; + }, + + handleSelectDetail(){ + this.detailTableDataLoading = true; + this.$http({ + url: this.$http.adornUrl("massage/packageDetail/findPage"), + method: "get", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + page: this.detailPage, + limit: this.detailLimit, + mainId: this.mainId, + }), + }).then(({data}) => { + if (data.code == 0) { + let returnData = data.data; + this.detailTableData = returnData; + } else { + this.$notify({ + title: "提示", + duration: 1800, + message: data.msg, + type: "warning", + }); + } + this.detailTableDataLoading = false; + }); + }, + + //分页 + handleDetailSizeChange(val) { + this.detailLimit = val; + this.handleSelectDetail(); + }, + + //翻页 + handleDetailCurrentChange(val) { + this.detailPage = val; + this.handleSelectDetail(); + }, + + changeDetailStatus(massageTypeId, status){ + this.$http({ + url: this.$http.adornUrl(`massage/packageDetail/updateStatus`), + method: "post", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + massageTypeId: massageTypeId, + status: status, + }), + }).then(({data}) => { + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.handleSelect(); + }, + }); + }); + }, + + // 修改次数 + showUpdateCountView(row) { + this.id = row.id; + this.serviceCount = row.serviceCount; + this.dialogFormVisibleCount = true; + }, + + // 修改次数 + updateCount() { + this.$http({ + url: this.$http.adornUrl("massage/packageDetail/updateCount"), + method: "post", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + id: this.id, + serviceCount: this.serviceCount, + }), + }).then(({data}) => { + if (data.code == 0) { + this.$message({ + message: "修改成功", + type: "success", + duration: 1500, + onClose: () => { + this.handleSelectDetail(); + }, + }); + this.dialogFormVisibleCount = false; + } else { + this.$message({ + message: data.msg, + type: "warning", + duration: 1500, + onClose: () => { + }, + }); + } + }); + }, + + // 修改间隔 + showUpdateDaysView(row) { + this.id = row.id; + this.intervalDays = row.intervalDays; + this.dialogFormVisibleIntervalDays = true; + }, + + // 修改间隔 + updateIntervalDays() { + this.$http({ + url: this.$http.adornUrl("massage/packageDetail/updateIntervalDays"), + method: "post", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + id: this.id, + intervalDays: this.intervalDays, + }), + }).then(({data}) => { + if (data.code == 0) { + this.$message({ + message: "修改成功", + type: "success", + duration: 1500, + onClose: () => { + this.handleSelectDetail(); + }, + }); + this.dialogFormVisibleIntervalDays = false; + } else { + this.$message({ + message: data.msg, + type: "warning", + duration: 1500, + onClose: () => { + }, + }); + } + }); + }, + + handleDeleteDetail(row){ + this.$confirm(`确定删除此条信息?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$http({ + url: this.$http.adornUrl("massage/packageDetail/delete"), + method: "post", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + id: row.id, + }), + }).then(({data}) => { + if (data.code == 0) { + this.$message({ + message: "删除成功", + type: "success", + duration: 1500, + onClose: () => { + this.handleSelectDetail(); + }, + }); + } else { + this.$message({ + message: data.msg, + type: "warning", + duration: 1500, + onClose: () => { + }, + }); + } + }); + }) + .catch(() => { + }); + }, + + //封面图片上传 + handleMassageImgSuccess(file) { + this.massageImg = file.data; + }, + //封面图片上传 + onMassageImgProgress(event, file, fileList) { + this.massageImgPercentage = parseInt(event.percent); + }, + + handleAddMassage(){ + this.title = ""; + this.status = 1; + this.sales = "0"; + this.price = ""; + this.oldPrice = ""; + this.massageTypeId = ""; + this.massageImg = ""; + this.isSex = 0; + this.duration = ""; + this.applyPeople = ""; + this.contentImg = []; + this.content = ""; + this.city = ""; + this.labelsArr = []; + this.storeAddre = "请选择城市"; + this.type = ""; + this.jianjie = ""; + this.serviceCount = 1; + this.intervalDays = 0; + this.dialogFormVisibleAddMassage = true; + }, + + //提交新增服务项目 + handleAddMassageSubmit(){ + if (this.type == "") { + this.$notify({ + title: "提示", + duration: 1800, + message: "请选择项目类型", + type: "warning", + }); + return; + } + if (this.title == "") { + this.$notify({ + title: "提示", + duration: 1800, + message: "请输入项目名称", + type: "warning", + }); + return; + } + if (this.massageImg == "") { + this.$notify({ + title: "提示", + duration: 1800, + message: "请上传项目图片", + type: "warning", + }); + return; + } + if (this.contentImg.length == 0) { + this.$notify({ + title: '提示', + duration: 1800, + message: '请上传项目详情图片', + type: 'warning' + }) + return + } + if (this.duration == "") { + this.$notify({ + title: "提示", + duration: 1800, + message: "请输入时长", + type: "warning", + }); + return; + } + if (this.isSex === '') { + this.$notify({ + title: '提示', + duration: 1800, + message: '请选择性别要求', + type: 'warning' + }) + return + } + if (this.oldPrice == "") { + this.$notify({ + title: "提示", + duration: 1800, + message: "请输入原价", + type: "warning", + }); + return; + } + if (this.price == "") { + this.$notify({ + title: "提示", + duration: 1800, + message: "请输入现价", + type: "warning", + }); + return; + } + if (this.status === "") { + this.$notify({ + title: "提示", + duration: 1800, + message: "请选择状态", + type: "warning", + }); + return; + } + this.$http({ + url: this.$http.adornUrl("massage/packageDetail/insertDetail"), + method: "post", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + title: this.title, + status: this.status, + sales: this.sales, + price: this.price, + oldPrice: this.oldPrice, + massageImg: this.massageImg, + isSex: this.isSex, + applyPeople: this.applyPeople, + duration: this.duration, + contentImg: this.contentImg.toString(), + content: this.content, + city: this.city, + labels: this.labelsArr.toString(), + type: this.type, + jianjie: this.jianjie, + mainId: this.mainId, + serviceCount: this.serviceCount, + intervalDays: this.intervalDays, + }), + }).then(({ data }) => { + if (data.code == 0) { + this.dialogFormVisibleAddMassage = false; + this.clearMassageDatas(); + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.handleSelectDetail(); + }, + }); + } else { + this.$message({ + message: data.msg, + type: "warning", + duration: 1500, + onClose: () => {}, + }); + } + }); + }, + + handleAddToDetail(row){ + this.$http({ + url: this.$http.adornUrl("massage/packageDetail/add"), + method: "post", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + mainId: this.mainId, + massageTypeId: row.massageTypeId, + serviceCount: this.serviceCount, + intervalDays: this.intervalDays, + }), + }).then(({ data }) => { + if (data.code == 0) { + this.dialogFormVisibleMassageList = false; + this.clearMassageDatas(); + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.handleSelectDetail(); + }, + }); + } else { + this.$message({ + message: data.msg, + type: "warning", + duration: 1500, + onClose: () => {}, + }); + } + }); + }, + + showMassageView(){ + + this.serviceCount = 1; + this.intervalDays = 0; + this.handleSelectMassage(); + this.dialogFormVisibleMassageList = true; + }, + + handleSelectMassage(){ + this.massageTableDataLoading = true; + this.$http({ + url: this.$http.adornUrl("massage/packageDetail/findMassagePage"), + method: "get", + params: this.$http.adornParams({ + // data: this.$http.adornData({ + page: this.massagePage, + limit: this.massageLimit, + title: this.massageTitle, + type: this.massageType, + }), + }).then(({data}) => { + if (data.code == 0) { + let returnData = data.data; + this.massageData = returnData; + } else { + this.$notify({ + title: "提示", + duration: 1800, + message: data.msg, + type: "warning", + }); + } + this.massageTableDataLoading = false; + }); + }, + + // 重置 + handleClearMassage() { + this.massageType = ""; + this.massageTitle = ""; + this.massagePage = 1; + this.handleSelectMassage(); + }, + + //分页 + handleMassageSizeChange(val) { + this.massageLimit = val; + this.handleSelectMassage(); + }, + + //翻页 + handleMassageCurrentChange(val) { + this.massagePage = val; + this.handleSelectMassage(); + }, + + clearMassageDatas(){ + this.apiUrl=""; + this.detailTableDataLoading= false; + this.id= "";//编号 + this.title= "";//标题 + this.type= "";//服务类型 + this.oldPrice= "";//原价 + this.price= "";//现价 + this.massageImg= "";//图片 + this.content= "";//简介 + this.contentImg= []; //详情图 + this.status= "";//状态 + this.esteemRate= "";//好评率 + this.sales= "";//销量 + this.labels= "";//标签 + this.city= "";//城市 + this.createTime= "";//创建时间 + this.detailPage= 1; + this.detailLimit= 10; + this.openValue= 1; + this.closeValue= 2; + this.dialogFormVisibleAddMassage= false; + this.titles= "添加服务包"; + this.label=""; + this.labelsArr= []; //标签集合 + this.storeAddress= []; + this.storeAddre= "请选择城市"; + this.province= ""; //省 + }, +//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<服务项目<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< }, mounted() { this.handleSelect(); this.typeDictSelect(); + this.fwSelect(); }, };