Browse Source

[feat] 委外加工

修改委外报价的新增后端接口
修改委外报价的新增前端页面
dev
liuxiaoxu 4 months ago
parent
commit
a04dab13a6
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java
  2. 60
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html

2
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java

@ -106,7 +106,7 @@ public class OutsourceQuoteController extends BaseController
@Log(title = "委外报价", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(OutsourceQuoteVO childVO)
public AjaxResult addSave(@RequestBody OutsourceQuoteVO childVO)
{
System.out.println(childVO);
return toAjax(outsourceQuoteService.insertOutsourceQuote(childVO));

60
ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html

@ -118,7 +118,7 @@ WWBJ002">
}, {});
outsourceQuote = {
outsourceQuoteCode: outsourceQuoteData.outsourceQuoteCode,
supplierQuoteCode: outsourceQuoteData.supplierCode,
supplierQuoteCode: outsourceQuoteData.supplierQuoteCode,
supplierName: outsourceQuoteData.supplierName,
pricingDate: outsourceQuoteData.pricingDate,
taxRate: outsourceQuoteData.taxRate,
@ -126,8 +126,6 @@ WWBJ002">
processAmount: 0,
outsourceQuoteChildList: []
}
console.log(outsourceQuote);
// console.log(outsourceQuoteData);
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var rows = $('#bootstrap-table-process').bootstrapTable('getData');
// 检查表格数据是否为空
@ -136,28 +134,24 @@ WWBJ002">
return;
}else{
outsourceQuote.processAmount = rows.length;
console.log(rows);
var unit = getUnit();
var noRmb = getNoRmb();
var rmb = getRmb();
for(var i=0;i<rows.length;i++){
var unit = getUnit();
console.log(unit);
var quoteChild = {
outsourceProcessCode: rows.outsourceProcessCode,
outsourceProcessNo: rows.outsourceProcessNo,
outsourceProcessName: rows.outsourceProcessName,
outsourceProcessCode: rows[i].outsourceProcessCode,
outsourceProcessNo: rows[i].outsourceProcessNo,
outsourceProcessName: rows[i].outsourceProcessName,
chargeUnit:unit[i],
materialNormb: noRmb[i],
materialRmb: rmb[i],
};
outsourceQuote.outsourceQuoteChildList.push(quoteChild);
}
}
// console.log(jsonData);
// 发送 AJAX 请求到后端接口
saveJson(prefix + "/add", jsonData);
// $.operate.submit(prefix + "/add", "post", "json", jsonData);
console.log(JSON.stringify(outsourceQuote));
saveJson(prefix + "/add", JSON.stringify(outsourceQuote));
}
}
function getUnit(){
var selectElements = $('#bootstrap-table-process').find('select[id="chargeUnit"]');
@ -167,13 +161,33 @@ WWBJ002">
// 获取当前下拉框的值
var selectedValue = $(this).val();
unit.push(selectedValue);
// 执行你想要的操作,比如记录值或更新其他地方的数据
console.log("Selected charge unit value:", selectedValue);
});
return unit;
}
function getNoRmb(){
var selectElements = $('#bootstrap-table-process').find('input[id="materialNormb"]');
// 遍历每个下拉框
var noRmb = [];
selectElements.each(function() {
// 获取当前下拉框的值
var selectedValue = $(this).val();
noRmb.push(selectedValue);
});
console.log(noRmb);
return noRmb;
};
function getRmb(){
var selectElements = $('#bootstrap-table-process').find('input[id="materialRmb"]');
// 遍历每个输入框
var rmb = [];
selectElements.each(function() {
// 获取当前输入框的值
var selectedValue = $(this).val();
rmb.push(selectedValue);
});
console.log(rmb);
return rmb;
};
$(function() {
var options = {
id: "bootstrap-table-process",

Loading…
Cancel
Save