shi'sen'yuan 3 роки тому
батько
коміт
fc36ecf701

+ 1 - 0
master/src/main/java/com/ruoyi/project/ehs/controller/TMsdsController.java

@@ -59,6 +59,7 @@ public class TMsdsController extends BaseController
     public TableDataInfo list(TMsds tMsds)
     {
         startPage();
+        logger.info("msds:" + tMsds);
         List<TMsds> list = tMsdsService.selectTMsdsList(tMsds);
         return getDataTable(list);
     }

+ 1 - 1
master/src/main/java/com/ruoyi/project/plant/controller/TTargetactionController.java

@@ -37,7 +37,7 @@ public class TTargetactionController extends BaseController
     /**
      * 查询目标回顾行动项列表
      */
-    @PreAuthorize("@ss.hasPermi('plant:targetaction:list')")
+    @PreAuthorize("@ss.hasPermi('plant:targetaction:query')")
     @GetMapping("/list")
     public TableDataInfo list(TTargetaction tTargetaction)
     {

+ 12 - 0
master/src/main/java/com/ruoyi/project/plant/controller/TTargetlistController.java

@@ -44,6 +44,9 @@ public class TTargetlistController extends BaseController
     @Autowired
     private ITTargetlistService tTargetlistService;
 
+    @Autowired
+    private ITTargetreviewService tTargetreviewService;
+
     @Autowired
     private ISysDeptService iSysDeptService;
 
@@ -123,6 +126,12 @@ public class TTargetlistController extends BaseController
     {
         int doInsert = tTargetlistService.insertTTargetlist(tTargetlist);
         tTargetlist.setCreaterCode(getUserId().toString());
+        if (tTargetlist.getParentId() != 0) {
+            TTargetreview review = new TTargetreview();
+            review.setListId(tTargetlist.getId());
+            review.setDeptId(tTargetlist.getDeptId());
+            tTargetreviewService.insertTTargetreview(review);
+        }
         return toAjax(doInsert);
     }
 
@@ -147,6 +156,9 @@ public class TTargetlistController extends BaseController
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
+        for (Long listId : ids) {
+            tTargetreviewService.deleteTTargetreviewByListId(listId);
+        }
         return toAjax(tTargetlistService.deleteTTargetlistByIds(ids));
     }
 

+ 13 - 0
master/src/main/java/com/ruoyi/project/plant/domain/TTargetreview.java

@@ -120,6 +120,12 @@ public class TTargetreview extends BaseEntity
     /** 父菜单ID */
     private Long parentId;
 
+    /** 偏差说明 */
+    private String deviationInfo;
+
+    /** 对应的targetlistIID */
+    private Long listId;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -342,6 +348,12 @@ public class TTargetreview extends BaseEntity
     {
         this.parentId = parentId;
     }
+    public void setDeviationInfo(String deviationInfo) { this.deviationInfo = deviationInfo; }
+
+    public String getDeviationInfo() { return deviationInfo; }
+    public void setListId(Long listId) { this.listId = listId; }
+
+    public Long getListId() { return listId; }
 
     @Override
     public String toString() {
@@ -374,6 +386,7 @@ public class TTargetreview extends BaseEntity
             .append("principal", getPrincipal())
             .append("expectedDate", getExpectedDate())
             .append("completionDate", getCompletionDate())
+            .append("listId", getListId())
             .toString();
     }
 }

+ 8 - 0
master/src/main/java/com/ruoyi/project/plant/mapper/TTargetreviewMapper.java

@@ -46,6 +46,14 @@ public interface TTargetreviewMapper
      */
     public int updateTTargetreview(TTargetreview tTargetreview);
 
+    /**
+     * 根据listId删除目标回顾
+     *
+     * @param listId 需要删除的目标listId
+     * @return 结果
+     */
+    public int deleteTTargetreviewByListId(Long listId);
+
     /**
      * 删除目标回顾
      * 

+ 8 - 0
master/src/main/java/com/ruoyi/project/plant/service/ITTargetreviewService.java

@@ -46,6 +46,14 @@ public interface ITTargetreviewService
      */
     public int updateTTargetreview(TTargetreview tTargetreview);
 
+    /**
+     * 根据listId删除目标回顾
+     *
+     * @param listId 需要删除的目标listId
+     * @return 结果
+     */
+    public int deleteTTargetreviewByListId(Long listId);
+
     /**
      * 批量删除目标回顾
      * 

+ 11 - 8
master/src/main/java/com/ruoyi/project/plant/service/impl/TTargetreviewServiceImpl.java

@@ -85,10 +85,6 @@ public class TTargetreviewServiceImpl implements ITTargetreviewService
         }else {
             tTargetreview.setAnnualStatus("2");
         }
-        //序号排列
-        String[] items = tTargetreview.getItem().split("\\.");
-        tTargetreview.setItemTop(Long.parseLong(items[0]));
-        tTargetreview.setItemLast(Long.parseLong(items[1]));
         return tTargetreviewMapper.insertTTargetreview(tTargetreview);
     }
 
@@ -101,10 +97,6 @@ public class TTargetreviewServiceImpl implements ITTargetreviewService
     @Override
     public int updateTTargetreview(TTargetreview tTargetreview)
     {
-        //序号排列
-        String[] items = tTargetreview.getItem().split("\\.");
-        tTargetreview.setItemTop(Long.parseLong(items[0]));
-        tTargetreview.setItemLast(Long.parseLong(items[1]));
         //单元格背景颜色状态整改
         if (tTargetreview.getFirstquarter() == "" || tTargetreview.getFirstquarter() == null) {
             tTargetreview.setFirstquarterStatus(null);
@@ -133,6 +125,17 @@ public class TTargetreviewServiceImpl implements ITTargetreviewService
         return tTargetreviewMapper.updateTTargetreview(tTargetreview);
     }
 
+    /**
+     * 根据listId删除目标回顾
+     *
+     * @param listId 需要删除的目标listId
+     * @return 结果
+     */
+    @Override
+    public int deleteTTargetreviewByListId(Long listId) {
+        return tTargetreviewMapper.deleteTTargetreviewByListId(listId);
+    }
+
     /**
      * 批量删除目标回顾
      *

+ 2 - 2
master/src/main/resources/mybatis/ehs/TMsdsMapper.xml

@@ -51,10 +51,10 @@
     <select id="selectTMsdsList" parameterType="TMsds" resultMap="TMsdsResult">
         <include refid="selectTMsdsVo"/>
         <where>
-            <if test="cnName != null  and cnName != ''"> and cn_name like concat(concat('%', #{cnName}), '%')</if>
+            <if test="cnName != null and cnName != ''"> and cn_name like concat(concat('%', #{cnName}), '%')</if>
             <if test="cmr != null  and cmr != ''"> and cmr like concat(concat('%', #{cmr}), '%')</if>
             <if test="issueTime != null "> and issue_time = #{issueTime}</if>
-            <if test="productcategory != null "> and productcategory = #{productcategory}</if>
+            <if test="productcategory != null and productcategory != ''"> and productcategory = #{productcategory}</if>
             <if test="issueTimeYear != null "> and to_char(d.issue_time,'yyyy') = #{issueTimeYear}</if>
             and d.del_flag = 0
         </where>

+ 0 - 2
master/src/main/resources/mybatis/plant/TTargetactionMapper.xml

@@ -30,8 +30,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="targetreviewId != null "> and targetreview_id = #{targetreviewId}</if>
             and d.del_flag = 0
         </where>
-        <!-- 数据范围过滤 -->
-        ${params.dataScope}
     </select>
     
     <select id="selectTTargetactionById" parameterType="Long" resultMap="TTargetactionResult">

+ 1 - 6
master/src/main/resources/mybatis/plant/TTargetlistMapper.xml

@@ -65,14 +65,9 @@
     </select>
 
     <select id="selectListMeasures" parameterType="TTargetlist" resultMap="TTargetlistResult">
-        select d.id, a.action_item, a.principal, a.expected_date as expected, a.completion_date, d.parent_id, d.yardstick, d.partners, d.plant_code, d.item, d.description, d.targets, d.year, m.id as measuresId, m.measures, m.responsible, m.expected_date, m.firstquarter, m.halfyear, m.threequarter, m.annual, m.firstquarter_status, m.halfyear_status, m.threequarter_status, m.annual_status, o.name as first_checker, e.name as second_checker, t.name as three_checker, f.name as annual_checker, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_targetlist d
+        select d.id, d.parent_id, d.yardstick, d.partners, d.plant_code, d.item, d.description, d.targets, d.year, m.id as measuresId, m.measures, m.responsible, m.expected_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_targetlist d
         left join sys_dept s on s.dept_id = d.dept_id
         left join t_targetmeasures m on m.targetlist_id = d.id and m.del_flag = 0
-        left join t_targetaction a on a.targetreview_id = m.id and a.del_flag = 0
-        left join t_staffmgr o on o.staffid = m.first_checker
-        left join t_staffmgr e on e.staffid = m.second_checker
-        left join t_staffmgr t on t.staffid = m.three_checker
-        left join t_staffmgr f on f.staffid = m.annual_checker
         <where>
             <if test="year != null "> and year = #{year}</if>
             <if test="responsible != null  and responsible != ''"> and m.responsible like concat(concat('%', #{responsible}), '%')</if>

+ 20 - 6
master/src/main/resources/mybatis/plant/TTargetreviewMapper.xml

@@ -32,13 +32,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="principal"    column="principal"    />
         <result property="expectedDate"    column="expected_date"    />
         <result property="completionDate"    column="completion_date"    />
+        <result property="deviationInfo"    column="deviation_info"    />
+        <result property="listId"    column="list_id"    />
         <result property="deptName" column="dept_name" />
         <result property="parentId"       column="parent_id"      />
     </resultMap>
 
     <sql id="selectTTargetreviewVo">
-        select d.id, d.plant_code, d.item, d.description, d.targets, d.firstquarter, d.halfyear, d.threequarter, d.annual, d.year, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.firstquarter_status, d.halfyear_status, d.threequarter_status, d.annual_status, d.parent_id, s.dept_name, a.action_item, a.principal, a.expected_date, a.completion_date from t_targetreview d
+        select d.id, l.item, l.description, l.targets, d.firstquarter, d.halfyear, d.threequarter, d.annual, l.year, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.firstquarter_status, d.halfyear_status, d.threequarter_status, d.annual_status, l.parent_id, s.dept_name, a.action_item, a.principal, a.expected_date, a.completion_date, d.deviation_info, d.list_id from t_targetreview d
       left join sys_dept s on s.dept_id = d.dept_id
+      left join t_targetlist l on l.id = d.list_id
       left join t_targetaction a on a.targetreview_id = d.id
     </sql>
 
@@ -46,19 +49,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTTargetreviewVo"/>
         <where>  
             <if test="item != null  and item != ''"> and item like concat(concat('%', #{item}), '%')</if>
-            <if test="year != null "> and year = #{year}</if>
+            <if test="year != null "> and l.year = #{year}</if>
             <if test="parentId != null "> and d.parent_id = #{parentId}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
-        order by d.year desc, d.item_top asc, d.item_last asc
+        order by d.year desc, l.item_top asc, l.item_last asc
     </select>
     
     <select id="selectTTargetreviewById" parameterType="Long" resultMap="TTargetreviewResult">
-        select d.id, d.plant_code, d.item, d.description, d.targets, d.firstquarter, d.halfyear, d.threequarter, d.annual, d.year, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.firstquarter_status, d.halfyear_status, d.threequarter_status, d.annual_status, d.parent_id, s.dept_name from t_targetreview d
-        left join sys_dept s on s.dept_id = d.dept_id
-        where id = #{id}
+        select d.id, l.item, l.description, l.targets, d.firstquarter, d.halfyear, d.threequarter, d.annual, l.year, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.firstquarter_status, d.halfyear_status, d.threequarter_status, d.annual_status, l.parent_id, s.dept_name, d.deviation_info, d.list_id from t_targetreview d
+      left join sys_dept s on s.dept_id = d.dept_id
+      left join t_targetlist l on l.id = d.list_id
+        where d.id = #{id}
     </select>
         
     <insert id="insertTTargetreview" parameterType="TTargetreview">
@@ -91,6 +95,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="itemTop != null">item_top,</if>
             <if test="itemLast != null">item_last,</if>
             <if test="parentId != null">parent_id,</if>
+            <if test="deviationInfo != null">deviation_info,</if>
+            <if test="listId != null">list_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -117,6 +123,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="itemTop != null">#{itemTop},</if>
             <if test="itemLast != null">#{itemLast},</if>
             <if test="parentId != null">#{parentId},</if>
+            <if test="deviationInfo != null">#{deviationInfo},</if>
+            <if test="listId != null">#{listId},</if>
          </trim>
     </insert>
 
@@ -150,10 +158,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="itemTop != null">item_top = #{itemTop},</if>
             <if test="itemLast != null">item_last = #{itemLast},</if>
             <if test="parentId != null">parent_id = #{parentId},</if>
+            <if test="deviationInfo != null">deviation_info = #{deviationInfo},</if>
+            <if test="listId != null">list_id = #{listId},</if>
         </trim>
         where id = #{id}
     </update>
 
+    <update id="deleteTTargetreviewByListId" parameterType="Long">
+        update t_targetreview set del_flag = 2 where list_id = #{listId}
+    </update>
+
     <update id="deleteTTargetreviewById" parameterType="Long">
         update t_targetreview set del_flag = 2 where id = #{id}
     </update>

+ 2 - 0
ui/src/views/ehs/rcaudit/index.vue

@@ -756,6 +756,7 @@
         this.form.id = this.doc.pId;
         addFile(this.form)
         this.getFileList()
+        this.getList()
       },
       /** 删除按钮操作 */
       handleDeleteDoc(row) {
@@ -771,6 +772,7 @@
           this.msgSuccess(this.$t('删除成功'));
           this.form.id = this.doc.pId;
           reduceFile(this.form);
+          this.getList()
         })
       },
       // 文件下载处理

+ 3 - 11
ui/src/views/plant/targetlist/index.vue

@@ -69,7 +69,6 @@
       default-expand-all
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
-      <el-table-column :label="$t('装置名称')" align="center" prop="plantCode" :formatter="plantCodeFormat" />
       <el-table-column label="ITEM" align="center" prop="item" />
       <el-table-column :label="$t('内容')" align="center" prop="description" />
       <el-table-column :label="$t('目标')" align="center" prop="targets" />
@@ -106,16 +105,6 @@
     <!-- 添加或修改目标录入对话框 -->
     <el-dialog v-dialogDrag :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="$t('装置名称')" prop="plantCode">
-          <el-select v-model="form.plantCode" :placeholder="$t('请选择') + $t('装置名称')">
-            <el-option
-              v-for="dict in plantCodeOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
-        </el-form-item>
         <el-form-item label="ITEM" prop="item">
           <el-input v-model="form.item" :placeholder="$t('请输入') + 'ITEM'" />
         </el-form-item>
@@ -509,6 +498,7 @@ export default {
       this.reset();
       this.getTreeselect();
       this.form.parentId = row.id
+      this.form.year = row.year
       this.open = true;
       this.title = this.$t('新增') + " " + this.$t('目标录入');
     },
@@ -546,6 +536,8 @@ export default {
               }
             })
             this.form.partners = partner;
+          }else {
+            this.form.partners = null;
           }
           if (this.form.id != null) {
             updateTargetlist(this.form).then(response => {

+ 9 - 172
ui/src/views/plant/targetmeasures/index.vue

@@ -51,11 +51,11 @@
     </el-row>
 
     <el-table v-loading="loading" :data="targetlistList" :span-method="mergeMethod" @selection-change="handleSelectionChange" :cell-class-name="tableCellClassName" :height="clientHeight" border>
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column :label="$t('年份')" align="center" prop="year" width="80" />
-      <el-table-column :label="$t('序号')" align="center" prop="item" width="80" />
-      <el-table-column :label="$t('内容')" align="center" prop="description" width="300"/>
-      <el-table-column :label="$t('目标')" align="center" prop="targets" width="200"/>
+      <el-table-column type="selection" width="50" align="center" />
+      <el-table-column :label="$t('年份')" align="center" prop="year" width="50" />
+      <el-table-column :label="$t('序号')" align="center" prop="item" width="50" />
+      <el-table-column :label="$t('内容')" align="center" prop="description" width="200"/>
+      <el-table-column :label="$t('目标')" align="center" prop="targets" width="150"/>
       <el-table-column :label="$t('方案/行动计划/措施')" align="center" prop="measures" width="600" />
       <el-table-column :label="$t('负责人')" align="center" prop="responsible" width="200"/>
       <el-table-column :label="$t('计划完成日期')" align="center" prop="expectedDate" width="100">
@@ -63,86 +63,7 @@
           <span>{{ parseTime(scope.row.expectedDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('一季度')" align="center" prop="firstquarter" width="200" :show-overflow-tooltip="true">
-        <template slot-scope="scope" v-if="scope.row.firstquarter != null">
-          <el-dropdown placement="bottom" trigger="click">
-            <span class="el-dropdown-link">
-              <span>{{scope.row.firstquarter}}</span>
-              <i class="el-icon-caret-bottom"></i>
-            </span>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="statusFinish(1, scope.row)">{{ $t('已完成') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusCare(1, scope.row)">{{ $t('注意') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusUrgent(1, scope.row)">{{ $t('紧急') }}</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-          <el-button icon="el-icon-folder" style="color:#666666; background: #ffffff8c; border-color: #dcdfe636;" @click="handleDoc(scope.row , 'targetMeasures-first')" circle></el-button>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('第一季度')+' '+$t('检查人')" align="center" prop="firstChecker" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('二季度')" align="center" prop="halfyear" width="200" :show-overflow-tooltip="true">
-        <template slot-scope="scope" v-if="scope.row.halfyear != null">
-          <el-dropdown placement="bottom" trigger="click">
-            <span class="el-dropdown-link">
-              <span>{{scope.row.halfyear}}</span>
-              <i class="el-icon-caret-bottom"></i>
-            </span>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="statusFinish(2, scope.row)">{{ $t('已完成') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusCare(2, scope.row)">{{ $t('注意') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusUrgent(2, scope.row)">{{ $t('紧急') }}</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-          <el-button icon="el-icon-folder" style="color:#666666; background: #ffffff8c; border-color: #dcdfe636;" @click="handleDoc(scope.row , 'targetMeasures-second')"  circle></el-button>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('第二季度')+' '+$t('检查人')" align="center" prop="secondChecker" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('三季度')" align="center" prop="threequarter" width="200" :show-overflow-tooltip="true">
-        <template slot-scope="scope" v-if="scope.row.threequarter != null">
-          <el-dropdown placement="bottom" trigger="click">
-            <span class="el-dropdown-link"><span>{{scope.row.threequarter}}</span>
-              <i class="el-icon-caret-bottom"></i>
-            </span>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="statusFinish(3, scope.row)">{{ $t('已完成') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusCare(3, scope.row)">{{ $t('注意') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusUrgent(3, scope.row)">{{ $t('紧急') }}</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-          <el-button icon="el-icon-folder" style="color:#666666; background: #ffffff8c; border-color: #dcdfe636;" @click="handleDoc(scope.row , 'targetMeasures-third')"  circle></el-button>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('第三季度')+' '+$t('检查人')" align="center" prop="threeChecker" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('四季度')" align="center" prop="annual" width="200" :show-overflow-tooltip="true">
-        <template slot-scope="scope" v-if="scope.row.annual != null">
-          <el-dropdown placement="bottom" trigger="click">
-            <span class="el-dropdown-link">
-              <span>{{scope.row.annual}}</span>
-              <i class="el-icon-caret-bottom"></i>
-            </span>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="statusFinish(4, scope.row)">{{ $t('已完成') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusCare(4, scope.row)">{{ $t('注意') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="statusUrgent(4, scope.row)">{{ $t('紧急') }}</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-          <el-button icon="el-icon-folder" style="color:#666666; background: #ffffff8c; border-color: #dcdfe636;" @click="handleDoc(scope.row , 'targetMeasures-fouth')"  circle></el-button>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('第四季度')+' '+$t('检查人')" align="center" prop="annualChecker" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('行动项')" align="center" prop="actionItem" width="400" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('负责人')" align="center" prop="principalName" width="100" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('计划完成时间')" align="center" prop="expected" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.expected, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('完成时间')" align="center" prop="completionDate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('操作')" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
+      <el-table-column :label="$t('操作')" align="center" fixed="right" width="110" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -151,14 +72,14 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['plant:targetlist:edit']"
           >{{ $t('修改') }}</el-button>
-          <el-button
+          <!--<el-button
             size="mini"
             type="text"
             icon="el-icon-document"
             @click="handleAction(scope.row)"
             v-hasPermi="['plant:targetmeasures:edit']"
             v-if="scope.row.parentId !== 0"
-          >{{ $t('行动项') }}</el-button>
+          >{{ $t('行动项') }}</el-button>-->
           <el-button
             size="mini"
             type="text"
@@ -193,7 +114,7 @@
         <el-form-item :label="$t('目标')" prop="targets">
           <el-input v-model="form.targets" disabled />
         </el-form-item>
-        <el-form-item :label="$t('方案/行动计划/措施')" prop="measures">
+        <el-form-item :label="$t('方案/行动计划/措施')" prop="measures" label-width="150px">
           <el-input v-model="form.measures" :placeholder="$t('请输入') + $t('方案/行动计划/措施')" />
         </el-form-item>
         <el-row>
@@ -222,90 +143,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item :label="$t('第一季度')" prop="firstquarter">
-              <el-input v-model="form.firstquarter" :placeholder="$t('请输入') + $t('第一季度')" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item :label="$t('第一季度') + $t('检查人')" prop="firstChecker" label-width="110px">
-              <el-select v-model="form.firstChecker" filterable :placeholder="$t('请选择') + $t('第一季度') + $t('检查人')">
-                <el-option
-                  v-for="dict in principalOptions"
-                  :key="dict.staffid"
-                  :label="dict.name"
-                  :value="dict.staffid">
-                  <span style="float: left">{{ dict.name }}</span>
-                  <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item :label="$t('第二季度')" prop="halfyear">
-              <el-input v-model="form.halfyear" :placeholder="$t('请输入') + $t('第二季度')" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item :label="$t('第二季度') + $t('检查人')" prop="secondChecker" label-width="110px">
-              <el-select v-model="form.secondChecker" filterable :placeholder="$t('请选择') + $t('第二季度') + $t('检查人')">
-                <el-option
-                  v-for="dict in principalOptions"
-                  :key="dict.staffid"
-                  :label="dict.name"
-                  :value="dict.staffid">
-                  <span style="float: left">{{ dict.name }}</span>
-                  <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item :label="$t('第三季度')" prop="threequarter">
-              <el-input v-model="form.threequarter" :placeholder="$t('请输入') + $t('第三季度')" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item :label="$t('第三季度') + $t('检查人')" prop="threeChecker" label-width="110px">
-              <el-select v-model="form.threeChecker" filterable :placeholder="$t('请选择') +$t('第三季度')+' '+$t('检查人')">
-                <el-option
-                  v-for="dict in principalOptions"
-                  :key="dict.staffid"
-                  :label="dict.name"
-                  :value="dict.staffid">
-                  <span style="float: left">{{ dict.name }}</span>
-                  <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item :label="$t('第四季度')" prop="annual">
-              <el-input v-model="form.annual" :placeholder="$t('请输入') + $t('第四季度')" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item :label="$t('第四季度') + $t('检查人')" prop="annualChecker" label-width="110px">
-              <el-select v-model="form.annualChecker" filterable :placeholder="$t('请选择') +$t('第四季度')+' '+$t('检查人')">
-                <el-option
-                  v-for="dict in principalOptions"
-                  :key="dict.staffid"
-                  :label="dict.name"
-                  :value="dict.staffid">
-                  <span style="float: left">{{ dict.name }}</span>
-                  <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
         <el-row>
           <el-col :span="12">
             <el-form-item :label="$t('备注')" prop="remarks">

+ 244 - 38
ui/src/views/plant/targetreview/index.vue

@@ -1,23 +1,13 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="ITEM" prop="item">
-        <el-input
-          v-model="queryParams.item"
-          :placeholder="$t('请输入') + 'ITEM'"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item :label="$t('年份')" prop="year">
-        <el-input
-          v-model="queryParams.year"
-          :placeholder="$t('请输入') + $t('年份')"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+        <el-date-picker clearable size="small" style="width: 200px"
+                        v-model="queryParams.year"
+                        type="year"
+                        value-format="yyyy"
+                        :placeholder="$t('请选择')+$t('年份')">
+        </el-date-picker>
       </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
@@ -81,8 +71,8 @@
       <el-table-column :label="$t('年份')" align="center" prop="year" width="50" :show-overflow-tooltip="true"/>
       <el-table-column label="ITEM" align="center" prop="item" width="80" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('内容')" align="center" prop="description" width="400" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('目标')" align="center" prop="targets" width="200" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('一季度')" align="center" prop="firstquarter" width="200" :show-overflow-tooltip="true">
+      <el-table-column :label="$t('目标')" align="center" prop="targets" width="200"/>
+      <el-table-column :label="$t('一季度')" align="center" prop="firstquarter" width="200">
         <template slot-scope="scope" v-if="scope.row.firstquarter != null">
           <el-dropdown placement="bottom" trigger="click">
             <span class="el-dropdown-link">
@@ -97,7 +87,7 @@
           </el-dropdown>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('二季度')" align="center" prop="halfyear" width="200" :show-overflow-tooltip="true">
+      <el-table-column :label="$t('二季度')" align="center" prop="halfyear" width="200">
         <template slot-scope="scope" v-if="scope.row.halfyear != null">
           <el-dropdown placement="bottom" trigger="click">
             <span class="el-dropdown-link">
@@ -112,7 +102,7 @@
           </el-dropdown>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('三季度')" align="center" prop="threequarter" width="200" :show-overflow-tooltip="true">
+      <el-table-column :label="$t('三季度')" align="center" prop="threequarter" width="200">
         <template slot-scope="scope" v-if="scope.row.threequarter != null">
           <el-dropdown placement="bottom" trigger="click">
             <span class="el-dropdown-link">
@@ -127,7 +117,7 @@
           </el-dropdown>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('四季度')" align="center" prop="annual" width="200" :show-overflow-tooltip="true">
+      <el-table-column :label="$t('四季度')" align="center" prop="annual" width="200">
         <template slot-scope="scope" v-if="scope.row.annual != null">
           <el-dropdown placement="bottom" trigger="click">
             <span class="el-dropdown-link">
@@ -142,6 +132,7 @@
           </el-dropdown>
         </template>
       </el-table-column>
+      <el-table-column label="偏差说明" align="center" prop="deviationInfo" :show-overflow-tooltip="true"/>
       <el-table-column label="行动项" align="center" prop="actionItem" width="400" :show-overflow-tooltip="true"/>
       <el-table-column label="负责人" align="center" prop="principalName" width="100" :show-overflow-tooltip="true"/>
       <el-table-column label="计划完成时间" align="center" prop="expectedDate" width="100">
@@ -155,7 +146,7 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column :label="$t('操作')" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -164,6 +155,13 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['plant:targetreview:edit']"
           >{{ $t('修改') }}</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document"
+            @click="handleAction(scope.row)"
+            v-hasPermi="['plant:targetreview:edit']"
+          >{{ $t('行动项') }}</el-button>
           <el-button
             size="mini"
             type="text"
@@ -186,15 +184,8 @@
     <!-- 添加或修改目标回顾对话框 -->
     <el-dialog v-dialogDrag :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="$t('装置名称')" prop="plantCode">
-          <el-select v-model="form.plantCode" :placeholder="$t('请选择') + $t('装置名称')">
-            <el-option
-              v-for="dict in plantCodeOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
+        <el-form-item :label="$t('年份')" prop="year">
+          <el-input v-model="form.year" :placeholder="$t('请输入') + $t('年份')" />
         </el-form-item>
         <el-form-item label="ITEM" prop="item">
           <el-input v-model="form.item" :placeholder="$t('请输入') + 'ITEM'" />
@@ -217,8 +208,8 @@
         <el-form-item :label="$t('四季度')" prop="annual">
           <el-input v-model="form.annual" :placeholder="$t('请输入') + $t('四季度')" />
         </el-form-item>
-        <el-form-item :label="$t('年份')" prop="year">
-          <el-input v-model="form.year" :placeholder="$t('请输入') + $t('年份')" />
+        <el-form-item label="偏差说明" prop="deviationInfo">
+          <el-input v-model="form.deviationInfo" placeholder="请输入偏差说明" />
         </el-form-item>
         <el-form-item :label="$t('备注')" prop="remarks">
           <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
@@ -266,6 +257,70 @@
       </div>
     </el-dialog>
 
+    <!-- 行动项对话框 -->
+    <el-dialog v-dialogDrag :title="actionTitle" :visible.sync="actionOpen" width="1000px" append-to-body>
+      <el-form :inline="true" :model="actionQueryParams">
+        <el-form-item>
+          <el-button v-hasPermi="['plant:targetaction:add']" type="primary" @click="addAction()">{{ $t('新增') }}</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table v-loading="actionLoading" :data="targetactionList" border>
+        <el-table-column :label="$t('行动项')" align="center" header-align="center" prop="actionItem">
+          <template slot-scope="scope">
+            <el-input v-if="scope.row.isEdit" v-model="scope.row.actionItem" :placeholder="$t('请输入') + $t('行动项')" />
+            <span v-else>{{ scope.row.actionItem }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('负责人')" align="center" header-align="center" prop="principal">
+          <template slot-scope="scope">
+            <el-select v-if="scope.row.isEdit" v-model="scope.row.principal" filterable multiple :placeholder="$t('请选择') + $t('人员')">
+              <el-option
+                v-for="dict in principalOptions"
+                :key="dict.staffid"
+                :label="dict.name"
+                :value="dict.staffid">
+                <span style="float: left">{{ dict.name }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
+              </el-option>
+            </el-select>
+            <span v-else>{{ scope.row.principalName }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('计划完成时间')" align="center" header-align="center" prop="expectedDate">
+          <template slot-scope="scope">
+            <el-date-picker
+              v-if="scope.row.isEdit"
+              v-model="scope.row.expectedDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              :placeholder="$t('请选择') + $t('计划完成时间')">
+            </el-date-picker>
+            <span v-else>{{ parseTime(scope.row.expectedDate, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('完成时间')" align="center" header-align="center" prop="completionDate">
+          <template slot-scope="scope">
+            <el-date-picker
+              v-if="scope.row.isEdit"
+              v-model="scope.row.completionDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              :placeholder="$t('请选择') + $t('完成时间')">
+            </el-date-picker>
+            <span v-else>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button v-hasPermi="['plant:targetaction:edit']" type="text" size="small" v-if="scope.row.isEdit" @click="saveAction(scope.row)">{{ $t('保存') }}</el-button>
+            <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelAction(scope.row, scope.$index)">{{ $t('取消') }}</el-button>
+            <el-button v-hasPermi="['plant:targetaction:edit']" v-if="!scope.row.isEdit" @click="editAction(scope.row)" type="text" size="mini">{{ $t('编辑') }}</el-button>
+            <el-button v-hasPermi="['plant:targetaction:edit']" v-if="!scope.row.isEdit" type="text" size="small" @click="deleteAction(scope.row)">{{ $t('删除') }}</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+
     <!-- 下载对话框 -->
     <el-dialog v-dialogDrag :title="download.title" :visible.sync="download.open" width="400px" append-to-body>
       <el-form :model="queryParams" ref="queryForm" label-width="68px">
@@ -290,6 +345,7 @@
 
 <script>
   import { listTargetreview, getTargetreview, delTargetreview, addTargetreview, updateTargetreview, exportTargetreview } from "@/api/plant/targetreview";
+  import { listTargetaction, getTargetaction, delTargetaction, addTargetaction, updateTargetaction} from "@/api/plant/targetaction";
   import { listStaffmgr } from "@/api/plant/staffmgr";
   import { treeselect } from "@/api/system/dept";
   import { getToken } from "@/utils/auth";
@@ -303,6 +359,7 @@
       return {
         // 遮罩层
         loading: true,
+        actionLoading: true,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -315,13 +372,17 @@
         total: 0,
         // 目标回顾表格数据
         targetreviewList: [],
+        //行动项表格数据
+        targetactionList: [],
         // 弹出层标题
         title: "",
+        actionTitle: "",
         // 部门树选项
         deptOptions: undefined,
         clientHeight:300,
         // 是否显示弹出层
         open: false,
+        actionOpen: false,
         // 人员字典
         principalOptions: [],
         // 装置名称字典
@@ -371,13 +432,15 @@
         staffmgrQueryParams: {
           actualposts: null
         },
+        actionQueryParams: {
+          pageNum: 1,
+          pageSize: 20,
+          targetreviewId: null,
+        },
         // 表单参数
         form: {},
         // 表单校验
         rules: {
-          plantCode: [
-            { required: true, message: this.$t('装置名称') + this.$t('不能为空'), trigger: "change" }
-          ],
           item: [
             { required: true, message: this.$t('序号') + this.$t('不能为空'), trigger: "blur" }
           ],
@@ -531,10 +594,29 @@
           firstquarterStatus: null,
           halfyearStatus: null,
           threequarterStatus: null,
-          annualStatus: null
+          annualStatus: null,
+          deviationInfo: null
         };
         this.resetForm("form");
       },
+      //行动项表单重置
+      actionReset() {
+        this.actionForm = {
+          id: null,
+          targetreviewId: null,
+          actionItem: null,
+          principal: null,
+          principalName: null,
+          expectedDate: null,
+          completionDate: null,
+          delFlag: null,
+          createrCode: null,
+          createdate: null,
+          updaterCode: null,
+          updatedate: null,
+        };
+        this.resetForm("actionForm");
+      },
       /** 搜索按钮操作 */
       handleQuery() {
         this.queryParams.pageNum = 1;
@@ -599,6 +681,122 @@
           }
         });
       },
+      /** 行动项按钮操作 */
+      handleAction(row) {
+        let _this = this
+        this.actionReset();
+        this.actionLoading = true;
+        this.actionQueryParams.targetreviewId = row.id
+        listTargetaction(this.actionQueryParams).then(response => {
+          response.rows.forEach(element => {
+            element["isEdit"] = false
+          });
+          response.rows.forEach(element => {
+            element["isAdd"] = false
+          });
+          this.targetactionList = response.rows;
+          this.targetactionList.forEach(function (value,key,arr) {
+            let principal = null;
+            let principalName = null;
+            if (value.principal != null) {
+              principal = value.principal.split(",");
+              principal.forEach(function (id, index) {
+                _this.principalOptions.forEach(function (item) {
+                  if (item.staffid === id) {
+                    if (index === 0) {
+                      principalName = item.name
+                    }else {
+                      principalName = principalName + "," + item.name
+                    }
+                  }
+                });
+              });
+            }
+            _this.targetactionList[key].principal = principal;
+            _this.targetactionList[key].principalName = principalName;
+          })
+          this.actionLoading = false;
+          this.actionOpen = true;
+          this.actionTitle = this.$t('行动项');
+        });
+      },
+      /** 新增行动项按钮操作 */
+      addAction() {
+        this.targetactionList.push({
+          targetreviewId: this.actionQueryParams.targetreviewId,
+          actionItem: '',
+          expectedDate: '',
+          completionDate: '',
+          isEdit: true,
+          isAdd: true
+        });
+      },
+      /** 保存行动项按钮操作 */
+      saveAction(row) {
+        row.isEdit = false;
+        var that = this;
+        that.actionLoading = true;
+        this.actionForm = row;
+        this.actionForm.targetreviewId = this.actionQueryParams.targetreviewId;
+        var principal = null;
+        this.actionForm.principal.forEach(function (value,key,arr) {
+          if (key != 0) {
+            principal = principal + "," + value;
+          }else if (key == 0) {
+            principal = value;
+          }
+        })
+        this.actionForm.principal = principal;
+        if (row.isAdd == true) {
+          addTargetaction(this.actionForm).then(response => {
+            this.msgSuccess(this.$t('新增成功'));
+            this.actionOpen = false;
+            this.getList();
+          });
+        }else {
+          updateTargetaction(this.actionForm).then(response => {
+            this.msgSuccess(this.$t('修改成功'));
+            this.actionOpen = false;
+            this.getList();
+          });
+        }
+      },
+      /** 取消行动项按钮操作 */
+      cancelAction(row, index) {
+        // 如果是新增的数据
+        if (row.isAdd) {
+          this.targetactionList.splice(index, 1)
+        } else {
+          // 不是新增的数据  还原数据
+          for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+          }
+          row.isEdit = false
+        }
+      },
+      /** 修改行动项按钮操作 */
+      editAction(row) {
+        // 备份原始数据
+        row['oldRow'] = JSON.parse(JSON.stringify(row));
+        this.$nextTick(() => {
+          row.isEdit = true;
+        })
+      },
+      /** 删除行动项按钮操作 */
+      deleteAction(row) {
+        const ids = row.id || this.ids;
+        this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+          confirmButtonText: this.$t('确定'),
+          cancelButtonText: this.$t('取消'),
+          type: "warning"
+        }).then(function() {
+          return delTargetaction(ids);
+        }).then(() => {
+          this.getList();
+          this.actionOpen = false;
+          this.msgSuccess(this.$t('删除成功'));
+        })
+      },
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;
@@ -716,7 +914,7 @@
             colspan: _col
           };
         }
-        if (columnIndex === 13 ) {
+        if (columnIndex === 9 ) {
           const _row = this.setTable(this.targetreviewList).merge[rowIndex];
           const _col = _row > 0 ? 1 : 0;
           return {
@@ -732,6 +930,14 @@
             colspan: _col
           };
         }
+        if (columnIndex === 15 ) {
+          const _row = this.setTable(this.targetreviewList).merge[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
+          return {
+            rowspan: _row,
+            colspan: _col
+          };
+        }
       },
       setTable(tableData) {
         let spanArr = [],