|
|
@@ -68,19 +68,29 @@
|
|
|
<!-- @getCorpData="(row)=>{getGSData(row,['formTwo','boxMakingCompany'])}" corpType="GS"/>-->
|
|
|
<!-- </template>-->
|
|
|
<template slot="menuLeft" slot-scope="scope">
|
|
|
- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用'}) == -1?false:true)" type="primary" size="small"
|
|
|
- @click="statusUpdate('0','起租')">起租
|
|
|
+ <el-button
|
|
|
+ :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '录入'}) == -1?true:false)"
|
|
|
+ type="primary" size="small"
|
|
|
+ @click="statusUpdate('0','起租')">起租
|
|
|
</el-button>
|
|
|
- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '退租'}) == -1?false:true)" type="primary" size="small"
|
|
|
- @click="statusUpdate('1','退租')">退租
|
|
|
+ <el-button
|
|
|
+ :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用' || item.status == '使用'}) == -1?true:false)"
|
|
|
+ type="primary" size="small"
|
|
|
+ @click="statusUpdate('1','退租')">退租
|
|
|
</el-button>
|
|
|
- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '退租'}) == -1?false:true)" type="primary" size="small"
|
|
|
- @click="statusUpdate('2','计算租金')">计算租金
|
|
|
+ <el-button
|
|
|
+ :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用'}) == -1?true:false)"
|
|
|
+ type="primary" size="small"
|
|
|
+ @click="statusUpdate('2','计算租金')">计算租金
|
|
|
</el-button>
|
|
|
- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '退租'}) == -1?false:true)" type="primary" size="small"
|
|
|
- @click="statusUpdate('3','撤销租金')">撤销租金
|
|
|
+ <el-button
|
|
|
+ :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用' && item.count > 0}) == -1?true:false)"
|
|
|
+ type="primary" size="small"
|
|
|
+ @click="statusUpdate('3','撤销租金')">撤销租金
|
|
|
+ </el-button>
|
|
|
+ <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom"
|
|
|
+ @click="excelBox = true">导入
|
|
|
</el-button>
|
|
|
- <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom" @click="excelBox = true">导入</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
@@ -168,6 +178,7 @@ import {
|
|
|
import checkSchedule from "@/components/check/checkSchedule";
|
|
|
import {selectByName} from "@/api/boxManagement";
|
|
|
import {getToken} from "@/util/auth";
|
|
|
+import {dateFormat, defaultDate} from "@/util/date";
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
props: {
|
|
|
@@ -231,17 +242,26 @@ export default {
|
|
|
},
|
|
|
optionStateFour: {
|
|
|
menuBtn: false,
|
|
|
- span: 24,
|
|
|
+ span: 12,
|
|
|
column: [{
|
|
|
- label: '日期',
|
|
|
- prop: 'rentCalculationDateList',
|
|
|
+ label: '起始日期',
|
|
|
+ prop: 'rentStartDate',
|
|
|
width: 100,
|
|
|
- search: true,
|
|
|
- overHidden: true,
|
|
|
- type: "daterange",
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },{
|
|
|
+ label: '结束日期',
|
|
|
+ prop: 'rentCalculationDate',
|
|
|
+ width: 100,
|
|
|
+ type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
|
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
- defaultTime: ["00:00:00", "23:59:59"],
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
|
@@ -403,15 +423,15 @@ export default {
|
|
|
prop: 'code',
|
|
|
width: 100,
|
|
|
overHidden: true,
|
|
|
- // filterable: true,
|
|
|
- // remote: true,
|
|
|
- // allowCreate: true,
|
|
|
- // type: "select",
|
|
|
- // dicUrl: "/api/blade-box-tube/archives/selectArchivesList?size=10¤t=1&code={{key}}",
|
|
|
- // props: {
|
|
|
- // label: "code",
|
|
|
- // value: "code"
|
|
|
- // },
|
|
|
+ filterable: true,
|
|
|
+ remote: true,
|
|
|
+ allowCreate: true,
|
|
|
+ type: "select",
|
|
|
+ dicUrl: "/api/blade-box-tube/archives/selectArchivesList?size=10¤t=1&code={{key}}",
|
|
|
+ props: {
|
|
|
+ label: "code",
|
|
|
+ value: "code"
|
|
|
+ },
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
|
@@ -435,18 +455,6 @@ export default {
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
}, {
|
|
|
- label: '金额',
|
|
|
- prop: 'amount',
|
|
|
- type: 'number',
|
|
|
- controls: false,
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- }, {
|
|
|
label: '租金/天',
|
|
|
prop: 'price',
|
|
|
type: 'number',
|
|
|
@@ -462,20 +470,28 @@ export default {
|
|
|
label: '起租日期',
|
|
|
prop: 'leaseCommencementDate',
|
|
|
overHidden: true,
|
|
|
- display: false,
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
|
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
width: 100,
|
|
|
}, {
|
|
|
- label: '租金计算截止日期',
|
|
|
+ label: '退租日期',
|
|
|
+ prop: 'rentingOutDate',
|
|
|
+ overHidden: true,
|
|
|
+ type: "date",
|
|
|
+ display: false,
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ width: 100,
|
|
|
+ }, {
|
|
|
+ label: '当前租金期间',
|
|
|
prop: 'rentEndDate',
|
|
|
overHidden: true,
|
|
|
display: false,
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
|
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
- width: 160,
|
|
|
+ width: 160
|
|
|
}, {
|
|
|
label: '箱类型',
|
|
|
prop: 'boxTypeId',
|
|
|
@@ -518,7 +534,6 @@ export default {
|
|
|
width: 100,
|
|
|
overHidden: true,
|
|
|
filterable: true,
|
|
|
- disabled: true,
|
|
|
type: 'select',
|
|
|
dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
|
|
|
props: {
|
|
|
@@ -692,28 +707,28 @@ export default {
|
|
|
this.costData = res.data.data
|
|
|
})
|
|
|
//下拉箱号带出对应信息
|
|
|
- // this.findObject(this.option.column, "code").change = ({value, column}) => {
|
|
|
- // selectArchivesList({code: value}).then(res => {
|
|
|
- // for (let item of res.data.data) {
|
|
|
- // if (value == item.code) {
|
|
|
- // this.formTwo = {
|
|
|
- // boxSource: item.boxSource,
|
|
|
- // boxStatus: item.boxStatus,
|
|
|
- // emptyWeight: item.emptyWeight,
|
|
|
- // grossWeight: item.gorssWeight,
|
|
|
- // tare: item.tare,
|
|
|
- // loadingWeight: item.loadingWeight,
|
|
|
- // volume: item.volume,
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
+ this.findObject(this.option.column, "code").change = ({value, column}) => {
|
|
|
+ selectArchivesList({code: value}).then(res => {
|
|
|
+ for (let item of res.data.data) {
|
|
|
+ if (value == item.code) {
|
|
|
+ this.formTwo = {
|
|
|
+ boxSource: item.boxSource,
|
|
|
+ boxStatus: item.boxStatus,
|
|
|
+ emptyWeight: item.emptyWeight,
|
|
|
+ grossWeight: item.gorssWeight,
|
|
|
+ tare: item.tare,
|
|
|
+ loadingWeight: item.loadingWeight,
|
|
|
+ volume: item.volume,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
this.key++
|
|
|
if (this.onLoad.id && this.detailData.id) {
|
|
|
- this.refresh(this.onLoad.id,true)
|
|
|
- }else if (this.onLoad.id){
|
|
|
- this.refresh(this.onLoad.id,true)
|
|
|
+ this.refresh(this.onLoad.id, true)
|
|
|
+ } else if (this.onLoad.id) {
|
|
|
+ this.refresh(this.onLoad.id, true)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -726,6 +741,7 @@ export default {
|
|
|
},
|
|
|
uploadAfter(res, done, loading, column) {
|
|
|
this.excelBox = false;
|
|
|
+ if (typeof res.message === "string") return
|
|
|
for (let item of this.dataList){
|
|
|
for (let li of res){
|
|
|
if (item.code === li.code){
|
|
|
@@ -743,8 +759,19 @@ export default {
|
|
|
this.title = type
|
|
|
if (type === '起租') {
|
|
|
this.optionState = this.optionStateTwo
|
|
|
- } else if (type === '计算租金'){
|
|
|
+ } else if (type === '计算租金') {
|
|
|
this.optionState = this.optionStateFour
|
|
|
+ for (let item of this.selectionList) {
|
|
|
+ for (let li of this.selectionList) {
|
|
|
+ if (item.rentEndDate !== li.rentEndDate) {
|
|
|
+ return this.$message.error("当前租金期间不一样,请重新选择")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const date = new Date(this.selectionList[0].rentEndDate);
|
|
|
+ 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"
|
|
|
}else if(type === '撤销租金'){
|
|
|
return this.$confirm('此操作将撤销租金并删除费用, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
@@ -767,6 +794,7 @@ export default {
|
|
|
});
|
|
|
}else {
|
|
|
this.optionState = this.optionStateThree
|
|
|
+ this.formState.rentDate = dateFormat(new Date(), "yyyy-MM-dd") + " 23:59:59"
|
|
|
}
|
|
|
this.dialogVisible = true
|
|
|
} else {
|
|
|
@@ -777,13 +805,18 @@ export default {
|
|
|
this.$refs["formState"].validate((valid, done) => {
|
|
|
done()
|
|
|
if (valid) {
|
|
|
- if (this.title === "起租" || this.title === "退租"){
|
|
|
+ if (this.title === "起租" || this.title === "退租") {
|
|
|
+ if (this.title === "退租") {
|
|
|
+ if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
|
|
|
+ return this.$message.error("退租日期不能小于当前租金期间")
|
|
|
+ }
|
|
|
+ }
|
|
|
this.disabledVisible = true
|
|
|
statusUpdate({
|
|
|
...this.formState,
|
|
|
...this.form,
|
|
|
- tradingBoxItemsList:this.selectionList,
|
|
|
- rentType:this.title === "起租"?1:2
|
|
|
+ tradingBoxItemsList: this.selectionList,
|
|
|
+ rentType: this.title === "起租" ? 1 : 2
|
|
|
}).then(res => {
|
|
|
this.$message.success("操作成功")
|
|
|
this.dialogVisible = false
|
|
|
@@ -795,6 +828,9 @@ export default {
|
|
|
})
|
|
|
}else {
|
|
|
if (this.title === "计算租金"){
|
|
|
+ if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
|
|
|
+ return this.$message.error("起始日期不能小于起租日期")
|
|
|
+ }
|
|
|
this.disabledVisible = true
|
|
|
calculateRent({
|
|
|
...this.form,
|