liuxiaoxu
1 month ago
13 changed files with 1 additions and 2530 deletions
@ -1,170 +0,0 @@ |
|||
package com.ruoyi.purchase.controller; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
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.purchase.domain.PurchaseMaterial; |
|||
import com.ruoyi.purchase.service.IPurchaseMaterialService; |
|||
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.Arrays; |
|||
import java.util.List; |
|||
import java.util.Objects; |
|||
|
|||
import static com.ruoyi.common.core.domain.AjaxResult.Type.SUCCESS; |
|||
|
|||
/** |
|||
* 采购材料信息Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-04-03 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/purchase/purchaseMaterial") |
|||
public class PurchaseMaterialController extends BaseController |
|||
{ |
|||
private String prefix = "purchase/purchaseMaterial"; |
|||
|
|||
@Autowired |
|||
private IPurchaseMaterialService purchaseMaterialService; |
|||
|
|||
@RequiresPermissions("purchase:purchaseMaterial:view") |
|||
@GetMapping() |
|||
public String purchaseMaterial() |
|||
{ |
|||
return prefix + "/purchaseMaterial"; |
|||
} |
|||
|
|||
/** |
|||
* 查询采购材料信息列表 |
|||
*/ |
|||
@RequiresPermissions("purchase:purchaseMaterial:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(PurchaseMaterial purchaseMaterial) |
|||
{ |
|||
startPage(); |
|||
List<PurchaseMaterial> list = purchaseMaterialService.selectPurchaseMaterialList(purchaseMaterial); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出采购材料信息列表 |
|||
*/ |
|||
@RequiresPermissions("purchase:purchaseMaterial:export") |
|||
@Log(title = "采购材料信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(PurchaseMaterial purchaseMaterial) |
|||
{ |
|||
List<PurchaseMaterial> list = purchaseMaterialService.selectPurchaseMaterialList(purchaseMaterial); |
|||
ExcelUtil<PurchaseMaterial> util = new ExcelUtil<PurchaseMaterial>(PurchaseMaterial.class); |
|||
return util.exportExcel(list, "采购材料信息数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增采购材料信息 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存采购材料信息 |
|||
*/ |
|||
@RequiresPermissions("purchase:purchaseMaterial:add") |
|||
@Log(title = "采购材料信息", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(PurchaseMaterial purchaseMaterial) |
|||
{ |
|||
return toAjax(purchaseMaterialService.insertPurchaseMaterial(purchaseMaterial)); |
|||
} |
|||
|
|||
/** |
|||
* 新增保存采购材料信息 |
|||
*/ |
|||
@RequiresPermissions("purchase:purchaseMaterial:add") |
|||
@Log(title = "采购材料信息", businessType = BusinessType.INSERT) |
|||
@PostMapping("/addEditSave") |
|||
@ResponseBody |
|||
public AjaxResult addEditSave(@RequestParam(value = "data") String data) |
|||
{ |
|||
|
|||
// 反序列化
|
|||
List<PurchaseMaterial> purchaseMaterialList = JSONObject.parseArray(data, PurchaseMaterial.class); |
|||
|
|||
|
|||
for (int i=0;i<purchaseMaterialList.size();i++) { |
|||
|
|||
String id = String.valueOf(purchaseMaterialService.selectPurchaseMaterialById(purchaseMaterialList.get(i).getPurchaseMaterialId())); |
|||
if (Objects.equals(id, "null")) { |
|||
purchaseMaterialService.insertPurchaseMaterial(purchaseMaterialList.get(i)); |
|||
} else { |
|||
purchaseMaterialService.updatePurchaseMaterial(purchaseMaterialList.get(i)); |
|||
} |
|||
} |
|||
return new AjaxResult(SUCCESS, "test done"); |
|||
} |
|||
|
|||
/** |
|||
* 修改采购材料信息 |
|||
*/ |
|||
@GetMapping("/edit/{purchaseMaterialId}") |
|||
public String edit(@PathVariable("purchaseMaterialId") Long purchaseMaterialId, ModelMap mmap) |
|||
{ |
|||
PurchaseMaterial purchaseMaterial = purchaseMaterialService.selectPurchaseMaterialById(purchaseMaterialId); |
|||
mmap.put("purchaseMaterial", purchaseMaterial); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存采购材料信息 |
|||
*/ |
|||
@RequiresPermissions("purchase:purchaseMaterial:edit") |
|||
@Log(title = "采购材料信息", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(PurchaseMaterial purchaseMaterial) |
|||
{ |
|||
return toAjax(purchaseMaterialService.updatePurchaseMaterial(purchaseMaterial)); |
|||
} |
|||
|
|||
/** |
|||
* 删除采购材料信息 |
|||
*/ |
|||
|
|||
@RequiresPermissions("purchase:purchaseMaterial:remove") |
|||
@Log(title = "采购材料信息", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(purchaseMaterialService.deletePurchaseMaterialByIds(ids)); |
|||
} |
|||
|
|||
//删除
|
|||
@PostMapping("/removeMaterial") |
|||
@ResponseBody |
|||
public AjaxResult removeMaterial(@RequestParam(value = "ids") String ids) { |
|||
// System.out.println(ids);
|
|||
ids=ids.replace("[","").replace("]",""); |
|||
List<String> idList = Arrays.asList(ids.split(",")); |
|||
for (int i=0;i<idList.size();i++) { |
|||
if (!("null".equals(idList.get(i)))) { |
|||
purchaseMaterialService.deletePurchaseMaterialById(Long.valueOf(idList.get(i))); |
|||
} |
|||
} |
|||
return new AjaxResult(SUCCESS, "test done"); |
|||
} |
|||
} |
@ -1,269 +0,0 @@ |
|||
package com.ruoyi.purchase.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; |
|||
|
|||
/** |
|||
* 采购材料信息对象 purchase_material |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-04-03 |
|||
*/ |
|||
public class PurchaseMaterial extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 采购材料id */ |
|||
private Long purchaseMaterialId; |
|||
|
|||
|
|||
/** 订购单号 */ |
|||
@Excel(name = "订购单号") |
|||
private String purchaseOrderNumber; |
|||
|
|||
/** 供应商代码 */ |
|||
@Excel(name = "供应商代码") |
|||
private String supplierCode; |
|||
|
|||
/** 供应商名称 */ |
|||
@Excel(name = "供应商名称") |
|||
private String supplierName; |
|||
|
|||
/** 原辅料代码 */ |
|||
@Excel(name = "原辅料代码") |
|||
private String rawSubsidiaryCode; |
|||
|
|||
/** 原辅料名称 */ |
|||
@Excel(name = "原辅料名称") |
|||
private String rawSubsidiaryName; |
|||
|
|||
/** 规格型号 */ |
|||
@Excel(name = "规格型号") |
|||
private String specificationModel; |
|||
/** 物料类别 */ |
|||
@Excel(name = "物料类别") |
|||
private String materialType; |
|||
|
|||
/** 币别 */ |
|||
@Excel(name = "币别") |
|||
private String commonCurrency; |
|||
|
|||
/** 采购单位 */ |
|||
@Excel(name = "采购单位") |
|||
private String purchasingUnit; |
|||
|
|||
/** 采购单价 */ |
|||
@Excel(name = "采购单价") |
|||
private String purchasePrice; |
|||
|
|||
/** 数量 */ |
|||
@Excel(name = "数量") |
|||
private String materialQuantity; |
|||
|
|||
/** 金额 */ |
|||
@Excel(name = "金额") |
|||
private String amountMoney; |
|||
|
|||
/** 交期 */ |
|||
@Excel(name = "交期") |
|||
private String deliveryTime; |
|||
|
|||
/** 说明 */ |
|||
@Excel(name = "说明") |
|||
private String purchaseExplain; |
|||
/** 对账否 */ |
|||
@Excel(name = "对账否") |
|||
private String accountReconciliationFlag; |
|||
/** 对账人 */ |
|||
@Excel(name = "对账人") |
|||
private String accountReconciliationPerson; |
|||
/** 对账时间 */ |
|||
@Excel(name = "对账时间") |
|||
private String accountReconciliationTime; |
|||
|
|||
public void setPurchaseMaterialId(Long purchaseMaterialId) |
|||
{ |
|||
this.purchaseMaterialId = purchaseMaterialId; |
|||
} |
|||
|
|||
public Long getPurchaseMaterialId() |
|||
{ |
|||
return purchaseMaterialId; |
|||
} |
|||
public void setPurchaseOrderNumber(String purchaseOrderNumber) |
|||
{ |
|||
this.purchaseOrderNumber = purchaseOrderNumber; |
|||
} |
|||
|
|||
public String getPurchaseOrderNumber() |
|||
{ |
|||
return purchaseOrderNumber; |
|||
} |
|||
public void setSupplierCode(String supplierCode) |
|||
{ |
|||
this.supplierCode = supplierCode; |
|||
} |
|||
|
|||
public String getSupplierCode() |
|||
{ |
|||
return supplierCode; |
|||
} |
|||
public void setSupplierName(String supplierName) |
|||
{ |
|||
this.supplierName = supplierName; |
|||
} |
|||
|
|||
public String getSupplierName() |
|||
{ |
|||
return supplierName; |
|||
} |
|||
public void setRawSubsidiaryCode(String rawSubsidiaryCode) |
|||
{ |
|||
this.rawSubsidiaryCode = rawSubsidiaryCode; |
|||
} |
|||
|
|||
public String getRawSubsidiaryCode() |
|||
{ |
|||
return rawSubsidiaryCode; |
|||
} |
|||
public void setRawSubsidiaryName(String rawSubsidiaryName) |
|||
{ |
|||
this.rawSubsidiaryName = rawSubsidiaryName; |
|||
} |
|||
|
|||
public String getRawSubsidiaryName() |
|||
{ |
|||
return rawSubsidiaryName; |
|||
} |
|||
public void setSpecificationModel(String specificationModel) |
|||
{ |
|||
this.specificationModel = specificationModel; |
|||
} |
|||
|
|||
public String getSpecificationModel() |
|||
{ |
|||
return specificationModel; |
|||
} |
|||
|
|||
public String getMaterialType() { |
|||
return materialType; |
|||
} |
|||
|
|||
public void setMaterialType(String materialType) { |
|||
this.materialType = materialType; |
|||
} |
|||
|
|||
public void setCommonCurrency(String commonCurrency) |
|||
{ |
|||
this.commonCurrency = commonCurrency; |
|||
} |
|||
|
|||
public String getCommonCurrency() |
|||
{ |
|||
return commonCurrency; |
|||
} |
|||
public void setPurchasingUnit(String purchasingUnit) |
|||
{ |
|||
this.purchasingUnit = purchasingUnit; |
|||
} |
|||
|
|||
public String getPurchasingUnit() |
|||
{ |
|||
return purchasingUnit; |
|||
} |
|||
public void setPurchasePrice(String purchasePrice) |
|||
{ |
|||
this.purchasePrice = purchasePrice; |
|||
} |
|||
|
|||
public String getPurchasePrice() |
|||
{ |
|||
return purchasePrice; |
|||
} |
|||
public void setMaterialQuantity(String materialQuantity) |
|||
{ |
|||
this.materialQuantity = materialQuantity; |
|||
} |
|||
|
|||
public String getMaterialQuantity() |
|||
{ |
|||
return materialQuantity; |
|||
} |
|||
public void setAmountMoney(String amountMoney) |
|||
{ |
|||
this.amountMoney = amountMoney; |
|||
} |
|||
|
|||
public String getAmountMoney() |
|||
{ |
|||
return amountMoney; |
|||
} |
|||
public void setDeliveryTime(String deliveryTime) |
|||
{ |
|||
this.deliveryTime = deliveryTime; |
|||
} |
|||
|
|||
public String getDeliveryTime() |
|||
{ |
|||
return deliveryTime; |
|||
} |
|||
public void setPurchaseExplain(String purchaseExplain) |
|||
{ |
|||
this.purchaseExplain = purchaseExplain; |
|||
} |
|||
|
|||
public String getPurchaseExplain() |
|||
{ |
|||
return purchaseExplain; |
|||
} |
|||
|
|||
public String getAccountReconciliationFlag() { |
|||
return accountReconciliationFlag; |
|||
} |
|||
|
|||
public void setAccountReconciliationFlag(String accountReconciliationFlag) { |
|||
this.accountReconciliationFlag = accountReconciliationFlag; |
|||
} |
|||
|
|||
public String getAccountReconciliationPerson() { |
|||
return accountReconciliationPerson; |
|||
} |
|||
|
|||
public void setAccountReconciliationPerson(String accountReconciliationPerson) { |
|||
this.accountReconciliationPerson = accountReconciliationPerson; |
|||
} |
|||
|
|||
public String getAccountReconciliationTime() { |
|||
return accountReconciliationTime; |
|||
} |
|||
|
|||
public void setAccountReconciliationTime(String accountReconciliationTime) { |
|||
this.accountReconciliationTime = accountReconciliationTime; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("purchaseMaterialId", getPurchaseMaterialId()) |
|||
.append("purchaseOrderNumber", getPurchaseOrderNumber()) |
|||
.append("supplierCode", getSupplierCode()) |
|||
.append("supplierName", getSupplierName()) |
|||
.append("rawSubsidiaryCode", getRawSubsidiaryCode()) |
|||
.append("rawSubsidiaryName", getRawSubsidiaryName()) |
|||
.append("specificationModel", getSpecificationModel()) |
|||
.append("materialType", getMaterialType()) |
|||
.append("commonCurrency", getCommonCurrency()) |
|||
.append("purchasingUnit", getPurchasingUnit()) |
|||
.append("purchasePrice", getPurchasePrice()) |
|||
.append("materialQuantity", getMaterialQuantity()) |
|||
.append("amountMoney", getAmountMoney()) |
|||
.append("deliveryTime", getDeliveryTime()) |
|||
.append("purchaseExplain", getPurchaseExplain()) |
|||
.append("accountReconciliationFlag", getAccountReconciliationFlag()) |
|||
.append("accountReconciliationPerson", getAccountReconciliationPerson()) |
|||
.append("accountReconciliationTime", getAccountReconciliationTime()) |
|||
.toString(); |
|||
} |
|||
} |
@ -1,61 +0,0 @@ |
|||
package com.ruoyi.purchase.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.purchase.domain.PurchaseMaterial; |
|||
|
|||
/** |
|||
* 采购材料信息Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-04-03 |
|||
*/ |
|||
public interface PurchaseMaterialMapper |
|||
{ |
|||
/** |
|||
* 查询采购材料信息 |
|||
* |
|||
* @param purchaseMaterialId 采购材料信息ID |
|||
* @return 采购材料信息 |
|||
*/ |
|||
public PurchaseMaterial selectPurchaseMaterialById(Long purchaseMaterialId); |
|||
|
|||
/** |
|||
* 查询采购材料信息列表 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 采购材料信息集合 |
|||
*/ |
|||
public List<PurchaseMaterial> selectPurchaseMaterialList(PurchaseMaterial purchaseMaterial); |
|||
|
|||
/** |
|||
* 新增采购材料信息 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertPurchaseMaterial(PurchaseMaterial purchaseMaterial); |
|||
|
|||
/** |
|||
* 修改采购材料信息 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int updatePurchaseMaterial(PurchaseMaterial purchaseMaterial); |
|||
|
|||
/** |
|||
* 删除采购材料信息 |
|||
* |
|||
* @param purchaseMaterialId 采购材料信息ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deletePurchaseMaterialById(Long purchaseMaterialId); |
|||
|
|||
/** |
|||
* 批量删除采购材料信息 |
|||
* |
|||
* @param purchaseMaterialIds 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deletePurchaseMaterialByIds(String[] purchaseMaterialIds); |
|||
} |
@ -1,61 +0,0 @@ |
|||
package com.ruoyi.purchase.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.purchase.domain.PurchaseMaterial; |
|||
|
|||
/** |
|||
* 采购材料信息Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-04-03 |
|||
*/ |
|||
public interface IPurchaseMaterialService |
|||
{ |
|||
/** |
|||
* 查询采购材料信息 |
|||
* |
|||
* @param purchaseMaterialId 采购材料信息ID |
|||
* @return 采购材料信息 |
|||
*/ |
|||
public PurchaseMaterial selectPurchaseMaterialById(Long purchaseMaterialId); |
|||
|
|||
/** |
|||
* 查询采购材料信息列表 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 采购材料信息集合 |
|||
*/ |
|||
public List<PurchaseMaterial> selectPurchaseMaterialList(PurchaseMaterial purchaseMaterial); |
|||
|
|||
/** |
|||
* 新增采购材料信息 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertPurchaseMaterial(PurchaseMaterial purchaseMaterial); |
|||
|
|||
/** |
|||
* 修改采购材料信息 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 结果 |
|||
*/ |
|||
public int updatePurchaseMaterial(PurchaseMaterial purchaseMaterial); |
|||
|
|||
/** |
|||
* 批量删除采购材料信息 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deletePurchaseMaterialByIds(String ids); |
|||
|
|||
/** |
|||
* 删除采购材料信息信息 |
|||
* |
|||
* @param purchaseMaterialId 采购材料信息ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deletePurchaseMaterialById(Long purchaseMaterialId); |
|||
} |
@ -1,94 +0,0 @@ |
|||
package com.ruoyi.purchase.service.impl; |
|||
|
|||
import java.util.List; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.purchase.mapper.PurchaseMaterialMapper; |
|||
import com.ruoyi.purchase.domain.PurchaseMaterial; |
|||
import com.ruoyi.purchase.service.IPurchaseMaterialService; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
|
|||
/** |
|||
* 采购材料信息Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2023-04-03 |
|||
*/ |
|||
@Service |
|||
public class PurchaseMaterialServiceImpl implements IPurchaseMaterialService |
|||
{ |
|||
@Autowired |
|||
private PurchaseMaterialMapper purchaseMaterialMapper; |
|||
|
|||
/** |
|||
* 查询采购材料信息 |
|||
* |
|||
* @param purchaseMaterialId 采购材料信息ID |
|||
* @return 采购材料信息 |
|||
*/ |
|||
@Override |
|||
public PurchaseMaterial selectPurchaseMaterialById(Long purchaseMaterialId) |
|||
{ |
|||
return purchaseMaterialMapper.selectPurchaseMaterialById(purchaseMaterialId); |
|||
} |
|||
|
|||
/** |
|||
* 查询采购材料信息列表 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 采购材料信息 |
|||
*/ |
|||
@Override |
|||
public List<PurchaseMaterial> selectPurchaseMaterialList(PurchaseMaterial purchaseMaterial) |
|||
{ |
|||
return purchaseMaterialMapper.selectPurchaseMaterialList(purchaseMaterial); |
|||
} |
|||
|
|||
/** |
|||
* 新增采购材料信息 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertPurchaseMaterial(PurchaseMaterial purchaseMaterial) |
|||
{ |
|||
return purchaseMaterialMapper.insertPurchaseMaterial(purchaseMaterial); |
|||
} |
|||
|
|||
/** |
|||
* 修改采购材料信息 |
|||
* |
|||
* @param purchaseMaterial 采购材料信息 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updatePurchaseMaterial(PurchaseMaterial purchaseMaterial) |
|||
{ |
|||
return purchaseMaterialMapper.updatePurchaseMaterial(purchaseMaterial); |
|||
} |
|||
|
|||
/** |
|||
* 删除采购材料信息对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deletePurchaseMaterialByIds(String ids) |
|||
{ |
|||
return purchaseMaterialMapper.deletePurchaseMaterialByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除采购材料信息信息 |
|||
* |
|||
* @param purchaseMaterialId 采购材料信息ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deletePurchaseMaterialById(Long purchaseMaterialId) |
|||
{ |
|||
return purchaseMaterialMapper.deletePurchaseMaterialById(purchaseMaterialId); |
|||
} |
|||
} |
@ -1,125 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.ruoyi.purchase.mapper.PurchaseMaterialMapper"> |
|||
|
|||
<resultMap type="PurchaseMaterial" id="PurchaseMaterialResult"> |
|||
<result property="purchaseMaterialId" column="purchase_material_id" /> |
|||
<result property="purchaseOrderNumber" column="purchase_order_number" /> |
|||
<result property="supplierCode" column="supplier_code" /> |
|||
<result property="supplierName" column="supplier_name" /> |
|||
<result property="rawSubsidiaryCode" column="raw_subsidiary_code" /> |
|||
<result property="rawSubsidiaryName" column="raw_subsidiary_name" /> |
|||
<result property="specificationModel" column="specification_model" /> |
|||
<result property="materialType" column="material_type" /> |
|||
<result property="commonCurrency" column="common_currency" /> |
|||
<result property="purchasingUnit" column="purchasing_unit" /> |
|||
<result property="purchasePrice" column="purchase_price" /> |
|||
<result property="materialQuantity" column="material_quantity" /> |
|||
<result property="amountMoney" column="amount_money" /> |
|||
<result property="deliveryTime" column="delivery_time" /> |
|||
<result property="purchaseExplain" column="purchase_explain" /> |
|||
<result property="accountReconciliationFlag" column="account_reconciliation_flag" /> |
|||
<result property="accountReconciliationPerson" column="account_reconciliation_person" /> |
|||
<result property="accountReconciliationTime" column="account_reconciliation_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectPurchaseMaterialVo"> |
|||
select purchase_material_id, purchase_order_number, supplier_code, supplier_name, raw_subsidiary_code, raw_subsidiary_name, specification_model, material_type, common_currency, purchasing_unit, purchase_price, material_quantity, amount_money, delivery_time, purchase_explain, account_reconciliation_flag, account_reconciliation_person, account_reconciliation_time from purchase_material |
|||
</sql> |
|||
|
|||
<select id="selectPurchaseMaterialList" parameterType="PurchaseMaterial" resultMap="PurchaseMaterialResult"> |
|||
<include refid="selectPurchaseMaterialVo"/> |
|||
<where> |
|||
<if test="purchaseOrderNumber != null and purchaseOrderNumber != ''"> and purchase_order_number like concat('%', #{purchaseOrderNumber}, '%')</if> |
|||
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if> |
|||
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if> |
|||
<if test="rawSubsidiaryCode != null and rawSubsidiaryCode != ''"> and raw_subsidiary_code like concat('%', #{rawSubsidiaryCode}, '%')</if> |
|||
<if test="rawSubsidiaryName != null and rawSubsidiaryName != ''"> and raw_subsidiary_name like concat('%', #{rawSubsidiaryName}, '%')</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectPurchaseMaterialById" parameterType="Long" resultMap="PurchaseMaterialResult"> |
|||
<include refid="selectPurchaseMaterialVo"/> |
|||
where purchase_material_id = #{purchaseMaterialId} |
|||
</select> |
|||
|
|||
<insert id="insertPurchaseMaterial" parameterType="PurchaseMaterial" useGeneratedKeys="true" keyProperty="purchaseMaterialId"> |
|||
insert into purchase_material |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="purchaseOrderNumber != null">purchase_order_number,</if> |
|||
<if test="supplierCode != null">supplier_code,</if> |
|||
<if test="supplierName != null">supplier_name,</if> |
|||
<if test="rawSubsidiaryCode != null">raw_subsidiary_code,</if> |
|||
<if test="rawSubsidiaryName != null">raw_subsidiary_name,</if> |
|||
<if test="specificationModel != null">specification_model,</if> |
|||
<if test="materialType != null">material_type,</if> |
|||
<if test="commonCurrency != null">common_currency,</if> |
|||
<if test="purchasingUnit != null">purchasing_unit,</if> |
|||
<if test="purchasePrice != null">purchase_price,</if> |
|||
<if test="materialQuantity != null">material_quantity,</if> |
|||
<if test="amountMoney != null">amount_money,</if> |
|||
<if test="deliveryTime != null">delivery_time,</if> |
|||
<if test="purchaseExplain != null">purchase_explain,</if> |
|||
<if test="accountReconciliationFlag != null">account_reconciliation_flag,</if> |
|||
<if test="accountReconciliationPerson != null">account_reconciliation_person,</if> |
|||
<if test="accountReconciliationTime != null">account_reconciliation_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="purchaseOrderNumber != null">#{purchaseOrderNumber},</if> |
|||
<if test="supplierCode != null">#{supplierCode},</if> |
|||
<if test="supplierName != null">#{supplierName},</if> |
|||
<if test="rawSubsidiaryCode != null">#{rawSubsidiaryCode},</if> |
|||
<if test="rawSubsidiaryName != null">#{rawSubsidiaryName},</if> |
|||
<if test="specificationModel != null">#{specificationModel},</if> |
|||
<if test="materialType != null">#{materialType},</if> |
|||
<if test="commonCurrency != null">#{commonCurrency},</if> |
|||
<if test="purchasingUnit != null">#{purchasingUnit},</if> |
|||
<if test="purchasePrice != null">#{purchasePrice},</if> |
|||
<if test="materialQuantity != null">#{materialQuantity},</if> |
|||
<if test="amountMoney != null">#{amountMoney},</if> |
|||
<if test="deliveryTime != null">#{deliveryTime},</if> |
|||
<if test="purchaseExplain != null">#{purchaseExplain},</if> |
|||
<if test="accountReconciliationFlag != null">#{accountReconciliationFlag},</if> |
|||
<if test="accountReconciliationPerson != null">#{accountReconciliationPerson},</if> |
|||
<if test="accountReconciliationTime != null">#{accountReconciliationTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updatePurchaseMaterial" parameterType="PurchaseMaterial"> |
|||
update purchase_material |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="purchaseOrderNumber != null">purchase_order_number = #{purchaseOrderNumber},</if> |
|||
<if test="supplierCode != null">supplier_code = #{supplierCode},</if> |
|||
<if test="supplierName != null">supplier_name = #{supplierName},</if> |
|||
<if test="rawSubsidiaryCode != null">raw_subsidiary_code = #{rawSubsidiaryCode},</if> |
|||
<if test="rawSubsidiaryName != null">raw_subsidiary_name = #{rawSubsidiaryName},</if> |
|||
<if test="specificationModel != null">specification_model = #{specificationModel},</if> |
|||
<if test="materialType != null">material_type = #{materialType},</if> |
|||
<if test="commonCurrency != null">common_currency = #{commonCurrency},</if> |
|||
<if test="purchasingUnit != null">purchasing_unit = #{purchasingUnit},</if> |
|||
<if test="purchasePrice != null">purchase_price = #{purchasePrice},</if> |
|||
<if test="materialQuantity != null">material_quantity = #{materialQuantity},</if> |
|||
<if test="amountMoney != null">amount_money = #{amountMoney},</if> |
|||
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if> |
|||
<if test="purchaseExplain != null">purchase_explain = #{purchaseExplain},</if> |
|||
<if test="accountReconciliationFlag != null">account_reconciliation_flag = #{accountReconciliationFlag},</if> |
|||
<if test="accountReconciliationPerson != null">account_reconciliation_person = #{accountReconciliationPerson},</if> |
|||
<if test="accountReconciliationTime != null">account_reconciliation_time = #{accountReconciliationTime},</if> |
|||
</trim> |
|||
where purchase_material_id = #{purchaseMaterialId} |
|||
</update> |
|||
|
|||
<delete id="deletePurchaseMaterialById" parameterType="Long"> |
|||
delete from purchase_material where purchase_material_id = #{purchaseMaterialId} |
|||
</delete> |
|||
|
|||
<delete id="deletePurchaseMaterialByIds" parameterType="String"> |
|||
delete from purchase_material where purchase_material_id in |
|||
<foreach item="purchaseMaterialId" collection="array" open="(" separator="," close=")"> |
|||
#{purchaseMaterialId} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
</mapper> |
@ -1,116 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增采购材料信息')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-purchaseMaterial-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订购单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="purchaseOrderNumber" 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="supplierCode" 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="supplierName" 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="rawSubsidiaryCode" 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="rawSubsidiaryName" 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"> |
|||
<select name="commonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_coin_class')}"> |
|||
<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="purchasingUnit" 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="purchasePrice" 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="materialQuantity" 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="amountMoney" 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="deliveryTime" 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="purchaseExplain" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "purchase/purchaseMaterial" |
|||
$("#form-purchaseMaterial-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-purchaseMaterial-add').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='deliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,99 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改采购材料信息')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-purchaseMaterial-edit" th:object="${purchaseMaterial}"> |
|||
<input name="purchaseMaterialId" th:field="*{purchaseMaterialId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">原辅料代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="rawSubsidiaryCode" th:field="*{rawSubsidiaryCode}" 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="rawSubsidiaryName" th:field="*{rawSubsidiaryName}" 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"> |
|||
<select name="commonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_coin_class')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{commonCurrency}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">采购单位:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="purchasingUnit" th:field="*{purchasingUnit}" 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="purchasePrice" th:field="*{purchasePrice}" 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="materialQuantity" th:field="*{materialQuantity}" 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="amountMoney" th:field="*{amountMoney}" 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="deliveryTime" th:value="${#dates.format(purchaseMaterial.deliveryTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">说明:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="purchaseExplain" th:field="*{purchaseExplain}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "purchase/purchaseMaterial"; |
|||
$("#form-purchaseMaterial-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-purchaseMaterial-edit').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='deliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,153 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('采购材料信息列表')" /> |
|||
</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="purchaseOrderNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>供应商代码:</label> |
|||
<input type="text" name="supplierCode"/> |
|||
</li> |
|||
<li> |
|||
<label>供应商名称:</label> |
|||
<input type="text" name="supplierName"/> |
|||
</li> |
|||
<li> |
|||
<label>原辅料代码:</label> |
|||
<input type="text" name="rawSubsidiaryCode"/> |
|||
</li> |
|||
<li> |
|||
<label>原辅料名称:</label> |
|||
<input type="text" name="rawSubsidiaryName"/> |
|||
</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="purchase:purchaseMaterial:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="purchase:purchaseMaterial:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="purchase:purchaseMaterial:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="purchase:purchaseMaterial:export"> |
|||
<i class="fa fa-download"></i> 导出 |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('purchase:purchaseMaterial:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('purchase:purchaseMaterial:remove')}]]; |
|||
var commonCurrencyDatas = [[${@dict.getType('sys_coin_class')}]]; |
|||
var prefix = ctx + "purchase/purchaseMaterial"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
modalName: "采购材料信息", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'purchaseOrderId', |
|||
title: '采购订单id' |
|||
}, |
|||
{ |
|||
field: 'purchaseOrderNumber', |
|||
title: '订购单号' |
|||
}, |
|||
{ |
|||
field: 'supplierCode', |
|||
title: '供应商代码' |
|||
}, |
|||
{ |
|||
field: 'supplierName', |
|||
title: '供应商名称' |
|||
}, |
|||
{ |
|||
field: 'rawSubsidiaryCode', |
|||
title: '原辅料代码' |
|||
}, |
|||
{ |
|||
field: 'rawSubsidiaryName', |
|||
title: '原辅料名称' |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'commonCurrency', |
|||
title: '币别', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(commonCurrencyDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'purchasingUnit', |
|||
title: '采购单位' |
|||
}, |
|||
{ |
|||
field: 'purchasePrice', |
|||
title: '采购单价' |
|||
}, |
|||
{ |
|||
field: 'materialQuantity', |
|||
title: '数量' |
|||
}, |
|||
{ |
|||
field: 'amountMoney', |
|||
title: '金额' |
|||
}, |
|||
{ |
|||
field: 'deliveryTime', |
|||
title: '交期' |
|||
}, |
|||
{ |
|||
field: 'purchaseExplain', |
|||
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.purchaseMaterialId + '\')"><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.purchaseMaterialId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,521 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增入库')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<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-warehousingInFinishProduct-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">入库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehousingNumber" 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="inNoticeNumber" class="form-control" type="text">--> |
|||
<select name="inNoticeNumber" class="form-control m-b" required> |
|||
<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="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}"> |
|||
<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="purchaseOrderNumber" 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="contacts" 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="warehousingDate" 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="supplierCode" 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="supplierName" 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="documentPreparationPersonnel" 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="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="exportSales" class="form-control m-b" th:with="type=${@dict.getType('sys_export_sales')}"> |
|||
<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"> |
|||
<textarea name="remarks" class="form-control"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">送货人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryMan" 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> |
|||
</form> |
|||
</div> |
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>材料信息</h4> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addDetailTable" style="white-space:nowrap"></table> |
|||
</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 + "storehouse/warehousingInInfo" |
|||
var prefixDetail = ctx + "storehouse/warehousingInDetail" |
|||
var prefixInspectionNotice = ctx + "storehouse/warehousingInspectionNotice"; |
|||
var prefixInspectionDetail = ctx + "storehouse/warehousingInspectionDetail"; |
|||
var prefixPurchaseMaterial = ctx + "purchase/purchaseMaterial"; |
|||
|
|||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
|
|||
$("#form-warehousingInFinishProduct-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
let getData=$('#addDetailTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0) { |
|||
//确认添加选中的物料数据 |
|||
if ($.validate.form()) { |
|||
confirmDetailMaterial(); |
|||
$.operate.save(prefix + "/add", $('#form-warehousingInFinishProduct-add').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请添加!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='warehousingDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
todayBtn: true |
|||
}); |
|||
$("input[name='warehousingDate']").datetimepicker('setDate', new Date()) |
|||
|
|||
//获取单号 |
|||
$.ajax({ |
|||
url: prefix + "/getFinishProductId", |
|||
type: "post", |
|||
dateType: "json", |
|||
success: function (resp) { |
|||
if (resp.code === 0) { |
|||
$("input[name='warehousingNumber']").val(resp.data); |
|||
} else { |
|||
$.modal.msgError("失败啦"); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}); |
|||
|
|||
//获取暂收单号 |
|||
$.ajax({ |
|||
url: prefixInspectionNotice + "/list", |
|||
type: "post", |
|||
dateType: "json", |
|||
success: function (res) { |
|||
if (res.rows.length > 0) { |
|||
var orderData = res.rows; |
|||
//alert(JSON.stringify(data)); |
|||
for (let i in orderData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-warehousingInFinishProduct-add select[name='inNoticeNumber']").append("<option value='" + orderData[i].inNoticeNumber + "'>" + orderData[i].inNoticeNumber + "</option>"); |
|||
} |
|||
$("#form-warehousingInFinishProduct-add select[name='inNoticeNumber']").change(function () { |
|||
var inNoticeNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].inNoticeNumber == inNoticeNumber) { |
|||
$("#form-warehousingInFinishProduct-add input[name='purchaseOrderNumber']").val(orderData[i].purchaseOrderNumber); |
|||
$("#form-warehousingInFinishProduct-add input[name='supplierCode']").val(orderData[i].supplierCode); |
|||
$("#form-warehousingInFinishProduct-add input[name='supplierName']").val(orderData[i].supplierName); |
|||
$("#form-warehousingInFinishProduct-add input[name='contacts']").val(orderData[i].customerContact); |
|||
$("#form-warehousingInFinishProduct-add input[name='stockNumber']").val(orderData[i].stockNumber); |
|||
$("#form-warehousingInFinishProduct-add input[name='stockName']").val(orderData[i].stockName); |
|||
$("#form-warehousingInFinishProduct-add input[name='stockManager']").val(orderData[i].stockManager); |
|||
$("#form-warehousingInFinishProduct-add input[name='exportSales']").val(orderData[i].exportSales); |
|||
$("#form-warehousingInFinishProduct-add select[name='warehousingCategory']").val(orderData[i].warehousingCategory).trigger('change'); |
|||
showDetailMaterial(); |
|||
} |
|||
} |
|||
}) |
|||
|
|||
} else { |
|||
$.modal.msgError(res.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}); |
|||
|
|||
//初始化添加材料表 |
|||
$('#addDetailTable').bootstrapTable({ |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true,//点击行选中 |
|||
contentType: "application/x-www-form-urlencoded", |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
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="removeMaterialData(\'' + row.materialCode + '\')" ><i class="fa fa-remove"></i>删除</a>'); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'warehousingDetailId', |
|||
title: '入库物料id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'warehousingNumber', |
|||
title: '入库单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'warehousingQuantity', |
|||
title: '合格数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '合格数量', |
|||
emptytext: '合格数量', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unitPrice', |
|||
title: '单价', |
|||
editable: { |
|||
type: 'text', |
|||
title: '单价', |
|||
emptytext: '单价', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'amountMoney', |
|||
title: '金额', |
|||
editable: { |
|||
type: 'text', |
|||
title: '金额', |
|||
emptytext: '金额', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
}, |
|||
formatter: function (value, row, index) { |
|||
let total = row.unitPrice * row.warehousingQuantity; |
|||
row.amountMoney = (row.unitPrice * row.warehousingQuantity).toFixed(2); |
|||
return total.toFixed(2); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'batchNumber', |
|||
title: '进货批号', |
|||
editable: { |
|||
type: 'text', |
|||
title: '进货批号', |
|||
emptytext: '进货批号', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
}, |
|||
formatter: (value, row, index) => { |
|||
console.log(value) |
|||
if (value === null) { |
|||
return '' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'manufacturerBatchNumber', |
|||
title: '厂商批号', |
|||
editable: { |
|||
type: 'text', |
|||
title: '厂商批号', |
|||
emptytext: '厂商批号', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
}, |
|||
formatter: (value, row, index) => { |
|||
console.log(value) |
|||
if (value === null) { |
|||
return '' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'storageLocation', |
|||
title: '存放地址', |
|||
editable: { |
|||
type: 'text', |
|||
title: '存放地址', |
|||
emptytext: '存放地址', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
}, |
|||
formatter: (value, row, index) => { |
|||
console.log(value) |
|||
if (value === null) { |
|||
return '' |
|||
} |
|||
} |
|||
}] |
|||
}) |
|||
|
|||
//选择暂收单号显示表内订单信息 |
|||
function showDetailMaterial() { |
|||
$('#addDetailTable').bootstrapTable("removeAll") |
|||
var inNoticeNumber = $("select[name='inNoticeNumber']").val(); |
|||
$.ajax({ |
|||
url: prefixInspectionDetail + '/list', |
|||
type: 'post', |
|||
data: { |
|||
inNoticeNumber: inNoticeNumber |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var warehousingNumber = $("input[name='warehousingNumber']").val(); |
|||
var purchaseOrderNumber = $("input[name='purchaseOrderNumber']").val(); |
|||
$.ajax({ |
|||
url: prefixPurchaseMaterial + '/list', |
|||
type: 'post', |
|||
data: { |
|||
purchaseOrderNumber: purchaseOrderNumber |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var data2 = res.rows; |
|||
for (i = 0; i < res.rows.length; i++) { |
|||
$("#addDetailTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
warehousingNumber: warehousingNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
materialType: data[i].materialType, |
|||
inventoryUnit: data[i].purchasingUnit, |
|||
warehousingQuantity: data[i].qualifiedQuantity, |
|||
unitPrice: data2[i].purchasePrice, |
|||
amountMoney: '', |
|||
description: data[i].purchaseExplain, |
|||
batchNumber: data[i].receiptBatchNumber, |
|||
manufacturerBatchNumber: data[i].manufacturerBatchNumber, |
|||
storageLocation: '' |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmDetailMaterial() { |
|||
$("#addDetailTable").bootstrapTable('refresh'); |
|||
let data = $('#addDetailTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
|
|||
//添加表格内删除物料信息 |
|||
function removeMaterialData(materialCode){ |
|||
var ids = []; |
|||
ids.push(materialCode); |
|||
$('#addDetailTable').bootstrapTable("remove",{ |
|||
field:'materialCode', |
|||
values:ids |
|||
}) |
|||
$("#addDetailTable").bootstrapTable('refresh'); |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,470 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改入库')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
<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-warehousingInFinishProduct-edit" th:object="${warehousingInInfo}"> |
|||
<input name="warehousingInfoId" th:field="*{warehousingInfoId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">入库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehousingNumber" th:field="*{warehousingNumber}" 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="inNoticeNumber" th:field="*{inNoticeNumber}" class="form-control" type="text">--> |
|||
<select name="inNoticeNumber" class="form-control m-b" required 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="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehousingCategory}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">采购订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="purchaseOrderNumber" th:field="*{purchaseOrderNumber}" 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="contacts" th:field="*{contacts}" 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="warehousingDate" th:field="*{warehousingDate}" 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="supplierCode" th:field="*{supplierCode}" 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="supplierName" th:field="*{supplierName}" 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="documentPreparationPersonnel" th:field="*{documentPreparationPersonnel}" 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="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="exportSales" class="form-control m-b" th:with="type=${@dict.getType('sys_export_sales')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{exportSales}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remarks" class="form-control">[[*{remarks}]]</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">送货人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryMan" th:field="*{deliveryMan}" 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> |
|||
</form> |
|||
</div> |
|||
<div class="other-container"> |
|||
<div class="other"> |
|||
<br><hr> |
|||
<h4>材料信息</h4> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="addDetailTable" style="white-space:nowrap"></table> |
|||
</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 = [[${warehousingInInfo}]] |
|||
var prefix = ctx + "storehouse/warehousingInInfo" |
|||
var prefixDetail = ctx + "storehouse/warehousingInDetail" |
|||
var prefixInspectionNotice = ctx + "storehouse/warehousingInspectionNotice"; |
|||
var prefixInspectionDetail = ctx + "storehouse/warehousingInspectionDetail"; |
|||
var prefixPurchaseMaterial = ctx + "purchase/purchaseMaterial"; |
|||
|
|||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
|
|||
$("#form-warehousingInFinishProduct-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
let getData=$('#addDetailTable').bootstrapTable('getData', true) |
|||
if(getData.length > 0) { |
|||
//确认添加选中的物料数据 |
|||
if ($.validate.form()) { |
|||
confirmDetailMaterial(); |
|||
$.operate.save(prefix + "/edit", $('#form-warehousingInFinishProduct-edit').serialize()); |
|||
} |
|||
} else { |
|||
$.modal.alertWarning("未选择物料,请添加!") |
|||
} |
|||
} |
|||
|
|||
$("input[name='warehousingDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
//获取暂收单号 |
|||
$.ajax({ |
|||
url: prefixInspectionNotice + "/list", |
|||
type: "post", |
|||
dateType: "json", |
|||
success: function (res) { |
|||
if (res.rows.length > 0) { |
|||
var orderData = res.rows; |
|||
//alert(JSON.stringify(data)); |
|||
for (let i in orderData) { |
|||
// console.log(finishProductData[i].finishProductCode) |
|||
$("#form-warehousingInFinishProduct-edit select[name='inNoticeNumber']").append("<option value='" + orderData[i].inNoticeNumber + "'>" + orderData[i].inNoticeNumber + "</option>"); |
|||
} |
|||
$("#form-warehousingInFinishProduct-edit select[name='inNoticeNumber']").val(getData.inNoticeNumber).trigger("change") |
|||
$("#form-warehousingInFinishProduct-edit select[name='warehousingCategory']").val(getData.warehousingCategory).trigger("change") |
|||
$("#form-warehousingInFinishProduct-edit select[name='inNoticeNumber']").change(function () { |
|||
var inNoticeNumber = $(this).val(); |
|||
for (let i=0;i<orderData.length;i++) { |
|||
if (orderData[i].inNoticeNumber == inNoticeNumber) { |
|||
$("#form-warehousingInFinishProduct-edit input[name='purchaseOrderNumber']").val(orderData[i].purchaseOrderNumber); |
|||
$("#form-warehousingInFinishProduct-edit input[name='supplierCode']").val(orderData[i].supplierCode); |
|||
$("#form-warehousingInFinishProduct-edit input[name='supplierName']").val(orderData[i].supplierName); |
|||
$("#form-warehousingInFinishProduct-edit input[name='contacts']").val(orderData[i].customerContact); |
|||
$("#form-warehousingInFinishProduct-edit input[name='stockNumber']").val(orderData[i].stockNumber); |
|||
$("#form-warehousingInFinishProduct-edit input[name='stockName']").val(orderData[i].stockName); |
|||
$("#form-warehousingInFinishProduct-edit input[name='stockManager']").val(orderData[i].stockManager); |
|||
$("#form-warehousingInFinishProduct-edit input[name='exportSales']").val(orderData[i].exportSales); |
|||
$("#form-warehousingInFinishProduct-edit select[name='warehousingCategory']").val(orderData[i].warehousingCategory).trigger('change'); |
|||
showDetailMaterial(); |
|||
} |
|||
} |
|||
}) |
|||
|
|||
} else { |
|||
$.modal.msgError(res.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}); |
|||
|
|||
//初始化添加材料表 |
|||
$('#addDetailTable').bootstrapTable({ |
|||
url: prefixDetail + '/list', |
|||
method: "post", |
|||
pagination: true, |
|||
pageNumber: 1, |
|||
pageSize: 10, |
|||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|||
cardView: false, // 是否显示详细视图 |
|||
detailView: false, // 是否显示父子表 |
|||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|||
showExport: false, // 是否显示导出按钮 |
|||
clickToSelect: true,//点击行选中 |
|||
contentType: "application/x-www-form-urlencoded", |
|||
paginationDetailHAlign: ' hiddenDetailInfo', |
|||
height: 250, |
|||
queryParams: function (params) { |
|||
//console.log("123"); |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
warehousingNumber: getData.warehousingNumber |
|||
// enterpriseCode: data[0].enterpriseCode |
|||
}; |
|||
// console.log(data[0].enterpriseCode) |
|||
return curParams |
|||
}, |
|||
columns: [ |
|||
{ |
|||
field: 'warehousingDetailId', |
|||
title: '入库物料id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'warehousingNumber', |
|||
title: '入库单号', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'materialCode', |
|||
title: '物料代码' |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
title: '物料名称' |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
title: '物料类别', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'specificationModel', |
|||
title: '规格型号' |
|||
}, |
|||
{ |
|||
field: 'inventoryUnit', |
|||
title: '单位', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'warehousingQuantity', |
|||
title: '合格数量', |
|||
editable: { |
|||
type: 'text', |
|||
title: '合格数量', |
|||
emptytext: '合格数量', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unitPrice', |
|||
title: '单价', |
|||
editable: { |
|||
type: 'text', |
|||
title: '单价', |
|||
emptytext: '单价', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'amountMoney', |
|||
title: '金额', |
|||
editable: { |
|||
type: 'text', |
|||
title: '金额', |
|||
emptytext: '金额', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
}, |
|||
formatter: function (value, row, index) { |
|||
let total = row.unitPrice * row.warehousingQuantity; |
|||
row.amountMoney = (row.unitPrice * row.warehousingQuantity).toFixed(2); |
|||
return total.toFixed(2); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'description', |
|||
title: '说明', |
|||
editable: { |
|||
type: 'text', |
|||
title: '说明', |
|||
emptytext: '说明', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'batchNumber', |
|||
title: '进货批号', |
|||
editable: { |
|||
type: 'text', |
|||
title: '进货批号', |
|||
emptytext: '进货批号', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'manufacturerBatchNumber', |
|||
title: '厂商批号', |
|||
editable: { |
|||
type: 'text', |
|||
title: '厂商批号', |
|||
emptytext: '厂商批号', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'storageLocation', |
|||
title: '存放地址', |
|||
editable: { |
|||
type: 'text', |
|||
title: '存放地址', |
|||
emptytext: '存放地址', |
|||
validate: function (v) { |
|||
|
|||
} |
|||
} |
|||
}] |
|||
}) |
|||
|
|||
//选择暂收单号显示表内订单信息 |
|||
function showDetailMaterial() { |
|||
$('#addDetailTable').bootstrapTable("removeAll") |
|||
var inNoticeNumber = $("select[name='inNoticeNumber']").val(); |
|||
$.ajax({ |
|||
url: prefixInspectionDetail + '/list', |
|||
type: 'post', |
|||
data: { |
|||
inNoticeNumber: inNoticeNumber |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var count = res.rows.length; |
|||
var data = res.rows; |
|||
var warehousingNumber = $("input[name='warehousingNumber']").val(); |
|||
var purchaseOrderNumber = $("input[name='purchaseOrderNumber']").val(); |
|||
$.ajax({ |
|||
url: prefixPurchaseMaterial + '/list', |
|||
type: 'post', |
|||
data: { |
|||
purchaseOrderNumber: purchaseOrderNumber |
|||
}, |
|||
success: function (res) { |
|||
console.log(res) |
|||
var data2 = res.rows; |
|||
for (i = 0; i < res.rows.length; i++) { |
|||
$("#addDetailTable").bootstrapTable('insertRow', { |
|||
index: count + i, |
|||
row: { |
|||
warehousingNumber: warehousingNumber, |
|||
materialCode: data[i].materialCode, |
|||
materialName: data[i].materialName, |
|||
specificationModel: data[i].specificationModel, |
|||
materialType: data[i].materialType, |
|||
inventoryUnit: data[i].purchasingUnit, |
|||
warehousingQuantity: data[i].qualifiedQuantity, |
|||
unitPrice: data2[i].purchasePrice, |
|||
amountMoney: '', |
|||
description: data[i].purchaseExplain, |
|||
batchNumber: data[i].receiptBatchNumber, |
|||
manufacturerBatchNumber: data[i].manufacturerBatchNumber, |
|||
storageLocation: '' |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
//确认添加选中的物料数据 |
|||
function confirmDetailMaterial() { |
|||
$("#addDetailTable").bootstrapTable('refresh'); |
|||
let data = $('#addDetailTable').bootstrapTable('getData', true); |
|||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|||
// console.log(data) |
|||
$.ajax({ |
|||
url: prefixDetail + '/addEditSave', |
|||
type: "POST", |
|||
data: { |
|||
data: JSON.stringify(data) |
|||
}, |
|||
dataType: "json", |
|||
success: function (resp) { |
|||
// console.log(data) |
|||
console.log(resp) |
|||
}, |
|||
|
|||
}) |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,268 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('入库列表')" /> |
|||
</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="warehousingNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>暂收单号:</label> |
|||
<input type="text" name="inNoticeNumber"/> |
|||
</li> |
|||
<li> |
|||
<label>入库类型:</label> |
|||
<select name="warehousingCategory" th:with="type=${@dict.getType('warehousing_category')}"> |
|||
<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="purchaseOrderNumber"/> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>入库日期:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingDate]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingDate]"/> |
|||
</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> |
|||
<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:warehousingInFinishProduct:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storehouse:warehousingInFinishProduct:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInFinishProduct:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingInFinishProduct: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:warehousingInFinishProduct:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('storehouse:warehousingInFinishProduct:remove')}]]; |
|||
var warehousingCategoryDatas = [[${@dict.getType('warehousing_category')}]]; |
|||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|||
var prefix = ctx + "storehouse/warehousingInInfo"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/listFinishProduct", |
|||
createUrl: prefix + "/addFinishProduct", |
|||
updateUrl: prefix + "/editFinishProduct/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
clickToSelect: true, |
|||
modalName: "入库", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'warehousingInfoId', |
|||
title: '入库id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'warehousingNumber', |
|||
title: '入库单号' |
|||
}, |
|||
{ |
|||
field: 'inNoticeNumber', |
|||
title: '暂收单号' |
|||
}, |
|||
{ |
|||
field: 'warehousingCategory', |
|||
title: '入库类型', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(warehousingCategoryDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'purchaseOrderNumber', |
|||
title: '采购订单号' |
|||
}, |
|||
{ |
|||
field: 'contacts', |
|||
title: '联系人' |
|||
}, |
|||
{ |
|||
field: 'warehousingDate', |
|||
title: '入库日期' |
|||
}, |
|||
{ |
|||
field: 'supplierCode', |
|||
title: '供应商代码' |
|||
}, |
|||
{ |
|||
field: 'supplierName', |
|||
title: '供应商名称' |
|||
}, |
|||
{ |
|||
field: 'documentPreparationPersonnel', |
|||
title: '制单人员' |
|||
}, |
|||
{ |
|||
field: 'stockNumber', |
|||
title: '仓库号' |
|||
}, |
|||
{ |
|||
field: 'stockName', |
|||
title: '仓库名称' |
|||
}, |
|||
{ |
|||
field: 'stockManager', |
|||
title: '仓库管理员' |
|||
}, |
|||
{ |
|||
field: 'exportSales', |
|||
title: '内外销', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(exportSalesDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'remarks', |
|||
title: '备注' |
|||
}, |
|||
{ |
|||
field: 'deliveryMan', |
|||
title: '送货人' |
|||
}, |
|||
{ |
|||
field: 'enterpriseCode', |
|||
title: '客户代码' |
|||
}, |
|||
{ |
|||
field: 'enterpriseName', |
|||
title: '客户名称' |
|||
}, |
|||
{ |
|||
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]; |
|||
} |
|||
} |
|||
}] |
|||
}; |
|||
$.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 exportSelectedSubsidiary() { |
|||
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 { |
|||
$.modal.confirm("是否确认要导出本条订单?", function (){ |
|||
axios({ |
|||
url: prefix + '/exportSelectedSubsidiary/'+data[0].warehousingInfoId, |
|||
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> |
Loading…
Reference in new issue