付款单申请
This commit is contained in:
parent
f798293bee
commit
3dd47ed305
|
|
@ -295,4 +295,52 @@ blockquote {
|
|||
-webkit-border-radius: 2em;
|
||||
-moz-border-radius: 2em;
|
||||
border-radius: 2em
|
||||
}
|
||||
|
||||
/* 表格输入框美化核心样式 */
|
||||
.classTable input.form-control {
|
||||
width: 100%;
|
||||
min-width: 80px;
|
||||
max-width: 120px;
|
||||
height: 30px;
|
||||
padding: 0 6px;
|
||||
border: 1px solid #e5e6eb;
|
||||
border-radius: 3px;
|
||||
background-color: #fafafa;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
box-sizing: border-box;
|
||||
text-align: right;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
/* 输入框聚焦时的高亮效果 */
|
||||
.classTable input.form-control:focus {
|
||||
outline: none;
|
||||
border-color: #409eff;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
/* 数字输入框禁用默认箭头 */
|
||||
.classTable input[type="number"] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.classTable input[type="number"]::-webkit-inner-spin-button,
|
||||
.classTable input[type="number"]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 表格单元格优化 */
|
||||
.classTable td, .classTable th {
|
||||
padding: 6px 8px;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 超出内容自动省略 */
|
||||
.classTable input.form-control {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ function submitApply(data) {
|
|||
})
|
||||
|
||||
const actualValues = getEditedActualValues();
|
||||
data.field.actualValues = actualValues;
|
||||
|
||||
$.each(allDataList, function (index, item) {
|
||||
const carActual = actualValues.carActualList.find(v => v.outDetailId == item.id); // 普通车辆
|
||||
const craneActual = actualValues.craneActualList.find(v => v.outDetailId == item.id); // 吊车
|
||||
|
|
@ -148,6 +148,9 @@ function submitApply(data) {
|
|||
exeGls: carActual?.exeGls || '',
|
||||
inMoney: carActual?.inMoney || craneActual?.inMoney || '',
|
||||
exeDay: craneActual?.exeDay || '',
|
||||
outDetailId:item.id,
|
||||
modelId:item.modelId,
|
||||
ton:item.ton
|
||||
};
|
||||
detailsList.push(obj);
|
||||
})
|
||||
|
|
@ -423,7 +426,34 @@ function getEditedActualValues() {
|
|||
return actualValues;
|
||||
}
|
||||
|
||||
// 输入框正则校验(仅正数 + 最多两位小数 + 不超过1亿元)
|
||||
$(document).on('input', '.classTable input.form-control', function() {
|
||||
// 1. 只保留数字和小数点,过滤负号、字母、符号等所有非法字符
|
||||
this.value = this.value
|
||||
.replace(/[^0-9.]/g, '') // 过滤除了数字和小数点的所有字符(包括负号)
|
||||
.replace(/\.{2,}/g, '.') // 多个小数点只保留第一个
|
||||
.replace(/^0+(?=\d)/, ''); // 去除开头多余的0(如 000123 → 123)
|
||||
|
||||
// 2. 限制小数点后最多两位
|
||||
if (this.value.indexOf('.') !== -1) {
|
||||
const parts = this.value.split('.');
|
||||
this.value = parts[0] + '.' + parts[1].substring(0, 2);
|
||||
}
|
||||
|
||||
// 3. 限制数值上限:不超过1亿元(100000000)
|
||||
const numValue = Number(this.value || 0);
|
||||
const maxAmount = 100000000; // 1亿元
|
||||
if (numValue > maxAmount) {
|
||||
this.value = maxAmount.toFixed(2); // 超过上限强制设为1亿元
|
||||
}
|
||||
});
|
||||
|
||||
// 输入框失焦时格式化(补零 + 统一两位小数)
|
||||
$(document).on('blur', '.classTable input.form-control', function() {
|
||||
if (this.value === '') return; // 空值不处理
|
||||
// 转数字后格式化,自动补两位小数(如 123 → 123.00,123.4 → 123.40)
|
||||
this.value = Number(this.value).toFixed(2);
|
||||
});
|
||||
|
||||
// 关闭页面
|
||||
function closePage(type) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue