qianyu
2 years ago
27 changed files with 6972 additions and 0 deletions
@ -0,0 +1,123 @@ |
|||
package com.ruoyi.storehouse.controller; |
|||
|
|||
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.poi.ExcelUtil; |
|||
import com.ruoyi.storehouse.domain.WarehousingCheckInfo; |
|||
import com.ruoyi.storehouse.service.IWarehousingCheckInfoService; |
|||
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 java.util.List; |
|||
|
|||
/** |
|||
* 盘点Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/storehouse/warehousingCheckInfo") |
|||
public class WarehousingCheckInfoController extends BaseController |
|||
{ |
|||
private String prefix = "storehouse/warehousingCheckInfo"; |
|||
|
|||
@Autowired |
|||
private IWarehousingCheckInfoService warehousingCheckInfoService; |
|||
|
|||
@RequiresPermissions("storehouse:warehousingCheckInfo:view") |
|||
@GetMapping() |
|||
public String warehousingCheckInfo() |
|||
{ |
|||
return prefix + "/warehousingCheckInfo"; |
|||
} |
|||
|
|||
/** |
|||
* 查询盘点列表 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingCheckInfo:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(WarehousingCheckInfo warehousingCheckInfo) |
|||
{ |
|||
startPage(); |
|||
List<WarehousingCheckInfo> list = warehousingCheckInfoService.selectWarehousingCheckInfoList(warehousingCheckInfo); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出盘点列表 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingCheckInfo:export") |
|||
@Log(title = "盘点", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(WarehousingCheckInfo warehousingCheckInfo) |
|||
{ |
|||
List<WarehousingCheckInfo> list = warehousingCheckInfoService.selectWarehousingCheckInfoList(warehousingCheckInfo); |
|||
ExcelUtil<WarehousingCheckInfo> util = new ExcelUtil<WarehousingCheckInfo>(WarehousingCheckInfo.class); |
|||
return util.exportExcel(list, "盘点数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增盘点 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存盘点 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingCheckInfo:add") |
|||
@Log(title = "盘点", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(WarehousingCheckInfo warehousingCheckInfo) |
|||
{ |
|||
return toAjax(warehousingCheckInfoService.insertWarehousingCheckInfo(warehousingCheckInfo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改盘点 |
|||
*/ |
|||
@GetMapping("/edit/{warehousingCheckInfoId}") |
|||
public String edit(@PathVariable("warehousingCheckInfoId") Long warehousingCheckInfoId, ModelMap mmap) |
|||
{ |
|||
WarehousingCheckInfo warehousingCheckInfo = warehousingCheckInfoService.selectWarehousingCheckInfoById(warehousingCheckInfoId); |
|||
mmap.put("warehousingCheckInfo", warehousingCheckInfo); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存盘点 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingCheckInfo:edit") |
|||
@Log(title = "盘点", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(WarehousingCheckInfo warehousingCheckInfo) |
|||
{ |
|||
return toAjax(warehousingCheckInfoService.updateWarehousingCheckInfo(warehousingCheckInfo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除盘点 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingCheckInfo:remove") |
|||
@Log(title = "盘点", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(warehousingCheckInfoService.deleteWarehousingCheckInfoByIds(ids)); |
|||
} |
|||
} |
@ -0,0 +1,126 @@ |
|||
package com.ruoyi.storehouse.controller; |
|||
|
|||
import java.util.List; |
|||
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.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.storehouse.domain.WarehousingSearch; |
|||
import com.ruoyi.storehouse.service.IWarehousingSearchService; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 库存Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/storehouse/warehousingSearch") |
|||
public class WarehousingSearchController extends BaseController |
|||
{ |
|||
private String prefix = "storehouse/warehousingSearch"; |
|||
|
|||
@Autowired |
|||
private IWarehousingSearchService warehousingSearchService; |
|||
|
|||
@RequiresPermissions("storehouse:warehousingSearch:view") |
|||
@GetMapping() |
|||
public String warehousingSearch() |
|||
{ |
|||
return prefix + "/warehousingSearch"; |
|||
} |
|||
|
|||
/** |
|||
* 查询库存列表 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingSearch:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(WarehousingSearch warehousingSearch) |
|||
{ |
|||
startPage(); |
|||
List<WarehousingSearch> list = warehousingSearchService.selectWarehousingSearchList(warehousingSearch); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出库存列表 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingSearch:export") |
|||
@Log(title = "库存", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(WarehousingSearch warehousingSearch) |
|||
{ |
|||
List<WarehousingSearch> list = warehousingSearchService.selectWarehousingSearchList(warehousingSearch); |
|||
ExcelUtil<WarehousingSearch> util = new ExcelUtil<WarehousingSearch>(WarehousingSearch.class); |
|||
return util.exportExcel(list, "库存数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增库存 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存库存 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingSearch:add") |
|||
@Log(title = "库存", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(WarehousingSearch warehousingSearch) |
|||
{ |
|||
return toAjax(warehousingSearchService.insertWarehousingSearch(warehousingSearch)); |
|||
} |
|||
|
|||
/** |
|||
* 修改库存 |
|||
*/ |
|||
@GetMapping("/edit/{materialCode}") |
|||
public String edit(@PathVariable("materialCode") String materialCode, ModelMap mmap) |
|||
{ |
|||
WarehousingSearch warehousingSearch = warehousingSearchService.selectWarehousingSearchById(materialCode); |
|||
mmap.put("warehousingSearch", warehousingSearch); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存库存 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingSearch:edit") |
|||
@Log(title = "库存", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(WarehousingSearch warehousingSearch) |
|||
{ |
|||
return toAjax(warehousingSearchService.updateWarehousingSearch(warehousingSearch)); |
|||
} |
|||
|
|||
/** |
|||
* 删除库存 |
|||
*/ |
|||
@RequiresPermissions("storehouse:warehousingSearch:remove") |
|||
@Log(title = "库存", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(warehousingSearchService.deleteWarehousingSearchByIds(ids)); |
|||
} |
|||
} |
@ -0,0 +1,188 @@ |
|||
package com.ruoyi.storehouse.domain; |
|||
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 盘点对象 warehousing_check_info |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
public class WarehousingCheckInfo extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 盘点id */ |
|||
private Long warehousingCheckInfoId; |
|||
|
|||
/** 盘点单号 */ |
|||
@Excel(name = "盘点单号") |
|||
private String warehousingCheckNumber; |
|||
|
|||
/** 盘点人名 */ |
|||
@Excel(name = "盘点人名") |
|||
private String warehousingCheckPerson; |
|||
|
|||
/** 仓库号 */ |
|||
@Excel(name = "仓库号") |
|||
private String stockNumber; |
|||
|
|||
/** 仓库名称 */ |
|||
@Excel(name = "仓库名称") |
|||
private String stockName; |
|||
|
|||
/** 盘点日期 */ |
|||
@Excel(name = "盘点日期") |
|||
private String warehousingCheckDate; |
|||
|
|||
/** 物料种类 */ |
|||
@Excel(name = "物料种类") |
|||
private String materialType; |
|||
|
|||
/** 更新否 */ |
|||
@Excel(name = "更新否") |
|||
private String updateFlag; |
|||
|
|||
/** 录入时间 */ |
|||
private String firstAddTime; |
|||
|
|||
/** 修改时间 */ |
|||
private String updateInfoTime; |
|||
|
|||
/** 备用一 */ |
|||
private String standbyOne; |
|||
|
|||
/** 备用二 */ |
|||
private String standbyTwo; |
|||
|
|||
public void setWarehousingCheckInfoId(Long warehousingCheckInfoId) |
|||
{ |
|||
this.warehousingCheckInfoId = warehousingCheckInfoId; |
|||
} |
|||
|
|||
public Long getWarehousingCheckInfoId() |
|||
{ |
|||
return warehousingCheckInfoId; |
|||
} |
|||
public void setWarehousingCheckNumber(String warehousingCheckNumber) |
|||
{ |
|||
this.warehousingCheckNumber = warehousingCheckNumber; |
|||
} |
|||
|
|||
public String getWarehousingCheckNumber() |
|||
{ |
|||
return warehousingCheckNumber; |
|||
} |
|||
public void setWarehousingCheckPerson(String warehousingCheckPerson) |
|||
{ |
|||
this.warehousingCheckPerson = warehousingCheckPerson; |
|||
} |
|||
|
|||
public String getWarehousingCheckPerson() |
|||
{ |
|||
return warehousingCheckPerson; |
|||
} |
|||
public void setStockNumber(String stockNumber) |
|||
{ |
|||
this.stockNumber = stockNumber; |
|||
} |
|||
|
|||
public String getStockNumber() |
|||
{ |
|||
return stockNumber; |
|||
} |
|||
public void setStockName(String stockName) |
|||
{ |
|||
this.stockName = stockName; |
|||
} |
|||
|
|||
public String getStockName() |
|||
{ |
|||
return stockName; |
|||
} |
|||
public void setWarehousingCheckDate(String warehousingCheckDate) |
|||
{ |
|||
this.warehousingCheckDate = warehousingCheckDate; |
|||
} |
|||
|
|||
public String getWarehousingCheckDate() |
|||
{ |
|||
return warehousingCheckDate; |
|||
} |
|||
public void setMaterialType(String materialType) |
|||
{ |
|||
this.materialType = materialType; |
|||
} |
|||
|
|||
public String getMaterialType() |
|||
{ |
|||
return materialType; |
|||
} |
|||
public void setUpdateFlag(String updateFlag) |
|||
{ |
|||
this.updateFlag = updateFlag; |
|||
} |
|||
|
|||
public String getUpdateFlag() |
|||
{ |
|||
return updateFlag; |
|||
} |
|||
public void setFirstAddTime(String firstAddTime) |
|||
{ |
|||
this.firstAddTime = firstAddTime; |
|||
} |
|||
|
|||
public String getFirstAddTime() |
|||
{ |
|||
return firstAddTime; |
|||
} |
|||
public void setUpdateInfoTime(String updateInfoTime) |
|||
{ |
|||
this.updateInfoTime = updateInfoTime; |
|||
} |
|||
|
|||
public String getUpdateInfoTime() |
|||
{ |
|||
return updateInfoTime; |
|||
} |
|||
public void setStandbyOne(String standbyOne) |
|||
{ |
|||
this.standbyOne = standbyOne; |
|||
} |
|||
|
|||
public String getStandbyOne() |
|||
{ |
|||
return standbyOne; |
|||
} |
|||
public void setStandbyTwo(String standbyTwo) |
|||
{ |
|||
this.standbyTwo = standbyTwo; |
|||
} |
|||
|
|||
public String getStandbyTwo() |
|||
{ |
|||
return standbyTwo; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("warehousingCheckInfoId", getWarehousingCheckInfoId()) |
|||
.append("warehousingCheckNumber", getWarehousingCheckNumber()) |
|||
.append("warehousingCheckPerson", getWarehousingCheckPerson()) |
|||
.append("stockNumber", getStockNumber()) |
|||
.append("stockName", getStockName()) |
|||
.append("warehousingCheckDate", getWarehousingCheckDate()) |
|||
.append("materialType", getMaterialType()) |
|||
.append("remark", getRemark()) |
|||
.append("updateFlag", getUpdateFlag()) |
|||
.append("firstAddTime", getFirstAddTime()) |
|||
.append("updateInfoTime", getUpdateInfoTime()) |
|||
.append("standbyOne", getStandbyOne()) |
|||
.append("standbyTwo", getStandbyTwo()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,206 @@ |
|||
package com.ruoyi.storehouse.domain; |
|||
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 库存对象 warehousing_search |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
public class WarehousingSearch extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 物料代码 */ |
|||
@Excel(name = "物料代码") |
|||
private String materialCode; |
|||
|
|||
/** 物料名称 */ |
|||
@Excel(name = "物料名称") |
|||
private String materialName; |
|||
|
|||
/** 物料类型 */ |
|||
@Excel(name = "物料类型") |
|||
private String materialType; |
|||
|
|||
/** 批号 */ |
|||
@Excel(name = "批号") |
|||
private String batchNumber; |
|||
|
|||
/** 规格型号 */ |
|||
@Excel(name = "规格型号") |
|||
private String specificationModel; |
|||
|
|||
/** 机种 */ |
|||
@Excel(name = "机种") |
|||
private String typeMachine; |
|||
|
|||
/** 单位 */ |
|||
@Excel(name = "单位") |
|||
private String inventoryUnit; |
|||
|
|||
/** 库存数量 */ |
|||
@Excel(name = "库存数量") |
|||
private String stockQuantity; |
|||
|
|||
/** 仓库号 */ |
|||
@Excel(name = "仓库号") |
|||
private String stockNumber; |
|||
|
|||
/** 仓库名称 */ |
|||
@Excel(name = "仓库名称") |
|||
private String stockName; |
|||
|
|||
/** 客户编号 */ |
|||
@Excel(name = "客户编号") |
|||
private String enterpriseCode; |
|||
|
|||
/** 客户名称 */ |
|||
@Excel(name = "客户名称") |
|||
private String enterpriseName; |
|||
|
|||
/** 存放地址 */ |
|||
@Excel(name = "存放地址") |
|||
private String storageLocation; |
|||
|
|||
public void setMaterialCode(String materialCode) |
|||
{ |
|||
this.materialCode = materialCode; |
|||
} |
|||
|
|||
public String getMaterialCode() |
|||
{ |
|||
return materialCode; |
|||
} |
|||
public void setMaterialName(String materialName) |
|||
{ |
|||
this.materialName = materialName; |
|||
} |
|||
|
|||
public String getMaterialName() |
|||
{ |
|||
return materialName; |
|||
} |
|||
public void setMaterialType(String materialType) |
|||
{ |
|||
this.materialType = materialType; |
|||
} |
|||
|
|||
public String getMaterialType() |
|||
{ |
|||
return materialType; |
|||
} |
|||
public void setBatchNumber(String batchNumber) |
|||
{ |
|||
this.batchNumber = batchNumber; |
|||
} |
|||
|
|||
public String getBatchNumber() |
|||
{ |
|||
return batchNumber; |
|||
} |
|||
public void setSpecificationModel(String specificationModel) |
|||
{ |
|||
this.specificationModel = specificationModel; |
|||
} |
|||
|
|||
public String getSpecificationModel() |
|||
{ |
|||
return specificationModel; |
|||
} |
|||
public void setTypeMachine(String typeMachine) |
|||
{ |
|||
this.typeMachine = typeMachine; |
|||
} |
|||
|
|||
public String getTypeMachine() |
|||
{ |
|||
return typeMachine; |
|||
} |
|||
public void setInventoryUnit(String inventoryUnit) |
|||
{ |
|||
this.inventoryUnit = inventoryUnit; |
|||
} |
|||
|
|||
public String getInventoryUnit() |
|||
{ |
|||
return inventoryUnit; |
|||
} |
|||
public void setStockQuantity(String stockQuantity) |
|||
{ |
|||
this.stockQuantity = stockQuantity; |
|||
} |
|||
|
|||
public String getStockQuantity() |
|||
{ |
|||
return stockQuantity; |
|||
} |
|||
public void setStockNumber(String stockNumber) |
|||
{ |
|||
this.stockNumber = stockNumber; |
|||
} |
|||
|
|||
public String getStockNumber() |
|||
{ |
|||
return stockNumber; |
|||
} |
|||
public void setStockName(String stockName) |
|||
{ |
|||
this.stockName = stockName; |
|||
} |
|||
|
|||
public String getStockName() |
|||
{ |
|||
return stockName; |
|||
} |
|||
public void setEnterpriseCode(String enterpriseCode) |
|||
{ |
|||
this.enterpriseCode = enterpriseCode; |
|||
} |
|||
|
|||
public String getEnterpriseCode() |
|||
{ |
|||
return enterpriseCode; |
|||
} |
|||
public void setEnterpriseName(String enterpriseName) |
|||
{ |
|||
this.enterpriseName = enterpriseName; |
|||
} |
|||
|
|||
public String getEnterpriseName() |
|||
{ |
|||
return enterpriseName; |
|||
} |
|||
public void setStorageLocation(String storageLocation) |
|||
{ |
|||
this.storageLocation = storageLocation; |
|||
} |
|||
|
|||
public String getStorageLocation() |
|||
{ |
|||
return storageLocation; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("materialCode", getMaterialCode()) |
|||
.append("materialName", getMaterialName()) |
|||
.append("materialType", getMaterialType()) |
|||
.append("batchNumber", getBatchNumber()) |
|||
.append("specificationModel", getSpecificationModel()) |
|||
.append("typeMachine", getTypeMachine()) |
|||
.append("inventoryUnit", getInventoryUnit()) |
|||
.append("stockQuantity", getStockQuantity()) |
|||
.append("stockNumber", getStockNumber()) |
|||
.append("stockName", getStockName()) |
|||
.append("enterpriseCode", getEnterpriseCode()) |
|||
.append("enterpriseName", getEnterpriseName()) |
|||
.append("storageLocation", getStorageLocation()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.storehouse.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.storehouse.domain.WarehousingCheckInfo; |
|||
|
|||
/** |
|||
* 盘点Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
public interface WarehousingCheckInfoMapper |
|||
{ |
|||
/** |
|||
* 查询盘点 |
|||
* |
|||
* @param warehousingCheckInfoId 盘点ID |
|||
* @return 盘点 |
|||
*/ |
|||
public WarehousingCheckInfo selectWarehousingCheckInfoById(Long warehousingCheckInfoId); |
|||
|
|||
/** |
|||
* 查询盘点列表 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 盘点集合 |
|||
*/ |
|||
public List<WarehousingCheckInfo> selectWarehousingCheckInfoList(WarehousingCheckInfo warehousingCheckInfo); |
|||
|
|||
/** |
|||
* 新增盘点 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertWarehousingCheckInfo(WarehousingCheckInfo warehousingCheckInfo); |
|||
|
|||
/** |
|||
* 修改盘点 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateWarehousingCheckInfo(WarehousingCheckInfo warehousingCheckInfo); |
|||
|
|||
/** |
|||
* 删除盘点 |
|||
* |
|||
* @param warehousingCheckInfoId 盘点ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingCheckInfoById(Long warehousingCheckInfoId); |
|||
|
|||
/** |
|||
* 批量删除盘点 |
|||
* |
|||
* @param warehousingCheckInfoIds 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingCheckInfoByIds(String[] warehousingCheckInfoIds); |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.storehouse.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.storehouse.domain.WarehousingSearch; |
|||
|
|||
/** |
|||
* 库存Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
public interface WarehousingSearchMapper |
|||
{ |
|||
/** |
|||
* 查询库存 |
|||
* |
|||
* @param materialCode 库存ID |
|||
* @return 库存 |
|||
*/ |
|||
public WarehousingSearch selectWarehousingSearchById(String materialCode); |
|||
|
|||
/** |
|||
* 查询库存列表 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 库存集合 |
|||
*/ |
|||
public List<WarehousingSearch> selectWarehousingSearchList(WarehousingSearch warehousingSearch); |
|||
|
|||
/** |
|||
* 新增库存 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertWarehousingSearch(WarehousingSearch warehousingSearch); |
|||
|
|||
/** |
|||
* 修改库存 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateWarehousingSearch(WarehousingSearch warehousingSearch); |
|||
|
|||
/** |
|||
* 删除库存 |
|||
* |
|||
* @param materialCode 库存ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingSearchById(String materialCode); |
|||
|
|||
/** |
|||
* 批量删除库存 |
|||
* |
|||
* @param materialCodes 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingSearchByIds(String[] materialCodes); |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.storehouse.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.storehouse.domain.WarehousingCheckInfo; |
|||
|
|||
/** |
|||
* 盘点Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
public interface IWarehousingCheckInfoService |
|||
{ |
|||
/** |
|||
* 查询盘点 |
|||
* |
|||
* @param warehousingCheckInfoId 盘点ID |
|||
* @return 盘点 |
|||
*/ |
|||
public WarehousingCheckInfo selectWarehousingCheckInfoById(Long warehousingCheckInfoId); |
|||
|
|||
/** |
|||
* 查询盘点列表 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 盘点集合 |
|||
*/ |
|||
public List<WarehousingCheckInfo> selectWarehousingCheckInfoList(WarehousingCheckInfo warehousingCheckInfo); |
|||
|
|||
/** |
|||
* 新增盘点 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertWarehousingCheckInfo(WarehousingCheckInfo warehousingCheckInfo); |
|||
|
|||
/** |
|||
* 修改盘点 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateWarehousingCheckInfo(WarehousingCheckInfo warehousingCheckInfo); |
|||
|
|||
/** |
|||
* 批量删除盘点 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingCheckInfoByIds(String ids); |
|||
|
|||
/** |
|||
* 删除盘点信息 |
|||
* |
|||
* @param warehousingCheckInfoId 盘点ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingCheckInfoById(Long warehousingCheckInfoId); |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.storehouse.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.storehouse.domain.WarehousingSearch; |
|||
|
|||
/** |
|||
* 库存Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
public interface IWarehousingSearchService |
|||
{ |
|||
/** |
|||
* 查询库存 |
|||
* |
|||
* @param materialCode 库存ID |
|||
* @return 库存 |
|||
*/ |
|||
public WarehousingSearch selectWarehousingSearchById(String materialCode); |
|||
|
|||
/** |
|||
* 查询库存列表 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 库存集合 |
|||
*/ |
|||
public List<WarehousingSearch> selectWarehousingSearchList(WarehousingSearch warehousingSearch); |
|||
|
|||
/** |
|||
* 新增库存 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertWarehousingSearch(WarehousingSearch warehousingSearch); |
|||
|
|||
/** |
|||
* 修改库存 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateWarehousingSearch(WarehousingSearch warehousingSearch); |
|||
|
|||
/** |
|||
* 批量删除库存 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingSearchByIds(String ids); |
|||
|
|||
/** |
|||
* 删除库存信息 |
|||
* |
|||
* @param materialCode 库存ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehousingSearchById(String materialCode); |
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.ruoyi.storehouse.service.impl; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.storehouse.mapper.WarehousingCheckInfoMapper; |
|||
import com.ruoyi.storehouse.domain.WarehousingCheckInfo; |
|||
import com.ruoyi.storehouse.service.IWarehousingCheckInfoService; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
|
|||
/** |
|||
* 盘点Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
@Service |
|||
public class WarehousingCheckInfoServiceImpl implements IWarehousingCheckInfoService |
|||
{ |
|||
@Autowired |
|||
private WarehousingCheckInfoMapper warehousingCheckInfoMapper; |
|||
|
|||
/** |
|||
* 查询盘点 |
|||
* |
|||
* @param warehousingCheckInfoId 盘点ID |
|||
* @return 盘点 |
|||
*/ |
|||
@Override |
|||
public WarehousingCheckInfo selectWarehousingCheckInfoById(Long warehousingCheckInfoId) |
|||
{ |
|||
return warehousingCheckInfoMapper.selectWarehousingCheckInfoById(warehousingCheckInfoId); |
|||
} |
|||
|
|||
/** |
|||
* 查询盘点列表 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 盘点 |
|||
*/ |
|||
@Override |
|||
public List<WarehousingCheckInfo> selectWarehousingCheckInfoList(WarehousingCheckInfo warehousingCheckInfo) |
|||
{ |
|||
return warehousingCheckInfoMapper.selectWarehousingCheckInfoList(warehousingCheckInfo); |
|||
} |
|||
|
|||
/** |
|||
* 新增盘点 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertWarehousingCheckInfo(WarehousingCheckInfo warehousingCheckInfo) |
|||
{ |
|||
return warehousingCheckInfoMapper.insertWarehousingCheckInfo(warehousingCheckInfo); |
|||
} |
|||
|
|||
/** |
|||
* 修改盘点 |
|||
* |
|||
* @param warehousingCheckInfo 盘点 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateWarehousingCheckInfo(WarehousingCheckInfo warehousingCheckInfo) |
|||
{ |
|||
return warehousingCheckInfoMapper.updateWarehousingCheckInfo(warehousingCheckInfo); |
|||
} |
|||
|
|||
/** |
|||
* 删除盘点对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehousingCheckInfoByIds(String ids) |
|||
{ |
|||
return warehousingCheckInfoMapper.deleteWarehousingCheckInfoByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除盘点信息 |
|||
* |
|||
* @param warehousingCheckInfoId 盘点ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehousingCheckInfoById(Long warehousingCheckInfoId) |
|||
{ |
|||
return warehousingCheckInfoMapper.deleteWarehousingCheckInfoById(warehousingCheckInfoId); |
|||
} |
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.ruoyi.storehouse.service.impl; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.storehouse.mapper.WarehousingSearchMapper; |
|||
import com.ruoyi.storehouse.domain.WarehousingSearch; |
|||
import com.ruoyi.storehouse.service.IWarehousingSearchService; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
|
|||
/** |
|||
* 库存Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-05-16 |
|||
*/ |
|||
@Service |
|||
public class WarehousingSearchServiceImpl implements IWarehousingSearchService |
|||
{ |
|||
@Autowired |
|||
private WarehousingSearchMapper warehousingSearchMapper; |
|||
|
|||
/** |
|||
* 查询库存 |
|||
* |
|||
* @param materialCode 库存ID |
|||
* @return 库存 |
|||
*/ |
|||
@Override |
|||
public WarehousingSearch selectWarehousingSearchById(String materialCode) |
|||
{ |
|||
return warehousingSearchMapper.selectWarehousingSearchById(materialCode); |
|||
} |
|||
|
|||
/** |
|||
* 查询库存列表 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 库存 |
|||
*/ |
|||
@Override |
|||
public List<WarehousingSearch> selectWarehousingSearchList(WarehousingSearch warehousingSearch) |
|||
{ |
|||
return warehousingSearchMapper.selectWarehousingSearchList(warehousingSearch); |
|||
} |
|||
|
|||
/** |
|||
* 新增库存 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertWarehousingSearch(WarehousingSearch warehousingSearch) |
|||
{ |
|||
return warehousingSearchMapper.insertWarehousingSearch(warehousingSearch); |
|||
} |
|||
|
|||
/** |
|||
* 修改库存 |
|||
* |
|||
* @param warehousingSearch 库存 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateWarehousingSearch(WarehousingSearch warehousingSearch) |
|||
{ |
|||
return warehousingSearchMapper.updateWarehousingSearch(warehousingSearch); |
|||
} |
|||
|
|||
/** |
|||
* 删除库存对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehousingSearchByIds(String ids) |
|||
{ |
|||
return warehousingSearchMapper.deleteWarehousingSearchByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除库存信息 |
|||
* |
|||
* @param materialCode 库存ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehousingSearchById(String materialCode) |
|||
{ |
|||
return warehousingSearchMapper.deleteWarehousingSearchById(materialCode); |
|||
} |
|||
} |
@ -0,0 +1,103 @@ |
|||
<?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.storehouse.mapper.WarehousingCheckInfoMapper"> |
|||
|
|||
<resultMap type="WarehousingCheckInfo" id="WarehousingCheckInfoResult"> |
|||
<result property="warehousingCheckInfoId" column="warehousing_check_info_id" /> |
|||
<result property="warehousingCheckNumber" column="warehousing_check_number" /> |
|||
<result property="warehousingCheckPerson" column="warehousing_check_person" /> |
|||
<result property="stockNumber" column="stock_number" /> |
|||
<result property="stockName" column="stock_name" /> |
|||
<result property="warehousingCheckDate" column="warehousing_check_date" /> |
|||
<result property="materialType" column="material_type" /> |
|||
<result property="remark" column="remark" /> |
|||
<result property="updateFlag" column="update_flag" /> |
|||
<result property="firstAddTime" column="first_add_time" /> |
|||
<result property="updateInfoTime" column="update_info_time" /> |
|||
<result property="standbyOne" column="standby_one" /> |
|||
<result property="standbyTwo" column="standby_two" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectWarehousingCheckInfoVo"> |
|||
select warehousing_check_info_id, warehousing_check_number, warehousing_check_person, stock_number, stock_name, warehousing_check_date, material_type, remark, update_flag, first_add_time, update_info_time, standby_one, standby_two from warehousing_check_info |
|||
</sql> |
|||
|
|||
<select id="selectWarehousingCheckInfoList" parameterType="WarehousingCheckInfo" resultMap="WarehousingCheckInfoResult"> |
|||
<include refid="selectWarehousingCheckInfoVo"/> |
|||
<where> |
|||
<if test="warehousingCheckNumber != null and warehousingCheckNumber != ''"> and warehousing_check_number like concat('%', #{warehousingCheckNumber}, '%')</if> |
|||
<if test="stockNumber != null and stockNumber != ''"> and stock_number like concat('%', #{stockNumber}, '%')</if> |
|||
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if> |
|||
<if test="params.beginWarehousingCheckDate != null and params.beginWarehousingCheckDate != '' and params.endWarehousingCheckDate != null and params.endWarehousingCheckDate != ''"> and warehousing_check_date between #{params.beginWarehousingCheckDate} and #{params.endWarehousingCheckDate}</if> |
|||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if> |
|||
<if test="updateFlag != null and updateFlag != ''"> and update_flag = #{updateFlag}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectWarehousingCheckInfoById" parameterType="Long" resultMap="WarehousingCheckInfoResult"> |
|||
<include refid="selectWarehousingCheckInfoVo"/> |
|||
where warehousing_check_info_id = #{warehousingCheckInfoId} |
|||
</select> |
|||
|
|||
<insert id="insertWarehousingCheckInfo" parameterType="WarehousingCheckInfo" useGeneratedKeys="true" keyProperty="warehousingCheckInfoId"> |
|||
insert into warehousing_check_info |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="warehousingCheckNumber != null">warehousing_check_number,</if> |
|||
<if test="warehousingCheckPerson != null">warehousing_check_person,</if> |
|||
<if test="stockNumber != null">stock_number,</if> |
|||
<if test="stockName != null">stock_name,</if> |
|||
<if test="warehousingCheckDate != null">warehousing_check_date,</if> |
|||
<if test="materialType != null">material_type,</if> |
|||
<if test="remark != null">remark,</if> |
|||
<if test="updateFlag != null">update_flag,</if> |
|||
<if test="standbyOne != null">standby_one,</if> |
|||
<if test="standbyTwo != null">standby_two,</if> |
|||
first_add_time, |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="warehousingCheckNumber != null">#{warehousingCheckNumber},</if> |
|||
<if test="warehousingCheckPerson != null">#{warehousingCheckPerson},</if> |
|||
<if test="stockNumber != null">#{stockNumber},</if> |
|||
<if test="stockName != null">#{stockName},</if> |
|||
<if test="warehousingCheckDate != null">#{warehousingCheckDate},</if> |
|||
<if test="materialType != null">#{materialType},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
<if test="updateFlag != null">#{updateFlag},</if> |
|||
<if test="standbyOne != null">#{standbyOne},</if> |
|||
<if test="standbyTwo != null">#{standbyTwo},</if> |
|||
now(), |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateWarehousingCheckInfo" parameterType="WarehousingCheckInfo"> |
|||
update warehousing_check_info |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="warehousingCheckNumber != null">warehousing_check_number = #{warehousingCheckNumber},</if> |
|||
<if test="warehousingCheckPerson != null">warehousing_check_person = #{warehousingCheckPerson},</if> |
|||
<if test="stockNumber != null">stock_number = #{stockNumber},</if> |
|||
<if test="stockName != null">stock_name = #{stockName},</if> |
|||
<if test="warehousingCheckDate != null">warehousing_check_date = #{warehousingCheckDate},</if> |
|||
<if test="materialType != null">material_type = #{materialType},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
<if test="updateFlag != null">update_flag = #{updateFlag},</if> |
|||
<if test="standbyOne != null">standby_one = #{standbyOne},</if> |
|||
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if> |
|||
update_info_time = CONCAT_WS(',',NOW(),update_info_time), |
|||
</trim> |
|||
where warehousing_check_info_id = #{warehousingCheckInfoId} |
|||
</update> |
|||
|
|||
<delete id="deleteWarehousingCheckInfoById" parameterType="Long"> |
|||
delete from warehousing_check_info where warehousing_check_info_id = #{warehousingCheckInfoId} |
|||
</delete> |
|||
|
|||
<delete id="deleteWarehousingCheckInfoByIds" parameterType="String"> |
|||
delete from warehousing_check_info where warehousing_check_info_id in |
|||
<foreach item="warehousingCheckInfoId" collection="array" open="(" separator="," close=")"> |
|||
#{warehousingCheckInfoId} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
</mapper> |
@ -0,0 +1,179 @@ |
|||
<?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.storehouse.mapper.WarehousingSearchMapper"> |
|||
|
|||
<resultMap type="WarehousingSearch" id="WarehousingSearchResult"> |
|||
<result property="materialCode" column="material_code" /> |
|||
<result property="materialName" column="material_name" /> |
|||
<result property="materialType" column="material_type" /> |
|||
<result property="batchNumber" column="batch_number" /> |
|||
<result property="specificationModel" column="specification_model" /> |
|||
<result property="typeMachine" column="type_machine" /> |
|||
<result property="inventoryUnit" column="inventory_unit" /> |
|||
<result property="stockQuantity" column="stock_quantity" /> |
|||
<result property="stockNumber" column="stock_number" /> |
|||
<result property="stockName" column="stock_name" /> |
|||
<result property="enterpriseCode" column="enterprise_code" /> |
|||
<result property="enterpriseName" column="enterprise_name" /> |
|||
<result property="storageLocation" column="storage_location" /> |
|||
</resultMap> |
|||
|
|||
<!-- <sql id="selectWarehousingSearchVo">--> |
|||
<!-- select material_code, material_name, material_type, batch_number, specification_model, type_machine, inventory_unit, stock_quantity, stock_number, stock_name, enterprise_code, enterprise_name, storage_location from warehousing_search--> |
|||
<!-- </sql>--> |
|||
|
|||
<sql id="selectWarehousingSearchVo"> |
|||
SELECT |
|||
material_code, |
|||
material_name, |
|||
material_type, |
|||
batch_number, |
|||
specification_model, |
|||
type_machine, |
|||
inventory_unit, |
|||
sum( count ) AS stock_quantity, |
|||
stock_number, |
|||
stock_name, |
|||
enterprise_code, |
|||
enterprise_name, |
|||
storage_location |
|||
FROM |
|||
( |
|||
SELECT |
|||
warehousing_in_detail.material_code AS material_code, |
|||
warehousing_in_detail.material_name AS material_name, |
|||
warehousing_in_detail.material_type AS material_type, |
|||
warehousing_in_detail.batch_number AS batch_number, |
|||
warehousing_in_detail.specification_model AS specification_model, |
|||
warehousing_in_detail.type_machine AS type_machine, |
|||
warehousing_in_detail.inventory_unit AS inventory_unit, |
|||
SUM( warehousing_in_detail.warehousing_quantity ) AS `count`, |
|||
warehousing_in_info.stock_number AS stock_number, |
|||
warehousing_in_info.stock_name AS stock_name, |
|||
warehousing_in_info.enterprise_code AS enterprise_code, |
|||
warehousing_in_info.enterprise_name AS enterprise_name, |
|||
warehousing_in_detail.storage_location AS storage_location |
|||
FROM |
|||
warehousing_in_detail, |
|||
warehousing_in_info |
|||
WHERE |
|||
warehousing_in_detail.warehousing_number = warehousing_in_info.warehousing_number |
|||
GROUP BY |
|||
warehousing_in_detail.material_code UNION ALL |
|||
SELECT |
|||
outbound_detail.material_code AS material_code, |
|||
outbound_detail.material_name AS material_name, |
|||
outbound_info.material_type AS material_type, |
|||
outbound_detail.batch_number AS batch_number, |
|||
outbound_detail.specification_model AS specification_model, |
|||
outbound_detail.type_machine AS type_machine, |
|||
outbound_detail.inventory_unit AS inventory_unit, |
|||
- SUM( outbound_detail.actual_count ) AS `count`, |
|||
outbound_info.stock_no AS stock_number, |
|||
outbound_info.stock_name AS stock_name, |
|||
outbound_info.enterprise_code AS enterprise_code, |
|||
outbound_info.enterprise_name AS enterprise_name, |
|||
outbound_detail.storage_location AS storage_location |
|||
FROM |
|||
outbound_detail, |
|||
outbound_info |
|||
WHERE |
|||
outbound_detail.outbound_no = outbound_info.outbound_no |
|||
GROUP BY |
|||
outbound_detail.material_code |
|||
) AS tabletemp |
|||
GROUP BY |
|||
material_code |
|||
</sql> |
|||
|
|||
<select id="selectWarehousingSearchList" parameterType="WarehousingSearch" resultMap="WarehousingSearchResult"> |
|||
select * from (<include refid="selectWarehousingSearchVo"/>) as `temTable` |
|||
<where> |
|||
<if test="materialCode != null and materialCode != ''"> material_code like concat('%', #{materialCode}, '%')</if> |
|||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
|||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if> |
|||
<if test="batchNumber != null and batchNumber != ''"> and batch_number like concat('%', #{batchNumber}, '%')</if> |
|||
<if test="stockNumber != null and stockNumber != ''"> and stock_number like concat('%', #{stockNumber}, '%')</if> |
|||
<if test="stockName != null and stockName != ''"> and stock_name like concat('%', #{stockName}, '%')</if> |
|||
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code = #{enterpriseCode}</if> |
|||
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> |
|||
<choose> |
|||
<when test="stockQuantity != null and stockQuantity != '' and stockQuantity == 1">and stock_quantity > 0</when> |
|||
<when test="stockQuantity != null and stockQuantity != '' and stockQuantity == 0">and stock_quantity <= 0</when> |
|||
<otherwise></otherwise> |
|||
</choose> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectWarehousingSearchById" parameterType="String" resultMap="WarehousingSearchResult"> |
|||
<include refid="selectWarehousingSearchVo"/> |
|||
where material_code = #{materialCode} |
|||
</select> |
|||
|
|||
<insert id="insertWarehousingSearch" parameterType="WarehousingSearch"> |
|||
insert into warehousing_search |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="materialCode != null">material_code,</if> |
|||
<if test="materialName != null">material_name,</if> |
|||
<if test="materialType != null">material_type,</if> |
|||
<if test="batchNumber != null">batch_number,</if> |
|||
<if test="specificationModel != null">specification_model,</if> |
|||
<if test="typeMachine != null">type_machine,</if> |
|||
<if test="inventoryUnit != null">inventory_unit,</if> |
|||
<if test="stockQuantity != null">stock_quantity,</if> |
|||
<if test="stockNumber != null">stock_number,</if> |
|||
<if test="stockName != null">stock_name,</if> |
|||
<if test="enterpriseCode != null">enterprise_code,</if> |
|||
<if test="enterpriseName != null">enterprise_name,</if> |
|||
<if test="storageLocation != null">storage_location,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="materialCode != null">#{materialCode},</if> |
|||
<if test="materialName != null">#{materialName},</if> |
|||
<if test="materialType != null">#{materialType},</if> |
|||
<if test="batchNumber != null">#{batchNumber},</if> |
|||
<if test="specificationModel != null">#{specificationModel},</if> |
|||
<if test="typeMachine != null">#{typeMachine},</if> |
|||
<if test="inventoryUnit != null">#{inventoryUnit},</if> |
|||
<if test="stockQuantity != null">#{stockQuantity},</if> |
|||
<if test="stockNumber != null">#{stockNumber},</if> |
|||
<if test="stockName != null">#{stockName},</if> |
|||
<if test="enterpriseCode != null">#{enterpriseCode},</if> |
|||
<if test="enterpriseName != null">#{enterpriseName},</if> |
|||
<if test="storageLocation != null">#{storageLocation},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateWarehousingSearch" parameterType="WarehousingSearch"> |
|||
update warehousing_search |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="materialName != null">material_name = #{materialName},</if> |
|||
<if test="materialType != null">material_type = #{materialType},</if> |
|||
<if test="batchNumber != null">batch_number = #{batchNumber},</if> |
|||
<if test="specificationModel != null">specification_model = #{specificationModel},</if> |
|||
<if test="typeMachine != null">type_machine = #{typeMachine},</if> |
|||
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if> |
|||
<if test="stockQuantity != null">stock_quantity = #{stockQuantity},</if> |
|||
<if test="stockNumber != null">stock_number = #{stockNumber},</if> |
|||
<if test="stockName != null">stock_name = #{stockName},</if> |
|||
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if> |
|||
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if> |
|||
<if test="storageLocation != null">storage_location = #{storageLocation},</if> |
|||
</trim> |
|||
where material_code = #{materialCode} |
|||
</update> |
|||
|
|||
<delete id="deleteWarehousingSearchById" parameterType="String"> |
|||
delete from warehousing_search where material_code = #{materialCode} |
|||
</delete> |
|||
|
|||
<delete id="deleteWarehousingSearchByIds" parameterType="String"> |
|||
delete from warehousing_search where material_code in |
|||
<foreach item="materialCode" collection="array" open="(" separator="," close=")"> |
|||
#{materialCode} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
</mapper> |
@ -0,0 +1,683 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<style> |
|||
.other-container { |
|||
width: 90%; |
|||
height: 200px; |
|||
margin: auto; |
|||
} |
|||
.other { |
|||
margin-top: 20px; |
|||
} |
|||
h4 { |
|||
display: inline-block; |
|||
margin-right: 20px; |
|||
} |
|||
.modal-body{ |
|||
height: 550px; |
|||
} |
|||
iframe{ |
|||
width: 100%; |
|||
height: 500px; |
|||
frameborder: 0; |
|||
border: 0; |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-materialRequisitionYL-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">领料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialRequisitionNumber" class="form-control" type="text" required readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单号码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" 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="workOrderNumber" class="form-control" type="text">--> |
|||
<select name="workOrderNumber" class="form-control m-b" type="text"> |
|||
<option value="">请选择工单号</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料部门:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <select name="deptName" class="form-control m-b" th:with="type=${@dict.getType('sys_dept_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<select name="deptName" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料部门</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料人:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <input name="materialRequisitionPerson" class="form-control" type="text">--> |
|||
<select name="materialRequisitionPerson" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料人</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">部门编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deptNumber" 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="stockName" class="form-control m-b"> |
|||
<option value="">请选择仓库名称</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="stockNumber" 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="stockManager" 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="outputClass" class="form-control m-b" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="outputDate" 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="finishProductCode" 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="typeMachine" 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="workOrderQuantity" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remarkContent" class="form-control" type="text"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hidden"> |
|||
<label class="col-sm-3 control-label">领料否:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="getMaterialFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
|
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>物料信息</h4> |
|||
<!-- <a class="btn btn-primary" onclick="showMaterialModal()"><i class="fa fa-plus"></i> 选择信息</a>--> |
|||
<!-- <div style="width: 10%;display: inline-block;margin-left: 10px;">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}" style="margin-top: 10px;">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- <form class="form-horizontal m">--> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-3 control-label">物料类别:</label>--> |
|||
<!-- <div class="col-sm-3">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </form>--> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addMaterialTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="rawModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formRawMaterialSearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>原料代码:</label> |
|||
<input type="text" name="rawMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>原料名称:</label> |
|||
<input type="text" name="rawMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="rawTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addrowconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addRawToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeRawModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="subsidiaryModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formSubsidiarySearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>辅料代码:</label> |
|||
<input type="text" name="subsidiaryMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>辅料名称:</label> |
|||
<input type="text" name="subsidiaryMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
|
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="subsidiaryTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addsubsidiaryconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addSubsidiaryToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeSubsidiaryModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="productInfoModal" |
|||
role="dilog" aria-hidden="true"> |
|||
|
|||
<!-- 查询成品资料--> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-body"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="productFormId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>成品代码:</label> |
|||
<input type="text" name="finishProductCode"/> |
|||
</li> |
|||
<li> |
|||
<label>成品名称:</label> |
|||
<input type="text" name="finishProductName"/> |
|||
</li> |
|||
<li> |
|||
<label>客户代码:</label> |
|||
<input type="text" name="enterpriseCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="enterpriseName"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="productTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: select2-js"/> |
|||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "manufacture/materialRequisitionInfo" |
|||
var prefixMaterialPequisitionDetail = ctx + "manufacture/materialRequisitionDetail" |
|||
var prefixWorkOrder = ctx + "manufacture/workOrderInfo" |
|||
|
|||
var materialCategoryDatas = [[${@dict.getType('sys_raw_material_category')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|||
var purchasingUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var limitWhetherDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var whetherSemiManufacturesDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var gpItemSelectionDatas = [[${@dict.getType('sys_gp_Item_selection')}]]; |
|||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]];; |
|||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|||
|
|||
$("#form-materialRequisitionYL-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
// if ($.validate.form()) { |
|||
// $.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize()); |
|||
// } |
|||
let getData=$('#addMaterialTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0){ |
|||
//确认添加选中的物料数据 |
|||
confirmMaterial(); |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请选择!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='outputDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
todayBtn: true |
|||
}); |
|||
$("input[name='outputDate']").datetimepicker("setDate",new Date()) |
|||
|
|||
$(function() { |
|||
//初始化添加材料表 |
|||
$('#addMaterialTable').bootstrapTable({ |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true,//点击行选中 |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
uniqueId: 'materialCode', |
|||
queryParams: function (params) { |
|||
//console.log("123"); |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
// enterpriseCode: data[0].enterpriseCode |
|||
|
|||
}; |
|||
// console.log(data[0].enterpriseCode) |
|||
return curParams |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeMaterial(\'' + row.materialCode + '\')" ><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
// { |
|||
// field: 'typeMachine', |
|||
// title: '机种', |
|||
// formatter: (value, row, index) => { |
|||
// if (value === null) { |
|||
// return ""; |
|||
// } else { |
|||
// return value |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'planQuantity', |
|||
title: '计划数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '计划数量', |
|||
emptytext: '计划数量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
// { |
|||
// field: 'unitUsage', |
|||
// title: '单位用量', |
|||
// editable: { |
|||
// type: 'text', |
|||
// title: '单位用量', |
|||
// emptytext: '单位用量', |
|||
// validate: function (value) { |
|||
// |
|||
// } |
|||
// } |
|||
// }, |
|||
// { |
|||
// field: 'storageLocation', |
|||
// title: '存放位置', |
|||
// editable: { |
|||
// type: 'text', |
|||
// title: '存放位置', |
|||
// emptytext: '存放位置', |
|||
// validate: function (value) { |
|||
// |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
visible: false |
|||
}] |
|||
}) |
|||
}); |
|||
|
|||
//获取单号 |
|||
$.ajax({ |
|||
url: prefix + "/getBcpId", |
|||
type: "post", |
|||
dateType: "json", |
|||
success: function (resp) { |
|||
if (resp.code === 0) { |
|||
$("input[name='materialRequisitionNumber']").val(resp.data); |
|||
} else { |
|||
$.modal.msgError("失败啦"); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}); |
|||
|
|||
//获取领料人 |
|||
$.ajax({ |
|||
url: ctx + "system/user/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let userData = res.rows; |
|||
for (let i in userData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//工单号 |
|||
$.ajax({ |
|||
url: prefixWorkOrder + '/list', |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let orderData = res.rows; |
|||
for (let i in orderData) { |
|||
$("#form-materialRequisitionYL-add select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-add select[name='workOrderNumber']").change(function () { |
|||
var workOrderNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].workOrderNumber == workOrderNumber) { |
|||
$("#form-materialRequisitionYL-add input[name='salesOrderNumber']").val(orderData[i].salesOrderNumber); |
|||
$("#form-materialRequisitionYL-add input[name='finishProductCode']").val(orderData[i].finishProductCode); |
|||
$("#form-materialRequisitionYL-add input[name='typeMachine']").val(orderData[i].typeMachine); |
|||
$("#form-materialRequisitionYL-add input[name='workOrderQuantity']").val(orderData[i].orderQuantity); |
|||
showDetailMaterial(workOrderNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
|
|||
//获取仓库信息 |
|||
$.ajax({ |
|||
url: ctx + "stock/stockInfo/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let stockData = res.rows; |
|||
for (let i in stockData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
|||
$("#form-materialRequisitionYL-add select[name='stockName']").change(function () { |
|||
var stockName = $(this).val(); |
|||
for (let i=0;i<stockData.length;i++) { |
|||
if (stockData[i].stockname == stockName) { |
|||
$("#form-materialRequisitionYL-add input[name='stockNumber']").val(stockData[i].stockNO); |
|||
$("#form-materialRequisitionYL-add input[name='stockManager']").val(stockData[i].stockmanager); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
//获取部门信息 |
|||
$.ajax({ |
|||
url: ctx + "system/dept/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
console.log(res) |
|||
if (res.length > 0) { |
|||
let deptData = res; |
|||
for (let i in deptData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>"); |
|||
$("#form-materialRequisitionYL-add select[name='deptName']").change(function () { |
|||
var deptName = $(this).val(); |
|||
for (let i=0;i<deptData.length;i++) { |
|||
if (deptData[i].deptName == deptName) { |
|||
$("#form-materialRequisitionYL-add input[name='deptNumber']").val(deptData[i].deptNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//选择工单号显示表内订单信息 |
|||
function showDetailMaterial(workOrderNumber) { |
|||
$('#addMaterialTable').bootstrapTable("removeAll") |
|||
console.log(workOrderNumber) |
|||
$.ajax({ |
|||
url: ctx + 'manufacture/workOrderDetail/list', |
|||
type: 'post', |
|||
data: { |
|||
workOrderNumber: workOrderNumber, |
|||
materialType: '半成品' |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val(); |
|||
for (i = 0; i < data.length; i++) { |
|||
$("#addMaterialTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
materialRequisitionNumber: materialRequisitionNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
inventoryUnit: data[i].inventoryUnit, |
|||
planQuantity: data[i].materialConsumption, |
|||
description: '', |
|||
// unitUsage: '', |
|||
// storageLocation: '', |
|||
materialType: data[i].materialType |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmMaterial() { |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
let data = $('#addMaterialTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixMaterialPequisitionDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
|
|||
//添加表格内删除物料信息 |
|||
function removeMaterial(materialCode){ |
|||
var ids = []; |
|||
ids.push(materialCode); |
|||
$('#addMaterialTable').bootstrapTable("remove",{ |
|||
field:'materialCode', |
|||
values:ids |
|||
}) |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,658 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<style> |
|||
.other-container { |
|||
width: 90%; |
|||
height: 200px; |
|||
margin: auto; |
|||
} |
|||
.other { |
|||
margin-top: 20px; |
|||
} |
|||
h4 { |
|||
display: inline-block; |
|||
margin-right: 20px; |
|||
} |
|||
.modal-body{ |
|||
height: 550px; |
|||
} |
|||
iframe{ |
|||
width: 100%; |
|||
height: 500px; |
|||
frameborder: 0; |
|||
border: 0; |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-materialRequisitionYL-edit" th:object="${materialRequisitionInfo}"> |
|||
<input name="materialRequisitionId" th:field="*{materialRequisitionId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">领料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialRequisitionNumber" th:field="*{materialRequisitionNumber}" class="form-control" type="text" required readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单号码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" 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"> |
|||
<!-- <input name="workOrderNumber" th:field="*{workOrderNumber}" class="form-control" type="text">--> |
|||
<select name="workOrderNumber" class="form-control m-b" type="text" disabled> |
|||
<option value="">请选择工单号</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料部门:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <select name="deptName" class="form-control m-b" th:with="type=${@dict.getType('sys_dept_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deptName}"></option>--> |
|||
<!-- </select>--> |
|||
<select name="deptName" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料部门</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料人:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <input name="materialRequisitionPerson" th:field="*{materialRequisitionPerson}" class="form-control" type="text">--> |
|||
<select name="materialRequisitionPerson" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料人</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">部门编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deptNumber" th:field="*{deptNumber}" 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="stockName" class="form-control m-b"> |
|||
<option value="">请选择仓库名称</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="stockNumber" th:field="*{stockNumber}" 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="stockManager" th:field="*{stockManager}" 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="outputClass" class="form-control m-b" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{outputClass}"></option> |
|||
</select> |
|||
</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="outputDate" th:field="*{outputDate}" 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="finishProductCode" th:field="*{finishProductCode}" 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="typeMachine" th:field="*{typeMachine}" 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="workOrderQuantity" th:field="*{workOrderQuantity}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remarkContent" class="form-control" type="text"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料否:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="getMaterialFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{getMaterialFlag}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>物料信息</h4> |
|||
<!-- <a class="btn btn-primary" onclick="showMaterialModal()"><i class="fa fa-plus"></i> 选择信息</a>--> |
|||
<!-- <div style="width: 10%;display: inline-block;margin-left: 10px;">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}" style="margin-top: 10px;">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- <form class="form-horizontal m">--> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-3 control-label">物料类别:</label>--> |
|||
<!-- <div class="col-sm-3">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </form>--> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addMaterialTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="rawModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formRawMaterialSearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>原料代码:</label> |
|||
<input type="text" name="rawMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>原料名称:</label> |
|||
<input type="text" name="rawMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="rawTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addrowconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addRawToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeRawModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="subsidiaryModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formSubsidiarySearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>辅料代码:</label> |
|||
<input type="text" name="subsidiaryMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>辅料名称:</label> |
|||
<input type="text" name="subsidiaryMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
|
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="subsidiaryTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addsubsidiaryconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addSubsidiaryToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeSubsidiaryModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="productInfoModal" |
|||
role="dilog" aria-hidden="true"> |
|||
|
|||
<!-- 查询成品资料--> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-body"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="productFormId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>成品代码:</label> |
|||
<input type="text" name="finishProductCode"/> |
|||
</li> |
|||
<li> |
|||
<label>成品名称:</label> |
|||
<input type="text" name="finishProductName"/> |
|||
</li> |
|||
<li> |
|||
<label>客户代码:</label> |
|||
<input type="text" name="enterpriseCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="enterpriseName"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="productTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: select2-js"/> |
|||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|||
<script th:inline="javascript"> |
|||
var getData = [[${materialRequisitionInfo}]] |
|||
|
|||
var prefix = ctx + "manufacture/materialRequisitionInfo" |
|||
var prefixMaterialPequisitionDetail = ctx + "manufacture/materialRequisitionDetail" |
|||
var prefixWorkOrder = ctx + "manufacture/workOrderInfo" |
|||
|
|||
var materialCategoryDatas = [[${@dict.getType('sys_raw_material_category')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|||
var purchasingUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var limitWhetherDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var whetherSemiManufacturesDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var gpItemSelectionDatas = [[${@dict.getType('sys_gp_Item_selection')}]]; |
|||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]];; |
|||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|||
|
|||
$("#form-materialRequisitionYL-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
// if ($.validate.form()) { |
|||
// $.operate.save(prefix + "/edit", $('#form-materialRequisitionYL-edit').serialize()); |
|||
// } |
|||
let getData=$('#addMaterialTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0){ |
|||
//确认添加选中的物料数据 |
|||
confirmMaterial(); |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-materialRequisitionYL-edit').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请选择!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='outputDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
todayBtn: true |
|||
}); |
|||
|
|||
$(function() { |
|||
//初始化添加材料表 |
|||
$('#addMaterialTable').bootstrapTable({ |
|||
url: prefixMaterialPequisitionDetail + '/list', |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
method: "post", |
|||
contentType: "application/x-www-form-urlencoded", |
|||
striped: true, // 是否显示行间隔色 |
|||
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true, |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
uniqueId: 'materialCode', |
|||
queryParams: function (params) { |
|||
//console.log("123"); |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
materialRequisitionNumber: getData.materialRequisitionNumber |
|||
// enterpriseCode: data[0].enterpriseCode |
|||
|
|||
}; |
|||
// console.log(data[0].enterpriseCode) |
|||
return curParams |
|||
}, |
|||
columns: [ |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
// { |
|||
// field: 'typeMachine', |
|||
// title: '机种', |
|||
// formatter: (value, row, index) => { |
|||
// if (value === null) { |
|||
// return ""; |
|||
// } else { |
|||
// return value |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'planQuantity', |
|||
title: '计划数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '计划数量', |
|||
emptytext: '计划数量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
// { |
|||
// field: 'unitUsage', |
|||
// title: '单位用量', |
|||
// editable: { |
|||
// type: 'text', |
|||
// title: '单位用量', |
|||
// emptytext: '单位用量', |
|||
// validate: function (value) { |
|||
// |
|||
// } |
|||
// } |
|||
// }, |
|||
// { |
|||
// field: 'storageLocation', |
|||
// title: '存放位置', |
|||
// editable: { |
|||
// type: 'text', |
|||
// title: '存放位置', |
|||
// emptytext: '存放位置', |
|||
// validate: function (value) { |
|||
// |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
visible: false |
|||
}] |
|||
}) |
|||
}); |
|||
|
|||
//获取领料人 |
|||
$.ajax({ |
|||
url: ctx + "system/user/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let userData = res.rows; |
|||
for (let i in userData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-edit select[name='materialRequisitionPerson']").val(getData.materialRequisitionPerson).trigger("change") |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//工单号 |
|||
$.ajax({ |
|||
url: prefixWorkOrder + '/list', |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let orderData = res.rows; |
|||
for (let i in orderData) { |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").val(getData.workOrderNumber).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").change(function () { |
|||
var workOrderNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].workOrderNumber == workOrderNumber) { |
|||
$("#form-materialRequisitionYL-edit input[name='salesOrderNumber']").val(orderData[i].salesOrderNumber); |
|||
$("#form-materialRequisitionYL-edit input[name='finishProductCode']").val(orderData[i].finishProductCode); |
|||
$("#form-materialRequisitionYL-edit input[name='typeMachine']").val(orderData[i].typeMachine); |
|||
$("#form-materialRequisitionYL-edit input[name='workOrderQuantity']").val(orderData[i].orderQuantity); |
|||
showDetailMaterial(workOrderNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
|
|||
//获取仓库信息 |
|||
$.ajax({ |
|||
url: ctx + "stock/stockInfo/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let stockData = res.rows; |
|||
for (let i in stockData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").val(getData.stockName).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").change(function () { |
|||
var stockName = $(this).val(); |
|||
for (let i=0;i<stockData.length;i++) { |
|||
if (stockData[i].stockname == stockName) { |
|||
$("#form-materialRequisitionYL-edit input[name='stockNumber']").val(stockData[i].stockNO); |
|||
$("#form-materialRequisitionYL-edit input[name='stockManager']").val(stockData[i].stockmanager); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//获取部门信息 |
|||
$.ajax({ |
|||
url: ctx + "system/dept/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
console.log(res) |
|||
if (res.length > 0) { |
|||
let deptData = res; |
|||
for (let i in deptData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>"); |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").val(getData.deptName).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").change(function () { |
|||
var deptName = $(this).val(); |
|||
for (let i=0;i<deptData.length;i++) { |
|||
if (deptData[i].deptName == deptName) { |
|||
$("#form-materialRequisitionYL-edit input[name='deptNumber']").val(deptData[i].deptNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//选择工单号显示表内订单信息 |
|||
function showDetailMaterial(workOrderNumber) { |
|||
$('#addMaterialTable').bootstrapTable("removeAll") |
|||
console.log(workOrderNumber) |
|||
$.ajax({ |
|||
url: ctx + 'manufacture/workOrderDetail/list', |
|||
type: 'post', |
|||
data: { |
|||
workOrderNumber: workOrderNumber, |
|||
materialType: '原料' |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val(); |
|||
for (i = 0; i < data.length; i++) { |
|||
$("#addMaterialTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
materialRequisitionNumber: materialRequisitionNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
inventoryUnit: data[i].inventoryUnit, |
|||
planQuantity: data[i].materialConsumption, |
|||
description: '', |
|||
// unitUsage: '', |
|||
// storageLocation: '', |
|||
materialType: data[i].materialType |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmMaterial() { |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
let data = $('#addMaterialTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixMaterialPequisitionDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,291 @@ |
|||
<!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 :: datetimepicker-css"/> |
|||
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script> |
|||
</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="materialRequisitionNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>订单号码:</label> |
|||
<input type="text" name="salesOrderNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>制工单号:</label> |
|||
<input type="text" name="workOrderNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>领料部门:</label> |
|||
<select name="deptName" th:with="type=${@dict.getType('sys_dept_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>仓库名称:</label> |
|||
<select name="stockName"> |
|||
<option value="">所有</option> |
|||
<option value="-1">代码生成请选择字典属性</option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>出库类型:</label> |
|||
<select name="outputClass" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>出库日期:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginOutputDate]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endOutputDate]"/> |
|||
</li> |
|||
<li> |
|||
<label>领料否:</label> |
|||
<select name="getMaterialFlag" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="$.form.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="$.operate.add()" shiro:hasPermission="manufacture:materialRequisitionYL:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manufacture:materialRequisitionYL:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="manufacture:materialRequisitionYL:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="exportSelected()" shiro:hasPermission="manufacture:materialRequisitionYL:export"> |
|||
<i class="fa fa-download"></i> 导出 |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table" style="white-space: nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('manufacture:materialRequisitionYL:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('manufacture:materialRequisitionYL:remove')}]]; |
|||
var outputClassDatas = [[${@dict.getType('sys_out_type')}]]; |
|||
var getMaterialFlagDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var prefix = ctx + "manufacture/materialRequisitionInfo"; |
|||
var prefixMaterialRequisitionDetail = ctx + "manufacture/materialRequisitionDetail"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/listBcp", |
|||
createUrl: prefix + "/addBcp", |
|||
updateUrl: prefix + "/editBcp/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
clickToSelect: true, |
|||
modalName: "领料单", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionId', |
|||
title: '领料单id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号' |
|||
}, |
|||
{ |
|||
field: 'salesOrderNumber', |
|||
title: '订单号码' |
|||
}, |
|||
{ |
|||
field: 'workOrderNumber', |
|||
title: '制工单号' |
|||
}, |
|||
{ |
|||
field: 'deptName', |
|||
title: '领料部门' |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionPerson', |
|||
title: '领料人' |
|||
}, |
|||
{ |
|||
field: 'deptNumber', |
|||
title: '部门编号' |
|||
}, |
|||
{ |
|||
field: 'stockNumber', |
|||
title: '仓库编号' |
|||
}, |
|||
{ |
|||
field: 'stockName', |
|||
title: '仓库名称' |
|||
}, |
|||
{ |
|||
field: 'stockManager', |
|||
title: '仓库管理员' |
|||
}, |
|||
{ |
|||
field: 'outputClass', |
|||
title: '出库类型', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(outputClassDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'outputDate', |
|||
title: '出库日期' |
|||
}, |
|||
{ |
|||
field: 'finishProductCode', |
|||
title: '成品代码' |
|||
}, |
|||
{ |
|||
field: 'typeMachine', |
|||
title: '机种' |
|||
}, |
|||
{ |
|||
field: 'workOrderQuantity', |
|||
title: '工单数量' |
|||
}, |
|||
{ |
|||
field: 'remarkContent', |
|||
title: '备注内容' |
|||
}, |
|||
{ |
|||
field: 'getMaterialFlag', |
|||
title: '领料否', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(getMaterialFlagDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'firstAddTime', |
|||
title: '录入时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
return value; |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'updateInfoTime', |
|||
title: '上次修改时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
var vArr = value.split(',') |
|||
return vArr[0]; |
|||
} |
|||
} |
|||
}] |
|||
// { |
|||
// 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="$.operate.edit(\'' + row.materialRequisitionId + '\')"><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.materialRequisitionId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
// return actions.join(''); |
|||
// } |
|||
// } |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
//删除 |
|||
function removeSelected() { |
|||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|||
// console.log(rows) |
|||
if (rows.length > 0) { |
|||
$.modal.confirm("是否删除选中的"+ rows.length +"条半成品领料单?", function () { |
|||
$.ajax({ |
|||
url: prefix + '/removeSelected', |
|||
type: 'post', |
|||
data: { |
|||
ids : rows.join() |
|||
}, |
|||
success: function (res) { |
|||
// console.log(res) |
|||
$("#bootstrap-table").bootstrapTable("refresh"); |
|||
$.modal.msgSuccess("删除成功!") |
|||
}, |
|||
error: function (res) { |
|||
$.modal.msgError(res.error()) |
|||
} |
|||
}) |
|||
}) |
|||
} else { |
|||
$.modal.msgWarning("请选择一条数据") |
|||
} |
|||
} |
|||
|
|||
//导出 |
|||
function exportSelected() { |
|||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|||
var data = $("#bootstrap-table").bootstrapTable("getSelections") |
|||
|
|||
if (rows.length !== 1) { |
|||
$.modal.alert("请选择一条记录"); |
|||
return; |
|||
} else { |
|||
// rows为选中行的id |
|||
// console.log(rows); |
|||
// console.log(data); |
|||
// console.log(data[0].orderNumber) |
|||
$.modal.confirm("是否确认要导出本条领料单?", function (){ |
|||
axios({ |
|||
url: prefix + '/exportSelected/'+data[0].materialRequisitionId, |
|||
method: 'POST', |
|||
responseType: 'blob' |
|||
}).then(response => { |
|||
// console.log(response) |
|||
const URL = window.URL.createObjectURL(response.data) |
|||
// 创建隐藏<a>标签进行下载 |
|||
const tempLink = document.createElement('a') |
|||
tempLink.style.display = 'none' |
|||
tempLink.href = URL |
|||
let time = new Date().toLocaleString() |
|||
tempLink.setAttribute('download', time + "半成品领料单.xlsx") |
|||
if (typeof tempLink.download === 'undefined') { |
|||
tempLink.setAttribute('target', '_blank') |
|||
} |
|||
document.body.appendChild(tempLink) |
|||
tempLink.click() |
|||
document.body.removeChild(tempLink)// 移除dom元素 |
|||
window.URL.revokeObjectURL(URL)//释放内存 |
|||
}) |
|||
}); |
|||
|
|||
|
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,683 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<style> |
|||
.other-container { |
|||
width: 90%; |
|||
height: 200px; |
|||
margin: auto; |
|||
} |
|||
.other { |
|||
margin-top: 20px; |
|||
} |
|||
h4 { |
|||
display: inline-block; |
|||
margin-right: 20px; |
|||
} |
|||
.modal-body{ |
|||
height: 550px; |
|||
} |
|||
iframe{ |
|||
width: 100%; |
|||
height: 500px; |
|||
frameborder: 0; |
|||
border: 0; |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-materialRequisitionYL-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">领料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialRequisitionNumber" class="form-control" type="text" required readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单号码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" 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="workOrderNumber" class="form-control" type="text">--> |
|||
<select name="workOrderNumber" class="form-control m-b" type="text"> |
|||
<option value="">请选择工单号</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料部门:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <select name="deptName" class="form-control m-b" th:with="type=${@dict.getType('sys_dept_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<select name="deptName" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料部门</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料人:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <input name="materialRequisitionPerson" class="form-control" type="text">--> |
|||
<select name="materialRequisitionPerson" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料人</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">部门编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deptNumber" 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="stockName" class="form-control m-b"> |
|||
<option value="">请选择仓库名称</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="stockNumber" 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="stockManager" 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="outputClass" class="form-control m-b" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="outputDate" 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="finishProductCode" 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="typeMachine" 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="workOrderQuantity" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remarkContent" class="form-control" type="text"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hidden"> |
|||
<label class="col-sm-3 control-label">领料否:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="getMaterialFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
|
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>物料信息</h4> |
|||
<!-- <a class="btn btn-primary" onclick="showMaterialModal()"><i class="fa fa-plus"></i> 选择信息</a>--> |
|||
<!-- <div style="width: 10%;display: inline-block;margin-left: 10px;">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}" style="margin-top: 10px;">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- <form class="form-horizontal m">--> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-3 control-label">物料类别:</label>--> |
|||
<!-- <div class="col-sm-3">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </form>--> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addMaterialTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="rawModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formRawMaterialSearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>原料代码:</label> |
|||
<input type="text" name="rawMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>原料名称:</label> |
|||
<input type="text" name="rawMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="rawTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addrowconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addRawToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeRawModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="subsidiaryModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formSubsidiarySearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>辅料代码:</label> |
|||
<input type="text" name="subsidiaryMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>辅料名称:</label> |
|||
<input type="text" name="subsidiaryMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
|
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="subsidiaryTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addsubsidiaryconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addSubsidiaryToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeSubsidiaryModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="productInfoModal" |
|||
role="dilog" aria-hidden="true"> |
|||
|
|||
<!-- 查询成品资料--> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-body"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="productFormId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>成品代码:</label> |
|||
<input type="text" name="finishProductCode"/> |
|||
</li> |
|||
<li> |
|||
<label>成品名称:</label> |
|||
<input type="text" name="finishProductName"/> |
|||
</li> |
|||
<li> |
|||
<label>客户代码:</label> |
|||
<input type="text" name="enterpriseCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="enterpriseName"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="productTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: select2-js"/> |
|||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "manufacture/materialRequisitionInfo" |
|||
var prefixMaterialPequisitionDetail = ctx + "manufacture/materialRequisitionDetail" |
|||
var prefixWorkOrder = ctx + "manufacture/workOrderInfo" |
|||
|
|||
var materialCategoryDatas = [[${@dict.getType('sys_raw_material_category')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|||
var purchasingUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var limitWhetherDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var whetherSemiManufacturesDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var gpItemSelectionDatas = [[${@dict.getType('sys_gp_Item_selection')}]]; |
|||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]];; |
|||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|||
|
|||
$("#form-materialRequisitionYL-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
// if ($.validate.form()) { |
|||
// $.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize()); |
|||
// } |
|||
let getData=$('#addMaterialTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0){ |
|||
//确认添加选中的物料数据 |
|||
confirmMaterial(); |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请选择!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='outputDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
todayBtn: true |
|||
}); |
|||
$("input[name='outputDate']").datetimepicker("setDate",new Date()) |
|||
|
|||
$(function() { |
|||
//初始化添加材料表 |
|||
$('#addMaterialTable').bootstrapTable({ |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true,//点击行选中 |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
uniqueId: 'materialCode', |
|||
queryParams: function (params) { |
|||
//console.log("123"); |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
// enterpriseCode: data[0].enterpriseCode |
|||
|
|||
}; |
|||
// console.log(data[0].enterpriseCode) |
|||
return curParams |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeMaterial(\'' + row.materialCode + '\')" ><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
// { |
|||
// field: 'typeMachine', |
|||
// title: '机种', |
|||
// formatter: (value, row, index) => { |
|||
// if (value === null) { |
|||
// return ""; |
|||
// } else { |
|||
// return value |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'planQuantity', |
|||
title: '计划数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '计划数量', |
|||
emptytext: '计划数量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
// { |
|||
// field: 'unitUsage', |
|||
// title: '单位用量', |
|||
// editable: { |
|||
// type: 'text', |
|||
// title: '单位用量', |
|||
// emptytext: '单位用量', |
|||
// validate: function (value) { |
|||
// |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'storageLocation', |
|||
title: '存放位置', |
|||
editable: { |
|||
type: 'text', |
|||
title: '存放位置', |
|||
emptytext: '存放位置', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
visible: false |
|||
}] |
|||
}) |
|||
}); |
|||
|
|||
//获取单号 |
|||
$.ajax({ |
|||
url: prefix + "/getSubsidiaryId", |
|||
type: "post", |
|||
dateType: "json", |
|||
success: function (resp) { |
|||
if (resp.code === 0) { |
|||
$("input[name='materialRequisitionNumber']").val(resp.data); |
|||
} else { |
|||
$.modal.msgError("失败啦"); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}); |
|||
|
|||
//获取领料人 |
|||
$.ajax({ |
|||
url: ctx + "system/user/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let userData = res.rows; |
|||
for (let i in userData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//工单号 |
|||
$.ajax({ |
|||
url: prefixWorkOrder + '/list', |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let orderData = res.rows; |
|||
for (let i in orderData) { |
|||
$("#form-materialRequisitionYL-add select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-add select[name='workOrderNumber']").change(function () { |
|||
var workOrderNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].workOrderNumber == workOrderNumber) { |
|||
$("#form-materialRequisitionYL-add input[name='salesOrderNumber']").val(orderData[i].salesOrderNumber); |
|||
$("#form-materialRequisitionYL-add input[name='finishProductCode']").val(orderData[i].finishProductCode); |
|||
$("#form-materialRequisitionYL-add input[name='typeMachine']").val(orderData[i].typeMachine); |
|||
$("#form-materialRequisitionYL-add input[name='workOrderQuantity']").val(orderData[i].orderQuantity); |
|||
showDetailMaterial(workOrderNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
|
|||
//获取仓库信息 |
|||
$.ajax({ |
|||
url: ctx + "stock/stockInfo/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let stockData = res.rows; |
|||
for (let i in stockData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
|||
$("#form-materialRequisitionYL-add select[name='stockName']").change(function () { |
|||
var stockName = $(this).val(); |
|||
for (let i=0;i<stockData.length;i++) { |
|||
if (stockData[i].stockname == stockName) { |
|||
$("#form-materialRequisitionYL-add input[name='stockNumber']").val(stockData[i].stockNO); |
|||
$("#form-materialRequisitionYL-add input[name='stockManager']").val(stockData[i].stockmanager); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
//获取部门信息 |
|||
$.ajax({ |
|||
url: ctx + "system/dept/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
console.log(res) |
|||
if (res.length > 0) { |
|||
let deptData = res; |
|||
for (let i in deptData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>"); |
|||
$("#form-materialRequisitionYL-add select[name='deptName']").change(function () { |
|||
var deptName = $(this).val(); |
|||
for (let i=0;i<deptData.length;i++) { |
|||
if (deptData[i].deptName == deptName) { |
|||
$("#form-materialRequisitionYL-add input[name='deptNumber']").val(deptData[i].deptNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//选择工单号显示表内订单信息 |
|||
function showDetailMaterial(workOrderNumber) { |
|||
$('#addMaterialTable').bootstrapTable("removeAll") |
|||
console.log(workOrderNumber) |
|||
$.ajax({ |
|||
url: ctx + 'manufacture/workOrderDetail/list', |
|||
type: 'post', |
|||
data: { |
|||
workOrderNumber: workOrderNumber, |
|||
materialType: '辅料' |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val(); |
|||
for (i = 0; i < data.length; i++) { |
|||
$("#addMaterialTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
materialRequisitionNumber: materialRequisitionNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
inventoryUnit: data[i].inventoryUnit, |
|||
planQuantity: data[i].materialConsumption, |
|||
description: '', |
|||
// unitUsage: '', |
|||
storageLocation: '', |
|||
materialType: data[i].materialType |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmMaterial() { |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
let data = $('#addMaterialTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixMaterialPequisitionDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
|
|||
//添加表格内删除物料信息 |
|||
function removeMaterial(materialCode){ |
|||
var ids = []; |
|||
ids.push(materialCode); |
|||
$('#addMaterialTable').bootstrapTable("remove",{ |
|||
field:'materialCode', |
|||
values:ids |
|||
}) |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,658 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<style> |
|||
.other-container { |
|||
width: 90%; |
|||
height: 200px; |
|||
margin: auto; |
|||
} |
|||
.other { |
|||
margin-top: 20px; |
|||
} |
|||
h4 { |
|||
display: inline-block; |
|||
margin-right: 20px; |
|||
} |
|||
.modal-body{ |
|||
height: 550px; |
|||
} |
|||
iframe{ |
|||
width: 100%; |
|||
height: 500px; |
|||
frameborder: 0; |
|||
border: 0; |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-materialRequisitionYL-edit" th:object="${materialRequisitionInfo}"> |
|||
<input name="materialRequisitionId" th:field="*{materialRequisitionId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">领料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialRequisitionNumber" th:field="*{materialRequisitionNumber}" class="form-control" type="text" required readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单号码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" 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"> |
|||
<!-- <input name="workOrderNumber" th:field="*{workOrderNumber}" class="form-control" type="text">--> |
|||
<select name="workOrderNumber" class="form-control m-b" type="text" disabled> |
|||
<option value="">请选择工单号</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料部门:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <select name="deptName" class="form-control m-b" th:with="type=${@dict.getType('sys_dept_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deptName}"></option>--> |
|||
<!-- </select>--> |
|||
<select name="deptName" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料部门</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料人:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <input name="materialRequisitionPerson" th:field="*{materialRequisitionPerson}" class="form-control" type="text">--> |
|||
<select name="materialRequisitionPerson" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料人</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">部门编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deptNumber" th:field="*{deptNumber}" 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="stockName" class="form-control m-b"> |
|||
<option value="">请选择仓库名称</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="stockNumber" th:field="*{stockNumber}" 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="stockManager" th:field="*{stockManager}" 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="outputClass" class="form-control m-b" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{outputClass}"></option> |
|||
</select> |
|||
</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="outputDate" th:field="*{outputDate}" 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="finishProductCode" th:field="*{finishProductCode}" 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="typeMachine" th:field="*{typeMachine}" 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="workOrderQuantity" th:field="*{workOrderQuantity}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remarkContent" class="form-control" type="text"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料否:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="getMaterialFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{getMaterialFlag}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>物料信息</h4> |
|||
<!-- <a class="btn btn-primary" onclick="showMaterialModal()"><i class="fa fa-plus"></i> 选择信息</a>--> |
|||
<!-- <div style="width: 10%;display: inline-block;margin-left: 10px;">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}" style="margin-top: 10px;">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- <form class="form-horizontal m">--> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-3 control-label">物料类别:</label>--> |
|||
<!-- <div class="col-sm-3">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </form>--> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addMaterialTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="rawModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formRawMaterialSearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>原料代码:</label> |
|||
<input type="text" name="rawMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>原料名称:</label> |
|||
<input type="text" name="rawMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="rawTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addrowconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addRawToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeRawModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="subsidiaryModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formSubsidiarySearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>辅料代码:</label> |
|||
<input type="text" name="subsidiaryMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>辅料名称:</label> |
|||
<input type="text" name="subsidiaryMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
|
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="subsidiaryTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addsubsidiaryconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addSubsidiaryToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeSubsidiaryModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="productInfoModal" |
|||
role="dilog" aria-hidden="true"> |
|||
|
|||
<!-- 查询成品资料--> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-body"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="productFormId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>成品代码:</label> |
|||
<input type="text" name="finishProductCode"/> |
|||
</li> |
|||
<li> |
|||
<label>成品名称:</label> |
|||
<input type="text" name="finishProductName"/> |
|||
</li> |
|||
<li> |
|||
<label>客户代码:</label> |
|||
<input type="text" name="enterpriseCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="enterpriseName"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="productTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: select2-js"/> |
|||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|||
<script th:inline="javascript"> |
|||
var getData = [[${materialRequisitionInfo}]] |
|||
|
|||
var prefix = ctx + "manufacture/materialRequisitionInfo" |
|||
var prefixMaterialPequisitionDetail = ctx + "manufacture/materialRequisitionDetail" |
|||
var prefixWorkOrder = ctx + "manufacture/workOrderInfo" |
|||
|
|||
var materialCategoryDatas = [[${@dict.getType('sys_raw_material_category')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|||
var purchasingUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var limitWhetherDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var whetherSemiManufacturesDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var gpItemSelectionDatas = [[${@dict.getType('sys_gp_Item_selection')}]]; |
|||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]];; |
|||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|||
|
|||
$("#form-materialRequisitionYL-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
// if ($.validate.form()) { |
|||
// $.operate.save(prefix + "/edit", $('#form-materialRequisitionYL-edit').serialize()); |
|||
// } |
|||
let getData=$('#addMaterialTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0){ |
|||
//确认添加选中的物料数据 |
|||
confirmMaterial(); |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-materialRequisitionYL-edit').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请选择!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='outputDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
todayBtn: true |
|||
}); |
|||
|
|||
$(function() { |
|||
//初始化添加材料表 |
|||
$('#addMaterialTable').bootstrapTable({ |
|||
url: prefixMaterialPequisitionDetail + '/list', |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
method: "post", |
|||
contentType: "application/x-www-form-urlencoded", |
|||
striped: true, // 是否显示行间隔色 |
|||
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true, |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
uniqueId: 'materialCode', |
|||
queryParams: function (params) { |
|||
//console.log("123"); |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
materialRequisitionNumber: getData.materialRequisitionNumber |
|||
// enterpriseCode: data[0].enterpriseCode |
|||
|
|||
}; |
|||
// console.log(data[0].enterpriseCode) |
|||
return curParams |
|||
}, |
|||
columns: [ |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
// { |
|||
// field: 'typeMachine', |
|||
// title: '机种', |
|||
// formatter: (value, row, index) => { |
|||
// if (value === null) { |
|||
// return ""; |
|||
// } else { |
|||
// return value |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'planQuantity', |
|||
title: '计划数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '计划数量', |
|||
emptytext: '计划数量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
// { |
|||
// field: 'unitUsage', |
|||
// title: '单位用量', |
|||
// editable: { |
|||
// type: 'text', |
|||
// title: '单位用量', |
|||
// emptytext: '单位用量', |
|||
// validate: function (value) { |
|||
// |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'storageLocation', |
|||
title: '存放位置', |
|||
editable: { |
|||
type: 'text', |
|||
title: '存放位置', |
|||
emptytext: '存放位置', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
visible: false |
|||
}] |
|||
}) |
|||
}); |
|||
|
|||
//获取领料人 |
|||
$.ajax({ |
|||
url: ctx + "system/user/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let userData = res.rows; |
|||
for (let i in userData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-edit select[name='materialRequisitionPerson']").val(getData.materialRequisitionPerson).trigger("change") |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//工单号 |
|||
$.ajax({ |
|||
url: prefixWorkOrder + '/list', |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let orderData = res.rows; |
|||
for (let i in orderData) { |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").val(getData.workOrderNumber).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").change(function () { |
|||
var workOrderNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].workOrderNumber == workOrderNumber) { |
|||
$("#form-materialRequisitionYL-edit input[name='salesOrderNumber']").val(orderData[i].salesOrderNumber); |
|||
$("#form-materialRequisitionYL-edit input[name='finishProductCode']").val(orderData[i].finishProductCode); |
|||
$("#form-materialRequisitionYL-edit input[name='typeMachine']").val(orderData[i].typeMachine); |
|||
$("#form-materialRequisitionYL-edit input[name='workOrderQuantity']").val(orderData[i].orderQuantity); |
|||
showDetailMaterial(workOrderNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
|
|||
//获取仓库信息 |
|||
$.ajax({ |
|||
url: ctx + "stock/stockInfo/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let stockData = res.rows; |
|||
for (let i in stockData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").val(getData.stockName).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").change(function () { |
|||
var stockName = $(this).val(); |
|||
for (let i=0;i<stockData.length;i++) { |
|||
if (stockData[i].stockname == stockName) { |
|||
$("#form-materialRequisitionYL-edit input[name='stockNumber']").val(stockData[i].stockNO); |
|||
$("#form-materialRequisitionYL-edit input[name='stockManager']").val(stockData[i].stockmanager); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//获取部门信息 |
|||
$.ajax({ |
|||
url: ctx + "system/dept/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
console.log(res) |
|||
if (res.length > 0) { |
|||
let deptData = res; |
|||
for (let i in deptData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>"); |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").val(getData.deptName).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").change(function () { |
|||
var deptName = $(this).val(); |
|||
for (let i=0;i<deptData.length;i++) { |
|||
if (deptData[i].deptName == deptName) { |
|||
$("#form-materialRequisitionYL-edit input[name='deptNumber']").val(deptData[i].deptNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//选择工单号显示表内订单信息 |
|||
function showDetailMaterial(workOrderNumber) { |
|||
$('#addMaterialTable').bootstrapTable("removeAll") |
|||
console.log(workOrderNumber) |
|||
$.ajax({ |
|||
url: ctx + 'manufacture/workOrderDetail/list', |
|||
type: 'post', |
|||
data: { |
|||
workOrderNumber: workOrderNumber, |
|||
materialType: '原料' |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val(); |
|||
for (i = 0; i < data.length; i++) { |
|||
$("#addMaterialTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
materialRequisitionNumber: materialRequisitionNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
inventoryUnit: data[i].inventoryUnit, |
|||
planQuantity: data[i].materialConsumption, |
|||
description: '', |
|||
// unitUsage: '', |
|||
storageLocation: '', |
|||
materialType: data[i].materialType |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmMaterial() { |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
let data = $('#addMaterialTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixMaterialPequisitionDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,291 @@ |
|||
<!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 :: datetimepicker-css"/> |
|||
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script> |
|||
</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="materialRequisitionNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>订单号码:</label> |
|||
<input type="text" name="salesOrderNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>制工单号:</label> |
|||
<input type="text" name="workOrderNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>领料部门:</label> |
|||
<select name="deptName" th:with="type=${@dict.getType('sys_dept_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>仓库名称:</label> |
|||
<select name="stockName"> |
|||
<option value="">所有</option> |
|||
<option value="-1">代码生成请选择字典属性</option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>出库类型:</label> |
|||
<select name="outputClass" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>出库日期:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginOutputDate]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endOutputDate]"/> |
|||
</li> |
|||
<li> |
|||
<label>领料否:</label> |
|||
<select name="getMaterialFlag" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="$.form.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="$.operate.add()" shiro:hasPermission="manufacture:materialRequisitionYL:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manufacture:materialRequisitionYL:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="manufacture:materialRequisitionYL:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="exportSelected()" shiro:hasPermission="manufacture:materialRequisitionYL:export"> |
|||
<i class="fa fa-download"></i> 导出 |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table" style="white-space: nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('manufacture:materialRequisitionYL:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('manufacture:materialRequisitionYL:remove')}]]; |
|||
var outputClassDatas = [[${@dict.getType('sys_out_type')}]]; |
|||
var getMaterialFlagDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var prefix = ctx + "manufacture/materialRequisitionInfo"; |
|||
var prefixMaterialRequisitionDetail = ctx + "manufacture/materialRequisitionDetail"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/listSubsidiary", |
|||
createUrl: prefix + "/addSubsidiary", |
|||
updateUrl: prefix + "/editSubsidiary/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
clickToSelect: true, |
|||
modalName: "领料单", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionId', |
|||
title: '领料单id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号' |
|||
}, |
|||
{ |
|||
field: 'salesOrderNumber', |
|||
title: '订单号码' |
|||
}, |
|||
{ |
|||
field: 'workOrderNumber', |
|||
title: '制工单号' |
|||
}, |
|||
{ |
|||
field: 'deptName', |
|||
title: '领料部门' |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionPerson', |
|||
title: '领料人' |
|||
}, |
|||
{ |
|||
field: 'deptNumber', |
|||
title: '部门编号' |
|||
}, |
|||
{ |
|||
field: 'stockNumber', |
|||
title: '仓库编号' |
|||
}, |
|||
{ |
|||
field: 'stockName', |
|||
title: '仓库名称' |
|||
}, |
|||
{ |
|||
field: 'stockManager', |
|||
title: '仓库管理员' |
|||
}, |
|||
{ |
|||
field: 'outputClass', |
|||
title: '出库类型', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(outputClassDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'outputDate', |
|||
title: '出库日期' |
|||
}, |
|||
{ |
|||
field: 'finishProductCode', |
|||
title: '成品代码' |
|||
}, |
|||
{ |
|||
field: 'typeMachine', |
|||
title: '机种' |
|||
}, |
|||
{ |
|||
field: 'workOrderQuantity', |
|||
title: '工单数量' |
|||
}, |
|||
{ |
|||
field: 'remarkContent', |
|||
title: '备注内容' |
|||
}, |
|||
{ |
|||
field: 'getMaterialFlag', |
|||
title: '领料否', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(getMaterialFlagDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'firstAddTime', |
|||
title: '录入时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
return value; |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'updateInfoTime', |
|||
title: '上次修改时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
var vArr = value.split(',') |
|||
return vArr[0]; |
|||
} |
|||
} |
|||
}] |
|||
// { |
|||
// 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="$.operate.edit(\'' + row.materialRequisitionId + '\')"><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.materialRequisitionId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
// return actions.join(''); |
|||
// } |
|||
// } |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
//删除 |
|||
function removeSelected() { |
|||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|||
// console.log(rows) |
|||
if (rows.length > 0) { |
|||
$.modal.confirm("是否删除选中的"+ rows.length +"条辅料领料单?", function () { |
|||
$.ajax({ |
|||
url: prefix + '/removeSelected', |
|||
type: 'post', |
|||
data: { |
|||
ids : rows.join() |
|||
}, |
|||
success: function (res) { |
|||
// console.log(res) |
|||
$("#bootstrap-table").bootstrapTable("refresh"); |
|||
$.modal.msgSuccess("删除成功!") |
|||
}, |
|||
error: function (res) { |
|||
$.modal.msgError(res.error()) |
|||
} |
|||
}) |
|||
}) |
|||
} else { |
|||
$.modal.msgWarning("请选择一条数据") |
|||
} |
|||
} |
|||
|
|||
//导出 |
|||
function exportSelected() { |
|||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|||
var data = $("#bootstrap-table").bootstrapTable("getSelections") |
|||
|
|||
if (rows.length !== 1) { |
|||
$.modal.alert("请选择一条记录"); |
|||
return; |
|||
} else { |
|||
// rows为选中行的id |
|||
// console.log(rows); |
|||
// console.log(data); |
|||
// console.log(data[0].orderNumber) |
|||
$.modal.confirm("是否确认要导出本条领料单?", function (){ |
|||
axios({ |
|||
url: prefix + '/exportSelected/'+data[0].materialRequisitionId, |
|||
method: 'POST', |
|||
responseType: 'blob' |
|||
}).then(response => { |
|||
// console.log(response) |
|||
const URL = window.URL.createObjectURL(response.data) |
|||
// 创建隐藏<a>标签进行下载 |
|||
const tempLink = document.createElement('a') |
|||
tempLink.style.display = 'none' |
|||
tempLink.href = URL |
|||
let time = new Date().toLocaleString() |
|||
tempLink.setAttribute('download', time + "辅料领料单.xlsx") |
|||
if (typeof tempLink.download === 'undefined') { |
|||
tempLink.setAttribute('target', '_blank') |
|||
} |
|||
document.body.appendChild(tempLink) |
|||
tempLink.click() |
|||
document.body.removeChild(tempLink)// 移除dom元素 |
|||
window.URL.revokeObjectURL(URL)//释放内存 |
|||
}) |
|||
}); |
|||
|
|||
|
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,683 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<style> |
|||
.other-container { |
|||
width: 90%; |
|||
height: 200px; |
|||
margin: auto; |
|||
} |
|||
.other { |
|||
margin-top: 20px; |
|||
} |
|||
h4 { |
|||
display: inline-block; |
|||
margin-right: 20px; |
|||
} |
|||
.modal-body{ |
|||
height: 550px; |
|||
} |
|||
iframe{ |
|||
width: 100%; |
|||
height: 500px; |
|||
frameborder: 0; |
|||
border: 0; |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-materialRequisitionYL-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">领料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialRequisitionNumber" class="form-control" type="text" required readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单号码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" 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="workOrderNumber" class="form-control" type="text">--> |
|||
<select name="workOrderNumber" class="form-control m-b" type="text"> |
|||
<option value="">请选择工单号</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料部门:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <select name="deptName" class="form-control m-b" th:with="type=${@dict.getType('sys_dept_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<select name="deptName" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料部门</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料人:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <input name="materialRequisitionPerson" class="form-control" type="text">--> |
|||
<select name="materialRequisitionPerson" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料人</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">部门编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deptNumber" 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="stockName" class="form-control m-b"> |
|||
<option value="">请选择仓库名称</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="stockNumber" 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="stockManager" 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="outputClass" class="form-control m-b" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="outputDate" 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="finishProductCode" 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="typeMachine" 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="workOrderQuantity" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remarkContent" class="form-control" type="text"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group hidden"> |
|||
<label class="col-sm-3 control-label">领料否:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="getMaterialFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
|
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>物料信息</h4> |
|||
<!-- <a class="btn btn-primary" onclick="showMaterialModal()"><i class="fa fa-plus"></i> 选择信息</a>--> |
|||
<!-- <div style="width: 10%;display: inline-block;margin-left: 10px;">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}" style="margin-top: 10px;">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- <form class="form-horizontal m">--> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-3 control-label">物料类别:</label>--> |
|||
<!-- <div class="col-sm-3">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </form>--> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addMaterialTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="rawModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formRawMaterialSearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>原料代码:</label> |
|||
<input type="text" name="rawMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>原料名称:</label> |
|||
<input type="text" name="rawMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="rawTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addrowconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addRawToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeRawModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="subsidiaryModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formSubsidiarySearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>辅料代码:</label> |
|||
<input type="text" name="subsidiaryMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>辅料名称:</label> |
|||
<input type="text" name="subsidiaryMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
|
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="subsidiaryTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addsubsidiaryconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addSubsidiaryToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeSubsidiaryModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="productInfoModal" |
|||
role="dilog" aria-hidden="true"> |
|||
|
|||
<!-- 查询成品资料--> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-body"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="productFormId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>成品代码:</label> |
|||
<input type="text" name="finishProductCode"/> |
|||
</li> |
|||
<li> |
|||
<label>成品名称:</label> |
|||
<input type="text" name="finishProductName"/> |
|||
</li> |
|||
<li> |
|||
<label>客户代码:</label> |
|||
<input type="text" name="enterpriseCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="enterpriseName"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="productTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: select2-js"/> |
|||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "manufacture/materialRequisitionInfo" |
|||
var prefixMaterialPequisitionDetail = ctx + "manufacture/materialRequisitionDetail" |
|||
var prefixWorkOrder = ctx + "manufacture/workOrderInfo" |
|||
|
|||
var materialCategoryDatas = [[${@dict.getType('sys_raw_material_category')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|||
var purchasingUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var limitWhetherDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var whetherSemiManufacturesDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var gpItemSelectionDatas = [[${@dict.getType('sys_gp_Item_selection')}]]; |
|||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]];; |
|||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|||
|
|||
$("#form-materialRequisitionYL-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
// if ($.validate.form()) { |
|||
// $.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize()); |
|||
// } |
|||
let getData=$('#addMaterialTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0){ |
|||
//确认添加选中的物料数据 |
|||
confirmMaterial(); |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请选择!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='outputDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
todayBtn: true |
|||
}); |
|||
$("input[name='outputDate']").datetimepicker("setDate",new Date()) |
|||
|
|||
$(function() { |
|||
//初始化添加材料表 |
|||
$('#addMaterialTable').bootstrapTable({ |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true,//点击行选中 |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
uniqueId: 'materialCode', |
|||
queryParams: function (params) { |
|||
//console.log("123"); |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
// enterpriseCode: data[0].enterpriseCode |
|||
|
|||
}; |
|||
// console.log(data[0].enterpriseCode) |
|||
return curParams |
|||
}, |
|||
columns: [ |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function (value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeMaterial(\'' + row.materialCode + '\')" ><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
// { |
|||
// field: 'typeMachine', |
|||
// title: '机种', |
|||
// formatter: (value, row, index) => { |
|||
// if (value === null) { |
|||
// return ""; |
|||
// } else { |
|||
// return value |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'planQuantity', |
|||
title: '计划数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '计划数量', |
|||
emptytext: '计划数量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unitUsage', |
|||
title: '单位用量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '单位用量', |
|||
emptytext: '单位用量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'storageLocation', |
|||
title: '存放位置', |
|||
editable: { |
|||
type: 'text', |
|||
title: '存放位置', |
|||
emptytext: '存放位置', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
visible: false |
|||
}] |
|||
}) |
|||
}); |
|||
|
|||
//获取单号 |
|||
$.ajax({ |
|||
url: prefix + "/getRawId", |
|||
type: "post", |
|||
dateType: "json", |
|||
success: function (resp) { |
|||
if (resp.code === 0) { |
|||
$("input[name='materialRequisitionNumber']").val(resp.data); |
|||
} else { |
|||
$.modal.msgError("失败啦"); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}); |
|||
|
|||
//获取领料人 |
|||
$.ajax({ |
|||
url: ctx + "system/user/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let userData = res.rows; |
|||
for (let i in userData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//工单号 |
|||
$.ajax({ |
|||
url: prefixWorkOrder + '/list', |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let orderData = res.rows; |
|||
for (let i in orderData) { |
|||
$("#form-materialRequisitionYL-add select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-add select[name='workOrderNumber']").change(function () { |
|||
var workOrderNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].workOrderNumber == workOrderNumber) { |
|||
$("#form-materialRequisitionYL-add input[name='salesOrderNumber']").val(orderData[i].salesOrderNumber); |
|||
$("#form-materialRequisitionYL-add input[name='finishProductCode']").val(orderData[i].finishProductCode); |
|||
$("#form-materialRequisitionYL-add input[name='typeMachine']").val(orderData[i].typeMachine); |
|||
$("#form-materialRequisitionYL-add input[name='workOrderQuantity']").val(orderData[i].orderQuantity); |
|||
showDetailMaterial(workOrderNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
|
|||
//获取仓库信息 |
|||
$.ajax({ |
|||
url: ctx + "stock/stockInfo/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let stockData = res.rows; |
|||
for (let i in stockData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
|||
$("#form-materialRequisitionYL-add select[name='stockName']").change(function () { |
|||
var stockName = $(this).val(); |
|||
for (let i=0;i<stockData.length;i++) { |
|||
if (stockData[i].stockname == stockName) { |
|||
$("#form-materialRequisitionYL-add input[name='stockNumber']").val(stockData[i].stockNO); |
|||
$("#form-materialRequisitionYL-add input[name='stockManager']").val(stockData[i].stockmanager); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
//获取部门信息 |
|||
$.ajax({ |
|||
url: ctx + "system/dept/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
console.log(res) |
|||
if (res.length > 0) { |
|||
let deptData = res; |
|||
for (let i in deptData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-add select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>"); |
|||
$("#form-materialRequisitionYL-add select[name='deptName']").change(function () { |
|||
var deptName = $(this).val(); |
|||
for (let i=0;i<deptData.length;i++) { |
|||
if (deptData[i].deptName == deptName) { |
|||
$("#form-materialRequisitionYL-add input[name='deptNumber']").val(deptData[i].deptNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//选择工单号显示表内订单信息 |
|||
function showDetailMaterial(workOrderNumber) { |
|||
$('#addMaterialTable').bootstrapTable("removeAll") |
|||
console.log(workOrderNumber) |
|||
$.ajax({ |
|||
url: ctx + 'manufacture/workOrderDetail/list', |
|||
type: 'post', |
|||
data: { |
|||
workOrderNumber: workOrderNumber, |
|||
materialType: '原料' |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val(); |
|||
for (i = 0; i < data.length; i++) { |
|||
$("#addMaterialTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
materialRequisitionNumber: materialRequisitionNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
inventoryUnit: data[i].inventoryUnit, |
|||
planQuantity: data[i].materialConsumption, |
|||
description: '', |
|||
unitUsage: '', |
|||
storageLocation: '', |
|||
materialType: data[i].materialType |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmMaterial() { |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
let data = $('#addMaterialTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixMaterialPequisitionDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
|
|||
//添加表格内删除物料信息 |
|||
function removeMaterial(materialCode){ |
|||
var ids = []; |
|||
ids.push(materialCode); |
|||
$('#addMaterialTable').bootstrapTable("remove",{ |
|||
field:'materialCode', |
|||
values:ids |
|||
}) |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,658 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<style> |
|||
.other-container { |
|||
width: 90%; |
|||
height: 200px; |
|||
margin: auto; |
|||
} |
|||
.other { |
|||
margin-top: 20px; |
|||
} |
|||
h4 { |
|||
display: inline-block; |
|||
margin-right: 20px; |
|||
} |
|||
.modal-body{ |
|||
height: 550px; |
|||
} |
|||
iframe{ |
|||
width: 100%; |
|||
height: 500px; |
|||
frameborder: 0; |
|||
border: 0; |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-materialRequisitionYL-edit" th:object="${materialRequisitionInfo}"> |
|||
<input name="materialRequisitionId" th:field="*{materialRequisitionId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">领料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialRequisitionNumber" th:field="*{materialRequisitionNumber}" class="form-control" type="text" required readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单号码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" 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"> |
|||
<!-- <input name="workOrderNumber" th:field="*{workOrderNumber}" class="form-control" type="text">--> |
|||
<select name="workOrderNumber" class="form-control m-b" type="text" disabled> |
|||
<option value="">请选择工单号</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料部门:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <select name="deptName" class="form-control m-b" th:with="type=${@dict.getType('sys_dept_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deptName}"></option>--> |
|||
<!-- </select>--> |
|||
<select name="deptName" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料部门</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料人:</label> |
|||
<div class="col-sm-8"> |
|||
<!-- <input name="materialRequisitionPerson" th:field="*{materialRequisitionPerson}" class="form-control" type="text">--> |
|||
<select name="materialRequisitionPerson" class="form-control m-b" type="text"> |
|||
<option value="">请选择领料人</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">部门编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deptNumber" th:field="*{deptNumber}" 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="stockName" class="form-control m-b"> |
|||
<option value="">请选择仓库名称</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库编号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="stockNumber" th:field="*{stockNumber}" 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="stockManager" th:field="*{stockManager}" 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="outputClass" class="form-control m-b" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{outputClass}"></option> |
|||
</select> |
|||
</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="outputDate" th:field="*{outputDate}" 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="finishProductCode" th:field="*{finishProductCode}" 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="typeMachine" th:field="*{typeMachine}" 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="workOrderQuantity" th:field="*{workOrderQuantity}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remarkContent" class="form-control" type="text"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">领料否:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="getMaterialFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{getMaterialFlag}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>物料信息</h4> |
|||
<!-- <a class="btn btn-primary" onclick="showMaterialModal()"><i class="fa fa-plus"></i> 选择信息</a>--> |
|||
<!-- <div style="width: 10%;display: inline-block;margin-left: 10px;">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}" style="margin-top: 10px;">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- <form class="form-horizontal m">--> |
|||
<!-- <div class="form-group">--> |
|||
<!-- <label class="col-sm-3 control-label">物料类别:</label>--> |
|||
<!-- <div class="col-sm-3">--> |
|||
<!-- <select id="materialTypeSelect" name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<!-- </form>--> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addMaterialTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="rawModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formRawMaterialSearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>原料代码:</label> |
|||
<input type="text" name="rawMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>原料名称:</label> |
|||
<input type="text" name="rawMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formRawMaterialSearch','rawTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="rawTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addrowconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addRawToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeRawModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="subsidiaryModal" |
|||
role="dilog" aria-hidden="true"> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
<div class="modal-body"> |
|||
<div class="search"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formSubsidiarySearch"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>辅料代码:</label> |
|||
<input type="text" name="subsidiaryMaterialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>辅料名称:</label> |
|||
<input type="text" name="subsidiaryMaterialName"/> |
|||
</li> |
|||
|
|||
<li> |
|||
|
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formSubsidiarySearch','subsidiaryTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> </li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="subsidiaryTable" style="white-space:nowrap"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<!-- <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addsubsidiaryconfirm()">--> |
|||
<!-- 确定--> |
|||
<!-- </button>--> |
|||
<a class="btn btn-warning btn-rounded" onclick="addSubsidiaryToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeSubsidiaryModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal inmodal" id="productInfoModal" |
|||
role="dilog" aria-hidden="true"> |
|||
|
|||
<!-- 查询成品资料--> |
|||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-content" style="background-color: #FFFFFF"> |
|||
|
|||
<div class="modal-body"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="productFormId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>成品代码:</label> |
|||
<input type="text" name="finishProductCode"/> |
|||
</li> |
|||
<li> |
|||
<label>成品名称:</label> |
|||
<input type="text" name="finishProductName"/> |
|||
</li> |
|||
<li> |
|||
<label>客户代码:</label> |
|||
<input type="text" name="enterpriseCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="enterpriseName"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|||
class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|||
class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="productTable" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: select2-js"/> |
|||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|||
<script th:inline="javascript"> |
|||
var getData = [[${materialRequisitionInfo}]] |
|||
|
|||
var prefix = ctx + "manufacture/materialRequisitionInfo" |
|||
var prefixMaterialPequisitionDetail = ctx + "manufacture/materialRequisitionDetail" |
|||
var prefixWorkOrder = ctx + "manufacture/workOrderInfo" |
|||
|
|||
var materialCategoryDatas = [[${@dict.getType('sys_raw_material_category')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|||
var purchasingUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var limitWhetherDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var whetherSemiManufacturesDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var gpItemSelectionDatas = [[${@dict.getType('sys_gp_Item_selection')}]]; |
|||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]];; |
|||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|||
|
|||
$("#form-materialRequisitionYL-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
// if ($.validate.form()) { |
|||
// $.operate.save(prefix + "/edit", $('#form-materialRequisitionYL-edit').serialize()); |
|||
// } |
|||
let getData=$('#addMaterialTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0){ |
|||
//确认添加选中的物料数据 |
|||
confirmMaterial(); |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-materialRequisitionYL-edit').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请选择!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='outputDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
todayBtn: true |
|||
}); |
|||
|
|||
$(function() { |
|||
//初始化添加材料表 |
|||
$('#addMaterialTable').bootstrapTable({ |
|||
url: prefixMaterialPequisitionDetail + '/list', |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
method: "post", |
|||
contentType: "application/x-www-form-urlencoded", |
|||
striped: true, // 是否显示行间隔色 |
|||
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true, |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
uniqueId: 'materialCode', |
|||
queryParams: function (params) { |
|||
//console.log("123"); |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
materialRequisitionNumber: getData.materialRequisitionNumber |
|||
// enterpriseCode: data[0].enterpriseCode |
|||
|
|||
}; |
|||
// console.log(data[0].enterpriseCode) |
|||
return curParams |
|||
}, |
|||
columns: [ |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
// { |
|||
// field: 'typeMachine', |
|||
// title: '机种', |
|||
// formatter: (value, row, index) => { |
|||
// if (value === null) { |
|||
// return ""; |
|||
// } else { |
|||
// return value |
|||
// } |
|||
// } |
|||
// }, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'planQuantity', |
|||
title: '计划数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '计划数量', |
|||
emptytext: '计划数量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unitUsage', |
|||
title: '单位用量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '单位用量', |
|||
emptytext: '单位用量', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'storageLocation', |
|||
title: '存放位置', |
|||
editable: { |
|||
type: 'text', |
|||
title: '存放位置', |
|||
emptytext: '存放位置', |
|||
validate: function (value) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
visible: false |
|||
}] |
|||
}) |
|||
}); |
|||
|
|||
//获取领料人 |
|||
$.ajax({ |
|||
url: ctx + "system/user/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let userData = res.rows; |
|||
for (let i in userData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-edit select[name='materialRequisitionPerson']").val(getData.materialRequisitionPerson).trigger("change") |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//工单号 |
|||
$.ajax({ |
|||
url: prefixWorkOrder + '/list', |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let orderData = res.rows; |
|||
for (let i in orderData) { |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); |
|||
} |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").val(getData.workOrderNumber).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='workOrderNumber']").change(function () { |
|||
var workOrderNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].workOrderNumber == workOrderNumber) { |
|||
$("#form-materialRequisitionYL-edit input[name='salesOrderNumber']").val(orderData[i].salesOrderNumber); |
|||
$("#form-materialRequisitionYL-edit input[name='finishProductCode']").val(orderData[i].finishProductCode); |
|||
$("#form-materialRequisitionYL-edit input[name='typeMachine']").val(orderData[i].typeMachine); |
|||
$("#form-materialRequisitionYL-edit input[name='workOrderQuantity']").val(orderData[i].orderQuantity); |
|||
showDetailMaterial(workOrderNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
|
|||
//获取仓库信息 |
|||
$.ajax({ |
|||
url: ctx + "stock/stockInfo/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
let stockData = res.rows; |
|||
for (let i in stockData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").val(getData.stockName).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='stockName']").change(function () { |
|||
var stockName = $(this).val(); |
|||
for (let i=0;i<stockData.length;i++) { |
|||
if (stockData[i].stockname == stockName) { |
|||
$("#form-materialRequisitionYL-edit input[name='stockNumber']").val(stockData[i].stockNO); |
|||
$("#form-materialRequisitionYL-edit input[name='stockManager']").val(stockData[i].stockmanager); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//获取部门信息 |
|||
$.ajax({ |
|||
url: ctx + "system/dept/list", |
|||
type: "post", |
|||
success: function (res) { |
|||
console.log(res) |
|||
if (res.length > 0) { |
|||
let deptData = res; |
|||
for (let i in deptData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>"); |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").val(getData.deptName).trigger("change") |
|||
$("#form-materialRequisitionYL-edit select[name='deptName']").change(function () { |
|||
var deptName = $(this).val(); |
|||
for (let i=0;i<deptData.length;i++) { |
|||
if (deptData[i].deptName == deptName) { |
|||
$("#form-materialRequisitionYL-edit input[name='deptNumber']").val(deptData[i].deptNumber); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
|
|||
} |
|||
}) |
|||
|
|||
//选择工单号显示表内订单信息 |
|||
function showDetailMaterial(workOrderNumber) { |
|||
$('#addMaterialTable').bootstrapTable("removeAll") |
|||
console.log(workOrderNumber) |
|||
$.ajax({ |
|||
url: ctx + 'manufacture/workOrderDetail/list', |
|||
type: 'post', |
|||
data: { |
|||
workOrderNumber: workOrderNumber, |
|||
materialType: '原料' |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val(); |
|||
for (i = 0; i < data.length; i++) { |
|||
$("#addMaterialTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
materialRequisitionNumber: materialRequisitionNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
inventoryUnit: data[i].inventoryUnit, |
|||
planQuantity: data[i].materialConsumption, |
|||
description: '', |
|||
unitUsage: '', |
|||
storageLocation: '', |
|||
materialType: data[i].materialType |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmMaterial() { |
|||
$("#addMaterialTable").bootstrapTable('refresh'); |
|||
let data = $('#addMaterialTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixMaterialPequisitionDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,291 @@ |
|||
<!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 :: datetimepicker-css"/> |
|||
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script> |
|||
</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="materialRequisitionNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>订单号码:</label> |
|||
<input type="text" name="salesOrderNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>制工单号:</label> |
|||
<input type="text" name="workOrderNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>领料部门:</label> |
|||
<select name="deptName" th:with="type=${@dict.getType('sys_dept_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>仓库名称:</label> |
|||
<select name="stockName"> |
|||
<option value="">所有</option> |
|||
<option value="-1">代码生成请选择字典属性</option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>出库类型:</label> |
|||
<select name="outputClass" th:with="type=${@dict.getType('sys_out_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>出库日期:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginOutputDate]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endOutputDate]"/> |
|||
</li> |
|||
<li> |
|||
<label>领料否:</label> |
|||
<select name="getMaterialFlag" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="$.form.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="$.operate.add()" shiro:hasPermission="manufacture:materialRequisitionYL:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manufacture:materialRequisitionYL:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="manufacture:materialRequisitionYL:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="exportSelected()" shiro:hasPermission="manufacture:materialRequisitionYL:export"> |
|||
<i class="fa fa-download"></i> 导出 |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table" style="white-space: nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('manufacture:materialRequisitionYL:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('manufacture:materialRequisitionYL:remove')}]]; |
|||
var outputClassDatas = [[${@dict.getType('sys_out_type')}]]; |
|||
var getMaterialFlagDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var prefix = ctx + "manufacture/materialRequisitionInfo"; |
|||
var prefixMaterialRequisitionDetail = ctx + "manufacture/materialRequisitionDetail"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/listRaw", |
|||
createUrl: prefix + "/addRaw", |
|||
updateUrl: prefix + "/editRaw/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
clickToSelect: true, |
|||
modalName: "领料单", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionId', |
|||
title: '领料单id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionNumber', |
|||
title: '领料单号' |
|||
}, |
|||
{ |
|||
field: 'salesOrderNumber', |
|||
title: '订单号码' |
|||
}, |
|||
{ |
|||
field: 'workOrderNumber', |
|||
title: '制工单号' |
|||
}, |
|||
{ |
|||
field: 'deptName', |
|||
title: '领料部门' |
|||
}, |
|||
{ |
|||
field: 'materialRequisitionPerson', |
|||
title: '领料人' |
|||
}, |
|||
{ |
|||
field: 'deptNumber', |
|||
title: '部门编号' |
|||
}, |
|||
{ |
|||
field: 'stockNumber', |
|||
title: '仓库编号' |
|||
}, |
|||
{ |
|||
field: 'stockName', |
|||
title: '仓库名称' |
|||
}, |
|||
{ |
|||
field: 'stockManager', |
|||
title: '仓库管理员' |
|||
}, |
|||
{ |
|||
field: 'outputClass', |
|||
title: '出库类型', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(outputClassDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'outputDate', |
|||
title: '出库日期' |
|||
}, |
|||
{ |
|||
field: 'finishProductCode', |
|||
title: '成品代码' |
|||
}, |
|||
{ |
|||
field: 'typeMachine', |
|||
title: '机种' |
|||
}, |
|||
{ |
|||
field: 'workOrderQuantity', |
|||
title: '工单数量' |
|||
}, |
|||
{ |
|||
field: 'remarkContent', |
|||
title: '备注内容' |
|||
}, |
|||
{ |
|||
field: 'getMaterialFlag', |
|||
title: '领料否', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(getMaterialFlagDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'firstAddTime', |
|||
title: '录入时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
return value; |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'updateInfoTime', |
|||
title: '上次修改时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
var vArr = value.split(',') |
|||
return vArr[0]; |
|||
} |
|||
} |
|||
}] |
|||
// { |
|||
// 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="$.operate.edit(\'' + row.materialRequisitionId + '\')"><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.materialRequisitionId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
// return actions.join(''); |
|||
// } |
|||
// } |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
//删除 |
|||
function removeSelected() { |
|||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|||
// console.log(rows) |
|||
if (rows.length > 0) { |
|||
$.modal.confirm("是否删除选中的"+ rows.length +"条原料领料单?", function () { |
|||
$.ajax({ |
|||
url: prefix + '/removeSelected', |
|||
type: 'post', |
|||
data: { |
|||
ids : rows.join() |
|||
}, |
|||
success: function (res) { |
|||
// console.log(res) |
|||
$("#bootstrap-table").bootstrapTable("refresh"); |
|||
$.modal.msgSuccess("删除成功!") |
|||
}, |
|||
error: function (res) { |
|||
$.modal.msgError(res.error()) |
|||
} |
|||
}) |
|||
}) |
|||
} else { |
|||
$.modal.msgWarning("请选择一条数据") |
|||
} |
|||
} |
|||
|
|||
//导出 |
|||
function exportSelected() { |
|||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|||
var data = $("#bootstrap-table").bootstrapTable("getSelections") |
|||
|
|||
if (rows.length !== 1) { |
|||
$.modal.alert("请选择一条记录"); |
|||
return; |
|||
} else { |
|||
// rows为选中行的id |
|||
// console.log(rows); |
|||
// console.log(data); |
|||
// console.log(data[0].orderNumber) |
|||
$.modal.confirm("是否确认要导出本条领料单?", function (){ |
|||
axios({ |
|||
url: prefix + '/exportSelected/'+data[0].materialRequisitionId, |
|||
method: 'POST', |
|||
responseType: 'blob' |
|||
}).then(response => { |
|||
// console.log(response) |
|||
const URL = window.URL.createObjectURL(response.data) |
|||
// 创建隐藏<a>标签进行下载 |
|||
const tempLink = document.createElement('a') |
|||
tempLink.style.display = 'none' |
|||
tempLink.href = URL |
|||
let time = new Date().toLocaleString() |
|||
tempLink.setAttribute('download', time + "原料领料单.xlsx") |
|||
if (typeof tempLink.download === 'undefined') { |
|||
tempLink.setAttribute('target', '_blank') |
|||
} |
|||
document.body.appendChild(tempLink) |
|||
tempLink.click() |
|||
document.body.removeChild(tempLink)// 移除dom元素 |
|||
window.URL.revokeObjectURL(URL)//释放内存 |
|||
}) |
|||
}); |
|||
|
|||
|
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,88 @@ |
|||
<!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-warehousingCheckInfo-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">盘点单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehousingCheckNumber" 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="warehousingCheckPerson" 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="stockNumber" 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="stockName" 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="warehousingCheckDate" 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"> |
|||
<select name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="remark" 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="updateFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "storehouse/warehousingCheckInfo" |
|||
$("#form-warehousingCheckInfo-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-warehousingCheckInfo-add').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='warehousingCheckDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,89 @@ |
|||
<!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-warehousingCheckInfo-edit" th:object="${warehousingCheckInfo}"> |
|||
<input name="warehousingCheckInfoId" th:field="*{warehousingCheckInfoId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">盘点单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehousingCheckNumber" th:field="*{warehousingCheckNumber}" 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="warehousingCheckPerson" th:field="*{warehousingCheckPerson}" 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="stockNumber" th:field="*{stockNumber}" 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="stockName" th:field="*{stockName}" 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="warehousingCheckDate" th:value="${#dates.format(warehousingCheckInfo.warehousingCheckDate, '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"> |
|||
<select name="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{materialType}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注内容:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="remark" th:field="*{remark}" 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="updateFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{updateFlag}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "storehouse/warehousingCheckInfo"; |
|||
$("#form-warehousingCheckInfo-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-warehousingCheckInfo-edit').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='warehousingCheckDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,153 @@ |
|||
<!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('盘点列表')" /> |
|||
</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="warehousingCheckNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>仓库号:</label> |
|||
<input type="text" name="stockNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>仓库名称:</label> |
|||
<input type="text" name="stockName"/> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>盘点日期:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingCheckDate]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingCheckDate]"/> |
|||
</li> |
|||
<li> |
|||
<label>物料种类:</label> |
|||
<select name="materialType" th:with="type=${@dict.getType('ck_meterialt_type')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>更新否:</label> |
|||
<select name="updateFlag" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="$.form.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="$.operate.add()" shiro:hasPermission="storehouse:warehousingCheckInfo:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storehouse:warehousingCheckInfo:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="storehouse:warehousingCheckInfo:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingCheckInfo:export"> |
|||
<i class="fa fa-download"></i> 导出 |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table" style="white-space: nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('storehouse:warehousingCheckInfo:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('storehouse:warehousingCheckInfo:remove')}]]; |
|||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|||
var updateFlagDatas = [[${@dict.getType('sys_whether')}]]; |
|||
var prefix = ctx + "storehouse/warehousingCheckInfo"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
clickToSelect: true, |
|||
modalName: "盘点", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'warehousingCheckInfoId', |
|||
title: '盘点id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'warehousingCheckNumber', |
|||
title: '盘点单号' |
|||
}, |
|||
{ |
|||
field: 'warehousingCheckPerson', |
|||
title: '盘点人名' |
|||
}, |
|||
{ |
|||
field: 'stockNumber', |
|||
title: '仓库号' |
|||
}, |
|||
{ |
|||
field: 'stockName', |
|||
title: '仓库名称' |
|||
}, |
|||
{ |
|||
field: 'warehousingCheckDate', |
|||
title: '盘点日期' |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料种类', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'remark', |
|||
title: '备注内容' |
|||
}, |
|||
{ |
|||
field: 'updateFlag', |
|||
title: '更新否', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(updateFlagDatas, value); |
|||
} |
|||
} |
|||
// , |
|||
// { |
|||
// 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="$.operate.edit(\'' + row.warehousingCheckInfoId + '\')"><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.warehousingCheckInfoId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
// return actions.join(''); |
|||
// } |
|||
// } |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,105 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增库存')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-warehousingSearch-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialCode" 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="materialName" 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="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">批号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="batchNumber" 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="specificationModel" 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="typeMachine" 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="inventoryUnit" 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="stockQuantity" 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="stockNumber" 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="stockName" 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="enterpriseCode" 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="enterpriseName" 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="storageLocation" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "storehouse/warehousingSearch" |
|||
$("#form-warehousingSearch-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-warehousingSearch-add').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,106 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改库存')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-warehousingSearch-edit" th:object="${warehousingSearch}"> |
|||
<input name="materialCode" th:field="*{materialCode}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialCode" th:field="*{materialCode}" 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="materialName" th:field="*{materialName}" 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="materialType" class="form-control m-b" th:with="type=${@dict.getType('ck_meterialt_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{materialType}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">批号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="batchNumber" th:field="*{batchNumber}" 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="specificationModel" th:field="*{specificationModel}" 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="typeMachine" th:field="*{typeMachine}" 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="inventoryUnit" th:field="*{inventoryUnit}" 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="stockQuantity" th:field="*{stockQuantity}" 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="stockNumber" th:field="*{stockNumber}" 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="stockName" th:field="*{stockName}" 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="enterpriseCode" th:field="*{enterpriseCode}" 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="enterpriseName" th:field="*{enterpriseName}" 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="storageLocation" th:field="*{storageLocation}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "storehouse/warehousingSearch"; |
|||
$("#form-warehousingSearch-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-warehousingSearch-edit').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,178 @@ |
|||
<!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('库存列表')" /> |
|||
</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="materialCode"/> |
|||
</li> |
|||
<li> |
|||
<label>物料名称:</label> |
|||
<input type="text" name="materialName"/> |
|||
</li> |
|||
<li> |
|||
<label>物料类型:</label> |
|||
<select name="materialType" th:with="type=${@dict.getType('ck_meterialt_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="batchNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>仓库号:</label> |
|||
<input type="text" name="stockNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>仓库名称:</label> |
|||
<input type="text" name="stockName"/> |
|||
</li> |
|||
<li> |
|||
<label>客户编号:</label> |
|||
<input type="text" name="enterpriseCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="enterpriseName"/> |
|||
</li> |
|||
<li> |
|||
<label>库存大于0?:</label> |
|||
<select name="stockQuantity" th:with="type=${@dict.getType('sys_whether')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</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="$.form.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="$.operate.add()" shiro:hasPermission="storehouse:warehousingSearch:add">--> |
|||
<!-- <i class="fa fa-plus"></i> 添加--> |
|||
<!-- </a>--> |
|||
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storehouse:warehousingSearch:edit">--> |
|||
<!-- <i class="fa fa-edit"></i> 修改--> |
|||
<!-- </a>--> |
|||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="storehouse:warehousingSearch:remove">--> |
|||
<!-- <i class="fa fa-remove"></i> 删除--> |
|||
<!-- </a>--> |
|||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingSearch:export">--> |
|||
<!-- <i class="fa fa-download"></i> 导出--> |
|||
<!-- </a>--> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table" style="white-space: nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('storehouse:warehousingSearch:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('storehouse:warehousingSearch:remove')}]]; |
|||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|||
var prefix = ctx + "storehouse/warehousingSearch"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
modalName: "库存", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类型', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'batchNumber', |
|||
title: '批号' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'typeMachine', |
|||
title: '机种' |
|||
}, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位' |
|||
}, |
|||
{ |
|||
field: 'stockQuantity', |
|||
title: '库存数量', |
|||
formatter: (value, row, index) => { |
|||
if (value!==null) { |
|||
return parseFloat(value).toFixed(2) |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'stockNumber', |
|||
title: '仓库号' |
|||
}, |
|||
{ |
|||
field: 'stockName', |
|||
title: '仓库名称' |
|||
}, |
|||
{ |
|||
field: 'enterpriseCode', |
|||
title: '客户编号' |
|||
}, |
|||
{ |
|||
field: 'enterpriseName', |
|||
title: '客户名称' |
|||
}, |
|||
{ |
|||
field: 'storageLocation', |
|||
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="$.operate.edit(\'' + row.materialCode + '\')"><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.materialCode + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
// return actions.join(''); |
|||
// } |
|||
// } |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue