<template>
  <div class="app-container">
    <div >
          <div style="background-color: #fff;padding: 20px;border-radius: 10px; padding-bottom: 0;">
                  <p style="margin: 0; font-weight: 800;font-size: 16px;color: #343434;display: flex;align-items: center;margin-bottom: 20px;border-left: 6px solid #03BF8A;margin-left: -20px;">
                    <!-- <img src="../../../assets/images/icon_htgl_btzs.png" alt="" style="width: 16px;height: 20px;"> -->
                   <span style="margin-left: 10px;">搜索条件</span>
                  </p>
                  <div style="padding-bottom: 0;margin-bottom: 20px;">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
          <el-row>
              <el-col :span="8">
                <el-form-item label="联系人" prop="personName">
                        <el-input
                          v-model="queryParams.personName"
                          placeholder="请输入联系人"
                          clearable
                          @keyup.enter.native="handleQuery"
                        />
                      </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="联系电话" prop="phonenumber">
                        <el-input
                          v-model="queryParams.phonenumber"
                          placeholder="请输入联系电话"
                          clearable
                          @keyup.enter.native="handleQuery"
                        />
                      </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="工单类型" prop="type">
                        <el-select v-model="queryParams.type" placeholder="请选择工单类型" clearable>
                          <el-option
                            v-for="dict in dict.type.work_order_type"
                            :key="dict.value"
                            :label="dict.label"
                            :value="dict.value"
                          />
                        </el-select>
                      </el-form-item>
              </el-col>
              <el-col :span="8">
               <el-form-item label="服务进展" prop="serviceProgress">
                       <el-select v-model="queryParams.serviceProgress" placeholder="请选择服务进展" clearable>
                         <el-option
                           v-for="dict in dict.type.service_progress"
                           :key="dict.value"
                           :label="dict.label"
                           :value="dict.value"
                         />
                       </el-select>
                     </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item class="butt bnjle">
                  <el-button size="mini" type="primary" style="background-color: #1BDD96; border: #1BDD96;"   @click="handleQuery">搜索</el-button>
                  <el-button size="mini"  @click="resetQuery">重置</el-button>
                </el-form-item>
              </el-col>
          </el-row>

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


      <div class="casr">
              <el-row :gutter="10" class="mb8">
                <!-- <el-col :span="1.5">
                  <div style="font-weight: bold;font-size: 14px;color: #343434; display: flex;align-items: center;">
                    当夜全选
                  </div>
                </el-col> -->
               <el-col :span="1.5">
                  <el-button
                    type="primary"
                    plain
                    size="mini"
                    @click="handleAdd"
                    v-hasPermi="['wuYe:repair:add']"
                  >添加</el-button>
                </el-col>
                <!-- <el-col :span="1.5">
                  <el-button
                    type="success"
                    plain
                    size="mini"
                    :disabled="single"
                    @click="handleUpdate"
                    v-hasPermi="['system:post:edit']"
                  >修改</el-button>
                </el-col>
                <el-col :span="1.5">
                  <el-button
                    type="danger"
                    plain
                    size="mini"
                    :disabled="multiple"
                    @click="handleDelete"
                    v-hasPermi="['system:post:remove']"
                  >删除</el-button>
                </el-col> -->
                <el-col :span="1.5">
                  <el-button
                    type="warning"
                    plain
                    size="mini"
                    @click="handleExport"
                    v-hasPermi="['wuYe:repair:export']"
                  >导出</el-button>
                </el-col>
                <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
              </el-row>
              <div class=" infinite-list" :style="dynamicStyle">
                <el-row :gutter="10" v-if="infoList.length != 0" style="width: 100%;margin-left: 0;">
                  <el-col :span="6" v-for="(item,idx) in infoList" :key="idx">
                    <div class="worklist" style="background-color: #fff;box-shadow: 0px 0px 10px 0px #CDCDCD;border-radius: 4px;margin-bottom: 10px;" >
                    	<div class="listtop" style="position: relative;">
                    		<div class="name" :class="{'bga':item.type==2,'bgb':item.type==3,'bgc':item.type==4,}">{{item.rttie}}</div>
                    		<div class="flex1">
                    			<div class="namea">{{item.unitName == null ? '暂无数据' : item.unitName}}</div>
                    			<div class="adrlist">
                    				<div class="noico"><img :src="gdicob" class="imga"></img></div>
                    				<div class="notit">{{item.personName == null ? '暂无数据' : item.personName}}
                            <span style="margin-left: 10px;">{{item.phonenumber == null ? '暂无数据' : item.phonenumber}}</span></div>
                    			</div>
                    			<div class="adrlist">
                    				<div class="noico"><img :src="gdicoa" class="imgc"></img></div>
                            <el-tooltip class="item" effect="dark" :content="item.detailedAddress == null ? '暂无数据' : (item.city + item.region +item.detailedAddress)" placement="top-start">
                    				<div class="notit over co9B" >{{item.detailedAddress == null ? '暂无数据' : (item.city + item.region +item.detailedAddress)}}</div>
                            </el-tooltip>
                    			</div>
                    		</div>
                    		<!-- <img :src='phone' class="phone"  @click.stop="getPhone()"></img> -->
                        <div style="width: 90% ;height: 1px; background-color: #f1f1f1;position: absolute;bottom: 0;">

                        </div>
                    	</div>

                    	<div class="collapse" @click.stop=""  >

                    						<div class="chtop flexc" v-if="item.serviceProgress ==0">
                    							<div style="width: 40%;" class="over">暂无数据</div>
                    							<div style="width: 60%;" class="over">暂无数据接下了该客户的工单</div>
                    						</div>
                                <el-tooltip class="item" effect="dark" :content="item.takeTime + ' '+ item.responsiblePhone +'接下了该客户的工单'" placement="top-start">
                                <div class="chtop flexc" v-if="item.serviceProgress !=0">
                                	<div style="width: 40%;" class="over">{{item.takeTime}}</div>
                                	<div style="width: 60%;" class="over">{{item.responsibleName + item.responsiblePhone}} 接下了该客户的工单</div>
                                </div>
                        </el-tooltip>
                    					<div class="chstep">
                    						<div class="flexc mb8">
                    							<div class="imgs"><img :src="wicoa" class="imga"></img></div>
                    							<div class="tit">工单编号：</div>
                    							<div class="txt">{{item.orderId == null ? '暂无数据' : item.orderId}}</div>
                    							<img :src="code" class="code"></img>
                    						</div>
                    						<div class="flexc mb8">
                    							<div class="imgs"><img :src="wicob" class="imga"></img></div>
                    							<div class="tit">创建时间：</div>
                    							<div class="txt">{{item.createTime == null ? '暂无数据' : item.createTime}}</div>
                    						</div>
                    						<div class="flexc mb8">
                    							<div class="imgs"><img :src="wicoc" class="imgb"></img></div>
                    							<div class="tit">服务类型：</div>
                    							<div class="txt" :class="{'co77':item.type==1,'co06':item.type==2,'cofb':item.type==3,'coaf':item.type==4,'coafs':item.type==5,'coafss':item.type==6,}">
                                    <dict-tag :options="dict.type.work_order_type" :value="item.type"/></div>
                    						</div>
                                <div class="flexc mb8">
                                	<div class="imgs"><img :src="wicoc" class="imgb"></img></div>
                                	<div class="tit">工单状态：</div>
                                	<div class="txt" >
                                    <dict-tag :options="dict.type.service_progress" :value="item.serviceProgress"/></div>
                                </div>
                    					</div>
                    	</div>
                      <div class="bortt tongty" style="justify-content: space-between; margin-top: 0;">
                         <p  v-if="item.serviceProgress == 0" v-hasPermi="['work:info:jdq']"   style="cursor: pointer;color: #28C529;" @click="daifeng(item)" ><span  >派单</span></span>  </p>
                        <p  v-if="item.serviceProgress == 0" v-hasPermi="['work:info:jd']" style="cursor: pointer;" @click="jiedan(item)"><span  >接单</span></span>  </p>
                         <p  v-if="item.serviceProgress == 1" v-hasPermi="['work:info:add']"   style="cursor: pointer;color: #28C529;" @click="tianxie(item)" ><span>填写工单</span></span>  </p>
                         <p style="cursor: pointer;" @click="handleUpdatef(item)"><span  >查看</span></span>  </p>
                        <!-- <span @click="handleUpdatef(item)">查看</span> -->
                        <p  v-hasPermi="['work:info:remove']" style="color:red;cursor: pointer;" @click="handleDelete(item)">删除  </p>
                      </div>

                    </div>
                  </el-col>
                </el-row>
                <div style="margin-top: 20px;display: flex;justify-content: center;align-items: center;" v-if="infoList.length ==0">
                   <img   src="../../../assets/images/zwshjbig.png" alt="" style="">
                </div>
              </div>
      </div>


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

    <!-- 添加或修改岗位对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="640px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row>
          <!-- <el-col :span="24" v-if="isnusle == 0">
            <el-form-item label="报修标题" prop="repairTitle">
                      <el-input v-model="form.repairTitle" placeholder="请输入报修标题，简要描述报修内容" />
            </el-form-item>

          </el-col> -->
          <el-col :span="12" v-if="isnusle == 0">
             <el-form-item label="手机号码" prop="phoneNumber">
                      <el-input v-model="form.phoneNumber" placeholder="请输入报修用户手机号码" />
             </el-form-item>
          </el-col>
          <el-col :span="12" v-if="isnusle == 0">
            <el-form-item label="门牌号" prop="houseAddress">
                 <el-select filterable  v-model="form.houseAddress" placeholder="请选择门牌号" clearable>
                   <el-option
                    @click.native="itnegadd(dict)"
                     v-for="dict in houseInfoLise"
                     :key="dict.houseId"
                     :label="dict.detailedAddress"
                     :value="dict.houseId"
                   />
                 </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24" v-if="isnusle == 0">
             <el-form-item label="报修详情" prop="repairDetails">
                      <el-input v-model="form.repairDetails" type="textarea" placeholder="请输入内容" />
                    </el-form-item>
          </el-col>
          <el-col :span="12" v-if="isnusle == 0">
           <el-form-item label="报修类别" prop="maintenanceCategory">
                     <el-select v-model="form.maintenanceCategory" placeholder="请选择报修类别">
                       <el-option
                         v-for="dict in dict.type.baoxiutype"
                         :key="dict.value"
                         :label="dict.label"
                         :value="dict.value"
                       ></el-option>
                     </el-select>
                   </el-form-item>
          </el-col>
          <el-col :span="12" v-if="isnusle == 0">
            <el-form-item label="报修时间" prop="repairTime">
                      <el-date-picker
                      style="width:100%"
                        v-model="form.repairTime"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择报修时间">
                      </el-date-picker>
                    </el-form-item>
          </el-col>
          <el-col :span="24" v-if="isnusle == 0">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
          <el-col :span="24" v-if="isnusle == 2">
             <el-form-item label="维修详情" prop="repairCompletionDetails">
                      <el-input v-model="form.repairCompletionDetails" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
          <el-col :span="24" class="unimg" v-if="isnusle == 1" >
            <el-form-item label="上门拍照" prop="visitPhoto">
              <image-upload v-model="form.visitPhoto"/>
            </el-form-item>
          </el-col>
          <el-col :span="24" class="unimg" v-if="isnusle == 2">
            <el-form-item label="结束拍照" prop="completionPhoto">
              <image-upload v-model="form.completionPhoto"/>
            </el-form-item>
          </el-col>
        </el-row>



      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog title="指派" :visible.sync="openz" width="640px" append-to-body>
      <el-form ref="formz" :model="formz" :rules="rulesz" label-width="80px">
        <el-row>
          <el-col :span="24" >
            <el-form-item label="选择人员" prop="responsibleName">
                      <el-select style="width: 100%;" v-model="formz.responsibleName" placeholder="请选择选择人员">
                        <el-option
                        @click.native="xuanse(dict)"
                          v-for="dict in staffManageList"
                          :key="dict.userId"
                          :label="dict.nickName "
                          :value="dict.userId"
                        ></el-option>
                      </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormz">确 定</el-button>
        <el-button @click="cancelz">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog title="查看详情" :visible.sync="openzx" width="640px" append-to-body class="boet">
      <div  class="worklist" style="" >
        <div>
          <div style="margin-top: 15px; padding: 20px;" class="xiahgw">
            <el-steps :active="actjse" simple>
              <el-step title="待接单" icon="el-icon-upload2"></el-step>
              <el-step title="进行中" icon="el-icon-refresh"></el-step>
              <el-step title="已完成" icon="el-icon-check"></el-step>
              <el-step title="已评价" icon="el-icon-check"></el-step>
            </el-steps>
          </div>
        </div>
      	<div class="listtop">
      		<div class="name" style="border-radius: 5px;" :class="{'bga':chakn.type==2,'bgb':chakn.type==3,'bgc':chakn.type==4,}">{{chakn.titke}}</div>
      		<div class="flex1">
            <div class="adrlist">
            	<div class="notit" style="font-weight: bold;font-size: 16px;color: #222327;">{{chakn.personName ==null? '暂无数据' : chakn.personName}}
              <span style="font-size: 14px; font-weight: 400;">{{chakn.phonenumber ==null? '暂无数据' : chakn.phonenumber}}</span></div>
            </div>
      			<div class="namea" style="color: #666666; font-size: 15px;">{{chakn.unitName ==null? '暂无数据' : chakn.unitName}}</div>
      		</div>
      		<!-- <img :src='phone' class="phone"  @click.stop="getPhone()"></img> -->
      	</div>
      	<div class="collapse" @click.stop="" style="border-top: 1px  solid #E6E6E6;">
      					<div class="chstep" style="padding-top: 20px;">
      						<div class="flexc mb8">
      							<div class="imgs"><img :src="wicoa" class="imga"></img></div>
      							<div class="tit" style="font-size: 14px;color: #AAAAAA;">工单编号：</div>
      							<div class="txt" style="font-size: 14px;color: #666666;">{{chakn.orderId ==null? '暂无数据' : chakn.orderId}}</div>
      							<img :src="code" class="code"></img>
      						</div>
      						<div class="flexc mb8">
      							<div class="imgs"><img :src="wicob" class="imga"></img></div>
      							<div class="tit" style="font-size: 14px;color: #AAAAAA;">创建时间：</div>
      							<div class="txt" style="font-size: 14px;color: #666666;">{{chakn.createTime ==null? '暂无数据' : chakn.createTime}}</div>
      						</div>
                  <div class="flexc mb8">
                  	<div class="imgs"><img :src="wicob" class="imga"></img></div>
                  	<div class="tit" style="font-size: 14px;color: #AAAAAA;">客户地址：</div>
                  	<div class="txt" style="font-size: 14px;color: #666666;">{{chakn.detailedAddress ==null? '暂无数据' : chakn.detailedAddress}}</div>
                  </div>
                  <div class="flexc mb8">
                  	<div class="imgs"><img :src="wicoc" class="imgb"></img></div>
                  	<div class="tit">服务类型：</div>
                  	<div class="txt" :class="{'co77':chakn.type==1,'co06':chakn.type==2,'cofb':chakn.type==3,'coaf':chakn.type==4,'coafs':chakn.type==5,'coafss':chakn.type==6,}">
                      <dict-tag :options="dict.type.work_order_type" :value="chakn.type"/></div>
                  </div>
      					</div>
      	</div>
        <div class="collapse" @click.stop="" style="border-top: 1px  solid #E6E6E6;" v-if="chakn.workOrderFjgd!=null">
        			<div class="bsers" style="padding-top: 20px;" >
        			 <div>
        			   <p> <img src="../../../assets/images/wenjian.png" alt="" style="width: 20px;height: 20px;"></p>
        			   <p>{{chakn.workOrderFjgd.name}}</p>
        			 </div>
        			  <div>
        			              <!-- + baseUrl -->
        			              <p @click="yuangl(defaultSettings.urls + baseUrl + item.url)" style="color: #658CF8;margin-right: 10px;font-size: 14px;cursor: pointer;"><img src="../../../assets/images/icon_xq_yl.png" alt="" style="width: 15px;height: 10px;">预览</p>
        			              <p @click="downloadFileg(defaultSettings.urls+ baseUrl  + item.url,item.name)" style="color: #658CF8; font-size: 14px;cursor: pointer;"><img src="../../../assets/images/icon_xq_xz.png" alt=""  style="width: 15px;height: 15px;">下载</p>
        			            </div>
        			</div>

        </div>


      </div>
      <div style="background: #FFFFFF;border-radius: 10px;">
        <div class="baae">
          <p :class="isshoe == 0?'activeq' : ''" @click="iskeh(0)">客户需求</p>
          <p v-if="chakn.serviceProgress == 3" :class="isshoe == 1?'activeq' : ''" @click="iskeh(1)">客户评价</p>
        </div>
        <div style="padding: 20px;font-size: 14px;color: #161616;line-height: 30px;" v-if="isshoe == 0">
         {{chakn.demand ==null? '暂无数据' : chakn.demand}}

        </div>
        <div class="bsers" v-for = "(item,index) in  chakn.workOrderFjXqList" :key="index" v-if="isshoe == 0">
         <div>
           <p> <img src="../../../assets/images/wenjian.png" alt="" style="width: 20px;height: 20px;"></p>
           <p>{{item.name}}</p>
         </div>
          <div>
            <!-- + baseUrl -->
            <p @click="yuangl(defaultSettings.urls+ baseUrl  + item.url)" style="color: #658CF8;margin-right: 10px;font-size: 14px;cursor: pointer;"><img src="../../../assets/images/icon_xq_yl.png" alt="" style="width: 15px;height: 10px;">预览</p>
            <p @click="downloadFile(defaultSettings.urls+ baseUrl  + item.url,item.name)" style="color: #658CF8; font-size: 14px; cursor: pointer;"><img src="../../../assets/images/icon_xq_xz.png" alt=""  style="width: 15px;height: 15px;">下载</p>
          </div>
        </div>
        <div style="padding: 20px;font-size: 14px;color: #161616;line-height: 30px;" v-if="isshoe == 1">
          <div style="display: flex; ">服务评价  <div style="color: #00B278;margin-left: 10px;"><dict-tag :options="dict.type.work_order_evaluation" :value="chakn.evaluation"/></div></div>
          <div style="padding: 20px;font-size: 14px;color: #161616;line-height: 30px;" v-if="isshoe == 1">
           {{chakn.evaluationContent ==null? '暂无数据' : chakn.evaluationContent}}
          </div>
          <div style="border-top:  1px solid #E6E6E6;font-size: 14px;color: #AAAAAA;" v-if="isshoe == 1">
                评价于 {{chakn.updateTime}}
          </div>
        </div>

        <div class="bortt tongty" style="justify-content: space-between; margin-top: 0;" >
           <p  v-if="chakn.serviceProgress == 0" v-hasPermi="['work:info:jdq']"   style="cursor: pointer;color: #28C529;" @click="daifeng(chakn)" ><span  >派单</span></span>  </p>
           <p  v-if="chakn.serviceProgress == 0" v-hasPermi="['work:info:jd']" style="cursor: pointer;" @click="jiedan(chakn)"><span  >接单</span></span>  </p>
            <p  v-if="chakn.serviceProgress == 1" v-hasPermi="['work:info:add']"   style="cursor: pointer;color: #28C529;" @click="tianxie(chakn)" ><span  >填写</span></span>  </p>
            <!-- <p style="cursor: pointer;" @click="handleUpdatef(chakn)"><span  >查看</span></span>  </p> -->
           <!-- <span @click="handleUpdatef(item)">查看</span> -->
           <p  v-hasPermi="['work:info:remove']" style="color:red;cursor: pointer;flex: 1;" @click="handleDelete(chakn)">删除  </p>
        </div>


      </div>
    </el-dialog>
     <el-dialog title="查看图片" :visible.sync="openc" width="640px" append-to-body class="boet">
      <el-carousel trigger="click" height="450px">
            <el-carousel-item  v-for = "(item,index) in  chakn.imgelis"  :key="index">
             <img :src="defaultSettings.urls + baseUrl+ item.url " alt="" style="width: 100%;height: 100%;">
            </el-carousel-item>
      </el-carousel>
     </el-dialog>


  </div>
</template>

<script>
// import 'videojs-flash'
import { listInfo, getInfo, delInfo, addInfo, updateInfo,jd,listStaffManageNoPage } from "@/api/system/info"
const defaultSettings = require("@/settings.js");
import download from 'downloadjs'
export default {
  name: "Repair",
    dicts: ['baoxiutype', 'work_order_evaluation', 'shelf_life', 'work_order_type', 'sys_yes_no', 'service_progress', 'order_placement'],
  data() {
    return {
      list:[{},{name:'嘉欣医疗用品有限公司',type:'2'},{name:'嘉欣医疗用品有限公司',type:'3'},{name:'嘉欣医疗用品有限公司',type:'4'}],
      gdicoa:require('../../../assets/images/gdicoa.png'),
      gdicob:require('../../../assets/images/gdicob.png'),
      gdicoc:require('../../../assets/images/gdicoc.png'),
      phone:require('../../../assets/images/phone.png'),
      wicoa:require('../../../assets/images/wicoa.png'),
      wicob:require('../../../assets/images/wicob.png'),
      wicoc:require('../../../assets/images/wicoc.png'),
      code:require('../../../assets/images/code.png'),
      openzx:false,
      openc:false,
      actjse:1,
      ite:{
        name:'嘉欣医疗用品有限公司',type:'1'
      },
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 物业报修表格数据
       infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      openz:false,
      houseInfoLise:[],
      defaultSettings:defaultSettings,
      baseUrl: process.env.VUE_APP_BASE_API,
      // 查询参数
      queryParams: {
                pageNum: 1,
                       pageSize: 10,
                       unitName: null,
                       provinceId: null,
                       province: null,
                       cityId: null,
                       city: null,
                       regionId: null,
                       region: null,
                       detailedAddress: null,
                       lon: null,
                       lat: null,
                       personName: null,
                       phonenumber: null,
                       sex: null,
                       type: null,
                       demand: null,
                       isSignature: null,
                       evaluation: null,
                       evaluationContent: null,
                       serviceProgress: null,
                       orderPlacement: null,
                       responsibleId: null,
                       responsibleName: null,
                       projectName: null,
                       shelfLife: null,
                       isCharge: null,
                       totalCost: null,
                       totalCostDx: null,
                       loginIp: null,
                       loginDate: null,
                       delFlag:'N'
      },
      // 表单参数
      form: {},
      formz: {},
      // 表单校验
      rules: {
        repairTime: [
                  { required: true, message: "不能为空", trigger: "blur" }
                ],
        repairDetails: [
                  { required: true, message: "不能为空", trigger: "blur" }
                ],
        maintenanceCategory: [
                  { required: true, message: "不能为空", trigger: "blur" }
                ],

        phoneNumber: [
                 { required: true, message: "不能为空", trigger: "blur" },
                 {
                   pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
                   message: "请输入正确的手机号码",
                    trigger: "blur"
                   }
               ],

      },
      rulesz: {
        responsibleName: [
                  { required: true, message: "不能为空", trigger: "blur" }
                ],

      },
      activeName:'first',
      videoState: false, // 视频播放状态
      poster:true,
      controls:true,
      videoData:{},
       player: null,
       isshoe:0,
       isnusle:1,
       staffManageList: [],
       tableMaxHeight:'200',
       isryr:true,
       chakn:{},
       buyTypeOptions:[]

    };
  },
  computed: {
    dynamicStyle() {
      return {
        overflow:'auto',
        height:  this.tableMaxHeight + 'px',
        paddingTop:'10px'
      }
    }
    },
  created() {
   if(process.env.VUE_APP_BASE_API == '/dev-api'){
     // console.log(process.env.VUE_APP_BASE_API)
     this.baseUrl = ''
   }else{
     this.baseUrl = process.env.VUE_APP_BASE_API
   }
    this.getList()
    this.getstaffManageList()

    console.log(this.$store.getters)
  window.onresize = () => {
  	      this.changeTableMaxHeight()
  	    }
  	    this.changeTableMaxHeight()
  },
  mounted() {
  	window.onresize = () => {
  	          this.changeTableMaxHeight()
  	        }
  	        this.changeTableMaxHeight()
  },
  beforeDestroy() {
      if (this.player) {
        this.player.dispose()
      }
    },
  methods: {
    iskeh(row){
     this.isshoe = row
    },
    getListhouvr() {
       listNoPage().then(response => {
         this.houseInfoLise  = response.data;
         this.houseInfoLise.filter(rou=>{
           this.selectDictLabel(this.buyTypeOptions ,rou.orderId)
          console.log(this.selectDictLabel(this.buyTypeOptions ,rou.orderId))
         })
       });
     },
    /** 查询岗位列表 */
    getList() {
      this.loading = true;
      listInfo(this.queryParams).then(response => {
        this.infoList  = response.rows;
        this.infoList.filter(rou=>{
          rou.isnum = false
          rou.isryr = true
          rou.rttie=rou.unitName.substr(0,2)
          this.selectDictLabel(this.buyTypeOptions ,rou.type)

        })

        this.total = response.total;
        this.loading = false;
      });
    },
    getstaffManageList(row){
      let bsdf={'staffCategory':2}
      listStaffManageNoPage().then(response => {
        this.staffManageList  = response.rows;
        // this.staffManageList.filrter(rout=>{
        //   rout.lable = rout.staffName + '<p>'
        // })
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 获取当前时间
    gettime(){
      let nowDate = new Date()
      				  let date = {
      				    year: nowDate.getFullYear(),
      				    month: nowDate.getMonth() + 1,
      				    date: nowDate.getDate()
      				  }

      				   if (parseInt(date.date) < 10) {
      				      date.date = '0' + date.date
      				    }
                  let nghe = date.year + '-' + date.month + '-' + date.date
      				  return nghe

    },
    cancelz() {
      this.openz = false;
    },
    gettimeg(){
      let nowDate = new Date()
                //获取当前时间并打印
                        var _this = this;
                        let sgse=''
                    　　let yy = new Date().getFullYear();
                    　　let mm = new Date().getMonth()+1;
                    　　let dd = new Date().getDate();
                    　　let hh = new Date().getHours();
                    　　let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
                    　　let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
                    　 　sgse = yy+'-'+mm+'-'+dd+' '+hh+':'+mf+':'+ss;
                    return  sgse


    },
    // 表单重置
    reset() {
      this.form = {
                     unitName: null,
                     provinceId: null,
                     province: null,
                     cityId: null,
                     city: null,
                     regionId: null,
                     region: null,
                     detailedAddress: null,
                     lon: null,
                     lat: null,
                     personName: null,
                     phonenumber: null,
                     sex: null,
                     type: null,
                     demand: null,
                     isSignature: null,
                     evaluation: null,
                     evaluationContent: null,
                     serviceProgress: null,
                     orderPlacement: null,
                     responsibleId: null,
                     responsibleName: null,
                     projectName: null,
                     shelfLife: null,
                     isCharge: null,
                     totalCost: null,
                     totalCostDx: null,
                     loginIp: null,
                     loginDate: null,
            };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
          this.ids = selection.map(item => item.orderId)
          this.single = selection.length!==1
          this.multiple = !selection.length
        },
     /** 新增按钮操作 */
        handleAdd() {
          this.reset()
          this.open = true
          this.title = "添加工单信息"
        },
        /** 修改按钮操作 */
        handleUpdate(row) {
          this.reset()
          const orderId = row.orderId || this.ids
          getInfo(orderId).then(response => {
            this.form = response.data
            this.open = true
            this.title = "查看工单信息"
          })
        },
    handleUpdatef(row){
      this.reset()
      const orderId = row.orderId || this.ids
      getInfo(orderId).then(response => {
        this.chakn = response.data
        if(response.data.personName != null && response.data.personName !=''){
          this.chakn.titke = response.data.personName.substr(0,1)
        }else{
          this.chakn.titke = '无'
        }
        if(this.chakn.workOrderFjXqList.length !=0){
          this.chakn.imgelis=[]
          this.chakn.workOrderFjXqList.filter(rou=>{
            if (!/\.(png|PNG|jpg|JPG)$/.test(rou.url)) {

                    }else{
                        // 图片格式
                      this.chakn.imgelis.push(rou)
                    }
            // if (!/\.(pdf|PDF|png|PNG|jpg|JPG)$/.test(rou.url)) {
            //         } else  {
            //         // pdf 格式


            //         }

          })
          console.log(this.chakn.imgelis)
        }

        this.actjse = this.chakn.serviceProgress - 0
        this.openzx = true
        // this.title = "查看工单信息"
      })

    },
    // 填写工单价格
    tianxie(row){
      this.$router.push({
        path: '/gongdanxq',
        query: {
        	'id':row.orderId,
        }
      })
    },
    // 接单
    jiedan(row){
      let snge={'orderId':row.orderId,'orderPlacement':2,'responsibleId':this.$store.getters.id,'responsibleName':this.$store.getters.nickName,'responsiblePhone':this.$store.getters.phonenumber}
      jd(snge).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.openz = false;
        this.getList();
      });
    },
    // 待分配
    daifeng(row){
       // 待分配
       // this.formz.maintenanceCategory = row.maintenanceCategory
       this.openz = true
       this.formz.orderId = row.orderId
       this.formz.orderPlacement = 1
    },
    // 待分配提交
    submitFormz(){
      this.$refs["formz"].validate(valid => {
        if (valid) {
          jd(this.formz).then(response => {
            this.$modal.msgSuccess("操作成功");
            this.openz = false;
            this.getList();
          });
        }
        })

    },
    // 下载文件
    downloadFile(row,item){
      // window.open(row, );
      if (!/\.(pdf|PDF|png|PNG|jpg|JPG)$/.test(row)) {
              // 不是pdf格式
               window.location.href = row;
              } else  {
              download(row)
              }


    },
    // 下载工单
    downloadFileg(row,item){
      // window.open(row, );
      // download(row)
     window.location.href = row;
    },
    // 预览文件
    yuangl(row){

      if (!/\.(pdf|PDF|png|PNG|jpg|JPG)$/.test(row)) {
              // 不是pdf格式
                window.open(
                  " https://view.officeapps.live.com/op/view.aspx?src=" + row,
                  "_blank"
                );
              } else  {
                console.log(this.chakn.imgelis)
                if (!/\.(png|PNG|jpg|JPG)$/.test(row)) {
                    // pdf 格式
                     window.open(row, '_blank');
                        }else{
                            // 图片格式
                          this.openc = true
                        }

              }

    },
    /** 提交按钮 */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
        if (valid) {
                  if (this.form.repairId != null) {
                    updateInfo(this.form).then(response => {
                      this.$modal.msgSuccess("修改成功");
                      this.open = false;
                      this.getList();
                    });
                  } else {
                    this.form.userId = this.$store.getters.userId
                    addInfo(this.form).then(response => {
                      this.$modal.msgSuccess("新增成功");
                      this.open = false;
                      this.getList();
                    });
                  }
                  }
      });
    },
    /** 删除按钮操作 */
        handleDelete(row) {
          const repairIds = row.orderId  || this.ids;
          delInfo(repairIds).then(response => {
            this.$modal.msgSuccess("删除成功");
            this.getList();
          });
        },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/info/export', {
        ...this.queryParams
      }, `info_${new Date().getTime()}.xlsx`)
    },

      handleClick(){

      },

    xuanse(val){
      console.log(val)
     this.formz.responsibleName = val.nickName
     this.formz.responsibleId = val.userId
     this.formz.responsiblePhone = val.phonenumber

    },
    itnegadd(item){
      this.form.houseId = item.houseId
      this.form.houseAddress = item.detailedAddress
      console.log(item)
    },
    // 获取屏幕高度
    showFilterForm () {
          this.filterActive = !this.filterActive
          this.changeTableMaxHeight()
        },

        changeTableMaxHeight () {
          let height = document.body.offsetHeight // 网页可视区域高度
          // if (this.filterActive) {
          //   this.tableMaxHeight = height - 320
          // } else {
            this.tableMaxHeight = height - 150
          // }
          console.log(height)
        }

  }
};
</script>
<style  lang="scss">
  .boet{
    .el-dialog__body{
      background-color: #f8f8f8;
    }
  }
  .xiahgw{
    .el-step__head.is-process{
      color:#00B278;
      border-color:#00B278;
    }
    .el-step__title.is-process{
      color:#00B278;
    }
    .el-step__head.is-finish{
      color:#00B278;
      border-color:#00B278;
    }
    .el-step__title.is-finish{
       color:#00B278;
    }
  }
  .ingsek{
   .el-carousel__container{
  	 height: 150px;
   }
   .el-carousel--horizontal{
     width: 100%;
   }
  }
  .unimg{
    .el-upload--picture-card{
      width:102px;
      height: 102px;
      line-height: 102px;
    }
  }

  .bnjle{
    margin-left: 20px;
  }
  .butt{
    .el-button--small{
      padding: 9px 23px !important;
      font-size: 14px;
    }
  }
  .casr{
    .el-tabs__item.is-active{
      color: #196CFF;
    }
    .el-tabs--card > .el-tabs__header .el-tabs__item{
      padding: 0  30px !important;
    }
  }
  .el-table .el-table__header-wrapper th{
    background-color:#F5F6F8;
    color:#343434;
  }
  .el-table{
    color:#343434;
  }
 // ::-webkit-scrollbar {
 //   width: 7px; /* 滚动条宽度 */
 // }
 // ::-webkit-scrollbar-track {
 //   background: #f1f1f1; /* 滚动条轨道背景色 */
 // }
 // ::-webkit-scrollbar-thumb {
 //  background: #999; /* 滚动条滑块背景色 */
 //   border-radius: 10px; /* 滚动条滑块圆角 */
 // }
 // ::-webkit-scrollbar-thumb:hover {
 //   // background: red; /* 滚动条滑块悬停时的背景色 */
 // }
</style>
<style scoped lang="scss">
  // .flexc{
  //   display: flex;
  //   justify-content: space-between;
  // }
  	.carlist{background: #FFFFFF;border-radius: 10px;margin-bottom: 14px;
  		.ctop{border-bottom: 1px solid #E5E5E5;padding:13px 12px;
  			.imgs{width: 20px;height: 21px;margin-right: 15px;}
  			.tit{font-size: 16px;color: #272727;font-weight: bold;margin-right: 7px;overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;}
  			.txt{font-weight: 500;font-size: 14px;
  				&.ca{color: #3565ED;}
  				&.cb{color: #FE5A0E;}
  				&.cc{color: #28C529;}
  			}
  			.txta{font-weight: 500;font-size: 14px;color: #AAAAAA;}
  			.num{font-size: 14px;color: #AAAAAA;}
  		}
  		.btn{height: 17px;border-radius: 9px;display: flex;align-items: center;justify-content: center;padding: 0 5px;font-size:12px;margin-right: 12px;
  			&.btna{border: 1px solid #06C770;color: #06C770;}
  			&.btnb{border: 1px solid #3565ED;color: #3565ED;}
  			&.btnc{border: 1px solid #FE5A0E;color: #FE5A0E;}
  			&.btnbga{border: 1px solid #0156FE;color: #3565ED;background: #DFEAFF;height: 18px;}
  			&.btnbgb{border: 1px solid #C1C1C1;color: #666666;background: #F1F1F1;height: 18px;}
  			&.btnbgc{border: 1px solid #FE5A0E;color:#FE5A0E;background:#FFEEE6;height: 18px;}
  		}
  		.clists{padding: 12px 12px 4px;
  			.clist{font-weight: 500;margin-bottom: 8px;
  	font-size: 13px;color: #272727;display: flex;line-height: 17px;
  				.tit{font-size: 14px;color: #AAAAAA;flex: 0 0 auto;margin-right: 8px;text-align-last: justify;}
  				.imgas{display: flex;align-items: center;flex-wrap: wrap;
  					image{width: 71px;height: 71px;margin-right: 15px;margin-top:4px;}
  				}
  			}
  			.w50{
  				.clist{width: 50%;}
  			}
  		}
  	}
  	.houselist{
  		.clists{padding-bottom: 1px !important;}
  		.clist{margin-bottom: 11px !important;}
  	}
  .goe{
    p{
      margin: 0;
      font-weight: 800;
      font-size: 16px;
      color: #161616;
      margin-top: 10px;
      margin-bottom: 3px;
      padding: 0 10px;
      overflow: hidden;
      text-overflow: ellipsis;
      display:-webkit-box; //作为弹性伸缩盒子模型显示。
      -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
      -webkit-line-clamp:1; //显示的行
    }
    p:nth-child(2){

    }
  }
  .ingwe{
    border: 2px solid #196CFF;
  }
  .renyuangs{
    p{
      font-weight: 500;
      font-size: 14px;
      color: #161616;
      padding: 0;
    }
  }
  .tongty{
    display: flex;
    align-items: center;
  }
  .bortt{
    border-top: 1px solid #DADADA;
    margin-top: 15px;

    p{
      margin: 0;
      font-weight: bold;
      font-size: 14px;
      color: #5F8BF4;
      width:50%;
      padding: 10px;
      text-align: center;
    }
  }
  .xiangque{
    overflow: hidden;
    text-overflow: ellipsis;
    display:-webkit-box; //作为弹性伸缩盒子模型显示。
    -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
    -webkit-line-clamp:2; //显示的行
    height: 46px;
  }
  .buzhout{
    margin-top: 20px;
    p{
      margin: 0;
      font-weight: bold;
      font-size: 16px;
      color: #666666;
      span{
        font-size: 14px;
        font-weight: 400;
      }
    }
    .p{
      font-weight: 500;
      font-size: 14px;
      color: #666666;
      margin-top: 10px;
      padding-left: 22px;
      overflow: hidden;
      text-overflow: ellipsis;
      display:-webkit-box; //作为弹性伸缩盒子模型显示。
      -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
      -webkit-line-clamp:1; //显示的行
      position: relative;

    }
    .p:before{
      position: absolute;
      display: inline-block;
      content: "";
      width: 1px;
      height: 30px;
      background-color: #C1C1C1;
      top:0;
      left:6px;
    }
    .ph{
      font-weight: 500;
      font-size: 14px;
      color: #666666;
      margin-top: 10px;
      padding-left: 22px;
      overflow: hidden;
      text-overflow: ellipsis;
      display:-webkit-box; //作为弹性伸缩盒子模型显示。
      -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
      -webkit-line-clamp:1; //显示的行
      position: relative;

    }
    .pb:before{
      			display: inline-block;
      			content: "";
      			width: 12px;
      			height: 12px;
      			border-radius: 50%;
            background-color: #C1C1C1;
            margin-right: 10px;
    }
    .jisdei{
      position: relative;
    }
    .jisdei:before{
      position: absolute;
      display: inline-block;
      content: "";
      width: 1px;
      height: 98px;
      background-color: #C1C1C1;
      top:0;
      left:6px;
      // margin-right: 10px;
    }
    .acft{
      color: #0156FE ;
    }
    .acft:before{
      display: inline-block;
        content: "";
                  background:url("../../../assets/images/icon_htgl_lc_selected.png") no-repeat;
                  background-size: 12px 12px;
            			width: 12px;
            			height: 12px;
                  margin-right: 10px;
    }

  }
  .het{
    height: 450px;
  }
.work{}
.flex1{flex: 1;}
.over{overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.flexc{display: flex;align-items: center;}
.co9B{color: #9B9B9B !important;width: 90%;}
.mb8{margin-bottom: 18px;}
	.worklist{background: #FFFFFF;border-radius: 10px;overflow: hidden;margin-bottom: 12px;
		.listtop{display: flex;padding: 12px 12px 8px;
			.name{width: 35px;height: 35px;border-radius: 50%;font-weight: bold;text-align: center;line-height: 35px;flex: 0 0 auto;margin-right: 11px;font-size: 13px;background: #E4F2FA;color: #009FE8;
				&.bga{background: #ECF9F3;color: #00B278;}
				&.bgb{background: #FFF4E1;color: #FFB132;}
				&.bgc{background: #E0E0F1;color: #AF88B8;}

			}
			.namea{font-weight: bold;font-size: 15px;color: #222327;margin-bottom: 5px;}
			.phone{width: 30px;height: 30px;margin-left: 11px;flex: 0 0 auto;}
		}
		.chtop{font-weight: 500;font-size: 12px;min-height: 40px;padding-left: 13px;box-sizing: border-box;padding: 8px 13px 8px 13px;color: #999999;
			text{margin-right: 18rpx;color: #161616;}
		}
		.chstep{padding: 0 12px 6px;
			.imgs{width: 13px;height: 14px;display: flex;align-items: center;justify-content: center;margin-right: 6px;flex:0 0 auto;
				.imga{width: 13px;height: 13px;}
				.imgb{width: 13px;height: 14px;}
			}
			.tit{font-weight: 500;font-size: 13px;color: #B5B5B5;flex: 0 0 auto;}
			.txt{font-weight: 500;font-size: 13px;color: #222327;}
			.code{width: 18rpx;height: 11px;margin-left: 7px;}
		}
	}
	.worklist  .uni-collapse{background: #F4F7FF;border-top: 1px solid #E6E6E6;}
	.worklist .uni-collapse-item__wrap{background: #F4F7FF;}
	.notit{font-weight: 500;font-size: 13px;color: #222327;}
	.adrlist{margin-right: 36rpx;min-width: 70px;display: flex;align-items: center;margin-bottom: 5px;}
		.noico{width: 10px;height: 13px;margin-right: 6px;display: flex;align-items: center;justify-content: center;
			.imga{width: 10px;height: 11px;}
			.imgb{width: 10px;height: 12px;}
			.imgc{width: 9px;height: 14px;}
		}
  .co77{
   color: #779AF9 !important;
  }
  .co06{
    color: #AF88B8 !important;
  }
  .cofb{
    color: #FFA20C !important;
  }
  .coaf{
    color: #5470C6 !important;
  }
  .coafs{
    color: #00B278 !important;
  }
  .coafss{
    color: #FF6969 !important;
  }

  .baae{
    display: flex;
    padding: 20px;
    p{
      margin: 0;
      font-size: 16px;
      color: #AAAAAA;
      margin-right: 10px;
    }
    .activeq{
      font-weight: bold;
      font-size: 16px;
      color: #161616;
    }
  }
  .bsers{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    padding-bottom: 20px;
    padding-left: 0;
    img{
      margin-right: 10px;
    }
    div{
       display: flex;
       align-items: center;
       margin-left: 20px;
    }

    p{
       margin: 0;
       font-weight: 500;
       font-size: 14px;
       color: #161616;
       display: flex;
       align-items: center;
       font-family: PingFang SC;
       font-weight: 500;
       font-size: 16px;

    }
  }
  </style>


