|
|
@ -1,5 +1,5 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
|
|
|
|
|
|
|
<el-form
|
|
|
|
<el-form
|
|
|
|
ref="formRef"
|
|
|
|
ref="formRef"
|
|
|
|
:model="formData"
|
|
|
|
:model="formData"
|
|
|
@ -8,68 +8,72 @@
|
|
|
|
v-loading="formLoading"
|
|
|
|
v-loading="formLoading"
|
|
|
|
label-position="top"
|
|
|
|
label-position="top"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-row :span="24">
|
|
|
|
<el-row :gutter="24">
|
|
|
|
<!-- <el-col :span="11">
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
<el-form-item label="电网电价模型id" prop="priceId">
|
|
|
|
<el-form-item label="电网电价模型id" prop="priceId">
|
|
|
|
<el-input v-model="formData.priceId" placeholder="请输入电网电价模型id" />
|
|
|
|
<el-input v-model="formData.priceId" placeholder="请输入电网电价模型id" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col> -->
|
|
|
|
</el-col> -->
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="计费模型名称" prop="name">
|
|
|
|
<el-form-item label="计费模型名称" prop="name">
|
|
|
|
<el-input v-model="formData.name" placeholder="请输入计费模型名称" />
|
|
|
|
<el-input v-model="formData.name" placeholder="请输入计费模型名称" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
<el-form-item label="时段数量" prop="periodsAmount">
|
|
|
|
<el-form-item label="时段数量" prop="periodsAmount">
|
|
|
|
<el-input v-model="formData.periodsAmount" placeholder="请输入时段数量" />
|
|
|
|
<el-input v-model="formData.periodsAmount" placeholder="请输入时段数量" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="序列" prop="no">
|
|
|
|
<el-form-item label="序列" prop="no">
|
|
|
|
<el-input v-model="formData.no" placeholder="请输入序列" />
|
|
|
|
<el-input v-model="formData.no" placeholder="请输入序列" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col> -->
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="开始日期" prop="startDate">
|
|
|
|
<el-form-item label="开始日期" prop="startDate">
|
|
|
|
<el-date-picker
|
|
|
|
<el-date-picker
|
|
|
|
v-model="formData.startDate"
|
|
|
|
v-model="formData.startDate"
|
|
|
|
type="date"
|
|
|
|
type="date"
|
|
|
|
value-format="x"
|
|
|
|
format="YYYY-MM-DD"
|
|
|
|
placeholder="选择开始日期"
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
|
|
|
placeholder="选择开始日期"
|
|
|
|
|
|
|
|
style="width: 100%;"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="结束日期" prop="endDate">
|
|
|
|
<el-form-item label="结束日期" prop="endDate">
|
|
|
|
<el-date-picker
|
|
|
|
<el-date-picker
|
|
|
|
v-model="formData.endDate"
|
|
|
|
v-model="formData.endDate"
|
|
|
|
type="date"
|
|
|
|
type="date"
|
|
|
|
value-format="x"
|
|
|
|
format="YYYY-MM-DD"
|
|
|
|
placeholder="选择结束日期"
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
|
|
|
placeholder="选择结束日期"
|
|
|
|
|
|
|
|
style="width: 100%;"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="尖电价" prop="theTipPrice">
|
|
|
|
<el-form-item label="尖电价" prop="theTipPrice">
|
|
|
|
<el-input v-model="formData.theTipPrice" placeholder="请输入尖电价" />
|
|
|
|
<el-input v-model="formData.theTipPrice" placeholder="请输入尖电价" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="峰电价" prop="peakPrice">
|
|
|
|
<el-form-item label="峰电价" prop="peakPrice">
|
|
|
|
<el-input v-model="formData.peakPrice" placeholder="请输入峰电价" />
|
|
|
|
<el-input v-model="formData.peakPrice" placeholder="请输入峰电价" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="平电价" prop="flatPrice">
|
|
|
|
<el-form-item label="平电价" prop="flatPrice">
|
|
|
|
<el-input v-model="formData.flatPrice" placeholder="请输入平电价" />
|
|
|
|
<el-input v-model="formData.flatPrice" placeholder="请输入平电价" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="谷电价" prop="theValleyPrice">
|
|
|
|
<el-form-item label="谷电价" prop="theValleyPrice">
|
|
|
|
<el-input v-model="formData.theValleyPrice" placeholder="请输入谷电价" />
|
|
|
|
<el-input v-model="formData.theValleyPrice" placeholder="请输入谷电价" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="是否启用" prop="status">
|
|
|
|
<el-form-item label="是否启用" prop="status">
|
|
|
|
<el-radio-group v-model="formData.status">
|
|
|
|
<el-radio-group v-model="formData.status">
|
|
|
|
<el-radio
|
|
|
|
<el-radio
|
|
|
@ -82,12 +86,12 @@
|
|
|
|
</el-radio-group>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="11">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
|
|
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<!-- <el-col :span="11">
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
<el-form-item label="数据来源:0:云平台;1;三方运营商" prop="source">
|
|
|
|
<el-form-item label="数据来源:0:云平台;1;三方运营商" prop="source">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="formData.source"
|
|
|
|
v-model="formData.source"
|
|
|
@ -103,11 +107,10 @@
|
|
|
|
<el-input v-model="formData.code" placeholder="请输入唯一编码" />
|
|
|
|
<el-input v-model="formData.code" placeholder="请输入唯一编码" />
|
|
|
|
</el-form-item> -->
|
|
|
|
</el-form-item> -->
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<template #footer>
|
|
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">{{ formType=='update'?'确认编辑':'确认新增' }}</el-button>
|
|
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
|
|
|
<el-button @click="onCencel" v-if="formType=='update'">取消编辑</el-button>
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
@ -120,7 +123,12 @@ defineOptions({ name: 'ElectricityDateForm' })
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
const props=defineProps({
|
|
|
|
|
|
|
|
modeId:{
|
|
|
|
|
|
|
|
type:String,
|
|
|
|
|
|
|
|
default:''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
@ -140,7 +148,8 @@ const formData = ref({
|
|
|
|
status: undefined,
|
|
|
|
status: undefined,
|
|
|
|
remark: undefined,
|
|
|
|
remark: undefined,
|
|
|
|
source: undefined,
|
|
|
|
source: undefined,
|
|
|
|
code: undefined
|
|
|
|
code: undefined,
|
|
|
|
|
|
|
|
modeId:'',
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const formRules = reactive({
|
|
|
|
const formRules = reactive({
|
|
|
|
name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }],
|
|
|
|
name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }],
|
|
|
@ -150,7 +159,11 @@ const formRules = reactive({
|
|
|
|
theValleyPrice: [{ required: true, message: '谷电价不能为空', trigger: 'blur' }]
|
|
|
|
theValleyPrice: [{ required: true, message: '谷电价不能为空', trigger: 'blur' }]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
const onCencel=()=>{
|
|
|
|
|
|
|
|
formType.value='create'
|
|
|
|
|
|
|
|
resetForm()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
/** 打开弹窗 */
|
|
|
|
/** 打开弹窗 */
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
dialogVisible.value = true
|
|
|
|
dialogVisible.value = true
|
|
|
@ -177,7 +190,9 @@ const submitForm = async () => {
|
|
|
|
// 提交请求
|
|
|
|
// 提交请求
|
|
|
|
formLoading.value = true
|
|
|
|
formLoading.value = true
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
console.log('props.modeI电价',props.modeId)
|
|
|
|
const data = formData.value as unknown as ElectricityDateApi.ElectricityDateVO
|
|
|
|
const data = formData.value as unknown as ElectricityDateApi.ElectricityDateVO
|
|
|
|
|
|
|
|
data.modeId =props.modeId
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
await ElectricityDateApi.createElectricityDate(data)
|
|
|
|
await ElectricityDateApi.createElectricityDate(data)
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|