飞行资质和保险类型采用字典数据
This commit is contained in:
parent
4fca11d1b7
commit
526c511bd7
@ -139,6 +139,7 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import { upload } from '@/utils/upload'
|
||||
import { addInsurance, getInsuranceDetail, deleteInsurance, editInsurance } from '@/api/aircraft'
|
||||
import { get as getDictDetail } from '@/api/system/dictDetail'
|
||||
|
||||
export default {
|
||||
name: "InsuranceRecord",
|
||||
@ -182,11 +183,7 @@ export default {
|
||||
edit: ['admin', 'aircraftDetail:edit'],
|
||||
delete: ['admin', 'aircraftDetail:delete']
|
||||
},
|
||||
insuranceTypes: [
|
||||
{ value: 0, label: "三方险" },
|
||||
{ value: 1, label: "设备险" },
|
||||
{ value: 2, label: "运营险" },
|
||||
],
|
||||
insuranceTypes: [],
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入保险名称", trigger: "blur" }],
|
||||
insuranceType: [
|
||||
@ -201,7 +198,23 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getInsuranceTypes()
|
||||
},
|
||||
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) {
|
||||
const found = this.insuranceTypes.find(t => t.value === type)
|
||||
return found ? found.label : '未知类型'
|
||||
|
@ -32,6 +32,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getDeviceDetail, getMaintenanceRecords, getInsuranceRecords } from '@/api/aircraft'
|
||||
import { get } from "@/api/system/dictDetail";
|
||||
import BasicInfo from './components/BasicInfo'
|
||||
import MaintenanceRecord from './components/MaintenanceRecord'
|
||||
import InsuranceRecord from './components/InsuranceRecord'
|
||||
@ -47,17 +48,18 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
name: '大疆',
|
||||
model: 'T100',
|
||||
useType: '载人飞行',
|
||||
areaName: '北京',
|
||||
scenicName: '白云山',
|
||||
username: '小明',
|
||||
remark: '设备状态良好',
|
||||
name: '',
|
||||
model: '',
|
||||
useType: '',
|
||||
areaName: '',
|
||||
scenicName: '',
|
||||
username: '',
|
||||
remark: '',
|
||||
deviceImages: [
|
||||
'https://axure-file.lanhuapp.com/md5__f344f816278c2a3f5164e4571c580ad9.png'
|
||||
]
|
||||
},
|
||||
typeOptions: [], // 飞行类型选项
|
||||
maintenanceData: [],
|
||||
insuranceData: [],
|
||||
maintenancePage: {
|
||||
@ -79,17 +81,36 @@ export default {
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.getFlightTypes()
|
||||
const id = this.$route.query.id
|
||||
const rowData = this.$route.query.data ? JSON.parse(this.$route.query.data) : null
|
||||
if (rowData) {
|
||||
setTimeout(() => {
|
||||
this.getDetail(id, rowData)
|
||||
}, 0)
|
||||
}else {
|
||||
setTimeout(() => {
|
||||
this.getDetail(id)
|
||||
}, 0)
|
||||
}
|
||||
this.loadMaintenanceRecords()
|
||||
this.loadInsuranceRecords()
|
||||
},
|
||||
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) {
|
||||
getDeviceDetail(id).then(response => {
|
||||
this.form = response
|
||||
@ -98,7 +119,8 @@ export default {
|
||||
this.form.scenicName = rowData.scenicName
|
||||
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) => {
|
||||
if (typeof image === 'string') {
|
||||
|
@ -32,6 +32,7 @@
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="area in areaOptions"
|
||||
@ -85,9 +86,12 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="useType">
|
||||
<el-select v-model="form.useType" style="width: 150px">
|
||||
<el-option :value="0" label="载物飞行" />
|
||||
<el-option :value="1" label="载人飞行" />
|
||||
<el-option :value="2" label="其他" />
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.dictSort"
|
||||
:value="item.dictSort"
|
||||
:label="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域" prop="areaId">
|
||||
@ -214,13 +218,7 @@
|
||||
<el-table-column label="型号" prop="model" />
|
||||
<el-table-column label="类型" prop="useType">
|
||||
<template slot-scope="scope">
|
||||
{{
|
||||
scope.row.useType === 0
|
||||
? "载物飞行"
|
||||
: scope.row.useType === 1
|
||||
? "载人飞行"
|
||||
: "其他"
|
||||
}}
|
||||
{{ typeOptions.find(t => t.dictSort === scope.row.useType)?typeOptions.find(t => t.dictSort === scope.row.useType).label : '未知' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负责人" prop="username" />
|
||||
@ -276,6 +274,7 @@ import crudAircraft from "@/api/aircraft";
|
||||
import { allAreas } from "@/api/system/area";
|
||||
import { getList, getDetail } from "@/api/system/pilot";
|
||||
import { allScenic } from "@/api/system/scenic";
|
||||
import { get } from "@/api/system/dictDetail";
|
||||
import { upload } from "@/utils/upload";
|
||||
import { mapGetters } from "vuex";
|
||||
import rrOperation from "@crud/RR.operation";
|
||||
@ -285,7 +284,7 @@ const defaultForm = {
|
||||
name: null,
|
||||
brand: null,
|
||||
model: null,
|
||||
useType: 0,
|
||||
useType: 1,
|
||||
areaId: null,
|
||||
scenicId: null,
|
||||
employeesId: null,
|
||||
@ -359,6 +358,7 @@ export default {
|
||||
areaOptions: [],
|
||||
scenicOptions: [],
|
||||
employeeOptions: [],
|
||||
typeOptions: [], // 飞行类型选项
|
||||
// 默认数据
|
||||
query: {
|
||||
name: "",
|
||||
@ -406,6 +406,8 @@ export default {
|
||||
this.getAreas();
|
||||
// 获取飞行员列表
|
||||
this.getEmployees();
|
||||
// 获取飞行类型
|
||||
this.getFlightTypes();
|
||||
},
|
||||
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() {
|
||||
try {
|
||||
|
@ -122,6 +122,7 @@ import { getOrderList } from "@/api/order";
|
||||
import { allAreas } from "@/api/system/area";
|
||||
import { allScenic } from "@/api/system/scenic";
|
||||
import { allCustomer } from "@/api/system/customer";
|
||||
import { get } from "@/api/system/dictDetail";
|
||||
import { getList } from "@/api/system/pilot";
|
||||
import { getOrderDetail } from "@/api/order";
|
||||
import { getUser } from "@/api/system/user";
|
||||
@ -135,6 +136,7 @@ export default {
|
||||
this.getScenics();
|
||||
this.getPilots();
|
||||
this.getCustomers();
|
||||
this.getFlightTypes();
|
||||
// this.getList();
|
||||
},
|
||||
data() {
|
||||
@ -154,6 +156,7 @@ export default {
|
||||
scenicOptions: [],
|
||||
customerOptions: [],
|
||||
pilotOptions: [],
|
||||
typeOptions: [], // 飞行类型选项
|
||||
tableData: [],
|
||||
selection: [],
|
||||
};
|
||||
@ -163,6 +166,20 @@ export default {
|
||||
getSettlementStatusText,
|
||||
getOrderStatusClass,
|
||||
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() {
|
||||
this.loading = true;
|
||||
const params = {
|
||||
@ -194,7 +211,7 @@ export default {
|
||||
scenicName: scenic ? scenic.name : "未知景区",
|
||||
route: record.routeName,
|
||||
initiator: initiator ? initiator.name : "未知发起人",
|
||||
type: record.orderType === 1 ? "载物飞行" : "载人飞行",
|
||||
type: this.typeOptions.find(t => t.dictSort === record.orderType).label || '未知',
|
||||
mainOrderStatus: record.mainOrderStatus,
|
||||
settlementStatus: record.settlementStatus,
|
||||
id: record.id,
|
||||
|
@ -139,6 +139,7 @@
|
||||
import { getOrderList, getGenerateSettleOrderConfirmList, generateSettlementOrder } from "@/api/order";
|
||||
import { allAreas } from "@/api/system/area";
|
||||
import { allScenic } from "@/api/system/scenic";
|
||||
import { get } from "@/api/system/dictDetail";
|
||||
import { allCustomer } from "@/api/system/customer";
|
||||
import { getList } from "@/api/system/pilot";
|
||||
import { getUser } from "@/api/system/user";
|
||||
@ -151,6 +152,7 @@ export default {
|
||||
this.getScenics();
|
||||
this.getCustomers();
|
||||
this.getPilots();
|
||||
this.getFlightTypes();
|
||||
this.getList();
|
||||
},
|
||||
data() {
|
||||
@ -177,6 +179,7 @@ export default {
|
||||
scenicAreaOptions: [],
|
||||
customerOptions: [],
|
||||
pilotOptions: [],
|
||||
typeOptions: [], // 飞行类型选项
|
||||
tableData: [],
|
||||
selection: []
|
||||
}
|
||||
@ -186,6 +189,19 @@ export default {
|
||||
getSettlementStatusText,
|
||||
getOrderStatusClass,
|
||||
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() {
|
||||
this.loading = true;
|
||||
const params = {
|
||||
@ -217,7 +233,7 @@ export default {
|
||||
scenicArea: scenic ? scenic.name : "未知景区",
|
||||
route: record.routeName,
|
||||
initiator: initiator ? initiator.name : "未知发起人",
|
||||
orderType: record.orderType === 1 ? "载物飞行" : "载人飞行",
|
||||
orderType: this.typeOptions.find(t => t.dictSort === record.orderType).label || '未知',
|
||||
mainOrderStatus: record.mainOrderStatus,
|
||||
settlementStatus: record.settlementStatus,
|
||||
};
|
||||
|
@ -80,7 +80,7 @@
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.orderType === 1 ? '载物飞行' : '载人飞行' }}</span>
|
||||
<span>{{ typeOptions.find(t => t.dictSort === scope.row.orderType).label || '未知' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -161,6 +161,7 @@
|
||||
import { getOrderStatusText, getSettlementStatusText, getOrderStatusClass, getSettlementStatusClass } from "@/utils/orderStatus";
|
||||
import { getSettleOrderDetail, updateSettleOrderStatus, printSettleOrderData } from '@/api/order'
|
||||
import { getDetail } from "@/api/system/pilot";
|
||||
import { get } from "@/api/system/dictDetail";
|
||||
import { getCustomerId } from '@/api/system/customer'
|
||||
import { getScenicValue } from '@/api/dropdown'
|
||||
import SettlementPdf from './settlementPdf.vue'
|
||||
@ -175,6 +176,7 @@ export default {
|
||||
orderId: '',
|
||||
loading: false,
|
||||
scenicAreaOptions: [],
|
||||
typeOptions: [], // 飞行类型选项
|
||||
settlementStatus: 0,
|
||||
currentOrder: null,
|
||||
originalData: [], // 存储原始数据,用于筛选
|
||||
@ -215,12 +217,26 @@ export default {
|
||||
} else {
|
||||
this.$message.error('没有提供订单ID')
|
||||
}
|
||||
this.getFlightTypes()
|
||||
},
|
||||
methods: {
|
||||
getOrderStatusText,
|
||||
getSettlementStatusText,
|
||||
getOrderStatusClass,
|
||||
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) {
|
||||
try {
|
||||
const settleOrderDetail = await getSettleOrderDetail(orderId)
|
||||
|
Loading…
Reference in New Issue
Block a user