第二期优化基本完成

master
wangjiuyun 2025-05-20 14:27:27 +08:00
parent 594ddf9a3f
commit b4d8520b82
11 changed files with 771 additions and 2493 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,21 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<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 :: header('新增合同档案')"/>
<th:block th:include="include :: datetimepicker-css"/>
</head>
<style>
.customerBox{
.customerBox {
display: flex;
flex-direction: column;
}
.customerBox div{
.customerBox div {
padding-left: 25px !important;
}
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-add">
<h4 class="form-header h4">合同档案信息</h4>
<div class="col-xs-6">
@ -53,18 +54,21 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">合同类型:</label>
<div class="col-sm-8">
<select name="orderType" class="form-control" th:with="type=${@dict.getType('order_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<select name="orderType" class="form-control" th:with="type=${@dict.getType('order_type')}"
required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">代表处编码</label>
<label class="col-sm-4 control-label is-required">代表处:</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="text" name="orderAgentCode" onclick="selectAgent()" required>
<input class="form-control" type="hidden" name="orderAgentCode">
<input class="form-control" type="text" name="orderAgentName" onclick="selectAgent()" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
@ -72,10 +76,12 @@
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">代理商编码</label>
<label class="col-sm-4 control-label is-required">代理商:</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" type="text" name="orderPartnerCode" onclick="selectPartner()" required>
<input class="form-control" type="hidden" name="orderPartnerCode">
<input class="form-control" type="text" name="orderPartnerName" onclick="selectPartner()"
required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
@ -92,6 +98,53 @@
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户编码:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="customerCode" class="form-control" type="text" required
onclick="selectCustomer()">
<span class="input-group-addon" style="width: 40px !important;"><i
class="fa fa-search"></i></span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户联系人:</label>
<div class="col-sm-8">
<input name="customerContact" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户邮箱:</label>
<div class="col-sm-8">
<input name="customerEmail" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户电话:</label>
<div class="col-sm-8">
<input name="customerPhone" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-2 control-label">备注:</label>
@ -100,41 +153,6 @@
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<div class="col-sm-4 customerBox">
<div class="col-sm-12 is-required">客户编码:</div>
<div class="col-sm-12 input-group" style="display: flex">
<input name="customerCode" class="form-control" type="text" required style="width: 70% !important" onclick="selectCustomer()">
<span class="input-group-addon" style="width: 40px !important;"><i class="fa fa-search"></i></span>
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12 is-required">客户名称:</div>
<div class="col-sm-12">
<input name="customerName" readonly class="form-control" type="text" required>
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12 ">客户联系人:</div>
<div class="col-sm-12">
<input name="customerContact" readonly class="form-control" type="text">
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12">客户邮箱:</div>
<div class="col-sm-12">
<input name="customerEmail" readonly class="form-control" type="text">
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12">客户电话:</div>
<div class="col-sm-12">
<input name="customerPhone" readonly class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<h4 class="form-header h4">合同清单列表</h4>
@ -142,18 +160,22 @@
<div class="row">
<input id="uploadInput" type="file" accept=".xls,.xlsx" style="display: none">
<div class="col-xs-12">
<button type="button" class="btn btn-white btn-sm" onclick="downloadTem()"><i class="fa fa-download"> 下载模板</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="importList()"><i class="fa fa-upload"> 导入</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="downloadTem()"><i
class="fa fa-download">
下载模板</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="importList()"><i class="fa fa-upload">
导入</i>
</button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var prefix = ctx + "manage/order"
$("#form-order-add").validate({
focusCleanup: true
@ -171,7 +193,7 @@
autoclose: true
});
$(function() {
$(function () {
var options = {
pagination: false,
showSearch: false,
@ -195,7 +217,7 @@
field: 'productCode',
align: 'center',
title: 'BOM编码',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control' type='text' name='orderListList[%s].productCode' value='%s'>", index, value);
return html;
}
@ -204,7 +226,7 @@
field: 'productName',
align: 'center',
title: '产品名称',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<p class='form-control-static'>%s</p>", value);
return html;
}
@ -213,7 +235,7 @@
field: 'quantity',
align: 'center',
title: '数量',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control quantity' type='number' name='orderListList[%s].quantity' value='%s'>", index, value);
return html;
}
@ -222,7 +244,7 @@
field: 'price',
align: 'center',
title: '单价',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control price' type='number' name='orderListList[%s].price' value='%s'>", index, value);
return html;
}
@ -231,8 +253,8 @@
field: 'discount',
align: 'center',
title: '折扣',
width:60,
formatter: function(value, row, index) {
width: 60,
formatter: function (value, row, index) {
var html = $.common.sprintf("<input class='form-control discount' type='number' name='orderListList[%s].discount' value='%s' step='0.1' max='1' min='0'>", index, value);
return html;
}
@ -241,7 +263,7 @@
field: 'amount',
align: 'center',
title: '总价',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control amount' type='number' name='orderListList[%s].amount' value='%s'>", index, value);
return html;
}
@ -250,7 +272,7 @@
field: 'remark',
align: 'center',
title: '备注',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='orderListList[%s].remark' value='%s'>", index, value);
return html;
}
@ -258,7 +280,7 @@
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
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>';
}
@ -266,6 +288,7 @@
};
$.table.init(options);
});
function addRow(row) {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
@ -284,8 +307,9 @@
sub.addRow(row);
}
function selectCustomer(){
var url = prefix+"/customer";
function selectCustomer() {
var url = prefix + "/customer";
var options = {
title: '选择客户',
width: "680",
@ -294,8 +318,9 @@
};
$.modal.openOptions(options);
}
function selectAgent() {
var url = prefix+"/agent";
var url = prefix + "/agent";
var options = {
title: '选择代表处',
width: "680",
@ -304,8 +329,9 @@
};
$.modal.openOptions(options);
}
function selectPartner() {
var url = prefix+"/partner";
var url = prefix + "/partner";
var options = {
title: '选择代理商',
width: "680",
@ -314,7 +340,8 @@
};
$.modal.openOptions(options);
}
function doSubmitCustomer(index, layero){
function doSubmitCustomer(index, layero) {
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请选择一个用户");
@ -327,30 +354,38 @@
$(' [name="customerPhone"]').val(rows[0].contactPhone);
$.modal.close(index);
}
function doSubmitAgent(index, layero){
function doSubmitAgent(index, layero) {
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请选择一个代表处");
return;
}
$('[name="orderAgentCode"]').val(rows[0].agentCode);
$('[name="orderAgentName"]').val(rows[0].agentName);
$.modal.close(index);
}
function doSubmitPartner(index, layero){
function doSubmitPartner(index, layero) {
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请选择一个代理商");
return;
}
$('[name="orderPartnerCode"]').val(rows[0].partnerCode);
$('[name="orderPartnerName"]').val(rows[0].partnerName);
$.modal.close(index);
}
function importList(){
function importList() {
$('#uploadInput').click()
}
function downloadTem(){
function downloadTem() {
$.modal.loading("正在下载,请稍候...");
$.post( prefix + "/list/export", {}, function(result) {
$.post(prefix + "/list/export", {}, function (result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
@ -362,30 +397,31 @@
})
}
document.getElementById('uploadInput').addEventListener('change', function(event) {
document.getElementById('uploadInput').addEventListener('change', function (event) {
const file = event.target.files[0];
let data=new FormData()
data.append('file',file)
let data = new FormData()
data.append('file', file)
var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
xhr.open('POST',prefix+'/list/readData', true); // 设置请求类型和URL
xhr.open('POST', prefix + '/list/readData', true); // 设置请求类型和URL
// 当请求完成时执行的回调函数
xhr.onload = function (res) {
let data=JSON.parse(res.currentTarget.response)
let data = JSON.parse(res.currentTarget.response)
if (data.code === 0) {
$.modal.msgSuccess('导入成功');
data.data.forEach((row)=>{
data.data.forEach((row) => {
addRow(row)
})
$('.discount').on('change',function (){
$('.discount').on('change', function () {
changeTotal($(this))
})
$('.discount').on('focus',function(){
$('.discount').on('focus', function () {
$(this).blur()
})
} else {
$.modal.msgError(data.msg||'导入失败');
$.modal.msgError(data.msg || '导入失败');
}
$('#uploadInput').val('')
@ -402,13 +438,13 @@
});
function changeTotal(ele){
let price= Number($(ele).parent().parent().find('.price').val())||0
let quantity=Number($(ele).parent().parent().find('.quantity').val())||0
let discount=$(ele).val()||0
let res= Number((price*quantity*discount).toFixed(2))
function changeTotal(ele) {
let price = Number($(ele).parent().parent().find('.price').val()) || 0
let quantity = Number($(ele).parent().parent().find('.quantity').val()) || 0
let discount = $(ele).val() || 0
let res = Number((price * quantity * discount).toFixed(2))
$(ele).parent().parent().find('.amount').val(res)
}
</script>
</script>
</body>
</html>

View File

@ -1,19 +1,20 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<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 :: header('修改合同档案')"/>
<th:block th:include="include :: datetimepicker-css"/>
<style>
.hideTd{
.hideTd {
display: none;
}
.customerBox div{
.customerBox div {
padding-left: 25px !important;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-edit" th:object="${orderInfo}">
<h4 class="form-header h4">合同档案信息</h4>
<input name="id" th:field="*{id}" type="hidden">
@ -53,18 +54,22 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">合同类型:</label>
<div class="col-sm-8">
<select name="orderType" class="form-control" th:with="type=${@dict.getType('order_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{orderType}"></option>
<select name="orderType" class="form-control" th:with="type=${@dict.getType('order_type')}"
required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
th:field="*{orderType}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">代表处编码</label>
<label class="col-sm-4 control-label is-required">代表处:</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" name="orderAgentCode" th:field="*{orderAgentCode}" onclick="selectAgent()" required/>
<input class="form-control" type="hidden" name="orderAgentCode" th:field="*{orderAgentCode}"/>
<input class="form-control" name="orderAgentName" th:field="*{orderAgentName}"
onclick="selectAgent()" required/>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
@ -72,10 +77,14 @@
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">代理商编码</label>
<label class="col-sm-4 control-label is-required">代理商:</label>
<div class="col-sm-8">
<div class="input-group">
<input class="form-control" name="orderPartnerCode" th:field="*{orderPartnerCode}" onclick="selectPartner()" required><span class="input-group-addon"><i class="fa fa-search"></i></span>
<input class="form-control" name="orderPartnerCode" type="hidden"
th:field="*{orderPartnerCode}">
<input class="form-control" name="orderPartnerName" th:field="*{orderPartnerName}"
onclick="selectPartner()" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
@ -85,12 +94,64 @@
<label class="col-sm-4 control-label is-required">签定日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="orderDate" th:value="${#dates.format(orderInfo.orderDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<input name="orderDate" th:value="${#dates.format(orderInfo.orderDate, 'yyyy-MM-dd')}"
class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户编码:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="customerCode" th:field="*{customerCode}" class="form-control" type="text"
required onclick="selectCustomer()">
<span class="input-group-addon" style="width: 40px !important;"><i
class="fa fa-search"></i></span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text"
required>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户联系人:</label>
<div class="col-sm-8">
<input name="customerContact" th:field="*{customerContact}" class="form-control"
type="text">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户邮箱:</label>
<div class="col-sm-8">
<input name="customerEmail" th:field="*{customerEmail}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">客户电话:</label>
<div class="col-sm-8">
<input name="customerPhone" th:field="*{customerPhone}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-2 control-label">备注:</label>
@ -100,57 +161,28 @@
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<div class="col-sm-4 customerBox">
<div class="col-sm-12 is-required">客户编码:</div>
<div class="col-sm-12 input-group" style="display: flex">
<input name="customerCode" th:field="*{customerCode}" class="form-control" type="text" required style="width: 70% !important" onclick="selectCustomer()">
<span class="input-group-addon" style="width: 40px !important;"><i class="fa fa-search"></i></span>
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12 is-required">客户名称:</div>
<div class="col-sm-12">
<input name="customerName" th:field="*{customerName}" disabled class="form-control" type="text" required>
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12 ">客户联系人:</div>
<div class="col-sm-12">
<input name="customerContact" th:field="*{customerContact}" disabled class="form-control" type="text">
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12">客户邮箱:</div>
<div class="col-sm-12">
<input name="customerEmail" th:field="*{customerEmail}" disabled class="form-control" type="text">
</div>
</div>
<div class="col-sm-4 customerBox">
<div class="col-sm-12">客户电话:</div>
<div class="col-sm-12">
<input name="customerPhone" th:field="*{customerPhone}" disabled class="form-control" type="text">
</div>
</div>
</div>
</div>
<h4 class="form-header h4">合同清单列表</h4>
<input id="uploadInput" type="file" accept=".xls,.xlsx" style="display: none">
</div>
<div class="row">
<input id="uploadInput" type="file" accept=".xls,.xlsx" style="display: none">
<div class="col-xs-12">
<button type="button" class="btn btn-white btn-sm" onclick="downloadTem()"><i
class="fa fa-download"> 下载模板</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="importList()"><i class="fa fa-upload">
导入</i></button>
</div>
<div class="col-sm-12 select-table table-striped">
<button type="button" class="btn btn-white btn-sm" onclick="downloadTem()"><i class="fa fa-download"> 下载模板</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="importList()"><i class="fa fa-upload"> 导入</i></button>
<table id="bootstrap-table"></table>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var prefix = ctx + "manage/order";
$("#form-order-edit").validate({
focusCleanup: true
@ -161,13 +193,15 @@
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
}
}
$("input[name='orderDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function selectCustomer(){
var url = prefix+"/customer";
function selectCustomer() {
var url = prefix + "/customer";
var options = {
title: '选择客户',
width: "680",
@ -176,8 +210,9 @@
};
$.modal.openOptions(options);
}
function selectAgent() {
var url = prefix+"/agent";
var url = prefix + "/agent";
var options = {
title: '选择代表处',
width: "680",
@ -186,8 +221,9 @@
};
$.modal.openOptions(options);
}
function selectPartner() {
var url = prefix+"/partner";
var url = prefix + "/partner";
var options = {
title: '选择代理商',
width: "680",
@ -197,7 +233,7 @@
$.modal.openOptions(options);
}
function doSubmitCustomer(index, layero){
function doSubmitCustomer(index, layero) {
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请选择一个用户");
@ -210,53 +246,56 @@
$(' [name="customerPhone"]').val(rows[0].contactPhone);
$.modal.close(index);
}
function doSubmitAgent(index, layero){
function doSubmitAgent(index, layero) {
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请选择一个代表处");
return;
}
$('[name="orderAgentCode"]').val(rows[0].agentCode);
$('[name="orderAgentName"]').val(rows[0].agentName);
$.modal.close(index);
}
function doSubmitPartner(index, layero){
function doSubmitPartner(index, layero) {
var rows = layero.find("iframe")[0].contentWindow.getSelections();
if (rows.length == 0) {
$.modal.alertWarning("请选择一个代理商");
return;
}
$('[name="orderPartnerCode"]').val(rows[0].partnerCode);
$('[name="orderPartnerName"]').val(rows[0].partnerCode);
$.modal.close(index);
}
function importList(){
function importList() {
$('#uploadInput').click()
}
document.getElementById('uploadInput').addEventListener('change', function(event) {
document.getElementById('uploadInput').addEventListener('change', function (event) {
const file = event.target.files[0];
let data=new FormData()
data.append('file',file)
data.append('orderId',$('[name="id"]').val())
let data = new FormData()
data.append('file', file)
data.append('orderId', $('[name="id"]').val())
var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
xhr.open('POST',prefix+'/list/importData', true); // 设置请求类型和URL
xhr.open('POST', prefix + '/list/importData', true); // 设置请求类型和URL
// 当请求完成时执行的回调函数
xhr.onload = function (res) {
let data=JSON.parse(res.currentTarget.response)
let data = JSON.parse(res.currentTarget.response)
if (data.code === 0) {
$.modal.msgSuccess('导入成功');
$.table.refresh();
$('.discount').on('change',function (){
$.operate.get(prefix + `/detail/` + $('[name="id"]').val(), function (res) {
$.table.destroy()
initTable(res.data)
changeTotal($(this))
})
$('.discount').on('focus',function(){
$(this).blur()
})
// $.table.refresh();
} else {
$.modal.msgError(data.msg||'导入失败');
$.modal.msgError(data.msg || '导入失败');
}
$('#uploadInput').val('')
@ -273,9 +312,36 @@
});
$(function() {
$(function () {
initTable([[${orderInfo.orderListList}]])
});
function downloadTem() {
$.modal.loading("正在下载,请稍候...");
$.post(prefix + "/list/export", {}, function (result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
})
}
function changeTotal(ele) {
let price = Number($(ele).parent().parent().find('.price').val()) || 0
let quantity = Number($(ele).parent().parent().find('.quantity').val()) || 0
let discount = $(ele).val() || 0
let res = Number((price * quantity * discount).toFixed(2))
$(ele).parent().parent().find('.amount').val(res)
}
function initTable(data) {
var options = {
data: [[${orderInfo.orderListList}]],
data: data,
pagination: false,
showSearch: false,
showRefresh: false,
@ -297,7 +363,7 @@
field: 'id',
align: 'center',
title: "id",
class:'hideTd',
class: 'hideTd',
formatter: function (value, row, index) {
var html = $.common.sprintf("<input type='hidden' name='orderListList[%s].id' value='%s'>", index, value);
return html;
@ -307,7 +373,7 @@
field: 'productCode',
align: 'center',
title: 'BOM编码',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<p ='' class='form-control-static'>%s</p>", value);
return html;
}
@ -316,7 +382,7 @@
field: 'productName',
align: 'center',
title: '产品名称',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<p class='form-control-static'>%s</p>", value);
return html;
}
@ -326,7 +392,7 @@
field: 'quantity',
align: 'center',
title: '数量',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control quantity' type='text' name='orderListList[%s].quantity' value='%s'>", index, value);
return html;
}
@ -335,7 +401,7 @@
field: 'price',
align: 'center',
title: '单价',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control price' type='text' name='orderListList[%s].price' value='%s'>", index, value);
return html;
}
@ -344,7 +410,7 @@
field: 'discount',
align: 'center',
title: '折扣',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input class='form-control discount' type='number' name='orderListList[%s].discount' value='%s' step='0.1' max='1' min='0'>", index, value);
return html;
}
@ -354,8 +420,8 @@
field: 'amount',
align: 'center',
title: '总价',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control' type='text' name='orderListList[%s].amount' value='%s'>", index, value);
formatter: function (value, row, index) {
var html = $.common.sprintf("<input readonly class='form-control amount' type='text' name='orderListList[%s].amount' value='%s'>", index, value);
return html;
}
},
@ -364,36 +430,20 @@
field: 'remark',
align: 'center',
title: '备注',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='orderListList[%s].remark' value='%s'>", index, value);
return html;
}
}]
};
$.table.init(options);
});
function downloadTem(){
$.modal.loading("正在下载,请稍候...");
$.post( prefix + "/list/export", {}, function(result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
$('.discount').on('change', function () {
changeTotal($(this))
})
$('.discount').on('focus', function () {
$(this).blur()
})
}
function changeTotal(ele){
let price= Number($(ele).parent().parent().find('.price').val())||0
let quantity=Number($(ele).parent().parent().find('.quantity').val())||0
let discount=$(ele).val()||0
let res= Number((price*quantity*discount).toFixed(2))
$(ele).parent().parent().find('.amount').val(res)
}
</script>
</script>
</body>
</html>

View File

@ -89,7 +89,9 @@
<div class="form-group">
<label class="col-sm-4 control-label">所属行业:</label>
<div class="col-sm-8">
<input name="industryType" class="form-control" type="text">
<select name="industryType" class="form-control" th:with="type=${@dict.getType('industry_code')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
@ -101,39 +103,6 @@
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="createAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="updateAt" 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>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">删除时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deleteAt" 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>
</form>
</div>
<th:block th:include="include :: footer" />
@ -152,23 +121,6 @@
}
}
$("input[name='createAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updateAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='deleteAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
var urlChina = '/cnarea/select';
$.cxSelect.defaults.url = urlChina;
// $.cxSelect.defaults.jsonSpace = 'data';

View File

@ -91,7 +91,9 @@
<div class="form-group">
<label class="col-sm-4 control-label">所属行业:</label>
<div class="col-sm-8">
<input name="industryType" th:field="*{industryType}" class="form-control" type="text">
<select name="industryType" th:field="*{industryType}" class="form-control" th:with="type=${@dict.getType('industry_code')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
@ -103,38 +105,6 @@
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">创建时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="createAt" th:value="${#dates.format(customerInfo.createAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="updateAt" th:value="${#dates.format(customerInfo.updateAt, 'yyyy-MM-dd')}" 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>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">删除时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deleteAt" th:value="${#dates.format(customerInfo.deleteAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
@ -153,24 +123,6 @@
$.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
}
}
$("input[name='createAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='updateAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='deleteAt']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
var urlChina = '/cnarea/select';
$.cxSelect.defaults.url = urlChina;
$('#element1').cxSelect({

View File

@ -168,10 +168,6 @@
field: 'deleteAt',
title: '删除时间'
},
{
field: 'status',
title: '数据状态'
},
{
title: '操作',
align: 'center',

View File

@ -1,14 +1,14 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增供应商管理')" />
<th:block th:include="include :: header('新增代理商管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-partner-add">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">供应商编码:</label>
<label class="col-sm-4 control-label is-required">代理商编码:</label>
<div class="col-sm-8">
<input name="partnerCode" class="form-control" type="text" required>
</div>
@ -16,7 +16,7 @@
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">供应商名称:</label>
<label class="col-sm-4 control-label is-required">代理商名称:</label>
<div class="col-sm-8">
<input name="partnerName" class="form-control" type="text" required>
</div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改供应商管理')" />
<th:block th:include="include :: header('修改代理商管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -9,7 +9,7 @@
<input name="id" th:field="*{id}" type="hidden">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">供应商编码:</label>
<label class="col-sm-4 control-label is-required">代理商编码:</label>
<div class="col-sm-8">
<input name="partnerCode" th:field="*{partnerCode}" class="form-control" type="text" required>
</div>
@ -17,7 +17,7 @@
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">供应商名称:</label>
<label class="col-sm-4 control-label is-required">代理商名称:</label>
<div class="col-sm-8">
<input name="partnerName" th:field="*{partnerName}" class="form-control" type="text" required>
</div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('供应商管理列表')" />
<th:block th:include="include :: header('代理商管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
@ -11,11 +11,11 @@
<div class="select-list">
<ul>
<li>
<label>供应商编码:</label>
<label>代理商编码:</label>
<input type="text" name="partnerCode"/>
</li>
<li>
<label>供应商名称:</label>
<label>代理商名称:</label>
<input type="text" name="partnerName"/>
</li>
<li>
@ -67,7 +67,7 @@
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "供应商管理",
modalName: "代理商管理",
columns: [{
checkbox: true
},
@ -78,11 +78,11 @@
},
{
field: 'partnerCode',
title: '供应商编码'
title: '代理商编码'
},
{
field: 'partnerName',
title: '供应商名称'
title: '代理商名称'
},
{
field: 'province',

View File

@ -15,6 +15,14 @@
</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="hzCode" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">产品名称:</label>
@ -39,6 +47,26 @@
</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">
<select name="type" class="form-control" th:with="type=${@dict.getType('product_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></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">
<select name="value" class="form-control" th:with="type=${@dict.getType('product_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictValue}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>

View File

@ -15,6 +15,14 @@
</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="hzCode" th:field="*{hzCode}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">产品名称:</label>
@ -39,6 +47,26 @@
</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">
<select th:field="*{type}" name="type" class="form-control" th:with="type=${@dict.getType('product_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></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">
<select th:field="*{value}" name="value" class="form-control" th:with="type=${@dict.getType('product_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictValue}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>