|
@@ -164,9 +164,9 @@
|
|
|
trDom.id = "boat_car_" + i;
|
|
|
trDom.className = 'qjsjClass'
|
|
|
trDom.innerHTML = '<td class="operation_icon"><span class="up_btn"></span><span class="down_btn"></span></td>'
|
|
|
- + '<td name="boat_car_seq">' + '<span>' +(i + 1)+ '</span>'
|
|
|
+ + '<td name="boat_car_seq">' + '<span>' + (i + 1) + '</span>'
|
|
|
+ '<div>'
|
|
|
- + '<input type="hidden" name="TravelCostBoatCarDO[' + i + ']$indexCode" value="'+ (i + 1) +'">'
|
|
|
+ + '<input type="hidden" name="TravelCostBoatCarDO[' + i + ']$indexCode" value="' + (i + 1) + '">'
|
|
|
+ '</div>'
|
|
|
+ '</td>'
|
|
|
+ '<td>'
|
|
@@ -266,28 +266,28 @@
|
|
|
}
|
|
|
if (!(!boatCarArr[i].departPlace || boatCarArr[i].departPlace.trim() === '')) {
|
|
|
z.ui.input("[name='TravelCostBoatCarDO[" + i + "]$departPlace']").setValue(boatCarArr[i].departPlace);
|
|
|
- $("[name='TravelCostBoatCarDO[" + i + "]$departPlace']").attr('title',boatCarArr[i].departPlace);
|
|
|
+ $("[name='TravelCostBoatCarDO[" + i + "]$departPlace']").attr('title', boatCarArr[i].departPlace);
|
|
|
}
|
|
|
if (!(!boatCarArr[i].arriveDate || boatCarArr[i].arriveDate.trim() === '')) {
|
|
|
z.ui.laydate("[name='TravelCostBoatCarDO[" + i + "]$arriveDate']").setValue(boatCarArr[i].arriveDate);
|
|
|
}
|
|
|
if (!(!boatCarArr[i].arrivePlace || boatCarArr[i].arrivePlace.trim() === '')) {
|
|
|
z.ui.input("[name='TravelCostBoatCarDO[" + i + "]$arrivePlace']").setValue(boatCarArr[i].arrivePlace);
|
|
|
- $("[name='TravelCostBoatCarDO[" + i + "]$arrivePlace']").attr('title',boatCarArr[i].arrivePlace);
|
|
|
+ $("[name='TravelCostBoatCarDO[" + i + "]$arrivePlace']").attr('title', boatCarArr[i].arrivePlace);
|
|
|
}
|
|
|
if (boatCarArr[i].invoiceNums != '') {
|
|
|
z.ui.input("[name='TravelCostBoatCarDO[" + i + "]$invoiceNums']").setValue(boatCarArr[i].invoiceNums);
|
|
|
- $("[name='TravelCostBoatCarDO[" + i + "]$invoiceNums']").attr('title',boatCarArr[i].invoiceNums);
|
|
|
+ $("[name='TravelCostBoatCarDO[" + i + "]$invoiceNums']").attr('title', boatCarArr[i].invoiceNums);
|
|
|
}
|
|
|
if (boatCarArr[i].amount != '') {
|
|
|
z.ui.input("[name='TravelCostBoatCarDO[" + i + "]$amount']").setValue(boatCarArr[i].amount);
|
|
|
- $("[name='TravelCostBoatCarDO[" + i + "]$amount']").attr('title',boatCarArr[i].amount);
|
|
|
+ $("[name='TravelCostBoatCarDO[" + i + "]$amount']").attr('title', boatCarArr[i].amount);
|
|
|
totalBoatCarAmount()
|
|
|
totalAmount()
|
|
|
}
|
|
|
if (!(!boatCarArr[i].remark || boatCarArr[i].remark.trim() === '')) {
|
|
|
z.ui.input("[name='TravelCostBoatCarDO[" + i + "]$remark']").setValue(boatCarArr[i].remark);
|
|
|
- $("[name='TravelCostBoatCarDO[" + i + "]$remark']").attr('title',boatCarArr[i].remark);
|
|
|
+ $("[name='TravelCostBoatCarDO[" + i + "]$remark']").attr('title', boatCarArr[i].remark);
|
|
|
}
|
|
|
if (!(!boatCarArr[i].travelCostId || boatCarArr[i].travelCostId.trim() === '')) {
|
|
|
$("#editBtn_boat_car_" + i).find("span").html("编辑")
|
|
@@ -312,14 +312,14 @@
|
|
|
* 上移、下移JS交互效果实现
|
|
|
* */
|
|
|
$(".up_btn").unbind('click')
|
|
|
- $(".up_btn").click(function(){
|
|
|
+ $(".up_btn").click(function () {
|
|
|
var currentTrDom = $(this).parent().parent();
|
|
|
var prevTrDom = $(currentTrDom).prev();
|
|
|
- if(prevTrDom.length > 0){
|
|
|
+ if (prevTrDom.length > 0) {
|
|
|
var h = currentTrDom.height();
|
|
|
- $(currentTrDom).addClass("transition").css('transform', 'translateY('+(-h)+'px)')
|
|
|
- $(prevTrDom).addClass("transition").css('transform', 'translateY('+(h)+'px)')
|
|
|
- var timer = setTimeout(function(){
|
|
|
+ $(currentTrDom).addClass("transition").css('transform', 'translateY(' + (-h) + 'px)')
|
|
|
+ $(prevTrDom).addClass("transition").css('transform', 'translateY(' + (h) + 'px)')
|
|
|
+ var timer = setTimeout(function () {
|
|
|
$(currentTrDom).removeClass("transition").css('transform', 'translateY(0px)')
|
|
|
$(prevTrDom).removeClass("transition").css('transform', 'translateY(0px)')
|
|
|
prevTrDom.before(currentTrDom);
|
|
@@ -329,14 +329,14 @@
|
|
|
}
|
|
|
})
|
|
|
$(".down_btn").unbind('click')
|
|
|
- $(".down_btn").click(function(){
|
|
|
+ $(".down_btn").click(function () {
|
|
|
var currentTrDom = $(this).parent().parent();
|
|
|
var nextTrDom = $(currentTrDom).next();
|
|
|
- if(nextTrDom.length > 0){
|
|
|
+ if (nextTrDom.length > 0) {
|
|
|
var h = currentTrDom.height();
|
|
|
- $(currentTrDom).addClass("transition").css('transform', 'translateY('+(h)+'px)')
|
|
|
- $(nextTrDom).addClass("transition").css('transform', 'translateY('+(-h)+'px)')
|
|
|
- var timer = setTimeout(function(){
|
|
|
+ $(currentTrDom).addClass("transition").css('transform', 'translateY(' + (h) + 'px)')
|
|
|
+ $(nextTrDom).addClass("transition").css('transform', 'translateY(' + (-h) + 'px)')
|
|
|
+ var timer = setTimeout(function () {
|
|
|
$(currentTrDom).removeClass("transition").css('transform', 'translateY(0px)')
|
|
|
$(nextTrDom).removeClass("transition").css('transform', 'translateY(0px)')
|
|
|
nextTrDom.after(currentTrDom);
|
|
@@ -495,21 +495,21 @@
|
|
|
}
|
|
|
if (!(!otherArr[i].costPlace || otherArr[i].costPlace.trim() === '')) {
|
|
|
z.ui.input("[name='TravelCostOtherDO[" + i + "]$costPlace']").setValue(otherArr[i].costPlace);
|
|
|
- $("[name='TravelCostOtherDO[" + i + "]$costPlace']").attr('title',otherArr[i].costPlace);
|
|
|
+ $("[name='TravelCostOtherDO[" + i + "]$costPlace']").attr('title', otherArr[i].costPlace);
|
|
|
}
|
|
|
if (otherArr[i].invoiceNums != '') {
|
|
|
z.ui.input("[name='TravelCostOtherDO[" + i + "]$invoiceNums']").setValue(otherArr[i].invoiceNums);
|
|
|
- $("[name='TravelCostOtherDO[" + i + "]$invoiceNums']").attr('title',otherArr[i].invoiceNums);
|
|
|
+ $("[name='TravelCostOtherDO[" + i + "]$invoiceNums']").attr('title', otherArr[i].invoiceNums);
|
|
|
}
|
|
|
if (otherArr[i].amount != '') {
|
|
|
z.ui.input("[name='TravelCostOtherDO[" + i + "]$amount']").setValue(otherArr[i].amount);
|
|
|
- $("[name='TravelCostOtherDO[" + i + "]$amount']").attr('title',otherArr[i].amount);
|
|
|
+ $("[name='TravelCostOtherDO[" + i + "]$amount']").attr('title', otherArr[i].amount);
|
|
|
totalOtherAmount()
|
|
|
totalAmount()
|
|
|
}
|
|
|
if (!(!otherArr[i].remark || otherArr[i].remark.trim() === '')) {
|
|
|
z.ui.input("[name='TravelCostOtherDO[" + i + "]$remark']").setValue(otherArr[i].remark);
|
|
|
- $("[name='TravelCostOtherDO[" + i + "]$remark']").attr('title',otherArr[i].remark);
|
|
|
+ $("[name='TravelCostOtherDO[" + i + "]$remark']").attr('title', otherArr[i].remark);
|
|
|
}
|
|
|
if (!(!otherArr[i].travelCostId || otherArr[i].travelCostId.trim() === '')) {
|
|
|
$("#editBtn_other_" + i).find("span").html("编辑")
|
|
@@ -643,7 +643,7 @@
|
|
|
let elementsByName = document.getElementsByName(name);
|
|
|
for (let i = 0; i < elementsByName.length; i++) {
|
|
|
const seqElement = elementsByName[i];
|
|
|
- if(name==='boat_car_seq'){
|
|
|
+ if (name === 'boat_car_seq') {
|
|
|
let spanElement = seqElement.getElementsByTagName("span");
|
|
|
spanElement[0].innerHTML = i + 1;
|
|
|
let detailInput = seqElement.getElementsByTagName("input");
|
|
@@ -934,13 +934,18 @@
|
|
|
postData.createReqVO.boatCarList = boatCarList;
|
|
|
postData.createReqVO.otherList = otherList;
|
|
|
if (finance === "1") {
|
|
|
- if (Number(postData.createReqVO.totalAmount) > Number(previousAmount)) {
|
|
|
+ let bz2 = $("[name='createReqVO$bz2']").val();
|
|
|
+ if (!bz2) {
|
|
|
+ bz2 = 0;
|
|
|
+ }
|
|
|
+ let amount = Number(previousAmount) + Number(bz2);
|
|
|
+ if (Number(postData.createReqVO.totalAmount).toFixed(2) > Number(amount).toFixed(2)) {
|
|
|
all({success: false, errorMsg: "核减后金额不能大于原来金额!"});
|
|
|
return;
|
|
|
}
|
|
|
//发生金额变化
|
|
|
- if (Number(postData.createReqVO.totalAmount) != Number(previousAmount)) {
|
|
|
- let num = Number(previousAmount) - Number(postData.createReqVO.totalAmount);
|
|
|
+ if (Number(postData.createReqVO.totalAmount).toFixed(2) != Number(previousAmount).toFixed(2)) {
|
|
|
+ let num = Number(amount) - Number(postData.createReqVO.totalAmount);
|
|
|
postData.createReqVO.bz3 = '发生了核减:' + '核减' + num + '(元)';
|
|
|
postData.createReqVO.bz2 = num;
|
|
|
}
|