|
|
@ -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", |
|
|
|