<template>
|
<GlobalWindow
|
:title="title"
|
width="50%"
|
:visible.sync="visible"
|
:confirm-working="isWorking"
|
@confirm="confirm"
|
>
|
<el-form :model="form" ref="form" :rules="rules">
|
<el-form-item label="月份" prop="timeInfo">
|
<el-date-picker
|
v-model="form.timeInfo"
|
format="yyyy-MM"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
type="month"
|
/>
|
</el-form-item>
|
<el-form-item label="用气量(立方米):" prop="num" >
|
<el-input type="number" v-model="form.num" placeholder="请输入用气量(立方米)" v-trim/>
|
</el-form-item>
|
<el-form-item label="说明:" prop="content">
|
<el-input type="textarea" v-model="form.content" placeholder="请输入说明" v-trim/>
|
</el-form-item>
|
</el-form>
|
</GlobalWindow>
|
</template>
|
|
<script>
|
import BaseOpera from '@/components/base/BaseOpera'
|
import GlobalWindow from '@/components/common/GlobalWindow'
|
import { allList } from '@/api/platform/platformGroup'
|
export default {
|
name: 'OperaPlatformReasonWindow',
|
extends: BaseOpera,
|
components: { GlobalWindow },
|
data () {
|
return {
|
// 表单数据
|
groupList: [],
|
form: {
|
id: null,
|
content: null,
|
num: null,
|
timeInfo: '',
|
type: 1
|
},
|
// 验证规则
|
rules: {
|
timeInfo: [{ required: true, message: '请输选择月份 ', trigger: 'blur' }],
|
num: [{ required: true, message: '请输入用气量(吨) ', trigger: 'blur' }]
|
}
|
}
|
},
|
created () {
|
this.config({
|
api: '/platform/platformWaterGas',
|
'field.id': 'id'
|
})
|
},
|
methods: {
|
/**
|
* 打开窗口
|
* @title 窗口标题
|
* @target 编辑的对象
|
*/
|
open (title, target) {
|
this.title = title
|
this.visible = true
|
// 新建
|
if (target == null) {
|
this.$nextTick(() => {
|
this.$refs.form.resetFields()
|
this.form[this.configData['field.id']] = null
|
})
|
return
|
}
|
// 编辑
|
this.$nextTick(() => {
|
for (const key in this.form) {
|
this.form[key] = target[key]
|
}
|
})
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
.labelTip{
|
font-size: 12px;
|
color: #666666;
|
}
|
</style>
|