| | |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids; |
| | | this.#[[$modal]]#.confirm('æ¯å¦ç¡®è®¤å é¤${functionName}ç¼å·ä¸º"' + ${pkColumn.javaField}s + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | this.#[[$modal]]#.confirm('æ¯å¦ç¡®è®¤å é¤').then(function() { |
| | | return del${BusinessName}(${pkColumn.javaField}s); |
| | | }).then(() => { |
| | | this.getList(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.bs.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | 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.billion.common.annotation.Log; |
| | | import com.billion.common.core.controller.BaseController; |
| | | import com.billion.common.core.domain.AjaxResult; |
| | | import com.billion.common.enums.BusinessType; |
| | | import com.billion.main.bs.domain.BsLineInfo; |
| | | import com.billion.main.bs.service.IBsLineInfoService; |
| | | import com.billion.common.utils.poi.ExcelUtil; |
| | | import com.billion.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 产线信æ¯Controller |
| | | * |
| | | * @author Billion-Yi |
| | | * @date 2024-11-22 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/bs/lineInfo") |
| | | public class BsLineInfoController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IBsLineInfoService bsLineInfoService; |
| | | |
| | | /** |
| | | * æ¥è¯¢äº§çº¿ä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:lineInfo:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(BsLineInfo bsLineInfo) |
| | | { |
| | | startPage(); |
| | | List<BsLineInfo> list = bsLineInfoService.selectBsLineInfoList(bsLineInfo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºäº§çº¿ä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:lineInfo:export')") |
| | | @Log(title = "产线信æ¯", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, BsLineInfo bsLineInfo) |
| | | { |
| | | List<BsLineInfo> list = bsLineInfoService.selectBsLineInfoList(bsLineInfo); |
| | | ExcelUtil<BsLineInfo> util = new ExcelUtil<BsLineInfo>(BsLineInfo.class); |
| | | util.exportExcel(response, list, "äº§çº¿ä¿¡æ¯æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·å产线信æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:lineInfo:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(bsLineInfoService.selectBsLineInfoById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢äº§çº¿ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:lineInfo:add')") |
| | | @Log(title = "产线信æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody BsLineInfo bsLineInfo) |
| | | { |
| | | return toAjax(bsLineInfoService.insertBsLineInfo(bsLineInfo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹äº§çº¿ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:lineInfo:edit')") |
| | | @Log(title = "产线信æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody BsLineInfo bsLineInfo) |
| | | { |
| | | return toAjax(bsLineInfoService.updateBsLineInfo(bsLineInfo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤äº§çº¿ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:lineInfo:remove')") |
| | | @Log(title = "产线信æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(bsLineInfoService.deleteBsLineInfoByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.bs.domain; |
| | | |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.billion.common.annotation.Excel; |
| | | import com.billion.main.common.BaseEntity; |
| | | |
| | | /** |
| | | * 产线信æ¯å¯¹è±¡ bs_line_info |
| | | * |
| | | * @author Billion-Yi |
| | | * @date 2024-11-22 |
| | | */ |
| | | @Data |
| | | public class BsLineInfo extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主é®id */ |
| | | private Long id; |
| | | |
| | | /** 产线ç¼å· */ |
| | | @Excel(name = "产线ç¼å·") |
| | | private String lineCode; |
| | | |
| | | /** 产线åç§° */ |
| | | @Excel(name = "产线åç§°") |
| | | private String lineName; |
| | | |
| | | /** 夿³¨ */ |
| | | @Excel(name = "夿³¨") |
| | | private String remarks; |
| | | |
| | | /** ç¶æ */ |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | |
| | | /** é»è¾å é¤ */ |
| | | private String delFlag; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.bs.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.billion.main.bs.domain.BsLineInfo; |
| | | |
| | | /** |
| | | * 产线信æ¯Mapperæ¥å£ |
| | | * |
| | | * @author Billion-Yi |
| | | * @date 2024-11-22 |
| | | */ |
| | | public interface BsLineInfoMapper extends BaseMapper<BsLineInfo> |
| | | { |
| | | /** |
| | | * æ¥è¯¢äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param id 产线信æ¯ä¸»é® |
| | | * @return äº§çº¿ä¿¡æ¯ |
| | | */ |
| | | public BsLineInfo selectBsLineInfoById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢äº§çº¿ä¿¡æ¯å表 |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return 产线信æ¯éå |
| | | */ |
| | | public List<BsLineInfo> selectBsLineInfoList(BsLineInfo bsLineInfo); |
| | | |
| | | /** |
| | | * æ°å¢äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertBsLineInfo(BsLineInfo bsLineInfo); |
| | | |
| | | /** |
| | | * ä¿®æ¹äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateBsLineInfo(BsLineInfo bsLineInfo); |
| | | |
| | | /** |
| | | * å é¤äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param id 产线信æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsLineInfoById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsLineInfoByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.bs.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.billion.main.bs.domain.BsLineInfo; |
| | | |
| | | /** |
| | | * 产线信æ¯Serviceæ¥å£ |
| | | * |
| | | * @author Billion-Yi |
| | | * @date 2024-11-22 |
| | | */ |
| | | public interface IBsLineInfoService extends IService<BsLineInfo> |
| | | { |
| | | /** |
| | | * æ¥è¯¢äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param id 产线信æ¯ä¸»é® |
| | | * @return äº§çº¿ä¿¡æ¯ |
| | | */ |
| | | public BsLineInfo selectBsLineInfoById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢äº§çº¿ä¿¡æ¯å表 |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return 产线信æ¯éå |
| | | */ |
| | | public List<BsLineInfo> selectBsLineInfoList(BsLineInfo bsLineInfo); |
| | | |
| | | /** |
| | | * æ°å¢äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertBsLineInfo(BsLineInfo bsLineInfo); |
| | | |
| | | /** |
| | | * ä¿®æ¹äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateBsLineInfo(BsLineInfo bsLineInfo); |
| | | |
| | | /** |
| | | * æ¹éå é¤äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param ids éè¦å é¤ç产线信æ¯ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsLineInfoByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤äº§çº¿ä¿¡æ¯ä¿¡æ¯ |
| | | * |
| | | * @param id 产线信æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsLineInfoById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.billion.main.bs.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.billion.common.utils.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.billion.main.bs.mapper.BsLineInfoMapper; |
| | | import com.billion.main.bs.domain.BsLineInfo; |
| | | import com.billion.main.bs.service.IBsLineInfoService; |
| | | |
| | | /** |
| | | * 产线信æ¯Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author Billion-Yi |
| | | * @date 2024-11-22 |
| | | */ |
| | | @Service |
| | | public class BsLineInfoServiceImpl extends ServiceImpl<BsLineInfoMapper, BsLineInfo> implements IBsLineInfoService |
| | | { |
| | | @Autowired |
| | | private BsLineInfoMapper bsLineInfoMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param id 产线信æ¯ä¸»é® |
| | | * @return äº§çº¿ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public BsLineInfo selectBsLineInfoById(Long id) |
| | | { |
| | | return bsLineInfoMapper.selectBsLineInfoById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢äº§çº¿ä¿¡æ¯å表 |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return äº§çº¿ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<BsLineInfo> selectBsLineInfoList(BsLineInfo bsLineInfo) |
| | | { |
| | | return bsLineInfoMapper.selectBsLineInfoList(bsLineInfo); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertBsLineInfo(BsLineInfo bsLineInfo) |
| | | { |
| | | bsLineInfo.setCreateTime(DateUtils.getNowDate()); |
| | | return bsLineInfoMapper.insertBsLineInfo(bsLineInfo); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param bsLineInfo äº§çº¿ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateBsLineInfo(BsLineInfo bsLineInfo) |
| | | { |
| | | bsLineInfo.setUpdateTime(DateUtils.getNowDate()); |
| | | return bsLineInfoMapper.updateBsLineInfo(bsLineInfo); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤äº§çº¿ä¿¡æ¯ |
| | | * |
| | | * @param ids éè¦å é¤ç产线信æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteBsLineInfoByIds(Long[] ids) |
| | | { |
| | | return bsLineInfoMapper.deleteBsLineInfoByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤äº§çº¿ä¿¡æ¯ä¿¡æ¯ |
| | | * |
| | | * @param id 产线信æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteBsLineInfoById(Long id) |
| | | { |
| | | return bsLineInfoMapper.deleteBsLineInfoById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.billion.main.bs.mapper.BsLineInfoMapper"> |
| | | |
| | | <resultMap type="BsLineInfo" id="BsLineInfoResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="lineCode" column="line_code" /> |
| | | <result property="lineName" column="line_name" /> |
| | | <result property="remarks" column="remarks" /> |
| | | <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="status" column="status" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectBsLineInfoVo"> |
| | | select id, line_code, line_name, remarks, create_by, create_time, update_by, update_time, status, del_flag from bs_line_info |
| | | </sql> |
| | | |
| | | <select id="selectBsLineInfoList" parameterType="BsLineInfo" resultMap="BsLineInfoResult"> |
| | | <include refid="selectBsLineInfoVo"/> |
| | | <where> |
| | | <if test="lineCode != null and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if> |
| | | <if test="lineName != null and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectBsLineInfoById" parameterType="Long" resultMap="BsLineInfoResult"> |
| | | <include refid="selectBsLineInfoVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertBsLineInfo" parameterType="BsLineInfo" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into bs_line_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="lineCode != null and lineCode != ''">line_code,</if> |
| | | <if test="lineName != null">line_name,</if> |
| | | <if test="remarks != null">remarks,</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="status != null">status,</if> |
| | | <if test="delFlag != null">del_flag,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="lineCode != null and lineCode != ''">#{lineCode},</if> |
| | | <if test="lineName != null">#{lineName},</if> |
| | | <if test="remarks != null">#{remarks},</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="status != null">#{status},</if> |
| | | <if test="delFlag != null">#{delFlag},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateBsLineInfo" parameterType="BsLineInfo"> |
| | | update bs_line_info |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="lineCode != null and lineCode != ''">line_code = #{lineCode},</if> |
| | | <if test="lineName != null">line_name = #{lineName},</if> |
| | | <if test="remarks != null">remarks = #{remarks},</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="status != null">status = #{status},</if> |
| | | <if test="delFlag != null">del_flag = #{delFlag},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteBsLineInfoById" parameterType="Long"> |
| | | delete from bs_line_info where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteBsLineInfoByIds" parameterType="String"> |
| | | delete from bs_line_info where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢äº§çº¿ä¿¡æ¯å表 |
| | | export function listLineInfo(query) { |
| | | return request({ |
| | | url: '/bs/lineInfo/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢äº§çº¿ä¿¡æ¯è¯¦ç» |
| | | export function getLineInfo(id) { |
| | | return request({ |
| | | url: '/bs/lineInfo/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢äº§çº¿ä¿¡æ¯ |
| | | export function addLineInfo(data) { |
| | | return request({ |
| | | url: '/bs/lineInfo', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹äº§çº¿ä¿¡æ¯ |
| | | export function updateLineInfo(data) { |
| | | return request({ |
| | | url: '/bs/lineInfo', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤äº§çº¿ä¿¡æ¯ |
| | | export function delLineInfo(id) { |
| | | return request({ |
| | | url: '/bs/lineInfo/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="产线ç¼å·" prop="lineCode"> |
| | | <el-input |
| | | v-model="queryParams.lineCode" |
| | | placeholder="请è¾å
¥äº§çº¿ç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产线åç§°" prop="lineName"> |
| | | <el-input |
| | | v-model="queryParams.lineName" |
| | | placeholder="请è¾å
¥äº§çº¿åç§°" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item style="float: right"> |
| | | <el-button type="primary" 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" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['bs:lineInfo:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['bs:lineInfo:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['bs:lineInfo:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['bs:lineInfo:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table border v-loading="loading" :data="lineInfoList" @selection-change="handleSelectionChange"> |
| | | <el-table-column show-overflow-tooltip="true" type="selection" width="55" align="center" /> |
| | | <el-table-column label="主é®id" align="center" prop="id" /> |
| | | <el-table-column label="产线ç¼å·" align="center" prop="lineCode" /> |
| | | <el-table-column label="产线åç§°" align="center" prop="lineName" /> |
| | | <el-table-column label="夿³¨" align="center" prop="remarks" /> |
| | | <el-table-column label="ç¶æ" align="center" prop="status" /> |
| | | </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="lineCode"> |
| | | <el-input v-model="form.lineCode" placeholder="请è¾å
¥äº§çº¿ç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="产线åç§°" prop="lineName"> |
| | | <el-input v-model="form.lineName" placeholder="请è¾å
¥äº§çº¿åç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remarks"> |
| | | <el-input v-model="form.remarks" 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> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listLineInfo, getLineInfo, delLineInfo, addLineInfo, updateLineInfo } from "@/api/main/bs/lineInfo"; |
| | | |
| | | export default { |
| | | name: "LineInfo", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // 产线信æ¯è¡¨æ ¼æ°æ® |
| | | lineInfoList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | lineCode: null, |
| | | lineName: null, |
| | | status: null, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | lineCode: [ |
| | | { required: true, message: "产线ç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢äº§çº¿ä¿¡æ¯å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listLineInfo(this.queryParams).then(response => { |
| | | this.lineInfoList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | lineCode: null, |
| | | lineName: null, |
| | | remarks: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null, |
| | | status: null, |
| | | delFlag: 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 |
| | | getLineInfo(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) { |
| | | updateLineInfo(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addLineInfo(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤').then(function() { |
| | | return delLineInfo(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('bs/lineInfo/export', { |
| | | ...this.queryParams |
| | | }, `lineInfo_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['da:materialCollection:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['da:materialCollection:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['da:materialCollection:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="primary"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-plus"--> |
| | | <!-- size="mini"--> |
| | | <!-- @click="handleAdd"--> |
| | | <!-- v-hasPermi="['da:materialCollection:add']"--> |
| | | <!-- >æ°å¢</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="success"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-edit"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="single"--> |
| | | <!-- @click="handleUpdate"--> |
| | | <!-- v-hasPermi="['da:materialCollection:edit']"--> |
| | | <!-- >ä¿®æ¹</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="danger"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-delete"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="multiple"--> |
| | | <!-- @click="handleDelete"--> |
| | | <!-- v-hasPermi="['da:materialCollection:remove']"--> |
| | | <!-- >å é¤</el-button>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | |
| | | |
| | | <el-table border v-loading="loading" :data="materialCollectionList" @selection-change="handleSelectionChange"> |
| | | <el-table-column show-overflow-tooltip="true" type="selection" width="55" align="center" /> |
| | | <el-table-column label="主é®id" align="center" prop="id" /> |
| | | <!-- <el-table-column label="主é®id" align="center" prop="id" />--> |
| | | <el-table-column label="æ»æåºåå·" align="center" prop="sfcCode" /> |
| | | <el-table-column label="å·¥ä½ç¼ç " align="center" prop="locationCode" /> |
| | | <el-table-column label="åæ°ç¼ç " align="center" prop="paramCode" /> |