liuxiaoxu
1 month ago
15 changed files with 0 additions and 2514 deletions
@ -1,28 +0,0 @@ |
|||||
package com.ruoyi.ck.controller; |
|
||||
|
|
||||
import com.ruoyi.common.core.controller.BaseController; |
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
||||
import org.springframework.stereotype.Controller; |
|
||||
import org.springframework.web.bind.annotation.GetMapping; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
|
|
||||
/** |
|
||||
* 物料清单Controller |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2021-06-21 |
|
||||
*/ |
|
||||
@Controller |
|
||||
@RequestMapping("/ck/dataCollect") |
|
||||
public class DataCollectController extends BaseController { |
|
||||
private String prefix = "ck/dataCollect"; |
|
||||
|
|
||||
|
|
||||
@RequiresPermissions("ck:dataCollect:view") |
|
||||
@GetMapping() |
|
||||
public String bom() { |
|
||||
return prefix + "/dataCollect"; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,144 +0,0 @@ |
|||||
package com.ruoyi.ck.controller; |
|
||||
|
|
||||
import com.ruoyi.ck.domain.PictureUpload; |
|
||||
import com.ruoyi.ck.service.IPictureUploadService; |
|
||||
import com.ruoyi.ck.utils.Result; |
|
||||
import com.ruoyi.common.annotation.Log; |
|
||||
import com.ruoyi.common.core.controller.BaseController; |
|
||||
import com.ruoyi.common.core.domain.AjaxResult; |
|
||||
import com.ruoyi.common.core.page.TableDataInfo; |
|
||||
import com.ruoyi.common.enums.BusinessType; |
|
||||
import com.ruoyi.common.utils.file.FileUtils; |
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Controller; |
|
||||
import org.springframework.ui.ModelMap; |
|
||||
import org.springframework.web.bind.annotation.*; |
|
||||
import org.springframework.web.multipart.MultipartFile; |
|
||||
|
|
||||
import javax.servlet.http.HttpServletRequest; |
|
||||
import javax.servlet.http.HttpServletResponse; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 上传图片Controller |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2021-12-28 |
|
||||
*/ |
|
||||
@Controller |
|
||||
@RequestMapping("/ck/upload") |
|
||||
public class PictureUploadController extends BaseController { |
|
||||
private String prefix = "ck/upload"; |
|
||||
|
|
||||
@Autowired |
|
||||
private IPictureUploadService pictureUploadService; |
|
||||
|
|
||||
@RequiresPermissions("ck:upload:view") |
|
||||
@GetMapping() |
|
||||
public String upload() { |
|
||||
return prefix + "/upload"; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询上传图片列表 |
|
||||
*/ |
|
||||
@RequiresPermissions("ck:upload:list") |
|
||||
@PostMapping("/list") |
|
||||
@ResponseBody |
|
||||
public TableDataInfo list(PictureUpload pictureUpload) { |
|
||||
startPage(); |
|
||||
List<PictureUpload> list = pictureUploadService.selectPictureUploadList(pictureUpload); |
|
||||
return getDataTable(list); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 导出上传图片列表 |
|
||||
*/ |
|
||||
@RequiresPermissions("ck:upload:export") |
|
||||
@Log(title = "上传图片", businessType = BusinessType.EXPORT) |
|
||||
@PostMapping("/export") |
|
||||
@ResponseBody |
|
||||
public AjaxResult export(PictureUpload pictureUpload) { |
|
||||
List<PictureUpload> list = pictureUploadService.selectPictureUploadList(pictureUpload); |
|
||||
ExcelUtil<PictureUpload> util = new ExcelUtil<PictureUpload>(PictureUpload.class); |
|
||||
return util.exportExcel(list, "上传图片数据"); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增上传图片 |
|
||||
*/ |
|
||||
@GetMapping("/add") |
|
||||
public String add() { |
|
||||
return prefix + "/add"; |
|
||||
} |
|
||||
|
|
||||
@GetMapping("/toUploadHtml") |
|
||||
public String toUploadHtml() { |
|
||||
return prefix + "/uploadPicture"; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增保存上传图片 |
|
||||
*/ |
|
||||
@RequiresPermissions("ck:upload:add") |
|
||||
@Log(title = "上传图片", businessType = BusinessType.INSERT) |
|
||||
@PostMapping("/add") |
|
||||
@ResponseBody |
|
||||
public AjaxResult addSave(PictureUpload pictureUpload) { |
|
||||
return toAjax(pictureUploadService.insertPictureUpload(pictureUpload)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改上传图片 |
|
||||
*/ |
|
||||
@GetMapping("/edit/{id}") |
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap) { |
|
||||
PictureUpload pictureUpload = pictureUploadService.selectPictureUploadById(id); |
|
||||
mmap.put("pictureUpload", pictureUpload); |
|
||||
return prefix + "/edit"; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改保存上传图片 |
|
||||
*/ |
|
||||
@RequiresPermissions("ck:upload:edit") |
|
||||
@Log(title = "上传图片", businessType = BusinessType.UPDATE) |
|
||||
@PostMapping("/edit") |
|
||||
@ResponseBody |
|
||||
public AjaxResult editSave(PictureUpload pictureUpload) { |
|
||||
return toAjax(pictureUploadService.updatePictureUpload(pictureUpload)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除上传图片 |
|
||||
*/ |
|
||||
@RequiresPermissions("ck:upload:remove") |
|
||||
@Log(title = "上传图片", businessType = BusinessType.DELETE) |
|
||||
@PostMapping("/remove") |
|
||||
@ResponseBody |
|
||||
public AjaxResult remove(String ids) { |
|
||||
return toAjax(pictureUploadService.deletePictureUploadByIds(ids)); |
|
||||
} |
|
||||
|
|
||||
@ResponseBody |
|
||||
@PostMapping("/upload") |
|
||||
public Result upload(@RequestParam("file") MultipartFile file, PictureUpload pictureUpload) throws Exception { |
|
||||
return pictureUploadService.uploadPicture(file, pictureUpload); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 本地资源通用下载 |
|
||||
*/ |
|
||||
@GetMapping("/download") |
|
||||
public void resourceDownload(String path, HttpServletRequest request, HttpServletResponse response) |
|
||||
throws Exception { |
|
||||
response.setCharacterEncoding("utf-8"); |
|
||||
response.setContentType("multipart/form-data"); |
|
||||
response.setHeader("Content-Disposition", |
|
||||
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, path)); |
|
||||
FileUtils.writeBytes(path, response.getOutputStream()); |
|
||||
} |
|
||||
|
|
||||
} |
|
@ -1,210 +0,0 @@ |
|||||
package com.ruoyi.ck.domain; |
|
||||
|
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
|
||||
import com.ruoyi.common.annotation.Excel; |
|
||||
import com.ruoyi.common.core.domain.BaseEntity; |
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|
||||
import org.apache.commons.lang3.builder.ToStringStyle; |
|
||||
|
|
||||
import java.util.Date; |
|
||||
|
|
||||
/** |
|
||||
* 上传图片对象 picture_upload |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2021-12-28 |
|
||||
*/ |
|
||||
public class PictureUpload extends BaseEntity |
|
||||
{ |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** 编号 */ |
|
||||
@Excel(name = "编号") |
|
||||
private Long id; |
|
||||
|
|
||||
/** 物料代码 */ |
|
||||
@Excel(name = "物料代码") |
|
||||
private String itemCode; |
|
||||
|
|
||||
/** 图片类型 */ |
|
||||
@Excel(name = "图片类型") |
|
||||
private String type; |
|
||||
|
|
||||
/** 版本 */ |
|
||||
@Excel(name = "版本") |
|
||||
private String version; |
|
||||
|
|
||||
/** 路径 */ |
|
||||
@Excel(name = "路径") |
|
||||
private String path; |
|
||||
|
|
||||
/** 上传日期 */ |
|
||||
@JsonFormat(pattern = "yyyy-MM-dd") |
|
||||
@Excel(name = "上传日期", width = 30, dateFormat = "yyyy-MM-dd") |
|
||||
private Date uploadDate; |
|
||||
|
|
||||
/** 上传人 */ |
|
||||
@Excel(name = "上传人") |
|
||||
private String uploadMan; |
|
||||
|
|
||||
/** */ |
|
||||
@Excel(name = "") |
|
||||
private String spare1; |
|
||||
|
|
||||
/** */ |
|
||||
@Excel(name = "") |
|
||||
private String spare2; |
|
||||
|
|
||||
/** */ |
|
||||
@Excel(name = "") |
|
||||
private String spare3; |
|
||||
|
|
||||
/** */ |
|
||||
@Excel(name = "") |
|
||||
private String spare4; |
|
||||
|
|
||||
/** */ |
|
||||
@Excel(name = "") |
|
||||
private String spare5; |
|
||||
|
|
||||
/** */ |
|
||||
@Excel(name = "") |
|
||||
private String spare6; |
|
||||
|
|
||||
public void setId(Long id) |
|
||||
{ |
|
||||
this.id = id; |
|
||||
} |
|
||||
|
|
||||
public Long getId() |
|
||||
{ |
|
||||
return id; |
|
||||
} |
|
||||
public void setItemCode(String itemCode) |
|
||||
{ |
|
||||
this.itemCode = itemCode; |
|
||||
} |
|
||||
|
|
||||
public String getItemCode() |
|
||||
{ |
|
||||
return itemCode; |
|
||||
} |
|
||||
public void setType(String type) |
|
||||
{ |
|
||||
this.type = type; |
|
||||
} |
|
||||
|
|
||||
public String getType() |
|
||||
{ |
|
||||
return type; |
|
||||
} |
|
||||
public void setVersion(String version) |
|
||||
{ |
|
||||
this.version = version; |
|
||||
} |
|
||||
|
|
||||
public String getVersion() |
|
||||
{ |
|
||||
return version; |
|
||||
} |
|
||||
public void setPath(String path) |
|
||||
{ |
|
||||
this.path = path; |
|
||||
} |
|
||||
|
|
||||
public String getPath() |
|
||||
{ |
|
||||
return path; |
|
||||
} |
|
||||
public void setUploadDate(Date uploadDate) |
|
||||
{ |
|
||||
this.uploadDate = uploadDate; |
|
||||
} |
|
||||
|
|
||||
public Date getUploadDate() |
|
||||
{ |
|
||||
return uploadDate; |
|
||||
} |
|
||||
public void setUploadMan(String uploadMan) |
|
||||
{ |
|
||||
this.uploadMan = uploadMan; |
|
||||
} |
|
||||
|
|
||||
public String getUploadMan() |
|
||||
{ |
|
||||
return uploadMan; |
|
||||
} |
|
||||
public void setSpare1(String spare1) |
|
||||
{ |
|
||||
this.spare1 = spare1; |
|
||||
} |
|
||||
|
|
||||
public String getSpare1() |
|
||||
{ |
|
||||
return spare1; |
|
||||
} |
|
||||
public void setSpare2(String spare2) |
|
||||
{ |
|
||||
this.spare2 = spare2; |
|
||||
} |
|
||||
|
|
||||
public String getSpare2() |
|
||||
{ |
|
||||
return spare2; |
|
||||
} |
|
||||
public void setSpare3(String spare3) |
|
||||
{ |
|
||||
this.spare3 = spare3; |
|
||||
} |
|
||||
|
|
||||
public String getSpare3() |
|
||||
{ |
|
||||
return spare3; |
|
||||
} |
|
||||
public void setSpare4(String spare4) |
|
||||
{ |
|
||||
this.spare4 = spare4; |
|
||||
} |
|
||||
|
|
||||
public String getSpare4() |
|
||||
{ |
|
||||
return spare4; |
|
||||
} |
|
||||
public void setSpare5(String spare5) |
|
||||
{ |
|
||||
this.spare5 = spare5; |
|
||||
} |
|
||||
|
|
||||
public String getSpare5() |
|
||||
{ |
|
||||
return spare5; |
|
||||
} |
|
||||
public void setSpare6(String spare6) |
|
||||
{ |
|
||||
this.spare6 = spare6; |
|
||||
} |
|
||||
|
|
||||
public String getSpare6() |
|
||||
{ |
|
||||
return spare6; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|
||||
.append("id", getId()) |
|
||||
.append("itemCode", getItemCode()) |
|
||||
.append("type", getType()) |
|
||||
.append("version", getVersion()) |
|
||||
.append("path", getPath()) |
|
||||
.append("uploadDate", getUploadDate()) |
|
||||
.append("uploadMan", getUploadMan()) |
|
||||
.append("spare1", getSpare1()) |
|
||||
.append("spare2", getSpare2()) |
|
||||
.append("spare3", getSpare3()) |
|
||||
.append("spare4", getSpare4()) |
|
||||
.append("spare5", getSpare5()) |
|
||||
.append("spare6", getSpare6()) |
|
||||
.toString(); |
|
||||
} |
|
||||
} |
|
@ -1,49 +0,0 @@ |
|||||
package com.ruoyi.ck.domain; |
|
||||
|
|
||||
import java.math.BigDecimal; |
|
||||
|
|
||||
/** |
|
||||
* @author :pyy |
|
||||
* @date :Created in 2021/12/29 16:24 |
|
||||
* @description: |
|
||||
* @modified By: |
|
||||
* @version: $ |
|
||||
*/ |
|
||||
public class UnitConvert { |
|
||||
|
|
||||
private BigDecimal weight; |
|
||||
|
|
||||
private String unit; |
|
||||
|
|
||||
public BigDecimal getWeight() { |
|
||||
return weight; |
|
||||
} |
|
||||
|
|
||||
public UnitConvert(BigDecimal weight, String unit) { |
|
||||
this.weight = weight; |
|
||||
this.unit = unit; |
|
||||
} |
|
||||
|
|
||||
public UnitConvert() { |
|
||||
} |
|
||||
|
|
||||
public void setWeight(BigDecimal weight) { |
|
||||
this.weight = weight; |
|
||||
} |
|
||||
|
|
||||
public String getUnit() { |
|
||||
return unit; |
|
||||
} |
|
||||
|
|
||||
public void setUnit(String unit) { |
|
||||
this.unit = unit; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "unitConvert{" + |
|
||||
"weight=" + weight + |
|
||||
", unit='" + unit + '\'' + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
@ -1,62 +0,0 @@ |
|||||
package com.ruoyi.ck.mapper; |
|
||||
|
|
||||
import com.ruoyi.ck.domain.PictureUpload; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 上传图片Mapper接口 |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2021-12-28 |
|
||||
*/ |
|
||||
public interface PictureUploadMapper |
|
||||
{ |
|
||||
/** |
|
||||
* 查询上传图片 |
|
||||
* |
|
||||
* @param id 上传图片ID |
|
||||
* @return 上传图片 |
|
||||
*/ |
|
||||
public PictureUpload selectPictureUploadById(Long id); |
|
||||
|
|
||||
/** |
|
||||
* 查询上传图片列表 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 上传图片集合 |
|
||||
*/ |
|
||||
public List<PictureUpload> selectPictureUploadList(PictureUpload pictureUpload); |
|
||||
|
|
||||
/** |
|
||||
* 新增上传图片 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int insertPictureUpload(PictureUpload pictureUpload); |
|
||||
|
|
||||
/** |
|
||||
* 修改上传图片 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int updatePictureUpload(PictureUpload pictureUpload); |
|
||||
|
|
||||
/** |
|
||||
* 删除上传图片 |
|
||||
* |
|
||||
* @param id 上传图片ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deletePictureUploadById(Long id); |
|
||||
|
|
||||
/** |
|
||||
* 批量删除上传图片 |
|
||||
* |
|
||||
* @param ids 需要删除的数据ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deletePictureUploadByIds(String[] ids); |
|
||||
} |
|
@ -1,66 +0,0 @@ |
|||||
package com.ruoyi.ck.service; |
|
||||
|
|
||||
import com.ruoyi.ck.domain.PictureUpload; |
|
||||
import com.ruoyi.ck.utils.Result; |
|
||||
import org.springframework.web.multipart.MultipartFile; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 上传图片Service接口 |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2021-12-28 |
|
||||
*/ |
|
||||
public interface IPictureUploadService |
|
||||
{ |
|
||||
/** |
|
||||
* 查询上传图片 |
|
||||
* |
|
||||
* @param id 上传图片ID |
|
||||
* @return 上传图片 |
|
||||
*/ |
|
||||
public PictureUpload selectPictureUploadById(Long id); |
|
||||
|
|
||||
/** |
|
||||
* 查询上传图片列表 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 上传图片集合 |
|
||||
*/ |
|
||||
public List<PictureUpload> selectPictureUploadList(PictureUpload pictureUpload); |
|
||||
|
|
||||
/** |
|
||||
* 新增上传图片 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int insertPictureUpload(PictureUpload pictureUpload); |
|
||||
|
|
||||
/** |
|
||||
* 修改上传图片 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int updatePictureUpload(PictureUpload pictureUpload); |
|
||||
|
|
||||
/** |
|
||||
* 批量删除上传图片 |
|
||||
* |
|
||||
* @param ids 需要删除的数据ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deletePictureUploadByIds(String ids); |
|
||||
|
|
||||
/** |
|
||||
* 删除上传图片信息 |
|
||||
* |
|
||||
* @param id 上传图片ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deletePictureUploadById(Long id); |
|
||||
|
|
||||
public Result uploadPicture(MultipartFile file,PictureUpload pictureUpload)throws Exception; |
|
||||
} |
|
@ -1,112 +0,0 @@ |
|||||
package com.ruoyi.ck.service.impl; |
|
||||
|
|
||||
import com.ruoyi.ck.domain.PictureUpload; |
|
||||
import com.ruoyi.ck.mapper.PictureUploadMapper; |
|
||||
import com.ruoyi.ck.service.IPictureUploadService; |
|
||||
import com.ruoyi.ck.utils.Result; |
|
||||
import com.ruoyi.common.config.RuoYiConfig; |
|
||||
import com.ruoyi.common.core.text.Convert; |
|
||||
import com.ruoyi.common.utils.security.PermissionUtils; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
import org.springframework.web.multipart.MultipartFile; |
|
||||
|
|
||||
import java.io.File; |
|
||||
import java.util.Date; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 上传图片Service业务层处理 |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2021-12-28 |
|
||||
*/ |
|
||||
@Service |
|
||||
public class PictureUploadServiceImpl implements IPictureUploadService { |
|
||||
@Autowired |
|
||||
private PictureUploadMapper pictureUploadMapper; |
|
||||
|
|
||||
/** |
|
||||
* 查询上传图片 |
|
||||
* |
|
||||
* @param id 上传图片ID |
|
||||
* @return 上传图片 |
|
||||
*/ |
|
||||
@Override |
|
||||
public PictureUpload selectPictureUploadById(Long id) { |
|
||||
return pictureUploadMapper.selectPictureUploadById(id); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询上传图片列表 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 上传图片 |
|
||||
*/ |
|
||||
@Override |
|
||||
public List<PictureUpload> selectPictureUploadList(PictureUpload pictureUpload) { |
|
||||
return pictureUploadMapper.selectPictureUploadList(pictureUpload); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增上传图片 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int insertPictureUpload(PictureUpload pictureUpload) { |
|
||||
return pictureUploadMapper.insertPictureUpload(pictureUpload); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改上传图片 |
|
||||
* |
|
||||
* @param pictureUpload 上传图片 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int updatePictureUpload(PictureUpload pictureUpload) { |
|
||||
return pictureUploadMapper.updatePictureUpload(pictureUpload); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除上传图片对象 |
|
||||
* |
|
||||
* @param ids 需要删除的数据ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int deletePictureUploadByIds(String ids) { |
|
||||
return pictureUploadMapper.deletePictureUploadByIds(Convert.toStrArray(ids)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除上传图片信息 |
|
||||
* |
|
||||
* @param id 上传图片ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int deletePictureUploadById(Long id) { |
|
||||
return pictureUploadMapper.deletePictureUploadById(id); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Result uploadPicture(MultipartFile file, PictureUpload pictureUpload) throws Exception { |
|
||||
int version = pictureUploadMapper.selectPictureUploadList(pictureUpload).size() + 1; |
|
||||
String path = RuoYiConfig.getProfile() + "/" + pictureUpload.getItemCode() + "/" + pictureUpload.getType() + "/" + version+"/"+file.getOriginalFilename(); |
|
||||
File dir = new File(path); |
|
||||
if (!dir.exists()) { |
|
||||
dir.mkdirs(); |
|
||||
} |
|
||||
file.transferTo(dir); |
|
||||
pictureUpload.setVersion(version+""); |
|
||||
pictureUpload.setPath(path); |
|
||||
pictureUpload.setUploadDate(new Date()); |
|
||||
String userName = (String) PermissionUtils.getPrincipalProperty("userName"); |
|
||||
pictureUpload.setUploadMan(userName); |
|
||||
int i = pictureUploadMapper.insertPictureUpload(pictureUpload); |
|
||||
return Result.getSuccessResult(i); |
|
||||
} |
|
||||
} |
|
@ -1,25 +0,0 @@ |
|||||
package com.ruoyi.ck.utils; |
|
||||
|
|
||||
import org.springframework.boot.ApplicationArguments; |
|
||||
import org.springframework.boot.ApplicationRunner; |
|
||||
|
|
||||
/** |
|
||||
* Created by sunzhenhu on 2021/7/27 16:53 |
|
||||
*/ |
|
||||
//@Component
|
|
||||
public class ApplicationRunnerImpl implements ApplicationRunner { |
|
||||
// @Autowired
|
|
||||
// private SerialPortUtils serialPort;
|
|
||||
public void run(ApplicationArguments args) throws Exception { |
|
||||
// 创建串口必要参数接收类并赋值,赋值串口号,波特率,校验位,数据位,停止位
|
|
||||
// ParamConfig paramConfig = new ParamConfig("COM6", 9600, 0, 8, 1);
|
|
||||
// // 初始化设置,打开串口,开始监听读取串口数据
|
|
||||
// try {
|
|
||||
// serialPort.init(paramConfig);
|
|
||||
// int a=123;
|
|
||||
// } catch (Exception e) {
|
|
||||
// e.printStackTrace();
|
|
||||
// }
|
|
||||
|
|
||||
} |
|
||||
} |
|
@ -1,189 +0,0 @@ |
|||||
package com.ruoyi.ck.utils; |
|
||||
|
|
||||
import com.ruoyi.ck.domain.UnitConvert; |
|
||||
|
|
||||
import java.math.BigDecimal; |
|
||||
|
|
||||
/** |
|
||||
* @author :pyy |
|
||||
* @date :Created in 2021/12/29 15:08 |
|
||||
* @description: |
|
||||
* @modified By: |
|
||||
* @version: $ |
|
||||
*/ |
|
||||
public class UnitConvertUtil { |
|
||||
|
|
||||
private static final String G = "克"; |
|
||||
|
|
||||
private static final String KG = "千克"; |
|
||||
|
|
||||
private static final String T = "吨"; |
|
||||
|
|
||||
private static final String ML = "毫升"; |
|
||||
|
|
||||
private static final String L = "升"; |
|
||||
|
|
||||
private static final String M3 = "立方米"; |
|
||||
|
|
||||
private static final String MM = "毫米"; |
|
||||
|
|
||||
private static final String CM = "厘米"; |
|
||||
|
|
||||
private static final String M = "米"; |
|
||||
|
|
||||
private static final BigDecimal ONE = new BigDecimal("1"); |
|
||||
|
|
||||
private static final BigDecimal TEN = new BigDecimal("10"); |
|
||||
|
|
||||
private static final BigDecimal HUNDRED = new BigDecimal("100"); |
|
||||
|
|
||||
private static final BigDecimal KILO = new BigDecimal("1000"); |
|
||||
|
|
||||
public static UnitConvert unitConvert(UnitConvert unitConvert) { |
|
||||
String unit = unitConvert.getUnit(); |
|
||||
if (G.equals(unit)) { |
|
||||
gConvert(unitConvert); |
|
||||
} else if (KG.equals(unit)) { |
|
||||
kgConvert(unitConvert); |
|
||||
} else if (ML.equals(unit)) { |
|
||||
mlConvert(unitConvert); |
|
||||
} else if (L.equals(unit)) { |
|
||||
lConvert(unitConvert); |
|
||||
} else if (MM.equals(unit)) { |
|
||||
mmConvert(unitConvert); |
|
||||
} else if (CM.equals(unit)) { |
|
||||
cmConvert(unitConvert); |
|
||||
} else if (T.equals(unit)) { |
|
||||
tConvert(unitConvert); |
|
||||
} else if (M3.equals(unit)) { |
|
||||
m3Convert(unitConvert); |
|
||||
} else if (M.equals(unit)) { |
|
||||
mConvert(unitConvert); |
|
||||
} |
|
||||
return unitConvert; |
|
||||
} |
|
||||
|
|
||||
private static void gConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(KILO) == 1 || weight.compareTo(KILO) == 0) { |
|
||||
weight = weight.divide(KILO); |
|
||||
unitConvert.setUnit(KG); |
|
||||
unitConvert.setWeight(weight); |
|
||||
if (weight.compareTo(KILO) == 1 || weight.compareTo(KILO) == 0) { |
|
||||
weight = weight.divide(KILO); |
|
||||
unitConvert.setUnit(T); |
|
||||
unitConvert.setWeight(weight); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void kgConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(KILO) == 1 || weight.compareTo(KILO) == 0) { |
|
||||
weight = weight.divide(KILO); |
|
||||
unitConvert.setUnit(T); |
|
||||
unitConvert.setWeight(weight); |
|
||||
} else if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(KILO); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(G); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void tConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(KILO); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(KG); |
|
||||
if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(KILO); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(G); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void mlConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(KILO) == 1 || weight.compareTo(KILO) == 0) { |
|
||||
weight = weight.divide(KILO); |
|
||||
unitConvert.setUnit(L); |
|
||||
unitConvert.setWeight(weight); |
|
||||
if (weight.compareTo(KILO) == 1 || weight.compareTo(KILO) == 0) { |
|
||||
weight = weight.divide(KILO); |
|
||||
unitConvert.setUnit(M3); |
|
||||
unitConvert.setWeight(weight); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void lConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(KILO) == 1 || weight.compareTo(KILO) == 0) { |
|
||||
weight = weight.divide(KILO); |
|
||||
unitConvert.setUnit(M3); |
|
||||
unitConvert.setWeight(weight); |
|
||||
} else if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(KILO); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(ML); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void m3Convert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(KILO); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(L); |
|
||||
if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(KILO); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(ML); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void mmConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(TEN) == 1 || weight.compareTo(TEN) == 0) { |
|
||||
weight = weight.divide(TEN); |
|
||||
unitConvert.setUnit(CM); |
|
||||
unitConvert.setWeight(weight); |
|
||||
if (weight.compareTo(HUNDRED) == 1 || weight.compareTo(HUNDRED) == 0) { |
|
||||
weight = weight.divide(HUNDRED); |
|
||||
unitConvert.setUnit(M); |
|
||||
unitConvert.setWeight(weight); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void cmConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(HUNDRED) == 1 || weight.compareTo(HUNDRED) == 0) { |
|
||||
weight = weight.divide(HUNDRED); |
|
||||
unitConvert.setUnit(M); |
|
||||
unitConvert.setWeight(weight); |
|
||||
} else if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(TEN); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(MM); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
private static void mConvert(UnitConvert unitConvert) { |
|
||||
BigDecimal weight = unitConvert.getWeight(); |
|
||||
if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(HUNDRED); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(CM); |
|
||||
if (weight.compareTo(ONE) == -1) { |
|
||||
weight = weight.multiply(TEN); |
|
||||
unitConvert.setWeight(weight); |
|
||||
unitConvert.setUnit(MM); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
@ -1,113 +0,0 @@ |
|||||
<?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.ck.mapper.PictureUploadMapper"> |
|
||||
|
|
||||
<resultMap type="PictureUpload" id="PictureUploadResult"> |
|
||||
<result property="id" column="id" /> |
|
||||
<result property="itemCode" column="itemCode" /> |
|
||||
<result property="type" column="type" /> |
|
||||
<result property="version" column="version" /> |
|
||||
<result property="path" column="path" /> |
|
||||
<result property="uploadDate" column="uploadDate" /> |
|
||||
<result property="uploadMan" column="uploadMan" /> |
|
||||
<result property="spare1" column="spare1" /> |
|
||||
<result property="spare2" column="spare2" /> |
|
||||
<result property="spare3" column="spare3" /> |
|
||||
<result property="spare4" column="spare4" /> |
|
||||
<result property="spare5" column="spare5" /> |
|
||||
<result property="spare6" column="spare6" /> |
|
||||
</resultMap> |
|
||||
|
|
||||
<sql id="selectPictureUploadVo"> |
|
||||
select id, itemCode, type, version, path, uploadDate, uploadMan, spare1, spare2, spare3, spare4, spare5, spare6 from picture_upload |
|
||||
</sql> |
|
||||
|
|
||||
<select id="selectPictureUploadList" parameterType="PictureUpload" resultMap="PictureUploadResult"> |
|
||||
<include refid="selectPictureUploadVo"/> |
|
||||
<where> |
|
||||
<if test="id != null "> and id like concat('%', #{id}, '%')</if> |
|
||||
<if test="itemCode != null and itemCode != ''"> and itemCode like concat('%', #{itemCode}, '%')</if> |
|
||||
<if test="type != null and type != ''"> and type = #{type}</if> |
|
||||
<if test="version != null and version != ''"> and version like concat('%', #{version}, '%')</if> |
|
||||
<if test="path != null and path != ''"> and path like concat('%', #{path}, '%')</if> |
|
||||
<if test="params.beginUploadDate != null and params.beginUploadDate != '' and params.endUploadDate != null and params.endUploadDate != ''"> and uploadDate between #{params.beginUploadDate} and #{params.endUploadDate}</if> |
|
||||
<if test="uploadMan != null and uploadMan != ''"> and uploadMan like concat('%', #{uploadMan}, '%')</if> |
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if> |
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if> |
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if> |
|
||||
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if> |
|
||||
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if> |
|
||||
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<select id="selectPictureUploadById" parameterType="Long" resultMap="PictureUploadResult"> |
|
||||
<include refid="selectPictureUploadVo"/> |
|
||||
where id = #{id} |
|
||||
</select> |
|
||||
|
|
||||
<insert id="insertPictureUpload" parameterType="PictureUpload" useGeneratedKeys="true" keyProperty="id"> |
|
||||
insert into picture_upload |
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
||||
<if test="itemCode != null">itemCode,</if> |
|
||||
<if test="type != null">type,</if> |
|
||||
<if test="version != null">version,</if> |
|
||||
<if test="path != null">path,</if> |
|
||||
<if test="uploadDate != null">uploadDate,</if> |
|
||||
<if test="uploadMan != null">uploadMan,</if> |
|
||||
<if test="spare1 != null">spare1,</if> |
|
||||
<if test="spare2 != null">spare2,</if> |
|
||||
<if test="spare3 != null">spare3,</if> |
|
||||
<if test="spare4 != null">spare4,</if> |
|
||||
<if test="spare5 != null">spare5,</if> |
|
||||
<if test="spare6 != null">spare6,</if> |
|
||||
</trim> |
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
||||
<if test="itemCode != null">#{itemCode},</if> |
|
||||
<if test="type != null">#{type},</if> |
|
||||
<if test="version != null">#{version},</if> |
|
||||
<if test="path != null">#{path},</if> |
|
||||
<if test="uploadDate != null">#{uploadDate},</if> |
|
||||
<if test="uploadMan != null">#{uploadMan},</if> |
|
||||
<if test="spare1 != null">#{spare1},</if> |
|
||||
<if test="spare2 != null">#{spare2},</if> |
|
||||
<if test="spare3 != null">#{spare3},</if> |
|
||||
<if test="spare4 != null">#{spare4},</if> |
|
||||
<if test="spare5 != null">#{spare5},</if> |
|
||||
<if test="spare6 != null">#{spare6},</if> |
|
||||
</trim> |
|
||||
</insert> |
|
||||
|
|
||||
<update id="updatePictureUpload" parameterType="PictureUpload"> |
|
||||
update picture_upload |
|
||||
<trim prefix="SET" suffixOverrides=","> |
|
||||
<if test="itemCode != null">itemCode = #{itemCode},</if> |
|
||||
<if test="type != null">type = #{type},</if> |
|
||||
<if test="version != null">version = #{version},</if> |
|
||||
<if test="path != null">path = #{path},</if> |
|
||||
<if test="uploadDate != null">uploadDate = #{uploadDate},</if> |
|
||||
<if test="uploadMan != null">uploadMan = #{uploadMan},</if> |
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if> |
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if> |
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if> |
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if> |
|
||||
<if test="spare5 != null">spare5 = #{spare5},</if> |
|
||||
<if test="spare6 != null">spare6 = #{spare6},</if> |
|
||||
</trim> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<delete id="deletePictureUploadById" parameterType="Long"> |
|
||||
delete from picture_upload where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<delete id="deletePictureUploadByIds" parameterType="String"> |
|
||||
delete from picture_upload where id in |
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
||||
#{id} |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
</mapper> |
|
@ -1,809 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('数据采集')" /> |
|
||||
<th:block th:include="include :: bootstrap-editable-css" /> |
|
||||
</head> |
|
||||
<body class="gray-bg"> |
|
||||
<div class="container" style="position: relative;"> |
|
||||
<br> |
|
||||
<div class="row"> |
|
||||
<span>当前单号:</span><span id="formCode"></span> |
|
||||
</div> |
|
||||
<div class="col-xl-8 col-md-8 m-b-30"> |
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist"> |
|
||||
<li class="nav-item"> |
|
||||
<a class="nav-link" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="false">SOP</a> |
|
||||
</li> |
|
||||
<li class="nav-item"> |
|
||||
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="true">包装</a> |
|
||||
</li> |
|
||||
<li class="nav-item"> |
|
||||
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">标签打印</a> |
|
||||
</li> |
|
||||
</ul> |
|
||||
<div class="tab-content" id="myTabContent"> |
|
||||
<div class="tab-pane fade" id="home" role="tabpanel" aria-labelledby="home-tab"> |
|
||||
<img style="width: 600px;height:600px" th:src="@{/img/home.png}" alt=""> |
|
||||
</div> |
|
||||
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab"> |
|
||||
<div class="col-xl-8 col-md-6"> |
|
||||
<p>包装容量: <span id="box_max_num">暂无</span> </p> |
|
||||
<p>开始序号: <span>001</span> 包装等级: <span>1级</span> 箱子序号: <select id="box_list"></select> </p> |
|
||||
<p> |
|
||||
箱子代码: <span id="box_code">暂未生成代码(该代码会在打印标签的时候生成)</span> |
|
||||
</p> |
|
||||
<p> |
|
||||
<button id="btn_set_box" data-toggle="modal" class="btn btn-primary" data-target="#box_modal">箱子最大数量</button> |
|
||||
<button class="btn btn-primary" id="print_boxCode">打印标签</button> |
|
||||
|
|
||||
</p> |
|
||||
|
|
||||
<div class="modal inmodal" id="box_modal" tabindex="-1" role="dialog" aria-hidden="true"> |
|
||||
<div class="modal-dialog"> |
|
||||
<div class="modal-content animated bounceInRight"> |
|
||||
<div class="modal-header"> |
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span> |
|
||||
</button> |
|
||||
<i class="fa fa-laptop modal-icon"></i> |
|
||||
<h4 class="modal-title">设置箱号规则</h4> |
|
||||
<!-- <small class="font-bold">这里可以显示副标题。--> |
|
||||
</div> |
|
||||
<div class="modal-body"> |
|
||||
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>--> |
|
||||
<form class="form-horizontal m" id="form_set_box"> |
|
||||
<div class="form-group"> |
|
||||
<!-- <label>Email</label>--> |
|
||||
<!-- <input type="email" placeholder="请输入您的Email" class="form-control">--> |
|
||||
<input name="maxNum" id="input_maxNum" oninput="value=value.replace(/[^\d]/g,'')" placeholder="输入箱子上限数量" type="text" class="form-control" > |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button> |
|
||||
<button id="btn_sub_box" data-dismiss="modal" type="button" class="btn btn-primary">提交</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
|
|
||||
</div> |
|
||||
<div class="col-xl-4 col-md-6"> |
|
||||
<p>当前装箱数量: <span id="curr_num">暂无</span> / <span id="box_max_num2">总量</span> </p> |
|
||||
</div> |
|
||||
<div class="col-sm-12 select-table table-striped" style="padding-bottom: 100px;"> |
|
||||
<table id="bootstrap-table"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab"> |
|
||||
<p>标签重打</p> |
|
||||
<p>扫描标签 <input type="text"></p> |
|
||||
<div class="col-sm-12 select-table table-striped" style="padding-bottom: 100px;"> |
|
||||
<table id="bootstrap-table2"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="col-xl-4 col-md-4 m-b-30"> |
|
||||
<p>所属单号: <input type="text" id="input_workform_code"> |
|
||||
<button class="btn btn-primary" id="btn_search_workform_code">查询</button> |
|
||||
<button id="btn_add_workform" data-toggle="modal" class="btn btn-primary" data-target="#myModal">添加</button> |
|
||||
<button id="btn_edit_workform" data-toggle="modal" class="btn btn-primary" data-target="#editWorkForm">修改</button> |
|
||||
</p> |
|
||||
<p>箱号查询: |
|
||||
<input type="text" id="input_boxQuery"> |
|
||||
|
|
||||
</p> |
|
||||
<p>s n查询: |
|
||||
<input type="text" id="input_snQuery"> |
|
||||
</p> |
|
||||
<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true"> |
|
||||
<div class="modal-dialog"> |
|
||||
<div class="modal-content animated bounceInRight"> |
|
||||
<div class="modal-header"> |
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span> |
|
||||
</button> |
|
||||
<i class="fa fa-laptop modal-icon"></i> |
|
||||
<h4 class="modal-title">添加新的单号</h4> |
|
||||
<!-- <small class="font-bold">这里可以显示副标题。--> |
|
||||
</div> |
|
||||
<div class="modal-body"> |
|
||||
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>--> |
|
||||
<form class="form-horizontal m" id="form_workform_add"> |
|
||||
<div class="form-group"> |
|
||||
<!-- <label>Email</label>--> |
|
||||
<!-- <input type="email" placeholder="请输入您的Email" class="form-control">--> |
|
||||
<input name="formCode" id="input_workFormCode" placeholder="请输入工单号码" type="text" class="form-control" > |
|
||||
<input name="wlCode" id="input_wlCode" placeholder="请输入产品料号" type="text" class="form-control"> |
|
||||
<input name="special" id="input_special" placeholder="请输入产品描述" type="text" class="form-control" > |
|
||||
<input name="formNeedNum" id="input_needNum" placeholder="请输入工单数量" type="text" class="form-control" > |
|
||||
<input name="snPrefix" id="input_snPrefix" placeholder="请输入箱号规则" type="text" class="form-control" > |
|
||||
<input name="other" id="input_other" placeholder="其他" type="text" class="form-control" > |
|
||||
<!-- <input name="batch" id="input_batch" placeholder="请输入生产批次" type="text" class="form-control" >--> |
|
||||
<!-- <input name="vendor" id="input_vendor" placeholder="请输入厂商代码" type="text" class="form-control" >--> |
|
||||
|
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button> |
|
||||
<button id="btn_sub_workForm" data-dismiss="modal" type="button" class="btn btn-primary">提交</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<button id="btn_snModal" data-toggle="modal" class="btn btn-primary" data-target="#snModal" style="display:none;"></button> |
|
||||
<div class="modal inmodal" id="editWorkForm" tabindex="-1" role="dialog" aria-hidden="true"> |
|
||||
<div class="modal-dialog"> |
|
||||
<div class="modal-content animated bounceInRight"> |
|
||||
<div class="modal-header"> |
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span> |
|
||||
</button> |
|
||||
<i class="fa fa-laptop modal-icon"></i> |
|
||||
<h4 class="modal-title">修改单号</h4> |
|
||||
<!-- <small class="font-bold">这里可以显示副标题。--> |
|
||||
</div> |
|
||||
<div class="modal-body"> |
|
||||
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>--> |
|
||||
<form class="form-horizontal m" id="form_workform_edit"> |
|
||||
<div class="form-group"> |
|
||||
<!-- <label>Email</label>--> |
|
||||
<!-- <input type="email" placeholder="请输入您的Email" class="form-control">--> |
|
||||
<input name="formCode" id="input_edit_workFormCode" placeholder="请输入工单号码" type="text" class="form-control" > |
|
||||
<input name="wlCode" placeholder="请输入产品料号" type="text" class="form-control"> |
|
||||
<input name="special" placeholder="请输入产品描述" type="text" class="form-control" > |
|
||||
<input name="snPrefix" placeholder="请输入箱号规则" type="text" class="form-control" > |
|
||||
<input name="other" placeholder="其他" type="text" class="form-control" > |
|
||||
<!-- <input name="batch" id="input_batch" placeholder="请输入生产批次" type="text" class="form-control" >--> |
|
||||
<!-- <input name="vendor" id="input_vendor" placeholder="请输入厂商代码" type="text" class="form-control" >--> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button> |
|
||||
<button id="btn_edit_sub_workForm" data-dismiss="modal" type="button" class="btn btn-primary">提交</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div class="modal inmodal" id="snModal" tabindex="-1" role="dialog" aria-hidden="true"> |
|
||||
<div class="modal-dialog"> |
|
||||
<div class="modal-content animated bounceInRight"> |
|
||||
<div class="modal-body"> |
|
||||
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>--> |
|
||||
<div class="form-group"> |
|
||||
<p>隶属工单号:<span id="sn_formCode"></span></p> |
|
||||
<p>箱子代码:<span id="sn_boxCode"></span></p> |
|
||||
<p>s n号码:<span id="sn_sn"></span> </p> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-4"> |
|
||||
测试人:<span id="sn_actTest"></span> |
|
||||
</div> |
|
||||
<div class="col-md-4"> |
|
||||
状态:<span id="sn_status"></span> |
|
||||
</div> |
|
||||
<div class="col-md-4"> |
|
||||
时间:<span id="sn_passTime"></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div class="row"> |
|
||||
<div class="col-md-8"> |
|
||||
<p> |
|
||||
所属产品: <span id="model">xxxxxxxx</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
<div class="col-md-4"> |
|
||||
<p> |
|
||||
工单总数:<span id="formNeedNum">4522</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-8"> |
|
||||
<p> |
|
||||
工单类型: <span>正常工单</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
<div class="col-md-4"> |
|
||||
<p> |
|
||||
优先级别:<span>一级</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-8"> |
|
||||
<p> |
|
||||
PASS数量: <span id="pass_num">4000</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
<div class="col-md-4"> |
|
||||
<p> |
|
||||
FAIL数量:<span id="fail_num">0</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-8"> |
|
||||
<p> |
|
||||
工艺流程: <span>外协厂包装流程</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
<div class="col-md-4"> |
|
||||
<p> |
|
||||
是否拼板:<span>否</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
</div> |
|
||||
<!-- <div class="row">--> |
|
||||
<!-- <div class="col-md-8">--> |
|
||||
<!-- <p>--> |
|
||||
<!-- 目检结果: <span>PASS </span>--> |
|
||||
<!-- </p>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div class="col-md-4">--> |
|
||||
<!-- <p>--> |
|
||||
<!-- 是否超投:<span> 否</span>--> |
|
||||
<!-- </p>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-8"> |
|
||||
<p> |
|
||||
数据收集方式: <span>人工/扫描输入</span> |
|
||||
</p> |
|
||||
</div> |
|
||||
|
|
||||
</div> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-8"> |
|
||||
<p> |
|
||||
过站条码:: <input id="input_sn" type="text"> |
|
||||
</p> |
|
||||
</div> |
|
||||
|
|
||||
</div> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-8"> |
|
||||
<button id="btn_delete_workform" data-toggle="modal" class="btn btn-danger" data-target="#deleteWorkForm">删除</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div class="modal inmodal" id="deleteWorkForm" tabindex="-1" role="dialog" aria-hidden="true"> |
|
||||
<div class="modal-dialog"> |
|
||||
<div class="modal-content animated bounceInRight"> |
|
||||
<div class="modal-header"> |
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span> |
|
||||
</button> |
|
||||
<i class="fa fa-laptop modal-icon"></i> |
|
||||
<h4 class="modal-title">删除</h4> |
|
||||
<!-- <small class="font-bold">这里可以显示副标题。--> |
|
||||
</div> |
|
||||
<div class="modal-body"> |
|
||||
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>--> |
|
||||
<form class="form-horizontal m" id="form_workform_delete"> |
|
||||
<div class="form-group"> |
|
||||
|
|
||||
<!-- <input name="formCode" id="input_edit_workFormCode" placeholder="请输入工单号码" type="text" class="form-control" >--> |
|
||||
<!-- <input name="wlCode" placeholder="请输入产品料号" type="text" class="form-control">--> |
|
||||
<!-- <input name="special" placeholder="请输入产品描述" type="text" class="form-control" >--> |
|
||||
<!-- <input name="snPrefix" placeholder="请输入箱号规则" type="text" class="form-control" >--> |
|
||||
<!-- <input name="other" placeholder="其他" type="text" class="form-control" >--> |
|
||||
|
|
||||
<input name="boxCode" placeholder="请输入箱号" type="text" class="form-control"> |
|
||||
|
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<button type="button" class="btn btn-white" data-dismiss="modal" onclick="close()">关闭</button> |
|
||||
<button id="btn_delete_sub_workForm" data-dismiss="modal" type="button" class="btn btn-primary">提交</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<script th:inline="javascript"> |
|
||||
var prefix = ctx + "ck/workform"; |
|
||||
|
|
||||
function queryParams(params) { |
|
||||
var search = $.table.queryParams(params); |
|
||||
if ($('#box_list option:selected').val()!=null){ |
|
||||
search.boxId = $('#box_list option:selected').val(); |
|
||||
} |
|
||||
return search; |
|
||||
} |
|
||||
|
|
||||
$(function() { |
|
||||
var options = { |
|
||||
url: prefix + "/list", |
|
||||
// createUrl: prefix + "/add", |
|
||||
// updateUrl: prefix + "/edit/{versionNo}/{cpCode}", |
|
||||
// removeUrl: prefix + "/remove", |
|
||||
// exportUrl: prefix + "/export", |
|
||||
modalName: "sn", |
|
||||
showSearch:false, |
|
||||
showPageGo:false, |
|
||||
showRefresh:false, |
|
||||
showColumns:false, |
|
||||
cardView:false, |
|
||||
showToggle:false, |
|
||||
queryParams: queryParams, |
|
||||
columns: [ |
|
||||
{ |
|
||||
field: 'status', |
|
||||
title: '状态', |
|
||||
// visible: false |
|
||||
formatter: function (value ,row,index) { |
|
||||
return "通过"; |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'code', |
|
||||
title: '过站SN', |
|
||||
}, |
|
||||
{ |
|
||||
field: 'space1', |
|
||||
title: '过站时间', |
|
||||
// visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'space2', |
|
||||
title: '测试人', |
|
||||
// visible: false |
|
||||
}, |
|
||||
/* { |
|
||||
title: '操作', |
|
||||
align: 'center', |
|
||||
formatter: function(value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.versionNo + '\',\'' + row.cpCode + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.versionNo + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
} */] |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
}); |
|
||||
// var t1 = window.setInterval(calculation, 1000);//定时访问 |
|
||||
// function calculation() { |
|
||||
// $('#bootstrap-table').bootstrapTable('refresh'); |
|
||||
// $('#bootstrap-table').bootstrapTable('hideLoading'); |
|
||||
// |
|
||||
// }; |
|
||||
|
|
||||
|
|
||||
|
|
||||
$("#bootstrap-table2").bootstrapTable({ |
|
||||
showHeader:true, |
|
||||
// showRefresh: true, |
|
||||
pageSize: 10, |
|
||||
pageNumber: 1, |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field:"id", |
|
||||
title:"序号", |
|
||||
formatter:function (value, row, index){ |
|
||||
return index+1; |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'lableName', |
|
||||
title: '标签模板名称', |
|
||||
// visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'storeProcess', |
|
||||
title: '存储过程', |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
title: '标签模板地址', |
|
||||
align: 'center', |
|
||||
formatter: function (value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.versionNo + '\',\'' + row.cpCode + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.versionNo + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
} |
|
||||
], |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
function boxChange(){ |
|
||||
var box_id = $('#box_list option:selected').val(); |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/getBox", |
|
||||
data: {"id":box_id}, |
|
||||
type: "GET", |
|
||||
contentType:"application/json;charset=utf-8",/*传递json类型*/ |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
var boxWorkformHead=data.boxWorkformHead; |
|
||||
$("#box_code").text(data.boxWorkformHead.boxCode); |
|
||||
|
|
||||
|
|
||||
|
|
||||
if (boxWorkformHead.boxCode!=null||boxWorkformHead.currNum==boxWorkformHead.maxNum|| parseInt($("#pass_num").text())>=parseInt($("#formNeedNum").text())){ |
|
||||
$("#input_sn").attr("disabled","disabled"); |
|
||||
}else { |
|
||||
$("#input_sn").removeAttr("disabled"); |
|
||||
} |
|
||||
|
|
||||
$("#box_max_num").text(data.boxWorkformHead.maxNum); |
|
||||
$("#box_max_num2").text(data.boxWorkformHead.maxNum); |
|
||||
$("#curr_num").text(data.boxWorkformHead.currNum); |
|
||||
// table.options.updateUrl.add("{boxId}", box_id); |
|
||||
$('#bootstrap-table').bootstrapTable('refresh'); |
|
||||
$('#bootstrap-table').bootstrapTable('hideLoading'); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
//箱子列表发生了改变 |
|
||||
$("#box_list").change(function () { |
|
||||
boxChange(); |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
//新增单号 |
|
||||
$("#btn_sub_workForm").click(function (){ |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/add", |
|
||||
data: $('#form_workform_add').serialize(), |
|
||||
type: "POST", |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
if (data.value==1){ |
|
||||
var workformHead=data.workformHead; |
|
||||
$("#formCode").text(workformHead.formCode); |
|
||||
$("#fail_num").text(workformHead.faildNum); |
|
||||
$("#pass_num").text(workformHead.passNum); |
|
||||
$("#model").text(workformHead.wlCode); |
|
||||
$("#formNeedNum").text(workformHead.formNeedNum); |
|
||||
$("#btn_set_box").show(); |
|
||||
$("#box_list").empty(); |
|
||||
$("box_max_num").text(""); |
|
||||
$("box_code").text(""); |
|
||||
$("box_max_num2").text(""); |
|
||||
$("curr_num").text(""); |
|
||||
|
|
||||
$.modal.msgSuccess(data.msg); |
|
||||
}else { |
|
||||
$.modal.msgError(data.msg); |
|
||||
} |
|
||||
document.getElementById("form_workform_add").reset(); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
$("#btn_edit_workform").click(function () { |
|
||||
if ($("#formCode").text() == "") { |
|
||||
$.modal.msgError("先查询单号"); |
|
||||
return; |
|
||||
} |
|
||||
$("#input_edit_workFormCode").val($("#formCode").text()); |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
$("#btn_edit_sub_workForm").click(function (){ |
|
||||
if ($("#formCode").text() == "") { |
|
||||
$.modal.msgError("先查询单号"); |
|
||||
return; |
|
||||
} |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/edit", |
|
||||
data: $('#form_workform_edit').serialize(), |
|
||||
type: "POST", |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
if (data.value==1){ |
|
||||
$.modal.msgSuccess("修改成功,重新查询后可见"); |
|
||||
|
|
||||
}else { |
|
||||
$.modal.msgError(data.msg); |
|
||||
} |
|
||||
document.getElementById("form_workform_edit").reset(); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
|
|
||||
$("#btn_set_box").hide(); |
|
||||
|
|
||||
//设置箱子的回调事件 |
|
||||
function insertBoxCallback(data){ |
|
||||
$("#box_list").empty(); |
|
||||
if (data.boxWorkformHeads.length==0){ |
|
||||
$("#btn_set_box").show(); |
|
||||
}else { |
|
||||
$("#btn_set_box").hide(); |
|
||||
// var option0 = $("<option style='display: none'>").val("").text(""); |
|
||||
$("#box_list").append("<option style='display: none'></option>"); |
|
||||
for (var i=0;i<data.boxWorkformHeads.length;i++){ |
|
||||
var option = $("<option>").val(data.boxWorkformHeads[i].id).text(i+1); |
|
||||
$("#box_list").append(option); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
//设置箱子 |
|
||||
$("#btn_sub_box").click(function (){ |
|
||||
var dataparam=$("#form_set_box").serialize(); |
|
||||
dataparam=dataparam+"&"+"workformCode="+$("#formCode").text(); |
|
||||
$.operate.save("/ck/workform/setBox", dataparam,insertBoxCallback); |
|
||||
document.getElementById("form_workform_add").reset(); |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
|
|
||||
//查询单号 |
|
||||
$("#btn_search_workform_code").click(function (){ |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/queryByCode", |
|
||||
data: JSON.stringify({"formCode":$("#input_workform_code").val()}), |
|
||||
type: "POST", |
|
||||
contentType:"application/json;charset=utf-8",/*传递json类型*/ |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
$("#formNeedNum").text(""); |
|
||||
var workformHead=data.workformHead; |
|
||||
$("#formCode").text(workformHead.formCode); |
|
||||
$("#fail_num").text(workformHead.faildNum); |
|
||||
$("#pass_num").text(workformHead.passNum); |
|
||||
$("#model").text(workformHead.wlCode); |
|
||||
$("#formNeedNum").text(workformHead.formNeedNum); |
|
||||
$("#box_list").empty(); |
|
||||
$("#input_workform_code").val(""); |
|
||||
if (data.boxWorkformHeads.length==0){ |
|
||||
$("#btn_set_box").show(); |
|
||||
}else { |
|
||||
$("#btn_set_box").hide(); |
|
||||
// var option0 = $("<option style='display: none'>").val("").text(""); |
|
||||
$("#box_list").append("<option style='display: none'></option>"); |
|
||||
for (var i=0;i<data.boxWorkformHeads.length;i++){ |
|
||||
var option = $("<option>").val(data.boxWorkformHeads[i].id).text(i+1); |
|
||||
$("#box_list").append(option); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
function boxCodeSearch(){ |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/boxQuery", |
|
||||
data: $("#input_boxQuery").val(), |
|
||||
type: "POST", |
|
||||
contentType:"application/text;charset=utf-8",/*传递json类型*/ |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
$("input_boxQuery").val(""); |
|
||||
$("#formNeedNum").text(""); |
|
||||
var workformHead=data.workformHead; |
|
||||
$("#formCode").text(workformHead.formCode); |
|
||||
$("#fail_num").text(workformHead.faildNum); |
|
||||
$("#pass_num").text(workformHead.passNum); |
|
||||
$("#model").text(workformHead.wlCode); |
|
||||
$("#formNeedNum").text(workformHead.formNeedNum); |
|
||||
$("#box_list").empty(); |
|
||||
$("#input_workform_code").val(""); |
|
||||
if (data.boxWorkformHeads.length==0){ |
|
||||
$("#btn_set_box").show(); |
|
||||
}else { |
|
||||
$("#btn_set_box").hide(); |
|
||||
// var option0 = $("<option style='display: none'>").val("").text(""); |
|
||||
$("#box_list").append("<option style='display: none'></option>"); |
|
||||
for (var i=0;i<data.boxWorkformHeads.length;i++){ |
|
||||
var option = $("<option>").val(data.boxWorkformHeads[i].id).text(i+1); |
|
||||
$("#box_list").append(option); |
|
||||
} |
|
||||
$("#box_list").val(data.boxWorkformHead.id); |
|
||||
boxChange(); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
//sn回车触发的事件 |
|
||||
function sub_sn(){ |
|
||||
var boxId=$('#box_list option:selected').val(); |
|
||||
|
|
||||
var sn=$("#input_sn").val().trim(); |
|
||||
if(sn==""||$("#formCode").text()==""||boxId==null){ |
|
||||
$.modal.msgError("单号或sn或箱号不可为空"); |
|
||||
return; |
|
||||
} |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/addSn", |
|
||||
data: JSON.stringify({"code":sn,"boxId":boxId}), |
|
||||
type: "POST", |
|
||||
contentType:"application/json;charset=utf-8",/*传递json类型*/ |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
$("#input_sn").val(""); |
|
||||
if (data.value==0){ |
|
||||
// $.modal.msgError("重码或异常") |
|
||||
alert(data.sn+"重码"); |
|
||||
return ; |
|
||||
}else if (data.value==1){ |
|
||||
var boxWorkformHead=data.boxWorkformHead; |
|
||||
var workformHead=data.workformHead; |
|
||||
$("#curr_num").text(boxWorkformHead.currNum); |
|
||||
$("#pass_num").text(workformHead.passNum); |
|
||||
if (boxWorkformHead.currNum==boxWorkformHead.maxNum){ |
|
||||
$("#input_sn").attr("disabled","disabled"); |
|
||||
print(boxWorkformHead); |
|
||||
} |
|
||||
if (workformHead.passNum>=workformHead.formNeedNum){ |
|
||||
$("#input_sn").attr("disabled","disabled"); |
|
||||
} |
|
||||
|
|
||||
$('#bootstrap-table').bootstrapTable('refresh'); |
|
||||
$('#bootstrap-table').bootstrapTable('hideLoading'); |
|
||||
}else { |
|
||||
alert(data.sn+"规则不对"); |
|
||||
return ; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
//请求打印 |
|
||||
function print(boxWorkformHead){ |
|
||||
$.modal.msg("打印中"); |
|
||||
$("#input_sn").attr("disabled","disabled"); |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/print", |
|
||||
data: JSON.stringify(boxWorkformHead), |
|
||||
type: "POST", |
|
||||
contentType:"application/json;charset=utf-8",/*传递json类型*/ |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
if (data.value==1){ |
|
||||
// var boxWorkformHead=data.boxWorkformHead; |
|
||||
// $("#input_sn").removeAttr("disabled"); |
|
||||
console.log(data); |
|
||||
$("#box_code").text(data.boxWorkformHead.boxCode); |
|
||||
$.modal.msgSuccess("打印成功"); |
|
||||
|
|
||||
}else { |
|
||||
$.modal.msgError("打印失败"); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
//手动打印 |
|
||||
$("#print_boxCode").click(function () { |
|
||||
$.modal.msgError("手动打印中"); |
|
||||
|
|
||||
var boxWorkformHead={id:$('#box_list option:selected').val()}; |
|
||||
print(boxWorkformHead); |
|
||||
}) |
|
||||
|
|
||||
|
|
||||
|
|
||||
$("#btn_set_box").click(function (){ |
|
||||
document.getElementById("form_set_box").reset(); |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/checkWlCode", |
|
||||
data: JSON.stringify({"formCode":$("#formCode").text(),"wlCode":$("#model").text()}), |
|
||||
type: "POST", |
|
||||
contentType:"application/json;charset=utf-8",/*传递json类型*/ |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
$("#input_maxNum").val(data.boxWorkformHead.maxNum); |
|
||||
} |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
//sn输入框绑定回车事件 |
|
||||
window.onload = function(e) { |
|
||||
var isCommit=false; |
|
||||
var codeString = ""; |
|
||||
var lastTime; |
|
||||
var caseFormat = false; |
|
||||
$("#input_sn").keydown(function(e) { |
|
||||
var nextTime = new Date().getTime(); |
|
||||
var code = e.which; |
|
||||
if(code==13){ |
|
||||
sub_sn(); |
|
||||
} |
|
||||
lastTime = nextTime; |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
$("#input_boxQuery").keydown(function(e) { |
|
||||
var code = e.which; |
|
||||
if(code==13){ |
|
||||
boxCodeSearch(); |
|
||||
} |
|
||||
}); |
|
||||
$("#input_snQuery").keydown(function(e) { |
|
||||
var code = e.which; |
|
||||
if(code==13){ |
|
||||
snSearch(); |
|
||||
} |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function snSearch(){ |
|
||||
$.ajax({ |
|
||||
url: "/ck/workform/snQuery", |
|
||||
data: $("#input_snQuery").val(), |
|
||||
type: "POST", |
|
||||
contentType:"application/text;charset=utf-8",/*传递json类型*/ |
|
||||
dataType: "json", |
|
||||
success: function(data) { |
|
||||
console.log(data); |
|
||||
if (data.value==1){ |
|
||||
var boxWorkformHead=data.boxWorkformHead; |
|
||||
var workformBoxProduct=data.workformBoxProduct; |
|
||||
$("#btn_snModal").click(); |
|
||||
$("#sn_formCode").text(boxWorkformHead.workformCode); |
|
||||
$("#sn_boxCode").text(boxWorkformHead.boxCode); |
|
||||
|
|
||||
$("#sn_sn").text(workformBoxProduct.code); |
|
||||
$("#sn_actTest").text(workformBoxProduct.space2); |
|
||||
$("#sn_status").text("pass"); |
|
||||
$("#sn_passTime").text(workformBoxProduct.space1); |
|
||||
}else { |
|
||||
$.modal.msgError("sn不存在"); |
|
||||
} |
|
||||
$("#input_snQuery").val(""); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
$("#btn_delete_sub_workForm").on("click",function (){ |
|
||||
let boxCode = $("input[name='boxCode']").val(); |
|
||||
$.ajax({ |
|
||||
url:ctx + "ck/workform/remove", |
|
||||
type:"post", |
|
||||
dataType:"json", |
|
||||
data:{"boxCode":boxCode}, |
|
||||
success: function (resp) { |
|
||||
if (resp.code===0){ |
|
||||
$.modal.msgSuccess("删除成功!"); |
|
||||
}else { |
|
||||
$.modal.msgError(resp.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("出错了!"); |
|
||||
} |
|
||||
}) |
|
||||
close(); |
|
||||
}) |
|
||||
|
|
||||
function close(){ |
|
||||
$("input[name='boxCode']").val(""); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,111 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('新增上传图片')" /> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-upload-add"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">物料代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="itemCode" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">图片类型:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="type" class="form-control m-b"> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">版本:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="version" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">路径:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="path" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">上传日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="uploadDate" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">上传人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="uploadMan" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare1" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare2" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare3" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare4" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare5" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare6" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<script th:inline="javascript"> |
|
||||
var prefix = ctx + "ck/upload" |
|
||||
$("#form-upload-add").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
if ($.validate.form()) { |
|
||||
$.operate.save(prefix + "/add", $('#form-upload-add').serialize()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='uploadDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true |
|
||||
}); |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,112 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('修改上传图片')" /> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-upload-edit" th:object="${pictureUpload}"> |
|
||||
<input name="id" th:field="*{id}" type="hidden"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">物料代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="itemCode" th:field="*{itemCode}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">图片类型:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="type" class="form-control m-b"> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">版本:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="version" th:field="*{version}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">路径:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="path" th:field="*{path}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">上传日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="uploadDate" th:value="${#dates.format(pictureUpload.uploadDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">上传人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="uploadMan" th:field="*{uploadMan}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare1" th:field="*{spare1}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare2" th:field="*{spare2}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare3" th:field="*{spare3}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare4" th:field="*{spare4}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare5" th:field="*{spare5}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="spare6" th:field="*{spare6}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<script th:inline="javascript"> |
|
||||
var prefix = ctx + "ck/upload"; |
|
||||
$("#form-upload-edit").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
if ($.validate.form()) { |
|
||||
$.operate.save(prefix + "/edit", $('#form-upload-edit').serialize()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='uploadDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true |
|
||||
}); |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,210 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('上传图片列表')"/> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
</head> |
|
||||
<body class="gray-bg"> |
|
||||
<div class="container-div"> |
|
||||
<div class="row"> |
|
||||
<div class="col-sm-12 search-collapse"> |
|
||||
<form id="formId"> |
|
||||
<div class="select-list"> |
|
||||
<ul> |
|
||||
<li> |
|
||||
<label>编号:</label> |
|
||||
<input type="text" name="id"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>物料代码:</label> |
|
||||
<input type="text" name="itemCode"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>图片类型:</label> |
|
||||
<select name="type" class="form-control m-b" |
|
||||
th:with="type=${@dict.getType('sys_upload_type')}"> |
|
||||
<option value="">所有</option> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
|
||||
th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>版本:</label> |
|
||||
<input type="text" name="version"/> |
|
||||
</li> |
|
||||
<!-- <li class="select-time">--> |
|
||||
<!-- <label>上传日期:</label>--> |
|
||||
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginUploadDate]"/>--> |
|
||||
<!-- <span>-</span>--> |
|
||||
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endUploadDate]"/>--> |
|
||||
<!-- </li>--> |
|
||||
<!-- <li>--> |
|
||||
<!-- <label>上传人:</label>--> |
|
||||
<!-- <input type="text" name="uploadMan"/>--> |
|
||||
<!-- </li>--> |
|
||||
<!-- <li>--> |
|
||||
<!-- <label>:</label>--> |
|
||||
<!-- <input type="text" name="spare1"/>--> |
|
||||
<!-- </li>--> |
|
||||
<!-- <li>--> |
|
||||
<!-- <label>:</label>--> |
|
||||
<!-- <input type="text" name="spare2"/>--> |
|
||||
<!-- </li>--> |
|
||||
<!-- <li>--> |
|
||||
<!-- <label>:</label>--> |
|
||||
<!-- <input type="text" name="spare3"/>--> |
|
||||
<!-- </li>--> |
|
||||
<!-- <li>--> |
|
||||
<!-- <label>:</label>--> |
|
||||
<!-- <input type="text" name="spare4"/>--> |
|
||||
<!-- </li>--> |
|
||||
<!-- <li>--> |
|
||||
<!-- <label>:</label>--> |
|
||||
<!-- <input type="text" name="spare5"/>--> |
|
||||
<!-- </li>--> |
|
||||
<!-- <li>--> |
|
||||
<!-- <label>:</label>--> |
|
||||
<!-- <input type="text" name="spare6"/>--> |
|
||||
<!-- </li>--> |
|
||||
<li> |
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i |
|
||||
class="fa fa-search"></i> 搜索</a> |
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="reset()"><i |
|
||||
class="fa fa-refresh"></i> 重置</a> |
|
||||
</li> |
|
||||
</ul> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
|
|
||||
<div class="btn-group-sm" id="toolbar" role="group"> |
|
||||
<a class="btn btn-success" onclick="" shiro:hasPermission="ck:upload:add" disabled> |
|
||||
<i class="fa fa-plus"></i> 添加 |
|
||||
</a> |
|
||||
<a class="btn btn-primary single disabled" onclick="" shiro:hasPermission="ck:upload:edit" disabled> |
|
||||
<i class="fa fa-edit"></i> 修改 |
|
||||
</a> |
|
||||
<a class="btn btn-danger multiple disabled" onclick="" shiro:hasPermission="ck:upload:remove" disabled> |
|
||||
<i class="fa fa-remove"></i> 删除 |
|
||||
</a> |
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="ck:upload:export"> |
|
||||
<i class="fa fa-download"></i> 导出 |
|
||||
</a> |
|
||||
<a class="btn btn-success" onclick="upload()"> |
|
||||
<i class="fa fa-upload"></i> 上传图片 |
|
||||
</a> |
|
||||
</div> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="bootstrap-table"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer"/> |
|
||||
<script th:src="@{/ajax/libs/select2/select2.js}"></script> |
|
||||
<script th:inline="javascript"> |
|
||||
var editFlag = [[${@permission.hasPermi('ck:upload:edit')}]]; |
|
||||
var removeFlag = [[${@permission.hasPermi('ck:upload:remove')}]]; |
|
||||
var prefix = ctx + "ck/upload"; |
|
||||
|
|
||||
function upload() { |
|
||||
$.modal.open("上传图片", prefix + "/toUploadHtml"); |
|
||||
} |
|
||||
|
|
||||
$(function () { |
|
||||
var options = { |
|
||||
url: prefix + "/list", |
|
||||
createUrl: prefix + "/add", |
|
||||
updateUrl: prefix + "/edit/{id}", |
|
||||
removeUrl: prefix + "/remove", |
|
||||
exportUrl: prefix + "/export", |
|
||||
modalName: "上传图片", |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field: 'id', |
|
||||
title: '编号', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'itemCode', |
|
||||
title: '物料代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'type', |
|
||||
title: '图片类型' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'version', |
|
||||
title: '版本' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'path', |
|
||||
title: '路径', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'uploadDate', |
|
||||
title: '上传日期' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'uploadMan', |
|
||||
title: '上传人' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'spare1', |
|
||||
title: '', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'spare2', |
|
||||
title: '', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'spare3', |
|
||||
title: '', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'spare4', |
|
||||
title: '', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'spare5', |
|
||||
title: '', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'spare6', |
|
||||
title: '', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
title: '操作', |
|
||||
align: 'center', |
|
||||
formatter: function (value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="" disabled><i class="fa fa-edit"></i>编辑</a> '); |
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="" disabled><i class="fa fa-remove"></i>删除</a>'); |
|
||||
actions.push('<a class="btn btn-warning btn-xs ' + removeFlag + '" href="javascript:void(0)" style="margin-left: 5px" onclick="downloadPicture(\'' + row.path + '\')"><i class="fa fa-download"></i>下载</a>'); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
}] |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
}); |
|
||||
|
|
||||
function downloadPicture(path) { |
|
||||
window.location.href = prefix + "/download?path=" + path; |
|
||||
} |
|
||||
|
|
||||
function reset() { |
|
||||
$("select[name='type']").val("").select2(); |
|
||||
$.form.reset(); |
|
||||
} |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,274 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('上传图片')"/> |
|
||||
<th:block th:include="include :: datetimepicker-css"/> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
|
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<!-- <div class="wrapper wrapper-content animated fadeInRight ibox-content">--> |
|
||||
<div class="container-div"> |
|
||||
<div class="row"> |
|
||||
<div class="col-sm-12"> |
|
||||
|
|
||||
</div> |
|
||||
<form class="form-horizontal m" id="form-poinvoicehead-add"> |
|
||||
<div class="form-group"> |
|
||||
<input id="filePath" name="filePath" class="form-control" type="file"> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">物料代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="itemCode" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">图纸类型:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('sys_upload_type')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
|
||||
th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<div class="modal inmodal" id="itemModal" tabindex="-1" |
|
||||
role="dilog" aria-hidden="true" style="padding-bottom: 100px;"> |
|
||||
<div class="modal-dialog" style="width: 800px;"> |
|
||||
<div class="modal-content"> |
|
||||
<div class="modal-header"> |
|
||||
<button type="button" class="close" data-dismiss="modal" |
|
||||
aria-hidden="true"></button> |
|
||||
<h4 class="modal-title">选择物料</h4> |
|
||||
</div> |
|
||||
<div class="modal-body" style="text-align: center;"> |
|
||||
<div class="row" style="margin-bottom: 20px;"> |
|
||||
<div class="col-md-5"> |
|
||||
<form id="formId"> |
|
||||
<div class="form-group"> |
|
||||
<label class="control-label col-md-4">物料代码:</label> |
|
||||
<div class="col-md-8"> |
|
||||
<input type="text" class="form-control" |
|
||||
id="wlCode" name="wlCode"> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="col-md-2"> |
|
||||
<button type="button" class="btn btn-success" id="wlCodeSearch">搜索</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="row"> |
|
||||
<div class="col-md-12"> |
|
||||
<div class="table-responsive"> |
|
||||
<table id="wlTable" |
|
||||
class="table table-striped table-responsive"> |
|
||||
</table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<button type="button" class="btn btn-primary" |
|
||||
onClick="selectWl();">选择 |
|
||||
</button> |
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" name="close">关闭</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<th:block th:include="include :: footer"/> |
|
||||
<th:block th:include="include :: datetimepicker-js"/> |
|
||||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|
||||
<script th:src="@{/ajax/libs/select2/select2.js}"></script> |
|
||||
<script th:inline="javascript"> |
|
||||
let prefix = ctx + "ck/upload" |
|
||||
$("#form-poinvoicehead-add").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
//鼠标移入,显示完整的数据 |
|
||||
function paramsMatter(value, row, index) { |
|
||||
var span = document.createElement("span"); |
|
||||
span.setAttribute("title", value); |
|
||||
span.innerHTML = value; |
|
||||
return span.outerHTML; |
|
||||
} |
|
||||
|
|
||||
function submitHandler() { |
|
||||
if ($.validate.form()) { |
|
||||
uploadFile(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
function uploadFile() { |
|
||||
var formData = new FormData(); |
|
||||
if ($('#filePath')[0].files[0] == null) { |
|
||||
$.modal.alertWarning("请先选择文件路径"); |
|
||||
return false; |
|
||||
} |
|
||||
let itemCode = $("input[name='itemCode']").val(); |
|
||||
if (itemCode===null || itemCode===""){ |
|
||||
$.modal.alertWarning("请先选择物料"); |
|
||||
return false; |
|
||||
} |
|
||||
formData.append('type', $("select[name='type']").val()); |
|
||||
formData.append('file', $('#filePath')[0].files[0]); |
|
||||
formData.append('itemCode', itemCode); |
|
||||
$.ajax({ |
|
||||
url: prefix + "/upload", |
|
||||
type: 'post', |
|
||||
cache: false, |
|
||||
data: formData, |
|
||||
processData: false, |
|
||||
contentType: false, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// $.operate.successCallback(result); |
|
||||
if (resp.code === 0) { |
|
||||
alert("上传成功!") |
|
||||
var index = parent.layer.getFrameIndex(window.name); |
|
||||
var parent2 = window.parent; |
|
||||
parent2.$.table.refresh(); |
|
||||
parent.layer.close(index);//关闭当前页 |
|
||||
} else { |
|
||||
$.modal.msgError("上传失败"); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
$("input[name='itemCode']").on("click", function () { |
|
||||
$("#itemModal").modal("show"); |
|
||||
}) |
|
||||
|
|
||||
//选择物料列表 |
|
||||
$('#wlTable').bootstrapTable({ |
|
||||
url: '/ck/itemCP/itemList', |
|
||||
pagination: true, |
|
||||
pageNumber: 1, |
|
||||
pageSize: 10, |
|
||||
pageList: [10, 25, 50, 100], |
|
||||
showRefresh: true, |
|
||||
method: "post", |
|
||||
contentType: "application/x-www-form-urlencoded", |
|
||||
striped: true, // 是否显示行间隔色 |
|
||||
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|
||||
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*) |
|
||||
clickToSelect: true, // 是否启用点击选中行 |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
singleSelect: true, |
|
||||
height: 400, |
|
||||
queryParams: function (params) { |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
pageSize: params.limit, |
|
||||
pageNum: params.offset / params.limit + 1, |
|
||||
searchValue: params.search, |
|
||||
orderByColumn: params.sort, |
|
||||
isAsc: params.order |
|
||||
}; |
|
||||
//console.log(curParams); |
|
||||
var json = $.extend(curParams, $.common.formToJSON("formId")); |
|
||||
//console.log(json); |
|
||||
return json; |
|
||||
}, |
|
||||
columns: [ |
|
||||
{ |
|
||||
checkbox: true |
|
||||
}, { |
|
||||
field: 'wlCode', |
|
||||
title: '物料代码', |
|
||||
cellStyle: function (value, row, index) { |
|
||||
return { |
|
||||
css: { |
|
||||
"min-width": "130px", |
|
||||
"text-overflow": "ellipsis", |
|
||||
"overflow": "hidden", |
|
||||
"max-width": "150px", |
|
||||
"white-space": "nowrap" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
formatter: paramsMatter |
|
||||
}, { |
|
||||
field: 'itemname', |
|
||||
title: '物料名称', |
|
||||
cellStyle: function (value, row, index) { |
|
||||
return { |
|
||||
css: { |
|
||||
"min-width": "130px", |
|
||||
"text-overflow": "ellipsis", |
|
||||
"overflow": "hidden", |
|
||||
"max-width": "150px", |
|
||||
"white-space": "nowrap" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
formatter: paramsMatter |
|
||||
}, { |
|
||||
field: 'itemstandard', |
|
||||
title: '规格型号', |
|
||||
cellStyle: function (value, row, index) { |
|
||||
return { |
|
||||
css: { |
|
||||
"min-width": "130px", |
|
||||
"text-overflow": "ellipsis", |
|
||||
"overflow": "hidden", |
|
||||
"max-width": "150px", |
|
||||
"white-space": "nowrap" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
formatter: paramsMatter |
|
||||
}, { |
|
||||
field: 'machineNo', |
|
||||
title: '机种', |
|
||||
cellStyle: function (value, row, index) { |
|
||||
return { |
|
||||
css: { |
|
||||
"min-width": "130px", |
|
||||
"text-overflow": "ellipsis", |
|
||||
"overflow": "hidden", |
|
||||
"max-width": "150px", |
|
||||
"white-space": "nowrap" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
formatter: paramsMatter |
|
||||
}, { |
|
||||
field: 'stockDw', |
|
||||
title: '单位' |
|
||||
} |
|
||||
] |
|
||||
}); |
|
||||
|
|
||||
//搜索物料列表 |
|
||||
$("#wlCodeSearch").on("click", function () { |
|
||||
$("#wlTable").bootstrapTable('refresh'); |
|
||||
$("#wlCode").val(""); |
|
||||
}) |
|
||||
|
|
||||
//点击选择物料 |
|
||||
function selectWl() { |
|
||||
let row = $("#wlTable").bootstrapTable("getSelections"); |
|
||||
$("#itemModal").modal("hide"); |
|
||||
$("input[name='itemCode']").val(row[0].wlCode); |
|
||||
} |
|
||||
|
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
Loading…
Reference in new issue