|
|
@ -8,11 +8,11 @@
|
|
|
|
label-position="top"
|
|
|
|
label-position="top"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-row :gutter="24">
|
|
|
|
<el-row :gutter="24">
|
|
|
|
<el-col :span="12">
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
<el-form-item label="分时模型(月日)id" prop="dateId">
|
|
|
|
<el-form-item label="分时模型(月日)id" prop="dateId">
|
|
|
|
<el-input v-model="formData.dateId" placeholder="请输入分时模型(月日)id" />
|
|
|
|
<el-input v-model="formData.dateId" placeholder="请输入分时模型(月日)id" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col> -->
|
|
|
|
<el-col :span="12">
|
|
|
|
<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="请输入计费模型名称" />
|
|
|
@ -26,7 +26,7 @@
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col> -->
|
|
|
|
</el-col> -->
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="尖电价时间范围" prop="Time">
|
|
|
|
<!-- <el-form-item label="尖电价时间范围" prop="Time">
|
|
|
|
<el-time-picker
|
|
|
|
<el-time-picker
|
|
|
|
v-model="formData.Time"
|
|
|
|
v-model="formData.Time"
|
|
|
|
is-range
|
|
|
|
is-range
|
|
|
@ -35,11 +35,17 @@
|
|
|
|
end-placeholder="结束时间"
|
|
|
|
end-placeholder="结束时间"
|
|
|
|
value-format="HH:mm:ss"
|
|
|
|
value-format="HH:mm:ss"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<!-- <el-form-item label="尖电价开始时刻" prop="startTime">
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="尖电价开始时刻" prop="startTime">
|
|
|
|
<el-date-picker
|
|
|
|
<el-date-picker
|
|
|
|
v-model="formData.startTime"
|
|
|
|
v-model="formData.startTime"
|
|
|
|
type="date"
|
|
|
|
type="date"
|
|
|
|
value-format="x"
|
|
|
|
format="hh:mm:ss"
|
|
|
|
|
|
|
|
value-format="hh:mm:ss"
|
|
|
|
placeholder="选择尖电价开始时刻"
|
|
|
|
placeholder="选择尖电价开始时刻"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
@ -49,14 +55,25 @@
|
|
|
|
<el-date-picker
|
|
|
|
<el-date-picker
|
|
|
|
v-model="formData.endTime"
|
|
|
|
v-model="formData.endTime"
|
|
|
|
type="date"
|
|
|
|
type="date"
|
|
|
|
value-format="x"
|
|
|
|
format="hh:mm:ss"
|
|
|
|
|
|
|
|
value-format="hh:mm:ss"
|
|
|
|
placeholder="选择尖电价结束时刻"
|
|
|
|
placeholder="选择尖电价结束时刻"
|
|
|
|
/> -->
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="电价模型id" prop="electricityModelId">
|
|
|
|
<el-form-item label="电价模型名称" prop="electricityModel">
|
|
|
|
<el-input v-model="formData.electricityModelId" placeholder="请输入电价模型id" />
|
|
|
|
<el-select v-model="formData.electricityModelId" style="width: 100%;">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="item in electricityModel"
|
|
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
|
|
:label="item.name"
|
|
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
@ -70,30 +87,37 @@ import {
|
|
|
|
ElectricityTimeApi,
|
|
|
|
ElectricityTimeApi,
|
|
|
|
ElectricityTimeVO
|
|
|
|
ElectricityTimeVO
|
|
|
|
} from '@/api/operationsManagement/electricityPriceModel/timeModel'
|
|
|
|
} from '@/api/operationsManagement/electricityPriceModel/timeModel'
|
|
|
|
|
|
|
|
import { ElectricityDateApi, ElectricityDateVO } from '@/api/operationsManagement/electricityPriceModel/monthModel'
|
|
|
|
/** 电价模型小时 表单 */
|
|
|
|
/** 电价模型小时 表单 */
|
|
|
|
defineOptions({ name: 'ElectricityTimeForm' })
|
|
|
|
defineOptions({ name: 'ElectricityTimeForm' })
|
|
|
|
|
|
|
|
const props=defineProps({
|
|
|
|
|
|
|
|
selectId:{
|
|
|
|
|
|
|
|
type:String,
|
|
|
|
|
|
|
|
default:''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
|
|
|
const electricityModel = ref('')
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
const formType = ref('create') // 表单的类型:create - 新增;update - 修改
|
|
|
|
const formData = ref({
|
|
|
|
const formData = ref({
|
|
|
|
id: undefined,
|
|
|
|
id: undefined,
|
|
|
|
dateId: undefined,
|
|
|
|
dateId: props.selectId,
|
|
|
|
name: undefined,
|
|
|
|
name: undefined,
|
|
|
|
type: undefined,
|
|
|
|
type: undefined,
|
|
|
|
startTime: undefined,
|
|
|
|
startTime: undefined,
|
|
|
|
endTime: undefined,
|
|
|
|
endTime: undefined,
|
|
|
|
electricityModelId: undefined,
|
|
|
|
electricityModelId: undefined,
|
|
|
|
Time:[]
|
|
|
|
|
|
|
|
|
|
|
|
// Time:[]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const formRules = reactive({
|
|
|
|
const formRules = reactive({
|
|
|
|
name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }],
|
|
|
|
name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }],
|
|
|
|
electricityModelId: [{ required: true, message: '电价模型id不能为空', trigger: 'blur' }]
|
|
|
|
electricityModelId: [{ required: true, message: '电价模型名称不能为空', trigger: 'blur' }]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
const onCencel=()=>{
|
|
|
|
const onCencel=()=>{
|
|
|
@ -111,7 +135,9 @@ const open = async (type: string, id?: number) => {
|
|
|
|
if (id) {
|
|
|
|
if (id) {
|
|
|
|
formLoading.value = true
|
|
|
|
formLoading.value = true
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
// const res = await ElectricityTimeApi.getElectricityTime(id)
|
|
|
|
formData.value = await ElectricityTimeApi.getElectricityTime(id)
|
|
|
|
formData.value = await ElectricityTimeApi.getElectricityTime(id)
|
|
|
|
|
|
|
|
// formData.value={...res,Time:[res?.startTime,res?.endTime]}
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
formLoading.value = false
|
|
|
|
formLoading.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -126,8 +152,11 @@ const submitForm = async () => {
|
|
|
|
await formRef.value.validate()
|
|
|
|
await formRef.value.validate()
|
|
|
|
// 提交请求
|
|
|
|
// 提交请求
|
|
|
|
formLoading.value = true
|
|
|
|
formLoading.value = true
|
|
|
|
|
|
|
|
formData.value.dateId=props.selectId
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const data = formData.value as unknown as ElectricityTimeApi.ElectricityTimeVO
|
|
|
|
const data = formData.value as unknown as ElectricityTimeApi.ElectricityTimeVO
|
|
|
|
|
|
|
|
// data.startTime=formData.value.Time[0]
|
|
|
|
|
|
|
|
// data.endTime=formData.value.Time[1]
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
await ElectricityTimeApi.createElectricityTime(data)
|
|
|
|
await ElectricityTimeApi.createElectricityTime(data)
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
@ -157,12 +186,20 @@ const resetForm = () => {
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// watch(()=>props.selectId,async(newValue)=>{
|
|
|
|
async function getbillingDateData(){
|
|
|
|
// console.log('newValue',newValue)
|
|
|
|
// const data = await ElectricityDateApi.getElectricityDatenew({modelId:props.selectId})
|
|
|
|
// getbillingDateData()
|
|
|
|
const data = await ElectricityDateApi.getElectricityDatePage({priceId:props.selectId})
|
|
|
|
|
|
|
|
// console.log(data,"-++++++++++-")
|
|
|
|
|
|
|
|
electricityModel.value=data.list||[]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(()=>props.selectId,async(newValue)=>{
|
|
|
|
|
|
|
|
console.log('newValue',newValue)
|
|
|
|
|
|
|
|
getbillingDateData()
|
|
|
|
|
|
|
|
|
|
|
|
// },{
|
|
|
|
},{
|
|
|
|
// deep:true,
|
|
|
|
deep:true,
|
|
|
|
// immediate:true
|
|
|
|
immediate:true
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|