Browse Source

[feat]修改采购计划,采购报价添加修改table的js引入

dev
zhangsiqi 6 months ago
parent
commit
d07c1877d3
  1. 37
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/add.html
  2. 67
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/detail.html
  3. 16
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/edit.html
  4. 2
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html
  5. 125
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html

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

@ -58,12 +58,47 @@
</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(){
var option = {
url: ctx + "purchase/purchasePlanChild/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
purchasePlanCode: row.purchasePlanCode
},
columns: [
{field: 'purchasePlanId',title: '主键id',visible: false},
{field: 'materialNo',title: '料号',},
{field: 'photoUrl',title: '图片',
formatter: function(value, row, index) {return $.table.imageView(value);}
},
{field: 'materialName',title: '物料名称',},
{field: 'materialType',title: '物料类型',
formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}
},
{field: 'describe',title: '描述',},
{field: 'brand',title: '品牌',},
{field: 'processMethod',title: '半成品类型',
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}
},
{field: 'unit',title: '单位',
formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}
},
{field: 'planNum',title: '计划采购数',
formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}
},
]
});
}
})
$("")
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-plan-add').serialize());

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

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改采购计划单')" />
<th:block th:include="include :: header('详情采购计划单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -10,7 +10,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">采购计划单号:</label>
<div class="col-sm-8">
<input name="purchasePlanCode" th:field="*{purchasePlanCode}" class="form-control" type="text">
<input id="detail_purchasePlanCode" name="purchasePlanCode" th:field="*{purchasePlanCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -60,26 +60,65 @@
<input name="rmbSum" th:field="*{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" th:field="*{applyUser}" class="form-control" type="text">
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
</form>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-purchasePlanChild"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "purchase/purchasePlan";
$("#form-plan-edit").validate({
focusCleanup: true
$("#form-plan-edit").validate({focusCleanup: true});
$(function(){
var option = {
id:'bootstrap-sub-table-purchasePlanChild',
url: ctx + "purchase/purchasePlanChild/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : function (params){
var temp = {
purchasePlanCode: $("#detail_purchasePlanCode").val()
}
return temp
},
columns: [
{field: 'purchasePlanId',title: '主键id',visible: false},
{field: 'materialNo',title: '料号',},
{field: 'photoUrl',title: '图片',
formatter: function(value, row, index) {return $.table.imageView(value);}
},
{field: 'materialName',title: '物料名称',},
{field: 'materialType',title: '物料类型',
formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}
},
{field: 'describe',title: '描述',},
{field: 'brand',title: '品牌',},
{field: 'processMethod',title: '半成品类型',
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}
},
{field: 'unit',title: '单位',
formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}
},
{field: 'planNum',title: '计划采购数',
formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}
},
]}
$.table.init(option);
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-plan-edit').serialize());
}
}
</script>
</body>
</html>

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

@ -78,22 +78,6 @@
<input name="updateInfoTime" th:field="*{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}" th:field="*{auditStatus}"></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}" th:field="*{useStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">

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

@ -270,7 +270,7 @@
/* 删除指定表格行 */
function removeRow(id){
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('RemoveByUniqueId', {
field: 'id',
field: 'index',
values: id
})
}

125
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html

@ -12,9 +12,9 @@
<form class="form-horizontal m" id="form-purchaseQuote-edit" th:object="${purchaseQuote}">
<input name="purchaseQuoteId" th:field="*{purchaseQuoteId}" type="hidden">
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label">采购报价单号:</label>
<label class="col-sm-3 control-label" >采购报价单号:</label>
<div class="col-sm-8">
<input name="purchaseQuoteCode" th:field="*{purchaseQuoteCode}" class="form-control" type="text">
<input id="purchaseQuoteCode_edit" name="purchaseQuoteCode" th:field="*{purchaseQuoteCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
@ -67,7 +67,10 @@
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text">
<div class="input-group">
<input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" />
<span class="input-group-addon">%</span>
</div>
</div>
</div>
</form>
@ -163,9 +166,19 @@
$("#form-purchaseQuote-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-requisitionChild',
// url: ctx + "system/quoteChild/list",
id:'bootstrap-sub-table-purchaseQuoteChild',
url: ctx + "purchase/purchaseQuoteChild/list",
pagination: false,
queryParams: function(params) {
var temp = {
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
sortName: params.sort,
sortOrder: params.order,
purchaseQuoteCode: $("#purchaseQuoteCode_edit").val(),
}
return temp;
},
sidePagination: "client",
model: "物料报价信息",
columns: [
@ -203,8 +216,8 @@
},
{title:'最新报价',field: 'materialSole',align: 'center',},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true,},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true,},
{title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false},
@ -213,13 +226,16 @@
{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.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
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);
selectSupplier();
$("#form-purchaseQuote-edit select[name='supplierQuoteCode']").val(purchaseQuote.supplierQuoteCode).trigger("change");
$("#form-purchaseQuote-edit select[name='supplierName']").val(purchaseQuote.supplierName).trigger("change");
});
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
@ -259,10 +275,10 @@
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(id){
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', {
field: 'id',
values: id
function removeRow(index){
$("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('removeByUniqueId', {
field: 'index',
values: index
})
}
function submitHandler() {
@ -280,30 +296,75 @@
}
}
}
function selectSupplierName(){
$.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) {
// console.log(finishProductData[i].finishProductCode)
$("#form-purchaseQuote-add select[name='supplierQuoteCode']").append(
"<option value='" + usertData[i].supplierCode + "'>" + usertData[i].supplierCode + "</option>");
$("#form-purchaseQuote-add select[name='supplierName']").append(
"<option value='" + usertData[i].supplierName + "'>" + usertData[i].supplierName + "</option>");
function selectSupplier(){
$("select[name='supplierQuoteCode']").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]["supplierCode"];
option.text = resultList[i]["supplierCode"];
option.title = resultList[i]["supplierName"];
options.push(option);
}
$("#form-purchaseQuote-add select[name='supplierQuoteCode']").val(purchaseQuote.supplierQuoteCode);
$("#form-purchaseQuote-add select[name='supplierName']").val(purchaseQuote.supplierName);
} 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-edit select[name='supplierQuoteCode']").on("select2:select",function (e) {
var dataObj = e.params.data;
console.log("codeData",dataObj);
$("#form-purchaseQuote-edit select[name='supplierName']").val(dataObj.supplierName).trigger("change");
});
$("#form-purchaseQuote-edit select[name='supplierName']").on("select2:select",function (e) {
var dataObj = e.params.data;
console.log("nameData",dataObj);
$("#form-purchaseQuote-edit select[name='supplierQuoteCode']").val(dataObj.supplierCode).trigger("change");
});
$("#form-purchaseQuote-edit select[name='supplierQuoteCode']").on("select2:select",function (e) {
var dataObj = e.params.data;
console.log("codeData",dataObj);
$("#form-purchaseQuote-edit select[name='supplierName']").val(dataObj.supplierName).trigger("change");
});
$("#form-purchaseQuote-edit select[name='supplierName']").on("select2:select",function (e) {
var dataObj = e.params.data;
console.log("nameData",dataObj);
$("#form-purchaseQuote-edit select[name='supplierQuoteCode']").val(dataObj.supplierCode).trigger("change");
});
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",

Loading…
Cancel
Save