Browse Source

[feat]采购模块:修改采购报价单供应商下拉选项获取, 财务模块,修改获取物料信息的下拉获取功能。修改采购计划页面字段信息查询,新增查询根据采购订单计划号查询物料信息方法。

dev
zhangsiqi 6 months ago
parent
commit
8fa31da977
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchasePlanController.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanMapper.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java
  4. 6
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java
  5. 7
      ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanMapper.xml
  6. 2
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/add.html
  7. 42
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/add.html
  8. 35
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html
  9. 10
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/purchasePlan.html
  10. 85
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html

6
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchasePlanController.java

@ -100,6 +100,12 @@ public class PurchasePlanController extends BaseController
mmap.put("purchasePlan", purchasePlan);
return prefix + "/edit";
}
@GetMapping("/addPurchaseOrder")
public String purChaseOrder(String planCode,ModelMap mmap){
List<PurchasePlan> purchasePlanList = purchasePlanService.selectPurchasePlanByPlanCode(planCode);
mmap.put("purchasePlanList", purchasePlanList);
return prefix + "/addPurchaseOrder";
}
@GetMapping("/detail/{purchasePlanId}")
public String detail(@PathVariable("purchasePlanId") Long purchasePlanId, ModelMap mmap)
{

2
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanMapper.java

@ -75,4 +75,6 @@ public interface PurchasePlanMapper
* @return 结果
*/
public int restorePurchasePlanById(Long purchasePlanId);
public List<PurchasePlan> selectPurchasePlanByPlanCode(String[] planCode);
}

2
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java

@ -73,4 +73,6 @@ public interface IPurchasePlanService
* @return
*/
int restorePurchasePlanById(Long purchasePlanId);
public List<PurchasePlan> selectPurchasePlanByPlanCode(String planCode);
}

6
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java

@ -123,4 +123,10 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
{
return purchasePlanMapper.restorePurchasePlanById(purchasePlanId);
}
@Override
public List<PurchasePlan> selectPurchasePlanByPlanCode(String planCodes) {
return purchasePlanMapper.selectPurchasePlanByPlanCode(Convert.toStrArray(planCodes));
}
}

7
ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanMapper.xml

@ -47,6 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectPurchasePlanVo"/>
where purchase_plan_id = #{purchasePlanId}
</select>
<select id="selectPurchasePlanByPlanCode" parameterType="Long" resultMap="PurchasePlanResult">
<include refid="selectPurchasePlanVo"/>
where purchase_plan_code in
<foreach item="purchasePlanCode" collection="array" open="(" separator="," close=")">
#{purchasePlanCode}
</foreach>
</select>
<insert id="insertPurchasePlan" parameterType="PurchasePlan" useGeneratedKeys="true" keyProperty="purchasePlanId">
insert into purchase_plan

2
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/add.html

@ -37,7 +37,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">订购单号:</label>
<div class="col-sm-8">
<input name="purchaseOrderNumber" class="form-control" type="text" required readonly>
<input name="purchaseOrderCode" class="form-control" type="text" required readonly>
</div>
</div>
<div class="form-group">

42
ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/add.html

@ -12,14 +12,6 @@
<input name="purchasePlanCode" 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="purchasePlanStatus" class="form-control m-b" th:with="type=${@dict.getType('purchase_plan_status')}">
<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">
@ -59,40 +51,6 @@
<input name="rmbSum" 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="applyUser" 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="firstAddTime" 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="updateInfoTime" 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="auditStatus" class="form-control m-b" th:with="type=${@dict.getType('auditStatus')}">
<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">
<select name="useStatus" class="form-control m-b" th:with="type=${@dict.getType('useStatus')}">
<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">

35
ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html

@ -0,0 +1,35 @@
<!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-plan-add" th:object="${purchasePlanList}">
<div class="form-group">
<label class="col-sm-3 control-label">已选择采购计划:</label>
<div class="col-sm-8">
<input name="purchasePlanCode" 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="remark" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "purchase/plan"
$("#form-plan-add").validate({focusCleanup: true});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-plan-add').serialize());
}
}
</script>
</body>
</html>

10
ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/purchasePlan.html

@ -52,8 +52,8 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="purchase:plan:export">
<i class="fa fa-download"></i> 导出
<a class="btn btn-warning" onclick="addPurchaseOrder()" shiro:hasPermission="purchase:plan:export">
<i class="fa fa-download"></i> 添加采购单
</a>
</div>
<div class="col-sm-12 select-table table-striped">
@ -99,10 +99,10 @@
columns: [
{checkbox: true},
{title: '采购计划索引id',field: 'purchasePlanId',visible: false},
{title: '采购计划单号',field: 'purchasePlanCode'},
{title: '采购计划状态',field: 'purchasePlanStatus',
formatter: function(value, row, index) {return $.table.selectDictLabel(purchasePlanStatusDatas, value);}
},
{title: '采购计划单号',field: 'purchasePlanCode'},
{title: '关联单号', field: 'correlationCode',},
{title: '采购来源',field: 'purchasePlanType',},
{title: '物料合计',field: 'materialAmount',},
@ -159,7 +159,9 @@
]
});
};
function addPurchaseOrder(){
$.modal.open("新增采购订单", prefix + "/addPurchaseOrder");
}
</script>
</body>
</html>

85
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html

@ -2,9 +2,9 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增采购报价单')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
<th:block th:include="include :: select2-css" />
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/>
</head>
<body class="white-bg">
@ -17,16 +17,18 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label>
<label class="col-sm-3 control-label is-required">供应商ID:</label>
<div class="col-sm-8">
<select name="supplierQuoteCode" class="form-control">
<select name="supplierQuoteCode" class="form-control" required>
<option value="">请选择供应商</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<label class="col-sm-3 control-label is-required">供应商名称:</label>
<div class="col-sm-8">
<select name="supplierName" class="form-control">
<select name="supplierName" class="form-control" required>
<option value="">请选择供应商</option>
</select>
</div>
</div>
@ -94,9 +96,9 @@
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript">
@ -172,7 +174,7 @@
id:'bootstrap-sub-table-purchaseQuoteChild',
// url: ctx + "system/quoteChild/list",
pagination: false,
sidePagination: "client",
sidePagination: "server",
model: "物料报价信息",
columns: [
{checkbox: true},
@ -226,7 +228,7 @@
]
};
$.table.init(options);
selectSupplierName();
selectSupplier();
});
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
@ -288,28 +290,65 @@
}
}
//获取供应商
function selectSupplierName(){
$.ajax({
url: ctx + 'system/supplier/getSupplier',
function selectSupplier(){
$("select[name='supplierQuoteCode']").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: ctx + "system/supplier/getSupplier",
type: "post",
dataType: "json",
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
$("#form-purchaseQuote-add select[name='supplierQuoteCode']").append(
"<option value='" + usertData[i].supplierCode + "'>" + usertData[i].supplierCode + "</option>");
// console.log(finishProductData[i].finishProductCode)
$("#form-purchaseQuote-add select[name='supplierName']").append(
"<option value='" + usertData[i].supplierName + "'>" + usertData[i].supplierName + "</option>");
delay: 250,
processResults: function (res, params) {
var resultList = res.rows;
var options = [];
for (let i in resultList) {
var option = resultList[i];
option.id = resultList[i]["supplierCode"];
option.text = resultList[i]["supplierCode"];
option.title = resultList[i]["supplierName"];
options.push(option);
}
} else {
$.modal.msgError(res.msg);
return {results: options,}
},
escapeMarkup: function (markup) {return markup;},
}
});
$("select[name='supplierName']").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择供应商",
ajax: {
url: ctx + "system/supplier/getSupplier",
type: "post",
dataType: "json",
delay: 250,
processResults: function (res, params) {
var resultList = res.rows;
var options = [];
for (let i in resultList) {
var option = resultList[i];
option.id = resultList[i]["supplierName"];
option.text = resultList[i]["supplierName"];
options.push(option);
}
return {results: options,}
},
escapeMarkup: function (markup) {return markup;},
}
});
}
$("#form-purchaseQuote-add select[name='supplierQuoteCode']").on("select2:select",function (e) {
var dataObj = e.params.data;
console.log("codeData",dataObj);
$("#form-purchaseQuote-add select[name='supplierName']").val(dataObj.supplierName).trigger("change");
});
$("#form-purchaseQuote-add select[name='supplierName']").on("select2:select",function (e) {
var dataObj = e.params.data;
console.log("nameData",dataObj);
$("#form-purchaseQuote-add select[name='supplierQuoteCode']").val(dataObj.supplierCode).trigger("change");
});
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",

Loading…
Cancel
Save