Jelajahi Sumber

-添加:5s管理相关功能

jiangbiao 2 tahun lalu
induk
melakukan
4786b472a8

+ 14 - 15
master/src/main/java/com/ruoyi/project/production/controller/TFivesRegionController.java

@@ -23,8 +23,7 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/production/region")
-public class TFivesRegionController extends BaseController
-{
+public class TFivesRegionController extends BaseController {
     @Autowired
     private ITFivesRegionService tFivesRegionService;
 
@@ -33,21 +32,25 @@ public class TFivesRegionController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('production:region:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TFivesRegion tFivesRegion)
-    {
+    public TableDataInfo list(TFivesRegion tFivesRegion) {
         startPage();
         List<TFivesRegion> list = tFivesRegionService.selectTFivesRegionList(tFivesRegion);
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('production:region:list')")
+    @GetMapping("/listAll")
+    public AjaxResult listAll(TFivesRegion tFivesRegion) {
+        return AjaxResult.success(tFivesRegionService.selectTFivesRegionList(tFivesRegion));
+    }
+
     /**
      * 导出区域列台账列表
      */
     @PreAuthorize("@ss.hasPermi('production:region:export')")
     @Log(title = "区域列台账", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TFivesRegion tFivesRegion)
-    {
+    public AjaxResult export(TFivesRegion tFivesRegion) {
         List<TFivesRegion> list = tFivesRegionService.selectTFivesRegionList(tFivesRegion);
         ExcelUtil<TFivesRegion> util = new ExcelUtil<TFivesRegion>(TFivesRegion.class);
         return util.exportExcel(list, "region");
@@ -58,8 +61,7 @@ public class TFivesRegionController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('production:region:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tFivesRegionService.selectTFivesRegionById(id));
     }
 
@@ -69,8 +71,7 @@ public class TFivesRegionController extends BaseController
     @PreAuthorize("@ss.hasPermi('production:region:add')")
     @Log(title = "区域列台账", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TFivesRegion tFivesRegion)
-    {
+    public AjaxResult add(@RequestBody TFivesRegion tFivesRegion) {
         tFivesRegion.setCreatedate(new Date());
         tFivesRegion.setCreaterCode(getUserId().toString());
         return toAjax(tFivesRegionService.insertTFivesRegion(tFivesRegion));
@@ -82,8 +83,7 @@ public class TFivesRegionController extends BaseController
     @PreAuthorize("@ss.hasPermi('production:region:edit')")
     @Log(title = "区域列台账", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TFivesRegion tFivesRegion)
-    {
+    public AjaxResult edit(@RequestBody TFivesRegion tFivesRegion) {
         return toAjax(tFivesRegionService.updateTFivesRegion(tFivesRegion));
     }
 
@@ -92,9 +92,8 @@ public class TFivesRegionController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('production:region:remove')")
     @Log(title = "区域列台账", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tFivesRegionService.deleteTFivesRegionByIds(ids));
     }
 }

+ 158 - 100
master/src/main/java/com/ruoyi/project/production/domain/TFivesRegion.java

@@ -12,72 +12,119 @@ import java.util.Date;
  * 区域列台账对象 t_fives_region
  *
  * @author ruoyi
- * @date 2023-03-30
+ * @date 2023-04-04
  */
-public class TFivesRegion extends BaseEntity
-{
+public class TFivesRegion extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 唯一标识ID */
+    /**
+     * 唯一标识ID
+     */
     private Long id;
 
-    /** 装置名称 */
+    /**
+     * 装置名称
+     */
     @Excel(name = "装置名称")
     private String plantCode;
 
-    /** 序号 */
+    /**
+     * 序号
+     */
     @Excel(name = "序号")
-    private String orderNO;
+    private String orderNo;
 
-    /** 位置 */
+    /**
+     * 位置
+     */
     @Excel(name = "位置")
     private String position;
 
-    /** 责任人 */
+    /**
+     * 责任人
+     */
     @Excel(name = "责任人")
     private String personLiable;
 
-    /** 房间号 */
+    /**
+     * 房间号
+     */
     @Excel(name = "房间号")
     private String roomNo;
 
-    /** 关联文件id */
+    /**
+     * 关联文件id
+     */
     @Excel(name = "关联文件id")
     private String fileId;
 
-    /** 备注 */
+    /**
+     * 备注
+     */
     @Excel(name = "备注")
     private String remarks;
 
-    /** 状态 */
+    /**
+     * 状态
+     */
     @Excel(name = "状态")
     private Long status;
 
-    /** 状态 0 :正常 ;1:删除 */
+    /**
+     * 状态 0 :正常 ;1:删除
+     */
     private Long delFlag;
 
-    /** 创建人 */
+    /**
+     * 创建人
+     */
     @Excel(name = "创建人")
     private String createrCode;
 
-    /** 创建时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date createdate;
 
-    /** 修改人 */
+    /**
+     * 修改人
+     */
     @Excel(name = "修改人")
     private Long updaterCode;
 
-    /** 修改时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updatedate;
 
-    /** 部门编号 */
+    /**
+     * 部门编号
+     */
     @Excel(name = "部门编号")
     private Long deptId;
 
+    /**
+     * 系统中人员
+     */
+    @Excel(name = "系统中人员")
+    private String inSys;
+
+    /**
+     * 负责人照片
+     */
+    @Excel(name = "负责人照片")
+    private String personFile;
+
+    /**
+     * 负责人id
+     */
+    @Excel(name = "负责人id")
+    private String staffId;
+
     /**
      * 部门名称
      */
@@ -91,160 +138,171 @@ public class TFivesRegion extends BaseEntity
         this.deptName = deptName;
     }
 
-    public void setId(Long id)
-    {
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId()
-    {
+    public Long getId() {
         return id;
     }
-    public void setPlantCode(String plantCode)
-    {
+
+    public void setPlantCode(String plantCode) {
         this.plantCode = plantCode;
     }
 
-    public String getPlantCode()
-    {
+    public String getPlantCode() {
         return plantCode;
     }
-    public void setOrderNo(String orderNO)
-    {
-        this.orderNO = orderNO;
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
     }
 
-    public String getOrderNo()
-    {
-        return orderNO;
+    public String getOrderNo() {
+        return orderNo;
     }
-    public void setPosition(String position)
-    {
+
+    public void setPosition(String position) {
         this.position = position;
     }
 
-    public String getPosition()
-    {
+    public String getPosition() {
         return position;
     }
-    public void setPersonLiable(String personLiable)
-    {
+
+    public void setPersonLiable(String personLiable) {
         this.personLiable = personLiable;
     }
 
-    public String getPersonLiable()
-    {
+    public String getPersonLiable() {
         return personLiable;
     }
-    public void setRoomNo(String roomNo)
-    {
+
+    public void setRoomNo(String roomNo) {
         this.roomNo = roomNo;
     }
 
-    public String getRoomNo()
-    {
+    public String getRoomNo() {
         return roomNo;
     }
-    public void setFileId(String fileId)
-    {
+
+    public void setFileId(String fileId) {
         this.fileId = fileId;
     }
 
-    public String getFileId()
-    {
+    public String getFileId() {
         return fileId;
     }
-    public void setRemarks(String remarks)
-    {
+
+    public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
 
-    public String getRemarks()
-    {
+    public String getRemarks() {
         return remarks;
     }
-    public void setStatus(Long status)
-    {
+
+    public void setStatus(Long status) {
         this.status = status;
     }
 
-    public Long getStatus()
-    {
+    public Long getStatus() {
         return status;
     }
-    public void setDelFlag(Long delFlag)
-    {
+
+    public void setDelFlag(Long delFlag) {
         this.delFlag = delFlag;
     }
 
-    public Long getDelFlag()
-    {
+    public Long getDelFlag() {
         return delFlag;
     }
-    public void setCreaterCode(String createrCode)
-    {
+
+    public void setCreaterCode(String createrCode) {
         this.createrCode = createrCode;
     }
 
-    public String getCreaterCode()
-    {
+    public String getCreaterCode() {
         return createrCode;
     }
-    public void setCreatedate(Date createdate)
-    {
+
+    public void setCreatedate(Date createdate) {
         this.createdate = createdate;
     }
 
-    public Date getCreatedate()
-    {
+    public Date getCreatedate() {
         return createdate;
     }
-    public void setUpdaterCode(Long updaterCode)
-    {
+
+    public void setUpdaterCode(Long updaterCode) {
         this.updaterCode = updaterCode;
     }
 
-    public Long getUpdaterCode()
-    {
+    public Long getUpdaterCode() {
         return updaterCode;
     }
-    public void setUpdatedate(Date updatedate)
-    {
+
+    public void setUpdatedate(Date updatedate) {
         this.updatedate = updatedate;
     }
 
-    public Date getUpdatedate()
-    {
+    public Date getUpdatedate() {
         return updatedate;
     }
-    public void setDeptId(Long deptId)
-    {
+
+    public void setDeptId(Long deptId) {
         this.deptId = deptId;
     }
 
-    public Long getDeptId()
-    {
+    public Long getDeptId() {
         return deptId;
     }
 
+    public void setInSys(String inSys) {
+        this.inSys = inSys;
+    }
+
+    public String getInSys() {
+        return inSys;
+    }
+
+    public void setPersonFile(String personFile) {
+        this.personFile = personFile;
+    }
+
+    public String getPersonFile() {
+        return personFile;
+    }
+
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
+
+    public String getStaffId() {
+        return staffId;
+    }
+
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("plantCode", getPlantCode())
-            .append("orderNo", getOrderNo())
-            .append("position", getPosition())
-            .append("personLiable", getPersonLiable())
-            .append("roomNo", getRoomNo())
-            .append("fileId", getFileId())
-            .append("remarks", getRemarks())
-            .append("status", getStatus())
-            .append("delFlag", getDelFlag())
-            .append("createrCode", getCreaterCode())
-            .append("createdate", getCreatedate())
-            .append("updaterCode", getUpdaterCode())
-            .append("updatedate", getUpdatedate())
-            .append("deptId", getDeptId())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("plantCode", getPlantCode())
+                .append("orderNo", getOrderNo())
+                .append("position", getPosition())
+                .append("personLiable", getPersonLiable())
+                .append("roomNo", getRoomNo())
+                .append("fileId", getFileId())
+                .append("remarks", getRemarks())
+                .append("status", getStatus())
+                .append("delFlag", getDelFlag())
+                .append("createrCode", getCreaterCode())
+                .append("createdate", getCreatedate())
+                .append("updaterCode", getUpdaterCode())
+                .append("updatedate", getUpdatedate())
+                .append("deptId", getDeptId())
+                .append("inSys", getInSys())
+                .append("personFile", getPersonFile())
+                .append("staffId", getStaffId())
+                .toString();
     }
 }

+ 7 - 6
master/src/main/resources/mybatis/production/TFivesRecordDetailsMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.production.mapper.TFivesRecordDetailsMapper">
-    
+
     <resultMap type="TFivesRecordDetails" id="TFivesRecordDetailsResult">
         <result property="id"    column="id"    />
         <result property="recordId"    column="record_id"    />
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTFivesRecordDetailsList" parameterType="TFivesRecordDetails" resultMap="TFivesRecordDetailsResult">
         <include refid="selectTFivesRecordDetailsVo"/>
-        <where>  
+        <where>
             <if test="recordId != null "> and record_id = #{recordId}</if>
             <if test="fileId != null  and fileId != ''"> and file_id = #{fileId}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
@@ -44,13 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by createdate desc
     </select>
-    
+
     <select id="selectTFivesRecordDetailsById" parameterType="Long" resultMap="TFivesRecordDetailsResult">
         <include refid="selectTFivesRecordDetailsVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertTFivesRecordDetails" parameterType="TFivesRecordDetails">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_fives_record_details.NEXTVAL as id FROM DUAL
@@ -117,5 +118,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+</mapper>

+ 23 - 7
master/src/main/resources/mybatis/production/TFivesRegionMapper.xml

@@ -1,13 +1,13 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.production.mapper.TFivesRegionMapper">
 
     <resultMap type="TFivesRegion" id="TFivesRegionResult">
         <result property="id"    column="id"    />
         <result property="plantCode"    column="plant_code"    />
-        <result property="orderNO"    column="order_no"    />
+        <result property="orderNo"    column="order_no"    />
         <result property="position"    column="position"    />
         <result property="personLiable"    column="person_liable"    />
         <result property="roomNo"    column="room_no"    />
@@ -20,12 +20,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updaterCode"    column="updater_code"    />
         <result property="updatedate"    column="updatedate"    />
         <result property="deptId"    column="dept_id"    />
+        <result property="inSys"    column="in_sys"    />
+        <result property="personFile"    column="person_file"    />
+        <result property="staffId"    column="staff_id"    />
         <result property="deptName" column="dept_name" />
     </resultMap>
 
     <sql id="selectTFivesRegionVo">
-        select d.id, d.plant_code, d.order_no, d.position, d.person_liable, d.room_no, d.file_id, d.remarks, d.status, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id ,s.dept_name from t_fives_region d
-      left join sys_dept s on s.dept_id = d.dept_id
+        select d.id, d.plant_code, d.order_no, d.position, d.person_liable, d.room_no, d.file_id, d.remarks, d.status, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.in_sys, d.person_file, d.staff_id ,s.dept_name from t_fives_region d
+                                                                                                                                                                                                                                                                    left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
     <select id="selectTFivesRegionList" parameterType="TFivesRegion" resultMap="TFivesRegionResult">
@@ -44,10 +47,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="inSys != null  and inSys != ''"> and in_sys = #{inSys}</if>
+            <if test="personFile != null  and personFile != ''"> and person_file = #{personFile}</if>
+            <if test="staffId != null  and staffId != ''"> and staff_id = #{staffId}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by createdate desc
     </select>
 
     <select id="selectTFivesRegionById" parameterType="Long" resultMap="TFivesRegionResult">
@@ -76,7 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">updater_code,</if>
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
-         </trim>
+            <if test="inSys != null">in_sys,</if>
+            <if test="personFile != null">person_file,</if>
+            <if test="staffId != null">staff_id,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="plantCode != null">#{plantCode},</if>
@@ -93,7 +103,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">#{updaterCode},</if>
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
-         </trim>
+            <if test="inSys != null">#{inSys},</if>
+            <if test="personFile != null">#{personFile},</if>
+            <if test="staffId != null">#{staffId},</if>
+        </trim>
     </insert>
 
     <update id="updateTFivesRegion" parameterType="TFivesRegion">
@@ -113,6 +126,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">updater_code = #{updaterCode},</if>
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="inSys != null">in_sys = #{inSys},</if>
+            <if test="personFile != null">person_file = #{personFile},</if>
+            <if test="staffId != null">staff_id = #{staffId},</if>
         </trim>
         where id = #{id}
     </update>

+ 9 - 1
ui/src/api/production/region.js

@@ -8,6 +8,14 @@ export function listRegion(query) {
     params: query
   })
 }
+// 查询区域列台账列表
+export function listAllRegion(query) {
+  return request({
+    url: '/production/region/listAll',
+    method: 'get',
+    params: query
+  })
+}
 
 // 查询区域列台账详细
 export function getRegion(id) {
@@ -50,4 +58,4 @@ export function exportRegion(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 41 - 17
ui/src/views/production/inspection/index.vue

@@ -76,16 +76,16 @@
         >删除
         </el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="info"-->
-<!--          icon="el-icon-upload2"-->
-<!--          size="mini"-->
-<!--          @click="handleImport"-->
-<!--          v-hasPermi="['production:inspection:edit']"-->
-<!--        >导入-->
-<!--        </el-button>-->
-<!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="info"-->
+      <!--          icon="el-icon-upload2"-->
+      <!--          size="mini"-->
+      <!--          @click="handleImport"-->
+      <!--          v-hasPermi="['production:inspection:edit']"-->
+      <!--        >导入-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -153,13 +153,19 @@
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="区域序号" prop="regionOrder">
-          <el-input v-model="form.regionOrder" placeholder="请输入区域序号"/>
+          <el-select v-model="form.regionOrder" filterable  clearable placeholder="请选择区域序号"
+                     style="width: 100%" @change="selectChange">
+            <el-option v-for="region in regionList"
+                       :key="region.orderNo"
+                       :label="region.orderNo"
+                       :value="region.orderNo"/>
+          </el-select>
         </el-form-item>
         <el-form-item label="位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入位置"/>
+          <el-input v-model="form.position" disabled placeholder="请输入位置"/>
         </el-form-item>
         <el-form-item label="责任人" prop="owner">
-          <el-input v-model="form.owner" placeholder="请输入责任人"/>
+          <el-input v-model="form.owner" disabled placeholder="请输入责任人"/>
         </el-form-item>
         <el-form-item label="年" prop="year">
           <el-date-picker
@@ -355,6 +361,7 @@ import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {listAllRegion} from "@/api/production/region";
 
 export default {
   name: "Inspection",
@@ -425,14 +432,21 @@ export default {
         remarks: null,
         deptId: null
       },
+      regionList: [],
       scoreList: [],
       // 表单参数
       form: {},
       // 表单校验
       rules: {
-        deptId: [
-          {required: true, message: "部门编号不能为空", trigger: "blur"}
-        ]
+        regionOrder: [
+          {required: true, message: "请选择区域序号", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "请输入区域位置", trigger: "blur"}
+        ],
+        owner: [
+          {required: true, message: "请输入负责人", trigger: "blur"}
+        ],
       }
     };
   },
@@ -451,9 +465,19 @@ export default {
     this.getTreeselect();
     this.getDicts('5s_score').then(res => {
       this.scoreList = res.data
-    })
+    });
+    this.getRegion();
   },
   methods: {
+    selectChange(event){
+      this.form.position=this.regionList.find((o) => o.orderNo === event).position
+      this.form.owner=this.regionList.find((o) => o.orderNo === event).personLiable
+    },
+    getRegion() {
+      listAllRegion({}).then(res => {
+        this.regionList = res.data;
+      })
+    },
     /** 查询区域月度检查列表 */
     getList() {
       this.loading = true;

+ 50 - 7
ui/src/views/production/record/index.vue

@@ -121,7 +121,7 @@
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="区域序号" align="center" prop="regionOrder" :show-overflow-tooltip="true"/>
       <el-table-column label="位置" align="center" prop="position" :show-overflow-tooltip="true"/>
-      <el-table-column label="负责人" align="center" prop="owner" :show-overflow-tooltip="true"/>
+      <el-table-column label="区域负责人" align="center" prop="owner" :show-overflow-tooltip="true"/>
       <el-table-column label="检查日期" align="center" prop="checkDate" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
@@ -198,13 +198,19 @@
     <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="110px">
         <el-form-item label="区域序号" prop="regionOrder">
-          <el-input v-model="form.regionOrder" placeholder="请输入区域序号"/>
+          <el-select v-model="form.regionOrder" filterable  clearable placeholder="请选择区域序号"
+                     style="width: 100%" @change="selectChange">
+            <el-option v-for="region in regionList"
+                       :key="region.orderNo"
+                       :label="region.orderNo"
+                       :value="region.orderNo"/>
+          </el-select>
         </el-form-item>
         <el-form-item label="位置" prop="position">
-          <el-input v-model="form.position" placeholder="请输入位置"/>
+          <el-input v-model="form.position" disabled placeholder="请输入位置"/>
         </el-form-item>
-        <el-form-item label="负责人" prop="owner">
-          <el-input v-model="form.owner" placeholder="请输入负责人"/>
+        <el-form-item label="区域负责人"  prop="owner">
+          <el-input v-model="form.owner" disabled placeholder="请输入区域负责人"/>
         </el-form-item>
         <el-form-item label="检查日期" prop="checkDate">
           <el-date-picker clearable size="small" style="width: 100%"
@@ -374,6 +380,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Editor from '@/components/Editor';
 import {getFile} from "@/api/production/file";
 import {listDetails} from "@/api/production/details";
+import {listAllRegion} from "@/api/production/region";
 
 export default {
   name: "Record",
@@ -415,6 +422,7 @@ export default {
       total: 0,
       // 区域检查整改记录表格数据
       recordList: [],
+      regionList: [],
       // 弹出层标题
       title: "",
       // 部门树选项
@@ -465,8 +473,29 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        deptId: [
-          {required: true, message: "部门编号不能为空", trigger: "blur"}
+        regionOrder: [
+          {required: true, message: "请选择区域序号", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "请输入位置", trigger: "blur"}
+        ],
+        owner: [
+          {required: true, message: "请输入责任人", trigger: "blur"}
+        ],
+        checkDate: [
+          {required: true, message: "请选择检查日期", trigger: "blur"}
+        ],
+        checkProblem: [
+          {required: true, message: "请输入检查问题", trigger: "blur"}
+        ],
+        changeDate: [
+          {required: true, message: "请选择整改日期", trigger: "blur"}
+        ],
+        changeContent: [
+          {required: true, message: "请输入整改内容", trigger: "blur"}
+        ],
+        changeResult: [
+          {required: true, message: "请输入整改结果", trigger: "blur"}
         ]
       }
     };
@@ -484,8 +513,18 @@ export default {
     })
     this.getList();
     this.getTreeselect();
+    this.getRegion();
   },
   methods: {
+    getRegion() {
+      listAllRegion({}).then(res => {
+        this.regionList = res.data;
+      })
+    },
+    selectChange(event){
+      this.form.position=this.regionList.find((o) => o.orderNo === event).position
+      this.form.owner=this.regionList.find((o) => o.orderNo === event).personLiable
+    },
     openDetail(id) {
       this.detail.recordId = id;
       this.detail.open = true;
@@ -614,6 +653,10 @@ export default {
       this.reset();
       getRecord(this.detail.recordId).then(response => {
         this.form = response.data;
+        this.form.changeContent='';
+        this.form.changeFile='';
+        this.form.changeResult='';
+        this.form.changeDate='';
         this.changeOpen = true;
         this.title = "添加区域检查整改记录";
       });

+ 104 - 20
ui/src/views/production/region/index.vue

@@ -76,16 +76,16 @@
         >删除
         </el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="info"-->
-<!--          icon="el-icon-upload2"-->
-<!--          size="mini"-->
-<!--          @click="handleImport"-->
-<!--          v-hasPermi="['production:region:edit']"-->
-<!--        >导入-->
-<!--        </el-button>-->
-<!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="info"-->
+      <!--          icon="el-icon-upload2"-->
+      <!--          size="mini"-->
+      <!--          @click="handleImport"-->
+      <!--          v-hasPermi="['production:region:edit']"-->
+      <!--        >导入-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -150,8 +150,8 @@
     />
 
     <!-- 添加或修改区域列台账对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
         <el-form-item label="装置名称" prop="plantCode">
           <el-input v-model="form.plantCode" placeholder="请输入装置名称"/>
         </el-form-item>
@@ -161,11 +161,38 @@
         <el-form-item label="位置" prop="position">
           <el-input v-model="form.position" placeholder="请输入位置"/>
         </el-form-item>
-        <el-form-item label="责任人是否为系统中人员" prop="personLiable">
-          <el-input v-model="form.personLiable" placeholder="请输入责任人"/>
+        <el-form-item label="责任人是否为系统中人员" prop="inSys">
+          <el-radio v-model="form.inSys" label="是">是</el-radio>
+          <el-radio v-model="form.inSys" label="否">否</el-radio>
         </el-form-item>
-        <el-form-item label="责任人" prop="personLiable">
-          <el-input v-model="form.personLiable" placeholder="请输入责任人"/>
+        <el-form-item label="责任人姓名" prop="personLiable" v-if="form.inSys=='否'">
+          <el-input v-model="form.personLiable" placeholder="请输入责任人姓名"/>
+        </el-form-item>
+        <el-form-item label="责任人照片" prop="personFile" v-if="form.inSys=='否'">
+          <el-upload
+            ref="file"
+            :headers="file.headers"
+            :action="file.url"
+            :disabled="file.isUploading"
+            :on-progress="handleFileDocProgress"
+            :on-success="handleFileDocSuccess2"
+            :auto-upload="true"
+            accept=".jpg,.png"
+            :multiple="true"
+            :file-list="fileList"
+            list-type="picture-card"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="责任人" prop="staffId" v-if="form.inSys=='是'">
+          <el-select v-model="form.staffId" filterable multiple clearable placeholder="请选择责任人"
+                     style="width: 100%">
+            <el-option v-for="staff in staffList"
+                       :key="staff.staffid"
+                       :label="staff.name+'_'+staff.staffid"
+                       :value="staff.staffid"/>
+          </el-select>
         </el-form-item>
         <el-form-item label="房间号" prop="roomNo">
           <el-input v-model="form.roomNo" placeholder="请输入房间号"/>
@@ -257,6 +284,7 @@ import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {getFile} from "@/api/production/file";
+import {listOgzStaffmgr, listStaffmgrAll} from "@/api/plant/staffmgr";
 
 export default {
   name: "Region",
@@ -278,6 +306,7 @@ export default {
       total: 0,
       // 区域列台账表格数据
       regionList: [],
+      staffList: [],
       // 弹出层标题
       title: "",
       // 部门树选项
@@ -327,13 +356,39 @@ export default {
         createdate: null,
         updaterCode: null,
         updatedate: null,
-        deptId: null
+        deptId: null,
+        inSys: null,
+        personFile: null,
+        staffId: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {},
-      fileIds: []
+      rules: {
+        plantCode: [
+          {required: true, message: "请输入装置名称", trigger: "blur"}
+        ],
+        orderNo: [
+          {required: true, message: "请输入区域序号", trigger: "blur"}
+        ],
+        position: [
+          {required: true, message: "请输入区域位置", trigger: "blur"}
+        ],
+        inSys: [
+          {required: true, message: "请选择责任人是否为系统中人员", trigger: "blur"}
+        ],
+        personLiable: [
+          {required: true, message: "请输入责任人姓名", trigger: "blur"}
+        ],
+        staffId: [
+          {required: true, message: "请选择责任人", trigger: "blur"}
+        ],
+        roomNo: [
+          {required: true, message: "请输入房间号", trigger: "blur"}
+        ],
+      },
+      fileIds: [],
+      personFiles: []
     };
   },
   watch: {
@@ -349,8 +404,14 @@ export default {
     })
     this.getList();
     this.getTreeselect();
+    this.getStaff();
   },
   methods: {
+    getStaff() {
+      listOgzStaffmgr({}).then(res => {
+        this.staffList = res
+      })
+    },
     openFile(fileIds) {
       console.log(fileIds)
       this.file.open = true;
@@ -372,6 +433,10 @@ export default {
     handleFileDocSuccess(response, file, fileList) {
       this.fileIds.push(response.data);
     },
+    //附件上传成功处理
+    handleFileDocSuccess2(response, file, fileList) {
+      this.personFiles.push(response.data);
+    },
     /** 查询区域列台账列表 */
     getList() {
       this.loading = true;
@@ -409,7 +474,10 @@ export default {
         createdate: null,
         updaterCode: null,
         updatedate: null,
-        deptId: null
+        deptId: null,
+        inSys: null,
+        personFile: null,
+        staffId: null
       };
       this.resetForm("form");
     },
@@ -433,6 +501,8 @@ export default {
     handleAdd() {
       this.reset();
       this.fileIds = [];
+      this.personFiles = [];
+      this.fileList = [];
       this.open = true;
       this.title = "添加区域列台账";
     },
@@ -440,6 +510,8 @@ export default {
     handleUpdate(row) {
       this.reset();
       this.fileIds = [];
+      this.personFiles = [];
+      this.fileList = [];
       const id = row.id || this.ids
       getRegion(id).then(response => {
         this.form = response.data;
@@ -454,6 +526,18 @@ export default {
           if (this.fileIds != []) {
             this.form.fileId = this.fileIds.join(',');
           }
+          if (this.personFiles != []) {
+            this.form.personFile = this.personFiles.join(',');
+          }
+          if (this.form.staffId != null && this.form.staffId != []) {
+            let names = [];
+            for (const staffId of this.form.staffId) {
+              names.push(this.staffList.find((o) => o.staffid === staffId).name);
+            }
+            this.form.staffId = this.form.staffId.join(',');
+            this.form.personLiable = names.join(',')
+          }
+          console.log(this.form)
           if (this.form.id != null) {
             updateRegion(this.form).then(response => {
               this.msgSuccess("修改成功");