index.vue 32.8 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3
<template>
  <div class="app-container">

4
    <div v-if="-2 == $store.state.user.enterpriseId">
耿迪迪's avatar
耿迪迪 committed
5 6 7 8 9 10 11 12 13 14 15 16 17
      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
        <el-form-item label="企业名称" prop="enterpriseName">
          <el-input
            v-model="queryParams.enterpriseName"
            placeholder="请输入企业名称"
            clearable
            size="small"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>

        <el-form-item label="上报时间">
          <el-date-picker
耿迪迪's avatar
耿迪迪 committed
18
            v-model="dateRange"
耿迪迪's avatar
耿迪迪 committed
19
            size="small"
耿迪迪's avatar
耿迪迪 committed
20
            type="datetimerange"
耿迪迪's avatar
耿迪迪 committed
21 22
            start-placeholder="开始日期"
            end-placeholder="结束日期"
耿迪迪's avatar
耿迪迪 committed
23
            value-format="yyyy-MM-dd HH:mm:ss"
耿迪迪's avatar
耿迪迪 committed
24 25 26 27 28 29 30 31 32 33 34
            @change="timeChange"
          ></el-date-picker>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>

      <el-row :gutter="10" class="mb8">
耿迪迪's avatar
耿迪迪 committed
35 36
        <!--<el-col :span="1.5">
          <el-button
耿迪迪's avatar
耿迪迪 committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
          >新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            plain
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['system:day:edit']"
耿迪迪's avatar
耿迪迪 committed
53
          >修改</el-button>
耿迪迪's avatar
耿迪迪 committed
54 55 56 57 58 59 60 61 62 63
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            plain
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
          >删除</el-button>
耿迪迪's avatar
耿迪迪 committed
64
        </el-col>-->
耿迪迪's avatar
耿迪迪 committed
65 66 67 68 69 70 71 72 73 74 75 76 77
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            :loading="exportLoading"
            @click="handleExport"
          >导出</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>

耿迪迪's avatar
耿迪迪 committed
78 79 80
      <el-table v-loading="loading" :data="dayList">
        <!--<el-table-column type="selection" width="55" align="center"/>-->
        <el-table-column label="企业名称" align="center" prop="enterpriseName"  width="180" :show-overflow-tooltip="true"/>
耿迪迪's avatar
耿迪迪 committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
        <el-table-column label="天然气总气量/wm³" align="center" prop="fGasUsage" width="150"/>
        <el-table-column label="天然气城镇居民用量/wm³" align="center" prop="fUrbanGasUsage" width="180">
          <template slot-scope="scope">
            <span v-if="scope.row.fUrbanGasUsage">{{ scope.row.fUrbanGasUsage }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="天然气农村气代煤居民用量/wm³" align="center" prop="fRuralReplaceResidentsGasUsage" width="210">
          <template slot-scope="scope">
            <span v-if="scope.row.fRuralReplaceResidentsGasUsage">{{ scope.row.fRuralReplaceResidentsGasUsage }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="液化石油气总量/t" align="center" prop="fLpgUsage" width="150"/>
        <el-table-column label="液化石油气城镇居民用量/t" align="center" prop="fUrbanLpgUsage" width="180">
          <template slot-scope="scope">
            <span v-if="scope.row.fUrbanLpgUsage">{{ scope.row.fUrbanLpgUsage }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="液化石油气农村居民用量/t" align="center" prop="fRuralLpgUsage" width="180">
          <template slot-scope="scope">
            <span v-if="scope.row.fRuralLpgUsage">{{ scope.row.fRuralLpgUsage }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
107
        <el-table-column label="上报省厅状态" align="center" prop="fGovUploadStatus">
耿迪迪's avatar
耿迪迪 committed
108 109 110 111 112 113
          <template slot-scope="scope">
            <span v-if="scope.row.fGovUploadStatus == '0'">未上报</span>
            <span v-else-if="scope.row.fGovUploadStatus == '1'">已上报</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
114
        <el-table-column label="上报省厅日期" align="center" prop="fGovUploadTime" width="180">
耿迪迪's avatar
耿迪迪 committed
115 116 117 118 119
          <template slot-scope="scope">
            <span v-if="scope.row.fGovUploadTime">{{ parseTime(scope.row.fGovUploadTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
耿迪迪's avatar
耿迪迪 committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">
           <!-- <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
            >修改</el-button>-->
            <el-button
              size="mini"
              type="text"
              icon="el-icon-document"
              @click="handleDetail(scope.row)"
            >详情</el-button>
耿迪迪's avatar
耿迪迪 committed
134
           <!-- <el-button
耿迪迪's avatar
耿迪迪 committed
135 136 137 138
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
耿迪迪's avatar
耿迪迪 committed
139 140 141 142 143 144
            >删除</el-button>-->
            <el-button
              size="mini"
              type="text"
              @click="handleReport(scope.row)"
            >上报</el-button>
耿迪迪's avatar
耿迪迪 committed
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </div>


    <!-- 添加或修改供需平衡-企业每日填报对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="企业uuid" prop="fCompanyInfoId">
          <el-input v-model="form.fCompanyInfoId" placeholder="请输入企业uuid" />
        </el-form-item>
        <el-form-item label="天然气城镇居民用量" prop="fUrbanGasUsage">
          <el-input v-model="form.fUrbanGasUsage" placeholder="请输入天然气城镇居民用量" />
        </el-form-item>
        <el-form-item label="天然气农村气代煤居民用量" prop="fRuralReplaceResidentsGasUsage">
          <el-input v-model="form.fRuralReplaceResidentsGasUsage" placeholder="请输入天然气农村气代煤居民用量" />
        </el-form-item>
        <el-form-item label="天然气农村非气代煤居民用量" prop="fNoRuralReplaceResidentsGasUsage">
          <el-input v-model="form.fNoRuralReplaceResidentsGasUsage" placeholder="请输入天然气农村非气代煤居民用量" />
        </el-form-item>
        <el-form-item label="天然气工业用量" prop="fIndustrialGasUsage">
          <el-input v-model="form.fIndustrialGasUsage" placeholder="请输入天然气工业用量" />
        </el-form-item>
        <el-form-item label="天然气商业用量" prop="fCommercialGasUsage">
          <el-input v-model="form.fCommercialGasUsage" placeholder="请输入天然气商业用量" />
        </el-form-item>
        <el-form-item label="天然气公福用量" prop="fPublicGasUsage">
          <el-input v-model="form.fPublicGasUsage" placeholder="请输入天然气公福用量" />
        </el-form-item>
        <el-form-item label="天然气城市集中供热锅炉用量" prop="fCityHeatingGasUasge">
          <el-input v-model="form.fCityHeatingGasUasge" placeholder="请输入天然气城市集中供热锅炉用量" />
        </el-form-item>
        <el-form-item label="天然气汽车用户用量" prop="fCarGasUsage">
          <el-input v-model="form.fCarGasUsage" placeholder="请输入天然气汽车用户用量" />
        </el-form-item>
        <el-form-item label="出售给其他燃气企业的天然气量" prop="fSoldGasVolume">
          <el-input v-model="form.fSoldGasVolume" placeholder="请输入出售给其他燃气企业的天然气量" />
        </el-form-item>
        <el-form-item label="天然气总凄凉" prop="fGasUsage">
          <el-input v-model="form.fGasUsage" placeholder="请输入天然气总凄凉" />
        </el-form-item>
        <el-form-item label="液化石油气城镇居民用量" prop="fUrbanLpgUsage">
          <el-input v-model="form.fUrbanLpgUsage" placeholder="请输入液化石油气城镇居民用量" />
        </el-form-item>
        <el-form-item label="液化石油气农村居民用量" prop="fRuralLpgUsage">
          <el-input v-model="form.fRuralLpgUsage" placeholder="请输入液化石油气农村居民用量" />
        </el-form-item>
        <el-form-item label="液化石油气工业用量(吨)" prop="fIndustrialLpgUsage">
          <el-input v-model="form.fIndustrialLpgUsage" placeholder="请输入液化石油气工业用量(吨)" />
        </el-form-item>
        <el-form-item label="液化石油气商业用量(吨)" prop="fCommercialLpgUsage">
          <el-input v-model="form.fCommercialLpgUsage" placeholder="请输入液化石油气商业用量(吨)" />
        </el-form-item>
        <el-form-item label="液化石油气公福用量(吨)" prop="fPublicLpgUsage">
          <el-input v-model="form.fPublicLpgUsage" placeholder="请输入液化石油气公福用量(吨)" />
        </el-form-item>
        <el-form-item label="液化石油气汽车用户用量(吨)" prop="fCarLpgUsage">
          <el-input v-model="form.fCarLpgUsage" placeholder="请输入液化石油气汽车用户用量(吨)" />
        </el-form-item>
        <el-form-item label="出售或调拨给其他燃气企业液化石油气量(吨)" prop="fSoldLpgVolume">
          <el-input v-model="form.fSoldLpgVolume" placeholder="请输入出售或调拨给其他燃气企业液化石油气量(吨)" />
        </el-form-item>
        <el-form-item label="液化石油气总量(吨)" prop="fLpgUsage">
          <el-input v-model="form.fLpgUsage" placeholder="请输入液化石油气总量(吨)" />
        </el-form-item>
        <el-form-item label="记录时间,日,格式:2023-09-01" prop="fReportRecord">
          <el-input v-model="form.fReportRecord" placeholder="请输入记录时间,日,格式:2023-09-01" />
        </el-form-item>
        <el-form-item label="上报时间,日,格式:2023-09-01" prop="fReportTime">
          <el-input v-model="form.fReportTime" placeholder="请输入上报时间,日,格式:2023-09-01" />
        </el-form-item>
        <el-form-item label="创建时间 yyyy-MM-dd hh:mm:ss" prop="fCreateTime">
          <el-input v-model="form.fCreateTime" placeholder="请输入创建时间 yyyy-MM-dd hh:mm:ss" />
        </el-form-item>
        <el-form-item label="最后修改时间 yyyy-MM-dd hh:mm:ss" prop="fUpdateTime">
          <el-input v-model="form.fUpdateTime" placeholder="请输入最后修改时间 yyyy-MM-dd hh:mm:ss" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm"> </el-button>
        <el-button @click="cancel"> </el-button>
      </div>
    </el-dialog>

    <div v-if="-2 != $store.state.user.enterpriseId" class="report-content">
      <el-row style="margin-left: -3.5px;margin-right: -3.5px">
        <el-col :span="12" style="padding: 0px 3.5px 0px 3.5px">
          <div class="report-title">
            <div class="title">上报记录</div>
          </div>
          <div class="content">
            <!-- 日历 -->
            <Calendar
              width="100%"
              v-model="reportDate"
              :scheduleData="scheduleData"
              @dateChange="dateChange"
            />
          </div>
        </el-col>

        <el-col :span="12" style="padding: 0px 3.5px 0px 3.5px">
          <div class="report-title flex-between">
            <div class="title">上报情况</div>
            <el-button
              type="primary"
              size="small"
              @click="reportInfo"
            >
              上报
            </el-button>
          </div>
          <div class="content">
            <div class="state-warp">
              <el-row>
                <el-col :span="13">
                  <div class="label-warp">状态</div>
                  <div class="value-warp">
272
                    <span v-if="reportForm.fReportStatus == '1'">已上报</span>
耿迪迪's avatar
耿迪迪 committed
273 274 275
                    <span v-else>未上报</span>
                  </div>
                </el-col>
耿迪迪's avatar
耿迪迪 committed
276
                <el-col :span="11" style="padding-left: 45px">
耿迪迪's avatar
耿迪迪 committed
277 278
                  <div class="label-warp">上报时间</div>
                  <div class="value-warp">
279
                    <span v-if="reportForm.fReportTime">{{ reportForm.fReportTime }}</span>
耿迪迪's avatar
耿迪迪 committed
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
                    <span v-else>暂无</span>
                  </div>
                </el-col>
              </el-row>
            </div>

            <div class="report-form" >
              <el-form ref="reportForm" label-position="top" :rules="rules" label-width="80px" :model="reportForm">
                <el-row class="el-row-table">
                  <el-col :span="12" style="padding-right: 2px">
                    <el-col :span="24" class="sort-type">
                      天然气
                    </el-col>
                    <el-col :span="24">
                      <el-form-item label="天然气总气量(万立方米)" prop="fGasUsage">
                        <el-input type="Number" v-model="reportForm.fGasUsage" placeholder="请输入天然气总气量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="天然气农村气代煤居民用量(万立方米)" prop="fRuralReplaceResidentsGasUsage">
                        <el-input type="Number" v-model="reportForm.fRuralReplaceResidentsGasUsage" placeholder="请输入天然气农村气代煤居民用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="天然气工业用量(万立方米)" prop="fIndustrialGasUsage">
                        <el-input type="Number" v-model="reportForm.fIndustrialGasUsage" placeholder="请输入天然气工业用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="天然气公福用量(万立方米)" prop="fPublicGasUsage">
                        <el-input type="Number" v-model="reportForm.fPublicGasUsage" placeholder="请输入天然气公福用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="天然气汽车用户用量(万立方米)" prop="fCarGasUsage">
                        <el-input type="Number" v-model="reportForm.fCarGasUsage" placeholder="请输入天然气汽车用户用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-col :span="24" class="sort-type">
                        石油气
                      </el-col>
                      <el-form-item label="液化石油气总量(吨)" prop="fLpgUsage">
                        <el-input type="Number" v-model="reportForm.fLpgUsage" placeholder="请输入液化石油气总量(吨)" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="液化石油气农村居民用量(吨)" prop="fRuralLpgUsage">
                        <el-input type="Number" v-model="reportForm.fRuralLpgUsage" placeholder="请输入液化石油气农村居民用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="液化石油气商业用量(吨)" prop="fCommercialLpgUsage">
                        <el-input type="Number" v-model="reportForm.fCommercialLpgUsage" placeholder="请输入液化石油气商业用量(吨)" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="液化石油气汽车用户用量(吨)" prop="fCarLpgUsage">
                        <el-input type="Number" v-model="reportForm.fCarLpgUsage" placeholder="请输入液化石油气汽车用户用量(吨)" />
                      </el-form-item>
                    </el-col>


                  </el-col>

                  <el-col :span="12" style="padding-left: 2px;padding-right: 1px">
                    <el-col :span="24" class="sort-type">

                    </el-col>
                    <el-col :span="24">
                      <el-form-item label="天然气城镇居民用量(万立方米)" prop="fUrbanGasUsage">
                        <el-input type="Number" v-model="reportForm.fUrbanGasUsage" placeholder="请输入天然气城镇居民用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="天然气农村非气代煤居民用量(万立方米)" prop="fNoRuralReplaceResidentsGasUsage">
                        <el-input type="Number" v-model="reportForm.fNoRuralReplaceResidentsGasUsage" placeholder="请输入天然气农村非气代煤居民用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="天然气商业用量(万立方米)" prop="fCommercialGasUsage">
                        <el-input type="Number" v-model="reportForm.fCommercialGasUsage" placeholder="请输入天然气商业用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="天然气城市集中供热锅炉用量(万立方米)" prop="fCityHeatingGasUasge">
                        <el-input type="Number" v-model="reportForm.fCityHeatingGasUasge" placeholder="请输入天然气城市集中供热锅炉用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="出售给其他燃气企业的天然气量(万立方米)" prop="fSoldGasVolume">
                        <el-input type="Number" v-model="reportForm.fSoldGasVolume" placeholder="请输入出售给其他燃气企业的天然气量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24" class="sort-type">
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="液化石油气城镇居民用量" prop="fUrbanLpgUsage">
                        <el-input type="Number" v-model="reportForm.fUrbanLpgUsage" placeholder="请输入液化石油气城镇居民用量" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="液化石油气工业用量(吨)" prop="fIndustrialLpgUsage">
                        <el-input type="Number" v-model="reportForm.fIndustrialLpgUsage" placeholder="请输入液化石油气工业用量(吨)" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="液化石油气公福用量(吨)" prop="fPublicLpgUsage">
                        <el-input type="Number" v-model="reportForm.fPublicLpgUsage" placeholder="请输入液化石油气公福用量(吨)" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">
                      <el-form-item label="出售给其他燃气企业液化石油气量(吨)" prop="fSoldLpgVolume">
                        <el-input type="Number" v-model="reportForm.fSoldLpgVolume" placeholder="请输入出售给其他燃气企业液化石油气量(吨)" />
                      </el-form-item>
                    </el-col>

                    <el-col :span="24">

                    </el-col>

                  </el-col>

                </el-row>
              </el-form>
            </div>

            <!--<div style="border: 1px solid;height: 500px"></div>-->
          </div>


        </el-col>
      </el-row>
    </div>

    <!-- 详情 -->
    <DetailInfo ref="detail"/>
  </div>
</template>

<script>
耿迪迪's avatar
耿迪迪 committed
438
import { listDay, getDay, delDay, addDay, updateDay, exportDay, reportInfoList, getReportInfoByCompany, reportSupBalGasDayRecInfo } from "@/api/supplybalance/day";
耿迪迪's avatar
耿迪迪 committed
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
import Calendar from "@/components/Calendar";
import moment from "moment";
import DetailInfo from "./components/DetailInfo";
export default {
  name: "Day",
  components: {
    Calendar,
    DetailInfo
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 供需平衡-企业每日填报表格数据
      dayList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        fCompanyInfoId: null,
        enterpriseName: null,
        beginRepDate: null,
477
        endRepDate: null,
耿迪迪's avatar
耿迪迪 committed
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        fGasUsage: [
          { required: true, message: "天然气总气量不能为空", trigger: "blur" }
        ],
        fLpgUsage: [
          { required: true, message: "液化石油气总量不能为空", trigger: "blur" }
        ],
      },
      scheduleData:[
        {date:'2024-06-19',content:'已上报'},
        {date:'2024-06-17',content:'未上报'},
        {date:'2024-06-15',content:'已上报'},
        {date:'2024-06-14',content:'已上报'}
      ],
      reportForm: {},
      reportDate: moment().format('YYYY-MM-DD'),
耿迪迪's avatar
耿迪迪 committed
498
      dateRange: []
耿迪迪's avatar
耿迪迪 committed
499 500 501 502 503 504 505 506 507 508 509 510
    };
  },
  created() {
    if(-2 == this.$store.state.user.enterpriseId){
      this.getList();
      //return;
    }
    // 获取当月开始时间
    const startOfMonth = moment().startOf('month').format('YYYY-MM-DD HH:mm:ss');
    // 获取当月结束时间
    const endOfMonth = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
    this.currentMonthReportInfo(startOfMonth,endOfMonth);
511

耿迪迪's avatar
耿迪迪 committed
512

耿迪迪's avatar
耿迪迪 committed
513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592
  },
  mounted(){
    this.getReportInfo();
  },
  methods: {
    /** 查询供需平衡-企业每日填报列表 */
    getList() {
      this.loading = true;
      listDay(this.queryParams).then(response => {
        this.dayList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        fRepUsgDayId: null,
        fCompanyInfoId: null,
        fUrbanGasUsage: null,
        fRuralReplaceResidentsGasUsage: null,
        fNoRuralReplaceResidentsGasUsage: null,
        fIndustrialGasUsage: null,
        fCommercialGasUsage: null,
        fPublicGasUsage: null,
        fCityHeatingGasUasge: null,
        fCarGasUsage: null,
        fSoldGasVolume: null,
        fGasUsage: null,
        fUrbanLpgUsage: null,
        fRuralLpgUsage: null,
        fIndustrialLpgUsage: null,
        fCommercialLpgUsage: null,
        fPublicLpgUsage: null,
        fCarLpgUsage: null,
        fSoldLpgVolume: null,
        fLpgUsage: null,
        fReportRecord: null,
        fReportTime: null,
        fCreateTime: null,
        fUpdateTime: null
      };
      this.resetForm("form");
    },
    resetReportForm() {
      this.reportForm = {
        fRepUsgDayId: null,
        fCompanyInfoId: null,
        fUrbanGasUsage: null,
        fRuralReplaceResidentsGasUsage: null,
        fNoRuralReplaceResidentsGasUsage: null,
        fIndustrialGasUsage: null,
        fCommercialGasUsage: null,
        fPublicGasUsage: null,
        fCityHeatingGasUasge: null,
        fCarGasUsage: null,
        fSoldGasVolume: null,
        fGasUsage: null,
        fUrbanLpgUsage: null,
        fRuralLpgUsage: null,
        fIndustrialLpgUsage: null,
        fCommercialLpgUsage: null,
        fPublicLpgUsage: null,
        fCarLpgUsage: null,
        fSoldLpgVolume: null,
        fLpgUsage: null,
        fReportRecord: null,
        fReportTime: null,
        fCreateTime: null,
        fUpdateTime: null
      };
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
耿迪迪's avatar
耿迪迪 committed
593 594 595
      if (this.dateRange != null) {
        this.queryParams.beginRepDate = this.dateRange[0];
        this.queryParams.endRepDate = this.dateRange[1];
596 597 598 599
      } else {
        this.queryParams.beginRepDate = null;
        this.queryParams.endRepDate = null;
      }
耿迪迪's avatar
耿迪迪 committed
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.dateRange = [];
      this.queryParams.beginRepDate = null;
      this.queryParams.endRepDate = null;
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.fRepUsgDayId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加供需平衡-企业每日填报";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const fRepUsgDayId = row.fRepUsgDayId || this.ids
      getDay(fRepUsgDayId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改供需平衡-企业每日填报";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.fRepUsgDayId != null) {
            updateDay(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDay(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const fRepUsgDayIds = row.fRepUsgDayId || this.ids;
      this.$confirm('是否确认删除供需平衡-企业每日填报编号为"' + fRepUsgDayIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delDay(fRepUsgDayIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有供需平衡-企业每日填报数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.exportLoading = true;
          return exportDay(queryParams);
        }).then(response => {
          this.download(response.msg);
          this.exportLoading = false;
        }).catch(() => {});
    },
    //日期切换
    dateChange(val){
      this.resetReportForm();
      this.getReportInfo();
      if(val == 0){
耿迪迪's avatar
耿迪迪 committed
686
        const startOfMonth = moment(this.reportDate).startOf('month').format('YYYY-MM-DD HH:mm:ss');
耿迪迪's avatar
耿迪迪 committed
687
        // 获取当月结束时间
耿迪迪's avatar
耿迪迪 committed
688
        const endOfMonth = moment(this.reportDate).endOf('month').format('YYYY-MM-DD HH:mm:ss');
耿迪迪's avatar
耿迪迪 committed
689 690 691 692 693 694 695
        this.currentMonthReportInfo(startOfMonth,endOfMonth);
      }
    },
    reportInfo(){
      this.$refs["reportForm"].validate(valid => {
        if (valid) {
          if (this.reportForm.fRepUsgDayId != null) {
耿迪迪's avatar
耿迪迪 committed
696 697 698 699 700 701 702 703 704 705 706 707 708 709
            let that = this;
            this.$confirm('当前已上报,是否确认再次上报?', "警告", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }).then(function() {
              that.reportForm.fReportTime =  moment().format('YYYY-MM-DD HH:mm:ss');
              that.reportForm.calendarDate = that.reportDate;
              that.reportForm.fReportStatus = '1';
              return updateDay(that.reportForm);
            }).then(() => {
              that.getReportInfo();
              that.msgSuccess("上报成功");
            }).catch(() => {});
耿迪迪's avatar
耿迪迪 committed
710
          } else {
耿迪迪's avatar
耿迪迪 committed
711 712 713
            this.reportForm.fReportTime =  moment().format('YYYY-MM-DD HH:mm:ss');
            this.reportForm.fCalendarDate = this.reportDate;
            this.reportForm.fReportStatus = '1';
耿迪迪's avatar
耿迪迪 committed
714 715 716 717 718 719
            addDay(this.reportForm).then(response => {
              this.msgSuccess("上报成功");
              const startOfMonth = moment(this.reportDate).startOf('month').format('YYYY-MM-DD');
              // 获取当月结束时间
              const endOfMonth = moment(this.reportDate).endOf('month').format('YYYY-MM-DD');
              this.currentMonthReportInfo(startOfMonth,endOfMonth);
720
              this.getReportInfo();
耿迪迪's avatar
耿迪迪 committed
721 722 723 724 725
            });
          }
        }
      });
    },
耿迪迪's avatar
耿迪迪 committed
726 727
    currentMonthReportInfo(beginCurrentMonthDate,endCurrentMonthDate){
      reportInfoList({fCompanyInfoId:this.$store.state.user.enterpriseId,beginCurrentMonthDate:beginCurrentMonthDate,endCurrentMonthDate:endCurrentMonthDate}).then(res =>{
耿迪迪's avatar
耿迪迪 committed
728 729 730
        if(res.code == 200 && res.data){
          this.scheduleData = [];
            res.data.forEach(item =>{
耿迪迪's avatar
耿迪迪 committed
731
              this.scheduleData.push({date:item.fCalendarDate,content:item.fReportStatus == '1'?"已上报":"未上报"})
耿迪迪's avatar
耿迪迪 committed
732 733 734 735 736
          })
        }
      })
    },
    getReportInfo(){
耿迪迪's avatar
耿迪迪 committed
737
      getReportInfoByCompany({companyId:this.$store.state.user.enterpriseId,calendarDate:this.reportDate}).then(res =>{
耿迪迪's avatar
耿迪迪 committed
738 739 740 741 742 743 744 745 746 747
          if(res.code && res.data){
          this.reportForm = res.data;
        }
      })
    },
    //详情
    handleDetail(row){
      this.$refs.detail.getDetailInfo(row.fRepUsgDayId);
    },
    timeChange(val){
耿迪迪's avatar
耿迪迪 committed
748 749 750 751 752 753 754 755 756 757 758 759 760 761 762
      this.queryParams.beginRepDate = val[0];
      this.queryParams.endRepDate = val[1];
    },
    //上传
    handleReport(row) {
      this.$confirm('是否确认上报日用气量编号为"' + row.fRepUsgDayId + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function() {
        return reportSupBalGasDayRecInfo({fRepUsgDayId : row.fRepUsgDayId});
      }).then(() => {
        this.getList();
        this.msgSuccess("上报成功");
      }).catch(() => {});
耿迪迪's avatar
耿迪迪 committed
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862
    },
  }
};
</script>
<style scoped lang="scss">
  .report-content{
    //border: 1px solid;
    margin: auto;
    max-width: 1200px;
    padding: 30px
  }

  .report-title{
    background: rgb(241, 241, 242);
    padding: 20px 30px;
    border-radius: 3px;
  }

  .report-title .title{
    line-height: 32px;
    font-weight: 500;
  }

  .content{
    background: var(--custom-background-soft);
    box-shadow: 0 3px 14px #a9aaab80;
    border-radius: 3px;
    padding: 32px 48px;
    height: 525px;
  }

  .report-form{
    height: 84%;
    overflow-y: auto;
    &::-webkit-scrollbar {
      /* 设置滚动条宽度 */
      width: 4px;
      /* 设置滚动条背景色 */
      //background: black;
    }

    //滚动条轨道
    &::-webkit-scrollbar-track {
      background-color:transparent;
      -webkit-border-radius: 2em;
      -moz-border-radius: 2em;
      border-radius:2em;
    }

    //滚动条滑块
    &::-webkit-scrollbar-thumb {
      background-color: rgb(147,147,153,0.5);
      -webkit-border-radius: 2em;
      -moz-border-radius: 2em;
      border-radius:2em;
    }

    ::v-deep .el-form--label-top .el-form-item__label{
      padding: 0px;
      font-size: 12px;
    }

    ::v-deep .el-form-item {
      margin-bottom: 7px;
    }
  }

  .state-warp{
    border-bottom: 1px solid #d4d4d4;
    height: 54px;
    margin-top: -10px;
    padding-bottom: 8px;
    margin-bottom: 24px;
    color: var(--custom-main-text-color);
  }
  .label-warp{
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: rgba(24, 31, 67, .5);
    line-height: 20px;
  }

  .value-warp{
    font-weight: 500;
    font-size: 18px;
    line-height: 25px;
  }

  .flex-between{
    display: flex;
    justify-content: space-between;
  }

  .sort-type{
    height: 25px;
    font-weight: 600;
    margin: 0px 0px 6px 0px;
  }
</style>