|
|
@@ -48,10 +48,10 @@
|
|
|
color="blue"
|
|
|
closable
|
|
|
:visible="visible"
|
|
|
- @close.stop="tagClose2(index, item.key1)"
|
|
|
+ @close.stop="tagClose2(index, item.roomNo)"
|
|
|
v-for="(item, index) in model.rooms"
|
|
|
:key="index"
|
|
|
- >{{ item.key1 }}</a-tag
|
|
|
+ >{{ item.roomNo }}</a-tag
|
|
|
>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
@@ -91,7 +91,7 @@
|
|
|
]"
|
|
|
@click="checkRoomClick(r)"
|
|
|
>
|
|
|
- {{ r.key1 }}
|
|
|
+ {{ r.roomNo }}
|
|
|
</div></a-col
|
|
|
>
|
|
|
</a-row>
|
|
|
@@ -124,7 +124,8 @@ export default {
|
|
|
const rooms = [];
|
|
|
for (let i = 0; i < 100; i++) {
|
|
|
rooms.push({
|
|
|
- key1: "100" + i,
|
|
|
+ id: "100" + i,
|
|
|
+ roomNo: 1000 + i,
|
|
|
check: 0,
|
|
|
kz: i == 1 ? 1 : 0,
|
|
|
});
|
|
|
@@ -132,7 +133,8 @@ export default {
|
|
|
const rooms2 = [];
|
|
|
for (let i = 0; i < 50; i++) {
|
|
|
rooms2.push({
|
|
|
- key1: "200" + i,
|
|
|
+ id: "200" + i,
|
|
|
+ roomNo: 2000 + i,
|
|
|
check: 0,
|
|
|
kz: i == 5 ? 1 : 0,
|
|
|
});
|
|
|
@@ -194,7 +196,7 @@ export default {
|
|
|
this.model.rooms.splice(index, 1);
|
|
|
this.roomList.some((t) => {
|
|
|
var r = t.child.some((c) => {
|
|
|
- if (c.key1 === key1) {
|
|
|
+ if (c.roomNo === key1) {
|
|
|
c.check = 0;
|
|
|
return true;
|
|
|
}
|
|
|
@@ -217,35 +219,11 @@ export default {
|
|
|
},
|
|
|
submitForm() {
|
|
|
const that = this;
|
|
|
- that.$message.warning("未实现");
|
|
|
- return;
|
|
|
- // 触发表单验证
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- that.confirmLoading = true;
|
|
|
- let httpurl = "";
|
|
|
- let method = "";
|
|
|
- if (!this.model.id) {
|
|
|
- httpurl += this.url.add;
|
|
|
- method = "post";
|
|
|
- } else {
|
|
|
- httpurl += this.url.edit;
|
|
|
- method = "put";
|
|
|
- }
|
|
|
- httpAction(httpurl, this.model, method)
|
|
|
- .then((res) => {
|
|
|
- if (res.success) {
|
|
|
- that.$message.success(res.message);
|
|
|
- that.$emit("ok");
|
|
|
- } else {
|
|
|
- that.$message.warning(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- that.confirmLoading = false;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ if (that.model.rooms.length === 0) {
|
|
|
+ that.$message.warning("请先选择房间");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ that.$emit("ok", that.model.rooms);
|
|
|
},
|
|
|
},
|
|
|
};
|