index.vue 32.4 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3 4 5 6 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 33
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="130px">
      <el-form-item label="项目编码" prop="fProjectCode">
        <el-input
          v-model="queryParams.fProjectCode"
          placeholder="请输入项目编码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="施工工程项目名称" prop="fProjectName">
        <el-input
          v-model="queryParams.fProjectName"
          placeholder="请输入施工工程项目名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="管道压力等级分类" prop="fPipePress">
        <el-select v-model="queryParams.fPipePress" placeholder="请选择管道压力等级分类" clearable size="small">
          <el-option
            v-for="dict in fPipePressOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
34
      
35 36 37 38
      <el-form-item label="上报状态" prop="fUploadType">
        <el-select v-model="queryParams.fUploadType" placeholder="请选择上报状态" clearable size="small">
          <el-option label="未上报" value="0" />
          <el-option label="已上报" value="1" />
39 40 41
        </el-select>
      </el-form-item>

耿迪迪's avatar
耿迪迪 committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55
      <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"
          @click="handleAdd"
56
          v-if="user.roleId==5"
耿迪迪's avatar
耿迪迪 committed
57 58 59 60 61 62 63 64 65 66
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
67
          v-if="user.roleId==5"
耿迪迪's avatar
耿迪迪 committed
68 69 70 71 72 73 74 75 76 77
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
78
          v-if="user.roleId==5"
耿迪迪's avatar
耿迪迪 committed
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
        >删除</el-button>
      </el-col>
      <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>

94
    <el-table v-loading="loading" :data="inforList" @selection-change="handleSelectionChange"> 
耿迪迪's avatar
耿迪迪 committed
95 96 97 98 99
      <el-table-column label="项目编码" align="center" prop="fProjectCode" />
      <el-table-column label="外部工程编码" align="center" prop="fProjectNo" />
      <el-table-column label="施工工程项目名称" align="center" prop="fProjectName" />
      <el-table-column label="开工时间" align="center" prop="fConstructionStart" />
      <el-table-column label="计划竣工时间" align="center" prop="fConstructionEnd" />
wanghao's avatar
wanghao committed
100
      <el-table-column label="所属县级行政区" align="center" prop="fDistrictId" :formatter="beyondCountyFormat"/>
耿迪迪's avatar
耿迪迪 committed
101 102 103 104 105 106 107 108
      <el-table-column label="涉气施工点位位置属性" align="center" prop="fConstructionPointType" >
        <template slot-scope="scope">
          <span v-if="scope.row.fConstructionPointType == '1'">城镇</span>
          <span v-else-if="scope.row.fConstructionPointType == '2'">农村</span>
          <span v-else>-</span>
        </template>
      </el-table-column>
      <el-table-column label="管道压力等级分类" align="center" prop="fPipePress" :formatter="fPipePressFormat" />
109 110
      <el-table-column :label="uploadStateLabel" align="center" prop="uploadState" :formatter="uploadStateFormat" />
      <el-table-column :label="uploadTimeLabel" align="center" prop="uploadTime" :formatter="uploadTimeFormat" />
耿迪迪's avatar
耿迪迪 committed
111 112 113 114 115 116 117 118 119 120 121 122 123
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-document"
            @click="handleDetail(scope.row)"
          >详情</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
124
            v-if="user.roleId==5&&scope.row.entUploadState==0"
耿迪迪's avatar
耿迪迪 committed
125 126 127 128 129 130
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
131
            v-if="user.roleId==5&&scope.row.entUploadState==0"
耿迪迪's avatar
耿迪迪 committed
132 133 134 135 136
          >删除</el-button>
          <el-button
            size="mini"
            type="text"
            @click="handleReport(scope.row)"
137
            v-if="judgeUploadIsShow((scope.row))"
138
          >上报</el-button>
耿迪迪's avatar
耿迪迪 committed
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
        </template>
      </el-table-column>
    </el-table>

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

    <!-- 添加或修改涉气第三方施工项目档案对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="180px">
        <el-row class="el-row-table">
wanghao's avatar
wanghao committed
155
          <el-col :span="12">
156
            <el-form-item label="燃气企业" prop="fCompanyInfoId"> 
wanghao's avatar
wanghao committed
157 158 159
              <el-input v-model="enterpriseName" :disabled="true"></el-input>
            </el-form-item>
          </el-col>
耿迪迪's avatar
耿迪迪 committed
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
          <el-col :span="12">
            <el-form-item label="外部工程编码" prop="fProjectNo">
              <el-input v-model="form.fProjectNo" placeholder="请输入外部工程编码" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="施工工程项目名称" prop="fProjectName">
              <el-input v-model="form.fProjectName" placeholder="请输入施工工程项目名称" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="开工时间" prop="fConstructionStart">
              <el-date-picker
                style="width: 100%"
                v-model="form.fConstructionStart"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择开工时间">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="计划竣工时间" prop="fConstructionEnd">
              <el-date-picker
                style="width: 100%"
                v-model="form.fConstructionEnd"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择计划竣工时间">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="项目位置描述" prop="fAddress">
              <el-input v-model="form.fAddress" placeholder="请输入项目位置描述" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
wanghao's avatar
wanghao committed
203 204 205 206 207 208 209 210 211 212 213 214 215 216
            <el-form-item label="所属县级行政区" prop="fDistrictId">
              <el-select
                v-model="form.fDistrictId"
                placeholder="请选择县级行政区"
                style="width: 100%"
              >
                <el-option
                  v-for="county in countyInfo"
                  :key="county.fId"
                  :label="county.fName.trim()"
                  :value="county.fId"
                />
              </el-select>
              <!-- <el-input type="Number" v-model="form.fDistrictId" placeholder="请输入所属县级行政区" /> -->
耿迪迪's avatar
耿迪迪 committed
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="经纬度坐标" prop="fConstructionLongitude">
              <el-col :span="9">
                <el-input v-model="form.fConstructionLongitude" placeholder="请输入经度"/>
              </el-col>
              <el-col :span="9" style="margin-left: 13px">
                <el-input v-model="form.fConstructionLatitude" placeholder="请输入纬度"/>
              </el-col>
              <el-col :span="4" style="margin-left: 30px">
                <el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
              </el-col>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="涉气施工点位位置属性" prop="fConstructionPointType">
              <el-select style="width: 100%" v-model="form.fConstructionPointType" placeholder="请选择涉气施工点位位置属性">
                <el-option label="城镇" value="1" />
                <el-option label="农村" value="2" />
              </el-select>
            </el-form-item>
240
          </el-col> 
耿迪迪's avatar
耿迪迪 committed
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257

          <el-col :span="12">
            <el-form-item label="管道压力等级分类" prop="fPipePress">
              <el-select style="width: 100%" v-model="form.fPipePress" placeholder="请选择管道压力等级分类">
                <el-option
                  v-for="dict in fPipePressOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="施工是否主动报备" prop="fReportFlag">
              <el-select style="width: 100%" v-model="form.fReportFlag" placeholder="请选择施工是否主动报备">
258 259
                <el-option label="是" value=1 />
                <el-option label="否" value=0 />
耿迪迪's avatar
耿迪迪 committed
260 261 262 263 264 265 266
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="施工状态">
              <el-select style="width: 100%" v-model="form.fConstructionStatus" placeholder="请选择施工状态">
267 268 269
                <el-option label="未开工" value='1' />
                <el-option label="正在施工" value='2' />
                <el-option label="已完工" value='3' />
耿迪迪's avatar
耿迪迪 committed
270 271 272 273 274 275 276 277 278 279 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 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 481 482 483 484 485 486
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="建设单位名称" prop="fBuildDepartment">
              <el-input v-model="form.fBuildDepartment" placeholder="请输入建设单位名称" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="建设单位项目负责人姓名" prop="fProjectLeader">
              <el-input v-model="form.fProjectLeader" placeholder="请输入建设单位项目负责人姓名" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item :rules="[{
                pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                message: '手机号格式有误!',
                trigger: 'blur'
              }]"
              label="建设单位项目负责人电话"
              prop="fProjectLeaderPhone"
            >
              <el-input :maxlength="11" v-model="form.fProjectLeaderPhone" placeholder="请输入建设单位项目负责人电话" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="所属行业" prop="fIndustry">
              <el-input v-model="form.fIndustry" placeholder="请输入所属行业" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="行业安全监管部门名称" prop="fDepartmentName">
              <el-input v-model="form.fDepartmentName" placeholder="请输入行业安全监管部门名称" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="施工单位名称" prop="fConstructDepartment">
              <el-input v-model="form.fConstructDepartment" placeholder="请输入施工单位名称" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="施工单位项目负责人姓名" prop="fBuildProjectLeaderName">
              <el-input v-model="form.fBuildProjectLeaderName" placeholder="请输入施工单位项目负责人姓名" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item
              :rules="[{
                pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                message: '手机号格式有误!',
                trigger: 'blur'
              }]"
              label="施工单位项目负责人电话"
              prop="fBuildProjectLeaderPhone"
            >
              <el-input :maxlength="11" v-model="form.fBuildProjectLeaderPhone" placeholder="请输入施工单位项目负责人电话" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="施工单位技术负责人姓名" prop="fTechnicalLeaderName">
              <el-input v-model="form.fTechnicalLeaderName" placeholder="请输入施工单位技术负责人姓名" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item
              :rules="[{
                pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                message: '手机号格式有误!',
                trigger: 'blur'
              }]"
              label="施工单位技术负责人电话"
              prop="fTechnicalLeaderPhone"
            >
              <el-input :maxlength="11" v-model="form.fTechnicalLeaderPhone" placeholder="请输入施工单位技术负责人电话" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="监理单位名称" prop="fSupervisionUnitName">
              <el-input v-model="form.fSupervisionUnitName" placeholder="请输入监理单位名称" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="监理单位总监理工程师姓名" prop="fChiefEngineerName">
              <el-input v-model="form.fChiefEngineerName" placeholder="请输入监理单位总监理工程师姓名" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item
              :rules="[{
                pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                message: '手机号格式有误!',
                trigger: 'blur'
              }]"
              label="监理单位总监理工程师电话"
              prop="fChiefEngineerPhone"
            >
              <el-input :maxlength="11" v-model="form.fChiefEngineerPhone" placeholder="请输入监理单位总监理工程师电话" />
            </el-form-item>
          </el-col>


          <el-col :span="12">
            <el-form-item label="施工点位巡线员编码" prop="fPatrolSafetyOfficerNo">
              <el-input v-model="form.fPatrolSafetyOfficerNo" placeholder="请输入施工点位巡线员编码" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="施工点位巡线员姓名" prop="fPartrolSafetyOfficerName">
              <el-input v-model="form.fPartrolSafetyOfficerName" placeholder="请输入施工点位巡线员姓名" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item
              :rules="[{
                pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                message: '手机号格式有误!',
                trigger: 'blur'
              }]"
              label="施工点位巡线员电话"
              prop="fPatrolSafetyOfficerPhone"
            >
              <el-input :maxlength="11" v-model="form.fPatrolSafetyOfficerPhone" placeholder="请输入施工点位巡线员电话" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="驻村安全员编码" prop="fResidentSafetyOfficerNo">
              <el-input v-model="form.fResidentSafetyOfficerNo" placeholder="请输入驻村安全员编码" />
            </el-form-item>
          </el-col>


          <el-col :span="12">
            <el-form-item label="驻村安全员姓名" prop="fResidentSafetyOfficerName">
              <el-input v-model="form.fResidentSafetyOfficerName" placeholder="请输入驻村安全员姓名" />
            </el-form-item>
          </el-col>


          <el-col :span="12">
            <el-form-item
              :rules="[{
                pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                message: '手机号格式有误!',
                trigger: 'blur'
              }]"
              label="驻村安全员电话"
              prop="fResidentSafetyOfficerPhone"
            >
              <el-input :maxlength="11" v-model="form.fResidentSafetyOfficerPhone" placeholder="请输入驻村安全员电话" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="燃气企业旁站人员编码" prop="fGasCompanyStationNo">
              <el-input v-model="form.fGasCompanyStationNo" placeholder="请输入燃气企业旁站人员编码" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="燃气企业旁站人员姓名" prop="fGasCompanyStationName">
              <el-input v-model="form.fGasCompanyStationName" placeholder="请输入燃气企业旁站人员姓名" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item
              :rules="[{
                pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                message: '手机号格式有误!',
                trigger: 'blur'
              }]"
              label="燃气企业旁站人员电话"
              prop="fGasCompanyStationPhone"
            >
              <el-input :maxlength="11" v-model="form.fGasCompanyStationPhone" placeholder="请输入燃气企业旁站人员电话" />
            </el-form-item>
          </el-col>
        </el-row>

      </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>

    <GetPos
      :dialogVisible.sync="dialogTableVisibles"
      device=""
      :devicePos="devicePos"
      @close="dialogcancelFun"
      @getPath="getPath"
    />

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

  </div>
</template>

<script>
487
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportConGasProInfo,entReportConGasProInfo } from "@/api/thirdbuild/project";
耿迪迪's avatar
耿迪迪 committed
488
import GetPos from '@/components/GetPos';
489
import{getInfo} from "@/api/login"
耿迪迪's avatar
耿迪迪 committed
490
import DetailInfo from "./components/DetailInfo";
wanghao's avatar
wanghao committed
491 492
import { enterpriseLists } from "@/api/regulation/info";
import { getDefaultCountyList } from "@/api/area/county";
耿迪迪's avatar
耿迪迪 committed
493 494 495 496 497 498 499 500
export default {
  name: "Infor",
  components: {
    GetPos,
    DetailInfo
  },
  data() {
    return {
501 502
      uploadStateLabel:"",
      uploadTimeLabel:"",
wanghao's avatar
wanghao committed
503
      enterpriseName:"",
504
      enterprises: [],
505
      user:{},
wanghao's avatar
wanghao committed
506
      countyInfo: [],
耿迪迪's avatar
耿迪迪 committed
507 508 509 510 511 512 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
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      fProjectNames: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 涉气第三方施工项目档案表格数据
      inforList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 管道压力等级分类
      fPipePressOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        fProjectCode: null,
        fProjectNo: null,
        fProjectName: null,
        fPipePress: null,
538
        fCompanyInfoId: null,
539
        fUploadType:null,
耿迪迪's avatar
耿迪迪 committed
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        fProjectCode: [
          { required: true, message: "项目编码,6位县级行政区划编码+4位年+4位顺序码不能为空", trigger: "blur" }
        ],
        fProjectNo: [
          { required: true, message: "外部工程编码,工程项目在市级平台或燃气企业系统中的自有编号不能为空", trigger: "blur" }
        ],
        fProjectName: [
          { required: true, message: "施工工程项目名称不能为空", trigger: "blur" }
        ],
        fConstructionStart: [
          { required: true, message: "开工时间不能为空", trigger: "blur" }
        ],
        fConstructionEnd: [
          { required: true, message: "计划竣工时间不能为空", trigger: "blur" }
        ],
        fAddress: [
          { required: true, message: "项目位置描述不能为空", trigger: "blur" }
        ],
        fDistrictId: [
wanghao's avatar
wanghao committed
564
          { required: true, message: "所属县级行政区不能为空", trigger: "blur" }
耿迪迪's avatar
耿迪迪 committed
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
        ],
        fPipePress: [
          { required: true, message: "管道压力等级分类", trigger: "change" }
        ],
        fBuildDepartment: [
          { required: true, message: "建设单位名称不能为空", trigger: "blur" }
        ],
        fIndustry: [
          { required: true, message: "所属行业不能为空", trigger: "blur" }
        ],
        fConstructDepartment: [
          { required: true, message: "施工单位名称不能为空", trigger: "blur" }
        ],
        fCompanyInfoId: [
          { required: true, message: "燃气企业编码不能为空", trigger: "blur" }
        ],
      },
      dialogTableVisibles: false,
      devicePos: []
    };
  },
  created() {
587
    this.getuserInfo();
wanghao's avatar
wanghao committed
588 589
    this.getCountyInfo();
    this.getEnterpriseLists();
耿迪迪's avatar
耿迪迪 committed
590 591 592 593 594
    this.getDicts("t_pipe_press").then(response => {
      this.fPipePressOptions = response.data;
    });
  },
  methods: {
wanghao's avatar
wanghao committed
595 596 597 598
    //所属单位
    getEnterpriseLists(){
      const param = {}; 
        enterpriseLists(param).then(response => {
599 600
          if (response.rows.length>1){ 
            this.enterprises = response.rows;
601
            this.enterpriseName = response.rows[0].enterpriseName; 
602
        }else { 
wanghao's avatar
wanghao committed
603
          this.enterprises = response.rows;
604
          this.enterpriseName = response.rows[0].enterpriseName; 
wanghao's avatar
wanghao committed
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619
        }
      }); 
    },
    //获取县级
    getCountyInfo(){
      getDefaultCountyList().then(res =>{
        if(res.code == 200 && res.data){
        this.countyInfo =  res.data;
      }
    })
    },
    beyondCountyFormat(row){
      let info = this.countyInfo.find(item => item.fId == row.fDistrictId);
      return info?info.fName:"-";
    },
耿迪迪's avatar
耿迪迪 committed
620 621
    /** 查询涉气第三方施工项目档案列表 */
    getList() {
622 623 624 625
      this.loading = true; 
      // 企业查自己的数据
      if (this.user.roleId == 5) {
        this.queryParams.fCompanyInfoId = this.$store.state.user.enterpriseId 
626
        this.queryParams.entUploadState = this.queryParams.fUploadType;
627
      }
628 629 630 631
      // 政府如果按照状态查的话,是查的 govUploadState
      if (this.user.roleId == 3) {
        this.queryParams.govUploadState = this.queryParams.fUploadType;
      } 
耿迪迪's avatar
耿迪迪 committed
632 633 634 635 636 637 638 639 640 641
      listInfor(this.queryParams).then(response => {
        this.inforList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 管道压力等级分类
    fPipePressFormat(row, column) {
      return this.selectDictLabel(this.fPipePressOptions, row.fPipePress);
    },
642
    //上报状态动态展示
643 644 645 646
    uploadStateFormat(row, column) { 
      //角色 1 超级管理员  5 企业
      let roleId = this.user.roleId;
      if (roleId == 5) {
647
        this.uploadStateLabel = "上报状态"
648
        if (row.entUploadState == '0') {
649
          return "未上报"
650
        } else{
651
          return "已上报"
652 653
        } 
      } else { 
654
        this.uploadStateLabel = "上报省厅状态"
655
        if (row.govUploadState == '0') {
656
          return "未上报"
657
        } else{
658
          return "已上报"
659 660 661
        } 
      } 
    },
662
    //上报时间动态展示
663 664 665 666
    uploadTimeFormat(row, column) {
      //角色 1 超级管理员  5 企业
      let roleId = this.user.roleId;
      if (roleId == 5) {
667
        this.uploadTimeLabel = "上报时间"
668 669
        return row.entUploadTime;
      } else {
670
        this.uploadTimeLabel = "上报省厅时间"
671 672 673 674
        return row.govUploadTime;
      }

    },
耿迪迪's avatar
耿迪迪 committed
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        fConGasProInforId: null,
        fProjectCode: null,
        fProjectNo: null,
        fProjectName: null,
        fConstructionStart: null,
        fConstructionEnd: null,
        fAddress: null,
        fDistrictId: null,
        fConstructionLongitude: null,
        fConstructionLatitude: null,
        fConstructionPointType: null,
        fVillageId: null,
        fPipePress: null,
        fReportFlag: null,
        fConstructionStatus: null,
        fBuildDepartment: null,
        fProjectLeader: null,
        fProjectLeaderPhone: null,
        fIndustry: null,
        fDepartmentName: null,
        fConstructDepartment: null,
        fBuildProjectLeaderName: null,
        fBuildProjectLeaderPhone: null,
        fTechnicalLeaderName: null,
        fTechnicalLeaderPhone: null,
        fSupervisionUnitName: null,
        fChiefEngineerName: null,
        fChiefEngineerPhone: null,
        fCompanyInfoId: null,
        fPatrolSafetyOfficerNo: null,
        fPartrolSafetyOfficerName: null,
        fPatrolSafetyOfficerPhone: null,
        fResidentSafetyOfficerNo: null,
        fResidentSafetyOfficerName: null,
        fResidentSafetyOfficerPhone: null,
        fGasCompanyStationNo: null,
        fGasCompanyStationName: null,
        fGasCompanyStationPhone: null,
        fRemark: null,
        fUpdateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.fConGasProInforId);
      this.fProjectNames = selection.map(item => item.fProjectName);
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加涉气第三方施工项目档案";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const fConGasProInforId = row.fConGasProInforId || this.ids
      getInfor(fConGasProInforId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改涉气第三方施工项目档案";
      });
    },
759
    //判断 上报是否需要显示,上报分为企业上报 和 政府端上报
760
    judgeUploadIsShow(row) { 
761 762 763 764

      //角色 1 超级管理员  5 企业
      let roleId = this.user.roleId;

765
      // 企业端 上报状态 0-未上报,1-已上报
766 767
      let entUploadState = row.entUploadState;

768
      // 政府端 上报状态 0-未上报,1-已上报
769 770
      let govUploadState = row.govUploadState;

771
      // 如果政府端都已经上报,那就不能显示了。
772 773 774 775
      if(govUploadState === '1') {
        return false;
      }

776
      // 如果企业端上报了,则企业端就不能显示了,政府端和 超级管理员能显示
777
      if(entUploadState === '1' && govUploadState === '0') {
778
        if (roleId === 5) {
779 780 781 782 783 784 785 786 787 788 789 790 791
          return false;
        } else {
          return true;
        }
      }

      // 别的情况,都显示
      return true;

    },
    getuserInfo(){
      getInfo().then(response => {
        this.user = response.user.roles[0]
792
        this.getList();
793 794
      });
    },
耿迪迪's avatar
耿迪迪 committed
795 796
    /** 提交按钮 */
    submitForm() {
797
      this.form.fCompanyInfoId=this.enterprises[0].enterpriseId;
耿迪迪's avatar
耿迪迪 committed
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
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.fConGasProInforId != null) {
            updateInfor(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInfor(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const fConGasProInforIds = row.fConGasProInforId || this.ids;
      const fProjectNames = row.fProjectName || this.fProjectNames;
      this.$confirm('是否确认删除涉气第三方施工项目档案名称为"' + fProjectNames + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delInfor(fConGasProInforIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有涉气第三方施工项目档案数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.exportLoading = true;
840 841 842 843 844 845 846 847 848 849
          
          // 企业查自己的数据
          if (this.user.roleId == 5) {
            this.queryParams.fCompanyInfoId = this.$store.state.user.enterpriseId 
            this.queryParams.entUploadState = this.queryParams.fUploadType;
          }
          // 政府如果按照状态查的话,是查的 govUploadState
          if (this.user.roleId == 3) {
            this.queryParams.govUploadState = this.queryParams.fUploadType;
          } 
耿迪迪's avatar
耿迪迪 committed
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880
          return exportInfor(queryParams);
        }).then(response => {
          this.download(response.msg);
          this.exportLoading = false;
        }).catch(() => {});
    },
    /**
     * 经纬度坐标方法
     */
    MapdialogFun() {
      this.dialogTableVisibles = true;
    },
    /**
     * 经纬度 选择
     * @param res
     */
    getPath(res){
      //确认选择经纬度
      this.form.fConstructionLongitude = res[0];
      this.form.fConstructionLatitude = res[1];
    },
    /**
     * 地图关闭方法
     */
    dialogcancelFun() {
      this.dialogTableVisibles = false;
    },
    //详情
    handleDetail(row){
      this.$refs.detail.getDetailInfo(row.fConGasProInforId);
    },
881
    /** 上报按钮操作 */
耿迪迪's avatar
耿迪迪 committed
882
    handleReport(row) {
883

884
      // 如果是 超级管理员 或这企业,并且 企业端上报状态为0
885
      if ((this.user.roleId == 5 || this.user.roleId == 1) && row.entUploadState == '0') {
886
        this.$confirm('是否确认上报涉气第三方施工项目档案名称为"' + row.fProjectName + '"的数据项?', "警告", {
887 888 889 890 891 892 893
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
            return entReportConGasProInfo({fConGasProInforId : row.fConGasProInforId});
        }).then(() => {
          this.getList();
894
          this.msgSuccess("上报成功");
895
        }).catch(() => {});
896 897
      } 
    
898
      // 如果是 超级管理员 或这政府,并且 政府端上报状态为0
899
      if ((this.user.roleId == 3 || this.user.roleId == 1) && row.govUploadState == '0') {
900
        this.$confirm('是否确认上报涉气第三方施工项目档案名称为"' + row.fProjectName + '"的数据项?', "警告", {
耿迪迪's avatar
耿迪迪 committed
901 902 903 904 905 906 907
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return reportConGasProInfo({fConGasProInforId : row.fConGasProInforId});
        }).then(() => {
          this.getList();
908
          this.msgSuccess("上报成功");
909 910
        }).catch(() => {});
      }
耿迪迪's avatar
耿迪迪 committed
911 912 913 914
    },
  }
};
</script>