فهرست منبع

Merge remote-tracking branch 'origin/master'

wangggziwen 2 سال پیش
والد
کامیت
34208448f1

+ 10 - 1
master/src/main/java/com/ruoyi/project/ehs/controller/TJobticketController.java

@@ -35,6 +35,8 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
+
 /**
  * 工作票Controller
  *
@@ -53,7 +55,8 @@ public class TJobticketController extends BaseController
 
     @Autowired
     private ISysDeptService iSysDeptService;
-    @Autowired
+
+    @Resource
     private TJobticketMapper tJobticketMapper;
     /**
      * 查询工作票列表
@@ -64,6 +67,11 @@ public class TJobticketController extends BaseController
     {
         startPage();
         List<TJobticket> list = tJobticketService.selectTJobticketList(tJobticket);
+        for (TJobticket t: list
+             ) {
+            List<TJobticket> cList = tJobticketMapper.selectTJobticketChildren(t);
+            t.setChildren(cList);
+        }
         return getDataTable(list);
     }
 
@@ -193,6 +201,7 @@ public class TJobticketController extends BaseController
             tJobticket.setDhzyxkzh(tInvoiceWorkcontent.getDhzyxkzh());
             tJobticket.setUserMg(tInvoiceWorkcontent.getBookingworkticket().getUserMg());
             tJobticket.setUserUnit(tInvoiceWorkcontent.getBookingworkticket().getUserUnit());
+            tJobticket.setTag(tInvoiceWorkcontent.getTag());
             tJobticket.setZypzt("10");
             tJobticket.setQfsj("8:30");
             tJobticket.setKprq(tInvoiceWorkcontent.getBookingworkticket().getWorkStartTime());

+ 23 - 0
master/src/main/java/com/ruoyi/project/ehs/domain/TJobticket.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.ehs.domain;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import com.ruoyi.framework.web.domain.BaseEntity;
@@ -20,6 +22,8 @@ public class TJobticket extends BaseEntity
     /** id */
     private Long id;
 
+    private List<TJobticket> children;
+
     /** 装置 */
     @Excel(name = "装置名称", dictType = "PLANT_DIVIDE")
     private String plantCode;
@@ -150,6 +154,10 @@ public class TJobticket extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
+    /** 索引 */
+    @Excel(name = "索引")
+    private String tag;
+
     /** 查询开始日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date startDate;
@@ -500,6 +508,21 @@ public class TJobticket extends BaseEntity
         return userUnit;
     }
 
+    public List<TJobticket> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<TJobticket> children) {
+        this.children = children;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
 
     @Override
     public String toString() {

+ 7 - 1
master/src/main/java/com/ruoyi/project/ehs/mapper/TJobticketMapper.java

@@ -31,7 +31,13 @@ public interface TJobticketMapper
      */
     @DataScope(deptAlias = "d")
     public List<TJobticket> selectTJobticketList(TJobticket tJobticket);
-
+    /**
+     * 查询工作票列表
+     *
+     * @param tJobticket 工作票
+     * @return 工作票集合
+     */
+    public List<TJobticket> selectTJobticketChildren(TJobticket tJobticket);
     /**
      * 新增工作票
      *

+ 113 - 0
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceTagController.java

@@ -0,0 +1,113 @@
+package com.ruoyi.project.invoice.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.invoice.domain.TInvoiceTag;
+import com.ruoyi.project.invoice.service.ITInvoiceTagService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * 工作票索引Controller
+ *
+ * @author ruoyi
+ * @date 2022-10-09
+ */
+@RestController
+@RequestMapping("/invoice/tag")
+public class TInvoiceTagController extends BaseController
+{
+    @Autowired
+    private ITInvoiceTagService tInvoiceTagService;
+
+    /**
+     * 查询工作票索引列表
+     */
+    @PreAuthorize("@ss.hasPermi('invoice:tag:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TInvoiceTag tInvoiceTag)
+    {
+        startPage();
+        List<TInvoiceTag> list = tInvoiceTagService.selectTInvoiceTagList(tInvoiceTag);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询工作票索引列表
+     */
+    @GetMapping("/listAll")
+    public List<TInvoiceTag> listAll(TInvoiceTag tInvoiceTag)
+    {
+        List<TInvoiceTag> list = tInvoiceTagService.selectTInvoiceTagList(tInvoiceTag);
+        return list;
+    }
+
+    /**
+     * 导出工作票索引列表
+     */
+    @PreAuthorize("@ss.hasPermi('invoice:tag:export')")
+    @Log(title = "工作票索引", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TInvoiceTag tInvoiceTag)
+    {
+        List<TInvoiceTag> list = tInvoiceTagService.selectTInvoiceTagList(tInvoiceTag);
+        ExcelUtil<TInvoiceTag> util = new ExcelUtil<TInvoiceTag>(TInvoiceTag.class);
+        return util.exportExcel(list, "tag");
+    }
+
+    /**
+     * 获取工作票索引详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('invoice:tag:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tInvoiceTagService.selectTInvoiceTagById(id));
+    }
+
+    /**
+     * 新增工作票索引
+     */
+    @PreAuthorize("@ss.hasPermi('invoice:tag:add')")
+    @Log(title = "工作票索引", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TInvoiceTag tInvoiceTag)
+    {
+        return toAjax(tInvoiceTagService.insertTInvoiceTag(tInvoiceTag));
+    }
+
+    /**
+     * 修改工作票索引
+     */
+    @PreAuthorize("@ss.hasPermi('invoice:tag:edit')")
+    @Log(title = "工作票索引", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TInvoiceTag tInvoiceTag)
+    {
+        return toAjax(tInvoiceTagService.updateTInvoiceTag(tInvoiceTag));
+    }
+
+    /**
+     * 删除工作票索引
+     */
+    @PreAuthorize("@ss.hasPermi('invoice:tag:remove')")
+    @Log(title = "工作票索引", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tInvoiceTagService.deleteTInvoiceTagByIds(ids));
+    }
+}

+ 187 - 0
master/src/main/java/com/ruoyi/project/invoice/domain/TInvoiceTag.java

@@ -0,0 +1,187 @@
+package com.ruoyi.project.invoice.domain;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 工作票索引对象 t_invoice_tag
+ *
+ * @author ruoyi
+ * @date 2022-10-09
+ */
+public class TInvoiceTag extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识ID */
+    private Long id;
+
+    /** 索引 */
+    @Excel(name = "索引")
+    private String tag;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private String type;
+
+    /** 状态 0 :正常 ;-1:删除 */
+    private Long delFlag;
+
+    /** 创建人 */
+    private String createrCode;
+
+    /** 创建时间 */
+    private Date createdate;
+
+    /** 修改人 */
+    private Long updaterCode;
+
+    /** 修改时间 */
+    private Date updatedate;
+
+    /** 部门编号 */
+    private Long deptId;
+
+    @TableField(exist = false)
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setTag(String tag)
+    {
+        this.tag = tag;
+    }
+
+    public String getTag()
+    {
+        return tag;
+    }
+    public void setSort(Long sort)
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort()
+    {
+        return sort;
+    }
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(Long updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public Long getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("tag", getTag())
+            .append("sort", getSort())
+            .append("type", getType())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

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

@@ -108,6 +108,8 @@ public class TInvoiceWorkcontent extends BaseEntity
     @TableField(exist = false)
     private String deptName;
 
+    private String tag;
+
     public String getDeptName() {
         return deptName;
     }
@@ -246,6 +248,14 @@ public class TInvoiceWorkcontent extends BaseEntity
         return reservationNumber;
     }
 
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 63 - 0
master/src/main/java/com/ruoyi/project/invoice/mapper/TInvoiceTagMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.invoice.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.invoice.domain.TInvoiceTag;
+
+/**
+ * 工作票索引Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-10-09
+ */
+public interface TInvoiceTagMapper
+{
+    /**
+     * 查询工作票索引
+     *
+     * @param id 工作票索引ID
+     * @return 工作票索引
+     */
+    public TInvoiceTag selectTInvoiceTagById(Long id);
+
+    /**
+     * 查询工作票索引列表
+     *
+     * @param tInvoiceTag 工作票索引
+     * @return 工作票索引集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TInvoiceTag> selectTInvoiceTagList(TInvoiceTag tInvoiceTag);
+
+    /**
+     * 新增工作票索引
+     *
+     * @param tInvoiceTag 工作票索引
+     * @return 结果
+     */
+    public int insertTInvoiceTag(TInvoiceTag tInvoiceTag);
+
+    /**
+     * 修改工作票索引
+     *
+     * @param tInvoiceTag 工作票索引
+     * @return 结果
+     */
+    public int updateTInvoiceTag(TInvoiceTag tInvoiceTag);
+
+    /**
+     * 删除工作票索引
+     *
+     * @param id 工作票索引ID
+     * @return 结果
+     */
+    public int deleteTInvoiceTagById(Long id);
+
+    /**
+     * 批量删除工作票索引
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTInvoiceTagByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/invoice/service/ITInvoiceTagService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.invoice.service;
+
+import java.util.List;
+import com.ruoyi.project.invoice.domain.TInvoiceTag;
+
+/**
+ * 工作票索引Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-10-09
+ */
+public interface ITInvoiceTagService 
+{
+    /**
+     * 查询工作票索引
+     * 
+     * @param id 工作票索引ID
+     * @return 工作票索引
+     */
+    public TInvoiceTag selectTInvoiceTagById(Long id);
+
+    /**
+     * 查询工作票索引列表
+     * 
+     * @param tInvoiceTag 工作票索引
+     * @return 工作票索引集合
+     */
+    public List<TInvoiceTag> selectTInvoiceTagList(TInvoiceTag tInvoiceTag);
+
+    /**
+     * 新增工作票索引
+     * 
+     * @param tInvoiceTag 工作票索引
+     * @return 结果
+     */
+    public int insertTInvoiceTag(TInvoiceTag tInvoiceTag);
+
+    /**
+     * 修改工作票索引
+     * 
+     * @param tInvoiceTag 工作票索引
+     * @return 结果
+     */
+    public int updateTInvoiceTag(TInvoiceTag tInvoiceTag);
+
+    /**
+     * 批量删除工作票索引
+     * 
+     * @param ids 需要删除的工作票索引ID
+     * @return 结果
+     */
+    public int deleteTInvoiceTagByIds(Long[] ids);
+
+    /**
+     * 删除工作票索引信息
+     * 
+     * @param id 工作票索引ID
+     * @return 结果
+     */
+    public int deleteTInvoiceTagById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/invoice/service/impl/TInvoiceTagServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.invoice.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.invoice.mapper.TInvoiceTagMapper;
+import com.ruoyi.project.invoice.domain.TInvoiceTag;
+import com.ruoyi.project.invoice.service.ITInvoiceTagService;
+
+/**
+ * 工作票索引Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-10-09
+ */
+@Service
+public class TInvoiceTagServiceImpl implements ITInvoiceTagService
+{
+    @Autowired
+    private TInvoiceTagMapper tInvoiceTagMapper;
+
+    /**
+     * 查询工作票索引
+     *
+     * @param id 工作票索引ID
+     * @return 工作票索引
+     */
+    @Override
+    public TInvoiceTag selectTInvoiceTagById(Long id)
+    {
+        return tInvoiceTagMapper.selectTInvoiceTagById(id);
+    }
+
+    /**
+     * 查询工作票索引列表
+     *
+     * @param tInvoiceTag 工作票索引
+     * @return 工作票索引
+     */
+    @Override
+    public List<TInvoiceTag> selectTInvoiceTagList(TInvoiceTag tInvoiceTag)
+    {
+        return tInvoiceTagMapper.selectTInvoiceTagList(tInvoiceTag);
+    }
+
+    /**
+     * 新增工作票索引
+     *
+     * @param tInvoiceTag 工作票索引
+     * @return 结果
+     */
+    @Override
+    public int insertTInvoiceTag(TInvoiceTag tInvoiceTag)
+    {
+        return tInvoiceTagMapper.insertTInvoiceTag(tInvoiceTag);
+    }
+
+    /**
+     * 修改工作票索引
+     *
+     * @param tInvoiceTag 工作票索引
+     * @return 结果
+     */
+    @Override
+    public int updateTInvoiceTag(TInvoiceTag tInvoiceTag)
+    {
+        return tInvoiceTagMapper.updateTInvoiceTag(tInvoiceTag);
+    }
+
+    /**
+     * 批量删除工作票索引
+     *
+     * @param ids 需要删除的工作票索引ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTInvoiceTagByIds(Long[] ids)
+    {
+        return tInvoiceTagMapper.deleteTInvoiceTagByIds(ids);
+    }
+
+    /**
+     * 删除工作票索引信息
+     *
+     * @param id 工作票索引ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTInvoiceTagById(Long id)
+    {
+        return tInvoiceTagMapper.deleteTInvoiceTagById(id);
+    }
+}

+ 21 - 5
master/src/main/resources/mybatis/ehs/TJobticketMapper.xml

@@ -44,17 +44,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="postponeNumber"    column="postpone_number"    />
         <result property="userMg"    column="user_mg"    />
         <result property="userUnit"    column="user_unit"    />
+        <result property="tag"    column="tag"    />
     </resultMap>
 
     <sql id="selectTJobticketVo">
         select d.id, d.plant_code, d.kprq, d.qfsj, d.qfbz, d.qfr, d.xpxp, d.yqxkzh, d.whgzxkzh, d.dhzyxkzh, d.hpjb, d.xzkjxkzh, d.content, d.byclxr, d.sgdw, d.lxr, d.lxdh, d.xpsj, d.zypzt, d.jccdr, d.wcxxbh, d.wcxzt, d.cxsj,
-               d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.postpone_number,d.user_mg,d.user_unit, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_jobticket d
+               d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.postpone_number,d.user_mg,d.user_unit, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks,d.tag ,s.dept_name from t_jobticket d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
     <select id="selectTJobticketList" parameterType="TJobticket" resultMap="TJobticketResult">
         <include refid="selectTJobticketVo"/>
-       where  d.id in (SELECT MAX(id) FROM t_jobticket u
         <where>
             <if test="startDate != null ">and kprq <![CDATA[>=]]> #{startDate}</if>
             <if test="endDate != null">and kprq <![CDATA[<=]]>#{endDate}</if>
@@ -69,12 +69,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="postponeNumber != null "> and postpone_number = #{postponeNumber}</if>
             <if test="userMg != null "> and user_mg = #{userMg}</if>
             <if test="userUnit != null "> and user_unit = #{userUnit}</if>
-            and u.del_flag = 0
+            <if test="tag != null "> and tag = #{tag}</if>
+            and d.del_flag = 0 and xpxp = 10
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
-        GROUP BY u.xzkjxkzh,u.mbzyxkzh,u.gczyxkzh,u.whgzxkzh,u.dhzyxkzh,u.yqxkzh)
-        order by d.kprq  desc,d.yqxkzh asc
+        order by d.kprq desc
+    </select>
+
+    <select id="selectTJobticketChildren" parameterType="TJobticket" resultMap="TJobticketResult">
+        <include refid="selectTJobticketVo"/>
+        <where>
+            <if test="whgzxkzh != null  and whgzxkzh != ''"> and whgzxkzh = #{whgzxkzh}</if>
+            <if test="dhzyxkzh != null  and dhzyxkzh != ''"> and dhzyxkzh = #{dhzyxkzh}</if>
+            <if test="xzkjxkzh != null  and xzkjxkzh != ''"> and xzkjxkzh = #{xzkjxkzh}</if>
+            <if test="mbzyxkzh != null  and mbzyxkzh != ''"> and mbzyxkzh = #{mbzyxkzh}</if>
+            <if test="gczyxkzh != null  and gczyxkzh != ''"> and gczyxkzh = #{gczyxkzh}</if>
+            and d.del_flag = 0 and xpxp = 12
+        </where>
+        order by d.kprq
     </select>
 
     <select id="selectTJobticketById" parameterType="Long" resultMap="TJobticketResult">
@@ -137,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="postponeNumber != null">postpone_number,</if>
             <if test="userMg != null">user_mg,</if>
             <if test="userUnit != null">user_unit,</if>
+            <if test="tag != null">tag,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -175,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="postponeNumber != null">#{postponeNumber},</if>
             <if test="userMg != null">#{userMg},</if>
             <if test="userUnit != null">#{userUnit},</if>
+            <if test="tag != null">#{tag},</if>
          </trim>
     </insert>
 
@@ -216,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="postponeNumber != null">postpone_number = #{postponeNumber},</if>
             <if test="userMg != null">user_mg = #{userMg},</if>
             <if test="userUnit != null">user_unit = #{userUnit},</if>
+            <if test="tag != null">tag = #{tag},</if>
         </trim>
         where id = #{id}
     </update>

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

@@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <sql id="selectTInvoiceWorkcontentVo">
         select d.id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.work_type, d.risk_level, d.work_description, d.work_people_number, d.hpjb, d.estimate_worktime, d.bookingticket_id, d.dept_id ,d.reservation_number,s.dept_name,
-            d.whgzxkzh,d.dhzyxkzh,d.xzkjxkzh,d.mbzyxkzh,d.gczyxkzh,d.gczyjb from t_invoice_workcontent d
+            d.whgzxkzh,d.dhzyxkzh,d.xzkjxkzh,d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.tag from t_invoice_workcontent d
        left join sys_dept s on s.dept_id = d.dept_id  left join t_invoice_bookingworkticket b on d.bookingticket_id =b.id
     </sql>
 

+ 105 - 0
master/src/main/resources/mybatis/invoice/TInvoiceTagMapper.xml

@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.invoice.mapper.TInvoiceTagMapper">
+
+    <resultMap type="TInvoiceTag" id="TInvoiceTagResult">
+        <result property="id"    column="id"    />
+        <result property="tag"    column="tag"    />
+        <result property="sort"    column="sort"    />
+        <result property="type"    column="type"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTInvoiceTagVo">
+        select d.id, d.tag, d.sort, d.type, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_invoice_tag d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTInvoiceTagList" parameterType="TInvoiceTag" resultMap="TInvoiceTagResult">
+        <include refid="selectTInvoiceTagVo"/>
+        <where>
+            <if test="tag != null  and tag != ''"> and tag = #{tag}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        order by d.sort desc
+    </select>
+
+    <select id="selectTInvoiceTagById" parameterType="Long" resultMap="TInvoiceTagResult">
+        <include refid="selectTInvoiceTagVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTInvoiceTag" parameterType="TInvoiceTag">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_invoice_tag.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_invoice_tag
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="tag != null">tag,</if>
+            <if test="sort != null">sort,</if>
+            <if test="type != null">type,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="remarks != null">remarks,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="tag != null">#{tag},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="type != null">#{type},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="remarks != null">#{remarks},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTInvoiceTag" parameterType="TInvoiceTag">
+        update t_invoice_tag
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="tag != null">tag = #{tag},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTInvoiceTagById" parameterType="Long">
+        update t_invoice_tag set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTInvoiceTagByIds" parameterType="String">
+        update t_invoice_tag set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+</mapper>

+ 9 - 7
master/src/main/resources/mybatis/invoice/TInvoiceWorkcontentMapper.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.TInvoiceWorkcontentMapper">
-    
+
     <resultMap type="TInvoiceWorkcontent" id="TInvoiceWorkcontentResult">
         <result property="id"    column="id"    />
         <result property="delFlag"    column="del_flag"    />
@@ -27,17 +27,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="mbzyxkzh"    column="mbzyxkzh"    />
         <result property="gczyxkzh"    column="gczyxkzh"    />
         <result property="gczyjb"    column="gczyjb"    />
+        <result property="tag"    column="tag"    />
     </resultMap>
 
     <sql id="selectTInvoiceWorkcontentVo">
         select d.id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.work_type, d.risk_level, d.work_description, d.work_people_number, d.hpjb, d.estimate_worktime, d.bookingticket_id, d.dept_id ,
-               d.whgzxkzh,d.dhzyxkzh,d.xzkjxkzh,d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.reservation_number,s.dept_name from t_invoice_workcontent d
+               d.whgzxkzh,d.dhzyxkzh,d.xzkjxkzh,d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.reservation_number,d.tag,s.dept_name from t_invoice_workcontent d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
     <select id="selectTInvoiceWorkcontentList" parameterType="TInvoiceWorkcontent" resultMap="TInvoiceWorkcontentResult">
         <include refid="selectTInvoiceWorkcontentVo"/>
-        <where>  
+        <where>
             <if test="createrCode != null "> and creater_code = #{createrCode}</if>
             <if test="createdate != null "> and createdate = #{createdate}</if>
             <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
@@ -62,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <!-- 数据范围过滤 -->
         ${params.dataScope}
     </select>
-    
+
     <select id="selectTInvoiceWorkcontentById" parameterType="Long" resultMap="TInvoiceWorkcontentResult">
         <include refid="selectTInvoiceWorkcontentVo"/>
         where id = #{id}
@@ -74,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where d.bookingticket_id = #{bookingticketId}
         and d.del_flag = 0
     </select>
-        
+
     <insert id="insertTInvoiceWorkcontent" parameterType="TInvoiceWorkcontent">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT T_INVOICE_WORKCONTENT_SEQ.NEXTVAL as id FROM DUAL
@@ -152,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="mbzyxkzh != null">mbzyxkzh = #{mbzyxkzh},</if>
             <if test="gczyxkzh != null">gczyxkzh = #{gczyxkzh},</if>
             <if test="gczyjb != null">gczyjb = #{gczyjb},</if>
+            <if test="tag != null">tag = #{tag},</if>
         </trim>
         where id = #{id}
     </update>
@@ -166,5 +168,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+</mapper>

+ 62 - 0
ui/src/api/invoice/tag.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询工作票索引列表
+export function listTag(query) {
+  return request({
+    url: '/invoice/tag/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询工作票索引列表
+export function listTagAll(query) {
+  return request({
+    url: '/invoice/tag/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询工作票索引详细
+export function getTag(id) {
+  return request({
+    url: '/invoice/tag/' + id,
+    method: 'get'
+  })
+}
+
+// 新增工作票索引
+export function addTag(data) {
+  return request({
+    url: '/invoice/tag',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改工作票索引
+export function updateTag(data) {
+  return request({
+    url: '/invoice/tag',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除工作票索引
+export function delTag(id) {
+  return request({
+    url: '/invoice/tag/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出工作票索引
+export function exportTag(query) {
+  return request({
+    url: '/invoice/tag/export',
+    method: 'get',
+    params: query
+  })
+}

+ 43 - 5
ui/src/views/ehs/jobticket/index.vue

@@ -58,6 +58,16 @@
       <el-form-item :label="$t('限制空间许可证号')" label-width="50" prop="xzkjxkzh">
         <el-checkbox v-model="queryParams.xzkjxkzh" @change="handleQuery"></el-checkbox>
       </el-form-item>
+      <el-form-item :label="$t('索引')" label-width="50" prop="tag">
+        <el-select v-model="queryParams.tag" :placeholder="$t('请选择') + $t('索引')" filterable clearable size="small" @change="handleQuery">
+          <el-option
+            v-for="dict in tagOptions"
+            :key="dict.tag"
+            :label="dict.tag"
+            :value="dict.tag"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
@@ -74,7 +84,7 @@
           v-hasPermi="['ehs:jobticket:add']"
         >{{ $t('新增') }}</el-button>
       </el-col>
-      <el-col :span="1.5">
+<!--      <el-col :span="1.5">
         <el-button
           type="success"
           icon="el-icon-edit"
@@ -93,7 +103,7 @@
           @click="handleDelete"
           v-hasPermi="['ehs:jobticket:remove']"
         >{{ $t('删除') }}</el-button>
-      </el-col>
+      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -114,9 +124,12 @@
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="jobticketList" @selection-change="handleSelectionChange" :height="clientHeight" border :cell-style="myclass">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column :label="$t('开票日期')" align="center" prop="kprq" width="100">
+    <el-table v-loading="loading" :data="jobticketList"
+              :height="clientHeight" border :cell-style="myclass"
+              row-key="id"
+              :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+      <el-table-column :label="$t('开票日期')" align="center" prop="kprq" width="125">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.kprq, '{y}-{m}-{d}') }}</span>
         </template>
@@ -184,6 +197,7 @@
           <span>{{ parseTime(scope.row.cxsj, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column :label="$t('索引')" align="center" prop="tag" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('操作')" align="center" fixed="right" width="160" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -361,6 +375,16 @@
             :placeholder="$t('请选择') + $t('撤销时间')">
           </el-date-picker>
         </el-form-item>
+        <el-form-item label="索引" prop="tag">
+          <el-select v-model="form.tag" clearable placeholder="请选择索引">
+            <el-option
+              v-for="dict in tagOptions"
+              :key="dict.tag"
+              :label="dict.tag"
+              :value="dict.tag"
+            ></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item :label="$t('备注')" prop="remarks">
           <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
         </el-form-item>
@@ -470,6 +494,7 @@ import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import FireData from "./fireData";
+import { listTagAll} from "@/api/invoice/tag";
 
 export default {
   name: "Jobticket",
@@ -524,6 +549,7 @@ export default {
       userUnitOptions: [],
        // 用户主管字典
       userMgOptions: [],
+      tagOptions: [],
       // 用户导入参数
       upload: {
         //下载模板请求地址
@@ -570,6 +596,7 @@ export default {
         wcxxbh: null,
         wcxzt: null,
         cxsj: null,
+        tag: null
       },
       //日期快速选择
       pickerOptions: {
@@ -641,6 +668,7 @@ export default {
     this.getList();
     this.getTreeselect();
     this.getChengbaoshang();
+    this.getTagList()
     this.getDicts("PLANT_DIVIDE").then(response => {
       this.plantCodeOptions = response.data;
     });
@@ -713,6 +741,12 @@ export default {
               this.sgdwOptions = response.data[1].children;
           });
     },
+    //得到索引下拉框
+    getTagList(){
+      listTagAll().then(response => {
+        this.tagOptions = response
+      });
+    },
     //延期 即新增一条 改为续票
     handlePostpone(row){
       this.guanlianVisible=true
@@ -1004,6 +1038,10 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
+      if (row.children!= null && row.children.length > 0) {
+        this.msgError('存在续票,无法删除主票')
+        return
+      }
       const ids = row.id || this.ids;
       this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
           confirmButtonText: this.$t('确定'),

+ 39 - 24
ui/src/views/invoice/bookingworkticket/index.vue

@@ -172,6 +172,7 @@
       <el-table-column label="盲板作业许可证号" align="center" prop="mbzyxkzh" :show-overflow-tooltip="true"/>
       <el-table-column label="高处作业许可证号" align="center" prop="gczyxkzh" :show-overflow-tooltip="true"/>
       <el-table-column label="高处作业级别" align="center" prop="gczyjb" :formatter="gczyjbFormat"/>
+      <el-table-column label="索引" align="center" prop="tag" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -421,6 +422,16 @@
              ></el-option>
           </el-select>
         </el-form-item>
+          <el-form-item label="索引" prop="tag">
+            <el-select v-model="licenseForm.tag" clearable placeholder="请选择索引">
+              <el-option
+                v-for="dict in tagOptions"
+                :key="dict.tag"
+                :label="dict.tag"
+                :value="dict.tag"
+              ></el-option>
+            </el-select>
+          </el-form-item>
          </el-form>
      <div slot="footer" class="dialog-footer">
               <el-button @click="guanlianVisible=false">取 消</el-button>
@@ -435,6 +446,7 @@
 import { listBookingworkticket, getBookingworkticket, delBookingworkticket, addBookingworkticket, updateBookingworkticket, exportBookingworkticket, importTemplate, seeBookingworkticket,assion} from "@/api/invoice/bookingworkticket";
 import { listWorkcontent, getWorkcontent, delWorkcontent, addWorkcontent, updateWorkcontent, exportWorkcontent,getWorkcontentBybookingticketId} from "@/api/invoice/workcontent";
 import { listDevice, getDevice, delDevice, updateDevice, exportDevice, selectDevice} from "@/api/invoice/device";
+import { listTagAll} from "@/api/invoice/tag";
 import { listUnit, getUnit, delUnit, addUnit, updateUnit, exportUnit,getUserByUnit} from "@/api/invoice/unit";
 import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus,userDataScope,getUserByUserName } from "@/api/system/user";
 import { listJobticket, getJobticket, delJobticket, addJobticket, updateJobticket, exportJobticket,batchAddJobticket } from "@/api/ehs/jobticket";
@@ -500,6 +512,7 @@ export default {
       hpjbOptions: [],
       // 高处作业级别字典
       gczyjbOptions: [],
+      tagOptions: [],
       // 是否显示弹出层
       open: false,
         // 用户导入参数
@@ -608,9 +621,10 @@ export default {
           this.clientHeight = document.body.clientHeight -250
 
       })
-         this.getNowFormatDate()
-       this.getList();
-       this.getTreeselect();
+       this.getNowFormatDate()
+       this.getList()
+       this.getTreeselect()
+       this.getTagList()
         //初始化作业区域、 初始化用户单位下拉框
         this.getDeviceup();
       this.getDicts("booking_work_status").then(response => {
@@ -707,9 +721,15 @@ export default {
         remarks: null
       };
           selectDevice(queryForm).then(response => {
-           this.workAreaOptions=response.data
+           this.workAreaOptions = response.data
           });
     },
+    //得到索引下拉框
+    getTagList(){
+      listTagAll().then(response => {
+        this.tagOptions = response
+      });
+    },
     addAprrove(row) {
       this.reset();
 
@@ -1101,30 +1121,29 @@ export default {
        submitassociation(){
        this.guanlianVisible=false
        let arr=[]
-       arr.push(this.licenseForm.whgzxkzh)
-        arr.push(this.licenseForm.dhzyxkzh)
+         arr.push(this.licenseForm.whgzxkzh)
+         arr.push(this.licenseForm.dhzyxkzh)
          arr.push(this.licenseForm.xzkjxkzh)
-          arr.push(this.licenseForm.mbzyxkzh)
-           arr.push(this.licenseForm.gczyxkzh)
+         arr.push(this.licenseForm.mbzyxkzh)
+         arr.push(this.licenseForm.gczyxkzh)
       const putData={}
       let num=0
        arr.forEach(item => {if(item===null||item===''){
           num=num+1
        }})
-       if(num<5){
-      putData.id=this.associationParams.id
-      putData.whgzxkzh=this.licenseForm.whgzxkzh
-      putData.hpjb=this.licenseForm.hpjb
-      putData.dhzyxkzh=this.licenseForm.dhzyxkzh
-      putData.xzkjxkzh=this.licenseForm.xzkjxkzh
-      putData.mbzyxkzh=this.licenseForm.mbzyxkzh
-      putData.gczyxkzh=this.licenseForm.gczyxkzh
-      putData.gczyjb=this.licenseForm.gczyjb
-
+      if(num<5){
+        putData.id=this.associationParams.id
+        putData.whgzxkzh=this.licenseForm.whgzxkzh
+        putData.hpjb=this.licenseForm.hpjb
+        putData.dhzyxkzh=this.licenseForm.dhzyxkzh
+        putData.xzkjxkzh=this.licenseForm.xzkjxkzh
+        putData.mbzyxkzh=this.licenseForm.mbzyxkzh
+        putData.gczyxkzh=this.licenseForm.gczyxkzh
+        putData.gczyjb=this.licenseForm.gczyjb
+        putData.tag=this.licenseForm.tag
        }else{
         return  this.msgError("请至少关联一张许可证号");
       }
-
        updateWorkcontent(putData).then(response => {
           //    console.log(response.row)
 
@@ -1212,7 +1231,7 @@ export default {
             colspan: _col
           };
         }
-        if (columnIndex === 23) {
+        if (columnIndex === 24) {
           const _row = this.setTable(this.bookingworkticketList).merge[rowIndex];
           const _col = _row > 0 ? 1 : 0;
           return {
@@ -1321,10 +1340,6 @@ export default {
       })
       }
 
-
-
-
-
     },
       //文件预览
     openPdf(){

+ 362 - 0
ui/src/views/invoice/tag/index.vue

@@ -0,0 +1,362 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="索引" prop="tag">
+        <el-input
+          v-model="queryParams.tag"
+          placeholder="请输入索引"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['invoice:tag:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['invoice:tag:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['invoice:tag:remove']"
+        >删除</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="tagList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="索引" align="center" prop="tag" :show-overflow-tooltip="true"/>
+      <el-table-column label="排序" align="center" prop="sort" :show-overflow-tooltip="true"/>
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['invoice:tag:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['invoice:tag:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改工作票索引对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="索引" prop="tag">
+          <el-input v-model="form.tag" placeholder="请输入索引" />
+        </el-form-item>
+        <el-form-item label="排序" prop="sort">
+          <el-input-number v-model="form.sort" controls-position="right" :min="0" placeholder="请输入排序" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注" />
+        </el-form-item>
+          <el-form-item label="归属部门" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+          </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+      <!-- 用户导入对话框 -->
+      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+          <el-upload
+                  ref="upload"
+                  :limit="1"
+                  accept=".xlsx, .xls"
+                  :headers="upload.headers"
+                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
+                  :disabled="upload.isUploading"
+                  :on-progress="handleFileUploadProgress"
+                  :on-success="handleFileSuccess"
+                  :auto-upload="false"
+                  drag
+          >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</em>
+              </div>
+              <div class="el-upload__tip" slot="tip">
+                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+              </div>
+              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+          </el-upload>
+          <div slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="submitFileForm">确 定</el-button>
+              <el-button @click="upload.open = false">取 消</el-button>
+          </div>
+      </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listTag, getTag, delTag, addTag, updateTag, exportTag, importTemplate} from "@/api/invoice/tag";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "Tag",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 工作票索引表格数据
+      tagList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/invoice/tag/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        tag: null,
+        type: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    /** 查询工作票索引列表 */
+    getList() {
+      this.loading = true;
+      listTag(this.queryParams).then(response => {
+        this.tagList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        tag: null,
+        sort: null,
+        type: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加工作票索引";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getTag(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改工作票索引";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateTag(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addTag(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delTag(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有工作票索引数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportTag(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.$refs.upload.clearFiles();
+          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      }
+  }
+};
+</script>