Commit 7bd16f7c by 吕明尚

更改套餐列表,房间列表

parent 4dac456e
...@@ -298,19 +298,20 @@ export default { ...@@ -298,19 +298,20 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
let name; getRoomPack(row.id).then(response => {
const ids = row.id || this.ids; let roomnNameStr = `是否确认删除${row.name}的数据?`
this.getRoomPackList(ids); if(response.data.length>0){
var roomId = roomPackList[0].roomId; let str = response.data.map(item=>item.roomName).join("、")
getRoom(roomId).then(response => { roomnNameStr = `是否确认删除${row.name}数据及其关联的房间${str}下的绑定套餐?`
name = response.data.name; }
this.$modal.confirm("当前套餐下有"+name+"房间,请确认删除").then((result) =>{ this.$modal.confirm(roomnNameStr).then((result) =>{
return delPack(ids); return delPack(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
<el-table-column label="套餐" align="center" prop="packIds" > <el-table-column label="套餐" align="center" prop="packIds" >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.packIds" style="display: flex;flex-wrap: wrap;width: 100%;"> <div v-if="scope.row.packIds" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag style="margin: 0 3px;" v-for="(item ,k) in packList" :key="k" :options="packIds" :value="item.name+'-'+'时段'+item.packaStartPeriod+'-'+item.packaEndPeriod"/> <dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.packIds" :key="k" :options="packList" :value="item"/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -300,7 +300,10 @@ export default { ...@@ -300,7 +300,10 @@ export default {
created() { created() {
this.onGetAllStoreList() this.onGetAllStoreList()
this.onPackList() this.onPackList()
this.getList();
},
mounted() {
console.log(this.dict)
}, },
methods: { methods: {
onChange(e){ onChange(e){
...@@ -318,7 +321,23 @@ export default { ...@@ -318,7 +321,23 @@ export default {
}, },
onPackList(){ onPackList(){
query().then(res => { query().then(res => {
this.packList = res.data this.packList = res.data.map(obj=>{
return {
...obj,
raw:{
dictSort: 1,
dictValue: "1",
listClass : "primary",
cssClass:''
},
value: obj.id.toString(),
label: obj.name,
}
})
console.log(this.packList,9090999)
this.getList();
}) })
}, },
...@@ -329,7 +348,8 @@ export default { ...@@ -329,7 +348,8 @@ export default {
this.roomList = response.rows.map(item=>{ this.roomList = response.rows.map(item=>{
return { return {
...item, ...item,
facilities: item.facilities? item.facilities.split(","): [] facilities: item.facilities? item.facilities.split(","): [],
packIds: item.packIds? item.packIds.split(","): []
} }
}); });
this.total = response.total; this.total = response.total;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment