8.9 代码提交

master
shilei 4 months ago
parent 28d7aef1e1
commit 1cf5c4f37e

@ -0,0 +1,88 @@
import request from '@/config/axios'
// 仓位 VO
export interface BinInfoVO {
// id
id: number
// 换电站编码
stationNo: string
// 仓位编号
no: string
// 仓位编码
code: string
// 仓位名称
name: string
// 在位状态0-不在位1-在位2-无效
exists: number
// 电池编号
batteryNo: string
// 充电机编号
chargerNo: string
// 充电枪编号
chargerGunNo: string
// 水冷编号
waterCoolNo: string
// 是否有电插头;0-无电插头1-有电插头
elecPluginFlag: number
// 电插头状态;0-未知1-已经连接2-未连接
elecPluginStatus: string
// 是否有水插头;0-无水插头1-有水插头
waterPluginFlag: string
// 预约锁定;0-未锁定1-锁定
amtLock: number
// soc
soc: number
// soe
soe: number
// soh
soh: number
// 电池入仓顺序
batteryEnterSeq: number
// 充电状态;0-未知1-正在充电2-无电池3-禁用 4-充電完成
chargeStatus: number
// 仓位状态;0-禁用1-启用
status: number
// 最后结束充电时间 结束充电后更新
lastChargeFinishTime: Date
// 缓存仓标记,0不是 1:是
cacheBinFlag: number
// 是否可以换电,0不能 1:能
canSwapFlag: number
// 是否可以充电,0不能 1
canChargeFlag: number
// 入仓时间
inTime: Date
}
// 仓位 API
export const BinInfoApi = {
// 查询仓位分页
getBinInfoPage: async (params: any) => {
return await request.get({ url: `/cloud/bin-info/page`, params })
},
// 查询仓位详情
getBinInfo: async (id: number) => {
return await request.get({ url: `/cloud/bin-info/get?id=` + id })
},
// 新增仓位
createBinInfo: async (data: BinInfoVO) => {
return await request.post({ url: `/cloud/bin-info/create`, data })
},
// 修改仓位
updateBinInfo: async (data: BinInfoVO) => {
return await request.put({ url: `/cloud/bin-info/update`, data })
},
// 删除仓位
deleteBinInfo: async (id: number) => {
return await request.delete({ url: `/cloud/bin-info/delete?id=` + id })
},
// 导出仓位 Excel
exportBinInfo: async (params) => {
return await request.download({ url: `/cloud/bin-info/export-excel`, params })
},
}

@ -0,0 +1,94 @@
import request from '@/config/axios'
// 车队 VO
export interface TeamVO {
// 编码
id: number
// 运营商id
operatorId: number
// 队长 userid
captain: number
// 车队编码
teamCode: string
// 车队名称
teamName: string
// 负责人
principal: string
// 联系方式
contactWay: string
// 舍入模式
roundingMode: number
// 额度限制
limit: number
// 是否开启
openFlag: number
}
// 车队 API
export const TeamApi = {
// 查询车队分页
getTeamPage: async (params: any) => {
return await request.get({ url: `/cloud/team/page`, params })
},
// 查询车队详情
getTeam: async (id: number) => {
return await request.get({ url: `/cloud/team/get?id=` + id })
},
// 启用车队账户
getTeamEnable: async (params: any) => {
return await request.get({ url: `/cloud/team/enable/${params.id}` })
},
// 新增车队
createTeam: async (data: TeamVO) => {
return await request.post({ url: `/cloud/team/create`, data })
},
// 选择多辆车辆绑定
postcheckbindVehicle: async (data: any) => {
return await request.post({ url: `/cloud/team/bindVehicle`, data })
},
// 修改车队
updateTeam: async (data: TeamVO) => {
return await request.put({ url: `/cloud/team/update`, data })
},
// 删除车队
deleteTeam: async (id: number) => {
return await request.delete({ url: `/cloud/team/delete?id=` + id })
},
// 导出车队 Excel
exportTeam: async (params) => {
return await request.download({ url: `/cloud/team/export-excel`, params })
},
// ==================== 子表(车队车辆信息) ====================
// 获得车队车辆信息分页
getTeamVehiclePage: async (params) => {
return await request.get({ url: `/cloud/teamVehicle/page`, params })
},
// 新增车队车辆信息
createTeamVehicle: async (data) => {
return await request.post({ url: `/cloud/teamVehicle/create`, data })
},
// 修改车队车辆信息
updateTeamVehicle: async (data) => {
return await request.put({ url: `/cloud/teamVehicle/update`, data })
},
// 删除车队车辆信息
deleteTeamVehicle: async (id: number) => {
return await request.delete({ url: `/cloud/teamVehicle/delete?id=` + id })
},
// 获得车队车辆信息
getTeamVehicle: async (id: number) => {
return await request.get({ url: `/cloud/teamVehicle/get?id=` + id })
},
}

@ -0,0 +1,144 @@
import request from '@/config/axios'
// 换电站基础信息 VO
export interface StationInfoVO {
// id
id: number
// 运营商id
operatorId: number
// 换电站编码
stationNo: string
// 换电站名称
stationName: string
// 换电站识别号
stationSn: string
// 地理位置
stationLocation: string
// 站类型
stationType: number
// 计费模型id
sbmId: number
// 电价模型id
priceId: number
// 场站运营模型id
runId: number
// 换电站现场照片
avatar: string
// 纬度
latitude: string
// 经度
longitude: string
// 区域名称
areaName: string
// 区域编号
areaCode: string
// 营运时间
operationTime: Date
// 投放时间
launchTime: Date
// 联系方式-手机号
contactWay: string
// 服务电话400开头
serviceTel: string
// 联系方式-邮箱地址
email: string
// 负责人
principal: string
// 所属运营企业
stationCompany: string
// 所属运营企业统一社会信用代码
socialCreditCode: string
// 站控主机软件版本号
stationSftVer: string
// 供应商代码
supplierCode: string
// 云平台区域编码
nodeId: number
// 场站服务状态:0未知 1:换电站服务启用 2:换电站服务停用
status: number
// 站控版本号
version: string
// 协议版本号
protocolVersion: string
// 设备列表版本号
deviceVersion: string
// 场站运行模式:0:本地模式;1:云端模式
runModel: number
// 工位分类
staType: string
// 区域分类
areaType: string
// 特殊配置
specialConfig: string
// 站型类型
type: string
// 是否小程序可见:0否1是
appAccess: number
// 1.计费模型(交流/直流/SOC);2.计费模型(交流);3.计费模型(直流);4.计费模型(交流) + 电网电价(直流);5.计费模型(交流) + 电网电价(交流);6.计费模型(直流) + 电网电价(交流);7.计费模型(直流) + 电网电价(直流
settleType: number
// 站点类型 1公共; 50:个人; 100公交专用101环卫专用102物流专用103 出租⻋专用104分时租赁专用105小区共享专用106单位专用107私人共享桩专用255其他")
siteType: number
// 服务车型
matchVehicles: string
// is open all hours 是否全天营业0是;1否
oahFlag: number
// classification站点分类 1:充电站;2:换电站;3:充换电一体站
siteClassification: number
// construction建设场所 1居民区;2公共机构;3企事业单位;4写字楼;5工业园区;6交通枢纽;" + "7大型文体设施;8城市绿地;9大型建筑配建停车场;10路边停车位;11城际高速服务区;2风景区;13公交场站;14加油加气站;15出租车;255其他
constructionSite: number
// 电池运营模型id
batteryId: number
}
// 换电站基础信息 API
export const StationInfoApi = {
// 查询换电站基础信息分页
getStationInfoPage: async (params: any) => {
return await request.get({ url: `/cloud/station-info/page`, params })
},
// 查询换电站基础信息列表
getStationInfoList: async () => {
return await request.get({ url: `/cloud/station-info/list` })
},
// 查询电价模型
getBillingModelList: async () => {
return await request.get({ url: `/cloud/billing-model/list` })
},
// 查询换电计费模型
getElectricityPriceList: async () => {
return await request.get({ url: `/cloud/electricity-price/list` })
},
// 查询场站模型
getRunModelList: async () => {
return await request.get({ url: `/cloud/run-model/list` })
},
// 查询换电站基础信息详情
getStationInfo: async (id: number) => {
return await request.get({ url: `/cloud/station-info/get?id=` + id })
},
// 新增换电站基础信息
createStationInfo: async (data: StationInfoVO) => {
return await request.post({ url: `/cloud/station-info/create`, data })
},
// 修改换电站基础信息
updateStationInfo: async (data: StationInfoVO) => {
return await request.put({ url: `/cloud/station-info/update`, data })
},
// 删除换电站基础信息
deleteStationInfo: async (id: number) => {
return await request.delete({ url: `/cloud/station-info/delete?id=` + id })
},
// 导出换电站基础信息 Excel
exportStationInfo: async (params) => {
return await request.download({ url: `/cloud/station-info/export-excel`, params })
},
}

@ -101,13 +101,13 @@ export const getDictLabel = (dictType: string, value: any): string => {
}
export enum DICT_TYPE {
DETAIL_TYPE = 'detail_type',//1:上月订单收益 2:上月订单退款 3:跨月订单退款
COMMISSION_STATUS = 'commission_status',//状态0:未打款 1未完成打款 2已完成打款
PAYMENT_STATUS = 'payment_status',//0 未支付 10 支付成功 20 已退款 30 支付关闭
DETAIL_TYPE = 'detail_type',//1:上月订单收益 2:上月订单退款 3:跨月订单退款
COMMISSION_STATUS = 'commission_status',//状态0:未打款 1未完成打款 2已完成打款
PAYMENT_STATUS = 'payment_status',//0 未支付 10 支付成功 20 已退款 30 支付关闭
STORE_STATUS = 'store_status',//zz 门店状态 0-禁用 1-启用
VEHICLE_STATUS = 'vehicle_status',//zz车辆、电池 状态 在线状态: 0-离线1-在线
VEHICLE_STATUS_TWO = 'vehicle_status_two',//zz status车辆 状态 0-离线: 1-正常; 2-使用中;3-异常;4-停用
CAR_RENTAL_ORDER ='car_rental_order', //zz 骑行订单状态
CAR_RENTAL_ORDER = 'car_rental_order', //zz 骑行订单状态
REFUND_ORDER_STATUS = 'refund_order_status',//zz 退款单状态
CHECK_ORDER_STATUS = 'check_order_status',//zz退款状态 状态1-申请中2-退款成功3-取消
CHECK_ORDER_STATUS_ONE = 'check_order_status_one',//zz退款单状态 状态2-退款成功3-取消
@ -219,6 +219,30 @@ export enum DICT_TYPE {
CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别
CRM_PRODUCT_UNIT = 'crm_product_unit', // 产品单位
CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // 跟进方式
// ----------------------------------------------------------------------------最新
STATIONINFO_ENABLE = 'stationInfo_enable',
CONSTRUCTIONSITE = 'constructionSite',
SITECLASSIFICATION_TYPE = 'siteClassification_type',
OAHFLAG_STATUS = 'oahFlag_status',
SITE_TYPE = 'site_type',
APPACCESS_STATUS = 'appAccess_status',
RUNMODEL_TYPE = 'runModel_type',
STATION_INFO_STATUS = 'station_info_status',
SETTLE_TYPE = 'settle_type',
EXISTS_FLAG = 'existsFlag',
ELEC_PLUGIN_FLAG = 'elecPluginFlag',
ELEC_PLUGIN_STATUS = 'elecPluginStatus',
WATER_PLUGIN_FLAG = 'waterPluginFlag',
AMT_LOCK = 'amtLock',
CHARGE_STATUS = 'chargeStatus',
POSITION_STATUS = 'position_status',
CACHE_BIN_FLAG = 'cacheBinFlag',
CAN_SWAG_CHARGE_FLAG = 'canSwag_charge_Flag',
CANOFFLINE = 'canOffline',
OPENFLAG = 'openFlag',
ROUNDINGMODE = 'roundingMode',
}

@ -58,7 +58,7 @@
{{ t('login.remember') }}
</el-checkbox>
</el-col>
<!-- <el-col :offset="6" :span="12">
<!-- <el-col :offset="6" :span="12">
<el-link style="float: right" type="primary">{{ t('login.forgetPassword') }}</el-link>
</el-col> -->
</el-row>
@ -75,13 +75,13 @@
/>
</el-form-item>
</el-col>
<!-- <Verify
<Verify
ref="verify"
:captchaType="captchaType"
:imgSize="{ width: '400px', height: '200px' }"
mode="pop"
@success="handleLogin"
/> -->
/>
<!-- <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item>
<el-row :gutter="5" justify="space-between" style="width: 100%">
@ -207,7 +207,8 @@ const getCode = async () => {
} else {
//
//
verify.value.show()
// verify.value.show()
console.log(verify.value, '-------')
}
}
// ID

@ -58,7 +58,7 @@
{{ t('login.remember') }}
</el-checkbox>
</el-col>
<!-- <el-col :offset="6" :span="12">
<!-- <el-col :offset="6" :span="12">
<el-link style="float: right" type="primary">{{ t('login.forgetPassword') }}</el-link>
</el-col> -->
</el-row>
@ -266,7 +266,7 @@ const handleLogin = async (params) => {
}
authUtil.setToken(res)
if (!redirect.value) {
redirect.value = '/'
redirect.value = '/index'
}
// SSO
if (redirect.value.indexOf('sso') !== -1) {

@ -0,0 +1,388 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="120px"
v-loading="formLoading"
>
<el-row>
<el-col :span="12">
<el-form-item label="换电站编码" prop="stationNo">
<!-- <el-input v-model="formData.stationNo" placeholder="请输入换电站编码" /> -->
<el-select v-model="formData.stationNo" placeholder="请选择" style="width: 100%">
<el-option
:label="item.stationName"
:value="item.stationNo"
v-for="(item, index) in stationinfoList"
:key="index"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓位编号" prop="no">
<el-input v-model="formData.no" placeholder="请输入仓位编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="仓位编码" prop="code">
<el-input v-model="formData.code" placeholder="请输入仓位编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓位名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入仓位名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="在位状态" prop="exists">
<el-select v-model="formData.exists" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.EXISTS_FLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电池编号" prop="batteryNo">
<el-input v-model="formData.batteryNo" placeholder="请输入电池编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="充电机编号" prop="chargerNo">
<el-input v-model="formData.chargerNo" placeholder="请输入充电机编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="充电枪编号" prop="chargerGunNo">
<el-input v-model="formData.chargerGunNo" placeholder="请输入充电枪编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="水冷编号" prop="waterCoolNo">
<el-input v-model="formData.waterCoolNo" placeholder="请输入水冷编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否有电插头" prop="elecPluginFlag">
<el-select v-model="formData.elecPluginFlag" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ELEC_PLUGIN_FLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="电插头状态" prop="elecPluginStatus">
<el-select v-model="formData.elecPluginStatus" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ELEC_PLUGIN_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否有水插头" prop="waterPluginFlag">
<el-select v-model="formData.waterPluginFlag" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.WATER_PLUGIN_FLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="预约锁定" prop="amtLock">
<el-select v-model="formData.amtLock" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.AMT_LOCK)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="soc" prop="soc">
<el-input v-model="formData.soc" placeholder="请输入soc" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="soe" prop="soe">
<el-input v-model="formData.soe" placeholder="请输入soe" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="soh" prop="soh">
<el-input v-model="formData.soh" placeholder="请输入soh" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="电池入仓顺序" prop="batteryEnterSeq">
<el-input v-model="formData.batteryEnterSeq" placeholder="请输入电池入仓顺序" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="充电状态" prop="chargeStatus">
<el-select v-model="formData.chargeStatus" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CHARGE_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="仓位状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.POSITION_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束充电时间" prop="lastChargeFinishTime">
<el-date-picker
v-model="formData.lastChargeFinishTime"
type="date"
value-format="x"
placeholder="请选择"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="缓存仓标记" prop="cacheBinFlag">
<el-select v-model="formData.cacheBinFlag" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CACHE_BIN_FLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可以换电" prop="canSwapFlag">
<el-select v-model="formData.canSwapFlag" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CAN_SWAG_CHARGE_FLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否可以充电" prop="canChargeFlag">
<el-select v-model="formData.canChargeFlag" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CAN_SWAG_CHARGE_FLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入仓时间" prop="inTime">
<el-date-picker
v-model="formData.inTime"
type="date"
value-format="x"
placeholder="选择入仓时间"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { BinInfoApi, BinInfoVO } from '@/api/biz/bininfo'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
/** 仓位 表单 */
defineOptions({ name: 'BinInfoForm' })
const props = defineProps({
stationinfoList: {
type: Array,
default: () => []
}
})
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
stationNo: undefined,
no: undefined,
code: undefined,
name: undefined,
exists: undefined,
batteryNo: undefined,
chargerNo: undefined,
chargerGunNo: undefined,
waterCoolNo: undefined,
elecPluginFlag: undefined,
elecPluginStatus: undefined,
waterPluginFlag: undefined,
amtLock: undefined,
soc: undefined,
soe: undefined,
soh: undefined,
batteryEnterSeq: undefined,
chargeStatus: undefined,
status: undefined,
lastChargeFinishTime: undefined,
cacheBinFlag: undefined,
canSwapFlag: undefined,
canChargeFlag: undefined,
inTime: undefined
})
const formRules = reactive({
stationNo: [{ required: true, message: '换电站编码不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await BinInfoApi.getBinInfo(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as BinInfoApi.BinInfoVO
if (formType.value === 'create') {
await BinInfoApi.createBinInfo(data)
message.success(t('common.createSuccess'))
} else {
await BinInfoApi.updateBinInfo(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
stationNo: undefined,
no: undefined,
code: undefined,
name: undefined,
exists: undefined,
batteryNo: undefined,
chargerNo: undefined,
chargerGunNo: undefined,
waterCoolNo: undefined,
elecPluginFlag: undefined,
elecPluginStatus: undefined,
waterPluginFlag: undefined,
amtLock: undefined,
soc: undefined,
soe: undefined,
soh: undefined,
batteryEnterSeq: undefined,
chargeStatus: undefined,
status: undefined,
lastChargeFinishTime: undefined,
cacheBinFlag: undefined,
canSwapFlag: undefined,
canChargeFlag: undefined,
inTime: undefined
}
formRef.value?.resetFields()
}
</script>

@ -1,5 +1,305 @@
<template>
<span>111</span>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="100px"
>
<!-- <el-form-item label="换电站编码" prop="stationNo">
<el-input
v-model="queryParams.stationNo"
placeholder="请输入换电站编码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> -->
<el-form-item label="仓位编号" prop="no">
<el-input
v-model="queryParams.no"
placeholder="请输入仓位编号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="仓位编码" prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入仓位编码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="仓位名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入仓位名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" plain @click="openForm('create')">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button type="success" plain @click="handleExport" :loading="exportLoading">
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<!-- <el-table-column label="id" align="center" prop="id" /> -->
<el-table-column label="换电站名称" align="center" prop="stationNo" width="150">
<template #default="scope">
{{ handle_stationNo(scope.row.stationNo) }}
</template>
</el-table-column>
<el-table-column label="仓位编号" align="center" prop="no" width="150" />
<el-table-column label="仓位编码" align="center" prop="code" width="150" />
<el-table-column label="仓位名称" align="center" prop="name" width="150" />
<el-table-column label="在位状态" align="center" prop="exists" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.EXISTS_FLAG" :value="scope.row.existsFlag" />
</template>
</el-table-column>
<el-table-column label="电池编号" align="center" prop="batteryNo" width="150" />
<el-table-column label="充电机编号" align="center" prop="chargerNo" width="150" />
<el-table-column label="充电枪编号" align="center" prop="chargerGunNo" width="150" />
<el-table-column label="水冷编号" align="center" prop="waterCoolNo" width="150" />
<el-table-column label="是否有电插头" align="center" prop="elecPluginFlag" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.ELEC_PLUGIN_FLAG" :value="scope.row.elecPluginFlag" />
</template>
</el-table-column>
<el-table-column label="电插头状态" align="center" prop="elecPluginStatus" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.ELEC_PLUGIN_STATUS" :value="scope.row.elecPluginStatus" />
</template>
</el-table-column>
<el-table-column label="是否有水插头" align="center" prop="waterPluginFlag" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.WATER_PLUGIN_FLAG" :value="scope.row.waterPluginFlag" />
</template>
</el-table-column>
<el-table-column label="预约锁定" align="center" prop="amtLock" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.AMT_LOCK" :value="scope.row.amtLock" />
</template>
</el-table-column>
<el-table-column label="soc" align="center" prop="soc" width="150" />
<el-table-column label="soe" align="center" prop="soe" width="150" />
<el-table-column label="soh" align="center" prop="soh" width="150" />
<el-table-column label="电池入仓顺序" align="center" prop="batteryEnterSeq" width="150" />
<el-table-column label="充电状态" align="center" prop="chargeStatus" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CHARGE_STATUS" :value="scope.row.chargeStatus" />
</template>
</el-table-column>
<el-table-column label="仓位状态" align="center" prop="status" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.POSITION_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
label="结束充电时间"
align="center"
prop="lastChargeFinishTime"
:formatter="dateFormatter"
width="150"
/>
<el-table-column label="缓存仓标记" align="center" prop="cacheBinFlag" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CACHE_BIN_FLAG" :value="scope.row.cacheBinFlag" />
</template>
</el-table-column>
<el-table-column label="是否可以换电" align="center" prop="canSwapFlag" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CAN_SWAG_CHARGE_FLAG" :value="scope.row.canSwapFlag" />
</template>
</el-table-column>
<el-table-column label="是否可以充电" align="center" prop="canChargeFlag" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CAN_SWAG_CHARGE_FLAG" :value="scope.row.canChargeFlag" />
</template>
</el-table-column>
<el-table-column
label="入仓时间"
align="center"
prop="inTime"
:formatter="dateFormatter"
width="120px"
/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="120px"
/>
<el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope">
<el-button link type="primary" @click="openForm('update', scope.row.id)">
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BinInfoForm ref="formRef" @success="getList" :stationinfoList="stationinfoList" />
</template>
<script setup lang="ts">
</script>
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { BinInfoApi, BinInfoVO } from '@/api/biz/bininfo'
import { StationInfoApi, StationInfoVO } from '@/api/share/stationinfo'
import BinInfoForm from './BinInfoForm.vue'
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
/** 仓位 列表 */
defineOptions({ name: 'BinInfo' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<BinInfoVO[]>([]) //
//
const total = ref(0)
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
stationNo: undefined,
no: undefined,
code: undefined,
name: undefined,
exists: undefined,
batteryNo: undefined,
chargerNo: undefined,
chargerGunNo: undefined,
waterCoolNo: undefined,
elecPluginFlag: undefined,
elecPluginStatus: undefined,
waterPluginFlag: undefined,
amtLock: undefined,
soc: undefined,
soe: undefined,
soh: undefined,
batteryEnterSeq: undefined,
chargeStatus: undefined,
status: undefined,
lastChargeFinishTime: [],
cacheBinFlag: undefined,
canSwapFlag: undefined,
canChargeFlag: undefined,
inTime: [],
createTime: []
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
const handle_stationNo = (data) => {
let str = ''
for (var i = 0; i < stationinfoList.value.length; i++) {
if (data == stationinfoList.value[i].stationNo) {
str = stationinfoList.value[i].stationName
}
}
return str
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await BinInfoApi.getBinInfoPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
const stationinfoList = ref([])
const getStationList = async () => {
try {
const data = await StationInfoApi.getStationInfoList()
// console.log(data, 'data')
stationinfoList.value = data
} finally {
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await BinInfoApi.deleteBinInfo(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await BinInfoApi.exportBinInfo(queryParams)
download.excel(data, '仓位.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
getStationList()
})
</script>

@ -0,0 +1,171 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-row>
<el-col :span="12">
<el-form-item label="运营商" prop="operatorId">
<el-input v-model="formData.operatorId" placeholder="请输入" /> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="队长" prop="captain">
<el-input v-model="formData.captain" placeholder="请输入" /> </el-form-item
></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="车队编码" prop="teamCode">
<el-input v-model="formData.teamCode" placeholder="请输入" /> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="车队名称" prop="teamName">
<el-input v-model="formData.teamName" placeholder="请输入" /> </el-form-item
></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="负责人" prop="principal">
<el-input v-model="formData.principal" placeholder="请输入" /> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="联系方式" prop="contactWay">
<el-input v-model="formData.contactWay" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12"
><el-form-item label="额度限制" prop="limit">
<el-input v-model="formData.limit" placeholder="请输入额度限制" /> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="是否开启" prop="openFlag">
<el-select v-model="formData.openFlag" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.OPENFLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="舍入模式" prop="roundingMode">
<el-select v-model="formData.roundingMode" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ROUNDINGMODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-form-item
></el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { TeamApi, TeamVO } from '@/api/biz/team'
/** 车队 表单 */
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
operatorId: undefined,
captain: undefined,
teamCode: undefined,
teamName: undefined,
principal: undefined,
contactWay: undefined,
roundingMode: undefined,
limit: undefined,
openFlag: undefined
})
const formRules = reactive({
teamName: [{ required: true, message: '车队名称不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await TeamApi.getTeam(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as TeamApi.TeamVO
if (formType.value === 'create') {
await TeamApi.createTeam(data)
message.success(t('common.createSuccess'))
} else {
await TeamApi.updateTeam(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
operatorId: undefined,
captain: undefined,
teamCode: undefined,
teamName: undefined,
principal: undefined,
contactWay: undefined,
roundingMode: undefined,
limit: undefined,
openFlag: undefined
}
formRef.value?.resetFields()
}
</script>

@ -0,0 +1,188 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="车辆型号" prop="vehicleType">
<el-select v-model="formData.vehicleType" placeholder="请选择车辆型号">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="车牌号" prop="vehicleNo">
<el-input v-model="formData.vehicleNo" placeholder="请输入车牌号" />
</el-form-item>
<el-form-item label="车辆VIN码" prop="vehicleVin">
<el-input v-model="formData.vehicleVin" placeholder="请输入车辆VIN码" />
</el-form-item>
<el-form-item label="mac地址" prop="mac">
<el-input v-model="formData.mac" placeholder="请输入mac地址" />
</el-form-item>
<el-form-item label="rfid" prop="rfid">
<el-input v-model="formData.rfid" placeholder="请输入rfid" />
</el-form-item>
<el-form-item label="品牌" prop="brand">
<el-input v-model="formData.brand" placeholder="请输入品牌" />
</el-form-item>
<el-form-item label="底盘号码" prop="chassisNumber">
<el-input v-model="formData.chassisNumber" placeholder="请输入底盘号码" />
</el-form-item>
<el-form-item label="电动机号码" prop="engineNumber">
<el-input v-model="formData.engineNumber" placeholder="请输入电动机号码" />
</el-form-item>
<el-form-item label="购车日期" prop="purchaseDate">
<el-date-picker
v-model="formData.purchaseDate"
type="date"
value-format="x"
placeholder="选择购车日期"
/>
</el-form-item>
<el-form-item label="车辆厂家" prop="producer">
<el-input v-model="formData.producer" placeholder="请输入车辆厂家" />
</el-form-item>
<el-form-item label="所有人" prop="possessor">
<el-input v-model="formData.possessor" placeholder="请输入所有人" />
</el-form-item>
<el-form-item label="车辆外观" prop="vehicleApc">
<el-input v-model="formData.vehicleApc" placeholder="请输入车辆外观" />
</el-form-item>
<el-form-item label="离线换电有效时间" prop="startTime">
<el-date-picker
v-model="formData.startTime"
type="date"
value-format="x"
placeholder="选择离线换电有效时间"
/>
</el-form-item>
<el-form-item label="离线换电失效时间" prop="endTime">
<el-date-picker
v-model="formData.endTime"
type="date"
value-format="x"
placeholder="选择离线换电失效时间"
/>
</el-form-item>
<el-form-item label="是否允许离线换电:0不允许1允许" prop="canOffline">
<el-select v-model="formData.canOffline" placeholder="请选择是否允许离线换电:0不允许1允许">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CANOFFLINE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { TeamApi } from '@/api/biz/team'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
teamId: undefined,
vehicleType: undefined,
vehicleNo: undefined,
vehicleVin: undefined,
mac: undefined,
rfid: undefined,
brand: undefined,
chassisNumber: undefined,
engineNumber: undefined,
purchaseDate: undefined,
producer: undefined,
possessor: undefined,
vehicleApc: undefined,
startTime: undefined,
endTime: undefined,
canOffline: undefined,
})
const formRules = reactive({
vehicleVin: [{ required: true, message: '车辆VIN码不能为空', trigger: 'blur' }],
purchaseDate: [{ required: true, message: '购车日期不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number, teamId: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
formData.value.teamId = teamId
//
if (id) {
formLoading.value = true
try {
formData.value = await TeamApi.getTeamVehicle(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value
if (formType.value === 'create') {
await TeamApi.createTeamVehicle(data)
message.success(t('common.createSuccess'))
} else {
await TeamApi.updateTeamVehicle(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
teamId: undefined,
vehicleType: undefined,
vehicleNo: undefined,
vehicleVin: undefined,
mac: undefined,
rfid: undefined,
brand: undefined,
chassisNumber: undefined,
engineNumber: undefined,
purchaseDate: undefined,
producer: undefined,
possessor: undefined,
vehicleApc: undefined,
startTime: undefined,
endTime: undefined,
canOffline: undefined,
}
formRef.value?.resetFields()
}
</script>

@ -0,0 +1,145 @@
<template>
<!-- 列表 -->
<ContentWrap>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['biz:team:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<!-- <el-table-column label="id" align="center" prop="id" /> -->
<el-table-column label="车辆型号" align="center" prop="vehicleType" />
<el-table-column label="车牌号" align="center" prop="vehicleNo" />
<el-table-column label="车辆VIN码" align="center" prop="vehicleVin" />
<el-table-column label="mac地址" align="center" prop="mac" />
<el-table-column label="rfid" align="center" prop="rfid" />
<el-table-column label="品牌" align="center" prop="brand" />
<el-table-column label="底盘号码" align="center" prop="chassisNumber" />
<el-table-column label="电动机号码" align="center" prop="engineNumber" />
<el-table-column label="购车日期" align="center" prop="purchaseDate" />
<el-table-column label="车辆厂家" align="center" prop="producer" />
<el-table-column label="所有人" align="center" prop="possessor" />
<el-table-column label="车辆外观" align="center" prop="vehicleApc" />
<el-table-column label="离线换电有效时间" align="center" prop="startTime" />
<el-table-column label="离线换电失效时间" align="center" prop="endTime" />
<el-table-column label="是否允许离线换电" align="center" prop="canOffline">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CANOFFLINE" :value="scope.row.canOffline" />
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<!-- <el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['biz:team:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['biz:team:delete']"
>
删除
</el-button>
</template>
</el-table-column> -->
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<TeamVehicleForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import { TeamApi } from '@/api/biz/team'
import TeamVehicleForm from './TeamVehicleForm.vue'
const { t } = useI18n() //
const message = useMessage() //
const props = defineProps<{
teamId: undefined // id
}>()
const loading = ref(false) //
const list = ref([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
teamId: undefined
})
/** 监听主表的关联字段的变化,加载对应的子表数据 */
watch(
() => props.teamId,
(val) => {
console.log('teamId变化了');
queryParams.teamId = val
handleQuery()
},
{ immediate: false }
)
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await TeamApi.getTeamVehiclePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
if (!props.teamId) {
message.error('请选择一个车队')
return
}
formRef.value.open(type, id, props.teamId)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await TeamApi.deleteTeamVehicle(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
</script>

@ -1,5 +1,434 @@
<template>
<span>111</span>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<!-- <el-form-item label="运营商id" prop="operatorId">
<el-input
v-model="queryParams.operatorId"
placeholder="请输入运营商id"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> -->
<el-form-item label="队长" prop="captain">
<el-input
v-model="queryParams.captain"
placeholder="请输入队长"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!-- <el-form-item label="车队编码" prop="teamCode">
<el-input
v-model="queryParams.teamCode"
placeholder="请输入车队编码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> -->
<el-form-item label="车队名称" prop="teamName">
<el-input
v-model="queryParams.teamName"
placeholder="请输入车队名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!-- <el-form-item label="负责人" prop="principal">
<el-input
v-model="queryParams.principal"
placeholder="请输入负责人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="联系方式" prop="contactWay">
<el-input
v-model="queryParams.contactWay"
placeholder="请输入联系方式"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="舍入模式" prop="roundingMode">
<el-select
v-model="queryParams.roundingMode"
placeholder="请选择舍入模式"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ROUNDINGMODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="额度限制" prop="limit">
<el-input
v-model="queryParams.limit"
placeholder="请输入额度限制"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item> -->
<el-form-item label="是否开启" prop="openFlag">
<el-select
v-model="queryParams.openFlag"
placeholder="请选择是否开启"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.OPENFLAG)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" plain @click="openForm('create')">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button type="success" plain @click="handleExport" :loading="exportLoading">
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
highlight-current-row
@current-change="handleCurrentChange"
>
<el-table-column label="编码" align="center" prop="id" />
<!-- <el-table-column label="运营商id" align="center" prop="operatorId" /> -->
<el-table-column label="队长" align="center" prop="captain" />
<el-table-column label="车队编码" align="center" prop="teamCode" />
<el-table-column label="车队名称" align="center" prop="teamName" />
<el-table-column label="负责人" align="center" prop="principal" />
<el-table-column label="联系方式" align="center" prop="contactWay" />
<el-table-column label="舍入模式" align="center" prop="roundingMode">
<template #default="scope">
<dict-tag :type="DICT_TYPE.ROUNDINGMODE" :value="scope.row.roundingMode" />
</template>
</el-table-column>
<!-- <el-table-column label="额度限制" align="center" prop="limit" /> -->
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="是否开启" align="center" prop="openFlag">
<template #default="scope">
<dict-tag :type="DICT_TYPE.OPENFLAG" :value="scope.row.openFlag" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope">
<el-button link type="primary" @click="openForm('update', scope.row.id)">
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button>
<el-button link type="primary" @click="dialogVisible_binding = true">
绑定车辆
</el-button>
<el-popconfirm
title="是否确认启用?"
v-if="scope.row.openFlag == 0"
@confirm="handle_set_openflag(scope)"
>
<template #reference>
<el-button link type="primary">启用</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<TeamForm ref="formRef" @success="getList" />
<!-- 子表的列表 -->
<ContentWrap>
<el-tabs model-value="teamVehicle">
<el-tab-pane label="车队车辆信息" name="teamVehicle">
<TeamVehicleList :team-id="currentRow.id" />
</el-tab-pane>
</el-tabs>
</ContentWrap>
<!-- 绑定车辆 -->
<el-dialog v-model="dialogVisible_binding" title="绑定车辆" width="1200">
<div style="display: flex; flex-direction: column; justify-content: space-between">
<el-form
class="-mb-15px"
:model="bind_queryParams"
ref="bind_queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="车牌号" prop="captain">
<el-input
v-model="bind_queryParams.vehicleNo"
placeholder="请输入"
clearable
@keyup.enter="get_team_list"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="get_team_list"
><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
>
<el-button @click="bind_resetQuery"
><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button
>
</el-form-item>
</el-form>
<!-- -->
<el-table
:data="binding_tableData"
border
style="width: 100%; margin-top: 15px"
max-height="500"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column label="车辆型号" align="center" prop="vehicleType" />
<el-table-column label="车牌号" align="center" prop="vehicleNo" />
<el-table-column label="车辆VIN码" align="center" prop="vehicleVin" />
</el-table>
<div>
<Pagination
:total="bind_total"
v-model:page="bind_queryParams.pageNo"
v-model:limit="bind_queryParams.pageSize"
@pagination="get_team_list"
/>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible_binding = false">取消</el-button>
<el-button type="primary" @click="submit_bind"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
</script>
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { TeamApi, TeamVO } from '@/api/biz/team'
import TeamForm from './TeamForm.vue'
import TeamVehicleList from './components/TeamVehicleList.vue'
/** 车队 列表 */
defineOptions({ name: 'Team' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<TeamVO[]>([]) //
//
const total = ref(0)
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
operatorId: undefined,
captain: undefined,
teamCode: undefined,
teamName: undefined,
principal: undefined,
contactWay: undefined,
roundingMode: undefined,
limit: undefined,
createTime: [],
openFlag: undefined
})
const bind_queryParams = reactive({
pageNo: 1,
pageSize: 10,
vehicleType: undefined,
vehicleNo: undefined,
vehicleVin: undefined,
filerTeamFlag: true
})
const queryFormRef = ref() //
const bind_queryFormRef = ref() //
const exportLoading = ref(false) //
const dialogVisible_binding = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await TeamApi.getTeamPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
const binding_tableData = ref([])
const bind_total = ref(0)
const get_team_list = async () => {
try {
const data = await TeamApi.getTeamVehiclePage(bind_queryParams)
// let array = []
// data.list.map((item) => {
// if (item.teamId == null) {
// array.push(item)
// }
// })
// console.log(array, 'array')
binding_tableData.value = data.list
bind_total.value = data.total
} finally {
}
}
const currentRow_id = ref([])
const selectionChange = (rows: TeamVO[]) => {
let array = []
array = rows.map((item) => item.id)
// console.log(array, 'array')
currentRow_id.value = array
}
const submit_bind = async () => {
let params = {
teamId: currentRow.value.id,
vehicleIds: currentRow_id.value
}
try {
const data = await TeamApi.postcheckbindVehicle(params)
message.success('绑定成功')
dialogVisible_binding.value = false
// getList()
get_team_list()
currentRow.value.id = 0
currentRow.value.id = params.teamId
} finally {
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
const bind_resetQuery = () => {
bind_queryFormRef.value.resetFields()
get_team_list()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await TeamApi.deleteTeam(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
const handle_set_openflag = async (scope: any) => {
try {
let params = {
id: scope.row.id
}
await TeamApi.getTeamEnable(params)
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await TeamApi.exportTeam(queryParams)
download.excel(data, '车队.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 选中行操作 */
const currentRow = ref({}) //
const handleCurrentChange = (row) => {
currentRow.value = row
}
/** 初始化 **/
onMounted(() => {
getList()
get_team_list()
})
</script>

@ -0,0 +1,578 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="150px"
v-loading="formLoading"
>
<!-- <el-form-item label="运营商id" prop="operatorId">
<el-input v-model="formData.operatorId" placeholder="请输入运营商id" />
</el-form-item> -->
<el-row>
<el-col :span="12">
<el-form-item label="换电站编码" prop="stationNo">
<el-input v-model="formData.stationNo" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="换电站名称" prop="stationName">
<el-input v-model="formData.stationName" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="换电站识别号" prop="stationSn">
<el-input v-model="formData.stationSn" placeholder="请输入" /> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="地理位置" prop="stationLocation">
<el-input v-model="formData.stationLocation" placeholder="请输入" /> </el-form-item
></el-col>
</el-row>
<el-row>
<el-col :span="12"
><el-form-item label="站类型" prop="stationType">
<el-select v-model="formData.stationType" placeholder="请选择" style="width: 100%">
<el-option label="请选择" value="" />
</el-select> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="计费模型" prop="sbmId">
<el-select v-model="formData.sbmId" placeholder="请选择" style="width: 100%">
<el-option
:label="item.name"
:value="item.id"
v-for="(item, index) in sbmIdlist"
:key="index"
/>
</el-select> </el-form-item
></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="电价模型" prop="priceId">
<el-select v-model="formData.priceId" placeholder="请选择" style="width: 100%">
<el-option
:label="item.name"
:value="item.id"
v-for="(item, index) in priceIdList"
:key="index"
/>
</el-select> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="场站运营模型" prop="runId">
<el-select v-model="formData.runId" placeholder="请选择" style="width: 100%">
<el-option
:label="item.name"
:value="item.id"
v-for="(item, index) in runIdlist"
:key="index"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="经度" prop="longitude">
<el-input v-model="formData.longitude" placeholder="请输入" /> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="纬度" prop="latitude">
<el-input v-model="formData.latitude" placeholder="请输入" /> </el-form-item
></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="区域编号" prop="areaCode">
<el-input v-model="formData.areaCode" placeholder="请输入" /> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="营运时间" prop="operationTime">
<el-date-picker
v-model="formData.operationTime"
type="date"
value-format="x"
placeholder="选择营运时间"
style="width: 100%"
/> </el-form-item
></el-col>
</el-row>
<el-row>
<el-col :span="12"
><el-form-item label="投放时间" prop="launchTime">
<el-date-picker
v-model="formData.launchTime"
type="date"
value-format="x"
placeholder="选择投放时间"
style="width: 100%"
/> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item label="手机号" prop="contactWay">
<el-input v-model="formData.contactWay" placeholder="请输入" /> </el-form-item
></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="服务电话" prop="serviceTel">
<el-input v-model="formData.serviceTel" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系方式-邮箱地址" prop="email">
<el-input v-model="formData.email" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="负责人" prop="principal">
<el-input v-model="formData.principal" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属运营企业" prop="stationCompany">
<el-input v-model="formData.stationCompany" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="12">
<el-form-item label="电池运营模型" prop="batteryId">
<el-input v-model="formData.batteryId" placeholder="请输入" />
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="站控主机软件版本号" prop="stationSftVer">
<el-input v-model="formData.stationSftVer" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="云平台区域编码" prop="nodeId">
<el-input v-model="formData.nodeId" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="场站服务状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.STATION_INFO_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="协议版本号" prop="protocolVersion">
<el-input v-model="formData.protocolVersion" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备列表版本号" prop="deviceVersion">
<el-input v-model="formData.deviceVersion" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="场站运行模式" prop="runModel">
<el-select v-model="formData.runModel" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.RUNMODEL_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工位分类" prop="staType">
<el-select v-model="formData.staType" placeholder="请选择" style="width: 100%">
<el-option label="请选择" value="" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="区域分类" prop="areaType">
<el-select v-model="formData.areaType" placeholder="请选择" style="width: 100%">
<el-option label="请选择" value="" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="特殊配置" prop="specialConfig">
<el-input v-model="formData.specialConfig" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="站型类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择" style="width: 100%">
<el-option label="请选择" value="" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否小程序可见" prop="appAccess">
<el-select v-model="formData.appAccess" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.APPACCESS_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="计费模型" prop="settleType">
<el-select v-model="formData.settleType" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SETTLE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="站点类型" prop="siteType">
<el-select v-model="formData.siteType" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SITE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="服务车型" prop="matchVehicles">
<el-select v-model="formData.matchVehicles" placeholder="请选择" style="width: 100%">
<el-option label="请选择" value="" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否全天营业" prop="oahFlag">
<el-select v-model="formData.oahFlag" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.OAHFLAG_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="站点分类" prop="siteClassification">
<el-select
v-model="formData.siteClassification"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SITECLASSIFICATION_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="建设场所" prop="constructionSite">
<el-select v-model="formData.constructionSite" placeholder="请选择" style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CONSTRUCTIONSITE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="供应商代码" prop="supplierCode">
<el-input v-model="formData.supplierCode" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否启用" prop="enable">
<el-select
v-model="formData.siteClassification"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.STATIONINFO_ENABLE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
label="所属运营企业统一社会信用代码"
label-width="240px"
prop="socialCreditCode"
>
<el-input v-model="formData.socialCreditCode" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="站控版本号" prop="version">
<el-input v-model="formData.version" placeholder="请输入" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="换电站现场照片" prop="avatar">
<UploadImg v-model="formData.avatar" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="区域名称" prop="areaName">
<el-input v-model="formData.areaName" placeholder="请输入" /> </el-form-item
></el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { StationInfoApi, StationInfoVO } from '@/api/share/stationinfo'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
/** 换电站基础信息 表单 */
defineOptions({ name: 'StationInfoForm' })
const props = defineProps({
sbmIdlist: {
type: Array,
default: () => []
},
priceIdList: {
type: Array,
default: () => []
},
runIdlist: {
type: Array,
default: () => []
}
})
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
operatorId: undefined,
stationNo: undefined,
stationName: undefined,
stationSn: undefined,
stationLocation: undefined,
stationType: undefined,
sbmId: undefined,
priceId: undefined,
runId: undefined,
avatar: undefined,
latitude: undefined,
longitude: undefined,
areaName: undefined,
areaCode: undefined,
operationTime: undefined,
launchTime: undefined,
contactWay: undefined,
serviceTel: undefined,
email: undefined,
principal: undefined,
stationCompany: undefined,
socialCreditCode: undefined,
stationSftVer: undefined,
supplierCode: undefined,
nodeId: undefined,
status: undefined,
version: undefined,
protocolVersion: undefined,
deviceVersion: undefined,
runModel: 1,
staType: undefined,
areaType: undefined,
specialConfig: undefined,
type: undefined,
appAccess: 0,
settleType: undefined,
siteType: undefined,
matchVehicles: undefined,
oahFlag: undefined,
siteClassification: undefined,
constructionSite: undefined,
batteryId: undefined,
enable: undefined
})
const formRules = reactive({
stationNo: [{ required: true, message: '换电站编码不能为空', trigger: 'blur' }],
stationName: [{ required: true, message: '换电站名称不能为空', trigger: 'blur' }],
stationSn: [
{ required: true, message: '换电站识别号不能为空', trigger: 'blur' },
{ min: 1, max: 4, message: '长度不能超过4', trigger: 'blur' }
],
latitude: [{ required: true, message: '纬度不能为空', trigger: 'blur' }],
longitude: [{ required: true, message: '经度不能为空', trigger: 'blur' }],
areaName: [{ required: true, message: '区域名称不能为空', trigger: 'blur' }],
areaCode: [{ required: true, message: '区域编号不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await StationInfoApi.getStationInfo(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as StationInfoApi.StationInfoVO
if (formType.value === 'create') {
await StationInfoApi.createStationInfo(data)
message.success(t('common.createSuccess'))
} else {
await StationInfoApi.updateStationInfo(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
operatorId: undefined,
stationNo: undefined,
stationName: undefined,
stationSn: undefined,
stationLocation: undefined,
stationType: undefined,
sbmId: undefined,
priceId: undefined,
runId: undefined,
avatar: undefined,
latitude: undefined,
longitude: undefined,
areaName: undefined,
areaCode: undefined,
operationTime: undefined,
launchTime: undefined,
contactWay: undefined,
serviceTel: undefined,
email: undefined,
principal: undefined,
stationCompany: undefined,
socialCreditCode: undefined,
stationSftVer: undefined,
supplierCode: undefined,
nodeId: undefined,
status: undefined,
version: undefined,
protocolVersion: undefined,
deviceVersion: undefined,
runModel: undefined,
staType: undefined,
areaType: undefined,
specialConfig: undefined,
type: undefined,
appAccess: undefined,
settleType: undefined,
siteType: undefined,
matchVehicles: undefined,
oahFlag: undefined,
siteClassification: undefined,
constructionSite: undefined,
batteryId: undefined,
enable: undefined
}
formRef.value?.resetFields()
}
</script>

@ -1,5 +1,396 @@
<template>
<span>111</span>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="90px"
>
<el-form-item label="换电站名称" prop="stationName">
<el-input
v-model="queryParams.stationName"
placeholder="请输入换电站名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="地理位置" prop="stationLocation">
<el-input
v-model="queryParams.stationLocation"
placeholder="请输入地理位置"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="站类型" prop="stationType">
<el-select
v-model="queryParams.stationType"
placeholder="请选择站类型"
clearable
class="!w-240px"
>
<el-option label="请选择" value="" />
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" plain @click="openForm('create')">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button type="success" plain @click="handleExport" :loading="exportLoading">
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<!-- <el-table-column label="id" align="center" prop="id" /> -->
<!-- <el-table-column label="运营商id" align="center" prop="operatorId" /> -->
<!-- <el-table-column label="换电站编码" align="center" prop="stationNo" width="120" /> -->
<el-table-column label="换电站名称" align="center" prop="stationName" width="120" />
<el-table-column label="换电站识别号" align="center" prop="stationSn" width="120" />
<el-table-column label="地理位置" align="center" prop="stationLocation" width="120" />
<el-table-column label="站类型" align="center" prop="stationType" width="120" />
<el-table-column label="计费模型" align="center" width="120">
<template #default="scope">
{{ handle_sbmId(scope.row.sbmId) }}
</template>
</el-table-column>
<el-table-column label="电价模型" align="center" width="120">
<template #default="scope">
{{ handle_priceId(scope.row.priceId) }}
</template>
</el-table-column>
<el-table-column label="场站运营模型" align="center" width="150">
<template #default="scope">
{{ handle_runId(scope.row.runId) }}
</template>
</el-table-column>
<el-table-column label="换电站现场照片" align="center" prop="avatar" width="150" />
<el-table-column label="纬度" align="center" prop="latitude" width="120" />
<el-table-column label="经度" align="center" prop="longitude" width="120" />
<el-table-column label="区域名称" align="center" prop="areaName" width="120" />
<el-table-column label="区域编号" align="center" prop="areaCode" width="120" />
<el-table-column
label="营运时间"
align="center"
prop="operationTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="投放时间"
align="center"
prop="launchTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="手机号" align="center" prop="contactWay" width="120" />
<el-table-column label="服务电话" align="center" prop="serviceTel" width="120" />
<el-table-column label="邮箱地址" align="center" prop="email" width="120" />
<el-table-column label="负责人" align="center" prop="principal" width="120" />
<el-table-column label="所属运营企业" align="center" prop="stationCompany" width="120" />
<el-table-column
label="所属运营企业统一社会信用代码"
align="center"
prop="socialCreditCode"
width="180"
/>
<el-table-column label="站控主机软件版本号" align="center" prop="stationSftVer" width="150" />
<el-table-column label="供应商代码" align="center" prop="supplierCode" width="120" />
<el-table-column label="云平台区域编码" align="center" prop="nodeId" width="150" />
<el-table-column label="场站服务状态" align="center" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.STATION_INFO_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="站控版本号" align="center" prop="version" width="120" />
<el-table-column label="协议版本号" align="center" prop="protocolVersion" width="120" />
<el-table-column label="设备列表版本号" align="center" prop="deviceVersion" width="150" />
<el-table-column label="场站运行模式" align="center" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.RUNMODEL_TYPE" :value="scope.row.runModel" />
</template>
</el-table-column>
<el-table-column label="工位分类" align="center" prop="staType" width="120" />
<el-table-column label="区域分类" align="center" prop="areaType" width="120" />
<el-table-column label="特殊配置" align="center" prop="specialConfig" width="120" />
<el-table-column label="站型类型" align="center" prop="type" width="120" />
<el-table-column label="是否小程序可见" align="center" prop="appAccess" width="150">
<template #default="scope">
<dict-tag :type="DICT_TYPE.APPACCESS_STATUS" :value="scope.row.appAccess" />
</template>
</el-table-column>
<el-table-column label="计费模型" align="center" prop="settleType" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.SETTLE_TYPE" :value="scope.row.settleType" />
</template>
</el-table-column>
<el-table-column label="站点类型" align="center" prop="siteType" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.SITE_TYPE" :value="scope.row.siteType" />
</template>
</el-table-column>
<el-table-column label="服务车型" align="center" prop="matchVehicles" width="120" />
<el-table-column label="是否全天营业" align="center" prop="oahFlag" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.OAHFLAG_STATUS" :value="scope.row.oahFlag" />
</template>
</el-table-column>
<el-table-column label="站点分类" align="center" prop="siteClassification" width="120">
<template #default="scope">
<dict-tag
:type="DICT_TYPE.SITECLASSIFICATION_TYPE"
:value="scope.row.siteClassification"
/>
</template>
</el-table-column>
<el-table-column label="是否启用" align="center" prop="enable" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.STATIONINFO_ENABLE" :value="scope.row.enable" />
</template>
</el-table-column>
<el-table-column label="建设场所" align="center" prop="constructionSite" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CONSTRUCTIONSITE" :value="scope.row.constructionSite" />
</template>
</el-table-column>
<!-- <el-table-column label="电池运营模型id" align="center" prop="batteryId" width="150" /> -->
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center" width="200" fixed="right">
<template #default="scope">
<el-button link type="primary" @click="openForm('update', scope.row.id)">
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<StationInfoForm
ref="formRef"
@success="getList"
:sbmIdlist="sbmIdlist"
:priceIdList="priceIdList"
:runIdlist="runIdlist"
/>
</template>
<script setup lang="ts">
</script>
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { StationInfoApi, StationInfoVO } from '@/api/share/stationinfo'
import StationInfoForm from './StationInfoForm.vue'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
/** 换电站基础信息 列表 */
defineOptions({ name: 'StationInfo' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<StationInfoVO[]>([]) //
//
const total = ref(0)
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
operatorId: undefined,
stationNo: undefined,
stationName: undefined,
stationSn: undefined,
stationLocation: undefined,
stationType: undefined,
sbmId: undefined,
priceId: undefined,
runId: undefined,
avatar: undefined,
latitude: undefined,
longitude: undefined,
areaName: undefined,
areaCode: undefined,
operationTime: [],
launchTime: [],
contactWay: undefined,
serviceTel: undefined,
email: undefined,
principal: undefined,
stationCompany: undefined,
socialCreditCode: undefined,
stationSftVer: undefined,
supplierCode: undefined,
nodeId: undefined,
status: undefined,
version: undefined,
protocolVersion: undefined,
deviceVersion: undefined,
runModel: undefined,
staType: undefined,
areaType: undefined,
specialConfig: undefined,
type: undefined,
appAccess: undefined,
settleType: undefined,
siteType: undefined,
matchVehicles: undefined,
oahFlag: undefined,
siteClassification: undefined,
constructionSite: undefined,
batteryId: undefined,
enable: undefined,
createTime: []
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await StationInfoApi.getStationInfoPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
const priceIdList = ref([])
const getElectricityPriceList = async () => {
try {
const data = await StationInfoApi.getElectricityPriceList()
// console.log(data, 'data')
priceIdList.value = data
} finally {
}
}
const sbmIdlist = ref([])
const getBillingModelList = async () => {
try {
const data = await StationInfoApi.getBillingModelList()
// console.log(data, 'data')
sbmIdlist.value = data
} finally {
}
}
const runIdlist = ref([])
const getRunModelList = async () => {
try {
const data = await StationInfoApi.getRunModelList()
// console.log(data, 'data')
runIdlist.value = data
} finally {
}
}
const handle_sbmId = (data) => {
let str = ''
for (var i = 0; i < sbmIdlist.value.length; i++) {
if (data == sbmIdlist.value[i].id) {
str = sbmIdlist.value[i].name
}
}
return str
}
const handle_priceId = (data) => {
let str = ''
for (var i = 0; i < priceIdList.value.length; i++) {
if (data == priceIdList.value[i].id) {
str = priceIdList.value[i].name
}
}
return str
}
const handle_runId = (data) => {
let str = ''
for (var i = 0; i < runIdlist.value.length; i++) {
if (data == runIdlist.value[i].id) {
str = runIdlist.value[i].name
}
}
return str
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await StationInfoApi.deleteStationInfo(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await StationInfoApi.exportStationInfo(queryParams)
download.excel(data, '换电站基础信息.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
getBillingModelList()
getElectricityPriceList()
getRunModelList()
})
</script>

Loading…
Cancel
Save