Compare commits
2 Commits
2f163bafd9
...
1f84be4eec
Author | SHA1 | Date | |
---|---|---|---|
1f84be4eec | |||
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
|
||||
})
|
||||
}
|
@ -59,27 +59,27 @@ export const constantRouterMap = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/aircraft',
|
||||
component: Layout,
|
||||
hidden: false,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'aircraft',
|
||||
component: (resolve) => require(['@/views/aircraft'], resolve),
|
||||
name: '飞行器管理',
|
||||
meta: { title: '飞行器管理', icon: 'develop', affix: true },
|
||||
},
|
||||
{
|
||||
hidden: true,
|
||||
path: 'aircraftDetail',
|
||||
component: (resolve) => require(['@/views/aircraft/aircraftDetail'], resolve),
|
||||
name: '查看飞行器',
|
||||
meta: { title: '查看飞行器', icon: 'develop', affix: true },
|
||||
},
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/aircraft',
|
||||
// component: Layout,
|
||||
// hidden: false,
|
||||
// redirect: 'noredirect',
|
||||
// children: [
|
||||
// {
|
||||
// path: 'aircraft',
|
||||
// component: (resolve) => require(['@/views/aircraft'], resolve),
|
||||
// name: '飞行器管理',
|
||||
// meta: { title: '飞行器管理', icon: 'develop' },
|
||||
// },
|
||||
// {
|
||||
// hidden: true,
|
||||
// path: 'aircraftDetail',
|
||||
// component: (resolve) => require(['@/views/aircraft/aircraftDetail'], resolve),
|
||||
// name: '查看飞行器',
|
||||
// meta: { title: '查看飞行器', icon: 'develop' },
|
||||
// },
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '/article/content',
|
||||
component: (resolve) => require(['@/views/platform/article/content'], resolve),
|
||||
|
@ -341,7 +341,7 @@ export default {
|
||||
if (valid) {
|
||||
try {
|
||||
const baseData = {
|
||||
aircraftId: this.aircraftId,
|
||||
aircraftId: this.aircraftId || 0, // 设置为0是测试使用
|
||||
name: this.form.name,
|
||||
insuranceType: this.form.insuranceType,
|
||||
deadlineTime: this.form.deadlineTime,
|
||||
|
@ -52,7 +52,7 @@
|
||||
:value="scenic.id" />
|
||||
</el-select>
|
||||
</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-option v-for="employee in employeeOptions"
|
||||
:key="employee.id"
|
||||
@ -175,7 +175,9 @@
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
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 { mapGetters } from 'vuex'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
@ -271,6 +273,9 @@ export default {
|
||||
name: [
|
||||
{ required: true, message: '请输入飞行器名称', trigger: 'blur' }
|
||||
],
|
||||
brand: [
|
||||
{ required: true, message: '品牌不能为空', trigger: 'blur' }
|
||||
],
|
||||
model: [
|
||||
{ required: true, message: '请输入型号', trigger: 'blur' }
|
||||
],
|
||||
@ -310,16 +315,9 @@ export default {
|
||||
// 获取区域列表
|
||||
async getAreas() {
|
||||
try {
|
||||
const res = await areaApi.tree()
|
||||
const res = await allAreas()
|
||||
if (res) {
|
||||
this.areaOptions = [
|
||||
{
|
||||
id: 0,
|
||||
name: res.name,
|
||||
sons: res.sons || []
|
||||
},
|
||||
...(res.sons || [])
|
||||
]
|
||||
this.areaOptions = res
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error('获取区域列表失败')
|
||||
@ -330,43 +328,42 @@ export default {
|
||||
|
||||
// 获取景区列表
|
||||
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 {
|
||||
const test = {
|
||||
employeesId: this.query.employeesId || 0
|
||||
}
|
||||
const res = await crudAircraft.get(test)
|
||||
if (res.status === 200) {
|
||||
this.employeeOptions = res.data
|
||||
const res = await allScenic()
|
||||
if (res) {
|
||||
this.scenicOptions = res
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error('获取飞行员列表失败')
|
||||
console.error('获取飞行员列表失败:', error)
|
||||
this.$message.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 = []
|
||||
}
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 设置brand的值与name相同
|
||||
this.form.brand = this.form.name
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
// 检查是否选择了负责人
|
||||
if (!this.query.employeesId) {
|
||||
this.$message.warning('请先选择负责人')
|
||||
return false
|
||||
}
|
||||
// if (!this.query.employeesId) {
|
||||
// this.$message.warning('请先选择负责人')
|
||||
// return false
|
||||
// }
|
||||
// 设置分页参数
|
||||
this.query.current = this.page.page
|
||||
this.query.size = this.page.size
|
||||
|
@ -89,8 +89,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getOrderList } from '@/api/order'
|
||||
|
||||
export default {
|
||||
name: 'loadOrder',
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@ -136,20 +141,36 @@ export default {
|
||||
}
|
||||
},
|
||||
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() {
|
||||
// 实现搜索逻辑
|
||||
console.log('搜索条件:', this.query)
|
||||
this.page.current = 1
|
||||
this.getList()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selection = val
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page.size = val
|
||||
// 重新加载数据
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page.current = val
|
||||
// 重新加载数据
|
||||
this.getList()
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.$router.push({ path: '/order/loadOrderDetail', query: { id: row.orderId }})
|
||||
|
Loading…
Reference in New Issue
Block a user