|
@@ -29,7 +29,8 @@ export default {
|
|
|
total: 0,
|
|
total: 0,
|
|
|
listQuery: {
|
|
listQuery: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
- limit: 20
|
|
|
|
|
|
|
+ limit: 20,
|
|
|
|
|
+ name:undefined
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -82,7 +83,7 @@ export default {
|
|
|
async fetchData() {
|
|
async fetchData() {
|
|
|
const latitude = ''
|
|
const latitude = ''
|
|
|
const longitude = ''
|
|
const longitude = ''
|
|
|
- getResturants({ page: this.listQuery.page, limit: this.listQuery.limit }).then(response => {
|
|
|
|
|
|
|
+ getResturants(this.listQuery).then(response => {
|
|
|
const restaurants = response.data.records
|
|
const restaurants = response.data.records
|
|
|
this.total = response.data.total
|
|
this.total = response.data.total
|
|
|
this.tableData = []
|
|
this.tableData = []
|
|
@@ -101,6 +102,14 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ search() {
|
|
|
|
|
+ this.fetchData()
|
|
|
|
|
+ },
|
|
|
|
|
+ reset() {
|
|
|
|
|
+ this.listQuery.name = ''
|
|
|
|
|
+ this.fetchData()
|
|
|
|
|
+ },
|
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
|
console.log(`每页 ${val} 条`)
|
|
console.log(`每页 ${val} 条`)
|
|
|
},
|
|
},
|
|
@@ -127,7 +136,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleEdit(index, row) {
|
|
handleEdit(index, row) {
|
|
|
this.selectTable = row
|
|
this.selectTable = row
|
|
|
- this.selectTable.image = getApiUrl() + '/file/getImgStream?fileName=' + row.image_path
|
|
|
|
|
|
|
+ this.selectTable.image = getApiUrl() + '/file/getImgStream?fileName=' + row.image_path
|
|
|
this.address.address = row.address
|
|
this.address.address = row.address
|
|
|
this.dialogFormVisible = true
|
|
this.dialogFormVisible = true
|
|
|
this.selectedCategory = row.category.split('/')
|
|
this.selectedCategory = row.category.split('/')
|
|
@@ -138,6 +147,9 @@ export default {
|
|
|
addFood(index, row) {
|
|
addFood(index, row) {
|
|
|
this.$router.push({ path: '/data/food/add', query: { restaurant_id: row.id }})
|
|
this.$router.push({ path: '/data/food/add', query: { restaurant_id: row.id }})
|
|
|
},
|
|
},
|
|
|
|
|
+ viewFood(index,row) {
|
|
|
|
|
+ this.$router.push({path:'/data/food',query:{restaurant_id:row.id}})
|
|
|
|
|
+ },
|
|
|
async handleDelete(index, row) {
|
|
async handleDelete(index, row) {
|
|
|
try {
|
|
try {
|
|
|
const res = await deleteResturant(row.id)
|
|
const res = await deleteResturant(row.id)
|
|
@@ -181,7 +193,7 @@ export default {
|
|
|
handleServiceAvatarScucess(res, file) {
|
|
handleServiceAvatarScucess(res, file) {
|
|
|
this.selectTable.image_path = res.data.realFileName
|
|
this.selectTable.image_path = res.data.realFileName
|
|
|
this.selectTable.image = getApiUrl() + '/file/getImgStream?fileName=' + res.data.realFileName
|
|
this.selectTable.image = getApiUrl() + '/file/getImgStream?fileName=' + res.data.realFileName
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
beforeAvatarUpload(file) {
|
|
beforeAvatarUpload(file) {
|
|
|
const isRightType = (file.type === 'image/jpeg') || (file.type === 'image/png')
|
|
const isRightType = (file.type === 'image/jpeg') || (file.type === 'image/png')
|
|
@@ -199,7 +211,7 @@ export default {
|
|
|
this.dialogFormVisible = false
|
|
this.dialogFormVisible = false
|
|
|
try {
|
|
try {
|
|
|
Object.assign(this.selectTable, this.address)
|
|
Object.assign(this.selectTable, this.address)
|
|
|
- this.selectTable.category = this.selectedCategory.join('/')
|
|
|
|
|
|
|
+ this.selectTable.category = this.selectedCategory.join('/')
|
|
|
updateResturant(this.selectTable).then(response => {
|
|
updateResturant(this.selectTable).then(response => {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: 'success',
|
|
type: 'success',
|