yubo
2026-03-12 74612d64c6bd2d28dcf80450f2cb94ffbee9970d
src/views/user/Informationinput.vue
@@ -37,7 +37,7 @@
            <span :class="thisShowIndex===10?'selectedTimeline':''">工伤案件</span>
          </el-timeline-item>
          <el-timeline-item v-show="timelineShow('empLabortrouble:list')" @click.native="isShow(showArr[11].show, 11)">
            <span :class="thisShowIndex===11?'selectedTimeline':''">劳资案件</span>
            <span :class="thisShowIndex===11?'selectedTimeline':''">仲裁案件</span>
          </el-timeline-item>
          <el-timeline-item v-show="timelineShow('empBadrecord:list')" @click.native="isShow(showArr[12].show, 12)">
            <span :class="thisShowIndex===12?'selectedTimeline':''">不良记录</span>
@@ -115,7 +115,7 @@
          <el-table-column
            prop="insuranceType"
            show-overflow-tooltip
            label="保险类型"
            label="社保档位"
            width="80"
            :formatter="insuranceTypeFormat"
          />
@@ -405,7 +405,7 @@
          <el-table-column show-overflow-tooltip prop="certificateNumb" label="身份证号码" width="120" />
          <el-table-column show-overflow-tooltip prop="applayDate" label="社保申请日期" width="140" sortable="custom" :sort-orders="['ascending', 'descending']" />
          <el-table-column show-overflow-tooltip prop="proposer" label="申请人" width="80" />
          <el-table-column show-overflow-tooltip prop="insuranceGaers" label="保险类型" :formatter="insuranceGaersFormat" width="80" />
          <el-table-column show-overflow-tooltip prop="insuranceGaers" label="社保档位" :formatter="insuranceGaersFormat" width="80" />
          <el-table-column prop="reportStatus " label="是否已报告" width="100" :formatter="reportStatusFormat" />
          <el-table-column prop="applayStatus" label="状态" width="80" :formatter="applayStatusFormat" />
          <el-table-column prop="auditor" label="审核人" width="80" />
@@ -442,8 +442,8 @@
          <el-table-column show-overflow-tooltip prop="injuredPart" label="受伤部位" width="80" />
          <el-table-column show-overflow-tooltip prop="injuredDescribe" label="受伤经过描述" width="120" />
          <el-table-column show-overflow-tooltip prop="injuredDiacrisis" label="意外险诊断" width="120" />
          <el-table-column show-overflow-tooltip prop="hospitalName" label="就诊医院" width="80" />
          <el-table-column show-overflow-tooltip prop="treatmentName" label="就诊科室" width="80" />
          <!--          <el-table-column show-overflow-tooltip prop="hospitalName" label="就诊医院" width="80" />-->
          <!--          <el-table-column show-overflow-tooltip prop="treatmentName" label="就诊科室" width="80" />-->
          <el-table-column
            show-overflow-tooltip
            prop="hospitalizatioFlag"
@@ -451,10 +451,10 @@
            width="80"
            :formatter="hospitalizatioFlagFormat"
          />
          <el-table-column show-overflow-tooltip prop="bedNumb" label="床号" width="60" />
          <!--          <el-table-column show-overflow-tooltip prop="bedNumb" label="床号" width="60" />-->
          <el-table-column show-overflow-tooltip prop="reprotTime" label="报案时间" width="80" />
          <el-table-column show-overflow-tooltip prop="submitTime" label="递交资料时间" width="120" />
          <el-table-column show-overflow-tooltip prop="sbumitBy" label="递交人" width="80" />
          <!--          <el-table-column show-overflow-tooltip prop="submitTime" label="递交资料时间" width="120" />-->
          <!--          <el-table-column show-overflow-tooltip prop="sbumitBy" label="递交人" width="80" />-->
          <el-table-column show-overflow-tooltip prop="expensesFee" label="医疗总费用" width="100" />
          <el-table-column show-overflow-tooltip prop="innsureFee" label="保险赔付费用" width="120" />
        </el-table>
@@ -666,17 +666,19 @@
    <el-dialog title="基本信息" top="8vh" :visible.sync="dialogshowArr[0].show" width="60%" class="baseinfo">
      <el-container style="height: 70vh;">
        <el-aside width="200px">
          <el-upload
            class="avatar-uploader"
            action="#"
            :show-file-list="false"
            :on-change="handlePictureCardPreview"
            :auto-upload="false"
          >
            <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过4MB</div>
            <img v-if="empBaseInfoImageUrl" :src="empBaseInfoImageUrl" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon" />
          </el-upload>
          <!-- 头像显示区域 -->
          <div class="avatar-wrapper">
            <img
              v-if="empBaseInfoImageUrl"
              :src="empBaseInfoImageUrl"
              class="avatar"
              @click="openCamera"
            >
            <div v-else class="avatar-uploader-placeholder" @click="openCamera">
              <i class="el-icon-plus avatar-uploader-icon" />
              <div class="upload-tip">点击拍照上传</div>
            </div>
          </div>
        </el-aside>
        <el-main>
          <el-form
@@ -775,8 +777,8 @@
                <el-form-item label="银行名称">
                  <el-input v-model="empBaseInfoForm.bankName" />
                </el-form-item>
                <el-form-item label="保险类型" prop="insuranceType">
                  <el-select v-model="empBaseInfoForm.insuranceType" placeholder="请选择保险类型">
                <el-form-item label="社保档位" prop="insuranceType">
                  <el-select v-model="empBaseInfoForm.insuranceType" placeholder="请选择社保档位">
                    <el-option
                      v-for="dict in insuranceTypeOptions"
                      :key="dict.dicItemCode"
@@ -785,10 +787,10 @@
                    />
                  </el-select>
                </el-form-item>
                <el-form-item label="家庭成员及关系" prop="family">
                <el-form-item label="家庭成员及关系1" prop="family">
                  <el-input v-model="empBaseInfoForm.family" />
                </el-form-item>
                <el-form-item label="紧急联系电话" prop="urgencyPhone">
                <el-form-item label="家庭成员及关系2" prop="urgencyPhone">
                  <el-input v-model="empBaseInfoForm.urgencyPhone" />
                </el-form-item>
              </el-col>
@@ -1138,7 +1140,15 @@
              />
            </el-form-item>
            <el-form-item label="性别" prop="sex">
              <el-input v-model="contractInfoForm.sex" />
              <!--              <el-input v-model="contractInfoForm.sex" />-->
              <el-select v-model="contractInfoForm.sex" placeholder="请选择性别">
                <el-option
                  v-for="dict in sexOptions"
                  :key="dict.dicItemCode"
                  :label="dict.dicItemName"
                  :value="dict.dicItemCode"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="合同签订日期" prop="signingDate">
              <el-date-picker
@@ -1534,8 +1544,8 @@
                placeholder="选择社保申请日期"
              />
            </el-form-item>
            <el-form-item label="保险类型" prop="insuranceGaers">
              <el-select v-model="insuranceForm.insuranceGaers" placeholder="请选择保险类型">
            <el-form-item label="社保档位" prop="insuranceGaers">
              <el-select v-model="insuranceForm.insuranceGaers" placeholder="请选择社保档位">
                <el-option
                  v-for="dict in insuranceGaersOptions"
                  :key="dict.dicItemCode"
@@ -1733,6 +1743,9 @@
                  :value="dict.dicItemCode"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="备注" prop="remark">
              <el-input v-model="accidentCasesForm.remark" />
            </el-form-item>
          </el-col>
        </el-row>
@@ -1935,7 +1948,7 @@
        <el-button @click="dialogIsShow()">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog title="劳资案件" :visible.sync="dialogshowArr[11].show" width="50%">
    <el-dialog title="仲裁案件" :visible.sync="dialogshowArr[11].show" width="50%">
      <el-form
        ref="laborTroubleForm"
        :model="laborTroubleForm"
@@ -2162,6 +2175,33 @@
    <el-dialog title="选择员工" :visible.sync="dialogShowXzyg" width="60%">
      <Selectuser @selectedUser="selectedUser" @cancleChooseUser="cancleChooseUser" />
    </el-dialog>
    <!-- 摄像头拍照弹窗 -->
    <el-dialog
      title="拍照上传"
      :visible.sync="cameraDialogVisible"
      width="640px"
      :close-on-click-modal="false"
      @close="closeCamera"
    >
      <div class="camera-container">
        <video
          v-show="!capturedImage"
          ref="video"
          class="camera-video"
          autoplay
          playsinline
        />
        <canvas ref="canvas" style="display: none;" />
        <img v-if="capturedImage" :src="capturedImage" class="captured-image">
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="closeCamera">取消</el-button>
        <el-button v-if="!capturedImage" type="primary" @click="takePhoto">拍照</el-button>
        <el-button v-if="capturedImage" @click="retakePhoto">重拍</el-button>
        <el-button v-if="capturedImage" type="primary" @click="confirmPhoto">确认使用</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
@@ -2182,6 +2222,10 @@
      baseicInformationForm: {},
      dialogShowDryg: false,
      empBaseInfoImageUrl: '',
      // 摄像头相关
      cameraDialogVisible: false,
      capturedImage: '',
      stream: null,
      total: 0, // 总数量
      queryParams: {}, // 查询参数
      sort: {}, // 排序
@@ -2213,7 +2257,7 @@
          message: '长度不超过36个字符',
          trigger: 'blur'
        }],
        insuranceType: [{ required: true, message: '请选择保险类型', trigger: 'change' }],
        insuranceType: [{ required: true, message: '请选择社保档位', trigger: 'change' }],
        entryDate: [{ required: true, message: '请选择入职日期', trigger: 'change' }],
        seniority: [{ required: true, message: '请输入入司工龄', trigger: 'blur' }],
        archivesStatus: [{ required: true, message: '请选择档案情况', trigger: 'change' }],
@@ -2291,10 +2335,10 @@
          pattern: /^\d{1,2}(\.\d{1,1})?$/,
          message: '出勤天数精确到1位小数'
        }],
        overtimeDay: [{ pattern: /^\d{1,2}(\.\d{1,1})?$/, message: '加班(天)精确到1位小数' }],
        overtimeHour: [{ pattern: /^\d{1,2}(\.\d{1,1})?$/, message: '加班(小时)精确到1位小数' }],
        leaveDay: [{ pattern: /^\d{1,2}(\.\d{1,1})?$/, message: '请假(天)精确到1位小数' }],
        absenteeism: [{ pattern: /^\d{1,2}(\.\d{1,1})?$/, message: '旷工(天)精确到1位小数' }],
        overtimeDay: [{ pattern: /^\d{1,3}(\.\d{1,1})?$/, message: '加班(天)精确到1位小数' }],
        overtimeHour: [{ pattern: /^\d{1,3}(\.\d{1,1})?$/, message: '加班(小时)精确到1位小数' }],
        leaveDay: [{ pattern: /^\d{1,3}(\.\d{1,1})?$/, message: '请假(天)精确到1位小数' }],
        absenteeism: [{ pattern: /^\d{1,3}(\.\d{1,1})?$/, message: '旷工(天)精确到1位小数' }],
        remark: [{ max: 512, message: '长度不超过512个字符', trigger: 'blur' }]
      },
      leaveInfoRules: {
@@ -2337,7 +2381,7 @@
          message: '长度不超过40个字符',
          trigger: 'blur'
        }],
        insuranceGaers: [{ required: true, message: '请选择保险类型', trigger: 'change' }],
        insuranceGaers: [{ required: true, message: '请选择社保档位', trigger: 'change' }],
        auditor: [{ max: 40, message: '长度不超过40个字符', trigger: 'blur' }],
        remark: [{ max: 512, message: '长度不超过512个字符', trigger: 'blur' }],
        applayStatus: [{ required: true, message: '请选择申请状态', trigger: 'change' }]
@@ -3246,6 +3290,97 @@
        this.$message.error('图片大小超过4M,请重新上传')
      }
    },
    // 打开摄像头
    openCamera() {
      this.cameraDialogVisible = true
      this.$nextTick(() => {
        this.initCamera()
      })
    },
    // 初始化摄像头
    async initCamera() {
      try {
        // 请求摄像头权限
        this.stream = await navigator.mediaDevices.getUserMedia({
          video: {
            width: { ideal: 640 },
            height: { ideal: 480 },
            facingMode: 'user' // 前置摄像头
          },
          audio: false
        })
        // 将视频流绑定到 video 元素
        const video = this.$refs.video
        if (video) {
          video.srcObject = this.stream
        }
      } catch (error) {
        this.$message.error('无法访问摄像头,请检查摄像头权限设置')
        console.error('摄像头初始化失败:', error)
      }
    },
    // 拍照
    takePhoto() {
      const video = this.$refs.video
      const canvas = this.$refs.canvas
      if (!video || !canvas) return
      // 设置画布尺寸
      canvas.width = video.videoWidth || 640
      canvas.height = video.videoHeight || 480
      // 绘制视频帧到画布
      const ctx = canvas.getContext('2d')
      ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
      // 转换为图片数据
      this.capturedImage = canvas.toDataURL('image/jpeg', 0.9)
      // 停止摄像头
      this.stopCamera()
    },
    // 重拍
    retakePhoto() {
      this.capturedImage = ''
      this.initCamera()
    },
    // 确认使用照片
    confirmPhoto() {
      if (this.capturedImage) {
        // 设置图片预览
        this.empBaseInfoImageUrl = this.capturedImage
        // 设置表单数据(Base64格式)
        this.empBaseInfoForm.imagePath = this.capturedImage
        // 关闭弹窗
        this.closeCamera()
        this.$message.success('照片已保存')
      }
    },
    // 关闭摄像头
    closeCamera() {
      this.stopCamera()
      this.cameraDialogVisible = false
      this.capturedImage = ''
    },
    // 停止摄像头流
    stopCamera() {
      if (this.stream) {
        this.stream.getTracks().forEach(track => {
          track.stop()
        })
        this.stream = null
      }
      const video = this.$refs.video
      if (video) {
        video.srcObject = null
      }
    },
    // 翻页插件翻页方法
    search() {
      this.fetch({
@@ -3861,7 +3996,7 @@
              // 起始日期有,进行判断
              if (this.compareDate(this.contractInfoForm.signingDate, value)) {
                // 如果起始在结束之前
                this.contractInfoForm.contractPeriod = dateDifference(this.contractInfoForm.signingDate, this.contractInfoForm.endDate, 'y')
                this.contractInfoForm.contractPeriod = dateDifference(this.contractInfoForm.signingDate, this.contractInfoForm.endDate, 'o')
                callback()
              } else {
                callback(new Error('结束日期不能在开始始日期之前,请重新选择'))
@@ -3876,7 +4011,7 @@
              // 起始日期有,进行判断
              if (this.compareDate(this.leaveInfoForm.beginTime, value)) {
                // 如果起始在结束之前
                this.leaveInfoForm.leaveDay = dateDifference(this.leaveInfoForm.beginTime, this.leaveInfoForm.endTime, 'd')
                // this.leaveInfoForm.leaveDay = dateDifference(this.leaveInfoForm.beginTime, this.leaveInfoForm.endTime, 'd')
                callback()
              } else {
                callback(new Error('结束日期不能在开始始日期之前,请重新选择'))
@@ -6076,6 +6211,72 @@
.el-date-editor.el-input__inner {
  width: 100%;
}
/* 头像上传相关样式 */
.avatar-wrapper {
  width: 178px;
  height: 178px;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-wrapper:hover {
  border-color: #409EFF;
}
.avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.avatar-uploader-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8c939d;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  margin-bottom: 8px;
}
.upload-tip {
  font-size: 12px;
  color: #8c939d;
}
/* 摄像头弹窗样式 */
.camera-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  min-height: 360px;
}
.camera-video {
  width: 100%;
  max-width: 640px;
  height: auto;
}
.captured-image {
  max-width: 100%;
  max-height: 480px;
}
</style>
<style lang="scss">