index.vue 22.1 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
耿迪迪's avatar
耿迪迪 committed
4
      <el-form-item label="企业名称" prop="enterpriseName">
耿迪迪's avatar
耿迪迪 committed
5
        <el-input
耿迪迪's avatar
耿迪迪 committed
6
          v-model="queryParams.enterpriseName"
耿迪迪's avatar
耿迪迪 committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
          placeholder="请输入企业名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="停气类型" prop="fStopType">
        <el-select v-model="queryParams.fStopType" placeholder="请选择停气类型" clearable size="small">
          <el-option
            v-for="dict in fStopTypeOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="停气进度" prop="fStopProgress">
        <el-select v-model="queryParams.fStopProgress" placeholder="请选择停气进度" clearable size="small">
          <el-option
            v-for="dict in fStopProgressOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
耿迪迪's avatar
耿迪迪 committed
33
      <el-form-item label="上报状态" prop="fRepStatus" v-if="-2 != $store.state.user.enterpriseId">
耿迪迪's avatar
耿迪迪 committed
34 35
        <el-select v-model="queryParams.fRepStatus" placeholder="请选择上报状态" clearable size="small">
          <el-option label="未上报" value="0" />
耿迪迪's avatar
耿迪迪 committed
36 37 38 39 40 41 42
          <el-option label="已上报" value="1" />
        </el-select>
      </el-form-item>
      <el-form-item label="上报状态" prop="fGovUploadStatus" v-if="-2 == $store.state.user.enterpriseId">
        <el-select v-model="queryParams.fGovUploadStatus" placeholder="请选择上报状态" clearable size="small">
          <el-option label="未上报" value="0" />
          <el-option label="已上报" value="1" />
耿迪迪's avatar
耿迪迪 committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
        </el-select>
      </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">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
耿迪迪's avatar
耿迪迪 committed
58
          v-if="-2 != $store.state.user.enterpriseId"
耿迪迪's avatar
耿迪迪 committed
59 60 61
          @click="handleAdd"
        >新增</el-button>
      </el-col>
耿迪迪's avatar
耿迪迪 committed
62
     <!-- <el-col :span="1.5">
耿迪迪's avatar
耿迪迪 committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
        >修改</el-button>
      </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
81
      </el-col>-->
耿迪迪's avatar
耿迪迪 committed
82 83 84 85 86 87 88 89 90 91 92 93 94
      <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
95 96 97
    <el-table v-loading="loading" :data="supList">
     <!-- <el-table-column type="selection" width="55" align="center" />-->
      <el-table-column label="企业名称" align="center" prop="enterpriseName" :show-overflow-tooltip="true"/>
耿迪迪's avatar
耿迪迪 committed
98
      <el-table-column label="停气开始日期" align="center" prop="fStartDate" width="150">
耿迪迪's avatar
耿迪迪 committed
99
        <template slot-scope="scope">
100
          <span>{{ parseTime(scope.row.fStartDate, '{y}-{m}-{d}') }}</span>
耿迪迪's avatar
耿迪迪 committed
101 102
        </template>
      </el-table-column>
耿迪迪's avatar
耿迪迪 committed
103
      <el-table-column label="停气结束日期" align="center" prop="fEndDate" width="150">
耿迪迪's avatar
耿迪迪 committed
104
        <template slot-scope="scope">
105
          <span>{{ parseTime(scope.row.fEndDate, '{y}-{m}-{d}') }}</span>
耿迪迪's avatar
耿迪迪 committed
106 107 108 109 110 111 112
        </template>
      </el-table-column>
      <el-table-column label="停气类型" align="center" prop="fStopType" :formatter="fStopTypeFormat" />
      <el-table-column label="影响用户" align="center" prop="fInfluenceCus" />
      <el-table-column label="停气进度" align="center" prop="fStopProgress" :formatter="fStopProgressFormat" />
      <el-table-column label="恢复供气时间" align="center" prop="fRecoveryGasTime" width="180">
        <template slot-scope="scope">
113
          <span v-if="scope.row.fRecoveryGasTime">{{ parseTime(scope.row.fRecoveryGasTime, '{y}-{m}-{d}') }}</span>
耿迪迪's avatar
耿迪迪 committed
114 115 116
          <span v-else>-</span>
        </template>
      </el-table-column>
117
      <el-table-column label="上报状态" align="center" prop="fRepStatus" v-if="this.$store.state.user.roleId == 5">
耿迪迪's avatar
耿迪迪 committed
118 119 120 121 122 123
        <template slot-scope="scope">
          <span v-if="scope.row.fRepStatus == '0'">未上报</span>
          <span v-else-if="scope.row.fRepStatus == '1'">已上报</span>
          <span v-else>-</span>
        </template>
      </el-table-column>
124
      <el-table-column label="上报时间" align="center" prop="entRepTime" width="150" v-if="this.$store.state.user.roleId == 5">
耿迪迪's avatar
耿迪迪 committed
125
        <template slot-scope="scope">
126
          <span v-if="scope.row.entRepTime">{{ parseTime(scope.row.entRepTime, '{y}-{m}-{d} {h}:{i}') }}</span>
耿迪迪's avatar
耿迪迪 committed
127 128 129
          <span v-else>-</span>
        </template>
      </el-table-column>
130
      <el-table-column label="上报省厅状态" align="center" prop="fGovUploadStatus" v-if="this.$store.state.user.roleId == 3">
耿迪迪's avatar
耿迪迪 committed
131 132 133 134 135 136
        <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>
137
      <el-table-column label="上报省厅时间" align="center" prop="fRecoveryGasTime" width="150" v-if="this.$store.state.user.roleId == 3">
耿迪迪's avatar
耿迪迪 committed
138
        <template slot-scope="scope">
139
          <span v-if="scope.row.fGovUploadTime">{{ parseTime(scope.row.fGovUploadTime, '{y}-{m}-{d} {h}:{i}') }}</span>
耿迪迪's avatar
耿迪迪 committed
140 141 142 143
          <span v-else>-</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
耿迪迪's avatar
耿迪迪 committed
144
        <template slot-scope="scope">
耿迪迪's avatar
耿迪迪 committed
145 146 147 148 149 150
          <el-button
            size="mini"
            type="text"
            icon="el-icon-document"
            @click="handleDetail(scope.row)"
          >详情</el-button>
耿迪迪's avatar
耿迪迪 committed
151 152 153 154
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
耿迪迪's avatar
耿迪迪 committed
155
            v-if="scope.row.fRepStatus == '0'"
耿迪迪's avatar
耿迪迪 committed
156 157 158 159 160 161
            @click="handleUpdate(scope.row)"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
耿迪迪's avatar
耿迪迪 committed
162
            v-if="scope.row.fRepStatus == '0'"
耿迪迪's avatar
耿迪迪 committed
163 164
            @click="handleDelete(scope.row)"
          >删除</el-button>
耿迪迪's avatar
耿迪迪 committed
165 166 167 168 169 170 171 172 173 174 175
          <el-button
            size="mini"
            type="text"
            @click="handleReport(scope.row)"
          >上报</el-button>
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.fRepStatus == '1' && -2 != $store.state.user.enterpriseId"
            @click="handleStop(scope.row)"
          >停气状态</el-button>
耿迪迪's avatar
耿迪迪 committed
176 177 178 179 180 181 182 183 184 185 186 187 188
        </template>
      </el-table-column>
    </el-table>

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

    <!-- 添加或修改停气监管对话框 -->
189
    <el-dialog :title="title" :visible.sync="open" v-if="open" width="1200px" append-to-body :close-on-click-modal="false">
耿迪迪's avatar
耿迪迪 committed
190
      <el-form label-position="top" ref="form" :model="form" :rules="rules" label-width="120px">
耿迪迪's avatar
耿迪迪 committed
191 192 193 194 195 196 197 198 199
        <el-row>
          <el-col :span="12">
            <el-row class="el-row-table">
              <el-col :span="12">
                <el-form-item label="停气开始日期" prop="fStartDate">
                  <el-date-picker clearable size="small"
                                  v-model="form.fStartDate"
                                  type="datetime"
                                  value-format="yyyy-MM-dd HH:mm:ss"
耿迪迪's avatar
耿迪迪 committed
200
                                  style="width: 98%"
耿迪迪's avatar
耿迪迪 committed
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
                                  placeholder="选择停气开始日期">
                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="停气结束日期" prop="fEndDate">
                  <el-date-picker clearable size="small"
                                  v-model="form.fEndDate"
                                  type="datetime"
                                  value-format="yyyy-MM-dd HH:mm:ss"
                                  style="width: 100%"
                                  placeholder="选择停气结束日期">
                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="停气类型" prop="fStopType">
耿迪迪's avatar
耿迪迪 committed
220
                  <el-select v-model="form.fStopType" style="width: 98%" placeholder="请选择停气类型">
耿迪迪's avatar
耿迪迪 committed
221 222 223 224 225 226 227 228 229 230
                    <el-option
                      v-for="dict in fStopTypeOptions"
                      :key="dict.dictValue"
                      :label="dict.dictLabel"
                      :value="dict.dictValue"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>

耿迪迪's avatar
耿迪迪 committed
231
              <!--<el-col :span="12">
耿迪迪's avatar
耿迪迪 committed
232 233 234 235 236 237 238 239 240 241
                <el-form-item label="停气进度" prop="fStopProgress">
                  <el-select v-model="form.fStopProgress" style="width: 98%" placeholder="请选择停气进度">
                    <el-option
                      v-for="dict in fStopProgressOptions"
                      :key="dict.dictValue"
                      :label="dict.dictLabel"
                      :value="dict.dictValue"
                    ></el-option>
                  </el-select>
                </el-form-item>
耿迪迪's avatar
耿迪迪 committed
242
              </el-col>-->
耿迪迪's avatar
耿迪迪 committed
243

耿迪迪's avatar
耿迪迪 committed
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
              <el-col :span="12">
                <el-form-item label="影响用户" prop="fInfluenceCus">
                  <el-input type="Number" v-model="form.fInfluenceCus" placeholder="请输入影响用户" />
                </el-form-item>
              </el-col>

              <el-col :span="24">
                <el-form-item label="停气原因" prop="fStopReason">
                  <el-input type="textarea" v-model="form.fStopReason" placeholder="请输入停气原因" />
                </el-form-item>
              </el-col>

              <el-col :span="24">
                <el-form-item label="停气范围" prop="fStopRange">
                  <el-input type="textarea" v-model="form.fStopRange" placeholder="请输入停气范围" />
                </el-form-item>
              </el-col>
            </el-row>
          </el-col>

          <el-col :span="12" style="padding-left: 10px">
耿迪迪's avatar
耿迪迪 committed
265
            <el-form-item label="停气区域" prop="fGasStopArea">
266
              <DrawArea class="area-change" v-model="path" @update-path="handleUpdatePathFromParent"/>
耿迪迪's avatar
耿迪迪 committed
267
            </el-form-item>
耿迪迪's avatar
耿迪迪 committed
268 269 270 271 272 273
          </el-col>
        </el-row>


      </el-form>
      <div slot="footer" class="dialog-footer">
耿迪迪's avatar
耿迪迪 committed
274
        <el-button type="primary" @click="submitForm()"> </el-button>
耿迪迪's avatar
耿迪迪 committed
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
        <!--<el-button @click="submitForm()"> </el-button>-->
        <el-button @click="cancel"> </el-button>
      </div>
    </el-dialog>


    <!-- 停气状态弹框 -->
    <el-dialog title="停气状态" :visible.sync="stopOpen" width="500px" append-to-body :close-on-click-modal="false">
      <el-form ref="stopForm" :model="stopForm" :rules="stopRules" label-width="120px">
        <el-form-item label="停气进度" prop="fStopProgress">
          <el-select v-model="stopForm.fStopProgress" style="width: 98%" placeholder="请选择停气进度">
            <el-option
              v-for="dict in fStopProgressOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitStopForm()"> </el-button>
        <!--<el-button @click="submitForm()"> </el-button>-->
299
        <el-button @click="stopOpen=false"> </el-button>
耿迪迪's avatar
耿迪迪 committed
300 301 302
      </div>
    </el-dialog>

耿迪迪's avatar
耿迪迪 committed
303 304 305
    <!-- 详情 -->
    <DetailInfo ref="detail"/>

耿迪迪's avatar
耿迪迪 committed
306 307 308 309
  </div>
</template>

<script>
310
import { listSup, getSup, delSup, addSup, updateSup, exportSup, reportSupBalStopSupRecInfo, changeStopStatus } from "@/api/supplybalance/stop";
311
// 如果只允许画一个,则用这个
312
// import DrawArea from "@/components/DrawArea";
313
// 如果需要画多个,则用这个
314
import DrawArea from "@/components/GasShutDownDrawArea"
耿迪迪's avatar
耿迪迪 committed
315
import DetailInfo from "./components/DetailInfo";
耿迪迪's avatar
耿迪迪 committed
316
import moment from "moment";
耿迪迪's avatar
耿迪迪 committed
317 318 319
export default {
  name: "Sup",
  components: {
耿迪迪's avatar
耿迪迪 committed
320 321
    DrawArea,
    DetailInfo
耿迪迪's avatar
耿迪迪 committed
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
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 停气监管表格数据
      supList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 停气类型字典
      fStopTypeOptions: [],
      // 停气进度字典
      fStopProgressOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        fCompanyInfoId: null,
        fStopType: null,
        fStopProgress: null,
        fRepStatus: null,
耿迪迪's avatar
耿迪迪 committed
357 358
        enterpriseName: null,
        fGovUploadStatus: null
耿迪迪's avatar
耿迪迪 committed
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        fStartDate: [
          { required: true, message: "停气开始日期不能为空", trigger: "blur" }
        ],
        fEndDate: [
          { required: true, message: "停气结束日期不能为空", trigger: "blur" }
        ],
        fStopType: [
          { required: true, message: "停气类型不能为空", trigger: "change" }
        ],
        fInfluenceCus: [
          { required: true, message: "影响用户不能为空", trigger: "blur" }
        ],
        fStopRange: [
          { required: true, message: "停气范围不能为空", trigger: "blur" }
        ],
        fStopProgress: [
          { required: true, message: "停气进度不能为空", trigger: "change" }
        ],
耿迪迪's avatar
耿迪迪 committed
382 383
        fGasStopArea: [
          { required: true, message: "停气区域不能为空" }
耿迪迪's avatar
耿迪迪 committed
384 385 386 387 388 389 390
        ],
      },
      path:[
        [114.602763,38.071221],
        [114.762751,38.056354],
        [114.657695,38.020932],
        [114.655978,38.020121]
耿迪迪's avatar
耿迪迪 committed
391 392 393 394 395 396 397 398
      ],
      stopOpen: false,
      stopForm: {},
      stopRules: {
        fStopProgress: [
          { required: true, message: "停气进度不能为空", trigger: "change" }
        ],
      },
耿迪迪's avatar
耿迪迪 committed
399 400 401 402 403 404 405 406 407 408 409 410 411
    };
  },
  created() {
    this.getList();
    this.getDicts("t_stop_type").then(response => {
      this.fStopTypeOptions = response.data;
    });
    this.getDicts("t_stop_progress").then(response => {
      this.fStopProgressOptions = response.data;
    });
  },
  watch:{
    path(newVal,oldVal){
412
      console.log("index.watch.path = " + newVal);
413 414 415 416 417 418 419
      // 如果只允许画一个多边形,则用这个方法接收数据
      // if(newVal.length == 0){
      //   this.form.fGasStopArea = "";
      //   return
      // }
      // this.form.fGasStopArea = JSON.stringify(newVal);

耿迪迪's avatar
耿迪迪 committed
420 421 422
    }
  },
  methods: {
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
    // 需要画多个 多边形时 需要正确使用 emit 接收 drawArea 发回来的数据
    handleUpdatePathFromParent(data) {

      // 如果需要画多个则,需要这样接数据
      if(data.length === 0) {
        this.form.fGasStopArea = "";
        return
      }

      this.form.fGasStopArea = "";
      for(let i = 0;i < data.length;i ++) {
        let newValItem = data[i];
        if (newValItem._opts) {
          this.form.fGasStopArea += JSON.stringify(newValItem._opts.path) + "#";
        } else {
          this.form.fGasStopArea += JSON.stringify(newValItem) + "#";
        }
        console.log("this.form.fGasStopArea = " + this.form.fGasStopArea);
耿迪迪's avatar
耿迪迪 committed
441
      }
442
    },
耿迪迪's avatar
耿迪迪 committed
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 477 478 479 480 481 482 483 484 485 486 487
    /** 查询停气监管列表 */
    getList() {
      this.loading = true;
      listSup(this.queryParams).then(response => {
        this.supList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 停气类型字典翻译
    fStopTypeFormat(row, column) {
      return this.selectDictLabel(this.fStopTypeOptions, row.fStopType);
    },
    // 停气进度字典翻译
    fStopProgressFormat(row, column) {
      return this.selectDictLabel(this.fStopProgressOptions, row.fStopProgress);
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        fGasStopId: null,
        fCompanyInfoId: null,
        fStartDate: null,
        fEndDate: null,
        fStopType: null,
        fInfluenceCus: null,
        fStopReason: null,
        fStopRange: null,
        fStopProgress: null,
        fRecoveryGasTime: null,
        fRepStatus: "0",
        fGasStopArea: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isDel: null,
        remarks: null
      };
      this.resetForm("form");
耿迪迪's avatar
耿迪迪 committed
488
      this.path = [];
耿迪迪's avatar
耿迪迪 committed
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.fGasStopId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加停气监管";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const fGasStopId = row.fGasStopId || this.ids
      getSup(fGasStopId).then(response => {
        this.form = response.data;
耿迪迪's avatar
耿迪迪 committed
518
        if(this.form.fGasStopArea){
519 520 521 522
          console.log("this.from.fGasStopArea = " + this.form.fGasStopArea);
          let areasArr = [];
          if (this.form.fGasStopArea.includes("#")){
            let areas = this.form.fGasStopArea.split("#");
耿迪迪's avatar
耿迪迪 committed
523
            for (let i = 0; i < areas.length;i++) {
524
              console.log("i = " + i+  "item = " + areas[i]);
耿迪迪's avatar
耿迪迪 committed
525 526
              let areasItem = areas[i];
              if (areasItem != null && areasItem != "") {
527 528 529 530 531 532 533 534 535
                areasArr.push(JSON.parse(areasItem))
              }
            }
            this.path = areasArr;
            console.log("this.path = " + this.path);
          } else{
            areasArr.push( this.form.fGasStopArea);
            this.path = areasArr;
          }
耿迪迪's avatar
耿迪迪 committed
536 537 538 539 540 541
        }
        this.open = true;
        this.title = "修改停气监管";
      });
    },
    /** 提交按钮 */
耿迪迪's avatar
耿迪迪 committed
542 543
    submitForm() {
      /*if(1 == type){
耿迪迪's avatar
耿迪迪 committed
544
        this.form.fRepStatus = '1';
耿迪迪's avatar
耿迪迪 committed
545
      }*/
耿迪迪's avatar
耿迪迪 committed
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
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.fGasStopId != null) {
            updateSup(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSup(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const fGasStopIds = row.fGasStopId || this.ids;
      this.$confirm('是否确认删除停气监管编号为"' + fGasStopIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delSup(fGasStopIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有停气监管数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.exportLoading = true;
          return exportSup(queryParams);
        }).then(response => {
          this.download(response.msg);
          this.exportLoading = false;
        }).catch(() => {});
耿迪迪's avatar
耿迪迪 committed
592 593 594 595 596
    },
    //详情
    handleDetail(row){
      this.$refs.detail.getDetailInfo(row.fGasStopId);
    },
耿迪迪's avatar
耿迪迪 committed
597 598 599 600 601 602 603 604 605 606
    handleReport(row) {
      const that = this;
      this.$confirm('是否确认上报停气监管编号为"' + row.fGasStopId + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function() {
        if(-2 == that.$store.state.user.enterpriseId){
          return reportSupBalStopSupRecInfo({fGasStopId : row.fGasStopId});
        }
耿迪迪's avatar
耿迪迪 committed
607
        return updateSup({fGasStopId : row.fGasStopId,fRepStatus : '1',entRepTime: moment().format('YYYY-MM-DD HH:mm:ss')});
耿迪迪's avatar
耿迪迪 committed
608 609 610 611 612 613 614 615 616 617 618 619 620 621
      }).then(() => {
        this.getList();
        this.msgSuccess("上报成功");
      }).catch(() => {});
    },
    handleStop(row){
      getSup(row.fGasStopId).then(res => {
        if(res.code == 200 && res.data){
          this.stopForm = res.data;
          this.stopOpen = true;
        }
      })
    },
    submitStopForm(){
622
      changeStopStatus({fGasStopId:this.stopForm.fGasStopId,fStopProgress:this.stopForm.fStopProgress}).then(res =>{
耿迪迪's avatar
耿迪迪 committed
623 624 625 626 627 628 629
        if(res.code == 200){
          this.msgSuccess("停气进度更新成功");
          this.stopOpen = false;
          this.getList();
        }
      })
    }
耿迪迪's avatar
耿迪迪 committed
630 631 632
  }
};
</script>
耿迪迪's avatar
耿迪迪 committed
633 634 635 636 637
<style lang="scss">
  .area-change input{
    border: 1px solid #DCDFE6 !important;
  }
</style>