载物订单接入接口,完善飞行器管理,添加飞行器管理到菜单
This commit is contained in:
parent
6fcdada181
commit
491458b70b
9
src/api/order.js
Normal file
9
src/api/order.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getOrderList(params) {
|
||||||
|
return request({
|
||||||
|
url: 'api/order/allOrder',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
@ -58,27 +58,27 @@ export const constantRouterMap = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: '/aircraft',
|
// path: '/aircraft',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
hidden: false,
|
// hidden: false,
|
||||||
redirect: 'noredirect',
|
// redirect: 'noredirect',
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: 'aircraft',
|
// path: 'aircraft',
|
||||||
component: (resolve) => require(['@/views/aircraft'], resolve),
|
// component: (resolve) => require(['@/views/aircraft'], resolve),
|
||||||
name: '飞行器管理',
|
// name: '飞行器管理',
|
||||||
meta: { title: '飞行器管理', icon: 'develop', affix: true },
|
// meta: { title: '飞行器管理', icon: 'develop' },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
hidden: true,
|
// hidden: true,
|
||||||
path: 'aircraftDetail',
|
// path: 'aircraftDetail',
|
||||||
component: (resolve) => require(['@/views/aircraft/aircraftDetail'], resolve),
|
// component: (resolve) => require(['@/views/aircraft/aircraftDetail'], resolve),
|
||||||
name: '查看飞行器',
|
// name: '查看飞行器',
|
||||||
meta: { title: '查看飞行器', icon: 'develop', affix: true },
|
// meta: { title: '查看飞行器', icon: 'develop' },
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: '/article/content',
|
path: '/article/content',
|
||||||
component: (resolve) => require(['@/views/platform/article/content'], resolve),
|
component: (resolve) => require(['@/views/platform/article/content'], resolve),
|
||||||
|
@ -341,7 +341,7 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
const baseData = {
|
const baseData = {
|
||||||
aircraftId: this.aircraftId,
|
aircraftId: this.aircraftId || 0, // 设置为0是测试使用
|
||||||
name: this.form.name,
|
name: this.form.name,
|
||||||
insuranceType: this.form.insuranceType,
|
insuranceType: this.form.insuranceType,
|
||||||
deadlineTime: this.form.deadlineTime,
|
deadlineTime: this.form.deadlineTime,
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
:value="scenic.id" />
|
:value="scenic.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="负责人" prop="employeesId">
|
<el-form-item label="角色" prop="employeesId">
|
||||||
<el-select v-model="form.employeesId" style="width: 150px;">
|
<el-select v-model="form.employeesId" style="width: 150px;">
|
||||||
<el-option v-for="employee in employeeOptions"
|
<el-option v-for="employee in employeeOptions"
|
||||||
:key="employee.id"
|
:key="employee.id"
|
||||||
@ -175,7 +175,9 @@
|
|||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import crudAircraft from '@/api/aircraft'
|
import crudAircraft from '@/api/aircraft'
|
||||||
import areaApi from '@/api/system/area'
|
import { allAreas } from '@/api/system/area'
|
||||||
|
import { getAll } from '@/api/system/role'
|
||||||
|
import { allScenic } from '@/api/system/scenic'
|
||||||
import { upload } from '@/utils/upload'
|
import { upload } from '@/utils/upload'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
@ -271,6 +273,9 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{ required: true, message: '请输入飞行器名称', trigger: 'blur' }
|
{ required: true, message: '请输入飞行器名称', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
brand: [
|
||||||
|
{ required: true, message: '品牌不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
model: [
|
model: [
|
||||||
{ required: true, message: '请输入型号', trigger: 'blur' }
|
{ required: true, message: '请输入型号', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -310,16 +315,9 @@ export default {
|
|||||||
// 获取区域列表
|
// 获取区域列表
|
||||||
async getAreas() {
|
async getAreas() {
|
||||||
try {
|
try {
|
||||||
const res = await areaApi.tree()
|
const res = await allAreas()
|
||||||
if (res) {
|
if (res) {
|
||||||
this.areaOptions = [
|
this.areaOptions = res
|
||||||
{
|
|
||||||
id: 0,
|
|
||||||
name: res.name,
|
|
||||||
sons: res.sons || []
|
|
||||||
},
|
|
||||||
...(res.sons || [])
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$message.error('获取区域列表失败')
|
this.$message.error('获取区域列表失败')
|
||||||
@ -330,43 +328,42 @@ export default {
|
|||||||
|
|
||||||
// 获取景区列表
|
// 获取景区列表
|
||||||
async getScenics() {
|
async getScenics() {
|
||||||
// try {
|
|
||||||
// const test = {
|
|
||||||
// employeesId: this.query.employeesId || 0
|
|
||||||
// }
|
|
||||||
// const res = await crudAircraft.get(test)
|
|
||||||
// if (res.status === 200) {
|
|
||||||
// this.scenicOptions = res.data
|
|
||||||
// }
|
|
||||||
// } catch (error) {
|
|
||||||
// this.$message.error('获取景区列表失败')
|
|
||||||
// console.error('获取景区列表失败:', error)
|
|
||||||
// this.scenicOptions = []
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取飞行员列表
|
|
||||||
async getEmployees() {
|
|
||||||
try {
|
try {
|
||||||
const test = {
|
const res = await allScenic()
|
||||||
employeesId: this.query.employeesId || 0
|
if (res) {
|
||||||
}
|
this.scenicOptions = res
|
||||||
const res = await crudAircraft.get(test)
|
|
||||||
if (res.status === 200) {
|
|
||||||
this.employeeOptions = res.data
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$message.error('获取飞行员列表失败')
|
this.$message.error('获取景区列表失败')
|
||||||
console.error('获取飞行员列表失败:', error)
|
console.error('获取景区列表失败:', error)
|
||||||
|
this.scenicOptions = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取角色列表
|
||||||
|
async getEmployees() {
|
||||||
|
try {
|
||||||
|
const res = await getAll()
|
||||||
|
if (res) {
|
||||||
|
this.employeeOptions = res
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error('获取角色列表失败')
|
||||||
|
console.error('获取角色列表失败:', error)
|
||||||
this.employeeOptions = []
|
this.employeeOptions = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
|
// 设置brand的值与name相同
|
||||||
|
this.form.brand = this.form.name
|
||||||
|
return true
|
||||||
|
},
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
// 检查是否选择了负责人
|
// 检查是否选择了负责人
|
||||||
if (!this.query.employeesId) {
|
// if (!this.query.employeesId) {
|
||||||
this.$message.warning('请先选择负责人')
|
// this.$message.warning('请先选择负责人')
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
// 设置分页参数
|
// 设置分页参数
|
||||||
this.query.current = this.page.page
|
this.query.current = this.page.page
|
||||||
this.query.size = this.page.size
|
this.query.size = this.page.size
|
||||||
|
@ -89,8 +89,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getOrderList } from '@/api/order'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'loadOrder',
|
name: 'loadOrder',
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
@ -136,20 +141,36 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
const params = {
|
||||||
|
attractionId: this.query.scenicArea ? this.query.scenicArea : undefined,
|
||||||
|
customerId: this.query.customerName ? this.query.customerName : undefined,
|
||||||
|
phone: this.query.phone ? this.query.phone : undefined,
|
||||||
|
page: this.page.current - 1,
|
||||||
|
size: this.page.size
|
||||||
|
}
|
||||||
|
getOrderList(params).then(response => {
|
||||||
|
this.tableData = response.content || []
|
||||||
|
this.page.total = response.totalElements || 0
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
// 实现搜索逻辑
|
this.page.current = 1
|
||||||
console.log('搜索条件:', this.query)
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
this.selection = val
|
this.selection = val
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.page.size = val
|
this.page.size = val
|
||||||
// 重新加载数据
|
this.getList()
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.page.current = val
|
this.page.current = val
|
||||||
// 重新加载数据
|
this.getList()
|
||||||
},
|
},
|
||||||
handleDetail(row) {
|
handleDetail(row) {
|
||||||
this.$router.push({ path: '/order/loadOrderDetail', query: { id: row.orderId }})
|
this.$router.push({ path: '/order/loadOrderDetail', query: { id: row.orderId }})
|
||||||
|
Loading…
Reference in New Issue
Block a user