| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508 |
- <template>
- <div class="generationPlan">
- <div class="generationBtn">
- <p class="titleSty">发电计划管理</p>
- <div class="periodSeach">
- <div class="exceed">
- <span style="margin-top: 3px;">场站名称:</span>
- <el-select v-model="windTurbines" placeholder="请选择">
- <el-option
- v-for="item in windFramoptions"
- :key="item.no"
- :label="item.stationName"
- :value="item.no">
- </el-option>
- </el-select>
- </div>
- <el-button type="primary" style="margin-left: 10px;" v-on:click="getSeachData">搜索</el-button>
- <el-button style="margin-left: 10px;" @click="reset">重置</el-button>
- </div>
- <div style="display:flex;justify-content: space-between;padding: 10px;">
- <el-row :gutter="10" class="regionalBtn">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="Plus"
- size="mini"
- @click="handleAdd"
- >新增</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- plain
- icon="Edit"
- size="mini"
- @click="handleUpdate"
- >修改</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="Delete"
- size="mini"
- @click="handleDelete"
- >删除</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="DocumentCopy"
- size="mini"
- @click="handleCopy"
- >复制</el-button>
- </el-col>
- </el-row>
- </div>
- <div class="windframTableData">
- <el-table :data="windframtableData" border style="width: 100%" @row-click="rowClick">
- <el-table-column label="操作" width="60" align="center">
- <template #default="scope">
- <el-radio v-model="windframradio" :label="scope.row"></el-radio>
- </template>
- </el-table-column>
- <el-table-column label="场站名称">
- <template #default="scope">
- <span>{{scope.row.windplantName ? scope.row.windplantName : scope.row.pvStationName}}</span>
- </template>
- </el-table-column>
- <el-table-column label="计划年月">
- <template #default="scope">
- <span>{{scope.row.year}}年</span>
- <span>{{scope.row.month}}月</span>
- </template>
- </el-table-column>
- <el-table-column label="计划发电量(Wkw/h)">
- <template #default="scope">
- <span>{{scope.row.generatingcapacity}}万千瓦时</span>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="page.currentPage"
- :page-size="page.pagesize"
- layout="total, prev, pager, next, jumper"
- :total="page.total">
- </el-pagination>
- </div>
- </div>
- <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false" @close="closeDialog">
- <div class="windframFrom">
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
- <el-form-item label="场站名称" prop="station">
- <el-select v-model="ruleForm.station" placeholder="请选择场站" @change="chooseStation">
- <el-option
- v-for="item in windFramoptions"
- :key="item.no"
- :label="item.stationName"
- :value="item.no">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="期次名称" prop="project">
- <el-select v-model="ruleForm.project" placeholder="请选择期次" :disabled="!showProject">
- <el-option
- v-for="item in projectOptions"
- :key="item.projectNo"
- :label="item.projectName"
- :value="item.projectNo">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="计划年月" prop="monthVal">
- <el-date-picker
- v-model="ruleForm.monthVal"
- type="month"
- value-format="yyyy-MM"
- placeholder="选择日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="计划发电" prop="planElectric">
- <el-input type="number"
- v-model="ruleForm.planElectric"
- placeholder="请输入计划发电量"
- @keyup.native="ruleForm.planElectric = $utils.oninput(ruleForm.planElectric, 3, 'float')"></el-input>
- </el-form-item>
- </el-form>
- </div>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="resetForm" v-if="!single">重 置</el-button>
- <el-button @click="dialogVisible = false" v-else>取 消</el-button>
- <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
- </span>
- </template>
- </el-dialog>
- </div>
- </template>
- <script>
- import {apiGetWindplantprojectListByWindplantNo, apiGetgetProjectplanList, apiGetaddProjectplan, apiGetStation,
- apiGetupdateProjectplan, apiGetdeleteProjectplan} from '../../api/api'
- export default {
- name:'generationPlan',
- data() {
- return {
- title:'',
- windframtableData:[],
- windframradio: {},
- single: false,
- showProject: false,
- dialogVisible:false,
- windTurbines: '',
- windFramoptions:[],
- projectOptions: [],
- page:{
- pagesize: 12,
- currentPage: 1,
- total: 0
- },
- ruleForm: {
- station: '',
- project: '',
- monthVal: '',
- planElectric: ''
- },
- rules: {
- station: [
- { required: true, message: '请选择场站', trigger: 'change' }
- ],
- project: [
- { required: true, message: '请选择期次', trigger: 'change' }
- ],
- monthVal: [
- { required: true, message: '请选择日期', trigger: 'change' }
- ],
- planElectric: [
- { required: true, message: '请输入计划发电量', trigger: 'blur' }
- ],
- }
- }
- },
- mounted() {
- this.getProjectplanList()
- this.getWindFramData()
- },
- methods:{
- getSeachData() {
- this.page.currentPage = 1
- this.getProjectplanList('seach')
- },
- chooseStation(val) {
- this.getProjectData(val)
- },
- // 根据风场获取期次数据
- getProjectData(val) {
- let that = this
- let params = {
- stationNo: val
- }
- apiGetWindplantprojectListByWindplantNo(params).then(datas =>{
- if (datas && datas.data && datas.data.list) {
- that.showProject = true
- that.projectOptions = datas.data.list
- }
- })
- },
- reset() {
- this.windTurbines = ''
- this.page = {
- pagesize: 12,
- currentPage: 1,
- total: 0
- }
- this.getProjectplanList()
- },
- handleSizeChange(val){
- this.page.pagesize = val
- this.getProjectplanList('seach')
- },
- handleCurrentChange(val){
- this.page.currentPage =val
- this.getProjectplanList('seach')
- },
- closeDialog() {
- this.showProject = true
- this.$refs['ruleForm'].clearValidate()
- },
- submitForm(formName) {
- console.log('ruleForm====>>>>',this.ruleForm)
- this.$refs[formName].validate((valid) => {
- if (valid) {
- let that = this
- that.addOrUpdatewindframDate()
- }
- });
- },
- // 新增/修改风电场配置
- addOrUpdatewindframDate() {
- let that = this
- let params = {
- windpower: that.ruleForm.station,
- projectid: that.ruleForm.project,
- year: that.ruleForm.monthVal.substring(0, that.ruleForm.monthVal.indexOf('-')),
- month: that.ruleForm.monthVal.substring(that.ruleForm.monthVal.indexOf('-')+1, that.ruleForm.monthVal.length),
- generatingcapacity: that.ruleForm.planElectric
- }
- if (!that.single) {
- apiGetaddProjectplan(params).then(datas =>{
- that.changeshowData(datas)
- })
- } else {
- params.id = that.windframradio.id
- apiGetupdateProjectplan(params).then(datas =>{
- that.changeshowData(datas)
- })
- }
-
- },
- changeshowData(datas) {
- if (datas.msg === '操作成功') {
- this.dialogVisible = false
- if (!this.single) {
- this.$message({
- message: '发电计划信息新增成功',
- type: 'success'
- });
- } else {
- this.$message({
- message: '发电计划信息修改成功',
- type: 'success'
- });
- }
- this.single = false
- this.getProjectplanList('seach')
- }
- },
- resetForm() {
- this.ruleForm = {
- station: '',
- project: '',
- monthVal: '',
- planElectric: ''
- }
- },
- // 新增区域信息
- handleAdd() {
- this.dialogVisible = true
- this.single = false
- this.showProject = false
- this.title = '新增发电计划'
- this.ruleForm = {
- station: '',
- project: '',
- monthVal: '',
- planElectric: ''
- }
- this.$nextTick(() =>{
- this.resetForm()
- this.$refs['ruleForm'].clearValidate()
- })
- },
- // 获取风电场数据
- getWindFramData() {
- let that = this
- apiGetStation().then(datas =>{
- if (datas && datas.data && datas.data.list) {
- that.windFramoptions = datas.data.list
- // that.windTurbines = datas.data.list[0].no
- }
- })
- },
- // 复制区域信息
- handleCopy() {
- this.dialogVisible = true
- this.title = '复制发电计划'
- this.single = false
- this.showProject = true
- this.ruleForm = {
- station: this.windframradio.windpower,
- project: this.windframradio.projectid,
- monthVal: this.windframradio.year + '-' + this.windframradio.month,
- planElectric: this.windframradio.generatingcapacity
- }
- this.getProjectData(this.windframradio.windpower)
- },
- // 修改区域信息
- handleUpdate() {
- this.dialogVisible = true
- this.single = true
- this.showProject = true
- this.getProjectData(this.windframradio.windpower)
- this.title = '修改发电计划'
- this.ruleForm = {
- station: this.windframradio.windpower,
- project: this.windframradio.projectid,
- monthVal: this.windframradio.year + '-' + this.windframradio.month,
- planElectric: this.windframradio.generatingcapacity
- }
- },
- rowClick(row, column, event) {
- this.windframradio = row
- },
- // 删除区域信息
- handleDelete() {
- this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let that = this
- let params = {
- id: that.windframradio.id
- }
- apiGetdeleteProjectplan(params).then(datas =>{
- if (datas.msg === '操作成功') {
- that.getProjectplanList()
- }
- })
- if (that.windframtableData.length>0) {
- that.windframradio = that.windframtableData[0]
- }
- that.$message({
- type: 'success',
- message: '删除成功!'
- });
- })
- },
- //获取风电场列表数据
- getProjectplanList(type) {
- let that = this
- let params = {
- pageNum: that.page.currentPage,
- pageSize: that.page.pagesize
- }
- if (type) {
- params.windpower = that.windTurbines
- }
- apiGetgetProjectplanList(params).then(datas =>{
- if (datas && datas.rows) {
- that.windframtableData = datas.rows
- that.windframradio = datas.rows[0]
- that.page.total = datas.total
- }
- })
- }
- }
- }
- </script>
- <style lang="less">
- .generationPlan{
- .generationBtn{
- background: #fff;
- padding: 10px 20px 0 20px;
- .titleSty{
- border-left: 4px solid #2996da;
- padding-left: 5px;
- font-size: 14px;
- margin-left:20px;
- }
- .periodSeach{
- display: flex;
- margin:20px;
- .exceed{
- display: flex;
- margin-right:20px;
- .el-select{
- width: 200px;
- margin-right:10px;
- .el-input__inner{
- height:30px;
- }
- .el-input__suffix{
- .el-select__caret{
- line-height:30px;
- }
- }
- }
- }
- }
- span{
- font-size:14px;
- }
- .regionalBtn{
- padding-left: 10px;
- }
- .exceed{
- display: flex;
- margin-right:20px;
- .exTime{
- width: 240px;
- .el-select__tags{
- left: 1px;
- background:#fff;
- }
- }
- }
- .el-select{
- width: 160px;
- margin-right:10px;
- .el-input__inner{
- height:30px;
- }
- .el-input__suffix{
- .el-select__caret{
- line-height:30px;
- }
- }
- }
- .el-button{
- height: 30px;
- // width:100px;
- padding: 0 30px ;
- // padding-top: 8px;
- span{
- margin:0;
- }
- }
- }
- .windframTableData{
- padding: 10px 20px;
- .el-table{
- .el-table__body-wrapper{
- .el-table__empty-block{
- height: 550px !important;
- }
- }
- .el-input__inner{
- height: 30px !important;
- }
- .el-radio__label{
- display: none;
- }
- }
- .el-pagination{
- margin-top: 20px;
- text-align: end;
- position: relative;
- }
- }
- .el-overlay{
- .el-dialog{
- .windframFrom{
- .el-form{
- .el-select {
- width: 100%;
- .el-input__wrapper{
- height: 30px !important;
- }
- }
- .el-input {
- width: calc(100% - 30px);
- }
- .el-date-editor{
- height: 30px;
- }
- }
- }
- }
- }
- }
- </style>
|