|
@@ -75,8 +75,8 @@
|
|
|
</div>
|
|
|
<div style="display: flex;">
|
|
|
<div style="width: 98%;">
|
|
|
- <el-form-item label="备注" prop="Remark">
|
|
|
- <el-input type="textarea" :rows="3" placeholder="请输入内容" v-model="addData.Remark"></el-input>
|
|
|
+ <el-form-item label="酒店其他信息">
|
|
|
+ <el-input type="textarea" :rows="3" placeholder="请输入内容" v-model="addData.OtherInformation"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -129,7 +129,7 @@ export default {
|
|
|
token: '',
|
|
|
userId: 0,
|
|
|
addData: {
|
|
|
- Statu: '',
|
|
|
+ Status: '',
|
|
|
Id: 0,
|
|
|
City: '',
|
|
|
Name: '',
|
|
@@ -150,7 +150,7 @@ export default {
|
|
|
methods: {
|
|
|
HotelData() {
|
|
|
this.loading = true
|
|
|
- var url = "/api/Resource/QueryHotelData"
|
|
|
+ var url = "/api/Resource/QueryHotelDataInfo"
|
|
|
var that = this
|
|
|
this.$axios({
|
|
|
method: 'post',
|
|
@@ -160,26 +160,16 @@ export default {
|
|
|
},
|
|
|
data: {
|
|
|
portType: 1,
|
|
|
- PageIndex: 0,
|
|
|
- PageSize: 0,
|
|
|
- City: '',
|
|
|
- Name: '',
|
|
|
- Contact: '',
|
|
|
- ContactPhone: '',
|
|
|
+ id: that.$route.query.id,
|
|
|
+
|
|
|
}
|
|
|
}).then(function (res) {
|
|
|
console.log(res)
|
|
|
-
|
|
|
if (res.data.code == 200) {
|
|
|
- that.tableData = res.data.data;
|
|
|
- that.addData.Id = that.$route.query.id;
|
|
|
- if (that.addData.Id == undefined || that.addData.Id == null) {
|
|
|
- //添加
|
|
|
- that.addData.Status = 1
|
|
|
- } else {
|
|
|
- //编辑
|
|
|
- that.upData();
|
|
|
- }
|
|
|
+ that.HotelDataData=res.data.data
|
|
|
+ that.upData();
|
|
|
+ }else{
|
|
|
+ that.$message.error(res.data.mag);
|
|
|
}
|
|
|
that.loading = false
|
|
|
}).catch(function (error) {
|
|
@@ -190,12 +180,14 @@ export default {
|
|
|
|
|
|
addBtn() {
|
|
|
const that = this;
|
|
|
-
|
|
|
+ if(this.$route.query.id){
|
|
|
+ this.addData.Status = 2;
|
|
|
+ }else{
|
|
|
+ this.addData.Status = 1;
|
|
|
+ }
|
|
|
that.addData.CreateUserId = that.userId
|
|
|
that.$refs.addData.validate((valid) => {
|
|
|
if (valid) {
|
|
|
-
|
|
|
- console.log(that.addData)
|
|
|
var url = "/api/Resource/OperationHotelData"
|
|
|
that.$axios({
|
|
|
method: 'post',
|
|
@@ -215,7 +207,7 @@ export default {
|
|
|
that.loading = true;
|
|
|
setTimeout(() => {
|
|
|
that.$router.push('/home/HotelData')
|
|
|
- }, 3000);
|
|
|
+ }, 1000);
|
|
|
} else {
|
|
|
that.$message.error(res.data.msg);
|
|
|
}
|
|
@@ -227,15 +219,6 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
upData() {
|
|
|
-
|
|
|
- for (var i = 0; i < this.tableData.length; i++) {
|
|
|
- if (this.tableData[i].id == parseInt(this.addData.Id)) {
|
|
|
-
|
|
|
- this.HotelDataData = this.tableData[i];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- this.addData.Status = 2;
|
|
|
this.addData.Id = this.HotelDataData.id;
|
|
|
this.addData.City = this.HotelDataData.city;
|
|
|
this.addData.Name = this.HotelDataData.name;
|
|
@@ -252,11 +235,11 @@ export default {
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
-
|
|
|
this.token = JSON.parse(localStorage.getItem('userinif')).token;
|
|
|
this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
|
|
|
- this.HotelData();
|
|
|
-
|
|
|
+ if(this.$route.query.id){
|
|
|
+ this.HotelData();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|