瀏覽代碼

增加设置默认研判部门

Memory_LG 2 天之前
父節點
當前提交
c9fae98d89

+ 33 - 2
lawenforcement-ui/src/views/lawenforcement/provincialDept/index.vue

@@ -79,6 +79,16 @@
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="省平台部门名称" align="center" prop="provincialDeptName"/>
       <el-table-column label="态势感知部门名称" align="center" prop="deptName"/>
+      <el-table-column label="研判部门" align="center" key="isJudgment">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.isJudgment"
+            active-value="1"
+            inactive-value="0"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -115,12 +125,20 @@
         <el-form-item label="省平台部门名称" prop="provincialDeptName">
           <el-input v-model="form.provincialDeptName" placeholder="请输入省平台部门名称"/>
         </el-form-item>
-<!--   当this.insertOrUpdate = true 时, treeselect 为不可修改状态     -->
         <el-form-item label="态势感知部门名称" prop="deptId">
           <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true" :disabled="insertOrUpdate"
                       placeholder="请选择态势感知部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
         </el-form-item>
-
+        <el-form-item label="研判部门">
+          <el-radio-group v-model="form.isJudgment">
+            <el-radio
+              v-for="judgment in isJudgmentInit"
+              :key="judgment.value"
+              :label="judgment.value"
+            >{{judgment.label}}
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -148,6 +166,7 @@ export default {
   data() {
     return {
       insertOrUpdate: true,
+      isJudgmentInit:[{value: 0, label: '否'},{value: 1, label: '是'}],
       // 部门树选项
       deptOptions: [],
       // 遮罩层
@@ -193,6 +212,17 @@ export default {
     this.getTreeselect()
   },
   methods: {
+    handleStatusChange(row) {
+      let text = row.isJudgment === '0' ? '停用' : '启用'
+      this.$modal.confirm('确认要' + text + '"' + row.provincialDeptName + '"为研判部门吗?').then(function () {
+        let o = {deptId: row.deptId, isJudgment: row.isJudgment}
+        return updateProvincialDept(o)
+      }).then(() => {
+        this.$modal.msgSuccess(text + '成功')
+      }).catch(function () {
+        row.isJudgment = row.isJudgment === '0' ? '1' : '0'
+      })
+    },
     /** 查询部门下拉树结构 */
     getTreeselect() {
       treeselect().then(response => {
@@ -265,6 +295,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      console.log(this.form)
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.insertOrUpdate) {

+ 2 - 0
src/main/java/com/sooka/sponest/lawenforcement/provincialDept/domain/LawenforcementProvincialDept.java

@@ -49,6 +49,8 @@ public class LawenforcementProvincialDept extends BaseBusinessEntity {
 
     private String provincialDeptId;
 
+    private String isJudgment;
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 5 - 1
src/main/resources/mapper/lawenforcement/LawenforcementProvincialDeptMapper.xml

@@ -10,10 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptName"    column="dept_name"    />
         <result property="deptId"    column="dept_id"    />
         <result property="deptAncestors"    column="dept_ancestors"    />
+        <result property="isJudgment"    column="is_judgment"    />
     </resultMap>
 
     <sql id="selectLawenforcementProvincialDeptVo">
-        select provincial_dept_name, provincial_dept_id, dept_name, dept_id, dept_ancestors from lawenforcement_provincial_dept
+        select provincial_dept_name, provincial_dept_id, dept_name, dept_id, dept_ancestors, is_judgment from lawenforcement_provincial_dept
     </sql>
 
     <select id="selectLawenforcementProvincialDeptList" parameterType="LawenforcementProvincialDept" resultMap="LawenforcementProvincialDeptResult">
@@ -38,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptName != null">dept_name,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="deptName != null">dept_ancestors,</if>
+            <if test="isJudgment != null and isJudgment != ''">is_judgment,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="provincialDeptName != null and provincialDeptName != ''">(select dept_id from lawenforcement_record where dept_name = #{provincialDeptName} group by dept_name),</if>
@@ -45,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptName != null">#{deptName},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="deptName != null">(select ancestors from ${database_system}.sys_dept where dept_id = #{deptId}),</if>
+            <if test="isJudgment != null and isJudgment != ''">#{isJudgment},</if>
          </trim>
     </insert>
 
@@ -56,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptName != null">dept_name = (select dept_name from ${database_system}.sys_dept where dept_id = #{deptId}),</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="deptName != null">dept_ancestors = (select ancestors from ${database_system}.sys_dept where dept_id = #{deptId}),</if>
+            <if test="isJudgment != null and isJudgment != ''">is_judgment = #{isJudgment},</if>
         </trim>
         where dept_id = #{deptId}
     </update>