Эх сурвалжийг харах

张丁 预约作业票关联承包商和区域模块

zhangding 3 жил өмнө
parent
commit
bcbad66d93

+ 8 - 5
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -15,6 +15,7 @@ import com.deepoove.poi.data.PictureRenderData;
 import com.deepoove.poi.data.Pictures;
 import com.deepoove.poi.data.Pictures;
 import com.deepoove.poi.data.Texts;
 import com.deepoove.poi.data.Texts;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
@@ -360,12 +361,14 @@ public class TInvoiceBookingworkticketController extends BaseController
     @PostMapping
     @PostMapping
     public AjaxResult add(@RequestBody TInvoiceBookingworkticket tInvoiceBookingworkticket)
     public AjaxResult add(@RequestBody TInvoiceBookingworkticket tInvoiceBookingworkticket)
     {
     {
-       //先查当前登录的用户关联的承包商信息
-        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        TInvoiceContractor t= tInvoiceBookingworkticketService.selectTInvoiceContractorByName(loginUser.getUsername());
+       //先查当前登录的用户关联的承包商信息, 将名称 联系人 电话 都关联起来
+     //   LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        String createAccount = SecurityUtils.getUsername();
+        TInvoiceContractor t= tInvoiceBookingworkticketService.selectTInvoiceContractorByName(createAccount);
         tInvoiceBookingworkticket.setCreaterCode(getUserId());
         tInvoiceBookingworkticket.setCreaterCode(getUserId());
-     //   tInvoiceBookingworkticket.setContact(t.getContact());
-     //   tInvoiceBookingworkticket.setPhonenumber(t.getPhonenumber());
+        tInvoiceBookingworkticket.setContact(t.getContact());
+        tInvoiceBookingworkticket.setPhonenumber(t.getPhonenumber());
+        tInvoiceBookingworkticket.setWorkUnit(t.getContractorName());
         tInvoiceBookingworkticketService.insertTInvoiceBookingworkticket(tInvoiceBookingworkticket);
         tInvoiceBookingworkticketService.insertTInvoiceBookingworkticket(tInvoiceBookingworkticket);
 
 
         Long didi=tInvoiceBookingworkticket.getId();
         Long didi=tInvoiceBookingworkticket.getId();

+ 6 - 7
master/src/main/java/com/ruoyi/project/invoice/domain/TInvoiceBookingworkticket.java

@@ -23,13 +23,12 @@ public class TInvoiceBookingworkticket extends BaseEntity
     /** 唯一标识ID */
     /** 唯一标识ID */
     private Long id;
     private Long id;
 
 
-    /** 作业单位 */
     @Excel(name = "作业单位")
     @Excel(name = "作业单位")
-    private Long workUnit;
+    private String workUnit;
 
 
     /** 作业区域 */
     /** 作业区域 */
     @Excel(name = "作业区域")
     @Excel(name = "作业区域")
-    private Long workArea;
+    private String workArea;
 
 
     /** 单元号 */
     /** 单元号 */
     @Excel(name = "单元号")
     @Excel(name = "单元号")
@@ -115,21 +114,21 @@ public class TInvoiceBookingworkticket extends BaseEntity
     {
     {
         return id;
         return id;
     }
     }
-    public void setWorkUnit(Long workUnit)
+    public void setWorkUnit(String workUnit)
     {
     {
         this.workUnit = workUnit;
         this.workUnit = workUnit;
     }
     }
 
 
-    public Long getWorkUnit()
+    public String getWorkUnit()
     {
     {
         return workUnit;
         return workUnit;
     }
     }
-    public void setWorkArea(Long workArea)
+    public void setWorkArea(String workArea)
     {
     {
         this.workArea = workArea;
         this.workArea = workArea;
     }
     }
 
 
-    public Long getWorkArea()
+    public String getWorkArea()
     {
     {
         return workArea;
         return workArea;
     }
     }

+ 1 - 1
master/src/main/java/com/ruoyi/project/invoice/mapper/TInvoiceContractorMapper.java

@@ -62,5 +62,5 @@ public interface TInvoiceContractorMapper
      */
      */
     public int deleteTInvoiceContractorByIds(Long[] ids);
     public int deleteTInvoiceContractorByIds(Long[] ids);
 
 
-    public TInvoiceContractor selectTInvoiceContractorByName(String userId);
+    public TInvoiceContractor selectTInvoiceContractorByName(String username);
 }
 }

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

@@ -115,8 +115,8 @@ public interface ITInvoiceBookingworkticketService extends IService<TInvoiceBook
     /**
     /**
      * 根据名字找到承包商信息承包商信息信息
      * 根据名字找到承包商信息承包商信息信息
      *
      *
-     * @param userId 承包商信息ID
+     * @param username 承包商信息ID
      * @return 结果
      * @return 结果
      */
      */
-    public  TInvoiceContractor selectTInvoiceContractorByName(String userId);
+    public  TInvoiceContractor selectTInvoiceContractorByName(String username);
 }
 }

+ 3 - 3
master/src/main/java/com/ruoyi/project/invoice/service/impl/TInvoiceContractorServiceImpl.java

@@ -96,11 +96,11 @@ public class TInvoiceContractorServiceImpl implements ITInvoiceContractorService
     /**
     /**
      * 根据名字找到承包商信息承包商信息信息
      * 根据名字找到承包商信息承包商信息信息
      *
      *
-     * @param userId 承包商信息ID
+     * @param username 承包商信息ID
      * @return 结果
      * @return 结果
      */
      */
     @Override
     @Override
-    public TInvoiceContractor selectTInvoiceContractorByName(String userId) {
-      return  tInvoiceContractorMapper.selectTInvoiceContractorByName(userId);
+    public TInvoiceContractor selectTInvoiceContractorByName(String username) {
+      return  tInvoiceContractorMapper.selectTInvoiceContractorByName(username);
     }
     }
 }
 }

+ 1 - 1
master/src/main/resources/mybatis/invoice/TInvoiceContractorMapper.xml

@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectTInvoiceContractorByName" parameterType="String" resultMap="TInvoiceContractorResult">
     <select id="selectTInvoiceContractorByName" parameterType="String" resultMap="TInvoiceContractorResult">
         <include refid="selectTInvoiceContractorVo"/>
         <include refid="selectTInvoiceContractorVo"/>
-        where username = #{username}
+        where contractor_name = #{username}
     </select>
     </select>
 
 
     <insert id="insertTInvoiceContractor" parameterType="TInvoiceContractor">
     <insert id="insertTInvoiceContractor" parameterType="TInvoiceContractor">

+ 58 - 30
ui/src/views/invoice/bookingworkticket/index.vue

@@ -2,14 +2,13 @@
   <div class="app-container">
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="作业单位" prop="workUnit">
       <el-form-item label="作业单位" prop="workUnit">
-        <el-select v-model="queryParams.workUnit" placeholder="请选择作业单位" clearable size="small">
-             <el-option
-              v-for="dict in workUnitOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="parseInt(dict.dictValue)"
-             ></el-option>
-        </el-select>
+      <el-input
+          v-model="queryParams.workUnit"
+          placeholder="请输入作业单位"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
       </el-form-item>
       </el-form-item>
       <el-form-item label="作业区域" prop="workArea">
       <el-form-item label="作业区域" prop="workArea">
         <el-select v-model="queryParams.workArea" placeholder="请选择作业区域" clearable size="small">
         <el-select v-model="queryParams.workArea" placeholder="请选择作业区域" clearable size="small">
@@ -114,8 +113,8 @@
 
 
     <el-table v-loading="loading" :data="bookingworkticketList" :span-method="mergeMethod"  @selection-change="handleSelectionChange" :height="clientHeight" border>
     <el-table v-loading="loading" :data="bookingworkticketList" :span-method="mergeMethod"  @selection-change="handleSelectionChange" :height="clientHeight" border>
 
 
-      <el-table-column label="作业单位" align="center" prop="bookingworkticket.workUnit" :formatter="workUnitFormat"/>
-      <el-table-column label="作业区域单元" align="center" prop="bookingworkticket.workArea" :formatter="workAreaFormat"/>
+      <el-table-column label="作业单位" align="center" prop="bookingworkticket.workUnit" :show-overflow-tooltip="true"/>
+      <el-table-column label="作业区域单元" align="center" prop="bookingworkticket.workArea" :show-overflow-tooltip="true"/>
       <el-table-column label="楼层位置" align="center" prop="bookingworkticket.floorLocation" :formatter="floorLocationFormat"/>
       <el-table-column label="楼层位置" align="center" prop="bookingworkticket.floorLocation" :formatter="floorLocationFormat"/>
       <el-table-column label=" 作业开始时间" align="center" prop="workStartTime" width="100">
       <el-table-column label=" 作业开始时间" align="center" prop="workStartTime" width="100">
         <template slot-scope="scope">
         <template slot-scope="scope">
@@ -187,14 +186,7 @@
        <el-row>
        <el-row>
         <el-col :span="12">
         <el-col :span="12">
             <el-form-item label="承包商" prop="workUnit">
             <el-form-item label="承包商" prop="workUnit">
-          <el-select v-model="form.workUnit" placeholder="请选择作业单位">
-            <el-option
-              v-for="dict in workUnitOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="parseInt(dict.dictValue)"
-             ></el-option>
-          </el-select>
+        <el-input v-model="form.workUnit" placeholder="请输入作业单位" :disabled="edit"/>
         </el-form-item>
         </el-form-item>
           </el-col>
           </el-col>
         <el-col :span="12">
         <el-col :span="12">
@@ -202,9 +194,9 @@
           <el-select v-model="form.workArea" placeholder="请选择作业区域">
           <el-select v-model="form.workArea" placeholder="请选择作业区域">
              <el-option
              <el-option
             v-for="dict in workAreaOptions"
             v-for="dict in workAreaOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="parseInt(dict.dictValue)"
+            :key="dict.id"
+            :label="dict.workArea"
+            :value="dict.workArea"
                  ></el-option>
                  ></el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
@@ -382,6 +374,7 @@
 <script>
 <script>
 import { listBookingworkticket, getBookingworkticket, delBookingworkticket, addBookingworkticket, updateBookingworkticket, exportBookingworkticket, importTemplate, seeBookingworkticket} from "@/api/invoice/bookingworkticket";
 import { listBookingworkticket, getBookingworkticket, delBookingworkticket, addBookingworkticket, updateBookingworkticket, exportBookingworkticket, importTemplate, seeBookingworkticket} from "@/api/invoice/bookingworkticket";
 import { listWorkcontent, getWorkcontent, delWorkcontent, addWorkcontent, updateWorkcontent, exportWorkcontent,getWorkcontentBybookingticketId} from "@/api/invoice/workcontent";
 import { listWorkcontent, getWorkcontent, delWorkcontent, addWorkcontent, updateWorkcontent, exportWorkcontent,getWorkcontentBybookingticketId} from "@/api/invoice/workcontent";
+import { listDevice, getDevice, delDevice, updateDevice, exportDevice} from "@/api/invoice/device";
 import { treeselect } from "@/api/system/dept";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import Treeselect from "@riophae/vue-treeselect";
@@ -394,8 +387,11 @@ export default {
   components: { Treeselect,AddApprove},
   components: { Treeselect,AddApprove},
   data() {
   data() {
     return {
     return {
+      //禁用
+      edit:true,
       ppt:false,
       ppt:false,
       pptView:false,
       pptView:false,
+      imgs:[],
       tInvoiceWorkcontentList:[],
       tInvoiceWorkcontentList:[],
         //作业内容表头
         //作业内容表头
       tabletou:['作业类型','风险等级','作业内容描述','作业人员数','作业预计时间','监护人单位'],
       tabletou:['作业类型','风险等级','作业内容描述','作业人员数','作业预计时间','监护人单位'],
@@ -403,8 +399,6 @@ export default {
       username:"",
       username:"",
       addAprroveVisible: false,
       addAprroveVisible: false,
       hisAprroveVisible: false,
       hisAprroveVisible: false,
-      //bookticked关联ID
-      btid:"",
       // 遮罩层
       // 遮罩层
       loading: true,
       loading: true,
       loadingFlash: false,
       loadingFlash: false,
@@ -500,8 +494,8 @@ export default {
          flag: true,
          flag: true,
       // 表单校验
       // 表单校验
       rules: {
       rules: {
-        workUnit: [
-          { required: true, message: "作业单位不能为空", trigger: "blur" }
+        workArea: [
+          { required: true, message: "作业区域不能为空", trigger: "blur" }
         ],
         ],
          riskLevel: [
          riskLevel: [
           { required: true, message: "风险等级不能为空", trigger: "blur" }
           { required: true, message: "风险等级不能为空", trigger: "blur" }
@@ -521,13 +515,13 @@ export default {
           this.clientHeight = document.body.clientHeight -250
           this.clientHeight = document.body.clientHeight -250
       })
       })
            this.getList();
            this.getList();
-    this.getTreeselect();
+        this.getTreeselect();
+        //初始化作业区域
+        this.getDeviceup();
       this.getDicts("booking_work_status").then(response => {
       this.getDicts("booking_work_status").then(response => {
       this.statusOptions = response.data;
       this.statusOptions = response.data;
     });
     });
-    this.getDicts("book_work_area").then(response => {
-      this.workAreaOptions = response.data;
-    });
+
     this.getDicts("book_unit_number").then(response => {
     this.getDicts("book_unit_number").then(response => {
       this.unitNumberOptions = response.data;
       this.unitNumberOptions = response.data;
     });
     });
@@ -555,6 +549,25 @@ export default {
 
 
   },
   },
   methods: {
   methods: {
+    //得到区域
+    getDeviceup(){
+      const queryForm= {
+        pageNum: 1,
+        pageSize: 20,
+        devName: null,
+        workArea: null,
+        regionalHead: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null
+      };
+          listDevice(queryForm).then(response => {
+           this.workAreaOptions=response.rows
+          });
+    },
     addAprrove(row) {
     addAprrove(row) {
       this.reset();
       this.reset();
       const id = row.bookingticketId || this.ids
       const id = row.bookingticketId || this.ids
@@ -867,7 +880,14 @@ export default {
         //合并单元格
         //合并单元格
       mergeMethod({ row, column, rowIndex, columnIndex }) {
       mergeMethod({ row, column, rowIndex, columnIndex }) {
       // console.log(row)
       // console.log(row)
-       //  console.log(column)
+       if (columnIndex === 0) {
+          const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
+          return {
+            rowspan: _row,
+            colspan: _col
+          };
+        }
         if (columnIndex === 1) {
         if (columnIndex === 1) {
           const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
           const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
           const _col = _row > 0 ? 1 : 0;
           const _col = _row > 0 ? 1 : 0;
@@ -875,6 +895,14 @@ export default {
             rowspan: _row,
             rowspan: _row,
             colspan: _col
             colspan: _col
           };
           };
+        }
+         if (columnIndex === 10) {
+          const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
+          return {
+            rowspan: _row,
+            colspan: _col
+          };
         }
         }
         if (columnIndex === 11) {
         if (columnIndex === 11) {
           const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
           const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];