<template>
  <div class="ProjectTable">
    <el-table
      ref="multipleTable"
      :data="tableData"
      style="width: 100%"
      tooltip-effect="dark"
      @selection-change="handleSelectionChangePro"
      class="PJTable"
      :row-class-name="tableRowClassName"
    >
      <el-table-column type="selection"></el-table-column>
      <!-- <el-table-column >
        <template slot-scope="props">
          <el-form label-position="left" inline class="demo-table-expand">
            <el-form-item label="市">
              <span>{{ props.row.City }}</span>
            </el-form-item>
            <el-form-item label="区">
              <span>{{ props.row.District }}</span>
            </el-form-item>
            <el-form-item label="区域">
              <span>{{ props.row.RegionName }}</span>
            </el-form-item>
            <el-form-item label="项目地址">
              <span>{{ props.row.Address }}</span>
            </el-form-item>
            <el-form-item label="区域主管">
              <span>{{ props.row.UserName }}</span>
            </el-form-item>
            <el-form-item label="项目编号">
              <span>{{ props.row.Code }}</span>
            </el-form-item>
          </el-form>
        </template>
      </el-table-column>-->
      <!-- <el-table-column type="selection" width="55"></el-table-column> -->
      <el-table-column prop="projectCode" label="项目编号" min-width="50px;"></el-table-column>
      <el-table-column prop="projectName" label="项目名称" min-width="50px;"></el-table-column>
      <el-table-column prop="province" label="省" min-width="50px;"></el-table-column>
      <el-table-column prop="city" label="市" min-width="50px;"></el-table-column>
      <el-table-column prop="district" label="区" min-width="50px;"></el-table-column>
      <el-table-column prop="RegionName" label="区域" min-width="50px;"></el-table-column>
      <el-table-column prop="num" label="台量" min-width="50px;" sortable></el-table-column>
      <el-table-column
        prop="actualNum"
        label="系统台量"
        min-width="50px;"
        sortable
        show-overflow-tooltip
      ></el-table-column>
      <el-table-column prop="RegionWorkerName" label="区域主管" min-width="50px;"></el-table-column>
      <el-table-column prop="PPCompanyName" label="甲方名称" min-width="50px;"></el-table-column>
      <el-table-column prop="address" label="项目地址" min-width="100px;"></el-table-column>
      <el-table-column prop="startDate" label="开始时间" min-width="50px;"></el-table-column>
      <el-table-column prop="endDate" label="结束时间" min-width="50px;"></el-table-column>
      <el-table-column label="操作" min-width="200px;" fixed="right">
        <template slot-scope="props">
          <el-button
            size="mini"
            type="primary"
            plain
            round
            class
            style="margin-left: 5px;"
            @click="handleClick(props.row)"
            v-if="props.row.Status!=3"
          >维保工</el-button>

          <el-button size="mini" type="primary" plain round @click="showLiftList(props.row)">电梯信息</el-button>

          <el-button
            size="mini"
            type="primary"
            plain
            class
            round
            @click="handleClick(props.row)"
            style="margin-left:5px"
            v-if="props.row.Status!=3"
          >计划打印</el-button>

          <el-dropdown trigger="hover" slot="label" @command="handleCommand">
            <el-button class="el-dropdown-link" type="primary" plain round>
              更多
              <i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item
                v-if="props.row.Status!=3&&props.row.IsLocked==0"
                :command="composeValue('Update',props.row)"
              >编辑</el-dropdown-item>

              <el-dropdown-item
                v-if="props.row.Status!=2&&props.row.Status!=4"
                :command="composeValue('Delete',props.row)"
              >删除</el-dropdown-item>

              <!-- <el-dropdown-item :command="composeValue('UpdateIn',props.row)">修改间隔</el-dropdown-item> -->
              <el-dropdown-item
                v-if="props.row.Status==3"
                :command="composeValue('Re',props.row)"
              >恢复服务</el-dropdown-item>
              <el-dropdown-item
                v-if="props.row.IsLocked == 0&&props.row.Status!=3&&props.row.Status!=1"
                :command="composeValue('Stop',props.row)"
              >停止服务</el-dropdown-item>
              <el-dropdown-item
                v-if="props.row.Status==4"
                :command="composeValue('Start',props.row)"
              >继续服务</el-dropdown-item>
              <el-dropdown-item
                v-if="props.row.Status!=3&&props.row.IsLocked == 0"
                :command="composeValue('Lock',props.row)"
              >锁定</el-dropdown-item>
              <el-dropdown-item
                v-if="props.row.Status!=3&&props.row.IsLocked == 1"
                :command="composeValue('unLock',props.row)"
              >解锁</el-dropdown-item>
              <el-dropdown-item :command="composeValue('Hestory',props.row)">操作记录</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>
    <div class="pagenation">
      <span>
        <el-pagination
          background
          layout="prev, pager, next, sizes, total, jumper"
          :total="ProjectTotal"
          @current-change="click"
          @size-change="handleSizeChange"
          :page-sizes="[5, 10, 15, 20]"
          :page-size="pagesize"
        ></el-pagination>
      </span>
    </div>
    <!-- 穿梭模态框 -->
    <div>
      <el-dialog
        title="相关维保工"
        :visible.sync="dialogVisible"
        width="40%"
        :before-close="handleClose"
      >
        <div style="text-align: center">
          <el-transfer
            style="text-align: left; display: inline-block"
            v-model="value"
            filterable
            :left-default-checked="[2, 3]"
            :right-default-checked="[1]"
            :render-content="renderFunc"
            :titles="['维保工', '维保班长']"
            :format="{
              noChecked: '${total}',
              hasChecked: '${checked}/${total}'
            }"
            @change="handleChange"
            :data="data"
          >
            <el-button class="transfer-footer" slot="left-footer" size="small">操作</el-button>
            <el-button class="transfer-footer" slot="right-footer" size="small">操作</el-button>
          </el-transfer>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        </span>
      </el-dialog>
    </div>
    <!-- motal -->
    <!-- 新增/编辑项目模态框 -->
    <div>
      <el-dialog
        title="添加项目"
        :visible.sync="projectFormDialog"
        width="80%"
        :before-close="handleClose"
        class="addProject"
      >
        <el-dialog
          width="30%"
          title="添加甲方"
          :visible.sync="projectForm.addPpcDialog"
          append-to-body
          top="10%"
        >
          <el-form :inline="true" label-position="left">
            <el-form-item label="输入甲方名称" xs="24" :sm="24" :md="24" :lg="24">
              <el-input placeholder="输入甲方名称" v-model="projectForm.ppc_name"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="projectForm.addPpcDialog = false">取 消</el-button>
            <el-button type="primary">确 定</el-button>
          </div>
        </el-dialog>

        <el-dialog
          width="30%"
          title="添加甲方联系人"
          :visible.sync="projectForm.addPpmDialog"
          append-to-body
          top="10%"
        >
          <el-form :inline="true" label-position="left">
            <el-row>
              <el-form-item label="输入甲方联系人名称" xs="24" :sm="24" :md="24" :lg="24">
                <el-input placeholder="输入甲方联系人名称" v-model="projectForm.ppm_name"></el-input>
              </el-form-item>
            </el-row>

            <el-row>
              <el-form-item label="输入甲方联系人电话" xs="24" :sm="24" :md="24" :lg="24">
                <el-input placeholder="输入甲方联系人电话" v-model="projectForm.ppm_tel"></el-input>
              </el-form-item>
            </el-row>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="projectForm.addPpmDialog = false">取 消</el-button>
            <el-button type="primary">确 定</el-button>
          </div>
        </el-dialog>

        <el-form
          :model="projectForm"
          :inline="true"
          label-position="right"
          :rules="projectFormRule"
          ref="projectForm"
        >

          <el-row justify="space-around">
            <el-form-item label="项目名称" prop="name" :xs="8" :sm="8" :md="8" :lg="8">
              <el-input v-model="projectForm.name"></el-input>
            </el-form-item>
            <!-- <el-col :xs="6" :sm="6" :md="6" :lg="6">
              <el-row>
                <el-col :sm="10" :md="10" :lg="10" class="selectUp">
                  <span>项目名称<i class="FontRed">﹡</i></span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12">
                  <el-input v-model="projectForm.name"></el-input>
                </el-col>
              </el-row>
            </el-col>-->

            <el-form-item label="项目地址" prop="address" :xs="8" :sm="8" :md="8" :lg="8">
              <el-input v-model="projectForm.address"></el-input>
            </el-form-item>

            <!-- <el-col :xs="6" :sm="6" :md="6" :lg="6">
              <el-row>
                <el-col :sm="10" :md="10" :lg="10" class="selectUp">
                  <span>项目地址<i class="FontRed">﹡</i></span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12">
                  <el-input v-model="projectForm.address"></el-input>
                </el-col>
              </el-row>
            </el-col>-->
          </el-row>
          <el-row justify="space-around">
            <el-form-item label="开始时间" prop="StartDate" :xs="8" :sm="8" :md="8" :lg="8">
              <el-date-picker
                type="date"
                placeholder="选择项目开始时间时间"
                v-model="projectForm.StartDate"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>

            <el-form-item label="结束时间" prop="EndDate" :xs="8" :sm="8" :md="8" :lg="8">
              <el-date-picker
                type="date"
                placeholder="选择项目结束时间"
                v-model="projectForm.EndDate"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" >
            

            <el-form-item label="区域名称" prop="Region" :xs="8" :sm="8" :md="8" :lg="8">
              <el-select v-model="projectForm.Region" filterable placeholder="选择区域">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="区" prop="District" :xs="8" :sm="8" :md="8" :lg="8">
              <el-select v-model="projectForm.District" filterable placeholder="选择区">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>

            

            

            
          </el-row>

          
          <el-row justify="space-around" >
            <el-form-item label="项目用途" prop="usage">
              <el-select placeholder="请选择" v-model="projectForm.usage" class="siteel-select">
                <el-option
                  v-for="item in Usageoptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>

            <!-- <el-col :xs="6" :sm="6" :md="6" :lg="6">
              <el-row>
                <el-col :sm="10" :md="10" :lg="10" class="selectUp">
                  <span>项目用途<i class="FontRed">﹡</i></span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12">
                  <el-select placeholder="请选择" v-model="projectForm.usage" class="siteel-select">
                    <el-option
                      v-for="item in Usageoptions"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-col>
              </el-row>
            </el-col>-->

            <el-form-item label="项目台量" prop="num">
              <el-input type="number" v-model="projectForm.num"></el-input>
            </el-form-item>

            <!-- <el-col :xs="6" :sm="6" :md="6" :lg="6">
              <el-row>
                <el-col :sm="10" :md="10" :lg="10" class="selectUp">
                  <span>项目台量<i class="FontRed">﹡</i></span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12">
                  <el-input v-model="projectForm.num"></el-input>
                </el-col>
              </el-row>
            </el-col>-->
          </el-row>

          <el-row justify="space-around">
            <el-col :xs="10" :sm="10" :md="10" :lg="10">
              <el-row>
                <el-form-item label="甲方名称" prop="ppc_id" class="ProjectWidth60" style="width: 70%;">
                  <el-select placeholder="选择甲方" v-model="projectForm.ppc_id" class="siteel-select">
                    <el-option
                      v-for="item in ppcOptions"
                      :key="item.MTCompanyID"
                      :label="item.Name"
                      :value="item.MTCompanyID"
                    ></el-option>
                  </el-select>
                </el-form-item>

                <!-- <el-col :sm="6" :md="6" :lg="6" class="selectUp">
                  <span>甲方名称<i class="FontRed">﹡</i></span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12">
                  <el-select placeholder="选择甲方" v-model="projectForm.ppc_id" class="siteel-select">
                    <el-option
                      v-for="item in ppcOptions"
                      :key="item.MTCompanyID"
                      :label="item.Name"
                      :value="item.MTCompanyID"
                    ></el-option>
                  </el-select>
                </el-col>-->

                <el-button type="primary" plain @click="projectForm.addPpcDialog = true">添加甲方</el-button>
              </el-row>
            </el-col>

            <el-col :xs="12" :sm="12" :md="12" :lg="12">
              <el-row>
                <el-form-item
                  label="甲方联系人"
                  prop="ppm_id"
                  class="ProjectWidth60"
                  style="width: 65%;"
                >
                  <el-select
                    placeholder="选择甲方联系人"
                    v-model="projectForm.ppm_id"
                    class="siteel-select"
                  >
                    <el-option
                      v-for="item in ppmOptions"
                      :key="item.CreatorID"
                      :label='item.Name+"("+item.Telephone+")"'
                      :value="item.CreatorID"
                    ></el-option>
                  </el-select>
                </el-form-item>

                <!-- <el-col :sm="6" :md="6" :lg="6" class="selectUp">
                  <span>甲方联系人<i class="FontRed">﹡</i></span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12">
                  <el-select
                    placeholder="选择甲方联系人"
                    v-model="projectForm.ppm_id"
                    class="siteel-select"
                  >
                    <el-option
                      v-for="item in ppmOptions"
                      :key="item.CreatorID"
                      :label='item.Name+"("+item.Telephone+")"'
                      :value="item.CreatorID"
                    ></el-option>
                  </el-select>
                </el-col>-->

                <el-button type="primary" plain @click="projectForm.addPpmDialog = true">添加甲方联系人</el-button>
              </el-row>
            </el-col>
          </el-row>

          <el-row justify="space-around">
            <el-form-item label="急修是否推送物管评价录入完成后进行保存：">
              <el-radio-group v-model="projectForm.IsSave">
                <el-radio label="是"></el-radio>
                <el-radio label="否"></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-row>

          <el-row justify="space-around">
            <el-col :xs="6" :sm="6" :md="6" :lg="6">
              <el-row>
                <el-col :sm="10" :md="10" :lg="10" class="selectUp">
                  <span>区域主管：</span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12" class="selectUp">
                  <span>{{projectForm.RegionWorkerName}}</span>
                </el-col>
              </el-row>
            </el-col>

            <el-col :xs="6" :sm="6" :md="6" :lg="6">
              <el-row>
                <el-col :sm="10" :md="10" :lg="10" class="selectUp">
                  <span>文员：</span>
                </el-col>
                <el-col :sm="12" :md="12" :lg="12" class="selectUp">
                  <span>{{projectForm.ClerkName}}</span>
                </el-col>
              </el-row>
            </el-col>

            <!-- <el-form-item label="维保班长﹡" :xs="8" :sm="8" :md="8" :lg="8"  style="margin-left:80px;" >

                  <el-select placeholder="请选择维保班长">
                    <el-option label="区域一" ></el-option>
                    <el-option label="区域二" ></el-option>
                  </el-select>
            </el-form-item>-->
          </el-row>

          <!-- <el-row justify="space-around"  style="margin-left:30px;">
              <el-form-item :xs="8" :sm="8" :md="8" :lg="8" >维保工  
                <div  style="display:inline-block;" ><span>未设置</span>/<span>已设置</span></div><el-button type="primary" size="small"   @click="projectForm.relatedMaintenanceWorkers = true"    >设置维保工</el-button>
              </el-form-item>
          </el-row>-->
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="projectFormDialog = false">取 消</el-button>
          <el-button type="primary" @click="submitPro('projectForm')">确 定</el-button>
        </div>
      </el-dialog>
    </div>
    <!--修改电梯维保间隔-->
    <!-- <div class="UpdateInterval">
      <el-dialog
        title="修改维保间隔"
        :visible.sync="dialogInterval"
        width="30%"
        :before-close="handleClose"
      >
        <div>
          <p class="TXc">
            <i class="el-icon-warning"></i>提示
          </p>
          <p class="mb20 mt10">
            维保计划间隔
            <span style="color:red">默认为15天</span>，修改间隔会重新生成相应电梯的维保计划。请谨慎操作。
          </p>
          <el-select v-model="PlanInterval" multiple>
            <el-option
              v-for="item in PlanIntervalss"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogInterval = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>-->

    <!--停止服务-->
    <div class="StopProject">
      <el-dialog
        title="停止服务"
        :visible.sync="dialogStopProject"
        width="30%"
        :before-close="handleClose"
      >
        <div>
          <p class="TXc">
            <i class="el-icon-warning"></i>提示
          </p>
          <p class="mb20 mt10">
            选择停止服务后，项目状态将显示为，
            <span style="color:red">停止服务</span>，本项目相关的电梯也将全部停保，不再生成维保计划。
          </p>
          <el-form :model="StopProject" :inline="true" label-position="left">
            <el-row>
              <el-form-item label="停止服务描述：" :xs="24" :sm="24" :md="24" :lg="24">
                <el-input placeholder="请输入描述" v-model="StopProject.remarks"></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="停止服务时间：" :xs="24" :sm="24" :md="24" :lg="24">
                <el-date-picker
                  type="date"
                  placeholder="选择停止服务时间"
                  v-model="StopProject.endDate"
                  value-format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogStopProject = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--恢复服务-->
    <div class="ReProject">
      <el-dialog
        title="恢复服务"
        :visible.sync="dialogReProject"
        width="30%"
        :before-close="handleClose"
      >
        <div>
          <el-form :model="ReProject" :inline="true" label-position="left">
            <el-row>
              <el-form-item label="新开始时间" :xs="24" :sm="24" :md="24" :lg="24">
                <el-date-picker
                  type="date"
                  placeholder="选择新开始时间"
                  v-model="ReProject.StartDate"
                  value-format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="新结束时间" :xs="24" :sm="24" :md="24" :lg="24">
                <el-date-picker
                  type="date"
                  placeholder="选择新结束时间"
                  v-model="ReProject.endDate"
                  value-format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogReProject = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--继续服务-->
    <div class="StartProject">
      <el-dialog
        title="继续服务"
        :visible.sync="dialogStartProject"
        width="30%"
        :before-close="handleClose"
      >
        <div>
          <p class="mb10">当前结束时间：{{overTime}}</p>

          <el-row class="mb10">
            <el-date-picker
              type="date"
              placeholder="选择新结束时间"
              v-model="StopProject.endDate"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
          </el-row>
          <p>请选择下次项目结束时间，确定恢复后此项目将回到服务中列表</p>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogStartProject = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--删除项目-->
    <div class="DeleteProject">
      <el-dialog
        title="删除项目"
        :visible.sync="dialogDeleteProject"
        width="30%"
        :before-close="handleClose"
      >
        <p>
          确定将
          <span class="FontRed">{{DeleteProName}}</span> 删除吗？
        </p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogDeleteProject = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--锁定项目-->
    <div class="LockProject">
      <el-dialog
        title="锁定项目"
        :visible.sync="dialogLockProject"
        width="30%"
        :before-close="handleClose"
      >
        <p>已锁定该项目</p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button type="primary" @click="dialogLockProject = false">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--解锁项目-->
    <div class="unLockProject">
      <el-dialog
        title="解锁项目"
        :visible.sync="dialogunLockProject"
        width="30%"
        :before-close="handleClose"
      >
        <p>已解锁该项目</p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button type="primary" @click="dialogunLockProject = false">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--操作记录-->
    <div class="ProjectHestory">
      <el-dialog
        title="操作记录"
        :visible.sync="dialogProjectHestory"
        width="50%"
        :before-close="handleClose"
      >
        <el-table :data="Hestorytable" style="width: 100%;color:#101010">
          <el-table-column prop="Code" label="项目编号"></el-table-column>
          <el-table-column prop="Description" label="操作方式"></el-table-column>
          <el-table-column prop="Content" label="变更内容"></el-table-column>
          <el-table-column prop="Name" label="操作人"></el-table-column>
          <el-table-column prop="OperateDate" label="操作时间"></el-table-column>
        </el-table>
        <div class="pagenation">
          <span>
            <el-pagination
              background
              layout="prev, pager, next, sizes, total, jumper"
              :total="Hestorytable.length"
              @current-change="click"
              @size-change="handleSizeChange"
              :page-sizes="[5, 10, 15, 20]"
              :page-size="pagesize"
            ></el-pagination>
          </span>
        </div>
      </el-dialog>
    </div>

    <!--恢复电梯-->
    <div class="ReLift">
      <el-dialog title="恢复电梯" :visible.sync="dialogReLift" width="30%" :before-close="handleClose">
        <p>确定将恢复该电梯吗？</p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogReLift = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--停保电梯-->
    <div class="StopLiftOne">
      <el-dialog
        title="恢复电梯"
        :visible.sync="dialogStopLiftOne"
        width="30%"
        :before-close="handleClose"
      >
        <p>确定将停保该电梯吗？</p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogStopLiftOne = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--绑定物联设备-->
    <div class="BindingDvice">
      <el-dialog
        title="绑定物联设备"
        :visible.sync="dialogBindingDvice"
        width="35%"
        :before-close="handleClose"
      >
        <div>
          <el-form :model="BindingDvice" :inline="true" label-position="left">
            <el-row class="mb20">
              <el-col :sm="8" :md="8" :lg="8" class="selectUp">
                <span>
                  物联设备类型
                  <i class="FontRed">﹡</i>
                </span>
              </el-col>
              <el-col :sm="16" :md="16" :lg="16">
                <el-select v-model="BindingDvice.Usage" filterable placeholder="选择物联设备类型">
                  <el-option
                    v-for="item in Usages"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-col>
            </el-row>
            <el-row>
              <el-col :sm="8" :md="8" :lg="8" class="selectUp">
                <span>
                  物联设备ID
                  <i class="FontRed">﹡</i>
                </span>
              </el-col>
              <el-col :sm="16" :md="16" :lg="16">
                <el-input placeholder="输入物联设备ID" v-model="BindingDvice.deviceID"></el-input>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogBindingDvice = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--锁定电梯-->
    <div class="LockProject">
      <el-dialog
        title="批量锁定"
        :visible.sync="dialogLockLift"
        width="30%"
        :before-close="handleClose"
      >
        <p>已批量锁定</p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button type="primary" @click="dialogLockLift = false">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--解锁电梯-->
    <div class="unLockProject">
      <el-dialog
        title="批量解锁"
        :visible.sync="dialogunLockLift"
        width="30%"
        :before-close="handleClose"
      >
        <p>已批量解锁</p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button type="primary" @click="dialogunLockLift = false">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--批量移动-->
    <div class="LiftMoveS">
      <el-dialog
        title="批量移动"
        :visible.sync="dialogLiftMoveS"
        width="35%"
        :before-close="handleClose"
      >
        <div>
          <el-form :model="LiftMove" :inline="true" label-position="left">
            <el-row class="mb20">
              <el-col :sm="10" :md="10" :lg="10" class="selectUp">
                <span>
                  将电梯移动到
                  <i class="FontRed">﹡</i>
                </span>
              </el-col>
              <el-col :sm="14" :md="14" :lg="14">
                <el-select v-model="LiftMove.projectId" filterable placeholder="请选择项目">
                  <el-option
                    v-for="item in projectList"
                    :key="item.ID"
                    :label="item.Name"
                    :value="item.ID"
                  ></el-option>
                </el-select>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogLiftMoveS = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--批量停保-->
    <div class="StopLift">
      <el-dialog
        title="批量停保"
        :visible.sync="dialogStopLift"
        width="30%"
        :before-close="handleClose"
      >
        <p>
          确定停保
          <span class="FontRed">{{StopLiftNum}}</span> 台电梯吗？
        </p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogStopLift = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--地理位置-->
    <div class="LiftPosition">
      <el-dialog
        title="地理位置"
        :visible.sync="dialogLiftPosition"
        width="60%"
        :before-close="handleClose"
      >
        <div>
          <v-bmap ref="child"></v-bmap>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogLiftPosition = false">关 闭</el-button>
        </div>
      </el-dialog>
    </div>

    <!--电梯操作记录-->
    <div class="LiftHestory">
      <el-dialog
        title="操作记录"
        :visible.sync="dialogLiftHestory"
        width="50%"
        :before-close="handleClose"
      >
        <el-table :data="LiftHestorytable" style="width: 100%;color:#101010">
          <el-table-column prop="Code" label="电梯编号"></el-table-column>
          <el-table-column prop="Description" label="操作方式"></el-table-column>
          <el-table-column prop="Content" label="变更内容"></el-table-column>
          <el-table-column prop="Name" label="操作人"></el-table-column>
          <el-table-column prop="OperateDate" label="操作时间"></el-table-column>
        </el-table>
        <div class="pagenation">
          <span>
            <el-pagination
              background
              layout="prev, pager, next, sizes, total, jumper"
              :total="LiftHestorytable.length"
              @current-change="click"
              @size-change="handleSizeChange"
              :page-sizes="[5, 10, 15, 20]"
              :page-size="pagesize"
            ></el-pagination>
          </span>
        </div>
      </el-dialog>
    </div>

    <!-- 新增/编辑电梯模态框 -->
    <div>
      <el-dialog
        title="添加电梯"
        :visible.sync="dialogAddLift"
        width="85%"
        :before-close="handleClose"
        class="AddLift"
      >
        <el-form
          :model="AddLift"
          :inline="true"
          label-position="right"
          class="AddLiftFrom"
          :rules="LiftFormRule"
          ref="LiftForm"
        >

          <el-row justify="space-around" class="mb20">
            <el-form-item label="电梯类型" prop="liftType" class="LiftRow">
              <el-select
                v-model="AddLift.liftType"
                filterable
                placeholder="选择电梯类型"
                @change="TypeChange"
              >
                <el-option
                  v-for="item in Type"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>

            <el-form-item v-if="LiftTypeShow" label="电梯类别" prop="category" class="LiftRow">
              <el-select
                v-model="AddLift.category"
                filterable
                placeholder="选择电梯类别"
                @change="LiftTypeChange"
              >
                <el-option
                  v-for="item in Lifttype"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备出厂编号"
              prop="factoryCode"
              class="LiftRow"
            >
              <el-input v-model="AddLift.factoryCode" placeholder="输入出厂编号"></el-input>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备注册代码"
              prop="registrationCode"
              class="LiftRow"
            >
              <el-input v-model="AddLift.registrationCode" placeholder="输入注册代码"></el-input>
            </el-form-item>
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备品种"
              prop="DevKind"
              class="LiftRow"
            >
              <span v-text="AddLift.DevKind"></span>
            </el-form-item>
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备位置码"
              prop="devicePositionCode"
              class="LiftRow"
            >
              <el-input v-model="AddLift.devicePositionCode" placeholder="输入设备位置码"></el-input>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item v-if="LiftTypeShow&&InputShow" label="设备型号" prop="liftModel" class="LiftRow">
              <el-input v-model="AddLift.liftModel" placeholder="输入设备型号"></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备安装地址"
              prop="devicePosition"
              class="LiftRow"
            >
              <el-input v-model="AddLift.devicePosition" placeholder="输入安装地址"></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备内部编号"
              prop="useCompanyCode"
              class="LiftRow"
            >
              <el-input v-model="AddLift.useCompanyCode" placeholder="输入设备内部编号 "></el-input>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备制造商"
              prop="factory"
              class="LiftRow"
            >
              <el-input v-model="AddLift.factory" placeholder="输入设备制造商 "></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="进口设备代理商"
              prop="agency"
              class="LiftRow"
            >
              <el-input v-model="AddLift.agency" placeholder="输入进口设备代理商 "></el-input>
            </el-form-item>

            <el-form-item v-if="LiftTypeShow&&InputShow" label="自定义编号" prop="customNumber" class="LiftRow">
              <el-input v-model="AddLift.customNumber" placeholder="输入自定义编号 "></el-input>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备出厂日期"
              prop="manufactureDate"
              class="LiftRow"
            >
              <el-date-picker
                type="date"
                placeholder="选择设备出厂日期"
                v-model="AddLift.manufactureDate"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备改造单位"
              prop="reformCompany"
              class="LiftRow"
            >
              <el-input v-model="AddLift.reformCompany" placeholder="输入设备改造单位"></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备改造日期"
              prop="reformDate"
              class="LiftRow"
            >
              <el-date-picker
                type="date"
                placeholder="选择设备改造日期"
                v-model="AddLift.reformDate"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备安装单位"
              prop="installCompany"
              class="LiftRow"
            >
              <el-input v-model="AddLift.installCompany" placeholder="输入设备安装单位 "></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="设备安装日期"
              prop="installDate"
              class="LiftRow"
            >
              <el-date-picker
                type="date"
                placeholder="选择设备安装日期"
                v-model="AddLift.installDate"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="电梯维保负责人"
              prop="WorkerID"
              class="LiftRow"
            >
              <el-select v-model="AddLift.WorkerID" filterable placeholder="选择负责人">
                <el-option
                  v-for="item in selWorker"
                  :key="item.userId"
                  :label="item.userId"
                  :value="item.userId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item v-if="LiftTypeShow&&InputShow" label="设备用途" prop="deviceUsage" class="LiftRow">
              <el-select placeholder="选择设备用途" v-model="AddLift.deviceUsage" class="siteel-select">
                <el-option
                  v-for="item in Usageoptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>

            <el-form-item v-if="LiftTypeShow&&InputShow" label="品牌" prop="liftBrand" class="LiftRow">
              <el-select
                placeholder="选择品牌"
                filterable
                v-model="AddLift.liftBrand"
                class="siteel-select"
              >
                <el-option
                  v-for="item in BrandList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                ></el-option>
              </el-select>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="年检日期"
              prop="annualInspectionDate"
              class="LiftRow"
            >
              <el-date-picker
                type="month"
                placeholder="选择年检日期"
                v-model="AddLift.annualInspectionDate"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow&&LiftBoxShow==1"
              label="显示楼层"
              prop="innerFloor"
              class="LiftRow"
            >
              <el-input v-model="AddLift.innerFloor" placeholder="输入显示楼层 "></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow&&CategoryShow==1"
              label="曳引轮直径"
              prop="pulleyDiameter"
              class="LiftRow"
            >
              <el-input v-model="AddLift.pulleyDiameter" placeholder="输入曳引轮直径 "></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow&&CategoryShow==1"
              label="曳引绳根数"
              prop="ropeNum"
              class="LiftRow"
            >
              <el-input v-model="AddLift.ropeNum" placeholder="输入曳引绳根数"></el-input>
            </el-form-item>
          </el-row>

          <el-row
            justify="space-around"
            class="mb20"
            v-if="LiftTypeShow&&InputShow&&LiftBoxShow==1"
          >
            <el-form-item label="门锁型号" prop="lockModel" class="LiftRow">
              <el-input v-model="AddLift.lockModel" placeholder="输入门锁型号 "></el-input>
            </el-form-item>

            <el-form-item label="层站门" prop="layerStationDoor" class="LiftRow">
              <el-input v-model="AddLift.layerStationDoor" placeholder="输入层站门"></el-input>
            </el-form-item>

            <el-form-item label="安全钳类型" prop="clampType" class="LiftRow">
              <el-select placeholder="选择安全钳类型" v-model="AddLift.clampType" class="siteel-select">
                <el-option
                  v-for="item in safetyClampTypes"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="电梯载重"
              prop="ratedLoad"
              class="LiftRow"
            >
              <el-input v-model="AddLift.ratedLoad" placeholder="输入电梯载重"></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="提升高度m"
              prop="promoteHeight"
              class="LiftRow"
            >
              <el-input v-model="AddLift.promoteHeight" placeholder="输入提升高度"></el-input>
            </el-form-item>
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="电动机功率kw"
              prop="motorPower"
              class="LiftRow"
            >
              <el-input v-model="AddLift.motorPower" placeholder="输入电动机功率"></el-input>
            </el-form-item>
          </el-row>

          <el-row
            justify="space-around"
            class="mb20"
            v-if="LiftTypeShow&&InputShow&&LiftBoxShow==2"
          >
            <el-form-item label="梯级宽度" prop="stepWidth" class="LiftRow">
              <el-input v-model="AddLift.stepWidth" placeholder="输入梯级宽度"></el-input>
            </el-form-item>

            <el-form-item label="人行道长度m" prop="sidewalkLength" class="LiftRow">
              <el-input v-model="AddLift.sidewalkLength" placeholder="输入人行道长度"></el-input>
            </el-form-item>

            <el-form-item label="倾斜角度 °" prop="tiltAngle" class="LiftRow">
              <el-input v-model="AddLift.tiltAngle" placeholder="输入倾斜角度"></el-input>
            </el-form-item>
          </el-row>

          <el-row
            justify="space-around"
            class="mb20"
            v-if="LiftTypeShow&&InputShow&&CategoryShow==2"
          >
            <el-form-item label="油缸型式" prop="cylinderType" class="LiftRow">
              <el-input v-model="AddLift.cylinderType" placeholder="输入油缸型式"></el-input>
            </el-form-item>

            <el-form-item label="油缸数量" prop="cylinderNum" class="LiftRow">
              <el-input v-model="AddLift.cylinderNum" placeholder="输入油缸数量"></el-input>
            </el-form-item>

            <el-form-item label="顶升型式" prop="topType" class="LiftRow">
              <el-input v-model="AddLift.topType" placeholder="输入顶升型式"></el-input>
            </el-form-item>
          </el-row>

          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow&&CategoryShow==2"
              label="液压满负荷值(MPa)"
              prop="mpa"
              class="LiftRow"
            >
              <el-input v-model="AddLift.mpa" placeholder="输入液压满负荷值"></el-input>
            </el-form-item>

            <el-form-item
              :xs="8"
              :sm="8"
              :md="8"
              :lg="8"
              v-if="LiftTypeShow&&InputShow&&(CategoryShow==1||CategoryShow==3)"
              label="钢带"
              prop="steelBelt"
              class="LiftRow"
            >
              <el-input v-model="AddLift.steelBelt" placeholder="输入钢带"></el-input>
            </el-form-item>

            <el-form-item
              v-if="LiftTypeShow&&InputShow&&LiftBoxShow==1"
              label="控制方式"
              prop="controlType"
              class="LiftRow"
            >
              <el-input v-model="AddLift.controlType" placeholder="输入控制方式"></el-input>
            </el-form-item>
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="额定速度(m/s)"
              prop="ratedSpeed"
              class="LiftRow"
            >
              <el-input v-model="AddLift.ratedSpeed" placeholder="输入控制方式"></el-input>
            </el-form-item>
          </el-row>
          <el-row justify="space-around" class="mb20">
            <el-form-item
              v-if="LiftTypeShow&&InputShow"
              label="备注"
              prop="remarks"
              class="LiftRowRemark"
            >
              <el-input type="textarea" v-model="AddLift.remarks"></el-input>
            </el-form-item>
          </el-row>
          
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogAddLift = false">取 消</el-button>
          <el-button type="primary" @click="submitLift('LiftForm')">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!-- 电梯信息模态框 -->
    <div class="LiftList">
      <el-dialog
        title="电梯信息"
        :visible.sync="dialogLiftList"
        width="80%"
        :before-close="handleClose"
      >
        <el-row style="border-bottom:3px solid #BBB;padding-bottom:15px">
          <el-col :xs="16" :sm="16" :md="16" :lg="16">
            <el-button type="primary" plain @click="addLiftOne">
              <i class="el-icon-plus"></i>添加电梯
            </el-button>
            <el-button type="primary" plain @click="LockLift">批量锁定</el-button>
            <el-button type="primary" plain @click="unLockLift">批量解锁</el-button>
            <el-button type="primary" plain @click="MoveLift">批量移动</el-button>
            <el-button type="primary" plain @click="StopLift">批量停保</el-button>
          </el-col>
          <el-col :xs="8" :sm="8" :md="8" :lg="8">
            <el-input placeholder="模糊搜索" suffix-icon="el-icon-search" v-model="SearchFor"></el-input>
          </el-col>
        </el-row>
        <el-table :data="LiftData" style="width: 100%" @selection-change="handleSelectionChange">
          <el-table-column type="selection"></el-table-column>
          <el-table-column prop="RegistrationCode" label="电梯编号"></el-table-column>
          <el-table-column prop="Type" label="电梯类型"></el-table-column>
          <el-table-column prop="UseCompanyCode" label="电梯位置"></el-table-column>
          <el-table-column prop="BrandName" label="品牌"></el-table-column>
          <el-table-column prop="UserName" label="维保工"></el-table-column>
          <el-table-column prop="AnnualInspectionDate" label="年检日期"></el-table-column>
          <el-table-column prop="Status" label="电梯状态"></el-table-column>
          <el-table-column prop="DeviceID" label="物联设备"></el-table-column>
          <el-table-column label="操作" min-width="200px;" fixed="right">
            <template slot-scope="props">
              <el-button
                v-if="props.row.Coordinate==''||props.row.Coordinate==null"
                size="mini"
                class="mr5"
              >未定位</el-button>
              <el-button v-else size="mini" class="mr5" @click="LiftPosition(props.row)">地理位置</el-button>
              <el-dropdown trigger="hover" slot="label" @command="handleCommandLift">
                <el-button class="el-dropdown-link" size="mini" type="primary">
                  更多
                  <i class="el-icon-arrow-down el-icon--right"></i>
                </el-button>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item
                    v-if="!props.row.DeviceID"
                    :command="composeValue('BindIOT',props.row)"
                  >绑定物联设备</el-dropdown-item>
                  <el-dropdown-item
                    v-if="props.row.DeviceID"
                    :command="composeValue('UnBindIOT',props.row)"
                  >解绑物联设备</el-dropdown-item>
                  <el-dropdown-item
                    v-if="props.row.IsLocked==0&&props.row.Status==2"
                    :command="composeValue('LiftUpdate',props.row)"
                  >编辑</el-dropdown-item>

                  <!-- <el-dropdown-item :command="composeValue('UpdateIn',props.row)">修改间隔</el-dropdown-item> -->
                  <el-dropdown-item
                    v-if="props.row.IsLocked==0&&props.row.Status==2"
                    :command="composeValue('LiftDelete',props.row)"
                  >删除</el-dropdown-item>
                  <el-dropdown-item
                    v-if="props.row.Status==1"
                    :command="composeValue('LiftRecover',props.row)"
                  >恢复</el-dropdown-item>
                  <el-dropdown-item v-else :command="composeValue('LiftStop',props.row)">停保</el-dropdown-item>
                  <el-dropdown-item
                    v-if="props.row.IsLocked==0"
                    :command="composeValue('Stop',props.row)"
                  >复制添加</el-dropdown-item>
                  <el-dropdown-item :command="composeValue('LiftHestory',props.row)">操作记录</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </template>
          </el-table-column>
        </el-table>
        <div class="pagenation">
          <span>
            <el-pagination
              background
              layout="prev, pager, next, sizes, total, jumper"
              :total="LiftData.length"
              @current-change="click"
              @size-change="handleSizeChange"
              :page-sizes="[5, 10, 15, 20]"
              :page-size="pagesize"
            ></el-pagination>
          </span>
        </div>
      </el-dialog>
    </div>
    <!-- motal -->
  </div>
</template>

<script>
import bus from "../header/bus";
import Bmap from "../home/amaps.vue";
export default {
  components: {
    vBmap: Bmap
  },
  // 接受父组件的值
  props: {
    changeTable: String,
    required: true
  },
  data() {
    var validateTiltAngle = (rule, value, callback) => {
      if (value > 360) {
        return callback(new Error("输入最大倾斜度值不能超过360"));
      } else {
        return callback();
      }
    };

    const generateData = _ => {
      const data = [];
      for (let i = 1; i <= 15; i++) {
        data.push({
          key: i,
          label: `备选项 ${i}`
          // disabled: i % 4 === 0
        });
      }
      return data;
    };
    //编辑项目赋值
    const _initProjectForm = Project => {
      const _ProjectForm = {
        StartDate: "",
        EndDate: "",
        name: "",
        usage: "",
        selectedArea: "",
        num: "",
        address: "",
        ppm_id: "",
        ppc_id: "",
        station_id: "",
        selectedWorkers: "",
        province: "",
        city: "",
        District: "",
        Region: "",
        RegionWorkerName: "",
        UserName: "",
        ClerkName: "",
        addPpcDialog: false,
        ppc_name: "",
        ppm_name: "",
        addPpmDialog: false,
        IsSave:1

      };
      _ProjectForm.StartDate = Project.StartDate;
      _ProjectForm.EndDate = Project.EndDate;
      _ProjectForm.name = Project.Name;
      _ProjectForm.usage = Project.Usage;
      _ProjectForm.num = Project.Num;
      _ProjectForm.address = Project.Address;
      _ProjectForm.ppm_id = Project.PPContactID;
      _ProjectForm.ppc_id = Project.PPCompanyID;
      _ProjectForm.province = Project.ProvinceCode;
      _ProjectForm.city = Project.CityCode;
      _ProjectForm.District = Project.DistrictCode;
      _ProjectForm.Region = Project.RegionId;
      _ProjectForm.ClerkName = Project.ClerkName;
      _ProjectForm.RegionWorkerName = Project.RegionWorkerName;
      _ProjectForm.IsSave = Project.IsSave;

      console.log(_ProjectForm);
      return _ProjectForm;
    };

    const _initLiftForm = Lift => {
      const _AddLift = {
        liftType: "",
        category: "",
        registrationCode: "",
        devicePositionCode: "",
        liftModel: "",
        useCompanyCode: "",
        agency: "",
        reformDate: "",
        installDate: "",
        innerFloor: "",
        controlType: "",
        deviceUsage: "",
        promoteHeight: "",
        clampType: "",
        lockModel: "",
        layerStationDoor: "",
        pulleyDiameter: "",
        ropeNum: "",
        steelBelt: "",
        cylinderType: "",
        cylinderNum: "",
        topType: "",
        mpa: "",
        stepWidth: "",
        tiltAngle: "",
        sidewalkLength: "",
        liftBrand: "",
        ratedLoad: "",
        devicePosition: "",
        annualInspectionDate: "",
        ratedSpeed: "",
        motorPower: "",
        factoryCode: "",
        manufactureDate: "",
        reformCompany: "",
        installCompany: "",
        factory: "",
        customNumber: "",
        remarks: "",
        DevKind:"1111"//品种
      };

      _AddLift.liftType = Lift.liftType;
      this.TypeChange(Lift.liftType);
      _AddLift.category = Lift.category;
      this.LiftTypeChange(Lift.category);
      _AddLift.registrationCode = Lift.registrationCode;
      _AddLift.devicePositionCode = Lift.devicePositionCode;
      _AddLift.liftModel = Lift.liftModel;
      _AddLift.useCompanyCode = Lift.useCompanyCode;
      _AddLift.agency = Lift.agency;
      _AddLift.reformDate = Lift.reformDate?Lift.reformDate.substring(0, 10):Lift.reformDate;
      _AddLift.installDate = Lift.installDate?Lift.installDate.substring(0, 10):Lift.installDate;
      _AddLift.innerFloor = Lift.innerFloor;
      _AddLift.controlType = Lift.controlType;
      _AddLift.deviceUsage = Lift.deviceUsage;
      _AddLift.promoteHeight = Lift.promoteHeight;
      _AddLift.clampType = Lift.clampType;
      _AddLift.lockModel = Lift.lockModel;
      _AddLift.layerStationDoor = Lift.layerStationDoor;
      _AddLift.pulleyDiameter = Lift.pulleyDiameter;
      _AddLift.ropeNum = Lift.ropeNum;
      _AddLift.steelBelt = Lift.steelBelt;
      _AddLift.cylinderType = Lift.cylinderType;
      _AddLift.cylinderNum = Lift.cylinderNum;
      _AddLift.topType = Lift.topType;
      _AddLift.mpa = Lift.mpa;
      _AddLift.stepWidth = Lift.stepWidth;
      _AddLift.tiltAngle = Lift.tiltAngle;
      _AddLift.sidewalkLength = Lift.sidewalkLength;
      _AddLift.liftBrand = Lift.liftBrand;
      _AddLift.ratedLoad = Lift.ratedLoad;
      _AddLift.devicePosition = Lift.devicePosition;
      _AddLift.annualInspectionDate = Lift.annualInspectionDate;
      _AddLift.ratedSpeed = Lift.ratedSpeed;
      _AddLift.motorPower = Lift.motorPower;
      _AddLift.factoryCode = Lift.factoryCode;
      _AddLift.manufactureDate = Lift.manufactureDate?Lift.manufactureDate.substring(0, 10):Lift.manufactureDate;
      _AddLift.reformCompany = Lift.reformCompany;
      _AddLift.installCompany = Lift.installCompany;
      _AddLift.factory = Lift.factory;
      _AddLift.customNumber = Lift.customNumber;
      _AddLift.remarks = Lift.remarks;
      _AddLift.DevKind = Lift.DevKind;

      console.log(_AddLift);
      return _AddLift;
    };

    return {
      //数据
      PlanIntervalss: [
        {
          value: 1,
          label: 1
        },
        {
          value: 2,
          label: 2
        },
        {
          value: 3,
          label: 3
        },
        {
          value: 4,
          label: 4
        },
        {
          value: 5,
          label: 5
        },
        {
          value: 6,
          label: 6
        },
        {
          value: 7,
          label: 7
        },
        {
          value: 8,
          label: 8
        },
        {
          value: 9,
          label: 9
        },
        {
          value: 10,
          label: 10
        },
        {
          value: 11,
          label: 11
        },
        {
          value: 12,
          label: 12
        },
        {
          value: 13,
          label: 13
        },
        {
          value: 14,
          label: 14
        },
        {
          value: 15,
          label: 15
        }
      ],

      options: [
        {
          value: 1,
          label: "湖北省"
        },
        {
          value: 2,
          label: "浙江省"
        },
        {
          value: 3,
          label: "江苏省"
        },
        {
          value: 4,
          label: "广东省"
        },
        {
          value: 5,
          label: "福建省"
        }
      ],
      Usages: [
        {
          value: 1,
          label: "中盛"
        },
        {
          value: 2,
          label: "核歌"
        },
        {
          value: 3,
          label: "中秀"
        },
        {
          value: 4,
          label: "海康"
        }
      ],
      ppcOptions: [
        {
          Name: "哇哈哈",
          MTCompanyID: 1
        },
        {
          Name: "泛海物业",
          MTCompanyID: 2
        }
      ],
      ppmOptions: [
        {
          Name: "赵总",
          Telephone: "15811111111",
          CreatorID: 1
        },
        {
          Name: "李总",
          Telephone: "15815815815",
          CreatorID: 2
        }
      ],
      projectList: [
        {
          ID: 1001104125705,
          Name: "香海园"
        },
        {
          ID: 1001104125706,
          Name: "云海园"
        },
        {
          ID: 1001104125707,
          Name: "测试项目"
        },
        {
          ID: 1001104125708,
          Name: "测试项目2"
        }
      ],
      //电梯操作记录数据
      LiftHestorytable: [
        {
          Code: "ZT000015",
          Content: "恢复电梯",
          Description: "恢复电梯",
          ID: 0,
          LiftID: 1001105202148,
          MTCompanyID: 1001102110557,
          Name: "彭丹",
          OperateDate: "2019-08-16 05:39:46",
          RegistrationCode: null
        },
        {
          Code: "ZT000015",
          Content: "停保电梯",
          Description: "停保电梯",
          ID: 0,
          LiftID: 1001105202148,
          MTCompanyID: 1001102110557,
          Name: "彭丹",
          OperateDate: "2019-08-16 05:39:44",
          RegistrationCode: null
        }
      ],
      //安全钳类型
      safetyClampTypes: [
        {
          value: 1,
          label: "瞬时式安全钳"
        },
        {
          value: 2,
          label: "渐进式安全钳"
        }
      ],
      //电梯维保负责人
      selWorker: [
        {
          value: 1001101131069,
          label: "彭丹"
        },
        {
          value: 1001101131132,
          label: "黄龙山"
        }
      ],
      //品牌列表
      BrandList: [
        {
          value: 1,
          label: "武汉东菱富士"
        },
        {
          value: 2,
          label: "华升富士达"
        }
      ],
      LiftData: [],
      tableData: [],
      ProjectStatus:2,
      ProjectTotal: 10,

      Hestorytable: [
        {
          Code: "1",
          Description: "1",
          Content: "1",
          Name: "1",
          OperateDate: "1"
        },
        {
          Code: "2",
          Description: "2",
          Content: "2",
          Name: "2",
          OperateDate: "2"
        }
      ],
      multipleSelection: [],
      pagesize: 10,
      currpage: 1,
      //模态框状态值
      dialogVisible: false,
      dialogLiftList: false,
      projectFormDialog: false,
      dialogInterval: false,
      dialogStopProject: false,
      dialogLockProject: false,
      dialogProjectHestory: false,
      dialogStartProject: false,
      dialogReProject: false,
      dialogDeleteProject: false,
      dialogunLockProject: false,
      dialogBindingDvice: false,
      dialogLockLift: false,
      dialogunLockLift: false,
      dialogLiftMoveS: false,
      dialogStopLift: false,
      dialogAddLift: false,
      dialogLiftPosition: false,
      dialogReLift: false,
      dialogStopLiftOne: false,
      dialogLiftHestory: false,
      handleClose: null,
      //绑定值
      DeleteProName: "",
      overTime: "",
      SearchFor: "",
      PlanInterval: 15,
      //电梯选中值
      liftChoose: [],
      //新增、编辑电梯值
      AddLift: {},
      initLiftForm(Lift) {
        this.AddLift = _initLiftForm(Lift);
      },
      LiftFormRule: {
        registrationCode: [
          { required: true, message: "注册代码不能为空", trigger: "blur" },
          { min: 10, message: "注册代码至少为10个字符", trigger: "blur" }
        ],
        lockModel: [
          { max: 20, message: "输入最大长度不能超过20个字符", trigger: "blur" }
        ],
        tiltAngle: [
          { required: true, message: "倾斜角度不能为空", trigger: "blur" },
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          },
          { validator: validateTiltAngle, trigger: "blur" }
        ],
        stepWidth: [
          { required: true, message: "梯级宽度不能为空", trigger: "blur" },
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        sidewalkLength: [
          { required: true, message: "人行道长度不能为空", trigger: "blur" },
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          },
          { max: 20, message: "输入最大长度不能超过20个字符", trigger: "blur" }
        ],
        ropeNum: [
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        pulleyDiameter: [
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        ratedLoad: [
          { required: true, message: "电梯载重不能为空", trigger: "blur" },
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        layerStationDoor: [
          { required: true, message: "层站门不能为空", trigger: "blur" }
        ],
        factoryCode: [
          { max: 20, message: "最多只能输入20位字符", trigger: "blur" }
        ],
        promoteHeight: [
          { required: true, message: "提升高度不能为空", trigger: "blur" },
          {
            pattern: /^([1-9][0-9]*)$/,
            message: "输入值必须是大于0的数字",
            trigger: "blur"
          }
        ],
        motorPower: [
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        deviceUsage: [
          { required: true, message: "设备用途不能为空", trigger: "blur" }
        ],
        devicePosition: [
          { required: true, message: "设备安装地址不能为空", trigger: "blur" }
        ],
        annualInspectionDate: [
          { required: true, message: "日期不能为空", trigger: "blur" }
        ],
        remarks: [
          {
            max: 200,
            message: "最大输入长度200个字符，请修改输入",
            trigger: "blur"
          }
        ],
        liftType: [{ required: true, message: "请至少选择一项", trigger: "blur" }],
        category: [
          { required: true, message: "请至少选择一项", trigger: "blur" }
        ],
        cylinderNum: [
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        mpa: [
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        steelBelt: [
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        useCompanyCode: [
          { required: true, message: "设备内部编号不能为空", trigger: "blur" }
        ],
        ratedSpeed:[
          { required: true, message: "额定速度不能为空", trigger: "blur" },
          {
            pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
            message: "输入值必须是数字",
            trigger: "blur"
          }
        ],
        liftBrand: [{ required: true, message: "请至少选择一项", trigger: "blur" }],
      },
      //电梯类型
      Type: [
        {
          value: 1,
          label: "直梯"
        },
        {
          value: 2,
          label: "扶梯"
        }
      ],
      //电梯类别
      Lifttype: [],
      //控制电梯类别出来
      LiftTypeShow: false,
      //控制电梯框出来
      InputShow: false,
      //控制不同类型的框出来
      CategoryShow: "",
      //控制直梯扶梯出来
      LiftBoxShow: "",
      //停保电梯数量
      StopLiftNum: "",
      //用途列表
      Usageoptions: [
        {
          value: 1,
          label: "住宅"
        },
        {
          value: 2,
          label: "办公楼"
        },
        {
          value: 3,
          label: "医院"
        },
        {
          value: 4,
          label: "商场"
        },
        {
          value: 5,
          label: "工厂"
        },
        {
          value: 6,
          label: "酒店"
        },
        {
          value: 7,
          label: "交通枢纽"
        },
        {
          value: 8,
          label: "学校"
        },
        {
          value: 9,
          label: "剧场"
        },
        {
          value: 10,
          label: "其他"
        }
      ],
      projectForm: {},

      //项目规则

      projectFormRule: {
        StartDate: [
          { required: true, message: "请输入开始时间", trigger: "blur" }
        ],
        EndDate: [
          { required: true, message: "请输入结束时间", trigger: "blur" }
        ],
        province: [{ required: true, message: "请输入省", trigger: "blur" }],
        city: [{ required: true, message: "请输入市", trigger: "blur" }],
        District: [{ required: true, message: "请输入区", trigger: "blur" }],
        Region: [
          { required: true, message: "请输入区域名称", trigger: "blur" }
        ],
        name: [
          { required: true, message: "请输入项目名称", trigger: "blur" },
          { max: 30, message: "输入最大长度不能超过30个汉字", trigger: "blur" }
        ],
        address: [
          { required: true, message: "请输入项目地址", trigger: "blur" },
          {
            max: 100,
            message: "输入最大长度不能超过100个汉字",
            trigger: "blur"
          }
        ],
        usage: [{ required: true, message: "请输入项目用途", trigger: "blur" }],
        num: [
          { required: true, message: "请输入项目台量", trigger: "blur" },
          {
            pattern: /^\d{1,8}?$/,
            message: "输入最大长度不能超过8位数字",
            trigger: "blur"
          }
        ],
        ppc_id: [
          { required: true, message: "请输入甲方名称", trigger: "blur" }
        ],
        ppm_id: [
          { required: true, message: "请输入甲方联系人", trigger: "blur" }
        ]
      },

      initProjectForm(project) {
        this.projectForm = _initProjectForm(project);
      },
      StopProject: {
        remarks: "",
        endDate: ""
      },
      ReProject: {
        endDate: "",
        StartDate: ""
      },
      BindingDvice: {
        Usage: "",
        deviceID: ""
      },
      LiftMove: {
        projectId: ""
      },
      data: generateData(),
      value: [1],
      value4: [1],
      renderFunc(h, option) {
        return (
          <span>
            {option.key} - {option.label}
          </span>
        );
      },
      ProjectCheck:""
    };
  },
  watch: {
    changeTable: function(newVal, oldVal) {
      if (newVal == "pane-first") {
        this.ProjectStatus = 2;
        this.showProjectData(2,1,10)
      } else if (newVal == "pane-second") {
        this.ProjectStatus = 4;
        this.showProjectData(4,1,10)
      } else if (newVal == "pane-third") {
        this.ProjectStatus = 0;
        this.showProjectData(0,1,10)
        
      } else if (newVal == "pane-fourth") {
        this.ProjectStatus = 3;
        this.showProjectData(3,1,10)
      }
    }
  },

  created: function() {
    this.AcceptAdd();
    this.LiftData = [
      {
        Agency: "",
        AnnualInspectionDate: "2019-08",
        Brand: "ECEDT",
        BrandName: "ECE电梯",
        Category: 1,
        ClampType: 0,
        Code: "ZT000015",
        Code1: "",
        ControlType: "",
        Coordinate: "",
        CreateDate: "2019-08-06 01:52:36",
        CreatorID: 0,
        CylinderNum: 0,
        CylinderType: "",
        DevPosition: "      ",
        DeviceID: "344657687ff",
        DeviceType: 0,
        Factory: "",
        FactoryCode: "",
        FirstTime: "2019-08-06",
        ID: 1001105202148,
        InnerFloor: 0,
        InstallCompany: "",
        InstallDate: "",
        IsLocked: 0,
        IsOneself: 0,
        LayerStationDoor: "333",
        LockModel: "",
        ManufactureDate: "",
        MaxAnnualInspectionDate: null,
        Model: "",
        MotorPower: "0.00",
        Mpa: 0,
        PlanInterval: 15,
        Position: "光谷",
        PrintTime: "2019-08-15 15:02:55",
        ProjectID: 1001104125716,
        ProjectName: null,
        PromoteHeight: "10.00",
        PulleyDiameter: "0.00",
        RatedLoad: 50,
        RatedSpeed: "3.00",
        ReformCompany: "",
        ReformDate: "",
        RegistrationCode: "34rehd53453",
        Remarks: "",
        RopeNum: 0,
        SidewalkLength: "0.00",
        Status: 1,
        SteelBelt: 0,
        StepWidth: "0.00",
        TiltAngle: "0.00",
        TopType: 0,
        Type: 1,
        Usage: 12,
        UseCompanyCode: "453534535",
        UserName: "黄龙山",
        WorkerID: 1001101131132,
        Remarks: "",
        Mpa: 0,
        SteelBelt: 0
      },
      {
        Agency: "",
        AnnualInspectionDate: "2019-08",
        Brand: "ECEDT",
        BrandName: "ECE电梯",
        Category: 1,
        ClampType: 0,
        Code: "ZT000015",
        Code1: "",
        ControlType: "",
        Coordinate: "114.417563,30.406007",
        CreateDate: "2019-08-06 01:52:36",
        CreatorID: 0,
        CylinderNum: 0,
        CylinderType: "",
        DevPosition: "      ",
        DeviceID: "",
        DeviceType: 0,
        Factory: "",
        FactoryCode: "",
        FirstTime: "2019-08-06",
        ID: 1001105202148,
        InnerFloor: 0,
        InstallCompany: "",
        InstallDate: "",
        IsLocked: 1,
        IsOneself: 0,
        LayerStationDoor: "333",
        LockModel: "",
        ManufactureDate: "",
        MaxAnnualInspectionDate: null,
        Model: "",
        MotorPower: "0.00",
        Mpa: 0,
        PlanInterval: 15,
        Position: "光谷",
        PrintTime: "2019-08-15 15:02:55",
        ProjectID: 1001104125716,
        ProjectName: null,
        PromoteHeight: "10.00",
        PulleyDiameter: "0.00",
        RatedLoad: 50,
        RatedSpeed: "3.00",
        ReformCompany: "",
        ReformDate: "",
        RegistrationCode: "34rehd53453",
        Remarks: "",
        RopeNum: 0,
        SidewalkLength: "0.00",
        Status: 2,
        SteelBelt: 0,
        StepWidth: "0.00",
        TiltAngle: "0.00",
        TopType: 0,
        Type: 1,
        Usage: 12,
        UseCompanyCode: "453534535",
        UserName: "黄龙山",
        WorkerID: 1001101131132,
        Remarks: "",
        Mpa: 0,
        SteelBelt: 0
      },
      {
        Agency: "",
        AnnualInspectionDate: "2019-08",
        Brand: "ECEDT",
        BrandName: "ECE电梯",
        Category: 1,
        ClampType: 0,
        Code: "ZT000015",
        Code1: "",
        ControlType: "",
        Coordinate: "114.417563,30.406007",
        CreateDate: "2019-08-06 01:52:36",
        CreatorID: 0,
        CylinderNum: 0,
        CylinderType: "",
        DevPosition: "      ",
        DeviceID: "",
        DeviceType: 0,
        Factory: "",
        FactoryCode: "",
        FirstTime: "2019-08-06",
        ID: 1001105202148,
        InnerFloor: 0,
        InstallCompany: "",
        InstallDate: "",
        IsLocked: 0,
        IsOneself: 0,
        LayerStationDoor: "333",
        LockModel: "",
        ManufactureDate: "",
        MaxAnnualInspectionDate: null,
        Model: "",
        MotorPower: "0.00",
        Mpa: 0,
        PlanInterval: 15,
        Position: "光谷",
        PrintTime: "2019-08-15 15:02:55",
        ProjectID: 1001104125716,
        ProjectName: null,
        PromoteHeight: "10.00",
        PulleyDiameter: "0.00",
        RatedLoad: 50,
        RatedSpeed: "3.00",
        ReformCompany: "",
        ReformDate: "",
        RegistrationCode: "34rehd53453",
        Remarks: "",
        RopeNum: 0,
        SidewalkLength: "0.00",
        Status: 2,
        SteelBelt: 0,
        StepWidth: "0.00",
        TiltAngle: "0.00",
        TopType: 0,
        Type: 1,
        Usage: 12,
        UseCompanyCode: "453534535",
        UserName: "黄龙山",
        WorkerID: 1001101131132,
        Remarks: "",
        Mpa: 0,
        SteelBelt: 0
      },
      {
        Agency: "",
        AnnualInspectionDate: "2019-08",
        Brand: "ECEDT",
        BrandName: "ECE电梯",
        Category: 1,
        ClampType: 0,
        Code: "ZT000015",
        Code1: "",
        ControlType: "",
        Coordinate: "114.417563,30.406007",
        CreateDate: "2019-08-06 01:52:36",
        CreatorID: 0,
        CylinderNum: 0,
        CylinderType: "",
        DevPosition: "      ",
        DeviceID: "",
        DeviceType: 0,
        Factory: "",
        FactoryCode: "",
        FirstTime: "2019-08-06",
        ID: 1001105202148,
        InnerFloor: 0,
        InstallCompany: "",
        InstallDate: "",
        IsLocked: 0,
        IsOneself: 0,
        LayerStationDoor: "333",
        LockModel: "",
        ManufactureDate: "",
        MaxAnnualInspectionDate: null,
        Model: "",
        MotorPower: "0.00",
        Mpa: 0,
        PlanInterval: 15,
        Position: "光谷",
        PrintTime: "2019-08-15 15:02:55",
        ProjectID: 1001104125716,
        ProjectName: null,
        PromoteHeight: "10.00",
        PulleyDiameter: "0.00",
        RatedLoad: 50,
        RatedSpeed: "3.00",
        ReformCompany: "",
        ReformDate: "",
        RegistrationCode: "34rehd53453",
        Remarks: "",
        RopeNum: 0,
        SidewalkLength: "0.00",
        Status: 2,
        SteelBelt: 0,
        StepWidth: "0.00",
        TiltAngle: "0.00",
        TopType: 0,
        Type: 1,
        Usage: 12,
        UseCompanyCode: "453534535",
        UserName: "黄龙山",
        WorkerID: 1001101131132,
        Remarks: "",
        Mpa: 0,
        SteelBelt: 0
      },
      {
        Agency: "",
        AnnualInspectionDate: "2019-08",
        Brand: "ECEDT",
        BrandName: "ECE电梯",
        Category: 1,
        ClampType: 0,
        Code: "ZT000015",
        Code1: "",
        ControlType: "",
        Coordinate: "114.417563,30.406007",
        CreateDate: "2019-08-06 01:52:36",
        CreatorID: 0,
        CylinderNum: 0,
        CylinderType: "",
        DevPosition: "",
        DeviceID: "",
        DeviceType: 0,
        Factory: "",
        FactoryCode: "",
        FirstTime: "2019-08-06",
        ID: 1001105202148,
        InnerFloor: 0,
        InstallCompany: "",
        InstallDate: "",
        IsLocked: 0,
        IsOneself: 0,
        LayerStationDoor: "333",
        LockModel: "",
        ManufactureDate: "",
        MaxAnnualInspectionDate: null,
        Model: "",
        MotorPower: "0.00",
        Mpa: 0,
        PlanInterval: 15,
        Position: "光谷",
        PrintTime: "2019-08-15 15:02:55",
        ProjectID: 1001104125716,
        ProjectName: null,
        PromoteHeight: "10.00",
        PulleyDiameter: "0.00",
        RatedLoad: 50,
        RatedSpeed: "3.00",
        ReformCompany: "",
        ReformDate: "",
        RegistrationCode: "34rehd53453",
        Remarks: "",
        RopeNum: 0,
        SidewalkLength: "0.00",
        Status: 2,
        SteelBelt: 0,
        StepWidth: "0.00",
        TiltAngle: "0.00",
        TopType: 0,
        Type: 1,
        Usage: 12,
        UseCompanyCode: "453534535",
        UserName: "黄龙山",
        WorkerID: 1001101131132,
        Remarks: "",
        Mpa: 0,
        SteelBelt: 0
      },
      {
        Agency: "",
        AnnualInspectionDate: "2019-08",
        Brand: "ECEDT",
        BrandName: "ECE电梯",
        Category: 1,
        ClampType: 0,
        Code: "ZT000015",
        Code1: "",
        ControlType: "",
        Coordinate: "114.417563,30.406007",
        CreateDate: "2019-08-06 01:52:36",
        CreatorID: 0,
        CylinderNum: 0,
        CylinderType: "",
        DevPosition: "      ",
        DeviceID: "",
        DeviceType: 0,
        Factory: "",
        FactoryCode: "",
        FirstTime: "2019-08-06",
        ID: 1001105202148,
        InnerFloor: 0,
        InstallCompany: "",
        InstallDate: "",
        IsLocked: 0,
        IsOneself: 0,
        LayerStationDoor: "333",
        LockModel: "",
        ManufactureDate: "",
        MaxAnnualInspectionDate: null,
        Model: "",
        MotorPower: "0.00",
        Mpa: 0,
        PlanInterval: 15,
        Position: "光谷",
        PrintTime: "2019-08-15 15:02:55",
        ProjectID: 1001104125716,
        ProjectName: null,
        PromoteHeight: "10.00",
        PulleyDiameter: "0.00",
        RatedLoad: 50,
        RatedSpeed: "3.00",
        ReformCompany: "",
        ReformDate: "",
        RegistrationCode: "34rehd53453",
        Remarks: "",
        RopeNum: 0,
        SidewalkLength: "0.00",
        Status: 2,
        SteelBelt: 0,
        StepWidth: "0.00",
        TiltAngle: "0.00",
        TopType: 0,
        Type: 1,
        Usage: 12,
        UseCompanyCode: "453534535",
        UserName: "黄龙山",
        WorkerID: 1001101131132,
        Remarks: "",
        Mpa: 0,
        SteelBelt: 0
      },
      {
        Agency: "",
        AnnualInspectionDate: "2019-08",
        Brand: "ECEDT",
        BrandName: "ECE电梯",
        Category: 1,
        ClampType: 0,
        Code: "ZT000015",
        Code1: "",
        ControlType: "",
        Coordinate: "114.417563,30.406007",
        CreateDate: "2019-08-06 01:52:36",
        CreatorID: 0,
        CylinderNum: 0,
        CylinderType: "",
        DevPosition: "      ",
        DeviceID: "",
        DeviceType: 0,
        Factory: "",
        FactoryCode: "",
        FirstTime: "2019-08-06",
        ID: 1001105202148,
        InnerFloor: 0,
        InstallCompany: "",
        InstallDate: "",
        IsLocked: 0,
        IsOneself: 0,
        LayerStationDoor: "333",
        LockModel: "",
        ManufactureDate: "",
        MaxAnnualInspectionDate: null,
        Model: "",
        MotorPower: "0.00",
        Mpa: 0,
        PlanInterval: 15,
        Position: "光谷",
        PrintTime: "2019-08-15 15:02:55",
        ProjectID: 1001104125716,
        ProjectName: null,
        PromoteHeight: "10.00",
        PulleyDiameter: "0.00",
        RatedLoad: 50,
        RatedSpeed: "3.00",
        ReformCompany: "",
        ReformDate: "",
        RegistrationCode: "34rehd53453",
        Remarks: "",
        RopeNum: 0,
        SidewalkLength: "0.00",
        Status: 2,
        SteelBelt: 0,
        StepWidth: "0.00",
        TiltAngle: "0.00",
        TopType: 0,
        Type: 1,
        Usage: 12,
        UseCompanyCode: "453534535",
        UserName: "黄龙山",
        WorkerID: 1001101131132,
        Remarks: "",
        Mpa: 0,
        SteelBelt: 0
      }
    ];

    this.showProjectData(2,1,10)
  },

  methods: {
    //
    // toggleSelection(rows) {
    //   if (rows) {
    //     rows.forEach(row => {
    //       this.$refs.multipleTable.toggleRowSelection(row);
    //     });
    //   } else {
    //     this.$refs.multipleTable.clearSelection();
    //   }
    // },

    // handleCommand(command) {
    //   this.$message("click on item " + command);
    // },
    
    //项目列表数据
    showProjectData(projectStatus,pageNum,pageSize) {
      var url = "business/project/list";
      var param = {
        projectStatus: projectStatus,
        pageNum: pageNum,
        pageSize: pageSize
      };
      this.axios.post(url, param).then(result => {
        var data = result.data.data;
        this.tableData = data.rows;
        this.ProjectTotal = data.total;
        console.log(result.data.data.rows);
      });
    },
    // 模态框调用
    handleClick(a) {
      this.dialogVisible = true;
    },
    // 分页页码
    click(val) {
      this.currpage = val;
      this.showProjectData(this.ProjectStatus,val,this.pagesize)
      console.log(1)
    },
    // 分页显示条数
    handleSizeChange(val) {
      this.pagesize = val;
      this.showProjectData(this.ProjectStatus,this.currpage,val)
      console.log(2)
    },
    handleChange(value, direction, movedKeys) {
      console.log(value);
      console.log(direction);
      console.log(movedKeys);
    },
    // 电梯信息模态框
    showLiftList(a) {
      this.dialogLiftList = true;
      this.ProjectCheck = a.projectId
    },
    //项目选中
    handleSelectionChangePro(val) {
      console.log(val);
    },
    // 电梯信息选中
    handleSelectionChange(val) {
      this.liftChoose = val;
      console.log(val);
    },
    // 电梯信息表头颜色
    tableHeaderColor({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return "background-color:pink;color:#fff";
      }
    },
    //新增编辑项目
    handleCommand(command) {
      // if (projectId) {
      //   this.initForm(projectId);
      // }
      if (command.button == "Update") {
        console.log(command.row);

        this.initProjectForm(command.row);

        this.projectFormDialog = true;
      } else if (command.button == "UpdateIn") {
        this.dialogInterval = true;
      } else if (command.button == "Stop") {
        this.dialogStopProject = true;
      } else if (command.button == "Lock") {
        this.dialogLockProject = true;
      } else if (command.button == "unLock") {
        this.dialogunLockProject = true;
      } else if (command.button == "Hestory") {
        this.dialogProjectHestory = true;
      } else if (command.button == "Start") {
        this.overTime = command.row.EndDate;
        this.dialogStartProject = true;
      } else if (command.button == "Re") {
        this.dialogReProject = true;
      } else if (command.button == "Delete") {
        this.dialogDeleteProject = true;
        this.DeleteProName = command.row.Name;
      }

      // if (this.projectForm.ppcOptions.length == 0) {
      //   this.getPpc();
      //   this.getWorker();
      // }
    },
    //新增编辑项目提交
    submitPro(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          var url = "/Car/addCar";
          var param = this.projectForm;
          console.log(param);
        } else {
          this.$message({
            message: "请输入正确信息！",
            type: "warning"
          });
          return;
        }
      });
    },
    //电梯更多按钮
    handleCommandLift(command) {
      if (command.button == "BindIOT") {
        this.dialogBindingDvice = true;
      } else if (command.button == "LiftUpdate") {
        console.log(command.row);
        this.initLiftForm(command.row);
        this.dialogAddLift = true;
      } else if (command.button == "LiftStop") {
        this.dialogStopLiftOne = true;
      } else if (command.button == "LiftRecover") {
        this.dialogReLift = true;
      } else if (command.button == "Stop") {
        this.dialogAddLift = true;
      } else if (command.button == "LiftHestory") {
        this.dialogLiftHestory = true;
      }
    },
    addLiftOne() {
      this.handleCommandLift({ button: "LiftUpdate", row: "" });
      this.LiftTypeShow = false;
      this.getWorkList()
      this.InputShow = false;
      this.CategoryShow = "";
    },
    //新增编辑电梯提交
    submitLift(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          var url = "/Car/addCar";
          var param = this.AddLift;
          console.log(param);
        } else {
          this.$message({
            message: "请输入正确信息！",
            type: "warning"
          });
          return;
        }
      });
    },
    //获取项目组成员
    getWorkList(){
      var url = "business/project/userList";
      var param = {
        projectId:this.ProjectCheck
      };
      this.axios.post(url, param).then(result => {
        var data = result.data;
        if(data.statusCode==="1"){
          this.selWorker = data.data
        }
      });
    },
    //构造多参数
    composeValue(item, row) {
      return {
        button: item,

        row: row
      };
    },
    //table行锁定时背景色
    tableRowClassName({ row, rowIndex }) {
      if (row.IsLocked === 1) {
        return "Lock-row";
      }
      return "";
    },
    //接受添加项目传来数据
    AcceptAdd() {
      bus.$on("toTableAdd", d => {
        if (d.data == 1) {
          this.handleCommand({ button: "Update", row: "" });
        }
      });
    },
    //批量锁定
    LockLift() {
      if (this.liftChoose.length == 0) {
        this.$message({
          message: "请先选择电梯",
          type: "warning"
        });
      } else {
        this.dialogLockLift = true;
      }
    },
    unLockLift() {
      if (this.liftChoose.length == 0) {
        this.$message({
          message: "请先选择电梯",
          type: "warning"
        });
      } else {
        this.dialogunLockLift = true;
      }
    },
    //批量移动
    MoveLift() {
      if (this.liftChoose.length == 0) {
        this.$message({
          message: "请先选择电梯",
          type: "warning"
        });
      } else {
        this.dialogLiftMoveS = true;
      }
    },
    //批量停保
    StopLift() {
      if (this.liftChoose.length == 0) {
        this.$message({
          message: "请先选择电梯",
          type: "warning"
        });
      } else {
        this.StopLiftNum = this.liftChoose.length;
        this.dialogStopLift = true;
      }
    },
    //选择电梯类型切换电梯类别
    TypeChange(event, item) {
      if (event == 1) {
        this.Lifttype = [
          {
            value: 1,
            label: "曳引梯"
          },
          {
            value: 2,
            label: "液压梯"
          },
          {
            value: 3,
            label: "杂物梯"
          }
        ];
        this.LiftTypeShow = true;
        this.InputShow = false;
      } else if (event == 2) {
        this.Lifttype = [
          {
            value: 4,
            label: "自动扶梯"
          },
          {
            value: 5,
            label: "自动人行道"
          }
        ];
        this.LiftTypeShow = true;
        this.InputShow = false;
      }

      this.AddLift.category = "";
      this.AddLift.registrationCode = ""; 
      this.AddLift.devicePositionCode = ""; 
      this.AddLift.liftModel = ""; 
      this.AddLift.useCompanyCode = ""; 
      this.AddLift.agency = ""; 
      this.AddLift.reformDate = ""; 
      this.AddLift.installDate = ""; 
      this.AddLift.innerFloor = ""; 
      this.AddLift.controlType = ""; 
      this.AddLift.deviceUsage = ""; 
      this.AddLift.promoteHeight = ""; 
      this.AddLift.clampType = ""; 
      this.AddLift.lockModel = ""; 
      this.AddLift.layerStationDoor = ""; 
      this.AddLift.pulleyDiameter = ""; 
      this.AddLift.ropeNum = ""; 
      this.AddLift.steelBelt = ""; 
      this.AddLift.cylinderType = ""; 
      this.AddLift.cylinderNum = ""; 
      this.AddLift.topType = ""; 
      this.AddLift.mpa = ""; 
      this.AddLift.stepWidth = ""; 
      this.AddLift.tiltAngle = ""; 
      this.AddLift.sidewalkLength = "";
      this.AddLift.liftBrand = ""; 
      this.AddLift.ratedLoad = ""; 
      this.AddLift.devicePosition = ""; 
      this.AddLift.annualInspectionDate = ""; 
      this.AddLift.ratedSpeed = ""; 
      this.AddLift.motorPower = ""; 
      this.AddLift.factoryCode = ""; 
      this.AddLift.manufactureDate = ""; 
      this.AddLift.reformCompany = ""; 
      this.AddLift.installCompany = ""; 
      this.AddLift.factory = ""; 
      this.AddLift.customNumber = ""; 
      this.AddLift.remarks = ""; 
      this.AddLift.DevKind = "1111"; 
    },
    //点击电梯类别切换
    LiftTypeChange(event, item) {
      if (event == 1) {
        this.CategoryShow = 1;
        this.LiftBoxShow = 1;
        this.InputShow = true;
      } else if (event == 2) {
        this.CategoryShow = 2;
        this.LiftBoxShow = 1;
        this.InputShow = true;
      } else if (event == 3) {
        this.CategoryShow = 3;
        this.LiftBoxShow = 1;
        this.InputShow = true;
      } else if (event == 4) {
        this.CategoryShow = 4;
        this.LiftBoxShow = 2;
        this.InputShow = true;
      } else if (event == 5) {
        this.CategoryShow = 5;
        this.LiftBoxShow = 2;
        this.InputShow = true;
      }
    },
    LiftPosition(row) {
      // this.$refs.child.emitEvent(row.Coordinate);
      this.dialogLiftPosition = true;
    },
  }
};
</script>
<style lang="stylus">
.ProjectTable {
  padding: 0 20px;

  .el-table .Lock-row {
    background: #FFE3E3;
  }

  .PJTable {
    .el-dropdown-link {
      cursor: pointer;
      color: #409EFF;
    }

    .el-button {
      padding: 5px;
      width: 45%;
      display: inline-block;
      margin-bottom: 5px;
    }

    .el-dropdown {
      width: 45%;
      margin-left: 10px;
    }

    .el-dropdown .el-button {
      width: 100%;
    }
  }

  .addProject {
    .addPrHr {
      height: 4px;
      background: rgba(187, 187, 187, 1);
    }

    .ProjectWidth70 {
      .el-form-item__content {
        width: 70%;
      }
    }

    .ProjectWidth60 {
      .el-form-item__content {
        width: 60%;
      }
    }

    .ProjectWidth50 {
      .el-form-item__content {
        width: 50%;
      }
    }

    .el-button {
      padding: 12px 5px;
    }

    .el-dialog__footer {
      .el-button {
        padding: 10px 30px;
      }
    }
  }

  .UpdateInterval, .StopProject {
    .el-dialog__body {
      text-align: center;
      padding: 15px 20px;

      .el-form {
        text-align: left;
        padding-left: 5%;
      }
    }

    .el-dialog__footer {
      text-align: center;
    }

    p {
      font-size: 16px;

      .el-icon-warning {
        color: #FF9800;
      }
    }
  }

  .LockProject, .ProjectHestory {
    .el-dialog__body {
      padding: 10px 20px;
      font-size: 18px;
    }
  }

  .ReProject {
    .el-dialog__body {
      text-align: center;
      padding: 10px;
    }

    .el-dialog__footer {
      text-align: center;
    }
  }

  .StartProject {
    .el-dialog__body {
      font-size: 16px;
      padding: 10px 25px;
    }
  }

  .BindingDvice, .LiftMoveS {
    .el-dialog__footer {
      text-align: center;
    }
  }

  .AddLift {
    .AddLiftFrom {
      .selectUp >span, .el-input {
        font-size: 12px;
      }

      .LiftRow {
        width: 33%;
        margin: 0;

        .el-form-item__label {
          width: 41%;
          text-align: center;
        }

        .el-form-item__content {
          width: 59%;
        }
      }

      .LiftRowRemark {
        width: 100%;

        .el-form-item__label {
          width: 13.5%;
          text-align: center;
        }

        .el-form-item__content {
          width: 85%;
        }
      }

      .el-date-editor.el-input, .el-date-editor.el-input__inner {
        width: 100%;
      }
    }
  }
}

.el-icon-arrow-down {
  font-size: 12px;
}

.LiftList {
  .el-dialog__body {
    padding: 15px 20px;
  }

  .el-row .el-col .el-button {
    padding: 10px;
  }
}
</style>
