Compare commits
7 Commits
0507f7602c
...
7a018b4296
Author | SHA1 | Date |
---|---|---|
zhangsiqi | 7a018b4296 | 3 months ago |
zhangsiqi | 580766f56c | 3 months ago |
zhangsiqi | 64545bfd25 | 3 months ago |
zhangsiqi | f026a32067 | 3 months ago |
zhangsiqi | cbc463bfa1 | 3 months ago |
zhangsiqi | 178cb9aad5 | 3 months ago |
zhangsiqi | 84e55eea6e | 3 months ago |
38 changed files with 2595 additions and 957 deletions
@ -0,0 +1,151 @@ |
|||||
|
package com.ruoyi.purchase.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.purchase.domain.PurchaseQuoteHistory; |
||||
|
import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService; |
||||
|
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 zhang |
||||
|
* @date 2024-08-28 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/purchaseQuoteHistory/purchaseQuoteHistory") |
||||
|
public class PurchaseQuoteHistoryController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "purchaseQuoteHistory/purchaseQuoteHistory"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IPurchaseQuoteHistoryService purchaseQuoteHistoryService; |
||||
|
|
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:view") |
||||
|
@GetMapping() |
||||
|
public String purchaseQuoteHistory() |
||||
|
{ |
||||
|
return prefix + "/purchaseQuoteHistory"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询采购物料历史报价信息列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(PurchaseQuoteHistory purchaseQuoteHistory) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<PurchaseQuoteHistory> list = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryList(purchaseQuoteHistory); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出采购物料历史报价信息列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:export") |
||||
|
@Log(title = "采购物料历史报价信息", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
@ResponseBody |
||||
|
public AjaxResult export(PurchaseQuoteHistory purchaseQuoteHistory) |
||||
|
{ |
||||
|
List<PurchaseQuoteHistory> list = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryList(purchaseQuoteHistory); |
||||
|
ExcelUtil<PurchaseQuoteHistory> util = new ExcelUtil<PurchaseQuoteHistory>(PurchaseQuoteHistory.class); |
||||
|
return util.exportExcel(list, "采购物料历史报价信息数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增采购物料历史报价信息 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存采购物料历史报价信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:add") |
||||
|
@Log(title = "采购物料历史报价信息", businessType = BusinessType.INSERT) |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public AjaxResult addSave(PurchaseQuoteHistory purchaseQuoteHistory) |
||||
|
{ |
||||
|
return toAjax(purchaseQuoteHistoryService.insertPurchaseQuoteHistory(purchaseQuoteHistory)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改采购物料历史报价信息 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{purchaseQuoteChildId}") |
||||
|
public String edit(@PathVariable("purchaseQuoteChildId") Long purchaseQuoteChildId, ModelMap mmap) |
||||
|
{ |
||||
|
PurchaseQuoteHistory purchaseQuoteHistory = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryById(purchaseQuoteChildId); |
||||
|
mmap.put("purchaseQuoteHistory", purchaseQuoteHistory); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存采购物料历史报价信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:edit") |
||||
|
@Log(title = "采购物料历史报价信息", businessType = BusinessType.UPDATE) |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public AjaxResult editSave(PurchaseQuoteHistory purchaseQuoteHistory) |
||||
|
{ |
||||
|
return toAjax(purchaseQuoteHistoryService.updatePurchaseQuoteHistory(purchaseQuoteHistory)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除采购物料历史报价信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:remove") |
||||
|
@Log(title = "采购物料历史报价信息", businessType = BusinessType.DELETE) |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public AjaxResult remove(String ids) |
||||
|
{ |
||||
|
return toAjax(purchaseQuoteHistoryService.deletePurchaseQuoteHistoryByIds(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废采购物料历史报价信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:cancel") |
||||
|
@Log(title = "采购物料历史报价信息", businessType = BusinessType.CANCEL) |
||||
|
@GetMapping( "/cancel/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult cancel(@PathVariable("id") Long id){ |
||||
|
return toAjax(purchaseQuoteHistoryService.cancelPurchaseQuoteHistoryById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复采购物料历史报价信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("purchaseQuoteHistory:purchaseQuoteHistory:restore") |
||||
|
@Log(title = "采购物料历史报价信息", businessType = BusinessType.RESTORE) |
||||
|
@GetMapping( "/restore/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult restore(@PathVariable("id")Long id) |
||||
|
{ |
||||
|
return toAjax(purchaseQuoteHistoryService.restorePurchaseQuoteHistoryById(id)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,323 @@ |
|||||
|
package com.ruoyi.purchase.domain; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
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_quote_history |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-08-28 |
||||
|
*/ |
||||
|
public class PurchaseQuoteHistory extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 采购报价历史id */ |
||||
|
@Excel(name = "采购报价历史id") |
||||
|
private Long purchaseQuoteChildId; |
||||
|
|
||||
|
/** 关联报价编号字段 */ |
||||
|
@Excel(name = "关联报价编号字段") |
||||
|
private String purchaseQuoteCode; |
||||
|
|
||||
|
/** 物料表中的id */ |
||||
|
@Excel(name = "物料表中的id") |
||||
|
private Long materialId; |
||||
|
|
||||
|
/** 物料表中的编号 */ |
||||
|
@Excel(name = "物料表中的编号") |
||||
|
private String materialCode; |
||||
|
|
||||
|
/** 物料的名称 */ |
||||
|
@Excel(name = "物料的名称") |
||||
|
private String materialName; |
||||
|
|
||||
|
/** 物料的类型 */ |
||||
|
@Excel(name = "物料的类型") |
||||
|
private String materialType; |
||||
|
|
||||
|
/** 物料的加工方式 */ |
||||
|
@Excel(name = "物料的加工方式") |
||||
|
private String processMethod; |
||||
|
|
||||
|
/** 物料的品牌 */ |
||||
|
@Excel(name = "物料的品牌") |
||||
|
private String brand; |
||||
|
|
||||
|
/** 物料的图片 */ |
||||
|
@Excel(name = "物料的图片") |
||||
|
private String photoUrl; |
||||
|
|
||||
|
/** 物料的描述 */ |
||||
|
@Excel(name = "物料的描述") |
||||
|
private String describe; |
||||
|
|
||||
|
/** 国内税率 */ |
||||
|
@Excel(name = "国内税率") |
||||
|
private BigDecimal taxRate; |
||||
|
|
||||
|
/** 美元汇率 */ |
||||
|
@Excel(name = "美元汇率") |
||||
|
private BigDecimal usdRate; |
||||
|
|
||||
|
/** 物料的数量 */ |
||||
|
@Excel(name = "物料的数量") |
||||
|
private BigDecimal materialNum; |
||||
|
|
||||
|
/** 物料的对外报价 */ |
||||
|
@Excel(name = "物料的对外报价") |
||||
|
private Long materialSole; |
||||
|
|
||||
|
/** 物料的不含税单价(RMB) */ |
||||
|
@Excel(name = "物料的不含税单价(RMB)") |
||||
|
private BigDecimal materialRmb; |
||||
|
|
||||
|
/** 物料的含税单价(RMB) */ |
||||
|
@Excel(name = "物料的含税单价(RMB)") |
||||
|
private BigDecimal materialNormb; |
||||
|
|
||||
|
/** 供应商编号 */ |
||||
|
@Excel(name = "供应商编号") |
||||
|
private String supplierCode; |
||||
|
|
||||
|
/** 供应商名称 */ |
||||
|
@Excel(name = "供应商名称") |
||||
|
private String supplierName; |
||||
|
|
||||
|
/** 删除状态 */ |
||||
|
@Excel(name = "删除状态") |
||||
|
private String useStatus; |
||||
|
|
||||
|
/** 审核状态 */ |
||||
|
@Excel(name = "审核状态") |
||||
|
private String auditStatus; |
||||
|
|
||||
|
/** 删除标志 */ |
||||
|
private String delFlag; |
||||
|
|
||||
|
public void setPurchaseQuoteChildId(Long purchaseQuoteChildId) |
||||
|
{ |
||||
|
this.purchaseQuoteChildId = purchaseQuoteChildId; |
||||
|
} |
||||
|
|
||||
|
public Long getPurchaseQuoteChildId() |
||||
|
{ |
||||
|
return purchaseQuoteChildId; |
||||
|
} |
||||
|
public void setPurchaseQuoteCode(String purchaseQuoteCode) |
||||
|
{ |
||||
|
this.purchaseQuoteCode = purchaseQuoteCode; |
||||
|
} |
||||
|
|
||||
|
public String getPurchaseQuoteCode() |
||||
|
{ |
||||
|
return purchaseQuoteCode; |
||||
|
} |
||||
|
public void setMaterialId(Long materialId) |
||||
|
{ |
||||
|
this.materialId = materialId; |
||||
|
} |
||||
|
|
||||
|
public Long getMaterialId() |
||||
|
{ |
||||
|
return materialId; |
||||
|
} |
||||
|
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 setProcessMethod(String processMethod) |
||||
|
{ |
||||
|
this.processMethod = processMethod; |
||||
|
} |
||||
|
|
||||
|
public String getProcessMethod() |
||||
|
{ |
||||
|
return processMethod; |
||||
|
} |
||||
|
public void setBrand(String brand) |
||||
|
{ |
||||
|
this.brand = brand; |
||||
|
} |
||||
|
|
||||
|
public String getBrand() |
||||
|
{ |
||||
|
return brand; |
||||
|
} |
||||
|
public void setPhotoUrl(String photoUrl) |
||||
|
{ |
||||
|
this.photoUrl = photoUrl; |
||||
|
} |
||||
|
|
||||
|
public String getPhotoUrl() |
||||
|
{ |
||||
|
return photoUrl; |
||||
|
} |
||||
|
public void setDescribe(String describe) |
||||
|
{ |
||||
|
this.describe = describe; |
||||
|
} |
||||
|
|
||||
|
public String getDescribe() |
||||
|
{ |
||||
|
return describe; |
||||
|
} |
||||
|
public void setTaxRate(BigDecimal taxRate) |
||||
|
{ |
||||
|
this.taxRate = taxRate; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getTaxRate() |
||||
|
{ |
||||
|
return taxRate; |
||||
|
} |
||||
|
public void setUsdRate(BigDecimal usdRate) |
||||
|
{ |
||||
|
this.usdRate = usdRate; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getUsdRate() |
||||
|
{ |
||||
|
return usdRate; |
||||
|
} |
||||
|
public void setMaterialNum(BigDecimal materialNum) |
||||
|
{ |
||||
|
this.materialNum = materialNum; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getMaterialNum() |
||||
|
{ |
||||
|
return materialNum; |
||||
|
} |
||||
|
public void setMaterialSole(Long materialSole) |
||||
|
{ |
||||
|
this.materialSole = materialSole; |
||||
|
} |
||||
|
|
||||
|
public Long getMaterialSole() |
||||
|
{ |
||||
|
return materialSole; |
||||
|
} |
||||
|
public void setMaterialRmb(BigDecimal materialRmb) |
||||
|
{ |
||||
|
this.materialRmb = materialRmb; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getMaterialRmb() |
||||
|
{ |
||||
|
return materialRmb; |
||||
|
} |
||||
|
public void setMaterialNormb(BigDecimal materialNormb) |
||||
|
{ |
||||
|
this.materialNormb = materialNormb; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getMaterialNormb() |
||||
|
{ |
||||
|
return materialNormb; |
||||
|
} |
||||
|
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 setUseStatus(String useStatus) |
||||
|
{ |
||||
|
this.useStatus = useStatus; |
||||
|
} |
||||
|
|
||||
|
public String getUseStatus() |
||||
|
{ |
||||
|
return useStatus; |
||||
|
} |
||||
|
public void setAuditStatus(String auditStatus) |
||||
|
{ |
||||
|
this.auditStatus = auditStatus; |
||||
|
} |
||||
|
|
||||
|
public String getAuditStatus() |
||||
|
{ |
||||
|
return auditStatus; |
||||
|
} |
||||
|
public void setDelFlag(String delFlag) |
||||
|
{ |
||||
|
this.delFlag = delFlag; |
||||
|
} |
||||
|
|
||||
|
public String getDelFlag() |
||||
|
{ |
||||
|
return delFlag; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("purchaseQuoteChildId", getPurchaseQuoteChildId()) |
||||
|
.append("purchaseQuoteCode", getPurchaseQuoteCode()) |
||||
|
.append("materialId", getMaterialId()) |
||||
|
.append("materialCode", getMaterialCode()) |
||||
|
.append("materialName", getMaterialName()) |
||||
|
.append("materialType", getMaterialType()) |
||||
|
.append("processMethod", getProcessMethod()) |
||||
|
.append("brand", getBrand()) |
||||
|
.append("photoUrl", getPhotoUrl()) |
||||
|
.append("describe", getDescribe()) |
||||
|
.append("taxRate", getTaxRate()) |
||||
|
.append("usdRate", getUsdRate()) |
||||
|
.append("materialNum", getMaterialNum()) |
||||
|
.append("materialSole", getMaterialSole()) |
||||
|
.append("materialRmb", getMaterialRmb()) |
||||
|
.append("materialNormb", getMaterialNormb()) |
||||
|
.append("supplierCode", getSupplierCode()) |
||||
|
.append("supplierName", getSupplierName()) |
||||
|
.append("createBy", getCreateBy()) |
||||
|
.append("createTime", getCreateTime()) |
||||
|
.append("updateBy", getUpdateBy()) |
||||
|
.append("updateTime", getUpdateTime()) |
||||
|
.append("remark", getRemark()) |
||||
|
.append("useStatus", getUseStatus()) |
||||
|
.append("auditStatus", getAuditStatus()) |
||||
|
.append("delFlag", getDelFlag()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.ruoyi.purchase.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.purchase.domain.PurchaseQuoteHistory; |
||||
|
|
||||
|
/** |
||||
|
* 采购物料历史报价信息Mapper接口 |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-08-28 |
||||
|
*/ |
||||
|
public interface PurchaseQuoteHistoryMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 采购物料历史报价信息 |
||||
|
*/ |
||||
|
public PurchaseQuoteHistory selectPurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
|
||||
|
/** |
||||
|
* 查询采购物料历史报价信息列表 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 采购物料历史报价信息集合 |
||||
|
*/ |
||||
|
public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory); |
||||
|
|
||||
|
/** |
||||
|
* 新增采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertPurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory); |
||||
|
|
||||
|
/** |
||||
|
* 修改采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updatePurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory); |
||||
|
|
||||
|
/** |
||||
|
* 删除采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deletePurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildIds 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deletePurchaseQuoteHistoryByIds(String[] purchaseQuoteChildIds); |
||||
|
|
||||
|
/** |
||||
|
* 作废采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int cancelPurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
|
||||
|
/** |
||||
|
* 恢复采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
package com.ruoyi.purchase.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.purchase.domain.PurchaseQuoteHistory; |
||||
|
|
||||
|
/** |
||||
|
* 采购物料历史报价信息Service接口 |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-08-28 |
||||
|
*/ |
||||
|
public interface IPurchaseQuoteHistoryService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 采购物料历史报价信息 |
||||
|
*/ |
||||
|
public PurchaseQuoteHistory selectPurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
|
||||
|
/** |
||||
|
* 查询采购物料历史报价信息列表 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 采购物料历史报价信息集合 |
||||
|
*/ |
||||
|
public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory); |
||||
|
|
||||
|
/** |
||||
|
* 新增采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertPurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory); |
||||
|
|
||||
|
/** |
||||
|
* 修改采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updatePurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除采购物料历史报价信息 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deletePurchaseQuoteHistoryByIds(String ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除采购物料历史报价信息信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deletePurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
|
||||
|
/** |
||||
|
* 作废采购物料历史报价信息 |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int cancelPurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
|
||||
|
/** |
||||
|
* 恢复采购物料历史报价信息 |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId); |
||||
|
} |
@ -0,0 +1,126 @@ |
|||||
|
package com.ruoyi.purchase.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.common.utils.DateUtils; |
||||
|
import com.ruoyi.common.utils.ShiroUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.ruoyi.purchase.mapper.PurchaseQuoteHistoryMapper; |
||||
|
import com.ruoyi.purchase.domain.PurchaseQuoteHistory; |
||||
|
import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService; |
||||
|
import com.ruoyi.common.core.text.Convert; |
||||
|
|
||||
|
/** |
||||
|
* 采购物料历史报价信息Service业务层处理 |
||||
|
* |
||||
|
* @author zhang |
||||
|
* @date 2024-08-28 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class PurchaseQuoteHistoryServiceImpl implements IPurchaseQuoteHistoryService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private PurchaseQuoteHistoryMapper purchaseQuoteHistoryMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 采购物料历史报价信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public PurchaseQuoteHistory selectPurchaseQuoteHistoryById(Long purchaseQuoteChildId) |
||||
|
{ |
||||
|
return purchaseQuoteHistoryMapper.selectPurchaseQuoteHistoryById(purchaseQuoteChildId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询采购物料历史报价信息列表 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 采购物料历史报价信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory) |
||||
|
{ |
||||
|
return purchaseQuoteHistoryMapper.selectPurchaseQuoteHistoryList(purchaseQuoteHistory); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertPurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
purchaseQuoteHistory.setCreateBy(loginName); |
||||
|
purchaseQuoteHistory.setCreateTime(DateUtils.getNowDate()); |
||||
|
return purchaseQuoteHistoryMapper.insertPurchaseQuoteHistory(purchaseQuoteHistory); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteHistory 采购物料历史报价信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updatePurchaseQuoteHistory(PurchaseQuoteHistory purchaseQuoteHistory) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
purchaseQuoteHistory.setUpdateBy(loginName); |
||||
|
purchaseQuoteHistory.setUpdateTime(DateUtils.getNowDate()); |
||||
|
return purchaseQuoteHistoryMapper.updatePurchaseQuoteHistory(purchaseQuoteHistory); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除采购物料历史报价信息对象 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deletePurchaseQuoteHistoryByIds(String ids) |
||||
|
{ |
||||
|
return purchaseQuoteHistoryMapper.deletePurchaseQuoteHistoryByIds(Convert.toStrArray(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除采购物料历史报价信息信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deletePurchaseQuoteHistoryById(Long purchaseQuoteChildId) |
||||
|
{ |
||||
|
return purchaseQuoteHistoryMapper.deletePurchaseQuoteHistoryById(purchaseQuoteChildId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废采购物料历史报价信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int cancelPurchaseQuoteHistoryById(Long purchaseQuoteChildId) |
||||
|
{ |
||||
|
return purchaseQuoteHistoryMapper.cancelPurchaseQuoteHistoryById(purchaseQuoteChildId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复采购物料历史报价信息信息 |
||||
|
* |
||||
|
* @param purchaseQuoteChildId 采购物料历史报价信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId) |
||||
|
{ |
||||
|
return purchaseQuoteHistoryMapper.restorePurchaseQuoteHistoryById(purchaseQuoteChildId); |
||||
|
} |
||||
|
} |
@ -0,0 +1,180 @@ |
|||||
|
<?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.PurchaseQuoteHistoryMapper"> |
||||
|
|
||||
|
<resultMap type="PurchaseQuoteHistory" id="PurchaseQuoteHistoryResult"> |
||||
|
<result property="purchaseQuoteChildId" column="purchase_quote_child_id" /> |
||||
|
<result property="purchaseQuoteCode" column="purchase_quote_code" /> |
||||
|
<result property="materialId" column="material_id" /> |
||||
|
<result property="materialCode" column="material_code" /> |
||||
|
<result property="materialName" column="material_name" /> |
||||
|
<result property="materialType" column="material_type" /> |
||||
|
<result property="processMethod" column="processMethod" /> |
||||
|
<result property="brand" column="brand" /> |
||||
|
<result property="photoUrl" column="photoUrl" /> |
||||
|
<result property="describe" column="describe" /> |
||||
|
<result property="taxRate" column="tax_rate" /> |
||||
|
<result property="usdRate" column="usd_rate" /> |
||||
|
<result property="materialNum" column="material_num" /> |
||||
|
<result property="materialSole" column="material_sole" /> |
||||
|
<result property="materialRmb" column="material_rmb" /> |
||||
|
<result property="materialNormb" column="material_noRmb" /> |
||||
|
<result property="supplierCode" column="supplier_code" /> |
||||
|
<result property="supplierName" column="supplier_name" /> |
||||
|
<result property="createBy" column="create_by" /> |
||||
|
<result property="createTime" column="create_time" /> |
||||
|
<result property="updateBy" column="update_by" /> |
||||
|
<result property="updateTime" column="update_time" /> |
||||
|
<result property="remark" column="remark" /> |
||||
|
<result property="useStatus" column="use_status" /> |
||||
|
<result property="auditStatus" column="audit_status" /> |
||||
|
<result property="delFlag" column="del_flag" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectPurchaseQuoteHistoryVo"> |
||||
|
select purchase_quote_child_id, purchase_quote_code, material_id, material_code, material_name, material_type, processMethod, brand, photoUrl, describe, tax_rate, usd_rate, material_num, material_sole, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, remark, use_status, audit_status, del_flag from purchase_quote_history |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectPurchaseQuoteHistoryList" parameterType="PurchaseQuoteHistory" resultMap="PurchaseQuoteHistoryResult"> |
||||
|
<include refid="selectPurchaseQuoteHistoryVo"/> |
||||
|
<where> |
||||
|
<if test="purchaseQuoteChildId != null "> and purchase_quote_child_id = #{purchaseQuoteChildId}</if> |
||||
|
<if test="purchaseQuoteCode != null and purchaseQuoteCode != ''"> and purchase_quote_code = #{purchaseQuoteCode}</if> |
||||
|
<if test="materialId != null "> and material_id = #{materialId}</if> |
||||
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{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="processMethod != null and processMethod != ''"> and processMethod = #{processMethod}</if> |
||||
|
<if test="brand != null and brand != ''"> and brand = #{brand}</if> |
||||
|
<if test="photoUrl != null and photoUrl != ''"> and photoUrl = #{photoUrl}</if> |
||||
|
<if test="describe != null and describe != ''"> and describe = #{describe}</if> |
||||
|
<if test="taxRate != null "> and tax_rate = #{taxRate}</if> |
||||
|
<if test="usdRate != null "> and usd_rate = #{usdRate}</if> |
||||
|
<if test="materialNum != null "> and material_num = #{materialNum}</if> |
||||
|
<if test="materialSole != null "> and material_sole = #{materialSole}</if> |
||||
|
<if test="materialRmb != null "> and material_rmb = #{materialRmb}</if> |
||||
|
<if test="materialNormb != null "> and material_noRmb = #{materialNormb}</if> |
||||
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if> |
||||
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if> |
||||
|
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if> |
||||
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectPurchaseQuoteHistoryById" parameterType="Long" resultMap="PurchaseQuoteHistoryResult"> |
||||
|
<include refid="selectPurchaseQuoteHistoryVo"/> |
||||
|
where purchase_quote_child_id = #{purchaseQuoteChildId} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertPurchaseQuoteHistory" parameterType="PurchaseQuoteHistory" useGeneratedKeys="true" keyProperty="purchaseQuoteChildId"> |
||||
|
insert into purchase_quote_history |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="purchaseQuoteCode != null">purchase_quote_code,</if> |
||||
|
<if test="materialId != null">material_id,</if> |
||||
|
<if test="materialCode != null">material_code,</if> |
||||
|
<if test="materialName != null">material_name,</if> |
||||
|
<if test="materialType != null">material_type,</if> |
||||
|
<if test="processMethod != null">processMethod,</if> |
||||
|
<if test="brand != null">brand,</if> |
||||
|
<if test="photoUrl != null">photoUrl,</if> |
||||
|
<if test="describe != null">describe,</if> |
||||
|
<if test="taxRate != null">tax_rate,</if> |
||||
|
<if test="usdRate != null">usd_rate,</if> |
||||
|
<if test="materialNum != null">material_num,</if> |
||||
|
<if test="materialSole != null">material_sole,</if> |
||||
|
<if test="materialRmb != null">material_rmb,</if> |
||||
|
<if test="materialNormb != null">material_noRmb,</if> |
||||
|
<if test="supplierCode != null">supplier_code,</if> |
||||
|
<if test="supplierName != null">supplier_name,</if> |
||||
|
<if test="createBy != null">create_by,</if> |
||||
|
<if test="createTime != null">create_time,</if> |
||||
|
<if test="updateBy != null">update_by,</if> |
||||
|
<if test="updateTime != null">update_time,</if> |
||||
|
<if test="remark != null">remark,</if> |
||||
|
<if test="useStatus != null">use_status,</if> |
||||
|
<if test="auditStatus != null">audit_status,</if> |
||||
|
<if test="delFlag != null">del_flag,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="purchaseQuoteCode != null">#{purchaseQuoteCode},</if> |
||||
|
<if test="materialId != null">#{materialId},</if> |
||||
|
<if test="materialCode != null">#{materialCode},</if> |
||||
|
<if test="materialName != null">#{materialName},</if> |
||||
|
<if test="materialType != null">#{materialType},</if> |
||||
|
<if test="processMethod != null">#{processMethod},</if> |
||||
|
<if test="brand != null">#{brand},</if> |
||||
|
<if test="photoUrl != null">#{photoUrl},</if> |
||||
|
<if test="describe != null">#{describe},</if> |
||||
|
<if test="taxRate != null">#{taxRate},</if> |
||||
|
<if test="usdRate != null">#{usdRate},</if> |
||||
|
<if test="materialNum != null">#{materialNum},</if> |
||||
|
<if test="materialSole != null">#{materialSole},</if> |
||||
|
<if test="materialRmb != null">#{materialRmb},</if> |
||||
|
<if test="materialNormb != null">#{materialNormb},</if> |
||||
|
<if test="supplierCode != null">#{supplierCode},</if> |
||||
|
<if test="supplierName != null">#{supplierName},</if> |
||||
|
<if test="createBy != null">#{createBy},</if> |
||||
|
<if test="createTime != null">#{createTime},</if> |
||||
|
<if test="updateBy != null">#{updateBy},</if> |
||||
|
<if test="updateTime != null">#{updateTime},</if> |
||||
|
<if test="remark != null">#{remark},</if> |
||||
|
<if test="useStatus != null">#{useStatus},</if> |
||||
|
<if test="auditStatus != null">#{auditStatus},</if> |
||||
|
<if test="delFlag != null">#{delFlag},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updatePurchaseQuoteHistory" parameterType="PurchaseQuoteHistory"> |
||||
|
update purchase_quote_history |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="purchaseQuoteCode != null">purchase_quote_code = #{purchaseQuoteCode},</if> |
||||
|
<if test="materialId != null">material_id = #{materialId},</if> |
||||
|
<if test="materialCode != null">material_code = #{materialCode},</if> |
||||
|
<if test="materialName != null">material_name = #{materialName},</if> |
||||
|
<if test="materialType != null">material_type = #{materialType},</if> |
||||
|
<if test="processMethod != null">processMethod = #{processMethod},</if> |
||||
|
<if test="brand != null">brand = #{brand},</if> |
||||
|
<if test="photoUrl != null">photoUrl = #{photoUrl},</if> |
||||
|
<if test="describe != null">describe = #{describe},</if> |
||||
|
<if test="taxRate != null">tax_rate = #{taxRate},</if> |
||||
|
<if test="usdRate != null">usd_rate = #{usdRate},</if> |
||||
|
<if test="materialNum != null">material_num = #{materialNum},</if> |
||||
|
<if test="materialSole != null">material_sole = #{materialSole},</if> |
||||
|
<if test="materialRmb != null">material_rmb = #{materialRmb},</if> |
||||
|
<if test="materialNormb != null">material_noRmb = #{materialNormb},</if> |
||||
|
<if test="supplierCode != null">supplier_code = #{supplierCode},</if> |
||||
|
<if test="supplierName != null">supplier_name = #{supplierName},</if> |
||||
|
<if test="createBy != null">create_by = #{createBy},</if> |
||||
|
<if test="createTime != null">create_time = #{createTime},</if> |
||||
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
||||
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
||||
|
<if test="remark != null">remark = #{remark},</if> |
||||
|
<if test="useStatus != null">use_status = #{useStatus},</if> |
||||
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if> |
||||
|
</trim> |
||||
|
where purchase_quote_child_id = #{purchaseQuoteChildId} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deletePurchaseQuoteHistoryById" parameterType="Long"> |
||||
|
delete from purchase_quote_history where purchase_quote_child_id = #{purchaseQuoteChildId} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deletePurchaseQuoteHistoryByIds" parameterType="String"> |
||||
|
delete from purchase_quote_history where purchase_quote_child_id in |
||||
|
<foreach item="purchaseQuoteChildId" collection="array" open="(" separator="," close=")"> |
||||
|
#{purchaseQuoteChildId} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<update id="cancelPurchaseQuoteHistoryById" parameterType="Long"> |
||||
|
update purchase_quote_history set del_flag = '1' where purchase_quote_child_id = #{purchaseQuoteChildId} |
||||
|
</update> |
||||
|
|
||||
|
<update id="restorePurchaseQuoteHistoryById" parameterType="Long"> |
||||
|
update purchase_quote_history set del_flag = '0' where purchase_quote_child_id = #{purchaseQuoteChildId} |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,162 @@ |
|||||
|
<!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-purchaseQuoteHistory-add"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">关联报价编号字段:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="purchaseQuoteCode" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料表中的id:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialId" 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="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"> |
||||
|
<option value="">所有</option> |
||||
|
</select> |
||||
|
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料的加工方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="processMethod" 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="brand" 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="photoUrl" 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="describe" 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="taxRate" 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="usdRate" 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="materialNum" 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="materialSole" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料的不含税单价(RMB):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialRmb" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料的含税单价(RMB):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialNormb" 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"> |
||||
|
<textarea name="remark" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">删除状态:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="radio-box"> |
||||
|
<input type="radio" name="useStatus" value=""> |
||||
|
<label th:for="useStatus" th:text="未知"></label> |
||||
|
</div> |
||||
|
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">审核状态:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="radio-box"> |
||||
|
<input type="radio" name="auditStatus" value=""> |
||||
|
<label th:for="auditStatus" th:text="未知"></label> |
||||
|
</div> |
||||
|
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">删除标志:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="delFlag" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "purchaseQuoteHistory/purchaseQuoteHistory" |
||||
|
$("#form-purchaseQuoteHistory-add").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
$.operate.save(prefix + "/add", $('#form-purchaseQuoteHistory-add').serialize()); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,109 @@ |
|||||
|
<!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="purchaseQuoteCode"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>物料编号:</label> |
||||
|
<input type="text" name="materialCode"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>审核状态:</label> |
||||
|
<select name="auditStatus"> |
||||
|
<option value="">所有</option> |
||||
|
<option value="-1">代码生成请选择字典属性</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-warning" onclick="$.table.exportExcel()" shiro:hasPermission="purchaseQuoteHistory:purchaseQuoteHistory: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('purchaseQuoteHistory:purchaseQuoteHistory:edit')}]]; |
||||
|
var removeFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:remove')}]]; |
||||
|
var cancelFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:cancel')}]]; |
||||
|
var restoreFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:restore')}]]; |
||||
|
var prefix = ctx + "purchaseQuoteHistory/purchaseQuoteHistory"; |
||||
|
|
||||
|
$(function() { |
||||
|
var options = { |
||||
|
url: prefix + "/list", |
||||
|
createUrl: prefix + "/add", |
||||
|
updateUrl: prefix + "/edit/{id}", |
||||
|
removeUrl: prefix + "/remove", |
||||
|
cancelUrl: prefix + "/cancel/{id}", |
||||
|
restoreUrl: prefix + "/restore/{id}", |
||||
|
exportUrl: prefix + "/export", |
||||
|
modalName: "采购物料历史报价信息", |
||||
|
columns: [ |
||||
|
{checkbox: true}, |
||||
|
{title: '采购报价历史id', field: 'purchaseQuoteChildId', visible: false}, |
||||
|
{title: '关联报价编号字段', field: 'purchaseQuoteCode',}, |
||||
|
{title: '物料表中的id', field: 'materialId',}, |
||||
|
{title: '物料表中的编号', field: 'materialCode',}, |
||||
|
{title: '物料的名称', field: 'materialName',}, |
||||
|
{title: '物料的类型', field: 'materialType',}, |
||||
|
{title: '物料的加工方式', field: 'processMethod',}, |
||||
|
{title: '物料的品牌', field: 'brand',}, |
||||
|
{title: '物料的图片', field: 'photoUrl',}, |
||||
|
{title: '物料的描述', field: 'describe',}, |
||||
|
{title: '国内税率', field: 'taxRate',}, |
||||
|
{title: '美元汇率', field: 'usdRate',}, |
||||
|
{title: '物料的数量', field: 'materialNum',}, |
||||
|
{title: '物料的对外报价', field: 'materialSole',}, |
||||
|
{title: '物料的不含税单价(RMB)', field: 'materialRmb',}, |
||||
|
{title: '物料的含税单价(RMB)', field: 'materialNormb',}, |
||||
|
{title: '供应商编号', field: 'supplierCode',}, |
||||
|
{title: '供应商名称', field: 'supplierName',}, |
||||
|
{title: '备注', field: 'remark',}, |
||||
|
{title: '删除状态', field: 'useStatus',}, |
||||
|
{title: '审核状态', field: 'auditStatus',}, |
||||
|
{ |
||||
|
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.purchaseQuoteChildId + '\')"><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.purchaseQuoteChildId + '\')"><i class="fa fa-remove"></i>删除</a> '); |
||||
|
if(row.delFlag == '0'){ |
||||
|
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> '); |
||||
|
}else{ |
||||
|
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> '); |
||||
|
} |
||||
|
return actions.join(''); |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -1,303 +1,307 @@ |
|||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
<head> |
<head> |
||||
<th:block th:include="include :: header('修改报销单')" /> |
<th:block th:include="include :: header('总经理/总助审核')" /> |
||||
|
<th:block th:include="include :: datetimepicker-css" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
<th:block th:include="include :: bootstrap-editable-css" /> |
||||
</head> |
</head> |
||||
<body class="white-bg"> |
<body class="white-bg"> |
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
<form class="form-horizontal m" id="form-baseExpense-edit" th:object="${baseExpenseAccount}"> |
<form class="form-horizontal m" id="form-baseExpense-zozj" th:object="${baseExpenseAccount}"> |
||||
<input name="expenseId" th:field="*{expenseId}" type="hidden"> |
<input name="expenseId" th:field="*{expenseId}" type="hidden"> |
||||
<div class="form-group"> |
<input name="expenseCode" th:field="*{expenseCode}" type="hidden"> |
||||
<label class="col-sm-3 control-label">报销单编号:</label> |
<input name="instanceId" th:field="*{instanceId}" type="hidden"> |
||||
<div class="col-sm-8"> |
<!--驳回调整允许更新内容--> |
||||
<input name="expenseCode" th:field="*{expenseCode}" class="form-control" type="text"> |
<div class="form-group"> |
||||
</div> |
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="title" th:field="*{applyTitle}" 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="deptName" th:field="*{deptName}" class="form-control" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">岗位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="postName" th:field="*{postName}" class="form-control"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">姓名:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="fullName" th:field="*{fullName}" class="form-control"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-6 control-label">报销方式:</label> |
||||
|
<div class="col-sm-6"> |
||||
|
<select id="edit_expenseMethod" name="expenseMethod" th:field="*{expenseMethod}" onchange="handleExpenseMethod(this)" |
||||
|
class="form-control" |
||||
|
th:with="dictList=${@dict.getType('sys_base_expense_method')}"> |
||||
|
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
</div> |
</div> |
||||
<div class="form-group"> |
</div> |
||||
<label class="col-sm-3 control-label">部门:</label> |
<div id="edit_expenseMethodModal" class="container" style="display: none"> |
||||
|
<div class="col-xs-6"> |
||||
|
<label class="col-sm-3 control-label">是否是委外/采购采销:</label> |
||||
<div class="col-sm-8"> |
<div class="col-sm-8"> |
||||
<input name="deptName" th:field="*{deptName}" class="form-control" type="text"> |
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}"> |
||||
|
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<div class="form-group"> |
<div class="col-xs-6"> |
||||
<label class="col-sm-3 control-label">岗位:</label> |
<label class="col-sm-3 control-label">供应商ID:</label> |
||||
<div class="col-sm-8"> |
<div class="col-sm-8"> |
||||
<input name="postName" th:field="*{postName}" class="form-control" type="text"> |
<select id="supplierCode" name="supplierCode" class="form-control"></select> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<div class="form-group"> |
<div class="col-xs-6"> |
||||
<label class="col-sm-3 control-label">姓名:</label> |
<label class="col-sm-3 control-label">对公收款方:</label> |
||||
<div class="col-sm-8"> |
<div class="col-sm-8"> |
||||
<input name="fullName" th:field="*{fullName}" class="form-control" type="text"> |
<input name="corporatePayee" th:field="*{corporatePayee}" class="form-control" type="text"> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<div class="form-group"> |
<div class="col-xs-6"> |
||||
<label class="col-sm-6 control-label">报销方式:</label> |
<label class="col-sm-3 control-label">对公收款账户:</label> |
||||
<div class="col-sm-6"> |
<div class="col-sm-8"> |
||||
<select id="add_expenseMethod" name="expenseMethod" onchange="handleExpenseMethod(this)" class="form-control" th:with="dictList=${@dict.getType('sys_base_expense_method')}"> |
<input name="corporateReceivingAccount" th:field="*{corporateReceivingAccount}" class="form-control" type="text"> |
||||
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<div id="add_expenseMethodModal" class="container" style="display: none"> |
<div class="col-xs-6"> |
||||
<div class="form-group"> |
<label class="col-sm-3 control-label">对公开户行:</label> |
||||
<label class="col-sm-6 control-label">是否是委外/采购采销:</label> |
<div class="col-sm-8"> |
||||
<div class="col-sm-6"> |
<input name="publicAccountBanks" th:field="*{publicAccountBanks}" class="form-control" type="text"> |
||||
<select name="isPurchaseOutsource" class="form-control" th:with="dictList=${@dict.getType('sys_whether')}"> |
|
||||
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-6 control-label">供应商ID:</label> |
|
||||
<div class="col-sm-6"> |
|
||||
<select id="supplierCode" name="supplierCode" class="form-control"> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-6 control-label">对公收款方:</label> |
|
||||
<div class="col-sm-6"> |
|
||||
<input name="corporatePayee" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-6 control-label">对公收款账户:</label> |
|
||||
<div class="col-sm-6"> |
|
||||
<input name="corporateReceivingAccount" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-6 control-label">对公开户行:</label> |
|
||||
<div class="col-sm-6"> |
|
||||
<input name="publicAccountBanks" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</form> |
<input type="hidden" name="expenseDetailList" id="expenseDetailList"> |
||||
<div class="container"> |
</div> |
||||
<div class="form-row"> |
</form> |
||||
<div class="btn-group-sm" id="toolbar" role="group"> |
<div class="container"> |
||||
<span style="color: black;font-size:17px;font-weight: bold" >报销分类信息</span> |
<div class="form-row"> |
||||
<a class="btn btn-success" onclick="insertRow()"> |
<div class="btn-group-sm" id="toolbar" role="group"> |
||||
<span class="fa fa-plus"></span> 添加报销 |
<span>选择报销分类信息</span> |
||||
</a> |
<a class="btn btn-success" onclick="insertRow()"> |
||||
</div> |
<span class="fa fa-plus"></span> 添加报销 |
||||
|
</a> |
||||
|
<a class="btn btn-danger" onclick="removeRow()"> |
||||
|
<span class="fa fa-remove"></span> 删除报销 |
||||
|
</a> |
||||
</div> |
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
<div class="col-sm-12 select-table table-striped"> |
<div class="col-sm-12 select-table table-striped"> |
||||
<table id="bootstrap-sub-table-expense"></table> |
<table id="bootstrap-sub-table-expense-edit"></table> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<th:block th:include="include :: footer" /> |
</div> |
||||
<th:block th:include="include :: bootstrap-table-editable-js" /> |
<th:block th:include="include :: footer" /> |
||||
<script th:inline="javascript"> |
<th:block th:include="include :: datetimepicker-js" /> |
||||
var prefix = ctx + "system/baseExpense" |
<th:block th:include="include :: select2-js" /> |
||||
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; |
<th:block th:include="include :: bootstrap-table-editable-js" /> |
||||
var supplier = [[${formData.supplierCode}]]; |
<script th:src="@{/js/activiti.js}"></script> |
||||
$("#form-baseExpense-add").validate({focusCleanup: true}); |
<script th:inline="javascript"> |
||||
$(function(){ |
var prefix = ctx + "system/baseExpense"; |
||||
$.ajax({ |
var costTypeDatas = [[${@category.getChildByCode('costType')}]]; |
||||
url: prefix + "/getId", |
var taskId = [[${taskId}]]; |
||||
type: "post", |
var baseExpense = [[${baseExpenseAccount}]]; |
||||
dataType: "json", |
var $table = $("#bootstrap-sub-table-expense-edit"); |
||||
success: function(result) { |
$("#form-baseExpense-edit").validate({focusCleanup: true}); |
||||
if (result.code == 0) { |
|
||||
$("input[name='expenseCode']").val(result.data); |
$(function() { |
||||
} else { |
var options = { |
||||
$.modal.msgError(result.msg); |
id:'bootstrap-sub-table-expense-edit', |
||||
|
url: ctx + "system/expenseChild/list", |
||||
|
queryParams: function(params) {return {expenseCode: $("#expenseCode").val()};}, |
||||
|
sidePagination: "client", |
||||
|
pagination: true, |
||||
|
showColumns: false, |
||||
|
showSearch: false, |
||||
|
showRefresh:false, |
||||
|
showToggle:false, |
||||
|
model: "报销单数据", |
||||
|
columns: [ |
||||
|
{checkbox: true}, |
||||
|
{title:'主键',field: 'index',align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
var index = index + 1; |
||||
|
return index; |
||||
} |
} |
||||
} |
|
||||
}); |
|
||||
}) |
|
||||
var $table = $("#bootstrap-sub-table-expense"); |
|
||||
//获取子表信息 |
|
||||
$(function() { |
|
||||
var options = { |
|
||||
id:'bootstrap-sub-table-expense', |
|
||||
url: ctx + "system/expenseChild/list", |
|
||||
queryParams: function(params) { |
|
||||
return { |
|
||||
expenseCode: $("#expenseCode").val() |
|
||||
}; |
|
||||
}, |
}, |
||||
pagination: false, |
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, |
||||
sidePagination: "client", |
{title: '关联报销单号',field: 'expenseCode',visible: false}, |
||||
model: "报销单数据", |
{title: '成本类型',field: 'costType', |
||||
editable: true, |
formatter:function (value, row, index) {return costTypeFormatter(value,row,index);} |
||||
columns: [ |
}, |
||||
{checkbox: true}, |
{title: '成本小类',field:'costSmallType', |
||||
{title: '主键',field: 'index',visible: false, |
formatter:function(value, row, index){return getCostSmallType(value,row,index)} |
||||
formatter: function (value, row, index) { |
}, |
||||
return index; |
{title: '用途',field: 'purpose', editable:{type:'text', mode:'inline',}}, |
||||
} |
{title: '金额',field: 'amounts', editable:{type:'text', mode:'inline',}}, |
||||
}, |
{title: '报销时间',field: 'expenseTime', editable: {type: 'date',title: '报销时间', placement: 'left',}}, |
||||
{title: '报销单分项子表',field: 'expenseChildId',visible: false}, |
{title: '出差单号',field: 'evectionCode',editable:{type:'text', mode:'inline',}}, |
||||
{title: '关联报销单号',field: 'expenseCode',visible: false}, |
{title: '采购单号',field: 'purchaseCode',editable:{type:'text', mode:'inline',}}, |
||||
{title: '成本类型',field: 'costType', |
{title: '委外单号',field: 'outsourceCode',editable:{type:'text', mode:'inline',}}, |
||||
formatter:function (value, row, index) { |
{title: '操作', align: 'center', |
||||
return costTypeFormatter(value,row,index); |
formatter: function (value, row, index) { |
||||
} |
return '<a class="btn btn-danger btn-xs" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a>'; |
||||
}, |
|
||||
{title: '成本小类',field: 'costSmallType', |
|
||||
formatter:function(value, row, index){ |
|
||||
return getCostSmallType(value,row,index) |
|
||||
} |
|
||||
}, |
|
||||
{title: '用途',field: 'purpose',editable:{type:'text',mode:'inline'}}, |
|
||||
{title: '金额',field: 'amounts',editable: {type:'text',mode:'inline'}}, |
|
||||
{title: '报销时间',field: 'expenseTime',editable:{type:'date',mode:'inline',}}, |
|
||||
{title: '出差单号',field: 'evectionCode',editable: {type:'text',mode:'inline'}}, |
|
||||
{title: '采购单号',field: 'purcahseCode',editable: {type:'text',mode:'inline',}}, |
|
||||
{title: '委外单号',field: 'outsourceCode',editable: {type:'text',mode:'inline',}}, |
|
||||
{title: '操作', align: 'center', |
|
||||
formatter: function (value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> '); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
} |
|
||||
], |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
// 假设此函数返回供应商列表 |
|
||||
$("#supplierCode").select2({ |
|
||||
theme: "bootstrap", |
|
||||
allowClear: true, |
|
||||
placeholder: "请选择供应商", |
|
||||
ajax: { |
|
||||
url: '/system/supplier/getSupplier', |
|
||||
dataType: 'json', |
|
||||
method: "post", |
|
||||
delay: 250, |
|
||||
processResults: function (res, params) { |
|
||||
var options = []; |
|
||||
if(res.code==0){ |
|
||||
var resultList = res.rows; |
|
||||
for(let i in resultList){ |
|
||||
var option = resultList[i]; |
|
||||
option.id = resultList[i]["supplierCode"]; |
|
||||
option.text = resultList[i]["supplierCode"]; |
|
||||
options.push(option); |
|
||||
} |
|
||||
} |
|
||||
return { |
|
||||
results: options |
|
||||
}; |
|
||||
} |
} |
||||
} |
} |
||||
}); |
], |
||||
$("#supplierCode").val(supplier); |
}; |
||||
|
$.table.init(options); |
||||
|
handleExpenseMethod(this); |
||||
|
loadSupplierCodes(); |
||||
|
}); |
||||
|
function removeRow(index) { |
||||
|
// 使用索引值移除行 |
||||
|
$('#bootstrap-sub-table-expense-edit').bootstrapTable('remove', { |
||||
|
field: 'index', |
||||
|
values: index |
||||
}); |
}); |
||||
function handleExpenseMethod(expenseMethodSelect) { |
} |
||||
//获取页面元素中的下拉框选中的值 |
// 列中获取成本类型的下拉改变数据 |
||||
var expenseMethod = $("#add_expenseMethod option:selected").val(); |
function onCostTypeChange(selectElement, rowIndex) { |
||||
if (expenseMethod === '1') { |
var newSupplierId = $(selectElement).val(); |
||||
$("#add_expenseMethodModal").show(); |
var tableData = $table.bootstrapTable('getData'); |
||||
} else { |
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
$("#add_expenseMethodModal").hide(); |
newRow.costType = newSupplierId; // 更新供应商ID |
||||
} |
// 重新渲染成本小类的设备名称列 |
||||
} |
// 更新行数据 |
||||
$('#supplierCode').on('select2:select', function (e) { |
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
var data = e.params.data; |
} |
||||
$("input[name='corporatePayee']").val(data.supplierName); |
// 自定义供应商名称列的格式化函数 |
||||
$("input[name='corporateReceivingAccount']").val(data.bankAccount); |
function costTypeFormatter(value, row, index) { |
||||
$("input[name='publicAccountBanks']").val(data.depositBank); |
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')">'; |
||||
|
costTypeDatas.forEach(function (child) { |
||||
|
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>' ; |
||||
}); |
}); |
||||
|
selectHtml += '</select>'; |
||||
function insertRow() { |
return selectHtml; |
||||
$table.bootstrapTable('insertRow', { |
} |
||||
index:1, |
// 自定义设备名称列的格式化函数,依赖于供应商列的选择 |
||||
row: { |
function getCostSmallType(value, row, index) { |
||||
expenseChildId:'', |
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">'; |
||||
costType: "", |
// 假设此函数根据供应商ID返回设备列表 |
||||
costSmallType:"", |
var costSamllTypes = []; |
||||
purpose:'' , |
$.ajax({ |
||||
amounts: '', |
url: ctx + 'system/category/getChildCode', |
||||
expenseTime: '', |
type: 'post', |
||||
evectionCode:'' , |
data: {code: row.costType}, |
||||
purcahseCode:'', |
async: false, |
||||
outsourceCode: '', |
success: function (result) { |
||||
} |
console.log(result); |
||||
}) |
costSamllTypes = result; |
||||
layer.close(index); |
|
||||
} |
|
||||
/* 删除指定表格行 */ |
|
||||
function removeRow(id){ |
|
||||
$table.bootstrapTable('remove', { |
|
||||
field: 'id', |
|
||||
values: id |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
function submitHandler() { |
|
||||
if ($.validate.form()) { |
|
||||
var formData = $('#form-baseExpense-edit').serializeArray(); |
|
||||
var tableData = $table.bootstrapTable('getData'); |
|
||||
var rows = tableData.length; |
|
||||
if(rows==0){ |
|
||||
$.modal.alertWarning("子表数据不能为空!"); |
|
||||
}else{ |
|
||||
formData.push({"name": "expenseAccountChildList", "value": tableData}); |
|
||||
var jsonData = $.common.formDataToJson(formData); |
|
||||
$.operate.saveJson(prefix + "/edit", jsonData); |
|
||||
} |
|
||||
} |
} |
||||
} |
}); |
||||
// 列中获取成本类型的下拉改变数据 |
if (costSamllTypes) { |
||||
function onCostTypeChange(selectElement, rowIndex) { |
costSamllTypes.forEach(function (child) { |
||||
var newSupplierId = $(selectElement).val(); |
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>'; |
||||
var tableData = $table.bootstrapTable('getData'); |
|
||||
var newRow = tableData[rowIndex]; // 获取当前行数据 |
|
||||
newRow.costType = newSupplierId; // 更新供应商ID |
|
||||
// 重新渲染成本小类的设备名称列 |
|
||||
// 更新行数据 |
|
||||
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
|
||||
} |
|
||||
|
|
||||
// 自定义供应商名称列的格式化函数 |
|
||||
function costTypeFormatter(value, row, index) { |
|
||||
var selectHtml = '<select class="form-control" onchange="onCostTypeChange(this, ' + index + ')">'; |
|
||||
costTypeDatas.forEach(function (child) { |
|
||||
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>' ; |
|
||||
}); |
}); |
||||
selectHtml += '</select>'; |
selectHtml += '</select>'; |
||||
return selectHtml; |
return selectHtml; |
||||
} |
} |
||||
|
} |
||||
// 自定义设备名称列的格式化函数,依赖于供应商列的选择 |
function onCostSmallTypeChange(selectElement, rowIndex) { |
||||
function getCostSmallType(value, row, index) { |
var newCostSmallType = $(selectElement).val(); |
||||
var selectHtml = '<select class="form-control" onchange="onCostSmallTypeChange(this, ' + index + ')">'; |
var tableData = $table.bootstrapTable('getData'); |
||||
// 假设此函数根据供应商ID返回设备列表 |
var newRow = tableData[rowIndex]; // 获取当前行数据 |
||||
var costSamllTypes = []; |
newRow.costSmallType = newCostSmallType; |
||||
$.ajax({ |
// 重新渲染当前行的设备名称列 |
||||
url: ctx + 'system/category/getChildCode', |
// 更新行数据 |
||||
type: 'post', |
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
||||
data: {code: row.costType}, |
} |
||||
async: false, |
// 假设此函数返回供应商列表 |
||||
success: function (result) { |
function handleExpenseMethod(expenseMethodSelect) { |
||||
console.log(result); |
//获取页面元素中的下拉框选中的值 |
||||
costSamllTypes = result; |
var expenseMethod = $("#edit_expenseMethod option:selected").val(); |
||||
} |
if (expenseMethod === '1') { |
||||
}); |
$("#edit_expenseMethodModal").show(); |
||||
if (costSamllTypes) { |
} else { |
||||
costSamllTypes.forEach(function (child) { |
$("#edit_expenseMethodModal").hide(); |
||||
selectHtml += '<option value="' + child.code + '"' + (value === child.code ? ' selected' : '') + '>' + child.name + '</option>'; |
|
||||
}); |
|
||||
selectHtml += '</select>'; |
|
||||
return selectHtml; |
|
||||
} |
|
||||
} |
} |
||||
|
} |
||||
|
function getSelections(){ |
||||
|
$.ajax({ |
||||
|
url: ctx + "system/requisitioning/getEmpUserName", |
||||
|
type: "get", |
||||
|
dataType: "json", |
||||
|
success: function (data) { |
||||
|
$("input[name='deptName']").val(data.deptName); |
||||
|
$("input[name='fullName']").val(data.userName); |
||||
|
$("input[name='postName']").val(data.postName); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
function onCostSmallTypeChange(selectElement, rowIndex) { |
$("input[name='expenseTime']").datetimepicker({ |
||||
var newCostSmallType = $(selectElement).val(); |
format: "yyyy-mm-dd", |
||||
var tableData = $table.bootstrapTable('getData'); |
minView: "month", |
||||
var newRow = tableData[rowIndex]; // 获取当前行数据 |
autoclose: true |
||||
newRow.costSmallType = newCostSmallType; |
}); |
||||
// 重新渲染当前行的设备名称列 |
|
||||
// 更新行数据 |
function submitHandler() { |
||||
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); |
if ($.validate.form()) { |
||||
|
var tableData = $("#bootstrap-sub-table-expense-edit").bootstrapTable('getData'); |
||||
|
var formData = $("#form-baseExpense-add").serializeArray(); |
||||
|
var rows = tableData.length; |
||||
|
if(rows==0){ |
||||
|
$.modal.alertWarning("子表数据不能为空!"); |
||||
|
}else{ |
||||
|
formData.push({"name": "expenseAccountChildList", "value": tableData}); |
||||
|
var jsonData = $.common.formDataToJson(formData); |
||||
|
$.operate.saveJson(prefix + "/edit", jsonData); |
||||
|
} |
||||
} |
} |
||||
</script> |
} |
||||
|
function loadSupplierCodes() { |
||||
|
var url = ctx + 'system/supplier/getSupplier'; |
||||
|
$.ajax({ |
||||
|
type: 'post', // 请求类型 |
||||
|
url: url, // 后端接口URL |
||||
|
dataType: 'json', // 预期服务器返回的数据类型 |
||||
|
success: function(data) { |
||||
|
if (data.rows && Array.isArray(data.rows)) { |
||||
|
var selectElement = $('#supplierCode'); // 获取仓库编号下拉框元素 |
||||
|
// 清空下拉框现有选项 |
||||
|
selectElement.empty(); |
||||
|
// 添加默认选项(如果需要)编辑时不需要添加默认选项 |
||||
|
selectElement.append('<option value="">所有</option>'); |
||||
|
// 遍历返回的数据,添加为下拉框的选项 |
||||
|
$.each(data.rows, function(index, item) { |
||||
|
// 仓库ID |
||||
|
selectElement.append('<option value="' + item.supplierCode + '">' + item.supplierCode + '</option>'); |
||||
|
}); |
||||
|
selectElement.val(baseExpense.supplierCode); |
||||
|
} else { |
||||
|
$.modal.alertWarning("数据为空"); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
$('#supplierCode').on('change',function (e) { |
||||
|
$.ajax({ |
||||
|
type: 'post', // 请求类型 |
||||
|
url: ctx + 'system/supplier/getSupplierName', // 后端接口URL |
||||
|
dataType: 'json', // 预期服务器返回的数据类型 |
||||
|
data:{ |
||||
|
supplierCode: $('#supplierCode option:selected').val(), |
||||
|
}, |
||||
|
success: function(data) { |
||||
|
var expenseAccount = data[0]; |
||||
|
$("input[name='corporatePayee']").val(expenseAccount.supplierName); |
||||
|
$("input[name='corporateReceivingAccount']").val(expenseAccount.bankAccount); |
||||
|
$("input[name='publicAccountBanks']").val(expenseAccount.depositBank); |
||||
|
}, |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
</body> |
</body> |
||||
</html> |
</html> |
Loading…
Reference in new issue