Commit 1fde1ba1 authored by 耿迪迪's avatar 耿迪迪

违章人员记录和供应商信息详情 gengdidi

parent 4f723e07
package com.zehong.web.controller.contractor;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TContractor;
import com.zehong.system.service.ISysUserService;
import com.zehong.system.service.ITContractorService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TBreakRulesPersonRecord;
import com.zehong.system.service.ITBreakRulesPersonRecordService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 违章人员记录Controller
*
* @author zehong
* @date 2023-02-11
*/
@RestController
@RequestMapping("/breakRulesPerson/record")
public class TBreakRulesPersonRecordController extends BaseController
{
@Autowired
private ITBreakRulesPersonRecordService tBreakRulesPersonRecordService;
@Autowired
private ITContractorService tContractorService;
@Autowired
private ISysUserService iSysUserService;
/**
* 查询违章人员记录列表
*/
//@PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list")
public TableDataInfo list(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
startPage();
List<TBreakRulesPersonRecord> list = tBreakRulesPersonRecordService.selectTBreakRulesPersonRecordList(tBreakRulesPersonRecord);
return getDataTable(list);
}
/**
* 导出违章人员记录列表
*/
//@PreAuthorize("@ss.hasPermi('system:record:export')")
@Log(title = "违章人员记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
List<TBreakRulesPersonRecord> list = tBreakRulesPersonRecordService.selectTBreakRulesPersonRecordList(tBreakRulesPersonRecord);
for(TBreakRulesPersonRecord record : list){
if(null !=record.getContractId()){
TContractor contractor = tContractorService.selectTContractorById(record.getContractId());
record.setContractName(contractor.getContractorName());
}
SysUser user = iSysUserService.selectUserById(record.getReportPerson());
record.setReportPersonName(user.getNickName());
}
ExcelUtil<TBreakRulesPersonRecord> util = new ExcelUtil<TBreakRulesPersonRecord>(TBreakRulesPersonRecord.class);
return util.exportExcel(list, "违章人员记录数据");
}
/**
* 获取违章人员记录详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:record:query')")
@GetMapping(value = "/{breakRulesPersonId}")
public AjaxResult getInfo(@PathVariable("breakRulesPersonId") Long breakRulesPersonId)
{
return AjaxResult.success(tBreakRulesPersonRecordService.selectTBreakRulesPersonRecordById(breakRulesPersonId));
}
/**
* 新增违章人员记录
*/
//@PreAuthorize("@ss.hasPermi('system:record:add')")
@Log(title = "违章人员记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return toAjax(tBreakRulesPersonRecordService.insertTBreakRulesPersonRecord(tBreakRulesPersonRecord));
}
/**
* 修改违章人员记录
*/
//@PreAuthorize("@ss.hasPermi('system:record:edit')")
@Log(title = "违章人员记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return toAjax(tBreakRulesPersonRecordService.updateTBreakRulesPersonRecord(tBreakRulesPersonRecord));
}
/**
* 删除违章人员记录
*/
//@PreAuthorize("@ss.hasPermi('system:record:remove')")
@Log(title = "违章人员记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{breakRulesPersonIds}")
public AjaxResult remove(@PathVariable Long[] breakRulesPersonIds)
{
return toAjax(tBreakRulesPersonRecordService.deleteTBreakRulesPersonRecordByIds(breakRulesPersonIds));
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 违章人员记录对象 t_break_rules_person_record
*
* @author zehong
* @date 2023-02-11
*/
public class TBreakRulesPersonRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long breakRulesPersonId;
/** 承包商id */
private Long contractId;
/**承包商名称*/
@Excel(name = "承包商")
private String contractName;
/** 违规人员姓名 */
@Excel(name = "人员姓名")
private String breakRulesPersonName;
/** 违规时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "违规时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date breakTime;
/** 违规照片 */
@Excel(name = "违规照片")
private String breakPicUrl;
/** 违规说明 */
@Excel(name = "违规说明")
private String breakDescription;
/** 电子签名 */
//@Excel(name = "电子签名")
private String signature;
/** 上报人 */
private Long reportPerson;
/**上报人姓名*/
@Excel(name = "上报人")
private String reportPersonName;
/** 上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上报时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date reportTime;
/** 是否删除(0正常,1删除) */
private String isDel;
private Date reportTimeBegin;
private Date reportTimeEnd;
public void setBreakRulesPersonId(Long breakRulesPersonId)
{
this.breakRulesPersonId = breakRulesPersonId;
}
public Long getBreakRulesPersonId()
{
return breakRulesPersonId;
}
public void setContractId(Long contractId)
{
this.contractId = contractId;
}
public Long getContractId()
{
return contractId;
}
public void setBreakRulesPersonName(String breakRulesPersonName)
{
this.breakRulesPersonName = breakRulesPersonName;
}
public String getBreakRulesPersonName()
{
return breakRulesPersonName;
}
public void setBreakTime(Date breakTime)
{
this.breakTime = breakTime;
}
public Date getBreakTime()
{
return breakTime;
}
public void setBreakPicUrl(String breakPicUrl)
{
this.breakPicUrl = breakPicUrl;
}
public String getBreakPicUrl()
{
return breakPicUrl;
}
public void setBreakDescription(String breakDescription)
{
this.breakDescription = breakDescription;
}
public String getBreakDescription()
{
return breakDescription;
}
public void setSignature(String signature)
{
this.signature = signature;
}
public String getSignature()
{
return signature;
}
public void setReportPerson(Long reportPerson)
{
this.reportPerson = reportPerson;
}
public Long getReportPerson()
{
return reportPerson;
}
public void setReportTime(Date reportTime)
{
this.reportTime = reportTime;
}
public Date getReportTime()
{
return reportTime;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public Date getReportTimeBegin() {
return reportTimeBegin;
}
public void setReportTimeBegin(Date reportTimeBegin) {
this.reportTimeBegin = reportTimeBegin;
}
public Date getReportTimeEnd() {
return reportTimeEnd;
}
public void setReportTimeEnd(Date reportTimeEnd) {
this.reportTimeEnd = reportTimeEnd;
}
public String getContractName() {
return contractName;
}
public void setContractName(String contractName) {
this.contractName = contractName;
}
public String getReportPersonName() {
return reportPersonName;
}
public void setReportPersonName(String reportPersonName) {
this.reportPersonName = reportPersonName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("breakRulesPersonId", getBreakRulesPersonId())
.append("contractId", getContractId())
.append("breakRulesPersonName", getBreakRulesPersonName())
.append("breakTime", getBreakTime())
.append("breakPicUrl", getBreakPicUrl())
.append("breakDescription", getBreakDescription())
.append("signature", getSignature())
.append("reportPerson", getReportPerson())
.append("reportTime", getReportTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TBreakRulesPersonRecord;
/**
* 违章人员记录Mapper接口
*
* @author zehong
* @date 2023-02-11
*/
public interface TBreakRulesPersonRecordMapper
{
/**
* 查询违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 违章人员记录
*/
public TBreakRulesPersonRecord selectTBreakRulesPersonRecordById(Long breakRulesPersonId);
/**
* 查询违章人员记录列表
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 违章人员记录集合
*/
public List<TBreakRulesPersonRecord> selectTBreakRulesPersonRecordList(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 新增违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int insertTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 修改违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int updateTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 删除违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordById(Long breakRulesPersonId);
/**
* 批量删除违章人员记录
*
* @param breakRulesPersonIds 需要删除的数据ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordByIds(Long[] breakRulesPersonIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TBreakRulesPersonRecord;
/**
* 违章人员记录Service接口
*
* @author zehong
* @date 2023-02-11
*/
public interface ITBreakRulesPersonRecordService
{
/**
* 查询违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 违章人员记录
*/
public TBreakRulesPersonRecord selectTBreakRulesPersonRecordById(Long breakRulesPersonId);
/**
* 查询违章人员记录列表
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 违章人员记录集合
*/
public List<TBreakRulesPersonRecord> selectTBreakRulesPersonRecordList(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 新增违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int insertTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 修改违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int updateTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 批量删除违章人员记录
*
* @param breakRulesPersonIds 需要删除的违章人员记录ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordByIds(Long[] breakRulesPersonIds);
/**
* 删除违章人员记录信息
*
* @param breakRulesPersonId 违章人员记录ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordById(Long breakRulesPersonId);
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TBreakRulesPersonRecordMapper;
import com.zehong.system.domain.TBreakRulesPersonRecord;
import com.zehong.system.service.ITBreakRulesPersonRecordService;
/**
* 违章人员记录Service业务层处理
*
* @author zehong
* @date 2023-02-11
*/
@Service
public class TBreakRulesPersonRecordServiceImpl implements ITBreakRulesPersonRecordService
{
@Autowired
private TBreakRulesPersonRecordMapper tBreakRulesPersonRecordMapper;
/**
* 查询违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 违章人员记录
*/
@Override
public TBreakRulesPersonRecord selectTBreakRulesPersonRecordById(Long breakRulesPersonId)
{
return tBreakRulesPersonRecordMapper.selectTBreakRulesPersonRecordById(breakRulesPersonId);
}
/**
* 查询违章人员记录列表
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 违章人员记录
*/
@Override
public List<TBreakRulesPersonRecord> selectTBreakRulesPersonRecordList(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return tBreakRulesPersonRecordMapper.selectTBreakRulesPersonRecordList(tBreakRulesPersonRecord);
}
/**
* 新增违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
@Override
public int insertTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return tBreakRulesPersonRecordMapper.insertTBreakRulesPersonRecord(tBreakRulesPersonRecord);
}
/**
* 修改违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
@Override
public int updateTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return tBreakRulesPersonRecordMapper.updateTBreakRulesPersonRecord(tBreakRulesPersonRecord);
}
/**
* 批量删除违章人员记录
*
* @param breakRulesPersonIds 需要删除的违章人员记录ID
* @return 结果
*/
@Override
public int deleteTBreakRulesPersonRecordByIds(Long[] breakRulesPersonIds)
{
return tBreakRulesPersonRecordMapper.deleteTBreakRulesPersonRecordByIds(breakRulesPersonIds);
}
/**
* 删除违章人员记录信息
*
* @param breakRulesPersonId 违章人员记录ID
* @return 结果
*/
@Override
public int deleteTBreakRulesPersonRecordById(Long breakRulesPersonId)
{
return tBreakRulesPersonRecordMapper.deleteTBreakRulesPersonRecordById(breakRulesPersonId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TBreakRulesPersonRecordMapper">
<resultMap type="TBreakRulesPersonRecord" id="TBreakRulesPersonRecordResult">
<result property="breakRulesPersonId" column="break_rules_person_id" />
<result property="contractId" column="contract_id" />
<result property="breakRulesPersonName" column="break_rules_person_name" />
<result property="breakTime" column="break_time" />
<result property="breakPicUrl" column="break_pic_url" />
<result property="breakDescription" column="break_description" />
<result property="signature" column="signature" />
<result property="reportPerson" column="report_person" />
<result property="reportTime" column="report_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTBreakRulesPersonRecordVo">
select break_rules_person_id, contract_id, break_rules_person_name, break_time, break_pic_url, break_description, signature, report_person, report_time, is_del, remark from t_break_rules_person_record
</sql>
<select id="selectTBreakRulesPersonRecordList" parameterType="TBreakRulesPersonRecord" resultMap="TBreakRulesPersonRecordResult">
<include refid="selectTBreakRulesPersonRecordVo"/>
<where>
<if test="contractId != null "> and contract_id = #{contractId}</if>
<if test="breakRulesPersonName != null and breakRulesPersonName != ''"> and break_rules_person_name like concat('%', #{breakRulesPersonName}, '%')</if>
<if test="breakTime != null "> and break_time = #{breakTime}</if>
<if test="breakPicUrl != null and breakPicUrl != ''"> and break_pic_url = #{breakPicUrl}</if>
<if test="breakDescription != null and breakDescription != ''"> and break_description = #{breakDescription}</if>
<if test="signature != null and signature != ''"> and signature = #{signature}</if>
<if test="reportPerson != null "> and report_person = #{reportPerson}</if>
<if test="reportTimeBegin != null and reportTimeEnd != null"> and report_time BETWEEN #{ reportTimeBegin } AND #{ reportTimeEnd }</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTBreakRulesPersonRecordById" parameterType="Long" resultMap="TBreakRulesPersonRecordResult">
<include refid="selectTBreakRulesPersonRecordVo"/>
where break_rules_person_id = #{breakRulesPersonId}
</select>
<insert id="insertTBreakRulesPersonRecord" parameterType="TBreakRulesPersonRecord" useGeneratedKeys="true" keyProperty="breakRulesPersonId">
insert into t_break_rules_person_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="contractId != null">contract_id,</if>
<if test="breakRulesPersonName != null">break_rules_person_name,</if>
<if test="breakTime != null">break_time,</if>
<if test="breakPicUrl != null">break_pic_url,</if>
<if test="breakDescription != null">break_description,</if>
<if test="signature != null">signature,</if>
<if test="reportPerson != null">report_person,</if>
<if test="reportTime != null">report_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="contractId != null">#{contractId},</if>
<if test="breakRulesPersonName != null">#{breakRulesPersonName},</if>
<if test="breakTime != null">#{breakTime},</if>
<if test="breakPicUrl != null">#{breakPicUrl},</if>
<if test="breakDescription != null">#{breakDescription},</if>
<if test="signature != null">#{signature},</if>
<if test="reportPerson != null">#{reportPerson},</if>
<if test="reportTime != null">#{reportTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTBreakRulesPersonRecord" parameterType="TBreakRulesPersonRecord">
update t_break_rules_person_record
<trim prefix="SET" suffixOverrides=",">
<if test="contractId != null">contract_id = #{contractId},</if>
<if test="breakRulesPersonName != null">break_rules_person_name = #{breakRulesPersonName},</if>
<if test="breakTime != null">break_time = #{breakTime},</if>
<if test="breakPicUrl != null">break_pic_url = #{breakPicUrl},</if>
<if test="breakDescription != null">break_description = #{breakDescription},</if>
<if test="signature != null">signature = #{signature},</if>
<if test="reportPerson != null">report_person = #{reportPerson},</if>
<if test="reportTime != null">report_time = #{reportTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where break_rules_person_id = #{breakRulesPersonId}
</update>
<delete id="deleteTBreakRulesPersonRecordById" parameterType="Long">
delete from t_break_rules_person_record where break_rules_person_id = #{breakRulesPersonId}
</delete>
<delete id="deleteTBreakRulesPersonRecordByIds" parameterType="String">
delete from t_break_rules_person_record where break_rules_person_id in
<foreach item="breakRulesPersonId" collection="array" open="(" separator="," close=")">
#{breakRulesPersonId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询违章人员记录列表
export function listRecord(query) {
return request({
url: '/breakRulesPerson/record/list',
method: 'get',
params: query
})
}
// 查询违章人员记录详细
export function getRecord(breakRulesPersonId) {
return request({
url: '/breakRulesPerson/record/' + breakRulesPersonId,
method: 'get'
})
}
// 新增违章人员记录
export function addRecord(data) {
return request({
url: '/breakRulesPerson/record',
method: 'post',
data: data
})
}
// 修改违章人员记录
export function updateRecord(data) {
return request({
url: '/breakRulesPerson/record',
method: 'put',
data: data
})
}
// 删除违章人员记录
export function delRecord(breakRulesPersonId) {
return request({
url: '/breakRulesPerson/record/' + breakRulesPersonId,
method: 'delete'
})
}
// 导出违章人员记录
export function exportRecord(query) {
return request({
url: '/breakRulesPerson/record/export',
method: 'get',
params: query
})
}
......@@ -82,6 +82,12 @@
<el-table-column label="承包商状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-document-copy"
@click="detailInfo(scope.row)"
>详情</el-button>
<el-button
v-if="scope.row.status == '0'"
size="mini"
......@@ -238,12 +244,139 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 详情承包商信息对话框 -->
<el-dialog title="信息详情" :visible.sync="openDetail" width="800px" append-to-body>
<el-form label-width="120px">
<el-row>
<el-col :span="23">
<el-form-item label="单位名称:" prop="contractorName">
<span>{{ form.contractorName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="法定代表人:" prop="legalPerson">
<span>{{ form.legalPerson }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="法定代表人手机:" prop="legalPersonPhone">
<span>{{ form.legalPerson }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="主要负责人:" prop="keyPerson">
<span>{{ form.keyPerson }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主要负责人手机:" prop="keyPersonPhone">
<span>{{ form.keyPersonPhone }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="安全负责人:" prop="safetyPerson">
<span>{{ form.safetyPerson }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全负责人手机:" prop="safetyPersonPhone">
<span>{{ form.safetyPersonPhone }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="单位资质名称:" prop="certificateName">
<span>{{ form.certificateName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="单位资质证照" prop="certificateUrl">
<img :src="form.certificateUrl" style="width: 20%;vertical-align:middle;cursor:pointer;" @click="showPicture(form)"/>
<el-image :zIndex="9999" :ref="'a'+form.id" :src="form.certificateUrl" v-show="false" :preview-src-list="[form.certificateUrl]" v-if="form.certificateUrl != '' && form.certificateUrl != null"></el-image>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="团队信息记录" prop="teamInformation">
<span>{{ form.teamInformation }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="违章记录" prop="violationRecords">
<el-table class="breakTable" v-loading="loading" :data="breakRulesPersonRecords" height="250px">
<el-table-column label="承包商" align="center" prop="contractId" :formatter="contractorFormate" width="180"/>
<el-table-column label="人员姓名" align="center" prop="breakRulesPersonName" />
<el-table-column label="违规时间" align="center" prop="breakTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.breakTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="违规照片" align="center" prop="breakPicUrl" >
<template slot-scope="scope">
<el-image style="height: 30px;width: 30px" size="small" :preview-src-list="[scope.row.breakPicUrl]" :src="scope.row.breakPicUrl" ></el-image>
</template>
</el-table-column>
<el-table-column label="违规说明" align="center" prop="breakDescription" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column label="电子签名" align="center" prop="signature" >
<template slot-scope="scope">
<el-image style="height: 30px;width: 30px" size="small" :preview-src-list="[scope.row.signature]" :src="scope.row.signature" ></el-image>
</template>
</el-table-column>
<el-table-column label="上报人" align="center" prop="reportPerson" :formatter="reportPersonFormate"/>
<el-table-column label="上报时间" align="center" prop="reportTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="pageNum"
:limit.sync="pageSize"
@pagination="breakPersonRecords"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="承包商评定" prop="contractorEvaluate">
<el-radio-group v-model="form.contractorEvaluate" disabled>
<el-radio label="1"></el-radio>
<el-radio label="2"></el-radio>
<el-radio label="3"></el-radio>
</el-radio-group>
</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="openDetail = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import MyFileUpload from '@/components/MyFileUpload';
import { listContractorInfo, getContractorInfo, delContractorInfo, addContractorInfo, updateContractorInfo, exportContractorInfo } from "@/api/contractor/contractorInfo";
import { listContractorInfo, getContractorInfo, delContractorInfo, addContractorInfo, updateContractorInfo, exportContractorInfo,listAll } from "@/api/contractor/contractorInfo";
import { listRecord } from "@/api/contractor/breakRulesPersonRecord";
import { getAllUserName } from "@/api/system/user"
export default {
name: "ContractorInfo",
......@@ -304,7 +437,17 @@ export default {
contractorName: [
{ required: true, message: "请输入单位名称", trigger: "blur" }
],
}
},
openDetail:false,
breakRulesPersonRecords: [],
//承包商信息
contractorInfos:[],
userInfo:[],
// 总条数
total: 0,
pageNum: 1,
pageSize: 10,
contractId:""
};
},
created() {
......@@ -315,6 +458,8 @@ export default {
this.getDicts("t_contractor_status").then(response => {
this.statusOptions = response.data;
});
this.contractorInfo();
this.userInfos();
},
methods: {
// 承包商评定
......@@ -397,6 +542,20 @@ export default {
this.title = "修改承包商信息";
});
},
detailInfo(row){
const id = row.id || this.ids
getContractorInfo(id).then(response => {
this.form = response.data;
if (this.form.certificateUrl) {
this.fileList.push({
url: this.form.certificateUrl,
});
}
this.openDetail = true;
this.contractId = id;
this.breakPersonRecords();
});
},
/** 审核按钮操作 */
handleApproval(row) {
this.readOnly = true;
......@@ -491,6 +650,51 @@ export default {
this.$refs['a'+row.id].showViewer = true;
console.log("===",row.id);
},
breakPersonRecords(){
listRecord({contractId : this.contractId,pageNum:this.pageNum,pageSize:this.pageSize}).then(res =>{
if(res.code == 200){
this.breakRulesPersonRecords = res.rows;
this.total = res.total;
}
})
},
//承包商信息
contractorInfo(){
listAll().then(res =>{
if(res.code == 200){
this.contractorInfos = res.data;
}
})
},
//承包商名称
contractorFormate(row){
const contrator = this.contractorInfos.find(contractor => contractor.id == row.contractId);
return contrator?contrator.contractorName:"";
},
userInfos(){
getAllUserName().then(res =>{
if(res.code == 200){
this.userInfo = res.data;
}
})
},
//上报人信息
reportPersonFormate(row){
const user = this.userInfo.find(user =>user.userId == row.reportPerson);
return user?user.nickName:"";
},
}
};
</script>
<style lang="scss">
// 滚动条的宽度
.breakTable .el-table__body-wrapper::-webkit-scrollbar {
width: 8px; // 横向滚动条
height: 8px; // 纵向滚动条 必写
}
// 滚动条的滑块
.breakTable .el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #ddd;
border-radius: 3px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment