@ -174,6 +174,7 @@
< / e l - t a b l e - c o l u m n >
< el -table -column label = "操作" align = "center" >
< template # default = "scope" >
< el -button type = "text" @ click = "changebatchRenewalShow(scope.$index, scope.row)" > 续租 < / e l - b u t t o n >
< el -button type = "text" class = "red" @ click = "rentOutOperation(scope.$index, scope.row)"
: disabled = "scope.row.status > 2 ? true : false" > 退租 < / e l - b u t t o n >
< el -button type = "text" @ click = "deleteAgreement(scope.$index, scope.row)" > 删除 < / e l - b u t t o n >
@ -523,6 +524,24 @@
< el -button type = "primary" @click ="signAContract" > 签 约 < / el -button >
< / span >
< / e l - d i a l o g >
< el -dialog title = "续租" :visible.sync ="batchRenewalShow" width = "30%" >
< el -form ref = "batchRenewalFrom" :model ="batchRenewalFrom" label -width = " 80px " class = "temporary" >
< el -form -item label = "开始时间" >
< el -date -picker v -model = " batchRenewalFrom.startTime " :picker-options ="pickerOptionsBegin" size = "small"
type = "datetime" placeholder = "选择日期时间" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item label = "结束时间" >
< el -date -picker v -model = " batchRenewalFrom.endTime " :picker-options ="pickerOptionsBegin" size = "small"
type = "datetime" placeholder = "选择日期时间" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item >
< el -button size = "small" @ click = "batchRenewalShow = false" type = "primary" > 取消 < / e l - b u t t o n >
< el -button size = "small" @click ="batchRenewalMethods" type = "primary" > 确定 < / e l - b u t t o n >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< / e l - d i a l o g >
< zw ref = "myChild" > < / zw >
< getFinger ref = "myGetFinger" > < / getFinger >
< / div >
@ -547,6 +566,13 @@ export default {
name : "agreement" ,
data ( ) {
return {
/ / 续 租 信 息
batchmessage : { } ,
batchRenewalFrom : {
startTime : new Date ( ) ,
endTime : ''
} ,
batchRenewalShow : false ,
savevoucherlist : [ ] ,
checkInListing : [ ] ,
enterpriselist : [ ] ,
@ -740,6 +766,142 @@ export default {
this . getAllTree ( )
} ,
methods : {
/ / 续 租
batchRenewalMethods ( ) {
this . $confirm ( '此操作将延长入住时间, 是否继续?' , '提示' , {
confirmButtonText : '确定' ,
cancelButtonText : '取消' ,
type : 'warning'
} ) . then ( ( ) => {
if ( this . batchRenewalFrom . endTime == '' || this . batchRenewalFrom . startTime == '' ) {
return this . $message . error ( '请选择时间范围' )
}
if ( this . batchRenewalFrom . startTime > this . batchRenewalFrom . endTime ) {
return this . $message . error ( '开始时间不得大于结束时间' )
}
/ / 获 取 该 设 备 信 息
let lockdata = {
pageNum : 1 ,
pageSize : 10 ,
q : JSON . stringify ( { roomIds : [ this . batchmessage . siteId ] , lockType : 1 } )
}
httpPost ( lockdata , this . $api . getDeviceItems ) . then ( res => {
console . log ( res ) ;
if ( res . success ) {
var lockmessage = res . data . list [ 0 ] / / 房 间 信 息
lockmessage . cardId = this . batchmessage . cardId
if ( lockmessage . manufactureId == 101 ) {
var userTelephone = this . batchmessage . phone . substring ( this . batchmessage . phone . length - 6 , this . batchmessage . phone . length ) ;
var userPassword = this . batchmessage . phone . substring ( this . batchmessage . phone . length - 6 , this . batchmessage . phone . length ) ;
var endTime = new Date ( this . batchRenewalFrom . endTime ) . getTime ( )
var startTime = new Date ( this . batchRenewalFrom . startTime ) . getTime ( )
var passwordEndTime = moment ( endTime ) . format ( "YYYYMMDDHHmmss" ) ;
var passwordStartTime = moment ( startTime ) . format ( "YYYYMMDDHHmmss" ) ;
var data = {
deviceNum : lockmessage . deviceNum ,
imei : lockmessage . imei ,
userTelephone : userTelephone ,
userPassword : userPassword ,
password : userPassword ,
operateMode : 2 ,
order : 6202 ,
passwordStartTime : passwordStartTime ,
passwordEndTime : passwordEndTime ,
cardName : this . batchmessage . name ,
roomName : lockmessage . roomName
}
ICINLocker . LDAddUser ( data . deviceNum , data . imei , data . userTelephone , data . userPassword , data
. password ,
passwordStartTime , passwordEndTime , data . operateMode , data . order , data . cardName ,
data
. roomName , false , ( callback ) => {
console . log ( callback ) ;
if ( callback . success ) {
var data = {
pageNum : 0 ,
pageSize : 0 ,
orderBy : "create_at desc" ,
q : {
cardId : this . batchmessage . cardId ,
deviceNum : lockmessage . deviceNum ,
types : "0,1,2,3,4" ,
inStatus : "0,1"
} ,
} ;
var unbind = {
id : this . batchmessage . cardId ,
startTime : this . batchRenewalFrom . startTime ,
endTime : this . batchRenewalFrom . endTime
} ;
/ / 重 新 绑 定 房 间
httpPost ( unbind , this . $api . setTenant ) . then ( ( res ) => {
console . log ( res ) ;
} )
/ / 修 改 凭 证
httpGet ( data , this . $api . getCertificates ) . then ( ( res ) => {
let data = utils . zlib_unzip ( res . data )
data . map ( lt => {
utils . modifyPutCarfid ( lockmessage , lt , startTime , endTime )
} )
} )
this . batchRenewalShow = false
} else {
this . $message . error ( "修改失败" )
}
} )
} else if ( lockmessage . manufactureId == 201 || lockmessage . manufactureId == 221 ) {
var endTime = new Date ( this . batchRenewalFrom . endTime ) . getTime ( )
var startTime = new Date ( this . batchRenewalFrom . startTime ) . getTime ( )
var unbind = [ {
cardId : this . batchmessage . cardId ,
siteId : lockmessage . roomId ,
} ] ;
httpPost ( unbind , this . $api . unbindCard ) . then ( ( res ) => {
var data1 = [ {
cardId : this . batchmessage . cardId ,
siteId : lockmessage . roomId ,
startTime : this . batchRenewalFrom . startTime ,
endTime : this . batchRenewalFrom . endTime
} ] ;
httpPost ( data1 , this . $api . bindCard ) . then ( ( res ) => {
console . log ( res ) ;
} ) ;
} )
var data = {
pageNum : 0 ,
pageSize : 0 ,
orderBy : "create_at desc" ,
q : {
cardId : this . batchmessage . cardId ,
deviceNum : lockmessage . deviceNum ,
types : "0,1,2,3,4" ,
inStatus : "0,1"
} ,
} ;
httpGet ( data , this . $api . getCertificates ) . then ( ( res ) => {
console . log ( res ) ;
let data = utils . zlib_unzip ( res . data )
console . log ( data ) ;
data . map ( lt => {
utils . modifyPutCarfidzg ( lockmessage , lt , startTime , endTime )
} )
} )
this . batchRenewalShow = false
} else {
this . $message . error ( "暂未发现对应设备" )
}
} else {
this . $message . error ( res . message )
}
} )
} )
} ,
/ / 开 启 续 组 界 面
changebatchRenewalShow ( index , row ) {
this . batchRenewalShow = true
this . batchmessage = row
} ,
/ / 查 询 和 房 间 相 关 的 设 备
getAboutDevice ( ) {
httpGet ( "" , this . $api . onlySiteDevice ) . then ( ( res ) => {
@ -1869,6 +2031,12 @@ export default {
if ( this . value2 [ 0 ] > this . value2 [ 1 ] ) {
return this . $message . error ( '开始时间不能大于结束时间' )
}
if ( this . value2 [ 0 ] < this . form . signingTime || this . value2 [ 0 ] > this . form . contractTime ) {
return this . $message . error ( '开始时间不能超出祖约时间' )
}
if ( this . value2 [ 1 ] < this . form . signingTime || this . value2 [ 1 ] > this . form . contractTime ) {
return this . $message . error ( '结束时间不能超出租约时间' )
}
if ( this . documentType == 11 ) {
var fingerprintAlias = ''
var fingerprint = localStorage . getItem ( "fingerprint" ) ;