|
|
|
@ -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) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
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>
|
|
|
|
|
|