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. 9
      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. 93
      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); mmap.put("purchasePlan", purchasePlan);
return prefix + "/edit"; 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}") @GetMapping("/detail/{purchasePlanId}")
public String detail(@PathVariable("purchasePlanId") Long purchasePlanId, ModelMap mmap) 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 结果 * @return 结果
*/ */
public int restorePurchasePlanById(Long purchasePlanId); 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 * @return
*/ */
int restorePurchasePlanById(Long purchasePlanId); 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); return purchasePlanMapper.restorePurchasePlanById(purchasePlanId);
} }
@Override
public List<PurchasePlan> selectPurchasePlanByPlanCode(String planCodes) {
return purchasePlanMapper.selectPurchasePlanByPlanCode(Convert.toStrArray(planCodes));
}
} }

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

@ -47,6 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectPurchasePlanVo"/> <include refid="selectPurchasePlanVo"/>
where purchase_plan_id = #{purchasePlanId} where purchase_plan_id = #{purchasePlanId}
</select> </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 id="insertPurchasePlan" parameterType="PurchasePlan" useGeneratedKeys="true" keyProperty="purchasePlanId">
insert into purchase_plan insert into purchase_plan
@ -122,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deletePurchasePlanByIds" parameterType="String"> <delete id="deletePurchasePlanByIds" parameterType="String">
delete from purchase_plan where purchase_plan_id in delete from purchase_plan where purchase_plan_id in
<foreach item="purchasePlanId" collection="array" open="(" separator="," close=")"> <foreach item="purchasePlanId" collection="array" open="(" separator="," close=")">
#{purchasePlanId} #{purchasePlanId}
</foreach> </foreach>

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

@ -37,7 +37,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">订购单号:</label> <label class="col-sm-3 control-label is-required">订购单号:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <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"> <input name="purchasePlanCode" class="form-control" type="text">
</div> </div>
</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"> <div class="form-group">
<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">
@ -59,40 +51,6 @@
<input name="rmbSum" class="form-control" type="text"> <input name="rmbSum" class="form-control" type="text">
</div> </div>
</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"> <div class="form-group">
<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">

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

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

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

Loading…
Cancel
Save