index.vue 21.7 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">
耿迪迪's avatar
耿迪迪 committed
100
          <span>{{ parseTime(scope.row.fStartDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</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">
耿迪迪's avatar
耿迪迪 committed
105
          <span>{{ parseTime(scope.row.fEndDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
耿迪迪's avatar
耿迪迪 committed
106 107 108 109 110 111 112 113 114 115 116
        </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">
          <span v-if="scope.row.fRecoveryGasTime">{{ parseTime(scope.row.fRecoveryGasTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
          <span v-else>-</span>
        </template>
      </el-table-column>
耿迪迪's avatar
耿迪迪 committed
117
      <el-table-column label="上报状态" align="center" prop="fRepStatus" v-if="-2 != $store.state.user.enterpriseId">
耿迪迪'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>
耿迪迪's avatar
耿迪迪 committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137
      <el-table-column label="上报状态" align="center" prop="fGovUploadStatus" v-if="-2 == $store.state.user.enterpriseId">
        <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>
      <el-table-column label="上报时间" align="center" prop="fRecoveryGasTime" width="150" v-if="-2 == $store.state.user.enterpriseId">
        <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>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
耿迪迪's avatar
耿迪迪 committed
138
        <template slot-scope="scope">
耿迪迪's avatar
耿迪迪 committed
139 140 141 142 143 144
          <el-button
            size="mini"
            type="text"
            icon="el-icon-document"
            @click="handleDetail(scope.row)"
          >详情</el-button>
耿迪迪's avatar
耿迪迪 committed
145 146 147 148
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
耿迪迪's avatar
耿迪迪 committed
149
            v-if="scope.row.fRepStatus == '0'"
耿迪迪's avatar
耿迪迪 committed
150 151 152 153 154 155
            @click="handleUpdate(scope.row)"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
耿迪迪's avatar
耿迪迪 committed
156
            v-if="scope.row.fRepStatus == '0'"
耿迪迪's avatar
耿迪迪 committed
157 158
            @click="handleDelete(scope.row)"
          >删除</el-button>
耿迪迪's avatar
耿迪迪 committed
159 160 161 162 163 164 165 166 167 168 169
          <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
170 171 172 173 174 175 176 177 178 179 180 181 182
        </template>
      </el-table-column>
    </el-table>

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

    <!-- 添加或修改停气监管对话框 -->
183
    <el-dialog :title="title" :visible.sync="open" v-if="open" width="1200px" append-to-body :close-on-click-modal="false">
耿迪迪's avatar
耿迪迪 committed
184
      <el-form label-position="top" ref="form" :model="form" :rules="rules" label-width="120px">
耿迪迪's avatar
耿迪迪 committed
185 186 187 188 189 190 191 192 193
        <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
194
                                  style="width: 98%"
耿迪迪's avatar
耿迪迪 committed
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
                                  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
214
                  <el-select v-model="form.fStopType" style="width: 98%" placeholder="请选择停气类型">
耿迪迪's avatar
耿迪迪 committed
215 216 217 218 219 220 221 222 223 224
                    <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
225
              <!--<el-col :span="12">
耿迪迪's avatar
耿迪迪 committed
226 227 228 229 230 231 232 233 234 235
                <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
236
              </el-col>-->
耿迪迪's avatar
耿迪迪 committed
237

耿迪迪's avatar
耿迪迪 committed
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
              <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
259
            <el-form-item label="停气区域" prop="fGasStopArea">
260
              <DrawArea class="area-change" v-model="path" @update-path="handleUpdatePathFromParent"/>
耿迪迪's avatar
耿迪迪 committed
261
            </el-form-item>
耿迪迪's avatar
耿迪迪 committed
262 263 264 265 266 267
          </el-col>
        </el-row>


      </el-form>
      <div slot="footer" class="dialog-footer">
耿迪迪's avatar
耿迪迪 committed
268
        <el-button type="primary" @click="submitForm()"> </el-button>
耿迪迪's avatar
耿迪迪 committed
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
        <!--<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>-->
293
        <el-button @click="stopOpen=false"> </el-button>
耿迪迪's avatar
耿迪迪 committed
294 295 296
      </div>
    </el-dialog>

耿迪迪's avatar
耿迪迪 committed
297 298 299
    <!-- 详情 -->
    <DetailInfo ref="detail"/>

耿迪迪's avatar
耿迪迪 committed
300 301 302 303
  </div>
</template>

<script>
304
import { listSup, getSup, delSup, addSup, updateSup, exportSup, reportSupBalStopSupRecInfo, changeStopStatus } from "@/api/supplybalance/stop";
305
// 如果只允许画一个,则用这个
306
// import DrawArea from "@/components/DrawArea";
307
// 如果需要画多个,则用这个
308
import DrawArea from "@/components/GasShutDownDrawArea"
耿迪迪's avatar
耿迪迪 committed
309
import DetailInfo from "./components/DetailInfo";
耿迪迪's avatar
耿迪迪 committed
310 311 312
export default {
  name: "Sup",
  components: {
耿迪迪's avatar
耿迪迪 committed
313 314
    DrawArea,
    DetailInfo
耿迪迪's avatar
耿迪迪 committed
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
  },
  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
350 351
        enterpriseName: null,
        fGovUploadStatus: null
耿迪迪's avatar
耿迪迪 committed
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
      },
      // 表单参数
      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
375 376
        fGasStopArea: [
          { required: true, message: "停气区域不能为空" }
耿迪迪's avatar
耿迪迪 committed
377 378 379 380 381 382 383
        ],
      },
      path:[
        [114.602763,38.071221],
        [114.762751,38.056354],
        [114.657695,38.020932],
        [114.655978,38.020121]
耿迪迪's avatar
耿迪迪 committed
384 385 386 387 388 389 390 391
      ],
      stopOpen: false,
      stopForm: {},
      stopRules: {
        fStopProgress: [
          { required: true, message: "停气进度不能为空", trigger: "change" }
        ],
      },
耿迪迪's avatar
耿迪迪 committed
392 393 394 395 396 397 398 399 400 401 402 403 404
    };
  },
  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){
405
      console.log("index.watch.path = " + newVal);
406 407 408 409 410 411 412
      // 如果只允许画一个多边形,则用这个方法接收数据
      // if(newVal.length == 0){
      //   this.form.fGasStopArea = "";
      //   return
      // }
      // this.form.fGasStopArea = JSON.stringify(newVal);

耿迪迪's avatar
耿迪迪 committed
413 414 415
    }
  },
  methods: {
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
    // 需要画多个 多边形时 需要正确使用 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
434
      }
435
    },
耿迪迪's avatar
耿迪迪 committed
436 437 438 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 477 478 479 480
    /** 查询停气监管列表 */
    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
481
      this.path = [];
耿迪迪's avatar
耿迪迪 committed
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510
    },
    /** 搜索按钮操作 */
    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
511
        if(this.form.fGasStopArea){
512 513 514 515
          console.log("this.from.fGasStopArea = " + this.form.fGasStopArea);
          let areasArr = [];
          if (this.form.fGasStopArea.includes("#")){
            let areas = this.form.fGasStopArea.split("#");
耿迪迪's avatar
耿迪迪 committed
516
            for (let i = 0; i < areas.length;i++) {
517
              console.log("i = " + i+  "item = " + areas[i]);
耿迪迪's avatar
耿迪迪 committed
518 519
              let areasItem = areas[i];
              if (areasItem != null && areasItem != "") {
520 521 522 523 524 525 526 527 528
                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
529 530 531 532 533 534
        }
        this.open = true;
        this.title = "修改停气监管";
      });
    },
    /** 提交按钮 */
耿迪迪's avatar
耿迪迪 committed
535 536
    submitForm() {
      /*if(1 == type){
耿迪迪's avatar
耿迪迪 committed
537
        this.form.fRepStatus = '1';
耿迪迪's avatar
耿迪迪 committed
538
      }*/
耿迪迪's avatar
耿迪迪 committed
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
      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
585 586 587 588 589
    },
    //详情
    handleDetail(row){
      this.$refs.detail.getDetailInfo(row.fGasStopId);
    },
耿迪迪's avatar
耿迪迪 committed
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
    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});
        }
        return updateSup({fGasStopId : row.fGasStopId,fRepStatus : '1'});
      }).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(){
615
      changeStopStatus({fGasStopId:this.stopForm.fGasStopId,fStopProgress:this.stopForm.fStopProgress}).then(res =>{
耿迪迪's avatar
耿迪迪 committed
616 617 618 619 620 621 622
        if(res.code == 200){
          this.msgSuccess("停气进度更新成功");
          this.stopOpen = false;
          this.getList();
        }
      })
    }
耿迪迪's avatar
耿迪迪 committed
623 624 625
  }
};
</script>
耿迪迪's avatar
耿迪迪 committed
626 627 628 629 630
<style lang="scss">
  .area-change input{
    border: 1px solid #DCDFE6 !important;
  }
</style>