瀏覽代碼

SAI类别管理台账

wangggziwen 2 年之前
父節點
當前提交
0aeca51ff9

+ 128 - 0
master/src/main/java/com/ruoyi/project/production/controller/TSaiCategoryController.java

@@ -0,0 +1,128 @@
+package com.ruoyi.project.production.controller;
+
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
+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.production.domain.TSaiCategory;
+import com.ruoyi.project.production.service.ITSaiCategoryService;
+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;
+
+/**
+ * SAI类别Controller
+ *
+ * @author ruoyi
+ * @date 2023-04-18
+ */
+@RestController
+@RequestMapping("/production/category")
+public class TSaiCategoryController extends BaseController
+{
+    @Autowired
+    private ITSaiCategoryService tSaiCategoryService;
+
+    @Autowired
+    private ISysUserService userService;
+
+    /**
+     * 查询SAI类别列表
+     */
+    @GetMapping("/categoryList")
+    public AjaxResult categoryList()
+    {
+        return AjaxResult.success(tSaiCategoryService.selectTSaiCategoryList(null));
+    }
+
+    /**
+     * 查询SAI类别列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:category:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TSaiCategory tSaiCategory)
+    {
+        startPage();
+        List<TSaiCategory> list = tSaiCategoryService.selectTSaiCategoryList(tSaiCategory);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出SAI类别列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:category:export')")
+    @Log(title = "SAI类别", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TSaiCategory tSaiCategory)
+    {
+        List<TSaiCategory> list = tSaiCategoryService.selectTSaiCategoryList(tSaiCategory);
+        ExcelUtil<TSaiCategory> util = new ExcelUtil<TSaiCategory>(TSaiCategory.class);
+        return util.exportExcel(list, "category");
+    }
+
+    /**
+     * 获取SAI类别详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('production:category:query')")
+    @GetMapping(value = "/{saiCategoryId}")
+    public AjaxResult getInfo(@PathVariable("saiCategoryId") Long saiCategoryId)
+    {
+        return AjaxResult.success(tSaiCategoryService.selectTSaiCategoryById(saiCategoryId));
+    }
+
+    /**
+     * 新增SAI类别
+     */
+    @PreAuthorize("@ss.hasPermi('production:category:add')")
+    @Log(title = "SAI类别", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSaiCategory tSaiCategory)
+    {
+        Long userId = getUserId();
+        SysUser sysUser = userService.selectUserById(userId);
+        tSaiCategory.setDeptId(sysUser.getDeptId());
+        tSaiCategory.setCreateBy(sysUser.getUserId().toString());
+        tSaiCategory.setCreateTime(new Date());
+        return toAjax(tSaiCategoryService.insertTSaiCategory(tSaiCategory));
+    }
+
+    /**
+     * 修改SAI类别
+     */
+    @PreAuthorize("@ss.hasPermi('production:category:edit')")
+    @Log(title = "SAI类别", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSaiCategory tSaiCategory)
+    {
+        Long userId = getUserId();
+        SysUser sysUser = userService.selectUserById(userId);
+        tSaiCategory.setUpdateBy(sysUser.getUserId().toString());
+        tSaiCategory.setUpdateTime(new Date());
+        return toAjax(tSaiCategoryService.updateTSaiCategory(tSaiCategory));
+    }
+
+    /**
+     * 删除SAI类别
+     */
+    @PreAuthorize("@ss.hasPermi('production:category:remove')")
+    @Log(title = "SAI类别", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{saiCategoryIds}")
+    public AjaxResult remove(@PathVariable Long[] saiCategoryIds)
+    {
+        return toAjax(tSaiCategoryService.deleteTSaiCategoryByIds(saiCategoryIds));
+    }
+}

+ 83 - 0
master/src/main/java/com/ruoyi/project/production/domain/TSaiCategory.java

@@ -0,0 +1,83 @@
+package com.ruoyi.project.production.domain;
+
+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;
+
+/**
+ * SAI类别对象 t_sai_category
+ *
+ * @author ruoyi
+ * @date 2023-04-18
+ */
+public class TSaiCategory extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** SAI类别编号 */
+    @Excel(name = "SAI类别编号")
+    private Long saiCategoryId;
+
+    /** SAI类别名称 */
+    @Excel(name = "SAI类别名称")
+    private String saiCategoryName;
+
+    /** 删除状态 */
+    private String delFlag;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    public void setSaiCategoryId(Long saiCategoryId)
+    {
+        this.saiCategoryId = saiCategoryId;
+    }
+
+    public Long getSaiCategoryId()
+    {
+        return saiCategoryId;
+    }
+    public void setSaiCategoryName(String saiCategoryName)
+    {
+        this.saiCategoryName = saiCategoryName;
+    }
+
+    public String getSaiCategoryName()
+    {
+        return saiCategoryName;
+    }
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("saiCategoryId", getSaiCategoryId())
+            .append("saiCategoryName", getSaiCategoryName())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TSaiCategoryMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TSaiCategory;
+
+/**
+ * SAI类别Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-04-18
+ */
+public interface TSaiCategoryMapper 
+{
+    /**
+     * 查询SAI类别
+     * 
+     * @param saiCategoryId SAI类别ID
+     * @return SAI类别
+     */
+    public TSaiCategory selectTSaiCategoryById(Long saiCategoryId);
+
+    /**
+     * 查询SAI类别列表
+     * 
+     * @param tSaiCategory SAI类别
+     * @return SAI类别集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TSaiCategory> selectTSaiCategoryList(TSaiCategory tSaiCategory);
+
+    /**
+     * 新增SAI类别
+     * 
+     * @param tSaiCategory SAI类别
+     * @return 结果
+     */
+    public int insertTSaiCategory(TSaiCategory tSaiCategory);
+
+    /**
+     * 修改SAI类别
+     * 
+     * @param tSaiCategory SAI类别
+     * @return 结果
+     */
+    public int updateTSaiCategory(TSaiCategory tSaiCategory);
+
+    /**
+     * 删除SAI类别
+     * 
+     * @param saiCategoryId SAI类别ID
+     * @return 结果
+     */
+    public int deleteTSaiCategoryById(Long saiCategoryId);
+
+    /**
+     * 批量删除SAI类别
+     * 
+     * @param saiCategoryIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTSaiCategoryByIds(Long[] saiCategoryIds);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/production/service/ITSaiCategoryService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TSaiCategory;
+
+/**
+ * SAI类别Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-04-18
+ */
+public interface ITSaiCategoryService 
+{
+    /**
+     * 查询SAI类别
+     * 
+     * @param saiCategoryId SAI类别ID
+     * @return SAI类别
+     */
+    public TSaiCategory selectTSaiCategoryById(Long saiCategoryId);
+
+    /**
+     * 查询SAI类别列表
+     * 
+     * @param tSaiCategory SAI类别
+     * @return SAI类别集合
+     */
+    public List<TSaiCategory> selectTSaiCategoryList(TSaiCategory tSaiCategory);
+
+    /**
+     * 新增SAI类别
+     * 
+     * @param tSaiCategory SAI类别
+     * @return 结果
+     */
+    public int insertTSaiCategory(TSaiCategory tSaiCategory);
+
+    /**
+     * 修改SAI类别
+     * 
+     * @param tSaiCategory SAI类别
+     * @return 结果
+     */
+    public int updateTSaiCategory(TSaiCategory tSaiCategory);
+
+    /**
+     * 批量删除SAI类别
+     * 
+     * @param saiCategoryIds 需要删除的SAI类别ID
+     * @return 结果
+     */
+    public int deleteTSaiCategoryByIds(Long[] saiCategoryIds);
+
+    /**
+     * 删除SAI类别信息
+     * 
+     * @param saiCategoryId SAI类别ID
+     * @return 结果
+     */
+    public int deleteTSaiCategoryById(Long saiCategoryId);
+}

+ 96 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TSaiCategoryServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TSaiCategoryMapper;
+import com.ruoyi.project.production.domain.TSaiCategory;
+import com.ruoyi.project.production.service.ITSaiCategoryService;
+
+/**
+ * SAI类别Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-04-18
+ */
+@Service
+public class TSaiCategoryServiceImpl implements ITSaiCategoryService
+{
+    @Autowired
+    private TSaiCategoryMapper tSaiCategoryMapper;
+
+    /**
+     * 查询SAI类别
+     *
+     * @param saiCategoryId SAI类别ID
+     * @return SAI类别
+     */
+    @Override
+    public TSaiCategory selectTSaiCategoryById(Long saiCategoryId)
+    {
+        return tSaiCategoryMapper.selectTSaiCategoryById(saiCategoryId);
+    }
+
+    /**
+     * 查询SAI类别列表
+     *
+     * @param tSaiCategory SAI类别
+     * @return SAI类别
+     */
+    @Override
+    public List<TSaiCategory> selectTSaiCategoryList(TSaiCategory tSaiCategory)
+    {
+        return tSaiCategoryMapper.selectTSaiCategoryList(tSaiCategory);
+    }
+
+    /**
+     * 新增SAI类别
+     *
+     * @param tSaiCategory SAI类别
+     * @return 结果
+     */
+    @Override
+    public int insertTSaiCategory(TSaiCategory tSaiCategory)
+    {
+        tSaiCategory.setCreateTime(DateUtils.getNowDate());
+        return tSaiCategoryMapper.insertTSaiCategory(tSaiCategory);
+    }
+
+    /**
+     * 修改SAI类别
+     *
+     * @param tSaiCategory SAI类别
+     * @return 结果
+     */
+    @Override
+    public int updateTSaiCategory(TSaiCategory tSaiCategory)
+    {
+        tSaiCategory.setUpdateTime(DateUtils.getNowDate());
+        return tSaiCategoryMapper.updateTSaiCategory(tSaiCategory);
+    }
+
+    /**
+     * 批量删除SAI类别
+     *
+     * @param saiCategoryIds 需要删除的SAI类别ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSaiCategoryByIds(Long[] saiCategoryIds)
+    {
+        return tSaiCategoryMapper.deleteTSaiCategoryByIds(saiCategoryIds);
+    }
+
+    /**
+     * 删除SAI类别信息
+     *
+     * @param saiCategoryId SAI类别ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSaiCategoryById(Long saiCategoryId)
+    {
+        return tSaiCategoryMapper.deleteTSaiCategoryById(saiCategoryId);
+    }
+}

+ 92 - 0
master/src/main/resources/mybatis/production/TSaiCategoryMapper.xml

@@ -0,0 +1,92 @@
+<?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.production.mapper.TSaiCategoryMapper">
+    
+    <resultMap type="TSaiCategory" id="TSaiCategoryResult">
+        <result property="saiCategoryId"    column="sai_category_id"    />
+        <result property="saiCategoryName"    column="sai_category_name"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="deptId"    column="dept_id"    />
+    </resultMap>
+
+    <sql id="selectTSaiCategoryVo">
+        select d.sai_category_id, d.sai_category_name, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time, d.dept_id from t_sai_category d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTSaiCategoryList" parameterType="TSaiCategory" resultMap="TSaiCategoryResult">
+        <include refid="selectTSaiCategoryVo"/>
+        <where>  
+            <if test="saiCategoryId != null "> and sai_category_id = #{saiCategoryId}</if>
+            <if test="saiCategoryName != null  and saiCategoryName != ''"> and sai_category_name like concat(concat('%', #{saiCategoryName}), '%')</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTSaiCategoryById" parameterType="Long" resultMap="TSaiCategoryResult">
+        <include refid="selectTSaiCategoryVo"/>
+        where sai_category_id = #{saiCategoryId}
+    </select>
+        
+    <insert id="insertTSaiCategory" parameterType="TSaiCategory">
+        <selectKey keyProperty="saiCategoryId" resultType="long" order="BEFORE">
+            SELECT seq_t_sai_category.NEXTVAL as saiCategoryId FROM DUAL
+        </selectKey>
+        insert into t_sai_category
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="saiCategoryId != null">sai_category_id,</if>
+            <if test="saiCategoryName != null">sai_category_name,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="deptId != null">dept_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="saiCategoryId != null">#{saiCategoryId},</if>
+            <if test="saiCategoryName != null">#{saiCategoryName},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="deptId != null">#{deptId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTSaiCategory" parameterType="TSaiCategory">
+        update t_sai_category
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="saiCategoryName != null">sai_category_name = #{saiCategoryName},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where sai_category_id = #{saiCategoryId}
+    </update>
+
+    <update id="deleteTSaiCategoryById" parameterType="Long">
+        update t_sai_category set del_flag = 2 where sai_category_id = #{saiCategoryId}
+    </update>
+
+    <update id="deleteTSaiCategoryByIds" parameterType="String">
+        update t_sai_category set del_flag = 2 where sai_category_id in
+        <foreach item="saiCategoryId" collection="array" open="(" separator="," close=")">
+            #{saiCategoryId}
+        </foreach>
+    </update>
+    
+</mapper>

+ 53 - 0
ui/src/api/production/category.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询SAI类别列表
+export function listCategory(query) {
+  return request({
+    url: '/production/category/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询SAI类别详细
+export function getCategory(saiCategoryId) {
+  return request({
+    url: '/production/category/' + saiCategoryId,
+    method: 'get'
+  })
+}
+
+// 新增SAI类别
+export function addCategory(data) {
+  return request({
+    url: '/production/category',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改SAI类别
+export function updateCategory(data) {
+  return request({
+    url: '/production/category',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除SAI类别
+export function delCategory(saiCategoryId) {
+  return request({
+    url: '/production/category/' + saiCategoryId,
+    method: 'delete'
+  })
+}
+
+// 导出SAI类别
+export function exportCategory(query) {
+  return request({
+    url: '/production/category/export',
+    method: 'get',
+    params: query
+  })
+}

+ 376 - 0
ui/src/views/production/category/index.vue

@@ -0,0 +1,376 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="SAI类别编号" prop="saiCategoryId">
+        <el-input
+          v-model="queryParams.saiCategoryId"
+          placeholder="请输入SAI类别编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="SAI类别名称" prop="saiCategoryName">
+        <el-input
+          v-model="queryParams.saiCategoryName"
+          placeholder="请输入SAI类别名称"
+          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="['production:category: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="['production:category: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="['production:category:remove']"
+        >删除</el-button>
+      </el-col>
+        <!--<el-col :span="1.5">-->
+            <!--<el-button-->
+                    <!--type="info"-->
+                    <!--icon="el-icon-upload2"-->
+                    <!--size="mini"-->
+                    <!--@click="handleImport"-->
+                    <!--v-hasPermi="['production:category:edit']"-->
+            <!--&gt;导入</el-button>-->
+        <!--</el-col>-->
+      <!--<el-col :span="1.5">-->
+        <!--<el-button-->
+          <!--type="warning"-->
+          <!--icon="el-icon-download"-->
+          <!--size="mini"-->
+          <!--@click="handleExport"-->
+          <!--v-hasPermi="['production:category:export']"-->
+        <!--&gt;导出</el-button>-->
+      <!--</el-col>-->
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="categoryList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="SAI类别编号" align="center" prop="saiCategoryId" :show-overflow-tooltip="true"/>
+      <el-table-column label="SAI类别名称" align="center" prop="saiCategoryName" :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="['production:category:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['production:category: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"
+    />
+
+    <!-- 添加或修改SAI类别对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="SAI类别名称" prop="saiCategoryName">
+          <el-input v-model="form.saiCategoryName" placeholder="请输入SAI类别名称" />
+        </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 { listCategory, getCategory, delCategory, addCategory, updateCategory, exportCategory, importTemplate} from "@/api/production/category";
+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: "Category",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // SAI类别表格数据
+      categoryList: [],
+      // 弹出层标题
+      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 + "/production/category/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        saiCategoryId: null,
+        saiCategoryName: null,
+        deptId: 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: {
+    /** 查询SAI类别列表 */
+    getList() {
+      this.loading = true;
+      listCategory(this.queryParams).then(response => {
+        this.categoryList = 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 = {
+        saiCategoryId: null,
+        saiCategoryName: null,
+        delFlag: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        deptId: 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.saiCategoryId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加SAI类别";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const saiCategoryId = row.saiCategoryId || this.ids
+      getCategory(saiCategoryId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改SAI类别";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.saiCategoryId != null) {
+            updateCategory(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCategory(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const saiCategoryIds = row.saiCategoryId || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delCategory(saiCategoryIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有SAI类别数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportCategory(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>