@ -1,10 +1,10 @@
< template >
< div class = "container_box" >
< el -form :inline ="true" :model ="queryForm" class = "demo-form-inline" size = "small" >
< el -form -item label = "快递单 号" >
< el -input v -model = " queryForm.courierNumber " placeholder = "快递单 号" clearable > < / e l - i n p u t >
< el -form -item label = "运单编 号" >
< el -input v -model = " queryForm.courierNumber " placeholder = "运单编 号" clearable > < / e l - i n p u t >
< / e l - f o r m - i t e m >
< el -form -item label = "下单 时间" >
< el -form -item label = "派件 时间" >
< el -date -picker @change ="changeSearchDate" v -model = " queryForm.dateRange " type = "daterange" range -separator = " 至 "
start - placeholder = "开始日期" end - placeholder = "结束日期" >
< / e l - d a t e - p i c k e r >
@ -19,33 +19,47 @@
< el -button type = "primary" @click ="onSubmit" > 搜 索 < / el -button >
< / e l - f o r m - i t e m >
< el -form -item >
< el -upload ref = "upload" class = "upload-demo" action = "/sjapi/send" :show-file-list ="false" :on-success ="uploadSuccess "
: on - error = "uploadError" : limit = "1" >
< el -button size = "small" > 导 入 < / e l - b u t t o n >
< el -upload ref = "upload" class = "upload-demo" :on-change ="UploadChange" action = "http://192.168.1.38:8210/send" :show-file-list ="false "
: before - upload = "handleBeforeUpload" : on - success = "uploadSuccess" : on - error = "uploadError" : limit = "1" >
< el -button size = "small" v -loading .fullscreen.lock = " importLoading " > 导 入 < / e l - b u t t o n >
< / e l - u p l o a d >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -table :data ="expressData" size = "small" border style = "width: 100%" >
< el -table -column prop = "orderTime" label = "下单时间" width = "180" >
< el -table :data ="expressData" size = "small" border style = "width: 100%" v-loading ="loading" >
<!-- < el -table -column prop = "orderTime" label = "下单时间" width = "180" >
< template slot -scope = " scope " >
{ { dateFormatter ( scope . row . orderTime ) } }
< / template >
< / e l - t a b l e - c o l u m n > - - >
< el -table -column prop = "courierNumber" label = "运单编号" >
< template slot -scope = " scope " >
{ { dateFormatter ( scope . row . orderTime ) } }
< el -button @click ="queryExpressDetail(scope.row)" type = "text" > { { scope . row . courierNumber } } < / e l - b u t t o n >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "courierNumber" label = "快递单号" >
< el -table -column prop = "expressType" label = "快递类型" >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "deliveryTime" label = "派件时间" >
< template slot -scope = " scope " >
< el -button @click ="queryExpressDetail(scope.row)" type = "text" > { { scope . row . courierNumber } } < / e l - b u t t o n >
{ { dateFormatter ( scope . row . deliveryTime ) } }
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "expressType" label = "快递类型 " >
< el -table -column prop = "receiptStatus" label = "签收标识 " >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "placeOfOrigin " label = "发件地 " >
< el -table -column prop = "ex pressP lace" label = "签收网点 " >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "destination" label = "收件地" >
< el -table -column prop = "endTime" label = "签收时间" >
< template slot -scope = " scope " >
{ { scope . row . endTime ? dateFormatter ( scope . row . endTime ) : "" } }
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "addressee" label = "收件人" >
< el -table -column prop = "placeOfOrigin" label = "发件地 " >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "cellphoneNumber" label = "收件人手机号 " >
< el -table -column prop = "destination" label = "收件地 " >
< / e l - t a b l e - c o l u m n >
<!-- < el -table -column prop = "addressee" label = "收件人" >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "cellphoneNumber" label = "收件人手机号" >
< / e l - t a b l e - c o l u m n > - - >
< / e l - t a b l e >
< div style = "margin-top:20px;" >
< el -pagination background : page -sizes = " [ 10 , 20 , 50 ] " @size-change ="handleSizeChange"
@ -99,6 +113,8 @@ export default {
} , / / 快 递 类 型
dialogVisible : false ,
expressRecord : [ ] , / / 快 递 跟 踪 记 录
loading : false ,
importLoading : false , / / 导 入 l o a d i n g
} ;
} ,
mounted ( ) {
@ -126,13 +142,20 @@ export default {
_param [ item ] = param [ item ] ;
}
} )
queryExpressList ( _param ) . then ( res => {
if ( res . code == 200 ) {
this . total = res . total ;
this . expressData = res . data ;
}
} )
this . loading = true ;
try {
queryExpressList ( _param ) . then ( res => {
this . loading = false ;
if ( res . code == 200 ) {
this . total = res . total ;
this . expressData = res . data ;
}
} , err => {
this . loading = false ;
} )
} catch ( error ) {
this . loading = false ;
}
} ,
/ / 分 页
handleSizeChange ( val ) {
@ -151,8 +174,25 @@ export default {
this . queryList ( ) ;
} ,
/ / e x c e l 导 入
handleBeforeUpload ( file ) {
const isLt10M = file . size / 1024 / 1024 < 10 ;
if ( ! isLt10M ) {
this . $message . error ( '导入文件不能超过 10MB!' ) ;
} else {
this . importLoading = true ;
}
return isLt10M ;
} ,
UploadChange ( file , fileList ) {
setTimeout ( ( ) => {
this . importLoading = false ;
this . $refs . upload . clearFiles ( ) ;
this . $refs . upload . abort ( ) ;
} , 1000 * 60 * 1 ) ; / / 三 分 钟 之 后 关 闭 加 载
} ,
uploadSuccess ( response , file , fileList ) {
if ( response . code == 200 ) {
this . importLoading = false ;
if ( response . code == 200 ) {
this . $message . success ( '导入成功' ) ;
this . $refs . upload . clearFiles ( ) ;
this . pagination . page = 1 ;
@ -160,6 +200,7 @@ export default {
}
} ,
uploadError ( err , file , fileList ) {
this . importLoading = false ;
console . log ( '导入失败' , err )
} ,
/ / 快 递 1 0 0