|
@@ -181,6 +181,7 @@ import Pagination from '@/components/Pagination'
|
|
|
import { getList, remove, copyFromSimilarFood } from '@/api/food'
|
|
import { getList, remove, copyFromSimilarFood } from '@/api/food'
|
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
|
import { getToken } from '@/utils/auth'
|
|
import { getToken } from '@/utils/auth'
|
|
|
|
|
+import { getFoodSourceByUrl } from '@/utils/food-utils'
|
|
|
|
|
|
|
|
const foodTypes = { 0: '主材', 1: '辅材' }
|
|
const foodTypes = { 0: '主材', 1: '辅材' }
|
|
|
|
|
|
|
@@ -210,15 +211,18 @@ export default {
|
|
|
uploadFile: null,
|
|
uploadFile: null,
|
|
|
uploadLoading: false,
|
|
uploadLoading: false,
|
|
|
copyDialogVisible: false,
|
|
copyDialogVisible: false,
|
|
|
- params: {}
|
|
|
|
|
|
|
+ params: {},
|
|
|
|
|
+ foodSource: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ this.foodSource = getFoodSourceByUrl(this.$route.path)
|
|
|
this.fetchData()
|
|
this.fetchData()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
fetchData() {
|
|
fetchData() {
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
|
|
|
+ this.listQuery.foodSource = this.foodSource
|
|
|
getList(this.listQuery).then(response => {
|
|
getList(this.listQuery).then(response => {
|
|
|
this.list = response.data.list
|
|
this.list = response.data.list
|
|
|
this.total = response.data.count
|
|
this.total = response.data.count
|