|
@@ -217,7 +217,9 @@ import {
|
|
|
repealCancel,
|
|
|
statusUpdate, calculateRent, revokeRent, itemDetails, revokeRentingOut, detList, tradingBoxItemSubmitRent
|
|
|
} from "@/api/boxManagement/leaseIn/index.js";
|
|
|
-
|
|
|
+import {
|
|
|
+ tradingBoxFeesList,
|
|
|
+} from "@/api/boxManagement";
|
|
|
import checkSchedule from "@/components/check/checkSchedule";
|
|
|
import {selectByName} from "@/api/boxManagement";
|
|
|
import {getToken} from "@/util/auth";
|
|
@@ -944,12 +946,26 @@ export default {
|
|
|
const endDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
|
this.formState.rentStartDate = this.selectionList[0].rentEndDate
|
|
|
this.formState.rentCalculationDate = dateFormat(endDate, "yyyy-MM-dd") + " 23:59:59"
|
|
|
- if (this.selectionList[0].rentEndDate){
|
|
|
- let curDate = new Date(this.selectionList[0].rentEndDate);
|
|
|
- let endDateTime = new Date((curDate/1000+86400)*1000)
|
|
|
- this.formState.rentStartDate = dateFormat(endDateTime, "yyyy-MM-dd") + " 00:00:00"
|
|
|
- const endDateTwo = new Date(endDateTime.getFullYear(), endDateTime.getMonth() + 1, 0);
|
|
|
- this.formState.rentCalculationDate = dateFormat(endDateTwo, "yyyy-MM-dd") + " 23:59:59"
|
|
|
+ if (this.selectionList[0].rentEndDate) {
|
|
|
+ let endDateTime = 0
|
|
|
+ tradingBoxFeesList({
|
|
|
+ code: this.selectionList[0].code,
|
|
|
+ current: 1,
|
|
|
+ size: 10,
|
|
|
+ pid: this.form.id,
|
|
|
+ feesType: 1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.data.records.length>0) {
|
|
|
+ let curDate = new Date(this.selectionList[0].rentEndDate);
|
|
|
+ endDateTime = new Date((curDate / 1000 + 86400) * 1000)
|
|
|
+ } else {
|
|
|
+ let curDate = new Date(this.selectionList[0].leaseCommencementDate ? this.selectionList[0].leaseCommencementDate.slice(0, 10) : this.selectionList[0].leaseCommencementDate);
|
|
|
+ endDateTime = new Date((curDate / 1000) * 1000)
|
|
|
+ }
|
|
|
+ this.formState.rentStartDate = dateFormat(endDateTime, "yyyy-MM-dd") + " 00:00:00"
|
|
|
+ const endDateTwo = new Date(endDateTime.getFullYear(), endDateTime.getMonth() + 1, 0);
|
|
|
+ this.formState.rentCalculationDate = dateFormat(endDateTwo, "yyyy-MM-dd") + " 23:59:59"
|
|
|
+ })
|
|
|
}
|
|
|
}else if(type === '撤销租金'){
|
|
|
return this.$confirm('此操作将撤销租金并删除费用, 是否继续?', '提示', {
|
|
@@ -1061,7 +1077,7 @@ export default {
|
|
|
})
|
|
|
}else {
|
|
|
if (this.title === "计算租金"){
|
|
|
- if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
|
|
|
+ if (Number(new Date(this.selectionList[0].leaseCommencementDate?this.selectionList[0].leaseCommencementDate.slice(0, 10):this.selectionList[0].leaseCommencementDate,this.formState.rentStartDate)) > Number(new Date(this.formState.rentStartDate?this.formState.rentStartDate.slice(0, 10):this.formState.rentStartDate))) {
|
|
|
return this.$message.error("起始日期不能小于起租日期")
|
|
|
}
|
|
|
this.disabledVisible = true
|