hanfucheng hai 7 meses
pai
achega
c2d19c4674

+ 10 - 1
lawenforcement-ui/src/api/lawenforcement/case.js

@@ -43,7 +43,7 @@ export function delCase(id) {
   })
 }
 
-//按部门查询日
+//按部门查询日
 export function getCaseLog(data) {
   return request({
     url: '/sooka-sponest-lawenforcement/case/getCaseLog',
@@ -51,3 +51,12 @@ export function getCaseLog(data) {
     data: data
   })
 }
+
+//按部门查询人员
+export function getRenByDeptId(data) {
+  return request({
+    url: '/sooka-sponest-system/user/userFeginlist',
+    method: 'post',
+    data: data
+  })
+}

+ 6 - 1
lawenforcement-ui/src/views/components/FileUpload/index.vue

@@ -4,6 +4,7 @@
       multiple
       :action="uploadFileUrl"
       :before-upload="handleBeforeUpload"
+      :disabled="disabled"
       :file-list="fileList"
       :limit="limit"
       :on-error="handleUploadError"
@@ -36,7 +37,7 @@
         <div class="ele-upload-list__item-content-action">
           <el-link :underline="false" @click="handlePictureCardPreview(file)" type="primary">预览</el-link>
           <el-link :href="file.url" :underline="false" target="_blank" type="primary">下载</el-link>
-          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+          <el-link :underline="false" :disabled="disabled" @click="handleDelete(index)" type="danger">删除</el-link>
         </div>
       </li>
     </transition-group>
@@ -62,6 +63,10 @@ import {getConfigKey} from "@/api/system/config";
 export default {
         name: "FileUpload",
         props: {
+            disabled: {
+              type: Boolean,
+              default: false,
+            },
             setFileName: Function,
             removeFileName: Function,
             // 值

+ 54 - 13
lawenforcement-ui/src/views/lawenforcement/case/index.vue

@@ -126,14 +126,18 @@
             </el-col>
           </el-row>
           <el-row :gutter="20">
-            <el-col :span="12">
-              <el-form-item label="上报单位" prop="deptName" class="duanInput">
-                <el-input v-model="form.deptName" :disabled ="disabled"/>
+            <el-col :span="12" style="padding-left:20px;padding-right:40px">
+              <el-form-item label="上报单位" prop="reportunitName" class="duanInput">
+                <treeselect v-model="form.reportunitId" :options="deptOptions" :disabled ="disabled" multiple:false :show-count="true"
+                            :noResultsText="'空'" :noOptionsText="'空'" placeholder="请选择上报单位" @select="hx"/>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="上报人" prop="createName" class="duanInput">
-                <el-input v-model="form.createName" :disabled = "disabled"/>
+                <el-select v-model="form.createName" placeholder="请选择上报人" :disabled ="disabled" @change="setVal">
+                  <el-option v-for="dict in renOptions" :key="dict.userId" :label="dict.nickName"
+                             :value="{value:dict.userId,label:dict.nickName}"></el-option>
+                </el-select>
               </el-form-item>
             </el-col>
           </el-row>
@@ -255,10 +259,13 @@
 </template>
 
 <script>
-import {listCase, getCase, getCaseLog, updateCase} from "@/api/lawenforcement/case";
+import {listCase, getCase, getCaseLog, updateCase,getRenByDeptId} from "@/api/lawenforcement/case";
 import register from "@/views/lawenforcement/register/index.vue";
 import form from "element-ui/packages/form";
 import fileUpload from '@/views/components/FileUpload/index.vue';
+import {treeselect} from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "Case",
@@ -267,7 +274,7 @@ export default {
       return form
     }
   },
-  components: {register, fileUpload},
+  components: {register, fileUpload,Treeselect},
   dicts: ['lawenforcement_punish_target', 'lawenforcement_punish_type', 'lawenforcement_caseState'],
   data() {
     return {
@@ -278,6 +285,8 @@ export default {
       describe2: null,
       describe3: null,
 
+      deptOptions: undefined,
+      renOptions: undefined,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -330,15 +339,39 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {}
+      rules: {},
+      selected: null
     };
   },
   created() {
     this.queryParams.state = this.$route.query.state;
     this.type = this.$route.query.type;
     this.getList();
+    this.getTreeselect();
   },
   methods: {
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data
+      })
+    },
+    getRen(id){
+      //获取人员列表
+      getRenByDeptId({deptId:id}).then(response => {
+        this.renOptions = response.data
+      })
+    },
+    hx(node) {
+      this.form.reportunitId = node.id
+      this.form.reportunitName = node.label
+      this.form.createBy = null
+      this.form.createName = null
+      this.getRen(this.form.reportunitId)
+    },
+    setVal(data) {
+      this.form.createBy = data.value
+      this.form.createName = data.label
+    },
     /** 查询案件列表 */
     getList() {
       this.loading = true;
@@ -349,9 +382,10 @@ export default {
       });
     },
     // 按部门查看日志
-    getCaseLog(row) {
+    getCaseLog(id) {
+      console.log(id)
       this.form.deptId = this.$store.state.user.dept.deptId;
-      this.form.id = row.id;
+      this.form.id = id;
       getCaseLog(this.form).then(response => {
         this.logNum = response.data;
       });
@@ -369,6 +403,8 @@ export default {
         createBy: null,
         createName: null,
         createTime: null,
+        reportunitId: null,
+        reportunitName: null,
         updateBy: null,
         updateName: null,
         updateTime: null,
@@ -403,12 +439,14 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.selected = selection.map(item => item.reportunitId)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     // 修改
     updateCase(row) {
-      this.getCaseLog(row);
+      this.getRen(this.selected[0])
+      this.getCaseLog(this.ids[0]);
       this.reset();
       const id = row.id || this.ids
       getCase(id).then(response => {
@@ -433,7 +471,7 @@ export default {
     /** 详情 */
     handleUpdate(row) {
       this.disabled = true
-      this.getCaseLog(row);
+      this.getCaseLog(row.id);
       this.reset();
       const id = row.id || this.ids
       getCase(id).then(response => {
@@ -458,10 +496,13 @@ export default {
       this.form.state = state;
       this.form.type = type;
       updateCase(this.form).then(response => {
-        if (state == 'state_2') {
+        if (type == '1') {
+          this.$modal.msgSuccess("修改成功");
+        }
+        if (state == 'state_2' && type != '1') {
           this.$modal.msgSuccess("受理成功");
         }
-        if (state == 'state_6') {
+        if (state == 'state_6' && type != '1') {
           this.$modal.msgSuccess("通过成功");
         }
         this.open = false;

+ 2 - 2
lawenforcement-ui/src/views/lawenforcement/register/index.vue

@@ -74,7 +74,7 @@
               <br>
               <el-col :span="24">
                 <el-form-item label="附件" label-width="50px" prop="dataTwo">
-                  <fileUpload :fileType="fileType" v-model="form.dataTwo" :setFileName="setDataTwo"
+                  <fileUpload :fileType="fileType" :limit="1" v-model="form.dataTwo" :setFileName="setDataTwo"
                               :removeFileName="removeDataTwo" class="fjList"></fileUpload>
                 </el-form-item>
               </el-col>
@@ -91,7 +91,7 @@
               <br>
               <el-col :span="24">
                 <el-form-item label="附件" label-width="50px" prop="dataThree">
-                  <fileUpload :fileType="fileType" v-model="form.dataThree" :setFileName="setDataThree"
+                  <fileUpload :fileType="fileType" :limit="1" v-model="form.dataThree" :setFileName="setDataThree"
                               :removeFileName="removeDataThree" class="fjList"></fileUpload>
                 </el-form-item>
               </el-col>

+ 6 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/domain/LawenforcementCase.java

@@ -79,6 +79,12 @@ public class LawenforcementCase extends BaseBusinessEntity {
     @Excel(name = "状态")
     private String state;
 
+    //上报单位id
+    private String reportunitId;
+
+    //上报单位名称
+    private String reportunitName;
+
     private String content;
 
     //日志列表

+ 9 - 1
src/main/resources/mapper/lawenforcement/LawenforcementCaseMapper.xml

@@ -27,11 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="dataThree"    column="data_three"    />
         <result property="uploadThree"    column="upload_three"    />
         <result property="state"    column="state"    />
+        <result property="reportunitId"    column="reportunit_id"    />
+        <result property="reportunitName"    column="reportunit_name"    />
     </resultMap>
 
     <sql id="selectLawenforcementCaseVo">
         select a.id, a.create_by, a.create_name, a.create_time, a.update_by, a.update_name, a.update_time, a.dept_id, a.dept_name, a.record_id, a.case_name, a.case_number,
-               a.punish_target, a.punish_type, a.describe, a.state from lawenforcement_case a
+               a.punish_target, a.punish_type, a.describe, a.state, a.reportunit_id,a.reportunit_name from lawenforcement_case a
     </sql>
 
     <select id="selectLawenforcementCaseList" parameterType="LawenforcementCase" resultMap="LawenforcementCaseResult">
@@ -75,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="punishType != null">punish_type,</if>
             <if test="describe != null">`describe`,</if>
             <if test="state != null">state,</if>
+            <if test="reportunitId != null">reportunit_id,</if>
+            <if test="reportunitName != null">reportunit_name,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null and id != ''">#{id},</if>
@@ -93,6 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="punishType != null">#{punishType},</if>
             <if test="describe != null">#{describe},</if>
             <if test="state != null">#{state},</if>
+            <if test="reportunitId != null">#{reportunitId},</if>
+            <if test="reportunitName != null">#{reportunitName},</if>
          </trim>
     </insert>
 
@@ -114,6 +120,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="punishType != null">punish_type = #{punishType},</if>
             <if test="describe != null">`describe` = #{describe},</if>
             <if test="state != null">state = #{state},</if>
+            <if test="reportunitId != null">reportunit_id = #{reportunitId},</if>
+            <if test="reportunitName != null">reportunit_name = #{reportunitName},</if>
         </trim>
         where id = #{id}
     </update>