|
@ -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"> |
|
@ -17,16 +17,18 @@ |
|
|
</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", |
|
|