Browse Source

[fix]

委外加工 委外报价
修改委外报价列表页面、添加、编辑、详情页面;
修改委外报价实体类、controller、mapper和service接口;
修改委外报
dev
王晓迪 2 months ago
parent
commit
fc2adbf45c
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java
  2. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java
  4. 1
      ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml
  5. 131
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html
  6. 70
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/detail.html
  7. 112
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/edit.html
  8. 42
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/outsource_quote.html
  9. 328
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskModifyApply.html
  10. 6
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwjlVerify.html
  11. 6
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwzgVerify.html

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

@ -103,7 +103,15 @@ public class OutsourceQuoteController extends BaseController
@GetMapping("/detail/{outsourceQuoteId}")
public String detail(@PathVariable("outsourceQuoteId") Long outsourceQuoteId, ModelMap mmap)
{
mmap.put("outsourceQuote", outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId));
OutsourceQuoteVO outsourceQuoteVO = outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
if(outsourceQuoteVO.getAuditStatus().equals("0")){
outsourceQuoteVO.setAuditStatus("待审核");
}else if(outsourceQuoteVO.getAuditStatus().equals("1")){
outsourceQuoteVO.setAuditStatus("审核通过");
}else if(outsourceQuoteVO.getAuditStatus().equals("2")){
outsourceQuoteVO.setAuditStatus("审核拒绝");
}
mmap.put("outsourceQuote",outsourceQuoteVO);
return prefix + "/detail";
}
@ -223,7 +231,6 @@ public class OutsourceQuoteController extends BaseController
public String edit(@PathVariable("outsourceQuoteId") Long outsourceQuoteId, ModelMap mmap)
{
OutsourceQuoteVO outsourceQuoteVO = outsourceQuoteService.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
System.out.println(outsourceQuoteVO.toString());
mmap.put("outsourceQuote", outsourceQuoteVO);
return prefix + "/edit";
}

10
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java

@ -44,9 +44,9 @@ public class OutsourceQuote extends BaseEntity
private BigDecimal taxRate;
/** 定价日期 */
@Excel(name = "定价日期",dateFormat = "yyyy-MM-dd HH:mm:ss",sort = 5)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date pricingDate;
@Excel(name = "定价日期",dateFormat = "yyyy-MM-dd",sort = 5)
@JsonFormat(pattern = "yyyy-MM-dd")
private String pricingDate;
/** 审核状态 */
@Excel(name = "审核状态",sort = 8,dictType = "auditStatus")
@ -250,11 +250,11 @@ public class OutsourceQuote extends BaseEntity
return taxRate;
}
public Date getPricingDate() {
public String getPricingDate() {
return pricingDate;
}
public void setPricingDate(Date pricingDate) {
public void setPricingDate(String pricingDate) {
this.pricingDate = pricingDate;
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java

@ -133,10 +133,11 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
} else {
tempOutsourceQuoteVO.setTaskName("未启动");
}
tempOutsourceQuoteVO.setTaskStatus(tempOutsourceQuoteVO.getTaskName());
if(tempOutsourceQuoteVO.getAuditStatus().equals("1")){
tempOutsourceQuoteVO.setTaskName("审核通过");
tempOutsourceQuoteVO.setTaskStatus("审核通过");
}else if(tempOutsourceQuoteVO.getAuditStatus().equals("2")){
tempOutsourceQuoteVO.setTaskName("审核拒绝");
tempOutsourceQuoteVO.setTaskStatus("审核拒绝");
}
returnList.add(tempOutsourceQuoteVO);
}

1
ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml

@ -69,6 +69,7 @@
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
</where>
order by audit_status asc, create_time desc
</select>
<select id="selectOutsourceQuoteByOutsourceQuoteId" parameterType="Long" resultMap="OutsourceQuoteOutsourceQuoteChildResult">

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

@ -2,39 +2,49 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('新增委外报价')" />
<style>
#form-outsource_quote-add .table{
overflow: visible;
}
</style>
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsource_quote-add">
<h4 class="form-header h4">委外报价信息</h4>
<div class="form-check-inline">
<h4 class="form-header h4">委外报价信息</h4>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外报价单号:</label>
<div class="col-sm-8">
<input name="outsourceQuoteCode" readonly="readonly" class="form-control" type="text">
</div>
</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">
<input name="supplierQuoteCode" class="form-control" type="text">
<select id="selectSupplierQuoteCode" 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">
<input name="supplierName" class="form-control" type="text">
<input name="supplierName" class="form-control" type="text" required>
</div>
</div>
<div class="col-xs-12">
<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 class="input-group">
<input name="taxRate" class="form-control" type="text">
<span class="input-group-addon">%</span>
</div>
</div>
</div>
</div>
@ -42,7 +52,10 @@
<div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label>
<div class="col-sm-8">
<input name="pricingDate" class="time-input" type="text" placeholder="请选择定价时间">
<div class="input-group date">
<input name="pricingDate" class="form-control" type="text" placeholder="请选择定价时间">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
@ -54,14 +67,13 @@
</div>
</div>
</div>
<h4 class="form-header h4">委外报价工序信息</h4>
<div class="row">
<div class="col-xs-12">
<!-- <button type="button" class="btn btn-blue btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>-->
<a class="btn btn-success" onclick="processadd()" >
<!-- shiro:hasPermission="system:outsource_quote:processadd"-->
<i class="fa fa-plus"></i> 添加
</a>
<div class="form-check-inline">
<h4 class="form-header h4">委外报价工序信息</h4>
</div>
<div class="col-xs-12">
<div class="form-group-sm">
<a class="btn btn-success" onclick="processadd()" ><i class="fa fa-plus"></i> 添加</a>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-process"></table>
</div>
@ -72,6 +84,8 @@
<th:block th:include="include :: footer" />
<th:block th:include="include :: jquery-cxselect-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var prefix = ctx + "system/outsource_quote";
@ -80,29 +94,6 @@
focusCleanup: true
});
// 保存信息 刷新表格
function saveJson(url, data, callback) {
var config = {
url: url,
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: data,
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
$.operate.successCallback(result);
}
};
$.ajax(config)
};
//获取单号
$.ajax({
@ -114,7 +105,18 @@
if (resp != null) {$("input[name='outsourceQuoteCode']").val(resp);} else {$.modal.msgError("失败啦");}
}
});
//获取供应商
$("#selectSupplierQuoteCode").on("select2:select",function (e) {
var dataObj = e.params.data;
console.log("dataObj",dataObj);
$("input[name='supplierName']").val(dataObj.supplierName);
});
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
todayBtn: true,
autoClose: true
});
function submitHandler() {
var url = prefix + "/add";
var outsourceQuote = {
@ -161,7 +163,7 @@
}
}
console.log(JSON.stringify(outsourceQuote));
saveJson(prefix + "/add", JSON.stringify(outsourceQuote));
$.operate.saveJson(prefix + "/add", JSON.stringify(outsourceQuote));
}
}
function getUnit(){
@ -235,7 +237,7 @@
field: 'chargeUnit',
align: 'center',
title: '计价单位',
width: 100,
width: 150,
// overflow: visible,
formatter: function(value, row, index) {
var html = $.common.sprintf("<select class='form-control' id='chargeUnit' data-first-title= '请选择' > " +
@ -268,13 +270,38 @@
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.outsourceProcessCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
$('#selectSupplierQuoteCode').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);
}
return {results: options,}
},
escapeMarkup: function (markup) {return markup;},
}
});
});
function processadd() {
var url = prefix + "/processadd";
@ -326,6 +353,12 @@
}
});
}
function removeRow(outsourceProcessCode){
$("#bootstrap-table-process").bootstrapTable('remove', {
field: 'outsourceProcessCode',
values: outsourceProcessCode
})
}
</script>
</body>
</html>

70
ruoyi-admin/src/main/resources/templates/system/outsource_quote/detail.html

@ -9,7 +9,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">审核状态:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceQuote.auditStatus}"></div>
<div class="form-control-static" id="auditStatus" th:text="${outsourceQuote.auditStatus}"></div>
</div>
</div>
<div class="form-group">
@ -66,17 +66,81 @@
<div class="form-control-static" th:text="${outsourceQuote.updateTime}"></div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group-sm">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-process"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
<script th:inline="javascript">
var prefix = ctx + "system/outsource_quote";
var sysUnitClassData = [[${@dict.getType('outsource_quote_unit')}]];
$("#form-user-add").validate({
onkeyup: false,
focusCleanup: true
});
$(function() {
var children = [[${outsourceQuote.outsourceQuoteChildList}]];
var options = {
id: "bootstrap-table-process",
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
striped: false,
sidePagination: "client",
data: children,
columns: [
{
field: 'outsourceProcessId',
align: 'center',
title: '委外工序主键',
visible: false,
},
{
field: 'outsourceProcessCode',
align: 'center',
title: '委外工序ID',
},
{
field: 'outsourceProcessNo',
align: 'center',
title: '委外工序编号',
},
{
field: 'outsourceProcessName',
align: 'center',
title: '委外工序名称',
},
{
field: 'chargeUnit',
align: 'center',
title: '计价单位',
width: 150,
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassData, value);
}
},
{
field: 'materialNormb',
align: 'center',
title: '不含税单价(RMB) ',
},
{
field: 'materialRmb',
align: 'center',
title: '含税单价(RMB)',
},
]
};
$.table.init(options);
});
</script>
</body>

112
ruoyi-admin/src/main/resources/templates/system/outsource_quote/edit.html

@ -2,6 +2,8 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改委外报价')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -12,22 +14,25 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外报价单号:</label>
<div class="col-sm-8">
<input name="outsourceQuoteCode" th:field="*{outsourceQuoteCode}" class="form-control" type="text" required>
<input name="outsourceQuoteCode" th:field="*{outsourceQuoteCode}" class="form-control" type="text" required readonly>
</div>
</div>
</div>
<div class="col-xs-12">
<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">
<input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" type="text">
<input id="selectSupplierQuoteCode" name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" required>
<!-- <select id="selectSupplierQuoteCode" name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" required>-->
<!-- <option value="">请选择供应商</option>-->
<!-- </select>-->
</div>
</div>
</div>
<div class="col-xs-12">
<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">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text">
</div>
@ -45,7 +50,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" th:field="*{taxRate}" class="form-control" type="text">
<span class="input-group-addon">%</span>
</div>
</div>
</div>
</div>
@ -53,18 +61,14 @@
<div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label>
<div class="col-sm-8">
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">审核状态:</label>
<div class="col-sm-8">
<select name="auditStatus" class="form-control" th:with="type=${@dict.getType('audit_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{auditStatus}"></option>
</select>
<div class="input-group date">
<input name="pricingDate" class="form-control" type="text" th:field="*{pricingDate}" placeholder="请选择定价时间">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
<!-- <div class="col-sm-8">-->
<!-- <input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text">-->
<!-- </div>-->
</div>
</div>
<div class="col-xs-12">
@ -87,33 +91,28 @@
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<!--<th:block th:include="include :: bootstrap-table-editable-js"/>-->
<script th:inline="javascript">
var prefix = ctx + "system/outsource_quote";
$("#form-outsource_quote-edit").validate({
focusCleanup: true
});
// 保存信息 刷新表格
function saveJson(url, data, callback) {
var config = {
url: url,
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: data,
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
$.operate.successCallback(result);
}
};
$.ajax(config)
};
var processData = [[${outsourceQuote.outsourceQuoteChildList}]]
//获取供应商
// $("#selectSupplierQuoteCode").on("select2:select",function (e) {
// var dataObj = e.params.data;
// console.log("dataObj",dataObj);
// $("input[name='supplierName']").val(dataObj.supplierName);
// });
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
todayBtn: true,
autoClose: true
});
function submitHandler() {
var url = prefix + "/edit";
var outsourceQuote = {
@ -163,7 +162,7 @@
}
console.log(outsourceQuote);
}
saveJson(prefix + "/edit", JSON.stringify(outsourceQuote));
$.operate.saveJson(prefix + "/edit", JSON.stringify(outsourceQuote));
}
}
@ -251,7 +250,7 @@
return rmb;
};
function initTable(data,index){
function initProcessTable(data,index){
$("#bootstrap-table-process").bootstrapTable('insertRow', {
index:1,
row: {
@ -300,7 +299,7 @@
width: 120,
// overflow: visible,
formatter: function(value, row, index) {
var html = $.common.sprintf("<select class='form-control' id='chargeUnit" + index + "' data-first-title= '请选择' > " +
var html = $.common.sprintf("<select class='form-control' id='chargeUnit" + index + "' name='outsourceQuoteChildList[%s].chargeUnit' value='%s' data-first-title= '请选择' > " +
"<option value=''>请选择</option>" +
"<option value='0'>按重量计</option>" +
"<option value='1'>按数量计</option>" +
@ -314,7 +313,7 @@
align: 'center',
title: '工序的不含税单价(RMB) ',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' id='materialNormb" + index + "'>", index, value);
var html = $.common.sprintf("<input class='form-control' type='text' id='materialNormb" + index + "' name='outsourceQuoteChildList[%s].materialNormb' value='%s'>", index, value);
return html;
}
},
@ -323,34 +322,51 @@
align: 'center',
title: '工序的含税单价(RMB)',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' id='materialRmb" + index + "'>", index, value);
var html = $.common.sprintf("<input class='form-control' type='text' id='materialRmb" + index + "' name='outsourceQuoteChildList[%s].materialRmb' value='%s'>", index, value);
return html;
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.outsourceProcessCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
var quoteDetail = options.data;
console.log(quoteDetail);
$.each(quoteDetail, function(index, item) {
// 设置下拉框的值
$('#chargeUnit' + index).val(item.chargeUnit);
// 设置不含税单价输入框的值
$('#materialNormb' + index).val(item.materialNormb);
// 设置含税单价输入框的值
$('#materialRmb' + index).val(item.materialRmb);
});
// 监听刷新事件
$('#bootstrap-table-process').on('refresh.bs.table', function () {
$.each(quoteDetail, function(index, item) {
// 设置下拉框的值
$('#chargeUnit' + index).val(item.chargeUnit);
$('#materialNormb' + index).val(item.materialNormb);
$('#materialRmb' + index).val(item.materialRmb);
});
});
});
function removeRow(outsourceProcessCode){
$("#bootstrap-table-process").bootstrapTable('remove', {
field: 'outsourceProcessCode',
values: outsourceProcessCode
})
}
</script>
</body>
</html>

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

@ -91,9 +91,25 @@
exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}",
modalName: "委外报价",
sortable: true,
sortableTable: true,
columns: [{
checkbox: true
},
{
field: 'taskStatus',
title: '当前状态',
align: 'center',
formatter: function(value, row, index) {
if(row.auditStatus!="1"&&value != "未启动"){
return '<span class="badge badge-danger">' + value + '</span>';
}
if(value === "未启动"){
return '<span class="badge badge-primary">' + value + '</span>';
}
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{
field: 'outsourceQuoteId',
title: '委外报价ID',
@ -180,25 +196,17 @@
},
{
field: 'applyTime',
title: '申请时间'
title: '申请时间',
},
{
field: 'taskName',
title: '当前状态',
align: 'center',
formatter: function(value, row, index) {
if(row.auditStatus!="1"&&value != "未启动"){
return '<span class="badge badge-danger">' + value + '</span>';
}
if(value === "未启动"){
return '<span class="badge badge-primary">' + value + '</span>';
}
return '<span class="badge badge-primary">' + value + '</span>';
}
title: '任务名称',
visible: false,
},
{
field: 'createTime',
title: '录入时间'
title: '录入时间',
sortable: true,
},
{
field: 'updateBy',
@ -219,7 +227,7 @@
// 作废
// actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}else{
actions.push('<a class="btn btn-default btn-xs" disabled href="javascript:void(0)"><i class="fa fa-edit"></i> 编辑</a> ');
}
@ -258,8 +266,10 @@
};
$.table.init(options);
});
function edit(outsourceQuoteId) {
var url = table.options.updateUrl.replace("{id}", outsourceQuoteId);
$.modal.open("修改委外报价",url,1000,600);
}
</script>
</body>

328
ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskModifyApply.html

@ -0,0 +1,328 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('驳回调整')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsource_quote-edit" th:object="${outsourceQuote}">
<h4 class="form-header h4">委外报价信息</h4>
<input name="outsourceQuoteId" th:field="*{outsourceQuoteId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外报价单号:</label>
<div class="col-sm-8">
<input name="outsourceQuoteCode" th:field="*{outsourceQuoteCode}" class="form-control" type="text" required readonly>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商编号:</label>
<div class="col-sm-8">
<input id="selectSupplierQuoteCode" name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" required>
<!-- <select id="selectSupplierQuoteCode" name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" required>-->
<!-- <option value="">请选择供应商</option>-->
<!-- </select>-->
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">工序合计:</label>
<div class="col-sm-8">
<input name="processAmount" th:field="*{processAmount}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text">
<span class="input-group-addon">%</span>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="pricingDate" class="form-control" type="text" th:field="*{pricingDate}" placeholder="请选择定价时间">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
<!-- <div class="col-sm-8">-->
<!-- <input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text">-->
<!-- </div>-->
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label" for="reApply">是否继续申请:</label>
<div class="col-sm-8">
<select id="reApply" name="p_B_reApply" class="form-control m-b">
<option value="true">重新申请</option>
<option value="false">结束流程</option>
</select>
</div>
</div>
</div>
<h4 class="form-header h4">委外报价工序信息</h4>
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-blue btn-sm" onclick="processadd()"><i class="fa fa-plus"> 增加</i></button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-process"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: summernote-js" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_quote";
$("#form-outsource_quote-edit").validate({
focusCleanup: true
});
var processData = [[${outsourceQuote.outsourceQuoteChildList}]]
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
todayBtn: true,
autoClose: true
});
function submitHandler() {
if ($.validate.form()) {
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-aftersalesOrder-edit').serialize());
}
}
function processadd() {
var url = prefix + "/processadd";
var options = {
title: '选择委外工序',
height: "500",
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
/* 选择委外工序回调 */
function doSubmit(index, layero){
// // 这里取到的是多行的
var rowData = layero.find("iframe")[0].contentWindow.getSelections();
//判断是否重复
var rows = $("#bootstrap-table-process").bootstrapTable('getData').length;
if(rows>0){
for(var i=0;i<rows;i++){
var data = $("#bootstrap-table-process").bootstrapTable('getData')[i];
for(var j=0;j<rowData.length;j++){
if(data.outsourceProcessNo==rowData[j].outsourceProcessNo){
$.modal.alertError("不能选择已添加过的相同工序");
return;
}
insertTable(rowData[i]);
}
};
}else{
for(i=0;i<rowData.length;i++){
insertTable(rowData[i]);
}
}
layer.closeAll();
}
function insertTable(rowData) {
$("#bootstrap-table-process").bootstrapTable('insertRow', {
index: 1,
row: {
outsourceProcessNo: rowData.outsourceProcessNo,
outsourceProcessCode: rowData.outsourceProcessCode,
outsourceProcessName: rowData.outsourceProcessName,
materialNoRmb: 0.00,
materialRmb: 0.00,
}
});
}
function getUnit(){
var selectElements = $('#bootstrap-table-process').find('select[id^="chargeUnit"]');
// 遍历每个下拉框
var unit = [];
selectElements.each(function() {
// 获取当前下拉框的值
var selectedValue = $(this).val();
unit.push(selectedValue);
});
console.log(unit);
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);
});
return rmb;
};
function initProcessTable(data,index){
$("#bootstrap-table-process").bootstrapTable('insertRow', {
index:1,
row: {
outsourceProcessNo: data.outsourceProcessNo,
outsourceProcessCode: data.outsourceProcessCode,
outsourceProcessName: data.outsourceProcessName,
}
});
$('#bootstrap-table-process').find('select[id="chargeUnit'+index+'"]').val(data.chargeUnit);
$('#bootstrap-table-process').find('input[id="materialNormb'+index+'"]').val(data.materialNormb);
$('#bootstrap-table-process').find('input[id="materialRmb'+index+'"]').val(data.materialRmb);
};
$(function() {
var options = {
id: "bootstrap-table-process",
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
data: [[${outsourceQuote.outsourceQuoteChildList}]],
columns: [
{
field: 'outsourceProcessId',
align: 'center',
title: '委外工序主键',
visible: false,
},
{
field: 'outsourceProcessNo',
align: 'center',
title: '委外工序编号',
},
{
field: 'outsourceProcessName',
align: 'center',
title: '委外工序名称',
},
{
field: 'chargeUnit',
align: 'center',
title: '计价单位',
width: 120,
// overflow: visible,
formatter: function(value, row, index) {
var html = $.common.sprintf("<select class='form-control' id='chargeUnit" + index + "' name='outsourceQuoteChildList[%s].chargeUnit' value='%s' data-first-title= '请选择' > " +
"<option value=''>请选择</option>" +
"<option value='0'>按重量计</option>" +
"<option value='1'>按数量计</option>" +
"<option value='2'>按面积计</option>" +
"</select>", index, value);
return html;
}
},
{
field: 'materialNormb',
align: 'center',
title: '工序的不含税单价(RMB) ',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' id='materialNormb" + index + "' name='outsourceQuoteChildList[%s].materialNormb' value='%s'>", index, value);
return html;
}
},
{
field: 'materialRmb',
align: 'center',
title: '工序的含税单价(RMB)',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' id='materialRmb" + index + "' name='outsourceQuoteChildList[%s].materialRmb' value='%s'>", index, value);
return html;
}
},
{
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.outsourceProcessCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
var quoteDetail = options.data;
console.log(quoteDetail);
$.each(quoteDetail, function(index, item) {
// 设置下拉框的值
$('#chargeUnit' + index).val(item.chargeUnit);
$('#materialNormb' + index).val(item.materialNormb);
$('#materialRmb' + index).val(item.materialRmb);
});
// 监听刷新事件
$('#bootstrap-table-process').on('refresh.bs.table', function () {
$.each(quoteDetail, function(index, item) {
// 设置下拉框的值
$('#chargeUnit' + index).val(item.chargeUnit);
$('#materialNormb' + index).val(item.materialNormb);
$('#materialRmb' + index).val(item.materialRmb);
});
});
});
function removeRow(outsourceProcessCode){
$("#bootstrap-table-process").bootstrapTable('remove', {
field: 'outsourceProcessCode',
values: outsourceProcessCode
})
}
</script>
</body>
</html>

6
ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwjlVerify.html

@ -94,6 +94,8 @@
focusCleanup: true
});
var childData = [[${formData.outsourceQuoteChildList}]];
var sysUnitClassData = [[${@dict.getType('outsource_quote_unit')}]];
function submitHandler() {
if ($.validate.form()) {
@ -137,6 +139,10 @@
field: 'chargeUnit',
align: 'center',
title: '计价单位',
width:150,
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassData, value);
}
},
{
field: 'materialNormb',

6
ruoyi-admin/src/main/resources/templates/system/outsource_quote/taskWwzgVerify.html

@ -94,6 +94,8 @@
focusCleanup: true
});
var childData = [[${formData.outsourceQuoteChildList}]];
var sysUnitClassData = [[${@dict.getType('outsource_quote_unit')}]];
function submitHandler() {
if ($.validate.form()) {
@ -137,6 +139,10 @@
field: 'chargeUnit',
align: 'center',
title: '计价单位',
width:150,
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassData, value);
}
},
{
field: 'materialNormb',

Loading…
Cancel
Save