<template>
  <div class="content-main" id="protectedItems">
    <div style="display: table; margin-right: 10px; margin-left: auto">
      <el-button
        v-if="$route.query.shzt != 'add'"
        type="primary"
        @click="checkProblem(1)"
        >问题处理过程({{ formData.solveCount }})</el-button
      >
      <el-button
        v-if="$route.query.shzt != 'add'"
        type="primary"
        @click="checkProblem(2)"
        >追加问题描述({{ formData.problemCount }})</el-button
      >
    </div>
	<div id="pdfId">
    <div class="ywborderS">
      <div style="text-align: center; font-size: 22px; font-weight: 600">
        系统数据删改申请表
      </div>
      <div style="margin-left: auto; display: table">
        编号:{{ formData.orderNumber }}
      </div>
    </div>
    <el-form
      ref="formData"
      :rules="rules"
      :model="formData"
      inline
      class="demo-ruleForm"
    >
      <el-row>
        <table class="table-b table-el-form">
          <colgroup v-if="formData.scope == 2 && formData.cityOpinion != null">
            <col colspan="2" style="width: 50px" />
          </colgroup>
          <tr>
            <td class="songFont" colspan="2">
              <span style="color: red">*</span>申请单位
            </td>
            <td class="songFont">
              <el-form-item prop="applyOrgName">
                <span class="songFont">{{ formData.applyOrgName }}</span>
              </el-form-item>
            </td>
            <td><span style="color: red">*</span>申请日期</td>
            <td>
              <el-form-item prop="applyTime">
                <el-date-picker
                  disabled
                  clearable
                  v-model="formData.applyTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <!-- <td class="songFont">系统名称</td>
           <td>
             <el-form-item prop="webSysName">
               <el-select
                :disabled="disabled"
                 clearable
                 v-model="formData.webSysName"
                 placeholder="请选择系统名称"
               >
                 <el-option
                   v-for="item in systemNameOptions"
                   :key="item.name"
                   :label="item.name"
                   :value="item.name"
                 ></el-option>
               </el-select>
             </el-form-item>
           </td> -->
            <td colspan="2"><span style="color: red">*</span>申请人</td>
            <td>
              <el-form-item prop="applyUsername">
                <el-input
                  disabled
                  clearable
                  v-model="formData.applyUsername"
                ></el-input>
              </el-form-item>
            </td>
            <td><span style="color: red">*</span>申请人联系方式</td>
            <td>
              <el-form-item prop="applyUserPhone">
                <el-input
                  disabled
                  clearable
                  v-model="formData.applyUserPhone"
                ></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td colspan="2"><span style="color: red">*</span>数据所属范围</td>
            <td>
              <el-form-item prop="scope">
                <el-radio-group v-model="formData.scope" disabled>
                  <el-radio :label="2">市级数据</el-radio>
                  <el-radio :label="1">区级数据</el-radio>
                </el-radio-group>
              </el-form-item>
            </td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td colspan="2">
              <span style="color: red">*</span>数据删改需求描述
            </td>
            <td colspan="3">
              <el-form-item prop="requirementDescription">
                <el-input
                  disabled
                  type="textarea"
                  clearable
                  :autosize="{ minRows: 2, maxRows: 20 }"
                  maxlength="300"
                  v-model="formData.requirementDescription"
                  show-word-limit
                ></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td colspan="2"><span style="color: red">*</span>数据删改原因</td>
            <td colspan="3">
              <el-form-item prop="reason">
                <el-input
                  disabled
                  type="textarea"
                  clearable
                  :autosize="{ minRows: 2, maxRows: 20 }"
                  maxlength="300"
                  v-model="formData.reason"
                  show-word-limit
                ></el-input>
              </el-form-item>
            </td>
          </tr>
          <tr>
            <td colspan="2">附件</td>
            <td colspan="3" style="text-align: left">
              <el-form-item prop="" label-width="0px">
                <!-- <el-upload
                  disabled
                  :on-success="handleSuccess"
                  class="upload-demo"
                  :action="fileUrl"
                  :on-preview="handlePreview"
                  :on-remove="handleRemove"
                  :before-remove="beforeRemove"
                  :file-list="fileList"
                >
                </el-upload> -->
                <div v-for="item in fileList" :key="item.id">
                  <span>{{ item.name }}</span>
                  <el-button
                    v-if="
                      ['png', 'jpg', 'jpeg', 'bmp', 'pdf'].includes(
                        item.link.split('.')[item.link.split('.').length - 1]
                      ) && disabled
                    "
                    type="text"
                    size="small"
                    @click="YlPic(item.link)"
                    >预览</el-button
                  >
                  <el-button
                    v-show="disabled"
                    type="text"
                    size="small"
                    @click="XzPic(item.id)"
                    >下载</el-button
                  >
                </div>
              </el-form-item>
            </td>
          </tr>
          <!-- <tr>
           <td>申请人</td>
           <td>
             <el-form-item prop="sqr">
               <el-input
                 :disabled='disabled'
                 clearable
                 v-model="formData.sqr"
               ></el-input>
             </el-form-item>
           </td>
           <td>申请日期</td>
           <td>
             <el-form-item prop="sqrq">
               <el-date-picker
                :disabled="true"
                 clearable
                 v-model="formData.sqrq"
                 type="date"
                 value-format="yy-MM-dd"
               ></el-date-picker>
             </el-form-item>
           </td>
         </tr> -->
          <template v-if="formData.leaderOpinion != null">
            <!-- $route.query.shzt != 'add' &&
              (($route.query.type != 'CK' && $route.query.shzt > '92000002') ||
                ($route.query.type == 'CK' && $route.query.shzt >= '92000002')) -->
            <!-- 审核开始 -->
            <!-- 盖章信息 -->
            <tr>
              <td colspan="2"><span style="color: red">*</span>主管领导意见</td>
              <el-form-item prop="leaderOpinion">
                <el-radio-group v-model="formData.leaderOpinion" disabled>
                  <el-radio :label="1">同意</el-radio>
                  <el-radio :label="0">不同意</el-radio>
                </el-radio-group>
              </el-form-item>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>审核人</td>
              <td>
                <el-form-item prop="leaderUsername">
                  <el-input
                    disabled
                    clearable
                    v-model="formData.leaderUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td rowspan="2" colspan="2">
                <div style="text-align: left; align-items: center">盖章</div>
                <div style="margin: 0 100px" id="datadeletAndUp"></div>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>审核日期</td>
              <td>
                <el-form-item prop="leaderAuditDate">
                  <el-date-picker
                    clearable
                    :disabled="true"
                    v-model="formData.leaderAuditDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
            <!-- 审核结束 -->
          </template>
          <!-- 区级数据区粮办审核流程 -->
          <template v-if="formData.scope == 1 && formData.areaOpinion != null">
            <tr>
              <td colspan="5" style="font-weight: bold">区粮办审核意见</td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>审核意见</td>
              <td colspan="3">
                <el-form-item prop="areaOpinion">
                  <el-radio-group
                    v-model="formData.areaOpinion"
                    :disabled="$route.query.type != 'sh'"
                  >
                    <el-radio :label="1">同意</el-radio>
                    <el-radio :label="0">不同意</el-radio>
                    <el-radio :label="-1">驳回</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>审核意见说明</td>
              <td colspan="3">
                <el-form-item prop="areaOpinionRemark">
                  <el-input
                    :disabled="$route.query.type != 'sh'"
                    type="textarea"
                    clearable
                    :autosize="{ minRows: 2, maxRows: 20 }"
                    maxlength="300"
                    v-model="formData.areaOpinionRemark"
                    show-word-limit
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>审核人</td>
              <td>
                <el-form-item prop="areaAuditUsername">
                  <el-input
                    :disabled="true"
                    clearable
                    v-model="formData.areaAuditUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>审核日期</td>
              <td>
                <el-form-item prop="areaAuditDate">
                  <el-date-picker
                    :disabled="true"
                    clearable
                    v-model="formData.areaAuditDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>
          <!-- 市级数据市局审核流程 -->
          <!-- 第一步 市储备处 -->
          <template v-if="formData.cityOpinion != null">
            <tr>
              <td colspan="5" style="font-weight: bold">审核意见</td>
            </tr>
            <tr>
              <td rowspan="3" style="font-weight: bold">第一步市局储备处</td>
              <td><span style="color: red">*</span>审核意见</td>
              <td colspan="3">
                <el-form-item prop="cityOpinion">
                  <el-radio-group
                    v-model="formData.cityOpinion"
                    :disabled="$route.query.type != 'shone'"
                  >
                    <el-radio :label="1">同意</el-radio>
                    <el-radio :label="2">不同意</el-radio>
                    <el-radio :label="-1">驳回</el-radio>
                    <el-radio :label="0">征求储备公司意见</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核意见说明</td>
              <td colspan="3">
                <el-form-item prop="cityOpinionRemark">
                  <el-input
                    :disabled="$route.query.type != 'shone'"
                    type="textarea"
                    clearable
                    :autosize="{ minRows: 2, maxRows: 20 }"
                    maxlength="300"
                    v-model="formData.cityOpinionRemark"
                    show-word-limit
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核人</td>
              <td>
                <el-form-item prop="cityAuditUsername">
                  <el-input
                    :disabled="true"
                    clearable
                    v-model="formData.cityAuditUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>审核日期</td>
              <td>
                <el-form-item prop="cityAuditDate">
                  <el-date-picker
                    :disabled="true"
                    clearable
                    v-model="formData.cityAuditDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>
          <!-- 第二步 储备公司意见 -->
          <template v-if="formData.storageOpinion != null">
            <tr>
              <td rowspan="3" style="font-weight: bold">第二步:市储备公司</td>
              <td><span style="color: red">*</span>审核意见</td>
              <td colspan="3">
                <el-form-item prop="storageOpinion">
                  <el-radio-group
                    v-model="formData.storageOpinion"
                    :disabled="$route.query.type != 'shtwo'"
                  >
                    <el-radio :label="1">同意</el-radio>
                    <el-radio :label="0">不同意</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核意见说明</td>
              <td colspan="3">
                <el-form-item prop="storageOpinionRemark">
                  <el-input
                    :disabled="$route.query.type != 'shtwo'"
                    type="textarea"
                    clearable
                    :autosize="{ minRows: 2, maxRows: 20 }"
                    maxlength="300"
                    v-model="formData.storageOpinionRemark"
                    show-word-limit
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核人</td>
              <td>
                <el-form-item prop="storageAuditUsername">
                  <el-input
                    :disabled="true"
                    clearable
                    v-model="formData.storageAuditUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>审核日期</td>
              <td>
                <el-form-item prop="storageAuditDate">
                  <el-date-picker
                    :disabled="true"
                    clearable
                    v-model="formData.storageAuditDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>
          <!-- 第三步 市储备处二次确认 -->
          <template v-if="formData.citySecondOpinion != null">
            <tr>
              <td rowspan="3" style="font-weight: bold">第三步:市局储备处</td>
              <td><span style="color: red">*</span>审核意见</td>
              <td colspan="3">
                <el-form-item prop="storageOpinion" style="width: 350px">
                  <el-radio-group
                    v-model="formData.citySecondOpinion"
                    :disabled="$route.query.type != 'shthree'"
                  >
                    <el-radio :label="1">同意</el-radio>
                    <el-radio :label="0">不同意</el-radio>
                    <el-radio :label="2">征求其他处室意见</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item
                  prop="officeOrgCode"
                  style="width: 250px"
                  :rules="[
                    {
                      required: formData.citySecondOpinion == 2,
                      message: '请选择处室',
                      trigger: 'change',
                    },
                  ]"
                >
                  <!-- <span>{{formData.webSysName}}</span> -->
                  <el-select
                    :disabled="$route.query.type != 'shthree'"
                    clearable
                    v-model="formData.officeOrgCode"
                    placeholder="请选择处室"
                  >
                    <el-option
                      v-for="item in officeOrgCodeOptions"
                      :key="item.deptCode"
                      :label="item.deptName"
                      :value="item.deptCode"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核意见说明</td>
              <td colspan="3">
                <el-form-item prop="citySecondOpinionRemark">
                  <el-input
                    :disabled="$route.query.type != 'shthree'"
                    type="textarea"
                    clearable
                    :autosize="{ minRows: 2, maxRows: 20 }"
                    maxlength="300"
                    v-model="formData.citySecondOpinionRemark"
                    show-word-limit
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核人</td>
              <td>
                <el-form-item prop="citySecondAuditUsername">
                  <el-input
                    :disabled="true"
                    clearable
                    v-model="formData.citySecondAuditUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>审核日期</td>
              <td>
                <el-form-item prop="citySecondAuditDate">
                  <el-date-picker
                    :disabled="true"
                    clearable
                    v-model="formData.citySecondAuditDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>

          <!-- 第四步 其他处室意见 -->
          <template v-if="formData.officeOpinion != null">
            <tr>
              <td rowspan="3" style="font-weight: bold">
                第四步:{{ formData.officeOrgName }}
              </td>
              <td><span style="color: red">*</span>审核意见</td>
              <td colspan="3">
                <el-form-item prop="officeOpinion">
                  <el-radio-group
                    v-model="formData.officeOpinion"
                    :disabled="$route.query.type != 'shfour'"
                  >
                    <el-radio :label="1">同意</el-radio>
                    <el-radio :label="0">不同意</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核意见说明</td>
              <td colspan="3">
                <el-form-item prop="officeOpinionRemark">
                  <el-input
                    :disabled="$route.query.type != 'shfour'"
                    type="textarea"
                    clearable
                    :autosize="{ minRows: 2, maxRows: 20 }"
                    maxlength="300"
                    v-model="formData.officeOpinionRemark"
                    show-word-limit
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核人</td>
              <td>
                <el-form-item prop="officeAuditUsername">
                  <el-input
                    :disabled="true"
                    clearable
                    v-model="formData.officeAuditUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>审核日期</td>
              <td>
                <el-form-item prop="officeAuditDate">
                  <el-date-picker
                    :disabled="true"
                    clearable
                    v-model="formData.officeAuditDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>

          <!-- 第五步 市储备处三次确认 -->
          <template v-if="formData.cityThirdOpinion != null">
            <tr>
              <td rowspan="3" style="font-weight: bold">第五步:市局储备处</td>
              <td><span style="color: red">*</span>审核意见</td>
              <td colspan="3">
                <el-form-item prop="cityThirdOpinion" style="width: 350px">
                  <el-radio-group
                    v-model="formData.cityThirdOpinion"
                    :disabled="$route.query.type != 'shfive'"
                  >
                    <el-radio :label="1">同意</el-radio>
                    <el-radio :label="0">不同意</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核意见说明</td>
              <td colspan="3">
                <el-form-item prop="cityThirdOpinionRemark">
                  <el-input
                    :disabled="$route.query.type != 'shfive'"
                    type="textarea"
                    clearable
                    :autosize="{ minRows: 2, maxRows: 20 }"
                    maxlength="300"
                    v-model="formData.cityThirdOpinionRemark"
                    show-word-limit
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td><span style="color: red">*</span>审核人</td>
              <td>
                <el-form-item prop="cityThirdAuditUsername">
                  <el-input
                    :disabled="true"
                    clearable
                    v-model="formData.cityThirdAuditUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>审核日期</td>
              <td>
                <el-form-item prop="cityThirdAuditDate">
                  <el-date-picker
                    :disabled="true"
                    clearable
                    v-model="formData.cityThirdAuditDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>

          <!-- 受理情况 -->
          <template v-if="formData.acceptStatus != null">
            <tr>
              <td colspan="5" style="font-weight: bold">受理情况</td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>受理人员</td>
              <td>
                <el-form-item prop="acceptUsername">
                  <el-input
                    :disabled="$route.query.type != 'sl'"
                    clearable
                    v-model="formData.acceptUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>受理日期</td>
              <td>
                <el-form-item prop="acceptDate">
                  <el-date-picker
                    :disabled="$route.query.type != 'sl'"
                    clearable
                    v-model="formData.acceptDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>
          <template v-if="formData.solveStatus != null">
            <!-- 解决情况 -->
            <tr>
              <td colspan="5" style="font-weight: bold">解决情况</td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>系统名称</td>
              <td colspan="3">
                <el-form-item prop="systemName">
                  <!-- <span>{{formData.webSysName}}</span> -->
                  <el-select
                    multiple
                    :disabled="$route.query.type != 'jj'"
                    clearable
                    v-model="formData.systemName"
                    placeholder="请选择系统名称"
                  >
                    <el-option
                      v-for="item in systemNameOptions"
                      :key="item.name"
                      :label="item.name"
                      :value="item.name"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>问题类型</td>
              <td colspan="3">
                <el-form-item prop="problemType">
                  <!-- <span>{{formData.problemType}}</span> -->
                  <el-select
                    multiple
                    :disabled="$route.query.type != 'jj'"
                    clearable
                    v-model="formData.problemType"
                    placeholder="请选择问题类型"
                  >
                    <el-option
                      v-for="item in problemTypeOptions"
                      :key="item.code"
                      :label="item.name"
                      :value="item.name"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>处理方式</td>
              <td colspan="3">
                <el-form-item prop="solveType">
                  <!-- <span>{{formData.solveType}}</span> -->
                  <el-select
                    multiple
                    :disabled="$route.query.type != 'jj'"
                    clearable
                    v-model="formData.solveType"
                    placeholder="请选择处理方式"
                  >
                    <el-option
                      v-for="item in solveTypeOptions"
                      :key="item.code"
                      :label="item.name"
                      :value="item.name"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>处理结果</td>
              <td colspan="3">
                <el-form-item prop="solveRes">
                  <!-- <span>{{formData.solveRes}}</span> -->
                  <el-input
                    :disabled="$route.query.type != 'jj'"
                    type="textarea"
                    :autosize="{ minRows: 2, maxRows: 20 }"
                    maxlength="300"
                    show-word-limit
                    clearable
                    v-model="formData.solveRes"
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2">附件</td>
              <td colspan="3" style="text-align: left">
                <el-upload
                  v-if="$route.query.type == 'jj'"
                  :on-success="handleSuccessJJ"
                  class="upload-demo"
                  :action="fileUrl"
                  :on-preview="handlePreviewJJ"
                  :on-remove="handleRemoveJJ"
                  :before-remove="beforeRemoveJJ"
                  :file-list="fileListBL"
                >
                  <el-button
                    type="primary"
                    v-show="$route.query.type == 'jj'"
                    size="small"
                    class="iconfont icon"
                    >上传</el-button
                  >
                </el-upload>
                <div v-for="item in fileListBL" :key="item.id" v-else>
                  <span>{{ item.name }}</span>
                  <el-button
                    v-if="
                      ['png', 'jpg', 'jpeg', 'bmp', 'pdf'].includes(
                        item.link.split('.')[item.link.split('.').length - 1]
                      )
                    "
                    type="text"
                    size="small"
                    @click="YlPic(item.link)"
                    >预览</el-button
                  >
                  <el-button type="text" size="small" @click="XzPic(item.id)"
                    >下载</el-button
                  >
                </div>
                <!-- <span>{{formData.solveFile}}</span> -->
                <!-- <el-form-item prop="">
                 <el-upload
                   :on-success="handleSuccess"
                   class="upload-demo"
                   :action="fileUrl"
                   :on-preview="handlePreview"
                   :on-remove="handleRemove"
                   :before-remove="beforeRemove"
                   :file-list="fileList"
                 >
                   <el-button
                     type="primary"
                     size="small"
                     class="iconfont icon"
                     >上传</el-button
                   >
                 </el-upload> -->
                <!-- </el-form-item> -->
              </td>
            </tr>
            <tr>
              <td colspan="2">备注</td>
              <td colspan="3">
                <el-form-item prop="solveRemark">
                  <el-input
                    :disabled="$route.query.type != 'jj'"
                    type="textarea"
                    :rows="2"
                    clearable
                    v-model="formData.solveRemark"
                  ></el-input>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>运维人员</td>
              <td>
                <el-form-item prop="solveUsername">
                  <!-- <span>{{formData.solvePerson}}</span> -->
                  <el-select
                    clearable
                    multiple
                    :disabled="$route.query.type != 'jj'"
                    v-model="formData.solveUsername"
                    placeholder="请选择运维人员"
                  >
                    <el-option
                      v-for="item in solvePersonOptions"
                      :key="item.dictCode"
                      :label="item.dictName"
                      :value="item.dictName"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>解决日期</td>
              <td>
                <el-form-item prop="scnx">
                  <!-- <span>{{formData.solveDate}}</span> -->
                  <el-date-picker
                    :disabled="$route.query.type != 'jj'"
                    clearable
                    v-model="formData.solveDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>

          <!-- 申请人员确认 -->
          <template v-if="formData.applyVerify != null">
            <tr>
              <td colspan="5">
                <span style="font-weight: bold">确认完成情况</span>
              </td>
              <!-- <td colspan="3">
               <el-form-item prop="htsl">
                 <el-input
                   type="textarea"
                   :rows="2"
                   clearable
                   v-model="formData.htsl"
                 ></el-input>
               </el-form-item>
             </td> -->
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>申请人确认</td>
              <td colspan="3">
                <el-form-item prop="applyVerify">
                  <el-radio-group v-model="formData.applyVerify" disabled>
                    <el-radio :label="1">已完成</el-radio>
                    <el-radio :label="0">未完成</el-radio>
                  </el-radio-group>
                </el-form-item>
              </td>
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>申请人</td>
              <td>
                <el-form-item prop="applyVerifyUsername">
                  <el-input
                    disabled
                    clearable
                    v-model="formData.applyVerifyUsername"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>确认日期</td>
              <td>
                <el-form-item prop="applyVerifyDate">
                  <el-date-picker
                    disabled
                    clearable
                    v-model="formData.applyVerifyDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>

          <template v-if="formData.icVerify != null">
            <!-- 信息中心确认 -->
            <tr>
              <td colspan="2"><span style="color: red">*</span>信息中心确认</td>
              <!-- <td colspan="3"> -->
              <el-form-item prop="icVerify">
                <el-radio-group
                  v-model="formData.icVerify"
                  :disabled="$route.query.type != 'qr'"
                >
                  <el-radio :label="1">已完成</el-radio>
                  <el-radio :label="0">未完成</el-radio>
                </el-radio-group>
              </el-form-item>
              <!-- </td> -->
            </tr>
            <tr>
              <td colspan="2"><span style="color: red">*</span>信息中心人员</td>
              <td>
                <el-form-item prop="icVerifyUsername">
                  <el-input
                    :disabled="$route.query.type != 'qr'"
                    clearable
                    v-model="formData.icVerifyUsername"
                    placeholder="请输入信息中心人员"
                  ></el-input>
                </el-form-item>
              </td>
              <td><span style="color: red">*</span>确认日期</td>
              <td>
                <el-form-item prop="icVerifyDate">
                  <el-date-picker
                    :disabled="true"
                    clearable
                    v-model="formData.icVerifyDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
              </td>
            </tr>
          </template>
        </table>
      </el-row>
    </el-form>
	</div>
    <span class="detail-footer">
      <el-button
        type="primary"
        class="iconfont iconqianzhang"
        :loading="stateLoading"
        v-show="$route.query.type == 'gz'"
        @click="stamp"
        >盖章</el-button
      >
      <el-button
        type="primary"
        @click="signNotDo"
        v-show="$route.query.type == 'gz'"
        size="small"
        class="iconfont iconbohui"
        >驳回</el-button
      >
      <el-button
        v-if="$route.query.type == 'zj'"
        @click="addSolve"
        type="primary"
        class="iconfont iconadd"
        >追加问题处理</el-button
      >
      <el-button
        v-if="
          $route.query.shzt == 'add' ||
          $route.query.type == 'edit' ||
          $route.query.type.indexOf('sh') > -1 ||
          $route.query.type == 'qr'
        "
        @click="saveSubmit()"
        type="primary"
        class="iconfont icontijiao"
        >提交</el-button
      >
      <el-button
        v-if="$route.query.type == 'sl'"
        @click="saveSubmit()"
        type="primary"
        class="iconfont iconqueren"
        >受理</el-button
      >
      <el-button
        v-if="$route.query.type == 'jj'"
        @click="saveSubmit()"
        type="primary"
        class="iconfont iconqueren"
        >解决</el-button
      >
	  <el-button
	  v-if="$route.query.type =='dc'"
	    type="primary"
	    class="iconfont icondaochu11"
	    @click="exportPdf"
	    >导出</el-button
	  >
      <el-button @click="returnList" type="primary" class="iconfont iconfanhui"
        >返回</el-button
      >
    </span>
    <!-- 追加问题描述弹窗 -->
    <el-dialog
      title="追加问题处理"
      :visible.sync="dialogVisible"
      width="40%"
      ref="domPrint"
      :close-on-click-modal="false"
      :show-close="false"
    >
      <el-form
        ref="addFrom"
        :rules="addrule"
        :model="addFrom"
        label-width="70px"
        label-position="left"
      >
        <el-row>
          <el-col :span="24">
            <el-form-item prop="solveDesc" label-width="20px" label=" ">
              <el-input
                type="textarea"
                :autosize="{ minRows: 2, maxRows: 20 }"
                maxlength="300"
                show-word-limit
                clearable
                v-model="addFrom.solveDesc"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="附件">
            <el-upload
              :on-success="handleSuccessZJ"
              class="upload-demo"
              :action="fileUrl"
              :on-preview="handlePreviewZJ"
              :on-remove="handleRemoveZJ"
              :before-remove="beforeRemoveZJ"
              :file-list="fileList1"
            >
              <el-button type="primary" size="small" class="iconfont icon"
                >上传</el-button
              >
            </el-upload>
          </el-form-item>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="solveAuthor" label="填写人">
              <el-input clearable v-model="addFrom.solveAuthor"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item class="el-data-width" prop="writeDate" label="日期">
              <el-date-picker
                :disabled="true"
                clearable
                v-model="addFrom.writeDate"
                type="date"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
              <!-- <el-input
                 clearable
                 v-model="addFrom.writeDate"
               ></el-input> -->
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer no-print">
        <el-button
          type="primary"
          size="small"
          class="iconfont icontijiao"
          @click="AddProblomSubmit"
          >提交</el-button
        >
        <el-button
          type="primary"
          size="small"
          class="iconfont iconquxiao"
          @click="dialogVisible = false"
          >取消</el-button
        >
      </div>
    </el-dialog>
    <!--追加问题描述---查看 和问题处理过程--查看 -->
    <el-dialog
      :title="ProbelmName"
      :visible.sync="dialogCKVisible"
      width="40%"
      :close-on-click-modal="false"
      :show-close="false"
    >
      <div style="height: 50vh; overflow: auto">
        <div
          v-if="ProbelmName == '追加问题描述'"
          class="box-pro"
          v-for="item in problemList"
        >
          <div style="display: flex">
            <div style="margin-right: 20px">{{ item.writeDate }}</div>
            <div>{{ item.problemAuthor }}</div>
          </div>
          <div>{{ item.problemDesc }}</div>
          <div>
            <div v-for="items in item.problemFileList" :key="items.id">
              <span>{{ items.name }}</span>
              <el-button
                v-if="
                  ['png', 'jpg', 'jpeg', 'bmp', 'pdf'].includes(
                    items.link.split('.')[items.link.split('.').length - 1]
                  )
                "
                type="text"
                size="small"
                @click="YlPic(items.link)"
                >预览</el-button
              >
              <el-button type="text" size="small" @click="XzPic(items.id)"
                >下载</el-button
              >
              <!-- <el-button  type="text" size="small" @click="XzPic(items.id)">
                {{items.name}}</el-button> -->
            </div>
          </div>
          <!-- <a :href="item.problemFile">{{item.problemFile}}</a> -->
        </div>
        <div
          v-if="ProbelmName == '问题处理过程'"
          class="box-pro"
          v-for="item in SolveList"
        >
          <div style="display: flex">
            <div style="margin-right: 20px">{{ item.writeDate }}</div>
            <div>{{ item.solveAuthor }}</div>
          </div>
          <div>{{ item.solveDesc }}</div>
          <div>
            <div v-for="items in item.solveFileList" :key="items.id">
              <span>{{ items.name }}</span>
              <el-button
                v-if="
                  ['png', 'jpg', 'jpeg', 'bmp', 'pdf'].includes(
                    items.link.split('.')[items.link.split('.').length - 1]
                  )
                "
                type="text"
                size="small"
                @click="YlPic(items.link)"
                >预览</el-button
              >
              <el-button type="text" size="small" @click="XzPic(items.id)"
                >下载</el-button
              >
              <!-- <el-button  type="text" size="small" @click="XzPic(items.id)">
                {{items.name}}</el-button> -->
            </div>
          </div>
          <!-- <a :href="item.solveFile">{{item.solveFile}}</a> -->
        </div>
      </div>
      <div
        slot="footer"
        style="text-align: center"
        class="dialog-footer no-print"
      >
        <el-button
          type="primary"
          size="small"
          class="iconfont iconquxiao"
          @click="dialogCKVisible = false"
          >关闭</el-button
        >
      </div>
    </el-dialog>
    <!-- //签章弹窗组件 -->
    <sealDialog
      ref="sealDialog"
      sealId="datadeletAndUp"
      @sealTodo="sealTodo"
      @sealError="sealError"
    ></sealDialog>
  </div>
</template>

<script>
import {
  findByIds,
  findYWRYPDictCode,
} from "@/api/operationServices/operationOrder/index.js";
// import upload from "@/components/upload";
import { FileApi, files } from "@/api/index";
import sealDialog from "@/components/sealDialog/index.vue";
import {
  dataReviseOrderAdd,
  dataReviseOrderUpdate,
  dataReviseOrderInfo,
  addProblem,
  addSolve,
  listProblem,
  listSolve,
  findByOrgCodes,
} from "@/api/operationServices/datadeletAndUp/index.js";
import { getCodeName } from "@/utils/statusList.js";
import htmlToPdf from "@/utils/htmlToPdf";

function checkPhone(rule, value, callback) {
  var val = value && value.trim();
  if (/^1\d{10}$/.test(val)) {
    callback();
  } else {
    callback(new Error("请按正确手机号码格式填写"));
  }
}
export default {
  components: {
    sealDialog,
  },
  data() {
    return {
      officeOrgCodeOptions: [],
      state: "",
      stateLoading: false,
      disabled: false, //申请人填写信息是否禁用
      SHdisabled: false, //审核盖章
      SQRdisabled: false, //申请人确认
      ProbelmName: "", //动态title
      fileUrl: `${FileApi}/file/upload`,
      fileList: [],
      fileList1: [],
      fileListBL: [],
      dialogVisible: false, //问题添加
      dialogCKVisible: false, //问题查看
      systemNameOptions: [
        {
          code: "1",
          name: "天津智能出入库系统",
        },
        {
          code: "2",
          name: "天津市企业服务平台",
        },

        {
          code: "3",
          name: "天津智能粮库业务平台",
        },
        {
          code: "4",
          name: "市级综合粮食管理和服务平台",
        },
      ], //系统名称list
      solvePersonOptions: [],
      //处理方式
      solveTypeOptions: [
        {
          code: "1",
          name: "现场处理",
        },
        {
          code: "2",
          name: "远程处理",
        },
        {
          code: "3",
          name: "第三方介入处理",
        },
        {
          code: "4",
          name: "研发人员处理",
        },
        {
          code: "5",
          name: "其他",
        },
      ],
      //问题类型
      problemTypeOptions: [
        {
          code: "1",
          name: "测温问题",
        },
        {
          code: "2",
          name: "硬件问题",
        },
        {
          code: "3",
          name: "网路问题",
        },
        {
          code: "4",
          name: "供电问题",
        },
        {
          code: "5",
          name: "数据问题",
        },
        {
          code: "6",
          name: "配置问题",
        },
        {
          code: "7",
          name: "操作问题",
        },
        {
          code: "8",
          name: "系统服务问题",
        },
        {
          code: "9",
          name: "其他",
        },
      ],
      djOptions: [],
      addFrom: {
        mainId: "",
        gdbh: "",
        solveDesc: "",
        solveFile: "",
        writeDate: this.dateFormat(new Date()),
        solveAuthor: sessionStorage.getItem("userName"),
      },
      tableData: [],
      formData: {
        orderNumber: "",
        applyOrgName: sessionStorage.getItem("orgName"),
        applyOrgCode: sessionStorage.getItem("orgCode"),
        webSysName: "",
        applyUserPhone: "",
        requirementDescription: "", //问题情况描述
        attachment: "", //问题附件
        // workOrderTypeName: "",
        // workOrderType: "",
        // sqrq:'',
        applyTime: this.dateFormat(new Date()),
        applyUsername: sessionStorage.getItem("userName"),
        scope: "",
        // leaderOpinion: null,
        // leaderUsername: "",
        // leaderAuditDate:'',
        // verifyDate: this.dateFormat(new Date()),
        // acceptPerson: "",
        // acceptDate: "",
        // problemType: "", //问题类型
        // solveType: "", //解决方式
        // solveRes: "", //处理结果
        // solveFile: "", //解决附件,
        // solveRemark: "", //解决备注
        // solvePerson: "",
        // solveDate: "",
        // applicantVerifyRes: "",
        // applicantVerify: "",
        // applicantVerifyDate: "",
        // icVerifyRes: "",
        // icVerify: "",
        // icVerifyDate: "",
        // shzt: "", //默认审核状态
      },
      SolveList: [],
      problemList: [],
      addrule: {
        solveDesc: [
          {
            required: true,
            message: "请输入处理描述",
            trigger: ["blur"],
          },
        ],
        problemAuthor: [
          {
            required: true,
            message: "请输入填写人",
            trigger: ["blur", "change"],
          },
        ],
        writeDate: [
          {
            required: true,
            message: "请选择日期",
            trigger: ["blur", "change"],
          },
        ],
      },
      rules: {
        cityOpinion: [
          {
            required: true,
            message: "请选择审核意见",
            trigger: ["change"],
          },
        ],
        cityOpinionRemark: [
          {
            required: true,
            message: "请输入审核意见说明",
            trigger: ["blur", "change"],
          },
        ],
        cityAuditUsername: [
          {
            required: true,
            message: "请输入审核人",
            trigger: ["blur", "change"],
          },
        ],
        // problemType: [
        //   {
        //     required: true,
        //     message: "请选择",
        //     trigger: ["change"],
        //   },
        // ],
        solveType: [
          {
            required: true,
            message: "请选择",
            trigger: ["blur"],
          },
        ],
        solveUsername: [
          {
            required: true,
            message: "请选择",
            trigger: ["blur"],
          },
        ],
        systemName: [
          {
            required: true,
            message: "请选择",
            trigger: ["blur"],
          },
        ],
        acceptUsername: [
          {
            required: true,
            message: "请输入",
            trigger: ["blur", "change"],
          },
        ],
        acceptDate: [
          {
            required: true,
            message: "请选择",
            trigger: ["blur", "change"],
          },
        ],
        citySecondAuditDate: [
          {
            required: true,
            message: "请选择",
            trigger: ["blur", "change"],
          },
        ],
        citySecondAuditUsername: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        citySecondOpinionRemark: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        citySecondOpinion: [
          {
            required: true,
            message: "请选择",
            trigger: ["change"],
          },
        ],
        storageAuditDate: [
          {
            required: true,
            message: "请选择",
            trigger: ["change"],
          },
        ],
        storageAuditUsername: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        storageOpinionRemark: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        storageOpinion: [
          {
            required: true,
            message: "请选择",
            trigger: ["change"],
          },
        ],
        cityAuditDate: [
          {
            required: true,
            message: "请选择",
            trigger: ["change"],
          },
        ],
        cityAuditUsername: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        cityOpinionRemark: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        cityOpinion: [
          {
            required: true,
            message: "请选择",
            trigger: ["change"],
          },
        ],
        areaAuditDate: [
          {
            required: true,
            message: "请选择",
            trigger: ["change"],
          },
        ],
        areaAuditUsername: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        areaOpinionRemark: [
          {
            required: true,
            message: "请输入",
            trigger: ["change"],
          },
        ],
        areaOpinion: [
          {
            required: true,
            message: "请选择",
            trigger: ["change"],
          },
        ],
      },
    };
  },
  computed: {
    downloadExcelUrl(link) {
      return "http://101.36.160.140:8097/file/" + link;
      //Api.linkUrl.baseUrl+Api.linkUrl.downloadExcel = http://base地址/下载的地址
    },
  },
  created() {
    if (this.$route.query.type == "CK" || this.$route.query.type == "dc") {
      this.SQRdisabled = true;
      this.SHdisabled = true;
      this.disabled = true;
    } else if (
      this.$route.query.shzt == "add" ||
      this.$route.query.shzt == "91000001"
    ) {
      this.disabled = false;
      this.SHdisabled = true;
      this.SQRdisabled = true;
    } else if (
      this.$route.query.shzt == "91000010" ||
      this.$route.query.shzt == "91000011"
    ) {
      this.SHdisabled = false;
      this.disabled = true;
      this.SQRdisabled = true;
    } else if (
      this.$route.query.shzt == "91000050" ||
      this.$route.query.shzt == "91000052"
    ) {
      this.SQRdisabled = false;
      this.SHdisabled = true;
      this.disabled = true;
    } else {
      this.SQRdisabled = true;
      this.SHdisabled = true;
      this.disabled = true;
    }
    findYWRYPDictCode("YWRY").then((res) => {
      this.solvePersonOptions = res.data;
    });

    findByOrgCodes().then((res) => {
      this.officeOrgCodeOptions = res.data[0].departList;
    });
    this.$nextTick(() => {
      this.selectByInfo();
    });
  },
  methods: {
	  //导出pdf
	  exportPdf() {
	    let _this = this;
	    setTimeout(function () {
	      htmlToPdf.downloadPDF(
	        document.querySelector("#pdfId"),
	        "数据删改单"+_this.formData.orderNumber+".pdf"
	      );
	    }, 100);
	  },
    //详情信息
    selectByInfo() {
      if (this.$route.query.id) {
        dataReviseOrderInfo(this.$route.query.id).then((res) => {
          if (res.infoCode == 200) {
            // this.formData.leaderOpinion=1
            this.formData = res.data;
            this.getProblem(1);
            this.getProblem(2);
            if (this.formData.attachment) {
              findByIds(this.formData.attachment).then((res) => {
                this.fileList = res.data;
              });
            }
            if (this.formData.solveFile) {
              findByIds(this.formData.solveFile).then((res) => {
                this.fileListBL = res.data;
              });
            }
            // if (this.formData.applicantVerify) {
            //   this.formData.applicantVerify = this.formData.applicantVerify;
            // } else {
            //   this.formData.applicantVerify =
            //     sessionStorage.getItem("userName");
            // }
            // if (this.formData.applicantVerifyDate) {
            //   this.formData.applicantVerifyDate =
            //     this.formData.applicantVerifyDate;
            // } else {
            //   this.formData.applicantVerifyDate = this.dateFormat(new Date());
            // }
            // this.formData.problemType = this.formData.problemType
            //   ? this.formData.problemType.split(",")
            //   : this.formData.problemType;
            // this.formData.solveType = this.formData.solveType
            //   ? this.formData.solveType.split(",")
            //   : this.formData.solveType;
            // this.formData.webSysName = this.formData.webSysName
            //   ? this.formData.webSysName.split(",")
            //   : this.formData.webSysName;
            // this.formData.solvePerson = this.formData.solvePerson
            //   ? this.formData.solvePerson.split(",")
            //   : this.formData.solvePerson;
            this.formData.problemType = this.formData.problemType
              ? this.formData.problemType.split(",")
              : null;
            this.formData.solveType = this.formData.solveType
              ? this.formData.solveType.split(",")
              : null;
            this.formData.solveUsername = this.formData.solveUsername
              ? this.formData.solveUsername.split(",")
              : null;
            this.formData.systemName = this.formData.systemName
              ? this.formData.systemName.split(",")
              : null;
            if (this.formData.signature) {
              if (this.formData.signature.indexOf("newSeal") == -1) {
                this.$nextTick(() => {
                  this.$ShowSeal("datadeletAndUp", 1);
                  this.$SetSealData(this.formData.signature, 0, "lingdao", 1);
                });
              } else {
                this.$nextTick(() => {
                  this.$signatureOnload(
                    "datadeletAndUp",
                    this.formData.signature.substring(7)
                  );
                });
              }
            }
            if (this.$route.query.type == "sh") {
              this.formData.areaOpinion = 1;
              this.formData.areaOpinionRemark = "";
              this.formData.areaAuditUsername =
                sessionStorage.getItem("userName");
              this.formData.areaAuditDate = this.dateFormat(new Date());
            }
            if (this.$route.query.type == "shone") {
              this.formData.cityOpinion = 1;
              this.formData.cityOpinionRemark = "";
              this.formData.cityAuditUsername =
                sessionStorage.getItem("userName");
              this.formData.cityAuditDate = this.dateFormat(new Date());
            }
            if (this.$route.query.type == "shtwo") {
              this.formData.storageOpinion = 1;
              this.formData.storageOpinionRemark = "";
              this.formData.storageAuditUsername =
                sessionStorage.getItem("userName");
              this.formData.storageAuditDate = this.dateFormat(new Date());
            }
            if (this.$route.query.type == "shthree") {
              this.formData.citySecondOpinion = 1;
              this.formData.citySecondOpinionRemark = "";
              this.formData.citySecondAuditUsername =
                sessionStorage.getItem("userName");
              this.formData.citySecondAuditDate = this.dateFormat(new Date());
            }
            if (this.$route.query.type == "shfour") {
              this.formData.officeOpinion = 1;
              this.formData.officeOpinionRemark = "";
              this.formData.officeAuditUsername =
                sessionStorage.getItem("userName");
              this.formData.officeAuditDate = this.dateFormat(new Date());
            }
            if (this.$route.query.type == "shfive") {
              this.formData.cityThirdOpinion = 1;
              this.formData.cityThirdOpinionRemark = "";
              this.formData.cityThirdAuditUsername =
                sessionStorage.getItem("userName");
              this.formData.cityThirdAuditDate = this.dateFormat(new Date());
            }

            if (this.$route.query.type == "sl") {
              this.formData.acceptStatus = 1;
              this.formData.acceptUsername = sessionStorage.getItem("userName");
              this.formData.acceptDate = this.dateFormat(new Date());
            }
            if (this.$route.query.type == "jj") {
              this.formData.solveStatus = 1;
              // this.formData.acceptUsername = sessionStorage.getItem("userName");
              this.formData.solveDate = this.dateFormat(new Date());
            }

            if (this.$route.query.type == "qr") {
              this.formData.icVerify = 1;
              this.formData.icVerifyUsername =
                sessionStorage.getItem("userName");
              this.formData.icVerifyDate = this.dateFormat(new Date());
            }
          }
        });
      }
    },
    //查看追加问题
    checkProblem(state) {
      this.dialogCKVisible = true;
      if (state == 2) {
        this.ProbelmName = "追加问题描述";
      } else {
        this.ProbelmName = "问题处理过程";
      }
    },
    getProblem(state) {
      // this.dialogCKVisible = true;
      this.problemList = [];
      this.$nextTick(() => {
        let data = {
          id: this.formData.id,
        };
        if (state == 2) {
          // this.ProbelmName = "追加问题描述";
          listProblem(data).then((res) => {
            if (res.infoCode == 200) {
              this.formData.problemCount = res.data ? res.data.length : 0;
              res.data &&
                res.data.forEach((item) => {
                  if (item.problemFile) {
                    findByIds(item.problemFile).then((ress) => {
                      this.$set(item, "problemFileList", ress.data);
                      // item.problemFileList = res.data;
                    });
                  }
                });
              // this.msDisabel=true
              this.problemList = res.data;
            }
          });
        } else {
          // this.ProbelmName = "问题处理过程";
          listSolve(data).then((res) => {
            if (res.infoCode == 200) {
              this.formData.solveCount = res.data ? res.data.length : 0;
              this.SolveList = res.data;
              // this.SolveList=res.data
              this.SolveList &&
                this.SolveList.forEach((item) => {
                  if (item.solveFile) {
                    findByIds(item.solveFile).then((ress) => {
                      this.$set(item, "solveFileList", ress.data);
                    });
                  }
                });
            }
          });
        }
      });
    },

    //追加问题描述
    addSolve() {
      this.dialogVisible = true;
      console.log(this.formData.fid, this.formData.gdbh, "91-----------");
      this.addFrom.mainId = this.formData.id;
      this.addFrom.gdbh = this.formData.orderNumber;
    },
    //提交追加问题描述
    AddProblomSubmit() {
      this.$refs["addFrom"].validate((valid) => {
        if (valid) {
          let arrZJ = [];
          this.fileList1.map((item) => {
            arrZJ.push(item.response ? item.response.data.id : item.id);
          });
          this.addFrom.solveFile = arrZJ.join();

          addSolve(this.addFrom).then((res) => {
            if (res.infoCode == 200) {
              this.$message({
                message: "添加成功",
                type: "success",
              });
              this.dialogVisible = false;
              (this.addFrom = {
                mainId: "",
                gdbh: "",
                solveDesc: "",
                solveFile: "",
                writeDate: this.dateFormat(new Date()),
                solveAuthor: sessionStorage.getItem("userName"),
              }),
                (this.fileList1 = []);
              this.selectByInfo();
            } else {
              this.$message.error(res.msg);
            }
          });
        }
      });
    },
    //提交信息
    saveSubmit(susInfo, errInfo) {
      this.stateLoading = false;
      let arrList = [];
      console.log(arrList, "8888888888888");
      this.$refs["formData"].validate((valid) => {
        if (valid) {
          let arr = [];
          let arrBL = [];
          console.log(this.fileList, "ppppppp000000");
          this.fileList.map((item) => {
            arr.push(item.response ? item.response.data.id : item.id);
          });
          this.formData.attachment = arr.join();
          this.fileListBL.map((item) => {
            arrBL.push(item.response ? item.response.data.id : item.id);
          });
          this.formData.solveFile = arrBL.join();
          //这里写校验通过的业务逻辑
          console.log("通过");
          // if (this.$route.query.type == "jj") {
          this.formData.problemType =
            this.formData.problemType && this.formData.problemType.length > 0
              ? this.formData.problemType.join()
              : "";
          this.formData.solveType =
            this.formData.solveType && this.formData.solveType.length > 0
              ? this.formData.solveType.join()
              : "";
          this.formData.solveUsername =
            this.formData.solveUsername &&
            this.formData.solveUsername.length > 0
              ? this.formData.solveUsername.join()
              : "";
          this.formData.systemName =
            this.formData.systemName && this.formData.systemName.length > 0
              ? this.formData.systemName.join()
              : "";
          // }

          // if (this.$route.query.shzt == "add") {
          //   this.formData.workOrderTypeName = "运维";
          //   this.formData.workOrderType = "1";
          // }

          if (this.formData.officeOrgCode) {
            this.formData.officeOrgName = getCodeName(
              this.formData.officeOrgCode,
              this.officeOrgCodeOptions,
              "deptCode",
              "deptName"
            );
          }
          if (this.$route.query.shzt == "add") {
            dataReviseOrderAdd(this.formData).then((res) => {
              console.log(res, "kkkkkkkkkk4444444444");
              if (res.infoCode == 200) {
                this.$message({
                  message: "保存成功",
                  type: "success",
                });
                this.$router.go(-1);
              } else {
                this.$message.error(res.msg);
              }
            });
          } else {
            // this.formData.problemType = this.formData.problemType
            //   ? this.formData.problemType.join()
            //   : this.formData.problemType;
            // this.formData.solveType = this.formData.solveType
            //   ? this.formData.solveType.join()
            //   : this.formData.solveType;
            // this.formData.webSysName = this.formData.webSysName
            //   ? this.formData.webSysName.join()
            //   : this.formData.webSysName;
            // this.formData.solvePerson = this.formData.solvePerson
            //   ? this.formData.solvePerson.join()
            //   : this.formData.solvePerson;
            // this.formData.id = this.$route.query.id;
            console.log(this.formData, "this.formData------------");
            dataReviseOrderUpdate(this.formData).then((res) => {
              // console.log(res,susInfo,'kkkkkkkkkk4444444444')
              if (res.infoCode == 200) {
                this.$message({
                  message: susInfo ? susInfo : "提交成功",
                  type: "success",
                });
                this.$router.go(-1);
              } else {
                this.$message({
                  type: "error",
                  message: errInfo ? errInfo : res.msg,
                });
                // this.$message.error(res.msg);
              }
            });
          }
        }
      });
    },
    //盖章
    stamp() {
      this.$confirm("是否确认盖章？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.stateLoading = true;
          this.$refs.sealDialog.getData();
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消盖章",
          });
        });
    },
    sealTodo(sealData) {
      // new签章
      var sh = `newSeal${sealData}`;
      this.formData.signature = sh;
      this.formData.signatureStatus = "1";
      this.saveSubmit("盖章成功！", "盖章失败！");
    },
    sealError() {
      this.stateLoading = false;
    },
    //驳回
    signNotDo() {
      this.$confirm("是否确认驳回？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.formData.signatureStatus = "-1";
          this.saveSubmit("签章驳回成功！", "签章驳回失败！");
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消驳回",
          });
        });
    },
    //返回
    returnList() {
      this.$router.go(-1);
    },
    //上传
    handleSuccess(res, file, fileList) {
      this.fileList = fileList;
    },
    handleRemove(file, fileList) {
      this.fileList = fileList;
    },
    handlePreview(file) {
      // console.log(file);
      let fileLink = file.response ? file.response.data.uri : file.link;
      if (
        ["png", "jpg", "jpeg", "bmp", "pdf"].includes(
          fileLink.split(".")[fileLink.split(".").length - 1]
        )
      ) {
        // console.log(`${window.location.origin}/file/${fileLink}`);
        window.open(`${window.location.origin}/file/${fileLink}`);
      } else {
        window.location.href = `${FileApi}/file/download?id=${
          file.response ? file.response.data.id : file.id
        }`;
      }
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    //追加附件上传
    handleSuccessZJ(res, file, fileList) {
      this.fileList1 = fileList;
    },
    handleRemoveZJ(file, fileList) {
      this.fileList1 = fileList;
    },
    handlePreviewZJ(file) {
      // console.log(file);
      let fileLink = file.response ? file.response.data.uri : file.link;
      if (
        ["png", "jpg", "jpeg", "bmp", "pdf"].includes(
          fileLink.split(".")[fileLink.split(".").length - 1]
        )
      ) {
        // console.log(`${window.location.origin}/file/${fileLink}`);
        window.open(`${window.location.origin}/file/${fileLink}`);
      } else {
        window.location.href = `${FileApi}/file/download?id=${
          file.response ? file.response.data.id : file.id
        }`;
      }
    },
    beforeRemoveZJ(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },

    //追加附件上传
    handleSuccessJJ(res, file, fileList) {
      this.fileListBL = fileList;
    },
    handleRemoveJJ(file, fileList) {
      this.fileListBL = fileList;
    },
    handlePreviewJJ(file) {
      // console.log(file);
      let fileLink = file.response ? file.response.data.uri : file.link;
      if (
        ["png", "jpg", "jpeg", "bmp", "pdf"].includes(
          fileLink.split(".")[fileLink.split(".").length - 1]
        )
      ) {
        // console.log(`${window.location.origin}/file/${fileLink}`);
        window.open(`${window.location.origin}/file/${fileLink}`);
      } else {
        window.location.href = `${FileApi}/file/download?id=${
          file.response ? file.response.data.id : file.id
        }`;
      }
    },
    beforeRemoveJJ(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },

    //预览
    YlPic(link) {
      // window.open(`http://101.36.160.140:8097/file/${link}`)
      window.open(`${window.location.origin}/file/${link}`);
      // window.open(`${FileApi}/${link}`)
      // <a target='_black'  href='http://mczaiyun.top/ht/4.pdf'>预览PDF文件</a>
      // window.open(`https://view.officeapps.live.com/op/view.aspx?src=https://physics.nankai.edu.cn/_upload/article/6b/7c/8fe84466415a8e5d48a29c5e08a6/1ea96f13-3367-4ea7-a77f-85b0ec15e121.doc`);
    },
    //下载
    XzPic(id) {
      window.location.href = `${FileApi}/file/download?id=${id}`;
    },
    dateFormat(date) {
      // let date = new Date();
      let year = date.getFullYear();
      /* 在日期格式中，月份是从0开始的，因此要加0
       * 使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
       * */
      let month =
        date.getMonth() + 1 < 10
          ? "0" + (date.getMonth() + 1)
          : date.getMonth() + 1;
      let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
      let hours =
        date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
      let minutes =
        date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
      let seconds =
        date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
      // 拼接
      return year + "-" + month + "-" + day;
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.ywborderS {
  // border: 1px solid #000000;
  padding: 15px;
}
.table-b {
  width: 100%;
  border-collapse: collapse;
  //   height: 100px;
  text-align: center;
  // background-color: #000;
  // border-right: 1px solid #000;
  // border-bottom: 1px solid #000;
  border: 1px solid #000;
  td {
    // width: 320px;
    // height: 50px;
    padding: 10px 40px;
    border: 1px solid #000;
    // border-left: 1px solid #000;
    // border-top: 1px solid #000;
  }
  .inputwidth {
    width: 100%;
  }
}
.table-b td:nth-child(odd) {
  // text-align: justify;
  // text-align-last: justify;
}
.table-el-form /deep/ .el-form-item {
  width: 100%;
}
.table-el-form /deep/ .el-form-item__content {
  width: 100%;
}
.table-el-form /deep/ .el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: inherit;
}
.box-pro {
  border: 1px solid #cfcfcf;
  padding: 10px;
  margin-bottom: 20px;
}
.el-data-width /deep/.el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: auto;
}
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-thumb {
  background: #99a9bf;
  border-radius: 20px;
}
#pdfId{
  padding: 40px;
}
</style>
<style>
#datadeletAndUp {
  position: relative;
}

#datadeletAndUp > div {
  top: -80px !important;
  align-items: center;
  /* left: -25px !important; */
}
</style>
