瀏覽代碼

张丁 修改预约作业票表结构和curd逻辑等

zhangding 3 年之前
父節點
當前提交
b8aee13aab

+ 30 - 22
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -53,11 +53,7 @@ public class TInvoiceBookingworkticketController extends BaseController
     @Autowired
     private ITInvoiceBookingworkticketService tInvoiceBookingworkticketService;
 
-    @Autowired
-    private ITInvoiceContractorService tInvoiceContractorService;
 
-    @Autowired
-    private ITInvoiceWorkcontentService tInvoiceWorkcontentService;
     /**
      * 查询预约作业票台账列表
      */
@@ -66,16 +62,19 @@ public class TInvoiceBookingworkticketController extends BaseController
     public TableDataInfo list(TInvoiceBookingworkticket tInvoiceBookingworkticket)
     {
         startPage();
-        List<TInvoiceBookingworkticket>  newList =new ArrayList<>();
-        List<TInvoiceBookingworkticket> list = tInvoiceBookingworkticketService.selectTInvoiceBookingworkticketList(tInvoiceBookingworkticket);
-        for(int i=0;i<list.size();i++){
-            //遍历每一条主表  找到所有的子表
-            TInvoiceBookingworkticket t= list.get(i);
-           List<TInvoiceWorkcontent>  l= tInvoiceWorkcontentService.selectTInvoiceWorkcontentBybookingticketId(t.getId());
-            t.settInvoiceWorkcontentList(l);
-            newList.add(t);
+        List<TInvoiceWorkcontent>  newtInvoiceWorkcontentList =new ArrayList<>();
+        List<TInvoiceBookingworkticket> bookingworkticketList = tInvoiceBookingworkticketService.selectTInvoiceBookingworkticketList(tInvoiceBookingworkticket);
+        for(int i=0;i<bookingworkticketList.size();i++){
+            //遍历每一条主表  找到所有的子表 根据每条子表 将主表也同步到每一条数据
+            TInvoiceBookingworkticket bookingworkticket= bookingworkticketList.get(i);
+           List<TInvoiceWorkcontent>  workcontentList = tInvoiceBookingworkticketService.selectTInvoiceWorkcontentBybookingticketId(bookingworkticket.getId());
+           for (TInvoiceWorkcontent workcontent : workcontentList) {
+                       workcontent.setBookingworkticket(bookingworkticket);
+               newtInvoiceWorkcontentList.add(workcontent);
+           }
+
         }
-        return getDataTable(newList);
+        return getDataTable(newtInvoiceWorkcontentList);
     }
 
     /**
@@ -99,7 +98,7 @@ public class TInvoiceBookingworkticketController extends BaseController
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
       TInvoiceBookingworkticket t=  tInvoiceBookingworkticketService.selectTInvoiceBookingworkticketById(id);
-      List<TInvoiceWorkcontent>  list= tInvoiceWorkcontentService.selectTInvoiceWorkcontentBybookingticketId(t.getId());
+      List<TInvoiceWorkcontent>  list= tInvoiceBookingworkticketService.selectTInvoiceWorkcontentBybookingticketId(t.getId());
            t.settInvoiceWorkcontentList(list);
         return AjaxResult.success(t);
     }
@@ -114,10 +113,10 @@ public class TInvoiceBookingworkticketController extends BaseController
     {
        //先查当前登录的用户关联的承包商信息
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        TInvoiceContractor t= tInvoiceContractorService.selectTInvoiceContractorByName(loginUser.getUsername());
+        TInvoiceContractor t= tInvoiceBookingworkticketService.selectTInvoiceContractorByName(loginUser.getUsername());
         tInvoiceBookingworkticket.setCreaterCode(getUserId());
-      /*  tInvoiceBookingworkticket.setContact(t.getContact());
-        tInvoiceBookingworkticket.setPhonenumber(t.getPhonenumber());*/
+     //   tInvoiceBookingworkticket.setContact(t.getContact());
+     //   tInvoiceBookingworkticket.setPhonenumber(t.getPhonenumber());
         tInvoiceBookingworkticketService.insertTInvoiceBookingworkticket(tInvoiceBookingworkticket);
         Long didi=tInvoiceBookingworkticket.getId();
         List<TInvoiceWorkcontent>  w=tInvoiceBookingworkticket.gettInvoiceWorkcontentList();
@@ -125,7 +124,7 @@ public class TInvoiceBookingworkticketController extends BaseController
         for(int i=0;i<w.size();i++){
              TInvoiceWorkcontent wt= w.get(i);
             wt.setBookingticketId(didi);
-            tInvoiceWorkcontentService.insertTInvoiceWorkcontent(wt);
+            tInvoiceBookingworkticketService.insertTInvoiceWorkcontent(wt);
         }
         return AjaxResult.success(didi);
     }
@@ -138,11 +137,20 @@ public class TInvoiceBookingworkticketController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TInvoiceBookingworkticket tInvoiceBookingworkticket)
     {
-        List<TInvoiceWorkcontent>  list =tInvoiceBookingworkticket.gettInvoiceWorkcontentList();
-        for(int i=0;i<list.size();i++){
-            TInvoiceWorkcontent wt= list.get(i);
-            tInvoiceWorkcontentService.updateTInvoiceWorkcontent(wt);
+        //这是修改时上传的 list ,先全部清空,在重新添加现有的
+        List<Long>   ids =new ArrayList<>();
+         List<TInvoiceWorkcontent>  tInvoiceWorkcontentList =tInvoiceBookingworkticket.gettInvoiceWorkcontentList();
+      List<TInvoiceWorkcontent> oldtInvoiceWorkcontentList= tInvoiceBookingworkticketService.selectTInvoiceWorkcontentBybookingticketId(tInvoiceBookingworkticket.getId());
+        for (TInvoiceWorkcontent workcontent : oldtInvoiceWorkcontentList) {
+        ids.add((workcontent.getId()));
+        }
+        Long[] workcontentIds=ids.toArray(new Long[0]);
+         tInvoiceBookingworkticketService.deleteTInvoiceWorkcontentByIds(workcontentIds);
+        for (TInvoiceWorkcontent workcontent : tInvoiceWorkcontentList) {
+            workcontent.setBookingticketId(tInvoiceBookingworkticket.getId());
+           tInvoiceBookingworkticketService.insertTInvoiceWorkcontent(workcontent);
         }
+
         return toAjax(tInvoiceBookingworkticketService.updateTInvoiceBookingworkticket(tInvoiceBookingworkticket));
     }
 

+ 11 - 0
master/src/main/java/com/ruoyi/project/invoice/domain/TInvoiceWorkcontent.java

@@ -69,6 +69,8 @@ public class TInvoiceWorkcontent extends BaseEntity
     @Excel(name = "关联的预约开票ID")
     private Long bookingticketId;
 
+    private TInvoiceBookingworkticket bookingworkticket;
+
     /** 部门编号 */
     @Excel(name = "部门编号")
     private Long deptId;
@@ -216,7 +218,16 @@ public class TInvoiceWorkcontent extends BaseEntity
             .append("guardianUnit", getGuardianUnit())
             .append("estimateWorktime", getEstimateWorktime())
             .append("bookingticketId", getBookingticketId())
+                .append("bookingworkticket", getBookingworkticket())
             .append("deptId", getDeptId())
             .toString();
     }
+
+    public TInvoiceBookingworkticket getBookingworkticket() {
+        return bookingworkticket;
+    }
+
+    public void setBookingworkticket(TInvoiceBookingworkticket bookingworkticket) {
+        this.bookingworkticket = bookingworkticket;
+    }
 }

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

@@ -3,6 +3,7 @@ package com.ruoyi.project.invoice.mapper;
 import java.util.List;
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
+import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
 
 /**
  * 预约作业票台账Mapper接口
@@ -60,4 +61,12 @@ public interface TInvoiceBookingworkticketMapper
      * @return 结果
      */
     public int deleteTInvoiceBookingworkticketByIds(Long[] ids);
+
+    /**
+     * 关联ID查询预约作业票台账信息
+     *
+     * @param bookingticketId 预约作业票台账关联id
+     * @return 结果
+     */
+    List<TInvoiceWorkcontent> selectTInvoiceWorkcontentBybookingticketId(Long bookingticketId);
 }

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

@@ -2,6 +2,8 @@ package com.ruoyi.project.invoice.service;
 
 import java.util.List;
 import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
+import com.ruoyi.project.invoice.domain.TInvoiceContractor;
+import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
 
 /**
  * 预约作业票台账Service接口
@@ -58,4 +60,61 @@ public interface ITInvoiceBookingworkticketService
      * @return 结果
      */
     public int deleteTInvoiceBookingworkticketById(Long id);
+
+    /**
+     *根据关联ID 查询预约作业内容
+     *
+     * @param bookingticketId 预约作业内容bookingticketId
+     * @return 预约作业内容
+     */
+    public  List<TInvoiceWorkcontent> selectTInvoiceWorkcontentBybookingticketId(Long bookingticketId);
+
+    /**
+     * 根据名字找到承包商信息承包商信息信息
+     *
+     * @param userid 承包商信息ID
+     * @return 结果
+     */
+   /* public TInvoiceContractor selectTInvoiceContractorByName(String userId);*/
+
+    /**
+     * 新增预约作业内容
+     *
+     * @param tInvoiceWorkcontent 预约作业内容
+     * @return 结果
+     */
+    public int insertTInvoiceWorkcontent(TInvoiceWorkcontent tInvoiceWorkcontent);
+
+    /**
+     * 修改预约作业内容
+     *
+     * @param tInvoiceWorkcontent 预约作业内容
+     * @return 结果
+     */
+    public int updateTInvoiceWorkcontent(TInvoiceWorkcontent tInvoiceWorkcontent);
+
+
+    /**
+     * 批量删除预约作业内容
+     *
+     * @param ids 需要删除的预约作业内容ID
+     * @return 结果
+     */
+    public int deleteTInvoiceWorkcontentByIds(Long[] ids);
+
+    /**
+     * 删除预约作业内容信息
+     *
+     * @param id 预约作业内容ID
+     * @return 结果
+     */
+    public int deleteTInvoiceWorkcontentById(Long id);
+
+    /**
+     * 根据名字找到承包商信息承包商信息信息
+     *
+     * @param userId 承包商信息ID
+     * @return 结果
+     */
+    public  TInvoiceContractor selectTInvoiceContractorByName(String userId);
 }

+ 6 - 1
master/src/main/java/com/ruoyi/project/invoice/service/ITInvoiceContractorService.java

@@ -60,6 +60,11 @@ public interface ITInvoiceContractorService
      */
     public int deleteTInvoiceContractorById(Long id);
 
-
+    /**
+     * 根据名字找到承包商信息承包商信息信息
+     *
+     * @param userId 承包商信息ID
+     * @return 结果
+     */
      public  TInvoiceContractor selectTInvoiceContractorByName(String userId);
 }

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

@@ -2,6 +2,10 @@ package com.ruoyi.project.invoice.service.impl;
 
 import java.util.List;
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.invoice.domain.TInvoiceContractor;
+import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
+import com.ruoyi.project.invoice.mapper.TInvoiceContractorMapper;
+import com.ruoyi.project.invoice.mapper.TInvoiceWorkcontentMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.invoice.mapper.TInvoiceBookingworkticketMapper;
@@ -20,6 +24,12 @@ public class TInvoiceBookingworkticketServiceImpl implements ITInvoiceBookingwor
     @Autowired
     private TInvoiceBookingworkticketMapper tInvoiceBookingworkticketMapper;
 
+    @Autowired
+    private TInvoiceContractorMapper tInvoiceContractorMapper;
+
+    @Autowired
+    private TInvoiceWorkcontentMapper tInvoiceWorkcontentMapper;
+
     /**
      * 查询预约作业票台账
      *
@@ -92,4 +102,74 @@ public class TInvoiceBookingworkticketServiceImpl implements ITInvoiceBookingwor
     {
         return tInvoiceBookingworkticketMapper.deleteTInvoiceBookingworkticketById(id);
     }
+
+    /**
+     * 关联ID查询预约作业票台账信息
+     *
+     * @param bookingticketId 预约作业票台账关联id
+     * @return 结果
+     */
+    @Override
+    public List<TInvoiceWorkcontent> selectTInvoiceWorkcontentBybookingticketId(Long bookingticketId) {
+        return tInvoiceWorkcontentMapper.selectTInvoiceWorkcontentBybookingticketId(bookingticketId);
+    }
+
+    /**
+     * 新增预约作业内容
+     *
+     * @param tInvoiceWorkcontent 预约作业内容
+     * @return 结果
+     */
+    @Override
+    public int insertTInvoiceWorkcontent(TInvoiceWorkcontent tInvoiceWorkcontent)
+    {
+        return tInvoiceWorkcontentMapper.insertTInvoiceWorkcontent(tInvoiceWorkcontent);
+    }
+
+    /**
+     * 修改预约作业内容
+     *
+     * @param tInvoiceWorkcontent 预约作业内容
+     * @return 结果
+     */
+    @Override
+    public int updateTInvoiceWorkcontent(TInvoiceWorkcontent tInvoiceWorkcontent)
+    {
+        return tInvoiceWorkcontentMapper.updateTInvoiceWorkcontent(tInvoiceWorkcontent);
+    }
+
+    /**
+     * 批量删除预约作业内容
+     *
+     * @param ids 需要删除的预约作业内容ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTInvoiceWorkcontentByIds(Long[] ids)
+    {
+        return tInvoiceWorkcontentMapper.deleteTInvoiceWorkcontentByIds(ids);
+    }
+
+    /**
+     * 删除预约作业内容信息
+     *
+     * @param id 预约作业内容ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTInvoiceWorkcontentById(Long id)
+    {
+        return tInvoiceWorkcontentMapper.deleteTInvoiceWorkcontentById(id);
+    }
+
+    /**
+     * 根据名字找到承包商信息承包商信息信息
+     *
+     * @param userId 承包商信息ID
+     * @return 结果
+     */
+    @Override
+    public TInvoiceContractor selectTInvoiceContractorByName(String userId) {
+        return  tInvoiceContractorMapper.selectTInvoiceContractorByName(userId);
+    }
 }

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

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

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

@@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTInvoiceWorkcontentBybookingticketId" parameterType="Long" resultMap="TInvoiceWorkcontentResult">
         <include refid="selectTInvoiceWorkcontentVo"/>
         where d.bookingticket_id = #{bookingticketId}
+        and d.del_flag = 0
     </select>
         
     <insert id="insertTInvoiceWorkcontent" parameterType="TInvoiceWorkcontent">

+ 107 - 73
ui/src/views/invoice/bookingworkticket/index.vue

@@ -21,16 +21,6 @@
                  ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="单元号" prop="unitNumber">
-        <el-select v-model="queryParams.unitNumber" placeholder="请选择单元号" clearable size="small">
-          <el-option
-             v-for="dict in unitNumberOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="parseInt(dict.dictValue)"
-                   ></el-option>
-        </el-select>
-      </el-form-item>
       <el-form-item label="楼层位置" prop="floorLocation">
         <el-select v-model="queryParams.floorLocation" placeholder="请选择楼层位置" clearable size="small">
             <el-option
@@ -89,7 +79,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['invoice:bookingworkticket:add']"
-        >预约</el-button>
+        >新增</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -123,29 +113,30 @@
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="bookingworkticketList" @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 type="selection" width="55" align="center" />
-      <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-column label="楼层位置" align="center" prop="floorLocation" :formatter="floorLocationFormat"/>
+      <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.floorLocation" :formatter="floorLocationFormat"/>
       <el-table-column label=" 作业开始时间" align="center" prop="workStartTime" width="100">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.workStartTime, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.bookingworkticket.workStartTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="作业结束时间" align="center" prop="workEndTime" width="100">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.workEndTime, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.bookingworkticket.workEndTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-        
-                 
-                   
-                   
-      <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" />
+
+      <el-table-column label="作业类型" align="center" prop="workType" :formatter="workTypeFormat"/>
+      <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="bookingworkticket.contact" :show-overflow-tooltip="true"/>
+      <el-table-column label="联系方式" align="center" prop="bookingworkticket.phonenumber" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="bookingworkticket.status" width="100" :formatter="statusFormat" />
       <el-table-column label="操作" align="center" fixed="right" width="200" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -225,16 +216,6 @@
       </el-row>
        <el-row>
         <el-col :span="12">
-        <el-form-item label="单元号" prop="unitNumber">
-          <el-select v-model="form.unitNumber" placeholder="请选择单元号">
-            <el-option
-             v-for="dict in unitNumberOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="parseInt(dict.dictValue)"
-                   ></el-option>
-          </el-select>
-        </el-form-item>
           </el-col>
         <el-col :span="12">
         <el-form-item label="楼层位置" prop="floorLocation">
@@ -298,13 +279,13 @@
             </el-col>
       </el-row>
       </el-form>
-        
+
             <el-form v-for="(ruleForm, index) in ruleForm" :key="index" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
     <el-divider><i class="el-icon-more" style="color:green;font-size:100%"></i><i class="el-icon-more" style="color:green;font-size:100%"></i> <span ><font color="green">关联的作业内容</font></span>
     <i class="el-icon-more" style="color:green;font-size:100%"></i><i class="el-icon-more" style="color:green;font-size:100%"></i></el-divider>
           <el-form-item label="作业内容描述" prop="workDescription">
             <el-input v-model="ruleForm.workDescription"></el-input>
-          </el-form-item> 
+          </el-form-item>
                <el-row>
         <el-col :span="12">
               <el-form-item label="作业类型" prop="workType">
@@ -338,23 +319,13 @@
           </el-form-item>
             </el-col>
         <el-col :span="12">
-              <el-form-item label="监护人单位" prop="guardianUnit">
-        <el-select v-model="ruleForm.guardianUnit" placeholder="请选择监护人单位" clearable size="small">
-          <el-option
-            v-for="dict in guardianUnitOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="parseInt(dict.dictValue)"
-          />
-        </el-select>
+             <el-form-item label="预计作业时间" prop="estimateWorktime">
+        <el-input v-model="ruleForm.estimateWorktime"  style="width: 190px"></el-input>
       </el-form-item>
        </el-col>
       </el-row>
-      <el-form-item label="预计作业时间" prop="estimateWorktime">
-        <el-input v-model="ruleForm.estimateWorktime"  style="width: 190px"></el-input>
-      </el-form-item>
         </el-form>
-        
+
         <el-button @click="resetForm1()">重置</el-button>
         <el-button @click="add">+</el-button>
         <el-button @click="reduce" :disabled="flag">-</el-button>
@@ -456,7 +427,7 @@ export default {
       riskLevelOptions: [],
         // 监护人单位字典
       guardianUnitOptions: [],
-     
+
       // 是否显示弹出层
       open: false,
         // 用户导入参数
@@ -553,7 +524,7 @@ export default {
     this.getDicts("book_guardian_unit").then(response => {
       this.guardianUnitOptions = response.data;
     });
- 
+
   },
   methods: {
 // 表单添加一行
@@ -587,15 +558,18 @@ export default {
         this.loading = true;
        listBookingworkticket(this.queryParams).then(response => {
          this.bookingworkticketList=response.rows;
-        for (let i = 0; i <  this.bookingworkticketList.length; i++) {
-  if( this.bookingworkticketList[i].tInvoiceWorkcontentList) {
-    this.tInvoiceWorkcontentList =  this.bookingworkticketList[i].tInvoiceWorkcontentList
-  }
-        }
-        this.tInvoiceWorkcontentList.tabletou=this.tabletou;
-        this.total = response.total;
-        this.loading = false;
-        console.log(this.tInvoiceWorkcontentList)
+          for(let i = 0; i <  this.bookingworkticketList.length; i++) {
+                  Object.assign(this.bookingworkticketList[i],{workUnit:this.bookingworkticketList[i].bookingworkticket.workUnit}
+                  ,{workArea:this.bookingworkticketList[i].bookingworkticket.workArea}
+                  ,{floorLocation:this.bookingworkticketList[i].bookingworkticket.floorLocation}
+                  ,{contact:this.bookingworkticketList[i].bookingworkticket.contact}
+                  ,{phonenumber:this.bookingworkticketList[i].bookingworkticket.phonenumber}
+                  ,{status:this.bookingworkticketList[i].bookingworkticket.status});
+
+          }
+          console.log(this.bookingworkticketList)
+       this.total = response.total;
+        this.loading = false;       
       });
     },
      /** 查询部门下拉树结构 */
@@ -614,7 +588,7 @@ export default {
     },
     // 字典翻译
     workAreaFormat(row, column) {
-      return this.selectDictLabel(this.workAreaOptions, row.workArea);
+      return this.selectDictLabel(this.workAreaOptions, row.bookingworkticket.workArea);
     },
     // 字典翻译
     unitNumberFormat(row, column) {
@@ -686,7 +660,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
+      this.ids = selection.map(item => item.bookingticketId)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
@@ -695,16 +669,15 @@ export default {
       this.reset();
       this.resetForm1();
         var roles =this.$store.state.user.roles
-  
    this.open = true;
       this.title = "添加预约作业票台账";
-    
-   
+
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
+   //   console.log(row)
+      const id = row.bookingticketId || this.ids
       getBookingworkticket(id).then(response => {
         this.form = response.data;
         this.open = true;
@@ -719,7 +692,7 @@ export default {
           if (this.form.id != null) {
               this.form.tInvoiceWorkcontentList=this.ruleForm
             updateBookingworkticket(this.form).then(response => {
-          
+
               this.msgSuccess("修改成功");
               this.open = false;
               this.getList();
@@ -733,16 +706,16 @@ export default {
               this.getList();
               this.resetForm1();
             });
-        
-              
+
+
           }
         }
       });
-      
+
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
+      const ids = row.bookingticketId || this.ids;
       this.$confirm('是否确认删除?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -799,7 +772,68 @@ export default {
         console.log(this.$store.state.user)
         var userName = this.$store.state.user.roles;
         this.msgSuccess(userName);
-      }
+      },
+        //合并单元格
+      mergeMethod({ row, column, rowIndex, columnIndex }) {
+      // console.log(row)
+       //  console.log(column)
+        if (columnIndex === 1) {
+          const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
+          return {
+            rowspan: _row,
+            colspan: _col
+          };
+        }
+        if (columnIndex === 11) {
+          const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
+          return {
+            rowspan: _row,
+            colspan: _col
+          };
+        }
+         if (columnIndex === 12) {
+          const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
+          const _col = _row > 0 ? 1 : 0;
+          return {
+            rowspan: _row,
+            colspan: _col
+          };
+        }
+        if (columnIndex === 13) {
+          const _row = this.setTable(this.bookingworkticketList).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 {
+            console.log(item)
+            if (item.bookingticketId === tableData[index - 1].bookingticketId) {
+              //第一列需合并相同内容的判断条件
+              spanArr[concat] += 1;
+              spanArr.push(0);
+            } else {
+              spanArr.push(1);
+              concat = index;
+            }
+          }
+        });
+        return {
+          merge: spanArr
+        };
+      },
   }
 };
 </script>