wenhongquan преди 3 години
родител
ревизия
7bf1c22da3

+ 3 - 4
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysReportServiceImpl.java

@@ -56,7 +56,8 @@ public class SysReportServiceImpl implements ISysReportService
     {
        List<SysReport>  list = sysReportMapper.selectSysReportList(sysReport);
        SysReport p = new SysReport();
-       Map<String,Object> pm = new HashMap<>();
+       Map<String,Object> pm = sysReport.getParams();
+       if(pm==null) pm = new HashMap<>();
        pm.put("isMerge","-1");
        p.setParams(pm);
        List<SysReport>  list2 = sysReportMapper.selectSysReportList(p);
@@ -206,7 +207,7 @@ public class SysReportServiceImpl implements ISysReportService
                     }
 
 
-                }else if(last.get("content").contains("审批结果:不同意")&&(!sysReport.getStatus().equals("1"))){
+                }else if((last.get("content").contains("审批结果:不同意")&&(("2").equals(sysReport.getStatus())||sysReport.getStatus()==null))||("4").equals(sysReport.getStatus())){
                     //当审批不同意是 自动关闭
                     sysReport.setStatus("4");
                 }
@@ -215,8 +216,6 @@ public class SysReportServiceImpl implements ISysReportService
             }
 
 
-
-
         }catch (Exception w){}
 
 

+ 2 - 2
ruoyi-admin/src/main/resources/mapper/system/SysPlanMapper.xml

@@ -41,8 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="startHectometer != null  and startHectometer != ''"> and start_hectometer = #{startHectometer}</if>
             <if test="endKm != null  and endKm != ''"> and end_km = #{endKm}</if>
             <if test="endHectometer != null  and endHectometer != ''"> and end_hectometer = #{endHectometer}</if>
-            <if test="startTime != null "> and start_time = #{startTime}</if>
-            <if test="endTime != null "> and end_time = #{endTime}</if>
+            <if test="params.beginTime != null "> and date_format(start_time,'%y%m%d')  &gt;= date_format(#{params.beginTime},'%y%m%d')</if>
+            <if test="params.endTime != null "> and date_format(end_time,'%y%m%d')   &lt;= date_format(#{params.endTime},'%y%m%d') </if>
             <if test="dept != null  and dept != ''"> and dept = #{dept}</if>
             <if test="creatUser != null  and creatUser != ''"> and creat_user = #{creatUser}</if>
             <if test="bridgeHeightWidth != null  and bridgeHeightWidth != ''"> and bridge_height_width = #{bridgeHeightWidth}</if>

+ 2 - 2
ruoyi-admin/src/main/resources/mapper/system/SysReportMapper.xml

@@ -49,8 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="planId != null "> and plan_id = #{planId}</if>
             <if test="lane != null  and lane != ''"> and lane = #{lane}</if>
-            <if test="startTime != null "> and start_time = #{startTime}</if>
-            <if test="endTime != null "> and end_time = #{endTime}</if>
+            <if test="params.beginTime != null "> and date_format(start_time,'%y%m%d')  &gt;= date_format(#{params.beginTime},'%y%m%d')</if>
+            <if test="params.endTime != null "> and date_format(end_time,'%y%m%d')   &lt;= date_format(#{params.endTime},'%y%m%d') </if>
             <if test="manageUser != null  and manageUser != ''"> and manage_user = #{manageUser}</if>
             <if test="managePhone != null  and managePhone != ''"> and manage_phone = #{managePhone}</if>
             <if test="saveUser != null  and saveUser != ''"> and save_user = #{saveUser}</if>

+ 2 - 0
ruoyi-ui/src/store/modules/user.js

@@ -55,6 +55,7 @@ const user = {
       return new Promise((resolve, reject) => {
         getInfo().then(res => {
           const user = res.user
+
           const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
           if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
             commit('SET_ROLES', res.roles)
@@ -64,6 +65,7 @@ const user = {
           }
           commit('SET_NAME', user.userName)
           commit('SET_AVATAR', avatar)
+          commit('SET_DEPT',user.dept)
           resolve(res)
         }).catch(error => {
           reject(error)

+ 1 - 1
ruoyi-ui/src/views/home/index.vue

@@ -39,7 +39,7 @@
                                           施工报备
                                    </div>
                              </div>
-                     <div style="text-align:center;margin-top:33rem" @click='handleMsg("/plan",1)'>
+                     <div style="text-align:center;margin-top:33rem" @click='handleMsg("/plan",1)' v-has-permi="['system:plan:edit']">
                        <!-- <router-link key="collapse" class="sidebar-logo-link" to="/system/plan"> -->
                        <img src='@/assets/images/images/plan_entry.png' style="width:40rem;height:40rem"/>
                        <div :class='divSelect == 1?"icon_fontSelect":"icon_font"'>

+ 2 - 1
ruoyi-ui/src/views/plan/index.vue

@@ -4,6 +4,7 @@
       <el-form-item label="时间" prop="timeRanage">
         <el-date-picker
             v-model="queryParams.timeRanage"
+            value-format="yyyy-MM-dd"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
@@ -246,7 +247,7 @@ export default {
     /** 查询【请填写功能名称】列表 */
     getList() {
       this.loading = true;
-      listPlan(this.queryParams).then(response => {
+      listPlan(this.addDateRange(this.queryParams, this.queryParams.timeRanage)).then(response => {
         this.planList = response.rows;
         this.total = response.total;
         this.loading = false;

+ 34 - 3
ruoyi-ui/src/views/report/add.vue

@@ -334,7 +334,13 @@
         <el-row>
           <el-col
             :span="12"
-            v-for="item in deptlist.filter(i=>i.deptId==105||i.deptId==106)" v-bind:key="item.deptId"
+            v-for="item in deptlist.filter(i=>{
+
+              for (const iKey in spl) {
+                 if (spl[iKey][0]+'' == i.deptId+''){return true;}
+              }
+              return  false;
+            })" v-bind:key="item.deptId"
             style="margin-bottom: 10px"
           >
             <el-radio v-model="audioDept" :label="item.deptId">{{
@@ -374,6 +380,16 @@ import {
   updateDept,
   listDeptExcludeChild,
 } from "@/api/system/dept";
+import {
+  listConfig,
+  getConfig,
+  delConfig,
+  addConfig,
+  updateConfig,
+  refreshCache,
+  getConfigKey
+} from "@/api/system/config";
+
 import { cloneDeep } from "lodash";
 import moment from "moment";
 import router from "@/router";
@@ -402,7 +418,10 @@ export default {
       roadlan:[],
       showlengthover:false,
       showlenfthmsg:"总长不得超过2.5公里",
-      readonly:false
+      readonly:false,
+      nexdept:null,
+      alldept:[],
+      spl:[],
 
     };
   },
@@ -449,7 +468,10 @@ export default {
     this.$route.query.params = null;
     this.form = queryd;
     this.name = queryd.routerName;
-    this.form.planId= parseInt(this.form.planId);
+    if(this.form.planId){
+      this.form.planId= parseInt(this.form.planId);
+    }
+
 
     this.activities = JSON.parse(queryd.ext1 ?? "[]") ?? [];
     //根据时间排序
@@ -481,6 +503,15 @@ export default {
     });
 
 
+    listDept({}).then(res=>{
+      this.alldept = res.data;
+    });
+    getConfigKey("spflow").then(res=>{
+      res = JSON.parse(res.msg);
+      this.spl = res;
+    })
+
+
 
     // console.log(this.$route.query.status);
   },

+ 56 - 10
ruoyi-ui/src/views/report/index.vue

@@ -4,6 +4,7 @@
        <el-form-item label="时间" prop="timeRanage">
         <el-date-picker
             v-model="queryParams.timeRanage"
+            value-format="yyyy-MM-dd"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
@@ -30,7 +31,7 @@
     </el-form>
 
 
-    <el-table ref="listtbl" v-loading="loading" :data="reportList" default-expand-all row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @select="tblselect" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
+    <el-table ref="listtbl" v-loading="loading" :data="reportList" default-expand-all row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @select="tblselect" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" @row-click="tableclick">
       <el-table-column type="selection" width="40" align="center"   @selectable="selectable"/>
 <!--      <el-table-column-->
 <!--        type="index"-->
@@ -104,7 +105,7 @@
               size="mini"
               type="text"
               icon="el-icon-edit"
-              @click="handleDetail(scope.row)"
+              @click.stop="handleDetail(scope.row)"
 
             >查看</el-button>
             <el-button
@@ -112,7 +113,7 @@
             type="text"
             icon="el-icon-edit"
             v-if="scope.row.status==='1'||scope.row.status==='4'"
-            @click="handleUpdate(scope.row)"
+            @click.stop="handleUpdate(scope.row)"
             v-hasPermi="['system:report:edit']"
           >修改</el-button>
             <el-button
@@ -120,7 +121,7 @@
               type="text"
               icon="el-icon-delete"
               v-if="scope.row.status==='1'||scope.row.status==='4'"
-              @click="handleDelete(scope.row)"
+              @click.stop="handleDelete(scope.row)"
               v-hasPermi="['system:report:remove']"
             >删除</el-button>
 
@@ -130,7 +131,7 @@
                 type="text"
                 icon="el-icon-edit"
                 v-if="scope.row.status==='2' && scope.row.auditDept+'' === currentuserdeptid+''"
-                @click="handleSP(scope.row)"
+                @click.stop="handleSP(scope.row)"
                 v-hasPermi="['system:report:sp']"
 
               >审批</el-button>
@@ -153,15 +154,19 @@
 
 
     <el-dialog title="施工审批"  :visible.sync="spvisible" width="500px" append-to-body>
-      <el-form ref="form" :model="spform"  label-width="80px">
-        <el-form-item label="" >
+      <el-form ref="form" :model="spform"  label-width="150px">
+        <el-form-item label="审批意见" >
           <el-input v-model="spform.msg" type="textarea" placeholder="请输入审批意见" />
         </el-form-item>
 
-        <el-form-item label="" >
+
+        <el-form-item label="审批结果" >
           <el-radio v-model="spform.status" label="1">同意</el-radio>
           <el-radio v-model="spform.status" label="2">不同意</el-radio>
         </el-form-item>
+        <el-form-item label="下级审批部门" v-if="spform.status=='1' && nexdept" >
+          <el-radio  :value="nexdept"   :label="nexdept+''">{{ alldept.filter(i=>{ return i.deptId == nexdept}).length>0?alldept.filter(i=>{ return i.deptId == nexdept})[0].deptName:"" }}</el-radio>
+        </el-form-item>
 
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -177,6 +182,16 @@
 <script>
 import { listReport, getReport, delReport, addReport, updateReport,collisionDetection,mergeQuery,mergeReport } from "@/api/system/report";
 import moment from "moment";
+import {
+  listConfig,
+  getConfig,
+  delConfig,
+  addConfig,
+  updateConfig,
+  refreshCache,
+  getConfigKey
+} from "@/api/system/config";
+import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
 
 export default {
   name: "Report",
@@ -229,7 +244,10 @@ export default {
         reportid:0,
         msg:"",
         ext1:"",
-      }
+      },
+      nexdept:null,
+      alldept:[],
+      spl:[],
     };
   },
   created() {
@@ -245,6 +263,25 @@ export default {
     this.$parent.divSelect =2;
     this.$parent.activeIndex='1';
 
+    listDept({}).then(res=>{
+      this.alldept = res.data;
+    });
+    getConfigKey("spflow").then(res=>{
+     res = JSON.parse(res.msg);
+      this.spl = res;
+      for (var index in this.spl) {
+        var tempc = this.spl[index];
+        var indexc =  tempc.findIndex((i)=>i.deptId == this.currentuserdeptid);
+        if(indexc!=-1){
+          console.log(this.currentuserdeptid)
+          this.nexdept =  indexc+1 == tempc.length?null:tempc[indexc+1];
+          break;
+        }
+      }
+    })
+
+
+
 
 
   },
@@ -256,7 +293,7 @@ export default {
     /** 查询【请填写功能名称】列表 */
     getList() {
       this.loading = true;
-      listReport(this.queryParams).then(response => {
+      listReport(this.addDateRange(this.queryParams, this.queryParams.timeRanage)).then(response => {
         this.reportList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -358,6 +395,7 @@ export default {
             updateReport({id:this.spform.reportid,ext1:ext1}).then((response) => {
               this.$modal.msgSuccess("成功");
               this.$router.push({ path: "/report" });
+              this.handleQuery();
             });
 
 
@@ -374,6 +412,14 @@ export default {
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
+    tableclick(row, column, event){
+      if(row.isMerge!=-1){
+        return;
+      }
+      row.routerName = '详情'
+      localStorage.setItem("currentreport",JSON.stringify(row));
+      this.$router.push({path: '/addReport'})
+    },
 
     handleSP(row){
       this.spvisible = true;