Jelajahi Sumber

-修复了审批详情看不到数据的问题。
-修复了装置经理审批时可能会报错的问题。

jiangbiao 3 tahun lalu
induk
melakukan
003c9abe88

+ 5 - 4
master/src/main/java/com/ruoyi/project/invoice/controller/TApproveReserveInvoiceController.java

@@ -10,6 +10,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.approve.damain.DevTask;
 import com.ruoyi.project.invoice.domain.TApproveReserveInvoice;
 import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
+import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticketVo;
 import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
 import com.ruoyi.project.invoice.mapper.TInvoiceWorkcontentMapper;
 import com.ruoyi.project.invoice.service.ITApproveReserveInvoiceService;
@@ -70,8 +71,8 @@ public class TApproveReserveInvoiceController extends BaseController {
             ids = tApprove.getInvoiceId().split(",");
             List<Object> devList = new ArrayList<>();
             for (String id : ids) {
-                TInvoiceBookingworkticket book = workService.getById(id);
-                devList.add(book);
+                List<TInvoiceBookingworkticketVo> book = workService.selectDetailById(Long.valueOf(id));
+                devList.addAll(book);
             }
             tApprove.setDevList(devList);
         }
@@ -101,8 +102,8 @@ public class TApproveReserveInvoiceController extends BaseController {
         ids = tApprove.getInvoiceId().split(",");
         List<Object> devList = new ArrayList<>();
         for (String inId : ids) {
-            TInvoiceBookingworkticket book = workService.getById(inId);
-            devList.add(book);
+            List<TInvoiceBookingworkticketVo> book = workService.selectDetailById(Long.valueOf(inId));
+            devList.addAll(book);
         }
         tApprove.setDevList(devList);
         return AjaxResult.success(tApprove);

+ 147 - 0
master/src/main/java/com/ruoyi/project/invoice/domain/TInvoiceBookingworkticketVo.java

@@ -0,0 +1,147 @@
+package com.ruoyi.project.invoice.domain;
+
+import com.ruoyi.framework.web.domain.BaseEntity;
+
+/**
+ * 预约作业票台账详细
+ *
+ * @author jiang
+ * @date 2022-09-16
+ */
+public class TInvoiceBookingworkticketVo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+    private String workUnit;
+    private String workArea;
+    private String floorLocation;
+    private String workStartTime;
+    private String workEndTime;
+    private String contact;
+    private String phonenumber;
+    private String workType;
+    private String riskLevel;
+    private String workDescription;
+    private String workPeopleNumber;
+    private String estimateWorktime;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    private String status;
+
+    public TInvoiceBookingworkticketVo(String workUnit, String workArea, String floorLocation, String workStartTime, String workEndTime, String contact, String phonenumber, String workType, String riskLevel, String workDescription, String workPeopleNumber, String estimateWorktime) {
+        this.workUnit = workUnit;
+        this.workArea = workArea;
+        this.floorLocation = floorLocation;
+        this.workStartTime = workStartTime;
+        this.workEndTime = workEndTime;
+        this.contact = contact;
+        this.phonenumber = phonenumber;
+        this.workType = workType;
+        this.riskLevel = riskLevel;
+        this.workDescription = workDescription;
+        this.workPeopleNumber = workPeopleNumber;
+        this.estimateWorktime = estimateWorktime;
+    }
+
+    public String getWorkUnit() {
+        return workUnit;
+    }
+
+    public void setWorkUnit(String workUnit) {
+        this.workUnit = workUnit;
+    }
+
+    public String getWorkArea() {
+        return workArea;
+    }
+
+    public void setWorkArea(String workArea) {
+        this.workArea = workArea;
+    }
+
+    public String getFloorLocation() {
+        return floorLocation;
+    }
+
+    public void setFloorLocation(String floorLocation) {
+        this.floorLocation = floorLocation;
+    }
+
+    public String getWorkStartTime() {
+        return workStartTime;
+    }
+
+    public void setWorkStartTime(String workStartTime) {
+        this.workStartTime = workStartTime;
+    }
+
+    public String getWorkEndTime() {
+        return workEndTime;
+    }
+
+    public void setWorkEndTime(String workEndTime) {
+        this.workEndTime = workEndTime;
+    }
+
+    public String getContact() {
+        return contact;
+    }
+
+    public void setContact(String contact) {
+        this.contact = contact;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getWorkType() {
+        return workType;
+    }
+
+    public void setWorkType(String workType) {
+        this.workType = workType;
+    }
+
+    public String getRiskLevel() {
+        return riskLevel;
+    }
+
+    public void setRiskLevel(String riskLevel) {
+        this.riskLevel = riskLevel;
+    }
+
+    public String getWorkDescription() {
+        return workDescription;
+    }
+
+    public void setWorkDescription(String workDescription) {
+        this.workDescription = workDescription;
+    }
+
+    public String getWorkPeopleNumber() {
+        return workPeopleNumber;
+    }
+
+    public void setWorkPeopleNumber(String workPeopleNumber) {
+        this.workPeopleNumber = workPeopleNumber;
+    }
+
+    public String getEstimateWorktime() {
+        return estimateWorktime;
+    }
+
+    public void setEstimateWorktime(String estimateWorktime) {
+        this.estimateWorktime = estimateWorktime;
+    }
+}

+ 2 - 0
master/src/main/java/com/ruoyi/project/invoice/mapper/TInvoiceBookingworkticketMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.project.invoice.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
+import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticketVo;
 import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
 
 import java.util.List;
@@ -22,6 +23,7 @@ public interface TInvoiceBookingworkticketMapper  extends BaseMapper<TInvoiceBoo
      * @return 预约作业票台账
      */
     public TInvoiceBookingworkticket selectTInvoiceBookingworkticketById(Long id);
+    public List<TInvoiceBookingworkticketVo> selectDetailById(Long id);
 
     /**
      * 查询预约作业票台账列表

+ 2 - 0
master/src/main/java/com/ruoyi/project/invoice/service/ITInvoiceBookingworkticketService.java

@@ -2,6 +2,7 @@ package com.ruoyi.project.invoice.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
+import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticketVo;
 import com.ruoyi.project.invoice.domain.TInvoiceContractor;
 import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
 
@@ -22,6 +23,7 @@ public interface ITInvoiceBookingworkticketService extends IService<TInvoiceBook
      * @return 预约作业票台账
      */
     public TInvoiceBookingworkticket selectTInvoiceBookingworkticketById(Long id);
+    public List<TInvoiceBookingworkticketVo> selectDetailById(Long id);
 
     /**
      * 查询预约作业票台账列表

+ 7 - 0
master/src/main/java/com/ruoyi/project/invoice/service/impl/TInvoiceBookingworkticketServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.project.invoice.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
+import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticketVo;
 import com.ruoyi.project.invoice.domain.TInvoiceContractor;
 import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
 import com.ruoyi.project.invoice.mapper.TInvoiceBookingworkticketMapper;
@@ -44,6 +45,12 @@ public class TInvoiceBookingworkticketServiceImpl extends ServiceImpl<TInvoiceBo
         return tInvoiceBookingworkticketMapper.selectTInvoiceBookingworkticketById(id);
     }
 
+    @Override
+    public List<TInvoiceBookingworkticketVo> selectDetailById(Long id)
+    {
+        return tInvoiceBookingworkticketMapper.selectDetailById(id);
+    }
+
     /**
      * 查询预约作业票台账列表
      *

+ 28 - 6
master/src/main/resources/mybatis/invoice/TInvoiceBookingworkticketMapper.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.invoice.mapper.TInvoiceBookingworkticketMapper">
-    
+
     <resultMap type="TInvoiceBookingworkticket" id="TInvoiceBookingworkticketResult">
         <result property="id"    column="id"    />
         <result property="workUnit"    column="work_unit"    />
@@ -28,6 +28,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="userUnit"    column="user_unit"    />
     </resultMap>
 
+    <resultMap type="TInvoiceBookingworkticketVo" id="TInvoiceBookingworkticketResultVo">
+        <result property="workUnit"    column="work_unit"    />
+        <result property="workArea"    column="work_area"    />
+        <result property="floorLocation"    column="floor_location"    />
+        <result property="workStartTime"    column="work_start_time"    />
+        <result property="workEndTime"    column="work_end_time"    />
+        <result property="contact"    column="contact"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <result property="workType"    column="work_type"    />
+        <result property="riskLevel"    column="risk_level"    />
+        <result property="workDescription"    column="work_description"    />
+        <result property="workPeopleNumber"    column="work_people_number"    />
+        <result property="estimateWorktime"    column="estimate_worktime"    />
+        <result property="status"    column="status"    />
+    </resultMap>
+
     <sql id="selectTInvoiceBookingworkticketVo">
         select d.id, d.work_unit, d.work_area, d.unit_number, d.floor_location, d.work_start_time, d.work_end_time, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.contact, d.phonenumber, d.status, d.dept_id, d.user_mg ,d.user_unit,s.dept_name,d.filename,d.reservation_number from t_invoice_bookingworkticket d
       left join sys_dept s on s.dept_id = d.dept_id
@@ -35,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTInvoiceBookingworkticketList" parameterType="TInvoiceBookingworkticket" resultMap="TInvoiceBookingworkticketResult">
         <include refid="selectTInvoiceBookingworkticketVo"/>
-        <where>  
+        <where>
             <if test="workUnit != null "> and work_unit = #{workUnit}</if>
             <if test="workArea != null "> and work_area = #{workArea}</if>
             <if test="unitNumber != null "> and unit_number = #{unitNumber}</if>
@@ -59,13 +75,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <!-- 数据范围过滤 -->
         ${params.dataScope}
     </select>
-    
+
+    <select id="selectDetailById" parameterType="Long" resultMap="TInvoiceBookingworkticketResultVo">
+        select a.work_unit,a.work_area,a.floor_location,a.work_start_time,a.work_end_time,a.status,b.work_type,b.risk_level,b.work_description,b.work_people_number,b.estimate_worktime,a.contact,a.phonenumber
+        from  t_invoice_bookingworkticket a,t_invoice_workcontent b
+        where a.id=b.bookingticket_id and  a.id=#{id} and a.del_flag = 0
+    </select>
+
     <select id="selectTInvoiceBookingworkticketById" parameterType="Long" resultMap="TInvoiceBookingworkticketResult">
         <include refid="selectTInvoiceBookingworkticketVo"/>
         where id = #{id}
         and d.del_flag = 0
     </select>
-        
+
     <insert id="insertTInvoiceBookingworkticket" parameterType="TInvoiceBookingworkticket" useGeneratedKeys = "true" keyProperty = "id">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT t_bookingworkticket_seq.NEXTVAL as id FROM DUAL
@@ -153,5 +175,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+</mapper>

+ 100 - 5
ui/src/views/approve/approveDetail/invoice-detail.vue

@@ -4,12 +4,11 @@
     :close-on-click-modal="false"
     :visible.sync="visible"
     :append-to-body="true">
-    <el-form :model="taskForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="" label-width="80px">
+    <el-form :model="taskForm" :rules="dataRule"  ref="dataForm" @keyup.enter.native="" label-width="80px">
       <el-form-item :label="$t('申请开票')">
-        <el-table :data="devList" border style="width: 100%;">
-          <el-table-column label="作业单位" align="center" prop="workUnit" :formatter="workUnitFormat"/>
-          <el-table-column label="作业区域" align="center" prop="workArea" :formatter="workAreaFormat"/>
-          <el-table-column label="单元号" align="center" prop="unitNumber" :formatter="unitNumberFormat"/>
+        <el-table :data="devList" :span-method="mergeMethod" border style="width: 100%;">
+          <el-table-column label="作业单位" align="center" prop="workUnit" :show-overflow-tooltip="true"/>
+          <el-table-column label="作业区域单元" align="center" prop="workArea" :show-overflow-tooltip="true"/>
           <el-table-column label="楼层位置" align="center" prop="floorLocation" :formatter="floorLocationFormat"/>
           <el-table-column label=" 作业开始时间" align="center" prop="workStartTime" width="100">
             <template slot-scope="scope">
@@ -21,6 +20,11 @@
               <span>{{ parseTime(scope.row.workEndTime, '{y}-{m}-{d}') }}</span>
             </template>
           </el-table-column>
+          <el-table-column label="作业类型" align="center" prop="workType" :formatter="workTypeFormat"  :show-overflow-tooltip="true"/>
+          <el-table-column label="风险等级" align="center" prop="riskLevel" :formatter="riskLevelFormat"/>
+          <el-table-column label="作业内容描述" align="center" prop="workDescription" :show-overflow-tooltip="true"/>
+          <el-table-column label="作业人员数" align="center" prop="workPeopleNumber" :show-overflow-tooltip="true"/>
+          <el-table-column label="预计作业时间" align="center" prop="estimateWorktime" :show-overflow-tooltip="true"/>
           <el-table-column label="联系人" align="center" prop="contact" :show-overflow-tooltip="true"/>
           <el-table-column label="联系方式" align="center" prop="phonenumber" :show-overflow-tooltip="true"/>
           <el-table-column label="状态" align="center" prop="status" width="100" :formatter="statusFormat"/>
@@ -267,6 +271,7 @@ export default {
         this.historyLoading = false
       });
       getInvoice(id).then(response => {
+        console.log(123123123123123)
         console.log(response)
         this.taskForm.businessKey = response.data.id
         this.dataForm.userId = response.data.userId
@@ -335,6 +340,7 @@ export default {
       };
       this.resetForm("form");
       this.historyList=[];
+      this.devList=[];
     },
 
     /** 提交按钮 */
@@ -368,6 +374,95 @@ export default {
       this.$nextTick(() => {
         this.$refs.recordDeal.init(devList,dataForm);
       })
+    },//合并单元格
+    mergeMethod({ row, column, rowIndex, columnIndex }) {
+      // console.log(row)
+      if (columnIndex === 0) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+      if (columnIndex === 1) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+      if (columnIndex === 2) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+      if (columnIndex === 3) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+      if (columnIndex === 4) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+      if (columnIndex === 10) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }if (columnIndex === 11) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }if (columnIndex === 12) {
+        const _row = this.setTable(this.devList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+
+
+    },
+    //单元格整理
+    setTable(tableData) {
+      let spanArr = [],
+        concat = 0;
+      tableData.forEach((item, index) => {
+        if (index === 0) {
+          spanArr.push(1);
+        } else {
+          if (item.workUnit === tableData[index - 1].workUnit) {
+            //第一列需合并相同内容的判断条件
+            spanArr[concat] += 1;
+            spanArr.push(0);
+          } else {
+            spanArr.push(1);
+            concat = index;
+          }
+        }
+      });
+      return {
+        merge: spanArr
+      };
     },
 }
 }

+ 7 - 6
ui/src/views/invoice/bookingworkticket/index.vue

@@ -591,7 +591,7 @@ export default {
     },
     addAprrove(row) {
       this.reset();
-  
+
       var rows = row ? [row] : this.bookingworkticketList.map(item => {
         return item
       })
@@ -618,7 +618,7 @@ export default {
             this.approveForm.isSpecial = 1
           }
         this.approveForm.userSupId=row.bookingworkticket.userMg;
-    
+
         addInvoice(this.approveForm).then(response => {
           this.msgSuccess(this.$t('预约成功'));
           // this.visible = false;
@@ -857,7 +857,7 @@ export default {
         this.checkCategoryPromotion(this.form.userUnit);
     //  console.log(row.floorLocation)  将后台的字符串数组重新转换为el-select要的数组格式
        let arr=row.floorLocation.split(",")
-       let st=[] 
+       let st=[]
 		// 将字符串数组的每一项转换成Number,生成一个新的数组
       	for (var arrInt in arr) {
 			  st.push(parseInt(arr[arrInt]))
@@ -876,7 +876,7 @@ export default {
       });
     },
     /** 提交按钮 */
-   submitForm() { 
+   submitForm() {
     let arr=[]
      const basicForm = this.$refs.form;
      arr.push(basicForm)
@@ -919,7 +919,7 @@ export default {
               console.log(this.ruleForm)
             this.approveForm.invoiceId=response.data
             var nowTime = this.getNowFormatDate()
-       
+
              //判断是否涉及 动火 和当日
             if ( this.form.workStartTime &&  this.form.workStartTime ===  nowTime){
               this.approveForm.isToday = 1;
@@ -930,6 +930,7 @@ export default {
                if( this.ruleForm[i].workType===1||this.ruleForm[i].workType===2||
                this.ruleForm[i].workType===3||this.ruleForm[i].workType===15){
               this.approveForm.isSpecial = 1
+                 break;
             }else{
                 this.approveForm.isSpecial = 0
             }
@@ -953,7 +954,7 @@ export default {
           this.msgError("表单校验未通过,每项申请内容都必填");
         }
       });
-    
+
     },
     /** 删除按钮操作 */
     handleDelete(row) {