万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

533 lines
21 KiB

2 years ago
<!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"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<style>
.division {
width: 100%;
border-bottom: 1px solid #f1ecec;
padding: 10px 0 0;
margin-bottom: 30px;
}
.changeWidth {
width: 33% !important;
}
.col-sm-3 {
width: 26%;
}
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-supplierquotation-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">报价编码:</label>
<div class="col-sm-8">
<input name="quotationCode" class="form-control" type="text" required readonly>
2 years ago
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">原辅料代码:</label>
<div class="col-sm-8">
<select id="rawSubsidiaryCode" name="rawSubsidiaryCode" class="form-control m-b" required>
<option value="">请选择原料代码</option>
</select>
<!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>-->
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">原辅料名称:</label>
<div class="col-sm-8">
<input name="rawSubsidiaryName" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">规格型号:</label>
<div class="col-sm-8">
<input name="specificationModel" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机种:</label>
<div class="col-sm-8">
<input name="typeMachine" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料类别:</label>
<div class="col-sm-8">
<select name="materialType" class="form-control m-b"
th:with="type=${@dict.getType('ck_meterialt_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
2 years ago
</div>
<div class="form-group">
<label class="col-sm-3 control-label">库存单位:</label>
<div class="col-sm-8">
<input name="inventoryUnit" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">币别:</label>
<div class="col-sm-8">
<select name="commonCurrency" class="form-control m-b"
th:with="type=${@dict.getType('sys_common_currency')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">库存单价:</label>
<div class="col-sm-8">
<input name="inventoryPrice" 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="purchasingUnit" class="form-control m-b"
th:with="type=${@dict.getType('sys_unit_class')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">采购单价:</label>
<div class="col-sm-8">
<input name="purchasePrice" 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="relationalFormula" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商编号:</label>
<div class="col-sm-8">
<select id="supplierCode" name="supplierCode" class="form-control m-b" required>
<option value="">所有</option>
</select>
<!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>-->
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商名称:</label>
<div class="col-sm-8">
<select id="supplierName" name="supplierName" class="form-control m-b" required>
<option value="">所有</option>
</select>
<!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>-->
</div>
</div>
<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" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">含税否:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<input type="radio" th:id="${'confirmTax_' + dict.dictCode}" name="confirmTax"
th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<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>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">说明:</label>
<div class="col-sm-8">
<textarea name="quotationExplain" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否为当前报价:</label>
<div class="col-sm-8">
<select name="currentQuote" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">登记人:</label>
<div class="col-sm-8">
<input name="registrant" class="form-control" type="text">
</div>
</div>
<!--
<div class="division">
<h4>确认</h4>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">确认否:</label>
<div class="col-sm-8">
<select name="confirmNo" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">确认人:</label>
<div class="col-sm-8">
<input name="confirmName" class="form-control" type="text">
</div>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">确认时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="confirmTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="division">
<h4>审核</h4>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">审核否:</label>
<div class="col-sm-8">
<select name="auditNo" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">审核人:</label>
<div class="col-sm-8">
<input name="auditName" class="form-control" type="text">
</div>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">审核时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="auditTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="division">
<h4>核准</h4>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">核准否:</label>
<div class="col-sm-8">
<select name="approveNo" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">核准人:</label>
<div class="col-sm-8">
<input name="approveName" class="form-control" type="text">
</div>
</div>
<div class="form-group changeWidth">
<label class="col-sm-3 control-label">核准时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="approveTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>-->
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">备用一:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="standbyOne" 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="standbyTwo" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var prefix = ctx + "system/supplierquotation"
var supplierdata = []
$("#form-supplierquotation-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-supplierquotation-add').serialize());
}
}
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='confirmTime']").datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
minView: 0,
minuteStep: 1
});
$("input[name='auditTime']").datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
minView: 0,
minuteStep: 1
});
$("input[name='approveTime']").datetimepicker({
format: 'yyyy-mm-dd hh:ii:ss',
autoclose: true,
minView: 0,
minuteStep: 1
});
// 获取原辅料信息
var rawCodeList = [];
var subsidiaryCodeList = [];
var finishProductCodeList = [];
2 years ago
$.ajax({
url: ctx + "system/rawmaterial/list",
type: "POST",
async: false,
success: function (res) {
// console.log(1111111111)
// console.log(res.rows[1].rawMaterialCode)
for (var i = 0; i < res.rows.length; i++) {
rawCodeList.push(res.rows[i].rawMaterialCode)
}
}
})
//获取单号
$.ajax({
url: prefix + "/getId",
type: "post",
dateType: "json",
success: function (resp) {
if (resp.code === 0) {
$("input[name='quotationCode']").val(resp.data);
} else {
$.modal.msgError("失败啦");
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
2 years ago
$.ajax({
url: ctx + "system/subsidiarymaterial/list",
type: "POST",
async: false,
success: function (res) {
// console.log(1111111111)
// console.log(res.rows[0].subsidiaryMaterialCode)
for (i = 0; i < res.rows.length; i++) {
subsidiaryCodeList.push(res.rows[i].subsidiaryMaterialCode)
}
}
})
$.ajax({
url: ctx + "system/finishproduct/list",
type: "POST",
async: false,
success: function (res) {
// console.log(1111111111)
// console.log(res.rows[0].subsidiaryMaterialCode)
for (i = 0; i < res.rows.length; i++) {
finishProductCodeList.push(res.rows[i].finishProductCode)
}
}
})
var rawSubsidiaryCodeList = rawCodeList.concat(subsidiaryCodeList).concat(finishProductCodeList)
2 years ago
$("#rawSubsidiaryCode").select2({
tags: true,
placeholder: '请选择原辅料代码',
data: rawSubsidiaryCodeList,
allowClear: true
});
// 代码改变时
$("#rawSubsidiaryCode").change(function () {
const rawSubsidiaryCode = $(this).val();
console.log(subsidiaryCodeList)
console.log(subsidiaryCodeList.indexOf(rawSubsidiaryCode))
if (finishProductCodeList.indexOf(rawSubsidiaryCode) >= 0) {
$.ajax({
url: ctx + "system/finishproduct/getSubsidiaryCode",
type: "POST",
data: {
subsidiaryMaterialCode: $("#rawSubsidiaryCode").val()
},
success: function (res) {
console.log(res)
$("input[name='rawSubsidiaryName']").val(res.finishProductName)
$("input[name='specificationModel']").val(res.specificationModel)
$("input[name='typeMachine']").val(res.typeMachine)
$("input[name='inventoryUnit']").val(res.inventoryUnit)
$("select[name='supplierCode']").val(res.supplierCode).trigger("change")
$("select[name='supplierName']").val(res.supplierName).trigger("change")
}
})
} else if (subsidiaryCodeList.indexOf(rawSubsidiaryCode) >= 0) {
2 years ago
$.ajax({
url: ctx + "system/subsidiarymaterial/getSubsidiaryCode",
type: "POST",
data: {
subsidiaryMaterialCode: $("#rawSubsidiaryCode").val()
},
success: function (res) {
console.log(res)
$("input[name='rawSubsidiaryName']").val(res.subsidiaryMaterialName)
$("input[name='specificationModel']").val(res.specificationModel)
$("input[name='typeMachine']").val(res.typeMachine)
$("input[name='inventoryUnit']").val(res.inventoryUnit)
$("select[name='supplierCode']").val(res.supplierCode).trigger("change")
$("select[name='supplierName']").val(res.supplierName).trigger("change")
}
})
2 years ago
} else {
$.ajax({
url: ctx + "system/rawmaterial/getrawCode",
type: "POST",
data: {
rawMaterialCode: $("#rawSubsidiaryCode").val()
},
success: function (res) {
// console.log(res)
$("input[name='rawSubsidiaryName']").val(res.rawMaterialName)
$("input[name='specificationModel']").val(res.specificationModel)
$("input[name='typeMachine']").val(res.typeMachine)
$("input[name='inventoryUnit']").val(res.inventoryUnit)
$("select[name='supplierCode']").val(res.supplierCode).trigger("change")
$("select[name='supplierName']").val(res.supplierName).trigger("change")
}
})
}
})
// 供应商信息
$.ajax({
url: ctx + "system/supplier/list",
type: "POST",
success: function (res) {
// console.log(res)
if (res.rows.length > 0) {
supplierdata = res.rows;
//alert(JSON.stringify(data));
// console.log(res.rows)
for (let i in supplierdata) {
$("select[name='supplierCode']").append("<option value='" + supplierdata[i].supplierCode + "'>" + supplierdata[i].supplierCode + "</option>");
$("select[name='supplierName']").append("<option value='" + supplierdata[i].supplierName + "'>" + supplierdata[i].supplierName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
// 供应商编码改变
$("select[name='supplierCode']").change(function () {
var supplierCode = $(this).val();
for (i = 0; i < supplierdata.length; i++) {
if (supplierdata[i].supplierCode === supplierCode) {
$("select[name='supplierName']").val(supplierdata[i].supplierName).trigger("change")
}
}
})
// 自动获取当前时间
$("input[name='pricingDate']").datetimepicker("setDate", new Date());
/*
// 确认
$("select[name='confirmNo']").change(function () {
// console.log($(this).val())
if ($(this).val() == 1) {
$("input[name='confirmTime']").datetimepicker("setDate", new Date());
} else {
$("input[name='confirmTime']").val('')
}
})
// 审核
$("select[name='auditNo']").change(function () {
// console.log($(this).val())
if ($(this).val() == 1) {
$("input[name='auditTime']").datetimepicker("setDate", new Date());
} else {
$("input[name='auditTime']").val('')
}
})
// 核准
$("select[name='approveNo']").change(function () {
// console.log($(this).val())
if ($(this).val() == 1) {
$("input[name='approveTime']").datetimepicker("setDate", new Date());
} else {
$("input[name='approveTime']").val('')
}
})
*/
</script>
</body>
</html>