9.6 新添加功能代码提交

master
zz 3 months ago
parent 46d7417637
commit 5875871abb

@ -93,6 +93,10 @@ export const UserApi = {
return await request.download({ url: `/member/user/export-excel`, params })
},
//重置密码
resetpassword: async (data: UserVO) => {
return await request.put({ url: `/member/user/update-password`, data })
},
// ==================== 子表(用户车辆信息) ====================
// 获得用户车辆信息分页

@ -24,6 +24,12 @@ export interface WalletVO {
// 会员钱包 API
export const WalletApi = {
// 修改余额
setbalance: async (data: WalletVO) => {
return await request.post({ url: `/pay/wallet/updateWalletBalance`, data })
},
// 查询会员钱包分页
getWalletPage: async (params: any) => {
return await request.get({ url: `/pay/wallet/page`, params })

@ -147,4 +147,8 @@ export const StationInfoApi = {
exportStationInfo: async (params) => {
return await request.download({ url: `/cloud/station-info/export-excel`, params })
},
// 启用/禁用
enableStationInfo: async (data: StationInfoVO) => {
return await request.put({ url: `/cloud/station-info/updateEnable`, data })
},
}

@ -0,0 +1,54 @@
import request from '@/config/axios'
// 充电换电套餐 VO
export interface SetMealVO {
// 编号
id: number
// 换电站编码
stationNo: string
// 套餐名
name: string
// 支付金额
payPrice: number
// 有效月份
effective: number
// 套餐次数
frequency: number
// 状态
status: number
// 套餐类型
type: number
}
// 充电换电套餐 API
export const SetMealApi = {
// 查询充电换电套餐分页
getSetMealPage: async (params: any) => {
return await request.get({ url: `/cloud/set-meal/page`, params })
},
// 查询充电换电套餐详情
getSetMeal: async (id: number) => {
return await request.get({ url: `/cloud/set-meal/get?id=` + id })
},
// 新增充电换电套餐
createSetMeal: async (data: SetMealVO) => {
return await request.post({ url: `/cloud/set-meal/create`, data })
},
// 修改充电换电套餐
updateSetMeal: async (data: SetMealVO) => {
return await request.put({ url: `/cloud/set-meal/update`, data })
},
// 删除充电换电套餐
deleteSetMeal: async (id: number) => {
return await request.delete({ url: `/cloud/set-meal/delete?id=` + id })
},
// 导出充电换电套餐 Excel
exportSetMeal: async (params) => {
return await request.download({ url: `/cloud/set-meal/export-excel`, params })
},
}

@ -138,6 +138,11 @@ REFUND_TYPE = 'refund_type',
ELECTRICITYSOURCE_OUT = 'electricitySourceOut',
ELECTERICITYPRICEMODEL = 'electricityPriceModel',
TOP_UP_STATUS = 'top_up_status',
ENABLE_STATUS = 'enable_status',
PACKAGE_TYPE = 'package_type',//zz
PACKAGE_STATUS = 'package_status',
SITEMANAGER_SERVICE_STATE = 'siteManager_service_state',
PEAK_PLATEAU_STATE = 'peak_plateau_state',
USER_TYPE = 'user_type',
USER_NUMBER_STATUS = 'user_number_status',

@ -57,9 +57,10 @@
{{ scope.row.freezePrice / 100 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<el-table-column label="操作" align="center" fixed="right" width="160">
<template #default="scope">
<el-button link type="primary" @click="open_drawer(scope.row)"> </el-button>
<el-button link type="sucess" @click="setbalance(scope.row)"> </el-button>
</template>
</el-table-column>
</el-table>
@ -98,7 +99,7 @@ import { WalletApi, WalletVO } from '@/api/pay/wallet/account'
defineOptions({ name: 'PayWallet' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<WalletVO[]>([]) //
//
@ -171,7 +172,26 @@ const drawerRef = ref()
const open_drawer = (row: any) => {
drawerRef.value.open(row)
}
/** 修改余额 */
const setbalance = async (row) => {
try {
//
const result = await message.prompt(
'请输入"' + row.teamName + '"的需要修改余额',
t('common.reminder')
)
const balance = result.value
//
const params = {
walletId:row.id,
balance:balance
}
await WalletApi.setbalance(params)
getList()
message.success('修改成功' )
// message.success('' + balance)
} catch {}
}
/** 初始化 **/
onMounted(() => {
getList()

@ -47,9 +47,10 @@
<el-table-column label="累计支出(分)" align="center" prop="totalExpense" />
<el-table-column label="累计充值(分)" align="center" prop="totalRecharge" />
<el-table-column label="冻结金额(分)" align="center" prop="freezePrice" />
<el-table-column label="操作" align="center">
<el-table-column label="操作" align="center" width="160" fixed="right">
<template #default="scope">
<el-button link type="primary" @click="open_drawer(scope.row)"> </el-button>
<el-button link type="sucess" @click="setbalance(scope.row)"> </el-button>
</template>
</el-table-column>
</el-table>
@ -86,7 +87,7 @@ import { WalletApi, WalletVO } from '@/api/pay/wallet/account'
/** 会员钱包 列表 */
defineOptions({ name: 'PayWallet' })
const { t } = useI18n() //
const message = useMessage() //
const loading = ref(true) //
@ -160,7 +161,26 @@ const drawerRef = ref()
const open_drawer = (row: any) => {
drawerRef.value.open(row)
}
/** 修改余额 */
const setbalance = async (row) => {
try {
//
const result = await message.prompt(
'请输入"' + row.nickname + '"的需要修改余额',
t('common.reminder')
)
const balance = result.value
//
const params = {
walletId:row.id,
balance:balance
}
await WalletApi.setbalance(params)
getList()
message.success('修改成功' )
// message.success('' + balance)
} catch {}
}
/** 初始化 **/
onMounted(() => {
getList()

@ -77,16 +77,16 @@
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200">
<el-table-column label="操作" align="center" fixed="right" width="280">
<template #default="scope">
<el-button link type="primary" @click="openForm('update', scope.row.id)">
编辑
</el-button>
<el-button link type="waring" @click="checkform(scope.row.id)" v-if="scope.row.realNameAuthFlag == 0 || 1"> </el-button>
<el-button link type="waring" @click="checkform(scope.row.id)" v-if="scope.row.realNameAuthFlag == 2"> </el-button>
<!-- checkUser -->
<el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button>
<el-button link type="primary" @click="open_drawer(scope.row)"> </el-button>
<el-button link type="success" @click="handleResetPwd(scope.row)"> </el-button>
</template>
</el-table-column>
</el-table>
@ -245,6 +245,24 @@ const open_drawer = (row: any) => {
drawerRef.value.open(row)
}
/** 重置密码 */
const handleResetPwd = async (row) => {
try {
//
const result = await message.prompt(
'请输入"' + row.name + '"的新密码',
t('common.reminder')
)
const password = result.value
//
const params = {
userId:row.id,
password: password
}
await UserApi.resetpassword(params)
message.success('修改成功,新密码是:' + password)
} catch {}
}
/** 初始化 **/
onMounted(() => {
getList()

@ -0,0 +1,159 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
label-position="top"
>
<el-row :gutter="24">
<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="name">
<el-input v-model="formData.name" placeholder="请输入套餐名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="支付金额" prop="payPrice">
<el-input v-model="formData.payPrice" placeholder="请输入支付金额" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效月份" prop="effective">
<el-input v-model="formData.effective" placeholder="请输入有效月份" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="套餐次数" prop="frequency">
<el-input v-model="formData.frequency" placeholder="请输入套餐次数" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PACKAGE_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="type">
<el-select v-model="formData.type" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PACKAGE_TYPE)"
: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 { SetMealApi, SetMealVO } from '@/api/system/marketingManagement/packageList'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
/** 充电换电套餐 表单 */
defineOptions({ name: 'SetMealForm' })
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,
name: undefined,
payPrice: undefined,
effective: undefined,
frequency: undefined,
status: undefined,
type: undefined
})
const formRules = reactive({
stationNo: [{ required: true, message: '换电站编码不能为空', trigger: 'blur' }],
name: [{ required: true, message: '套餐名不能为空', trigger: 'blur' }],
payPrice: [{ required: true, message: '支付金额不能为空', trigger: 'blur' }],
effective: [{ required: true, message: '有效月份不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
type: [{ required: true, message: '套餐类型不能为空', trigger: 'change' }]
})
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 SetMealApi.getSetMeal(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 SetMealApi.SetMealVO
if (formType.value === 'create') {
await SetMealApi.createSetMeal(data)
message.success(t('common.createSuccess'))
} else {
await SetMealApi.updateSetMeal(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
stationNo: undefined,
name: undefined,
payPrice: undefined,
effective: undefined,
frequency: undefined,
status: undefined,
type: undefined
}
formRef.value?.resetFields()
}
</script>

@ -0,0 +1,222 @@
<template>
<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="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PACKAGE_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="套餐类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PACKAGE_TYPE)"
: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" :header-cell-style="{
backgroundColor: '#eff4fa'
}">
<!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="序号" type="index" align="center" width="80" />
<el-table-column label="换电站编码" align="center" prop="stationNo" />
<el-table-column label="套餐名" align="center" prop="name" />
<el-table-column label="支付金额(元)" align="center" prop="payPrice" />
<el-table-column label="有效月份" align="center" prop="effective" />
<el-table-column label="套餐次数" align="center" prop="frequency" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACKAGE_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="套餐类型" align="center" prop="type">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACKAGE_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<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>
<!-- 表单弹窗添加/修改 -->
<SetMealForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { SetMealApi, SetMealVO } from '@/api/system/marketingManagement/packageList'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import SetMealForm from './SetMealForm.vue'
/** 充电换电套餐 列表 */
defineOptions({ name: 'SetMeal' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<SetMealVO[]>([]) //
//
const total = ref(0)
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
stationNo: undefined,
name: undefined,
payPrice: undefined,
effective: undefined,
frequency: undefined,
status: undefined,
createTime: [],
type: undefined
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SetMealApi.getSetMealPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
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 SetMealApi.deleteSetMeal(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SetMealApi.exportSetMeal(queryParams)
download.excel(data, '充电换电套餐.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

@ -72,6 +72,18 @@
</el-select>
</el-form-item>
</el-col>
<el-col :sapn="12">
<el-form-item label="套餐类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PACKAGE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
@ -107,7 +119,8 @@ const formData = ref({
effective: undefined,
frequency: undefined,
expiredTime: undefined,
status: undefined
status: undefined,
type:undefined,
})
const formRules = reactive({
userId: [{ required: true, message: '用户id不能为空', trigger: 'blur' }],

@ -89,7 +89,7 @@
<el-table-column label="用户id" align="center" prop="userId" />
<!-- <el-table-column label="套餐id" align="center" prop="setMealId" /> -->
<el-table-column label="套餐名" align="center" prop="name" />
<el-table-column label="支付金额" align="center" prop="payPrice" />
<el-table-column label="支付金额(元)" align="center" prop="payPrice" />
<el-table-column label="支付订单编号" align="center" prop="payOrder" />
<el-table-column label="有效月份" align="center" prop="effective" />
<el-table-column label="套餐次数" align="center" prop="frequency" />
@ -106,6 +106,11 @@
</template>
</el-table-column>
<el-table-column label="套餐类型" align="center" prop="type">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PACKAGE_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"

@ -26,7 +26,7 @@
</el-form-item>
</el-col> -->
<el-col :span="12">
<!-- <el-form-item label="尖电价时间范围" prop="Time">
<el-form-item label="尖电价时间范围" prop="Time">
<el-time-picker
v-model="formData.Time"
is-range
@ -36,11 +36,11 @@
value-format="HH:mm:ss"
/>
</el-form-item> -->
</el-form-item>
<el-form-item label="尖电价开始时刻" prop="startTime">
<!-- <el-form-item label="尖电价开始时刻" prop="startTime">
<el-date-picker
v-model="formData.startTime"
type="date"
@ -48,9 +48,9 @@
value-format="hh:mm:ss"
placeholder="选择尖电价开始时刻"
/>
</el-form-item>
</el-form-item> -->
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="尖电价结束时刻" prop="endTime">
<el-date-picker
v-model="formData.endTime"
@ -61,7 +61,7 @@
/>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item label="计费模型月名称" prop="dateId">
<el-select v-model="formData.dateId" style="width: 100%;">
@ -115,7 +115,7 @@ const formData = ref({
endTime: undefined,
electricityModelId: props.selectId,
// Time:[]
Time:[]
})
const formRules = reactive({
name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }],
@ -137,9 +137,9 @@ const open = async (type: string, id?: number) => {
if (id) {
formLoading.value = true
try {
// const res = await ElectricityTimeApi.getElectricityTime(id)
formData.value = await ElectricityTimeApi.getElectricityTime(id)
// formData.value={...res,Time:[res?.startTime,res?.endTime]}
const res = await ElectricityTimeApi.getElectricityTime(id)
// formData.value = await ElectricityTimeApi.getElectricityTime(id)
formData.value={...res,Time:[res?.startTime,res?.endTime]}
} finally {
formLoading.value = false
}
@ -158,8 +158,8 @@ const submitForm = async () => {
// formData.value.dateId=props.selectId
try {
const data = formData.value as unknown as ElectricityTimeApi.ElectricityTimeVO
// data.startTime=formData.value.Time[0]
// data.endTime=formData.value.Time[1]
data.startTime=formData.value.Time[0]
data.endTime=formData.value.Time[1]
if (formType.value === 'create') {
await ElectricityTimeApi.createElectricityTime(data)
message.success(t('common.createSuccess'))

@ -0,0 +1,237 @@
<template>
<el-drawer title="基本信息" v-model="dialogVisible" size="60%">
<el-descriptions :column="3" border>
<el-descriptions-item
size="large"
label="换电站编码:"
label-align="right"
align="center"
label-class-name="my-label"
class-name="my-content"
width="120px"
>
{{ formData.stationNo == null ? '--' : formData.stationNo }}
</el-descriptions-item>
<el-descriptions-item label="仓位编号:" align="center" width="120px">
{{ formData.no == null ? '--' : formData.no }}
</el-descriptions-item>
<el-descriptions-item label="仓位编码:" align="center" width="120px">
{{ formData.code == null ? '--' : formData.code }}
</el-descriptions-item>
<el-descriptions-item label="仓位名称:" align="center" >
{{ formData.name == null ? '--' : formData.name }}
</el-descriptions-item>
<el-descriptions-item label="在位状态:" align="center" >
<dict-tag :type="DICT_TYPE.EXISTS_FLAG" :value="formData.existsFlag" />
<!-- {{ formData.existsFlag == null ? '--' : formData.existsFlag }} -->
</el-descriptions-item>
<el-descriptions-item label="电池编号:" align="center" >
{{ formData.batteryNo == null ? '--' : formData.batteryNo }}
</el-descriptions-item>
<el-descriptions-item label="充电机编号:" align="center" >
{{ formData.chargerNo == null ? '--' : formData.chargerNo }}
</el-descriptions-item>
<el-descriptions-item label="充电枪编号:" align="center" >
{{ formData.chargerGunNo == null ? '--' : formData.chargerGunNo }}
</el-descriptions-item>
<el-descriptions-item label="水冷编号:" align="center" >
{{ formData.waterCoolNo == null ? '--' : formData.waterCoolNo }}
</el-descriptions-item>
<el-descriptions-item label="是否有电插头:" align="center" >
<dict-tag :type="DICT_TYPE.ELEC_PLUGIN_FLAG" :value="formData.elecPluginFlag" />
<!-- {{ formData.elecPluginFlag == null ? '--' : formData.elecPluginFlag }} -->
</el-descriptions-item>
<el-descriptions-item label="电插头状态:" align="center" >
<dict-tag :type="DICT_TYPE.ELEC_PLUGIN_STATUS" :value="formData.elecPluginStatus" />
<!-- {{ formData.elecPluginStatus == null ? '--' : formData.elecPluginStatus }} -->
</el-descriptions-item>
<el-descriptions-item label="是否有水插头:" align="center" >
<dict-tag :type="DICT_TYPE.WATER_PLUGIN_FLAG" :value="formData.waterPluginFlag" />
<!-- {{ formData.waterPluginFlag == null ? '--' : formData.waterPluginFlag }} -->
</el-descriptions-item>
<el-descriptions-item label="预约锁定:" align="center" >
<dict-tag :type="DICT_TYPE.AMT_LOCK" :value="formData.amtLock" />
<!-- {{ formData.amtLock == null ? '--' : formData.amtLock }} -->
</el-descriptions-item>
<el-descriptions-item label="soc:" align="center" >
{{ formData.soc == null ? '--' : formData.soc }}
</el-descriptions-item>
<el-descriptions-item label="soe:" align="center" >
{{ formData.soe == null ? '--' : formData.soe }}
</el-descriptions-item>
<el-descriptions-item label="soh:" align="center" >
{{ formData.soh == null ? '--' : formData.soh }}
</el-descriptions-item>
<el-descriptions-item label="电池入仓顺序:" align="center" >
{{ formData.batteryEnterSeq == null ? '--' : formData.batteryEnterSeq }}
</el-descriptions-item>
<el-descriptions-item label="充电状态:" align="center" >
<dict-tag :type="DICT_TYPE.CHARGE_STATUS" :value="formData.chargeStatus" />
<!-- {{ formData.chargeStatus == null ? '--' : formData.chargeStatus }} -->
</el-descriptions-item>
<el-descriptions-item label="仓位状态:" align="center" >
<dict-tag :type="DICT_TYPE.POSITION_STATUS" :value="formData.status" />
<!-- {{ formData.status == null ? '--' : formData.status }} -->
</el-descriptions-item>
<el-descriptions-item label="最后结束充电时:" align="center" >
{{ formData.lastChargeFinishTime == null ? '--' : formData.lastChargeFinishTime }}
</el-descriptions-item>
<el-descriptions-item label="缓存仓标记:" align="center" >
<dict-tag :type="DICT_TYPE.CACHE_BIN_FLAG" :value="formData.cacheBinFlag" />
<!-- {{ formData.cacheBinFlag == null ? '--' : formData.cacheBinFlag }} -->
</el-descriptions-item>
<el-descriptions-item label="是否可以换电:" align="center" >
<dict-tag :type="DICT_TYPE.CAN_SWAG_CHARGE_FLAG" :value="formData.canSwapFlag" />
<!-- {{ formData.canSwapFlag == null ? '--' : formData.canSwapFlag }} -->
</el-descriptions-item>
<el-descriptions-item label="是否可以充电:" align="center" >
<dict-tag :type="DICT_TYPE.CAN_SWAG_CHARGE_FLAG" :value="formData.canChargeFlag" />
<!-- {{ formData.canChargeFlag == null ? '--' : formData.canChargeFlag }} -->
</el-descriptions-item>
<el-descriptions-item label="入仓时间:" align="center" >
{{ formData.inTime == null ? '--' : formData.inTime }}
</el-descriptions-item>
</el-descriptions>
<template #footer>
<!-- <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> -->
<el-button @click="dialogVisible = false"> </el-button>
</template>
</el-drawer >
</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,
existsFlag:undefined,
createTime:undefined,
})
const formRules = reactive({
stationNo: [{ required: true, message: '换电站编码不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (id?: number) => {
dialogVisible.value = true
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>

@ -164,6 +164,7 @@
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button>
<el-button link type="info" @click="openDetails(scope.row.id)"> </el-button>
</template>
</el-table-column>
</el-table>
@ -178,6 +179,8 @@
<!-- 表单弹窗添加/修改 -->
<BinInfoForm ref="formRef" @success="getList" :stationinfoList="stationinfoList" />
<!-- 详情 -->
<BinInfoDetails ref="detailRef" />
</template>
<script setup lang="ts">
@ -186,6 +189,7 @@ 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 BinInfoDetails from './BinInfoDetails.vue'
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
/** 仓位 列表 */
@ -278,6 +282,11 @@ const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 详情 */
const detailRef = ref()
const openDetails = (id?: number) => {
detailRef.value.open( id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {

@ -218,7 +218,36 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="营业时间范围" prop="Time">
<el-time-picker
v-model="formData.Time"
is-range
range-separator="至"
start-placeholder="营业开始时间"
end-placeholder="营业结束时间"
value-format="HH:mm:ss"
/>
</el-form-item>
<!-- <el-form-item label="营业开始时间" prop="launchTime">
<el-date-picker
v-model="formData.startTime"
type="date"
value-format="x"
placeholder="选择营业开始时间"
style="width: 100%"
/> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="营业结束时间" prop="launchTime">
<el-date-picker
v-model="formData.endTime"
type="date"
value-format="x"
placeholder="选择营业结束时间"
style="width: 100%"
/> </el-form-item> -->
</el-col>
<el-col :span="20">
<el-form-item label="换电站现场照片" prop="avatar">
<UploadImgs v-model:modelValue="formData.avatar" />
@ -320,6 +349,9 @@ const formData = ref({
chargeElectricitySource:undefined,
chargeElectricityPriceSource:undefined,
chargeModeId:undefined,
endTime:undefined,
startTime:undefined,
Time:[],
})
const formRules = reactive({
stationNo: [{ required: true, message: '换电站编码不能为空', trigger: 'blur' }],
@ -352,7 +384,8 @@ const open = async (type: string, id?: number) => {
formLoading.value = true
try {
const res= await StationInfoApi.getStationInfo(id)
formData.value =res
formData.value={...res,Time:[res?.startTime,res?.endTime]}
// formData.value =res
center_map_data.value = [
parseInt(formData.value.longitude),
parseInt(formData.value.latitude)
@ -417,6 +450,8 @@ const submitForm = async () => {
try {
const data = formData.value as unknown as StationInfoApi.StationInfoVO
data.startTime=formData.value.Time[0]
data.endTime=formData.value.Time[1]
if (formType.value === 'create') {
await StationInfoApi.createStationInfo(data)
message.success(t('common.createSuccess'))

@ -77,7 +77,7 @@
<dict-tag :type="DICT_TYPE.SITECLASSIFICATION_TYPE" :value="scope.row.stationType" />
</template>
</el-table-column>
<el-table-column label="换电计费模型" align="center" width="110">
<el-table-column label="换电计费模型" align="center" width="110">
<template #default="scope">
{{ handle_sbmId(scope.row.sbmId) }}
</template>
@ -111,10 +111,22 @@
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="手机号" align="center" prop="contactWay" width="120" />
<!-- <el-table-column label="服务电话" align="center" prop="serviceTel" /> -->
<!-- <el-table-column label="邮箱地址" align="center" prop="email" width="120" /> -->
<el-table-column label="负责人" align="center" prop="principal" />
<el-table-column label="场站服务状态" align="center" prop="status" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.SITEMANAGER_SERVICE_STATE" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="启用状态" align="center" prop="enable" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.ENABLE_STATUS" :value="scope.row.enable" />
</template>
</el-table-column>
<!-- <el-table-column label="所属运营企业" align="center" prop="stationCompany" width="120" /> -->
<!-- <el-table-column
label="所属运营企业统一社会信用代码"
@ -189,12 +201,44 @@
:formatter="dateFormatter"
width="180px"
/> -->
<el-table-column
label="营业开始时间"
align="center"
prop="startTime"
width="180px"
/>
<el-table-column
label="营业结束时间"
align="center"
prop="endTime"
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>
<el-button
link
type="warning"
@click="handleCheck2(scope.row.id, 1)"
v-if="scope.row.enable == 2"
>
启用
</el-button>
<el-button
link
type="danger"
@click="handleCheck2(scope.row.id, 2)"
v-if="scope.row.enable == 1"
>
禁用
</el-button>
</template>
</el-table-column>
</el-table>
@ -403,7 +447,19 @@ const handleExport = async () => {
exportLoading.value = false
}
}
// /
const handleCheck2 = async (id?: number, type) => {
await message.confirm('是否确认此操作?', '提示')
//
let params = {
id: id,
enable: type
}
// checkformRef.value.open(id)
const data = await StationInfoApi.enableStationInfo(params)
message.success('操作成功')
getList()
}
/** 初始化 **/
onMounted(() => {
getList()

@ -42,7 +42,19 @@
<el-row type="flex" justify="space-around">
<el-col :span="11">
<el-form-item label="车辆型号" prop="vehicleType">
<el-input v-model="formData.vehicleType" placeholder="请输入车辆型号" />
<el-select
v-model="formData.vehicleType"
placeholder="请选择"
clearable
style="width: 100%;"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.CARTYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
@ -167,6 +179,7 @@
<script setup lang="ts">
import * as vehiclesListApi from '@/api/system/vehicleManagement/personalVehicle/vehiclesList'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //

Loading…
Cancel
Save