¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.em.equipmentArchives.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.jcdm.common.annotation.Log; |
| | | import com.jcdm.common.core.controller.BaseController; |
| | | import com.jcdm.common.core.domain.AjaxResult; |
| | | import com.jcdm.common.enums.BusinessType; |
| | | import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives; |
| | | import com.jcdm.main.em.equipmentArchives.service.IEmEquipmentArchivesService; |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 设å¤æ¡£æ¡Controller |
| | | * |
| | | * @author Yi |
| | | * @date 2023-12-26 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/em/equipmentArchives") |
| | | public class EmEquipmentArchivesController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IEmEquipmentArchivesService emEquipmentArchivesService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤æ¡£æ¡å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('em:equipmentArchives:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(EmEquipmentArchives emEquipmentArchives) |
| | | { |
| | | startPage(); |
| | | List<EmEquipmentArchives> list = emEquipmentArchivesService.selectEmEquipmentArchivesList(emEquipmentArchives); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè®¾å¤æ¡£æ¡å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('em:equipmentArchives:export')") |
| | | @Log(title = "设å¤æ¡£æ¡", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, EmEquipmentArchives emEquipmentArchives) |
| | | { |
| | | List<EmEquipmentArchives> list = emEquipmentArchivesService.selectEmEquipmentArchivesList(emEquipmentArchives); |
| | | ExcelUtil<EmEquipmentArchives> util = new ExcelUtil<EmEquipmentArchives>(EmEquipmentArchives.class); |
| | | util.exportExcel(response, list, "设å¤æ¡£æ¡æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·å设å¤æ¡£æ¡è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('em:equipmentArchives:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(emEquipmentArchivesService.selectEmEquipmentArchivesById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤æ¡£æ¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('em:equipmentArchives:add')") |
| | | @Log(title = "设å¤æ¡£æ¡", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody EmEquipmentArchives emEquipmentArchives) |
| | | { |
| | | return toAjax(emEquipmentArchivesService.insertEmEquipmentArchives(emEquipmentArchives)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤æ¡£æ¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('em:equipmentArchives:edit')") |
| | | @Log(title = "设å¤æ¡£æ¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody EmEquipmentArchives emEquipmentArchives) |
| | | { |
| | | return toAjax(emEquipmentArchivesService.updateEmEquipmentArchives(emEquipmentArchives)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤æ¡£æ¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('em:equipmentArchives:remove')") |
| | | @Log(title = "设å¤æ¡£æ¡", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(emEquipmentArchivesService.deleteEmEquipmentArchivesByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.em.equipmentArchives.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.jcdm.common.annotation.Excel; |
| | | import com.jcdm.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 设å¤æ¡£æ¡å¯¹è±¡ em_equipment_archives |
| | | * |
| | | * @author Yi |
| | | * @date 2023-12-26 |
| | | */ |
| | | public class EmEquipmentArchives extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | private Long id; |
| | | |
| | | /** 设å¤ç¼ç */ |
| | | @Excel(name = "设å¤ç¼ç ") |
| | | private String equipmentCode; |
| | | |
| | | /** 设å¤å称 */ |
| | | @Excel(name = "设å¤å称") |
| | | private String equipmentName; |
| | | |
| | | /** åç */ |
| | | @Excel(name = "åç") |
| | | private String equipmentBrand; |
| | | |
| | | /** è§æ ¼åå· */ |
| | | @Excel(name = "è§æ ¼åå·") |
| | | private String equipmentSpec; |
| | | |
| | | /** 设å¤ç±»åID */ |
| | | @Excel(name = "设å¤ç±»åID") |
| | | private Long equipmentTypeId; |
| | | |
| | | /** 设å¤ç±»åç¼ç */ |
| | | @Excel(name = "设å¤ç±»åç¼ç ") |
| | | private String equipmentTypeCode; |
| | | |
| | | /** 设å¤ç±»åå称 */ |
| | | @Excel(name = "设å¤ç±»åå称") |
| | | private String equipmentTypeName; |
| | | |
| | | /** 车é´ç¼ç */ |
| | | @Excel(name = "车é´ç¼ç ") |
| | | private String workshopCode; |
| | | |
| | | /** 产线ç¼ç */ |
| | | @Excel(name = "产线ç¼ç ") |
| | | private String lineCode; |
| | | |
| | | /** å·¥åºç¼ç */ |
| | | @Excel(name = "å·¥åºç¼ç ") |
| | | private String processes; |
| | | |
| | | /** 设å¤ç¶æ */ |
| | | @Excel(name = "设å¤ç¶æ") |
| | | private String status; |
| | | |
| | | /** å建人 */ |
| | | @Excel(name = "å建人") |
| | | private String createUser; |
| | | |
| | | /** æ´æ°äºº */ |
| | | @Excel(name = "æ´æ°äºº") |
| | | private String updateUser; |
| | | |
| | | /** é¢çå段1 */ |
| | | @Excel(name = "é¢çå段1") |
| | | private String spareField1; |
| | | |
| | | /** é¢çå段2 */ |
| | | @Excel(name = "é¢çå段2") |
| | | private String spareField2; |
| | | |
| | | /** é¢çå段3 */ |
| | | @Excel(name = "é¢çå段3") |
| | | private Long spareField3; |
| | | |
| | | /** é¢çå段4 */ |
| | | @Excel(name = "é¢çå段4") |
| | | private Long spareField4; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setEquipmentCode(String equipmentCode) |
| | | { |
| | | this.equipmentCode = equipmentCode; |
| | | } |
| | | |
| | | public String getEquipmentCode() |
| | | { |
| | | return equipmentCode; |
| | | } |
| | | public void setEquipmentName(String equipmentName) |
| | | { |
| | | this.equipmentName = equipmentName; |
| | | } |
| | | |
| | | public String getEquipmentName() |
| | | { |
| | | return equipmentName; |
| | | } |
| | | public void setEquipmentBrand(String equipmentBrand) |
| | | { |
| | | this.equipmentBrand = equipmentBrand; |
| | | } |
| | | |
| | | public String getEquipmentBrand() |
| | | { |
| | | return equipmentBrand; |
| | | } |
| | | public void setEquipmentSpec(String equipmentSpec) |
| | | { |
| | | this.equipmentSpec = equipmentSpec; |
| | | } |
| | | |
| | | public String getEquipmentSpec() |
| | | { |
| | | return equipmentSpec; |
| | | } |
| | | public void setEquipmentTypeId(Long equipmentTypeId) |
| | | { |
| | | this.equipmentTypeId = equipmentTypeId; |
| | | } |
| | | |
| | | public Long getEquipmentTypeId() |
| | | { |
| | | return equipmentTypeId; |
| | | } |
| | | public void setEquipmentTypeCode(String equipmentTypeCode) |
| | | { |
| | | this.equipmentTypeCode = equipmentTypeCode; |
| | | } |
| | | |
| | | public String getEquipmentTypeCode() |
| | | { |
| | | return equipmentTypeCode; |
| | | } |
| | | public void setEquipmentTypeName(String equipmentTypeName) |
| | | { |
| | | this.equipmentTypeName = equipmentTypeName; |
| | | } |
| | | |
| | | public String getEquipmentTypeName() |
| | | { |
| | | return equipmentTypeName; |
| | | } |
| | | public void setWorkshopCode(String workshopCode) |
| | | { |
| | | this.workshopCode = workshopCode; |
| | | } |
| | | |
| | | public String getWorkshopCode() |
| | | { |
| | | return workshopCode; |
| | | } |
| | | public void setLineCode(String lineCode) |
| | | { |
| | | this.lineCode = lineCode; |
| | | } |
| | | |
| | | public String getLineCode() |
| | | { |
| | | return lineCode; |
| | | } |
| | | public void setProcesses(String processes) |
| | | { |
| | | this.processes = processes; |
| | | } |
| | | |
| | | public String getProcesses() |
| | | { |
| | | return processes; |
| | | } |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | public void setCreateUser(String createUser) |
| | | { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public String getCreateUser() |
| | | { |
| | | return createUser; |
| | | } |
| | | public void setUpdateUser(String updateUser) |
| | | { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public String getUpdateUser() |
| | | { |
| | | return updateUser; |
| | | } |
| | | public void setSpareField1(String spareField1) |
| | | { |
| | | this.spareField1 = spareField1; |
| | | } |
| | | |
| | | public String getSpareField1() |
| | | { |
| | | return spareField1; |
| | | } |
| | | public void setSpareField2(String spareField2) |
| | | { |
| | | this.spareField2 = spareField2; |
| | | } |
| | | |
| | | public String getSpareField2() |
| | | { |
| | | return spareField2; |
| | | } |
| | | public void setSpareField3(Long spareField3) |
| | | { |
| | | this.spareField3 = spareField3; |
| | | } |
| | | |
| | | public Long getSpareField3() |
| | | { |
| | | return spareField3; |
| | | } |
| | | public void setSpareField4(Long spareField4) |
| | | { |
| | | this.spareField4 = spareField4; |
| | | } |
| | | |
| | | public Long getSpareField4() |
| | | { |
| | | return spareField4; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("equipmentCode", getEquipmentCode()) |
| | | .append("equipmentName", getEquipmentName()) |
| | | .append("equipmentBrand", getEquipmentBrand()) |
| | | .append("equipmentSpec", getEquipmentSpec()) |
| | | .append("equipmentTypeId", getEquipmentTypeId()) |
| | | .append("equipmentTypeCode", getEquipmentTypeCode()) |
| | | .append("equipmentTypeName", getEquipmentTypeName()) |
| | | .append("workshopCode", getWorkshopCode()) |
| | | .append("lineCode", getLineCode()) |
| | | .append("processes", getProcesses()) |
| | | .append("status", getStatus()) |
| | | .append("remark", getRemark()) |
| | | .append("createUser", getCreateUser()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateUser", getUpdateUser()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("spareField1", getSpareField1()) |
| | | .append("spareField2", getSpareField2()) |
| | | .append("spareField3", getSpareField3()) |
| | | .append("spareField4", getSpareField4()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.em.equipmentArchives.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives; |
| | | |
| | | /** |
| | | * 设å¤æ¡£æ¡Mapperæ¥å£ |
| | | * |
| | | * @author Yi |
| | | * @date 2023-12-26 |
| | | */ |
| | | public interface EmEquipmentArchivesMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param id 设å¤æ¡£æ¡ä¸»é® |
| | | * @return 设å¤æ¡£æ¡ |
| | | */ |
| | | public EmEquipmentArchives selectEmEquipmentArchivesById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤æ¡£æ¡å表 |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return 设å¤æ¡£æ¡éå |
| | | */ |
| | | public List<EmEquipmentArchives> selectEmEquipmentArchivesList(EmEquipmentArchives emEquipmentArchives); |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives); |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives); |
| | | |
| | | /** |
| | | * å é¤è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param id 设å¤æ¡£æ¡ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEmEquipmentArchivesById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEmEquipmentArchivesByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.em.equipmentArchives.service; |
| | | |
| | | import java.util.List; |
| | | import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives; |
| | | |
| | | /** |
| | | * 设å¤æ¡£æ¡Serviceæ¥å£ |
| | | * |
| | | * @author Yi |
| | | * @date 2023-12-26 |
| | | */ |
| | | public interface IEmEquipmentArchivesService |
| | | { |
| | | /** |
| | | * æ¥è¯¢è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param id 设å¤æ¡£æ¡ä¸»é® |
| | | * @return 设å¤æ¡£æ¡ |
| | | */ |
| | | public EmEquipmentArchives selectEmEquipmentArchivesById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤æ¡£æ¡å表 |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return 设å¤æ¡£æ¡éå |
| | | */ |
| | | public List<EmEquipmentArchives> selectEmEquipmentArchivesList(EmEquipmentArchives emEquipmentArchives); |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives); |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives); |
| | | |
| | | /** |
| | | * æ¹éå é¤è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param ids éè¦å é¤ç设å¤æ¡£æ¡ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEmEquipmentArchivesByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤è®¾å¤æ¡£æ¡ä¿¡æ¯ |
| | | * |
| | | * @param id 设å¤æ¡£æ¡ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteEmEquipmentArchivesById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.em.equipmentArchives.service.impl; |
| | | |
| | | import java.util.List; |
| | | import com.jcdm.common.utils.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.jcdm.main.em.equipmentArchives.mapper.EmEquipmentArchivesMapper; |
| | | import com.jcdm.main.em.equipmentArchives.domain.EmEquipmentArchives; |
| | | import com.jcdm.main.em.equipmentArchives.service.IEmEquipmentArchivesService; |
| | | |
| | | /** |
| | | * 设å¤æ¡£æ¡Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author Yi |
| | | * @date 2023-12-26 |
| | | */ |
| | | @Service |
| | | public class EmEquipmentArchivesServiceImpl implements IEmEquipmentArchivesService |
| | | { |
| | | @Autowired |
| | | private EmEquipmentArchivesMapper emEquipmentArchivesMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param id 设å¤æ¡£æ¡ä¸»é® |
| | | * @return 设å¤æ¡£æ¡ |
| | | */ |
| | | @Override |
| | | public EmEquipmentArchives selectEmEquipmentArchivesById(Long id) |
| | | { |
| | | return emEquipmentArchivesMapper.selectEmEquipmentArchivesById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤æ¡£æ¡å表 |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return 设å¤æ¡£æ¡ |
| | | */ |
| | | @Override |
| | | public List<EmEquipmentArchives> selectEmEquipmentArchivesList(EmEquipmentArchives emEquipmentArchives) |
| | | { |
| | | return emEquipmentArchivesMapper.selectEmEquipmentArchivesList(emEquipmentArchives); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives) |
| | | { |
| | | emEquipmentArchives.setCreateTime(DateUtils.getNowDate()); |
| | | return emEquipmentArchivesMapper.insertEmEquipmentArchives(emEquipmentArchives); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param emEquipmentArchives 设å¤æ¡£æ¡ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateEmEquipmentArchives(EmEquipmentArchives emEquipmentArchives) |
| | | { |
| | | emEquipmentArchives.setUpdateTime(DateUtils.getNowDate()); |
| | | return emEquipmentArchivesMapper.updateEmEquipmentArchives(emEquipmentArchives); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤è®¾å¤æ¡£æ¡ |
| | | * |
| | | * @param ids éè¦å é¤ç设å¤æ¡£æ¡ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteEmEquipmentArchivesByIds(Long[] ids) |
| | | { |
| | | return emEquipmentArchivesMapper.deleteEmEquipmentArchivesByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤æ¡£æ¡ä¿¡æ¯ |
| | | * |
| | | * @param id 设å¤æ¡£æ¡ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteEmEquipmentArchivesById(Long id) |
| | | { |
| | | return emEquipmentArchivesMapper.deleteEmEquipmentArchivesById(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.jcdm.main.em.equipmentArchives.mapper.EmEquipmentArchivesMapper"> |
| | | |
| | | <resultMap type="EmEquipmentArchives" id="EmEquipmentArchivesResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="equipmentCode" column="equipment_code" /> |
| | | <result property="equipmentName" column="equipment_name" /> |
| | | <result property="equipmentBrand" column="equipment_brand" /> |
| | | <result property="equipmentSpec" column="equipment_spec" /> |
| | | <result property="equipmentTypeId" column="equipment_type_id" /> |
| | | <result property="equipmentTypeCode" column="equipment_type_code" /> |
| | | <result property="equipmentTypeName" column="equipment_type_name" /> |
| | | <result property="workshopCode" column="workshop_code" /> |
| | | <result property="lineCode" column="line_code" /> |
| | | <result property="processes" column="processes" /> |
| | | <result property="status" column="status" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="createUser" column="create_user" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateUser" column="update_user" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="spareField1" column="spare_field_1" /> |
| | | <result property="spareField2" column="spare_field_2" /> |
| | | <result property="spareField3" column="spare_field_3" /> |
| | | <result property="spareField4" column="spare_field_4" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectEmEquipmentArchivesVo"> |
| | | select id, equipment_code, equipment_name, equipment_brand, equipment_spec, equipment_type_id, equipment_type_code, equipment_type_name, workshop_code, line_code, processes, status, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from em_equipment_archives |
| | | </sql> |
| | | |
| | | <select id="selectEmEquipmentArchivesList" parameterType="EmEquipmentArchives" resultMap="EmEquipmentArchivesResult"> |
| | | <include refid="selectEmEquipmentArchivesVo"/> |
| | | <where> |
| | | <if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if> |
| | | <if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if> |
| | | <if test="equipmentBrand != null and equipmentBrand != ''"> and equipment_brand = #{equipmentBrand}</if> |
| | | <if test="equipmentSpec != null and equipmentSpec != ''"> and equipment_spec = #{equipmentSpec}</if> |
| | | <if test="equipmentTypeId != null "> and equipment_type_id = #{equipmentTypeId}</if> |
| | | <if test="equipmentTypeCode != null and equipmentTypeCode != ''"> and equipment_type_code = #{equipmentTypeCode}</if> |
| | | <if test="equipmentTypeName != null and equipmentTypeName != ''"> and equipment_type_name like concat('%', #{equipmentTypeName}, '%')</if> |
| | | <if test="workshopCode != null and workshopCode != ''"> and workshop_code = #{workshopCode}</if> |
| | | <if test="lineCode != null and lineCode != ''"> and line_code = #{lineCode}</if> |
| | | <if test="processes != null and processes != ''"> and processes = #{processes}</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
| | | <if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> |
| | | <if test="spareField1 != null and spareField1 != ''"> and spare_field_1 = #{spareField1}</if> |
| | | <if test="spareField2 != null and spareField2 != ''"> and spare_field_2 = #{spareField2}</if> |
| | | <if test="spareField3 != null "> and spare_field_3 = #{spareField3}</if> |
| | | <if test="spareField4 != null "> and spare_field_4 = #{spareField4}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectEmEquipmentArchivesById" parameterType="Long" resultMap="EmEquipmentArchivesResult"> |
| | | <include refid="selectEmEquipmentArchivesVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertEmEquipmentArchives" parameterType="EmEquipmentArchives"> |
| | | insert into em_equipment_archives |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="equipmentCode != null and equipmentCode != ''">equipment_code,</if> |
| | | <if test="equipmentName != null and equipmentName != ''">equipment_name,</if> |
| | | <if test="equipmentBrand != null">equipment_brand,</if> |
| | | <if test="equipmentSpec != null">equipment_spec,</if> |
| | | <if test="equipmentTypeId != null">equipment_type_id,</if> |
| | | <if test="equipmentTypeCode != null">equipment_type_code,</if> |
| | | <if test="equipmentTypeName != null">equipment_type_name,</if> |
| | | <if test="workshopCode != null">workshop_code,</if> |
| | | <if test="lineCode != null">line_code,</if> |
| | | <if test="processes != null">processes,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="createUser != null">create_user,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateUser != null">update_user,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="spareField1 != null">spare_field_1,</if> |
| | | <if test="spareField2 != null">spare_field_2,</if> |
| | | <if test="spareField3 != null">spare_field_3,</if> |
| | | <if test="spareField4 != null">spare_field_4,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if> |
| | | <if test="equipmentName != null and equipmentName != ''">#{equipmentName},</if> |
| | | <if test="equipmentBrand != null">#{equipmentBrand},</if> |
| | | <if test="equipmentSpec != null">#{equipmentSpec},</if> |
| | | <if test="equipmentTypeId != null">#{equipmentTypeId},</if> |
| | | <if test="equipmentTypeCode != null">#{equipmentTypeCode},</if> |
| | | <if test="equipmentTypeName != null">#{equipmentTypeName},</if> |
| | | <if test="workshopCode != null">#{workshopCode},</if> |
| | | <if test="lineCode != null">#{lineCode},</if> |
| | | <if test="processes != null">#{processes},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | <if test="createUser != null">#{createUser},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateUser != null">#{updateUser},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="spareField1 != null">#{spareField1},</if> |
| | | <if test="spareField2 != null">#{spareField2},</if> |
| | | <if test="spareField3 != null">#{spareField3},</if> |
| | | <if test="spareField4 != null">#{spareField4},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateEmEquipmentArchives" parameterType="EmEquipmentArchives"> |
| | | update em_equipment_archives |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if> |
| | | <if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if> |
| | | <if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if> |
| | | <if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if> |
| | | <if test="equipmentTypeId != null">equipment_type_id = #{equipmentTypeId},</if> |
| | | <if test="equipmentTypeCode != null">equipment_type_code = #{equipmentTypeCode},</if> |
| | | <if test="equipmentTypeName != null">equipment_type_name = #{equipmentTypeName},</if> |
| | | <if test="workshopCode != null">workshop_code = #{workshopCode},</if> |
| | | <if test="lineCode != null">line_code = #{lineCode},</if> |
| | | <if test="processes != null">processes = #{processes},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="createUser != null">create_user = #{createUser},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateUser != null">update_user = #{updateUser},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="spareField1 != null">spare_field_1 = #{spareField1},</if> |
| | | <if test="spareField2 != null">spare_field_2 = #{spareField2},</if> |
| | | <if test="spareField3 != null">spare_field_3 = #{spareField3},</if> |
| | | <if test="spareField4 != null">spare_field_4 = #{spareField4},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteEmEquipmentArchivesById" parameterType="Long"> |
| | | delete from em_equipment_archives where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteEmEquipmentArchivesByIds" parameterType="String"> |
| | | delete from em_equipment_archives where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢è®¾å¤æ¡£æ¡å表 |
| | | export function listEquipmentArchives(query) { |
| | | return request({ |
| | | url: '/em/equipmentArchives/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢è®¾å¤æ¡£æ¡è¯¦ç» |
| | | export function getEquipmentArchives(id) { |
| | | return request({ |
| | | url: '/em/equipmentArchives/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢è®¾å¤æ¡£æ¡ |
| | | export function addEquipmentArchives(data) { |
| | | return request({ |
| | | url: '/em/equipmentArchives', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹è®¾å¤æ¡£æ¡ |
| | | export function updateEquipmentArchives(data) { |
| | | return request({ |
| | | url: '/em/equipmentArchives', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤è®¾å¤æ¡£æ¡ |
| | | export function delEquipmentArchives(id) { |
| | | return request({ |
| | | url: '/em/equipmentArchives/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-card class="box-card"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="设å¤ç¼ç " prop="equipmentCode"> |
| | | <el-input |
| | | v-model="queryParams.equipmentCode" |
| | | placeholder="请è¾å
¥è®¾å¤ç¼ç " |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤å称" prop="equipmentName"> |
| | | <el-input |
| | | v-model="queryParams.equipmentName" |
| | | 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-card> |
| | | |
| | | <el-card style="margin-top: 10px" class="box-card"> |
| | | <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="['em:equipmentArchives: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="['em:equipmentArchives: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="['em:equipmentArchives: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="['em:equipmentArchives:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table border v-loading="loading" :data="equipmentArchivesList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="设å¤ç¼ç " align="center" prop="equipmentCode"/> |
| | | <el-table-column label="设å¤å称" align="center" prop="equipmentName"/> |
| | | <el-table-column label="åç" align="center" prop="equipmentBrand"/> |
| | | <el-table-column label="è§æ ¼åå·" align="center" prop="equipmentSpec"/> |
| | | <el-table-column label="车é´ç¼ç " align="center" prop="workshopCode"/> |
| | | <el-table-column label="设å¤ç¶æ" align="center" prop="status"/> |
| | | <el-table-column label="æ¥è¦æ¶é´" width="160" align="center" prop="createTime"/> |
| | | <el-table-column fixed="right" width="200" label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="success" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['em:equipmentArchives:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="danger" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['em:equipmentArchives:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹è®¾å¤æ¡£æ¡å¯¹è¯æ¡ --> |
| | | <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <span slot="title"> |
| | | <i class="el-icon-s-order"></i> |
| | | {{titleName}} |
| | | </span> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="设å¤ç¼ç " prop="equipmentCode"> |
| | | <el-input v-model="form.equipmentCode" placeholder="请è¾å
¥è®¾å¤ç¼ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤å称" prop="equipmentName"> |
| | | <el-input v-model="form.equipmentName" placeholder="请è¾å
¥è®¾å¤å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="åç" prop="equipmentBrand"> |
| | | <el-input v-model="form.equipmentBrand" placeholder="请è¾å
¥åç" /> |
| | | </el-form-item> |
| | | <el-form-item label="设å¤ç±»åå称" prop="equipmentTypeName"> |
| | | <el-input v-model="form.equipmentTypeName" placeholder="请è¾å
¥è®¾å¤ç±»åå称" /> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼åå·" prop="equipmentSpec"> |
| | | <el-input v-model="form.equipmentSpec" placeholder="请è¾å
¥è§æ ¼åå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="车é´ç¼ç " prop="workshopCode"> |
| | | <el-input v-model="form.workshopCode" placeholder="请è¾å
¥è½¦é´ç¼ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="å¤æ³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="设å¤ç±»åID" prop="equipmentTypeId">--> |
| | | <!-- <el-input v-model="form.equipmentTypeId" placeholder="请è¾å
¥è®¾å¤ç±»åID" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="设å¤ç±»åç¼ç " prop="equipmentTypeCode">--> |
| | | <!-- <el-input v-model="form.equipmentTypeCode" placeholder="请è¾å
¥è®¾å¤ç±»åç¼ç " />--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | |
| | | <!-- <el-form-item label="产线ç¼ç " prop="lineCode">--> |
| | | <!-- <el-input v-model="form.lineCode" placeholder="请è¾å
¥äº§çº¿ç¼ç " />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="å·¥åºç¼ç " prop="processes">--> |
| | | <!-- <el-input v-model="form.processes" placeholder="请è¾å
¥å·¥åºç¼ç " />--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | <!-- <el-form-item label="å建人" prop="createUser">--> |
| | | <!-- <el-input v-model="form.createUser" placeholder="请è¾å
¥å建人" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="æ´æ°äºº" prop="updateUser">--> |
| | | <!-- <el-input v-model="form.updateUser" placeholder="请è¾å
¥æ´æ°äºº" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="é¢çå段1" prop="spareField1">--> |
| | | <!-- <el-input v-model="form.spareField1" placeholder="请è¾å
¥é¢çå段1" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="é¢çå段2" prop="spareField2">--> |
| | | <!-- <el-input v-model="form.spareField2" placeholder="请è¾å
¥é¢çå段2" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="é¢çå段3" prop="spareField3">--> |
| | | <!-- <el-input v-model="form.spareField3" placeholder="请è¾å
¥é¢çå段3" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="é¢çå段4" prop="spareField4">--> |
| | | <!-- <el-input v-model="form.spareField4" placeholder="请è¾å
¥é¢çå段4" />--> |
| | | <!-- </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 { listEquipmentArchives, getEquipmentArchives, delEquipmentArchives, addEquipmentArchives, updateEquipmentArchives } from "@/api/main/em/equipmentArchives/equipmentArchives"; |
| | | |
| | | export default { |
| | | name: "EquipmentArchives", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | titleName: "", |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // 设å¤æ¡£æ¡è¡¨æ ¼æ°æ® |
| | | equipmentArchivesList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | equipmentCode: null, |
| | | equipmentName: null, |
| | | equipmentBrand: null, |
| | | equipmentSpec: null, |
| | | equipmentTypeId: null, |
| | | equipmentTypeCode: null, |
| | | equipmentTypeName: null, |
| | | workshopCode: null, |
| | | lineCode: null, |
| | | processes: null, |
| | | status: null, |
| | | createUser: null, |
| | | updateUser: null, |
| | | spareField1: null, |
| | | spareField2: null, |
| | | spareField3: null, |
| | | spareField4: null |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "IDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | equipmentCode: [ |
| | | { required: true, message: "设å¤ç¼ç ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | equipmentName: [ |
| | | { required: true, message: "设å¤å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | equipmentTypeId: [ |
| | | { required: true, message: "设å¤ç±»åIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢è®¾å¤æ¡£æ¡å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listEquipmentArchives(this.queryParams).then(response => { |
| | | this.equipmentArchivesList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | equipmentCode: null, |
| | | equipmentName: null, |
| | | equipmentBrand: null, |
| | | equipmentSpec: null, |
| | | equipmentTypeId: null, |
| | | equipmentTypeCode: null, |
| | | equipmentTypeName: null, |
| | | workshopCode: null, |
| | | lineCode: null, |
| | | processes: null, |
| | | status: null, |
| | | remark: null, |
| | | createUser: null, |
| | | createTime: null, |
| | | updateUser: null, |
| | | updateTime: null, |
| | | spareField1: null, |
| | | spareField2: null, |
| | | spareField3: null, |
| | | spareField4: 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.titleName = "æ·»å 设å¤æ¡£æ¡"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getEquipmentArchives(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.titleName = "ä¿®æ¹è®¾å¤æ¡£æ¡"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateEquipmentArchives(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addEquipmentArchives(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤è®¾å¤æ¡£æ¡ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delEquipmentArchives(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('em/equipmentArchives/export', { |
| | | ...this.queryParams |
| | | }, `equipmentArchives_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |