This commit is contained in:
yis 2025-08-19 17:04:23 +08:00
commit 2e423ffe85
12 changed files with 164 additions and 62 deletions

View File

@ -6,6 +6,6 @@ VUE_APP_BASE_API = 'http://8.138.171.103/aerocraftAdminApi'
# VUE_APP_BASE_API = 'https://webapi.aishangfeixing.com/aerocraftAdminApi/' # VUE_APP_BASE_API = 'https://webapi.aishangfeixing.com/aerocraftAdminApi/'
# 运行基本路径 # 运行基本路径
VUE_APP_BASE_PATH = 'http://8.138.171.103/aerocraftAdmin' VUE_APP_BASE_PATH = 'http://8.138.171.103/aerocraftAdmin'
# VUE_APP_BASE_PATH = 'https://webapi.aishangfeixing.com/aerocraftAdmin' # VUE_APP_BASE_PATH = 'https://admin.aishangfeixing.com'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://eladmin.vip' VUE_APP_WS_API = 'wss://eladmin.vip'

View File

@ -36,9 +36,9 @@ export default {
let matched = this.$route.matched.filter(item => item.meta && item.meta.title) let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
const first = matched[0] const first = matched[0]
if (!this.isDashboard(first)) { // if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched) // matched = [{ path: '/dashboard', meta: { title: '' }}].concat(matched)
} // }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
}, },

View File

@ -35,14 +35,14 @@ export const constantRouterMap = [
{ {
path: '/', path: '/',
component: Layout, component: Layout,
redirect: '/dashboard', // redirect: '/dashboard',
children: [ children: [
{ // {
path: 'dashboard', // path: 'dashboard',
component: (resolve) => require(['@/views/home'], resolve), // component: (resolve) => require(['@/views/home'], resolve),
name: 'Dashboard', // name: 'Dashboard',
meta: { title: '首页', icon: 'index', affix: true, noCache: true } // meta: { title: '首页', icon: 'index', affix: true, noCache: true }
} // }
] ]
}, },
{ {

View File

@ -139,6 +139,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { upload } from '@/utils/upload' import { upload } from '@/utils/upload'
import { addInsurance, getInsuranceDetail, deleteInsurance, editInsurance } from '@/api/aircraft' import { addInsurance, getInsuranceDetail, deleteInsurance, editInsurance } from '@/api/aircraft'
import { get as getDictDetail } from '@/api/system/dictDetail'
export default { export default {
name: "InsuranceRecord", name: "InsuranceRecord",
@ -182,11 +183,7 @@ export default {
edit: ['admin', 'aircraftDetail:edit'], edit: ['admin', 'aircraftDetail:edit'],
delete: ['admin', 'aircraftDetail:delete'] delete: ['admin', 'aircraftDetail:delete']
}, },
insuranceTypes: [ insuranceTypes: [],
{ value: 0, label: "三方险" },
{ value: 1, label: "设备险" },
{ value: 2, label: "运营险" },
],
rules: { rules: {
name: [{ required: true, message: "请输入保险名称", trigger: "blur" }], name: [{ required: true, message: "请输入保险名称", trigger: "blur" }],
insuranceType: [ insuranceType: [
@ -201,7 +198,23 @@ export default {
}, },
}; };
}, },
created() {
this.getInsuranceTypes()
},
methods: { methods: {
async getInsuranceTypes() {
try {
const res = await getDictDetail('insurance_type')
this.insuranceTypes = res.content.map(item => ({
value: item.dictSort,
label: item.value
}))
console.log(this.insuranceTypes)
} catch (error) {
console.error('获取保险类型失败:', error)
this.$message.error('获取保险类型失败')
}
},
getInsuranceTypeName(type) { getInsuranceTypeName(type) {
const found = this.insuranceTypes.find(t => t.value === type) const found = this.insuranceTypes.find(t => t.value === type)
return found ? found.label : '未知类型' return found ? found.label : '未知类型'

View File

@ -32,6 +32,7 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getDeviceDetail, getMaintenanceRecords, getInsuranceRecords } from '@/api/aircraft' import { getDeviceDetail, getMaintenanceRecords, getInsuranceRecords } from '@/api/aircraft'
import { get } from "@/api/system/dictDetail";
import BasicInfo from './components/BasicInfo' import BasicInfo from './components/BasicInfo'
import MaintenanceRecord from './components/MaintenanceRecord' import MaintenanceRecord from './components/MaintenanceRecord'
import InsuranceRecord from './components/InsuranceRecord' import InsuranceRecord from './components/InsuranceRecord'
@ -47,17 +48,18 @@ export default {
data() { data() {
return { return {
form: { form: {
name: '大疆', name: '',
model: 'T100', model: '',
useType: '载人飞行', useType: '',
areaName: '北京', areaName: '',
scenicName: '白云山', scenicName: '',
username: '小明', username: '',
remark: '设备状态良好', remark: '',
deviceImages: [ deviceImages: [
'https://axure-file.lanhuapp.com/md5__f344f816278c2a3f5164e4571c580ad9.png' 'https://axure-file.lanhuapp.com/md5__f344f816278c2a3f5164e4571c580ad9.png'
] ]
}, },
typeOptions: [], //
maintenanceData: [], maintenanceData: [],
insuranceData: [], insuranceData: [],
maintenancePage: { maintenancePage: {
@ -79,17 +81,36 @@ export default {
]) ])
}, },
created() { created() {
this.getFlightTypes()
const id = this.$route.query.id const id = this.$route.query.id
const rowData = this.$route.query.data ? JSON.parse(this.$route.query.data) : null const rowData = this.$route.query.data ? JSON.parse(this.$route.query.data) : null
if (rowData) { if (rowData) {
setTimeout(() => {
this.getDetail(id, rowData) this.getDetail(id, rowData)
}, 0)
}else { }else {
setTimeout(() => {
this.getDetail(id) this.getDetail(id)
}, 0)
} }
this.loadMaintenanceRecords() this.loadMaintenanceRecords()
this.loadInsuranceRecords() this.loadInsuranceRecords()
}, },
methods: { methods: {
//
async getFlightTypes() {
try {
const res = await get('user_qualification');
if (res && res.content) {
this.typeOptions = res.content;
}
} catch (error) {
console.error("获取飞行类型失败:", error);
this.$message.error("获取飞行类型失败");
this.typeOptions = [];
}
},
getDetail(id, rowData = null) { getDetail(id, rowData = null) {
getDeviceDetail(id).then(response => { getDeviceDetail(id).then(response => {
this.form = response this.form = response
@ -98,7 +119,8 @@ export default {
this.form.scenicName = rowData.scenicName this.form.scenicName = rowData.scenicName
this.form.username = rowData.username this.form.username = rowData.username
} }
this.form.useType = this.form.useType === 0 ? '载物飞行' : this.form.useType === 1 ? '载人飞行' : '其他' const type = this.typeOptions.find(t => t.dictSort === this.form.useType);
this.form.useType = type ? type.label : '未知';
// //
this.form.deviceImages = this.form.deviceImages.map((image, index) => { this.form.deviceImages = this.form.deviceImages.map((image, index) => {
if (typeof image === 'string') { if (typeof image === 'string') {

View File

@ -32,6 +32,7 @@
size="small" size="small"
style="width: 200px" style="width: 200px"
class="filter-item" class="filter-item"
clearable
> >
<el-option <el-option
v-for="area in areaOptions" v-for="area in areaOptions"
@ -85,9 +86,12 @@
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="useType"> <el-form-item label="类型" prop="useType">
<el-select v-model="form.useType" style="width: 150px"> <el-select v-model="form.useType" style="width: 150px">
<el-option :value="0" label="载物飞行" /> <el-option
<el-option :value="1" label="载人飞行" /> v-for="item in typeOptions"
<el-option :value="2" label="其他" /> :key="item.dictSort"
:value="item.dictSort"
:label="item.label"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="区域" prop="areaId"> <el-form-item label="区域" prop="areaId">
@ -124,12 +128,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remarks" :label-width="'100px'"> <el-form-item label="备注" prop="remark" :label-width="'100px'">
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
placeholder="请输入备注" placeholder="请输入备注"
v-model="form.remarks" v-model="form.remark"
style="width: 150px" style="width: 150px"
> >
</el-input> </el-input>
@ -214,13 +218,7 @@
<el-table-column label="型号" prop="model" /> <el-table-column label="型号" prop="model" />
<el-table-column label="类型" prop="useType"> <el-table-column label="类型" prop="useType">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{ typeOptions.find(t => t.dictSort === scope.row.useType)?typeOptions.find(t => t.dictSort === scope.row.useType).label : '未知' }}
scope.row.useType === 0
? "载物飞行"
: scope.row.useType === 1
? "载人飞行"
: "其他"
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="负责人" prop="username" /> <el-table-column label="负责人" prop="username" />
@ -276,6 +274,7 @@ import crudAircraft from "@/api/aircraft";
import { allAreas } from "@/api/system/area"; import { allAreas } from "@/api/system/area";
import { getList, getDetail } from "@/api/system/pilot"; import { getList, getDetail } from "@/api/system/pilot";
import { allScenic } from "@/api/system/scenic"; import { allScenic } from "@/api/system/scenic";
import { get } from "@/api/system/dictDetail";
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";
@ -285,7 +284,7 @@ const defaultForm = {
name: null, name: null,
brand: null, brand: null,
model: null, model: null,
useType: 0, useType: 1,
areaId: null, areaId: null,
scenicId: null, scenicId: null,
employeesId: null, employeesId: null,
@ -359,6 +358,7 @@ export default {
areaOptions: [], areaOptions: [],
scenicOptions: [], scenicOptions: [],
employeeOptions: [], employeeOptions: [],
typeOptions: [], //
// //
query: { query: {
name: "", name: "",
@ -406,6 +406,8 @@ export default {
this.getAreas(); this.getAreas();
// //
this.getEmployees(); this.getEmployees();
//
this.getFlightTypes();
}, },
methods: { methods: {
// //
@ -442,6 +444,20 @@ export default {
}); });
}, },
//
async getFlightTypes() {
try {
const res = await get('user_qualification');
if (res && res.content) {
this.typeOptions = res.content.sort((a, b) => a.dictSort - b.dictSort);
}
} catch (error) {
this.$message.error("获取飞行类型失败");
console.error("获取飞行类型失败:", error);
this.typeOptions = [];
}
},
// //
async getEmployees() { async getEmployees() {
try { try {

View File

@ -56,8 +56,10 @@ export default {
codeUrl: '', codeUrl: '',
cookiePass: '', cookiePass: '',
loginForm: { loginForm: {
username: 'admin', // username: 'admin',
password: '123456', // password: '123456',
username: '',
password: '',
rememberMe: false, rememberMe: false,
code: '', code: '',
uuid: '' uuid: ''

View File

@ -122,11 +122,12 @@ import { getOrderList } from "@/api/order";
import { allAreas } from "@/api/system/area"; import { allAreas } from "@/api/system/area";
import { allScenic } from "@/api/system/scenic"; import { allScenic } from "@/api/system/scenic";
import { allCustomer } from "@/api/system/customer"; import { allCustomer } from "@/api/system/customer";
import { get } from "@/api/system/dictDetail";
import { getList } from "@/api/system/pilot"; import { getList } from "@/api/system/pilot";
import { getOrderDetail } from "@/api/order"; import { getOrderDetail } from "@/api/order";
import { getUser } from "@/api/system/user"; // import { getUser } from "@/api/system/user";
import { getOrderStatusText, getSettlementStatusText, getOrderStatusClass, getSettlementStatusClass } from "@/utils/orderStatus"; import { getOrderStatusText, getSettlementStatusText, getOrderStatusClass, getSettlementStatusClass } from "@/utils/orderStatus";
import store from "@/store"; // import store from "@/store";
export default { export default {
name: "loadOrder", name: "loadOrder",
@ -135,6 +136,7 @@ export default {
this.getScenics(); this.getScenics();
this.getPilots(); this.getPilots();
this.getCustomers(); this.getCustomers();
this.getFlightTypes();
// this.getList(); // this.getList();
}, },
data() { data() {
@ -154,6 +156,7 @@ export default {
scenicOptions: [], scenicOptions: [],
customerOptions: [], customerOptions: [],
pilotOptions: [], pilotOptions: [],
typeOptions: [], //
tableData: [], tableData: [],
selection: [], selection: [],
}; };
@ -163,6 +166,20 @@ export default {
getSettlementStatusText, getSettlementStatusText,
getOrderStatusClass, getOrderStatusClass,
getSettlementStatusClass, getSettlementStatusClass,
//
async getFlightTypes() {
try {
const res = await get('user_qualification');
if (res && res.content) {
this.typeOptions = res.content.sort((a, b) => a.dictSort - b.dictSort);
}
} catch (error) {
this.$message.error("获取飞行类型失败");
console.error("获取飞行类型失败:", error);
this.typeOptions = [];
}
},
getList() { getList() {
this.loading = true; this.loading = true;
const params = { const params = {
@ -194,7 +211,7 @@ export default {
scenicName: scenic ? scenic.name : "未知景区", scenicName: scenic ? scenic.name : "未知景区",
route: record.routeName, route: record.routeName,
initiator: initiator ? initiator.name : "未知发起人", initiator: initiator ? initiator.name : "未知发起人",
type: record.orderType === 1 ? "载物飞行" : "载人飞行", type: this.typeOptions.find(t => t.dictSort === record.orderType).label || '未知',
mainOrderStatus: record.mainOrderStatus, mainOrderStatus: record.mainOrderStatus,
settlementStatus: record.settlementStatus, settlementStatus: record.settlementStatus,
id: record.id, id: record.id,
@ -225,19 +242,19 @@ export default {
try { try {
let res = []; let res = [];
// //
const userRes = await getUser({ id: store.getters.user.id }); // const userRes = await getUser({ id: store.getters.user.id });
if (userRes && userRes.content && userRes.content.length > 0) { // if (userRes && userRes.content && userRes.content.length > 0) {
const userInfo = userRes.content[0]; // const userInfo = userRes.content[0];
if (userInfo.roles && userInfo.roles.length > 0) { // if (userInfo.roles && userInfo.roles.length > 0) {
this.userRole = userInfo.roles[0].name; // this.userRole = userInfo.roles[0].name;
// // //
if (this.userRole === "区域负责人") { // if (this.userRole === "") {
res = await allScenic({areaId: userInfo.areaId}); // res = await allScenic({areaId: userInfo.areaId});
} else if (this.userRole === "管理员" || this.userRole === "财务") { // } else if (this.userRole === "" || this.userRole === "") {
res = await allScenic(); res = await allScenic();
} // }
} // }
} // }
// //
if (res && Array.isArray(res)) { if (res && Array.isArray(res)) {
this.scenicOptions = res.map((scenic) => ({ this.scenicOptions = res.map((scenic) => ({

View File

@ -139,6 +139,7 @@
import { getOrderList, getGenerateSettleOrderConfirmList, generateSettlementOrder } from "@/api/order"; import { getOrderList, getGenerateSettleOrderConfirmList, generateSettlementOrder } from "@/api/order";
import { allAreas } from "@/api/system/area"; import { allAreas } from "@/api/system/area";
import { allScenic } from "@/api/system/scenic"; import { allScenic } from "@/api/system/scenic";
import { get } from "@/api/system/dictDetail";
import { allCustomer } from "@/api/system/customer"; import { allCustomer } from "@/api/system/customer";
import { getList } from "@/api/system/pilot"; import { getList } from "@/api/system/pilot";
import { getUser } from "@/api/system/user"; import { getUser } from "@/api/system/user";
@ -151,6 +152,7 @@ export default {
this.getScenics(); this.getScenics();
this.getCustomers(); this.getCustomers();
this.getPilots(); this.getPilots();
this.getFlightTypes();
this.getList(); this.getList();
}, },
data() { data() {
@ -177,6 +179,7 @@ export default {
scenicAreaOptions: [], scenicAreaOptions: [],
customerOptions: [], customerOptions: [],
pilotOptions: [], pilotOptions: [],
typeOptions: [], //
tableData: [], tableData: [],
selection: [] selection: []
} }
@ -186,6 +189,19 @@ export default {
getSettlementStatusText, getSettlementStatusText,
getOrderStatusClass, getOrderStatusClass,
getSettlementStatusClass, getSettlementStatusClass,
//
async getFlightTypes() {
try {
const res = await get('user_qualification');
if (res && res.content) {
this.typeOptions = res.content.sort((a, b) => a.dictSort - b.dictSort);
}
} catch (error) {
this.$message.error("获取飞行类型失败");
console.error("获取飞行类型失败:", error);
this.typeOptions = [];
}
},
getList() { getList() {
this.loading = true; this.loading = true;
const params = { const params = {
@ -217,7 +233,7 @@ export default {
scenicArea: scenic ? scenic.name : "未知景区", scenicArea: scenic ? scenic.name : "未知景区",
route: record.routeName, route: record.routeName,
initiator: initiator ? initiator.name : "未知发起人", initiator: initiator ? initiator.name : "未知发起人",
orderType: record.orderType === 1 ? "载物飞行" : "载人飞行", orderType: this.typeOptions.find(t => t.dictSort === record.orderType).label || '未知',
mainOrderStatus: record.mainOrderStatus, mainOrderStatus: record.mainOrderStatus,
settlementStatus: record.settlementStatus, settlementStatus: record.settlementStatus,
}; };

View File

@ -11,7 +11,7 @@
<div class="head-container"> <div class="head-container">
<div class="filter-container"> <div class="filter-container">
<el-input <el-input
v-model="query.batchNo" v-model="query.结算批次号"
placeholder="请输入结算单批次号" placeholder="请输入结算单批次号"
class="filter-item" class="filter-item"
style="width: 200px;" style="width: 200px;"
@ -96,7 +96,7 @@ export default {
return { return {
loading: false, loading: false,
query: { query: {
batchNo: '' 结算批次号: ''
}, },
page: { page: {
current: 1, current: 1,

View File

@ -80,7 +80,7 @@
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.orderType === 1 ? '载物飞行' : '载人飞行' }}</span> <span>{{ typeOptions.find(t => t.dictSort === scope.row.orderType).label || '未知' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -161,6 +161,7 @@
import { getOrderStatusText, getSettlementStatusText, getOrderStatusClass, getSettlementStatusClass } from "@/utils/orderStatus"; import { getOrderStatusText, getSettlementStatusText, getOrderStatusClass, getSettlementStatusClass } from "@/utils/orderStatus";
import { getSettleOrderDetail, updateSettleOrderStatus, printSettleOrderData } from '@/api/order' import { getSettleOrderDetail, updateSettleOrderStatus, printSettleOrderData } from '@/api/order'
import { getDetail } from "@/api/system/pilot"; import { getDetail } from "@/api/system/pilot";
import { get } from "@/api/system/dictDetail";
import { getCustomerId } from '@/api/system/customer' import { getCustomerId } from '@/api/system/customer'
import { getScenicValue } from '@/api/dropdown' import { getScenicValue } from '@/api/dropdown'
import SettlementPdf from './settlementPdf.vue' import SettlementPdf from './settlementPdf.vue'
@ -175,6 +176,7 @@ export default {
orderId: '', orderId: '',
loading: false, loading: false,
scenicAreaOptions: [], scenicAreaOptions: [],
typeOptions: [], //
settlementStatus: 0, settlementStatus: 0,
currentOrder: null, currentOrder: null,
originalData: [], // originalData: [], //
@ -215,12 +217,26 @@ export default {
} else { } else {
this.$message.error('没有提供订单ID') this.$message.error('没有提供订单ID')
} }
this.getFlightTypes()
}, },
methods: { methods: {
getOrderStatusText, getOrderStatusText,
getSettlementStatusText, getSettlementStatusText,
getOrderStatusClass, getOrderStatusClass,
getSettlementStatusClass, getSettlementStatusClass,
//
async getFlightTypes() {
try {
const res = await get('user_qualification');
if (res && res.content) {
this.typeOptions = res.content.sort((a, b) => a.dictSort - b.dictSort);
}
} catch (error) {
console.error("获取飞行类型失败:", error);
this.$message.error("获取飞行类型失败");
this.typeOptions = [];
}
},
async getOrderDetail(orderId) { async getOrderDetail(orderId) {
try { try {
const settleOrderDetail = await getSettleOrderDetail(orderId) const settleOrderDetail = await getSettleOrderDetail(orderId)

View File

@ -330,9 +330,9 @@
}, },
// //
[CRUD.HOOK.afterValidateCU](crud) { [CRUD.HOOK.afterValidateCU](crud) {
const rolesIds = this.roles.find(item=>item.name === '飞行员').id; // const rolesIds = this.roles.find(item=>item.name === '').id;
crud.form.userType = 1; crud.form.userType = 1;
crud.form.roles = [{id:rolesIds}]; // crud.form.roles = [{id:rolesIds}];
return true; return true;
}, },
// //