|
|
@@ -361,38 +361,65 @@ export default {
|
|
|
this.$message.error("未获取到数据!")
|
|
|
return
|
|
|
}
|
|
|
- if (this.xfData.length > 0) {
|
|
|
|
|
|
- this.xfData.forEach(ele => {
|
|
|
- ele.roomLayoutId = this.layouts[this.activeIndex].id
|
|
|
- })
|
|
|
+ let xf = JSON.parse(JSON.stringify(this.xfData))
|
|
|
+ let tf = JSON.parse(JSON.stringify(this.tfData))
|
|
|
|
|
|
- postAction('/fw/fwRoomLayoutInConsumable/layoutInConsumableSave', this.xfData).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- // this.$message.success("保存成功!")
|
|
|
- this.$emit('ok')
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message)
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
+ xf.forEach(ele => {
|
|
|
+ ele.type = 1
|
|
|
+ })
|
|
|
+ tf.forEach(ele => {
|
|
|
+ ele.type = 2
|
|
|
+ })
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
- if (this.tfData.length > 0) {
|
|
|
- this.tfData.forEach(ele => {
|
|
|
- ele.roomLayoutId = this.layouts[this.activeIndex].id
|
|
|
- })
|
|
|
- postAction('/fw/fwRoomLayoutInConsumable/layoutInConsumableSave', this.tfData).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- this.$message.success("保存成功!")
|
|
|
- this.$emit('ok')
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message)
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
+ let arr = xf.concat(tf)
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
+ arr.forEach(ele => {
|
|
|
+ ele.roomLayoutId = this.layouts[this.activeIndex].id
|
|
|
+ })
|
|
|
+ postAction('/fw/fwRoomLayoutInConsumable/layoutInConsumableSave', arr).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success("保存成功!")
|
|
|
+ this.$emit('ok')
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ // if (this.xfData.length > 0) {
|
|
|
+
|
|
|
+ // this.xfData.forEach(ele => {
|
|
|
+ // ele.roomLayoutId = this.layouts[this.activeIndex].id
|
|
|
+ // })
|
|
|
+
|
|
|
+ // postAction('/fw/fwRoomLayoutInConsumable/layoutInConsumableSave', this.xfData).then((res) => {
|
|
|
+ // if (res.success) {
|
|
|
+ // // this.$message.success("保存成功!")
|
|
|
+ // this.$emit('ok')
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.message)
|
|
|
+ // }
|
|
|
+ // }).finally(() => {
|
|
|
+
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // if (this.tfData.length > 0) {
|
|
|
+ // this.tfData.forEach(ele => {
|
|
|
+ // ele.roomLayoutId = this.layouts[this.activeIndex].id
|
|
|
+ // })
|
|
|
+ // postAction('/fw/fwRoomLayoutInConsumable/layoutInConsumableSave', this.tfData).then((res) => {
|
|
|
+ // if (res.success) {
|
|
|
+ // this.$message.success("保存成功!")
|
|
|
+ // this.$emit('ok')
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.message)
|
|
|
+ // }
|
|
|
+ // }).finally(() => {
|
|
|
+
|
|
|
+ // })
|
|
|
+ // }
|
|
|
},
|
|
|
},
|
|
|
};
|