@ -3,8 +3,7 @@
< div v-show ="viewState == 1" >
< button -bar view -title = " 销售出库管理 " :btndisabled ="btndisabled" @btnhandle ="btnHandle" / >
< div class = "searchcon" >
< el -button size = "small" class = "searchbtn" @ click = "isSearchShow = !isSearchShow" > { { isSearchShow ? '隐藏查询条件' :
'显示查询条件' } }
< el -button size = "small" class = "searchbtn" @ click = "isSearchShow = !isSearchShow" > { { isSearchShow ? '隐藏查询条件' : '显示查询条件' } }
< / e l - b u t t o n >
< div v-show ="isSearchShow" class="search" >
< el -form :inline ="true" class = "tab-header" >
@ -16,14 +15,11 @@
< el -input v -model = " queryParams.params.customerName " placeholder = "请输入客户名称" clearable / >
< / e l - f o r m - i t e m >
< el -form -item label = "销售部门" class = "salesDepNameStyle" >
< el -cascader :key ="refreshItem" v -model = " salesDepName_list " @change ="salesDepNameChange"
: options = "options" : props = "props" / >
< el -cascader :key ="refreshItem" v -model = " salesDepName_list " @change ="salesDepNameChange" :options ="options" :props ="props" / >
< / e l - f o r m - i t e m >
< el -form -item label = "项目类别" >
< el -select v -model = " queryParams.params.finItemType " @change ="changefinItemType" style = "width:200px"
filterable placeholder = "请选择" >
< el -option v -for = " item in finItemType_list " :key ="item.dictKey" :label ="item.dictValue"
: value = "item.dictKey" > < / e l - o p t i o n >
< el -select v-model ="queryParams.params.finItemType" @change="changefinItemType" style="width:200px" filterable placeholder="请选择" >
< el -option v-for ="item in finItemType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" > < / el -option >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "制单人" >
@ -32,27 +28,21 @@
< / e l - r o w >
< el -row >
< el -form -item label = "中介单位" >
< el -select v -model = " queryParams.params.distributorName " @change ="changedistributorName"
style = "width:200px" filterable placeholder = "请选择" >
< el -option v -for = " item in distributorName_list " :key ="item.sid" :label ="item.distributorName"
: value = "item.sid" >
< el -select v-model ="queryParams.params.distributorName" @change="changedistributorName" style="width:200px" filterable placeholder="请选择" >
< el -option v-for ="item in distributorName_list" :key="item.sid" :label="item.distributorName" :value="item.sid" >
< / e l - o p t i o n >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "销售渠道" >
< el -select v -model = " queryParams.params.sellChannel " @ change = 'changesellChannel' style = "width:200px"
filterable placeholder = "请选择" >
< el -option v -for = " item in sellChannel_list " :key ="item.dictKey" :label ="item.dictValue"
: value = "item.dictKey" >
< el -select v-model ="queryParams.params.sellChannel" @change='changesellChannel' style="width:200px" filterable placeholder="请选择" >
< el -option v-for ="item in sellChannel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" >
< / e l - o p t i o n >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item class = "formItem" label = "出库日期" >
< el -date -picker value -format = " yyyy -MM -dd " v -model = " queryParams.params.outDateStart " clearable
style = "width: 160px;" type = "date" placeholder = "开始日期" / >
< el -date -picker value -format = " yyyy -MM -dd " v -model = " queryParams.params.outDateStart " clearable style = "width: 160px;" type = "date" placeholder = "开始日期" / >
< div class = "line" > 至 < / div >
< el -date -picker value -format = " yyyy -MM -dd " v -model = " queryParams.params.outDateEnd " clearable
style = "width: 160px;" type = "date" placeholder = "结束日期" / >
< el -date -picker value -format = " yyyy -MM -dd " v -model = " queryParams.params.outDateEnd " clearable style = "width: 160px;" type = "date" placeholder = "结束日期" / >
< / e l - f o r m - i t e m >
< / e l - r o w >
< el -divider / >
@ -66,20 +56,18 @@
<!-- Start 项目列表头部 -- >
< div class = "listtop" >
< div class = "tit" > 销售出库单列表 < / div >
< pageye v -show = " dataList.length > 0 " :total=" queryParams . total " :page.sync=" queryParams . current "
: limit . sync = "queryParams.size" class = "pagination" @ pagination = "loadList" / >
< pageye v -show = " dataList.length > 0 " :total=" queryParams . total " :page.sync=" queryParams . current " :limit.sync=" queryParams . size " class=" pagination " @pagination=" loadList " / >
< / div >
<!-- End 项目列表头部 -- >
<!-- Start 项目列表 -- >
< div class = "listcon" >
< el -table v -loading = " tableLoading " :data ="dataList" border style = "width: 100%"
@ selection - change = "handleSelectionChange" >
< el -table v-loading ="tableLoading" :data="dataList" border style="width: 100%" @selection-change="handleSelectionChange" >
< el -table -column width = "50px" type = "selection" align = "center" / >
< el -table -column width = "80px" label = "序号" type = "index" :index ="indexMethod" align = "center" / >
< el -table -column prop = "billNo" label = "单据编号" align = "center" >
< template slot -scope = " scope " >
< span class = "tablerow-click" @click ="toInfo(scope.row)" > {{ scope.row.billNo }} < / span >
< span class = "tablerow-click" @click ="toInfo(scope.row)" > {{ scope.row.billNo }} < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "sellType" label = "销售类型" align = "center" / >
@ -98,14 +86,7 @@
< div class = "pages" >
< div class = "tit" / >
<!-- 翻页 -- >
< pagination
v - show = "dataList.length > 0"
: total = "queryParams.total"
: page . sync = "queryParams.current"
: limit . sync = "queryParams.size"
class = "pagination"
@ pagination = "loadList"
/ >
< pagination v -show = " dataList.length > 0 " :total=" queryParams . total " :page.sync=" queryParams . current " :limit.sync=" queryParams . size " class=" pagination " @pagination=" loadList " / >
< / div >
< / div >
<!-- End 查询和其列表部分 -- >
@ -119,413 +100,415 @@
< / template >
< script >
import req from '@/api/anruiscm/scmoutbound'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './scmoutboundAdd'
import divInfo from './scmoutboundInfo'
import req from '@/api/anruiscm/scmoutbound'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './scmoutboundAdd'
import divInfo from './scmoutboundInfo'
export default {
name : 'ScmOutboundIndex' ,
components : {
ButtonBar ,
Pagination ,
pageye ,
divAdd ,
divInfo
export default {
name : 'ScmOutboundIndex' ,
components : {
ButtonBar ,
Pagination ,
pageye ,
divAdd ,
divInfo
} ,
data ( ) {
return {
btndisabled : false ,
refreshItem : 0 ,
viewState : 1 , / / 1 、 列 表 2 、 添 加 3 、 修 改 4 、 查 看
isSearchShow : false ,
tableLoading : false ,
dataList : [ ] ,
finItemType_list : [ ] , / / 项 目 类 别
distributorName_list : [ ] , / / 中 介 单 位
sellChannel_list : [ ] , / / 销 售 渠 道
salesDepName_list : [ ] , / / 销 售 部 门
options : [ ] ,
dataArr : [ ] ,
props : {
value : 'sid' ,
label : 'name' ,
children : 'children' ,
multiple : true
} ,
queryParams : {
current : 1 ,
size : 10 ,
total : 0 ,
params : {
sids : [ ] , / / 用 于 导 出 的 时 候 保 存 已 选 择 S I D
billNo : '' , / / 单 据 编 号
customerName : '' , / / 客 户 名 称
salesDepName : '' , / / 销 售 部 门
finItemType : '' , / / 项 目 类 别
distributorName : '' , / / 中 介 单 位 名 称
sellChannel : '' , / / 销 售 渠 道
creatorName : '' , / / 制 单 人
outDateStart : '' ,
outDateEnd : ''
}
} ,
multipleSelection : [ ]
}
} ,
created ( ) {
this . finItemType ( )
this . distributorName ( )
this . sellChannel ( )
this . loadList ( )
this . getZuZhi ( )
} ,
methods : {
resetState ( ) {
this . viewState = 1
} ,
data ( ) {
return {
btndisabled : false ,
refreshItem : 0 ,
viewState : 1 , / / 1 、 列 表 2 、 添 加 3 、 修 改 4 、 查 看
isSearchShow : false ,
tableLoading : false ,
dataList : [ ] ,
finItemType_list : [ ] , / / 项 目 类 别
distributorName_list : [ ] , / / 中 介 单 位
sellChannel_list : [ ] , / / 销 售 渠 道
salesDepName_list : [ ] , / / 销 售 部 门
options : [ ] ,
dataArr : [ ] ,
props : {
value : 'sid' ,
label : 'name' ,
children : 'children' ,
multiple : true
} ,
queryParams : {
current : 1 ,
size : 10 ,
total : 0 ,
params : {
sids : [ ] , / / 用 于 导 出 的 时 候 保 存 已 选 择 S I D
billNo : '' , / / 单 据 编 号
customerName : '' , / / 客 户 名 称
salesDepName : '' , / / 销 售 部 门
finItemType : '' , / / 项 目 类 别
distributorName : '' , / / 中 介 单 位 名 称
sellChannel : '' , / / 销 售 渠 道
creatorName : '' , / / 制 单 人
outDateStart : '' ,
outDateEnd : ''
}
} ,
multipleSelection : [ ]
}
finItemType ( ) {
req . pullDown ( { psid : 0 , type : 'finItemType' } ) . then ( ( response ) => {
if ( response . code === '200' ) {
this . finItemType_list = response . data
}
} )
} ,
created ( ) {
this . finItemType ( )
this . distributorName ( )
this . sellChannel ( )
this . loadList ( )
this . getZuZhi ( )
distributorName ( ) {
req . distributorName ( ) . then ( ( response ) => {
if ( response . code === '200' ) {
this . distributorName_list = response . data
}
} )
} ,
methods : {
resetState ( ) {
this . viewState = 1
} ,
finItemType ( ) {
req . pullDown ( { psid : 0 , type : 'finItemType' } ) . then ( ( response ) => {
if ( response . code === '200' ) {
this . finItemType_list = response . data
sellChannel ( ) {
req . pullDown ( { psid : 0 , type : 'sellChannel' } ) . then ( ( response ) => {
if ( response . code === '200' ) {
this . sellChannel_list = response . data
}
} )
} ,
changedistributorName ( value ) {
let bb = null
this . distributorName_list . forEach ( ( e ) => {
if ( e . sid === value ) {
bb = {
name : e . distributorName ,
value : e . sid
}
} )
} ,
distributorName ( ) {
req . distributorName ( ) . then ( ( response ) => {
if ( response . code === '200' ) {
this . distributorName_list = response . data
}
} )
this . queryParams . params . distributorName = bb . name
} ,
changesellChannel ( value ) {
let bb = null
this . sellChannel_list . forEach ( ( e ) => {
if ( e . dictKey === value ) {
bb = {
name : e . dictValue ,
value : e . dictKey
}
} )
} ,
sellChannel ( ) {
req . pullDown ( { psid : 0 , type : 'sellChannel' } ) . then ( ( response ) => {
if ( response . code === '200' ) {
this . sellChannel_list = response . data
}
} )
this . queryParams . params . sellChannel = bb . name
} ,
changefinItemType ( value ) {
let bb = null
this . finItemType_list . forEach ( ( e ) => {
if ( e . dictKey === value ) {
bb = {
name : e . dictValue ,
value : e . dictKey
}
}
} )
this . queryParams . params . finItemType = bb . name
} ,
btnHandle ( btnKey ) {
console . log ( 'XXXXXXXXXXXXXXX ' + btnKey )
switch ( btnKey ) {
case 'toAdd' :
this . toAdd ( )
break
case 'toEdit' :
this . toEdit ( )
break
case 'doSubmit' :
this . doSubmit ( )
break
case 'doDel' :
this . doDel ( )
break
case 'doImport' :
this . doImport ( )
break
case 'doExport' :
this . doExport ( )
break
default :
break
}
} ,
toAdd ( row ) {
this . viewState = 2
this . $refs [ 'divadd' ] . showAdd ( )
} ,
toEdit ( ) {
if ( this . multipleSelection . length === 0 ) {
this . $message ( { showClose : true , type : 'error' , message : '请选择一条记录进行编辑' } )
return
}
if ( this . multipleSelection . length > 1 ) {
this . $message ( { showClose : true , type : 'error' , message : '只能选择一条记录进行编辑' } )
return
}
this . viewState = 3
const row = this . multipleSelection [ 0 ]
this . $refs [ 'divadd' ] . showEdit ( row )
} ,
doSubmit ( row ) {
/ / 提 交 的 代 码
this . btndisabled = true
req
. doSubmit ( this . queryParams . params )
. then ( resp => {
console . log ( resp )
this . btndisabled = false
} )
} ,
changedistributorName ( value ) {
let bb = null
this . distributorName_list . forEach ( ( e ) => {
if ( e . sid == value ) {
bb = {
name : e . distributorName ,
value : e . sid
}
}
. catch ( ( ) => {
this . btndisabled = false
} )
this . queryParams . params . distributorName = bb . name
} ,
changesellChannel ( value ) {
let bb = null
this . sellChannel_list . forEach ( ( e ) => {
if ( e . dictKey == value ) {
bb = {
name : e . dictValue ,
value : e . dictKey
}
}
} ,
doDel ( row ) {
if ( this . multipleSelection . length === 0 ) {
this . $message ( { showClose : true , type : 'error' , message : '请选择至少一条记录进行删除操作' } )
return
}
const _this = this
const sids = [ ]
this . multipleSelection . forEach ( row => {
sids . push ( row . sid )
} )
const tip = '请确认是否删除所选 ' + this . multipleSelection . length + ' 条记录?'
this . $confirm ( tip , '提示' , {
confirmButtonText : '确定' ,
cancelButtonText : '取消' ,
type : 'warning'
} ) . then ( ( ) => {
const loading = this . $loading ( {
lock : true ,
text : 'Loading' ,
spinner : 'el-icon-loading' ,
background : 'rgba(0, 0, 0, 0.7)'
} )
this . queryParams . params . sellChannel = bb . name
} ,
changefinItemType ( value ) {
let bb = null
this . finItemType_list . forEach ( ( e ) => {
if ( e . dictKey == value ) {
bb = {
name : e . dictValue ,
value : e . dictKey
}
}
req . delBySids ( sids ) . then ( resp => {
loading . close ( )
_this . $message ( { type : 'success' , message : resp . msg , showClose : true } )
_this . loadList ( )
} ) . catch ( e => {
loading . close ( )
} )
this . queryParams . params . finItemType = bb . name
} ,
btnHandle ( btnKey ) {
console . log ( 'XXXXXXXXXXXXXXX ' + btnKey )
switch ( btnKey ) {
case 'toAdd' :
this . toAdd ( )
break
case 'toEdit' :
this . toEdit ( )
break
case 'doSubmit' :
this . doSubmit ( )
break
case 'doDel' :
this . doDel ( )
break
case 'doImport' :
this . doImport ( )
break
case 'doExport' :
this . doExport ( )
break
default :
break
}
} ,
toAdd ( row ) {
this . viewState = 2
this . $refs [ 'divadd' ] . showAdd ( )
} ,
toEdit ( ) {
if ( this . multipleSelection . length === 0 ) {
this . $message ( { showClose : true , type : 'error' , message : '请选择一条记录进行编辑' } )
return
}
if ( this . multipleSelection . length > 1 ) {
this . $message ( { showClose : true , type : 'error' , message : '只能选择一条记录进行编辑' } )
return
}
this . viewState = 3
const row = this . multipleSelection [ 0 ]
this . $refs [ 'divadd' ] . showEdit ( row )
} ,
doSubmit ( row ) {
/ / 提 交 的 代 码
this . btndisabled = true
req
. doSubmit ( this . queryParams . params )
. then ( resp => {
console . log ( resp )
this . btndisabled = false
} )
. catch ( ( ) => {
this . btndisabled = false
} )
} ,
doDel ( row ) {
if ( this . multipleSelection . length === 0 ) {
this . $message ( { showClose : true , type : 'error' , message : '请选择至少一条记录进行删除操作' } )
return
}
const _this = this
const sids = [ ]
this . multipleSelection . forEach ( row => {
sids . push ( row . sid )
} )
const tip = '请确认是否删除所选 ' + this . multipleSelection . length + ' 条记录?'
this . $confirm ( tip , '提示' , {
confirmButtonText : '确定' ,
cancelButtonText : '取消' ,
type : 'warning'
} ) . then ( ( ) => {
const loading = this . $loading ( {
lock : true ,
text : 'Loading' ,
spinner : 'el-icon-loading' ,
background : 'rgba(0, 0, 0, 0.7)'
} )
req . delBySids ( sids ) . then ( resp => {
loading . close ( )
_this . $message ( { type : 'success' , message : resp . msg , showClose : true } )
_this . loadList ( )
} ) . catch ( e => {
loading . close ( )
} )
} ) . catch ( ( ) => {
} ) . catch ( ( ) => {
} )
} ,
doImport ( row ) {
/ / 导 入 的 代 码
req
. importExcel ( this . queryParams . params )
. then ( resp => {
console . log ( resp )
} )
} ,
doImport ( row ) {
/ / 导 入 的 代 码
req
. importExcel ( this . queryParams . params )
. then ( resp => {
console . log ( resp )
} )
. catch ( ( ) => {
} )
} ,
doExport ( row ) {
/ / 导 出 的 代 码
const sids = [ ]
this . multipleSelection . forEach ( row => {
sids . push ( row . sid )
. catch ( ( ) => {
} )
this . queryParams . params . sids = sids
req
. exportExcel ( this . queryParams . params )
. then ( resp => {
var map = resp . data
const fileName = map . filename / / 导 出 文 件 名
/ / / / 对 于 < a > 标 签 , 只 有 F i r e f o x 和 C h r o m e ( 内 核 ) 支 持 d o w n l o a d 属 性
/ / / / I E 1 0 以 上 支 持 b l o b 但 是 依 然 不 支 持 d o w n l o a d
const link = document . createElement ( 'a' ) / / 创 建 a 标 签
link . download = fileName / / a 标 签 添 加 属 性
link . style . display = 'none'
link . href = map . downurl
document . body . appendChild ( link )
link . click ( ) / / 执 行 下 载
URL . revokeObjectURL ( link . href ) / / 释 放 u r l
document . body . removeChild ( link ) / / 释 放 标 签
} )
. catch ( ( ) => {
} )
} ,
dosearch ( ) {
this . queryParams . current = 1
this . loadList ( )
} ,
resetQuery ( ) {
this . queryParams = {
current : 1 ,
size : 10 ,
total : 0 ,
params : {
sids : [ ] , / / 用 于 导 出 的 时 候 保 存 已 选 择 S I D
billNo : '' , / / 单 据 编 号
customerName : '' , / / 客 户 名 称
salesDepName : '' , / / 销 售 部 门
finItemType : '' , / / 项 目 类 别
distributorName : '' , / / 中 介 单 位 名 称
sellChannel : '' , / / 销 售 渠 道
creatorName : '' , / / 制 单 人
outDateStart : '' ,
outDateEnd : ''
}
} ,
this . salesDepName_list = [ ] ,
this . dosearch ( )
} ,
loadList ( ) {
const _this = this
this . tableLoading = true
req . listPage ( this . queryParams ) . then ( resp => {
_this . tableLoading = false
const data = resp . data
_this . queryParams . total = data . total
_this . dataList = data . records
} ) . catch ( ( ) => {
_this . tableLoading = false
} ,
doExport ( row ) {
/ / 导 出 的 代 码
const sids = [ ]
this . multipleSelection . forEach ( row => {
sids . push ( row . sid )
} )
this . queryParams . params . sids = sids
req
. exportExcel ( this . queryParams . params )
. then ( resp => {
var map = resp . data
const fileName = map . filename / / 导 出 文 件 名
/ / / / 对 于 < a > 标 签 , 只 有 F i r e f o x 和 C h r o m e ( 内 核 ) 支 持 d o w n l o a d 属 性
/ / / / I E 1 0 以 上 支 持 b l o b 但 是 依 然 不 支 持 d o w n l o a d
const link = document . createElement ( 'a' ) / / 创 建 a 标 签
link . download = fileName / / a 标 签 添 加 属 性
link . style . display = 'none'
link . href = map . downurl
document . body . appendChild ( link )
link . click ( ) / / 执 行 下 载
URL . revokeObjectURL ( link . href ) / / 释 放 u r l
document . body . removeChild ( link ) / / 释 放 标 签
} )
} ,
handleSelectionChange ( val ) {
this . multipleSelection = val
} ,
/ / 序 号
indexMethod ( index ) {
var pagestart = ( this . queryParams . current - 1 ) * this . queryParams . size
var pageindex = index + 1 + pagestart
return pageindex
} ,
toInfo ( row ) {
this . $refs [ 'divinfo' ] . showInfo ( row )
this . viewState = 4
} ,
/ / 组 织
getZuZhi ( ) {
req . salesDepName ( ) . then ( ( res ) => {
if ( res . code === '200' ) {
this . options = res . data
this . zuzhi0 ( this . options )
}
. catch ( ( ) => {
} )
} ,
dosearch ( ) {
this . queryParams . current = 1
this . loadList ( )
} ,
resetQuery ( ) {
this . queryParams = {
current : 1 ,
size : 10 ,
total : 0 ,
params : {
sids : [ ] , / / 用 于 导 出 的 时 候 保 存 已 选 择 S I D
billNo : '' , / / 单 据 编 号
customerName : '' , / / 客 户 名 称
salesDepName : '' , / / 销 售 部 门
finItemType : '' , / / 项 目 类 别
distributorName : '' , / / 中 介 单 位 名 称
sellChannel : '' , / / 销 售 渠 道
creatorName : '' , / / 制 单 人
outDateStart : '' ,
outDateEnd : ''
}
} ,
zuzhi0 ( data ) {
data . forEach ( ( e ) => {
if ( e . children . length != 0 ) {
this . salesDepName_list = [ ] ,
this . dosearch ( )
} ,
loadList ( ) {
const _this = this
this . tableLoading = true
req . listPage ( this . queryParams ) . then ( resp => {
_this . tableLoading = false
const data = resp . data
_this . queryParams . total = data . total
_this . dataList = data . records
} ) . catch ( ( ) => {
_this . tableLoading = false
} )
} ,
handleSelectionChange ( val ) {
this . multipleSelection = val
} ,
/ / 序 号
indexMethod ( index ) {
var pagestart = ( this . queryParams . current - 1 ) * this . queryParams . size
var pageindex = index + 1 + pagestart
return pageindex
} ,
toInfo ( row ) {
this . $refs [ 'divinfo' ] . showInfo ( row )
this . viewState = 4
} ,
/ / 组 织
getZuZhi ( ) {
req . salesDepName ( ) . then ( ( res ) => {
if ( res . code === '200' ) {
this . options = res . data
this . zuzhi0 ( this . options )
}
} )
} ,
zuzhi0 ( data ) {
data . forEach ( ( e ) => {
if ( e . children ) {
if ( e . children . length !== 0 ) {
this . zuzhi0 ( e . children )
} else {
delete e . children
this . dataArr . push ( e )
return
}
} )
} ,
salesDepNameChange ( e ) {
console . log ( '选中结果:' + JSON . stringify ( e ) )
var result = ''
var result_Sid = ''
if ( e . length > 0 ) {
/ / 循 环 多 选 项
e . forEach ( ( item ) => {
var last_id = item [ item . length - 1 ]
/ / 循 环 查 找 名 字
this . select_temp_Name = '' / / 临 时 遍 历 , 用 来 保 存 选 中 结 果 ( 组 织 名 称 )
this . select_temp_Sid = '' / / 临 时 遍 历 , 用 来 保 存 选 中 结 果 ( 组 织 S i d )
this . findOrgId ( last_id , this . options )
result = result + this . select_temp_Name + ','
result_Sid = result_Sid + this . select_temp_Sid + ','
} )
}
if ( result !== '' ) {
result = result . substring ( 0 , result . length - 1 )
}
if ( result_Sid !== '' ) {
result_Sid = result_Sid . substring ( 0 , result_Sid . length - 1 )
}
this . queryParams . params . salesDepName = result
console . log ( '选中名称:' + this . queryParams . params . salesDepName )
} ,
findOrgId ( id , options ) {
for ( var i = 0 ; i < options . length ; i ++ ) {
if ( id == options [ i ] . sid ) {
this . select_temp_Name = options [ i ] . name / / 保 存 找 到 的 内 容
this . select_temp_Sid = options [ i ] . sid
return true
} else {
/ / 判 断 是 否 最 后 一 级
if ( options [ i ] . children !== undefined ) {
/ / 不 是 的 话 查 询 下 一 级
if ( this . findOrgId ( id , options [ i ] . children ) ) {
return true
}
} )
} ,
salesDepNameChange ( e ) {
console . log ( '选中结果:' + JSON . stringify ( e ) )
var result = ''
var result_Sid = ''
if ( e . length > 0 ) {
/ / 循 环 多 选 项
e . forEach ( ( item ) => {
var last_id = item [ item . length - 1 ]
/ / 循 环 查 找 名 字
this . select_temp_Name = '' / / 临 时 遍 历 , 用 来 保 存 选 中 结 果 ( 组 织 名 称 )
this . select_temp_Sid = '' / / 临 时 遍 历 , 用 来 保 存 选 中 结 果 ( 组 织 S i d )
this . findOrgId ( last_id , this . options )
result = result + this . select_temp_Name + ','
result_Sid = result_Sid + this . select_temp_Sid + ','
} )
}
if ( result !== '' ) {
result = result . substring ( 0 , result . length - 1 )
}
if ( result_Sid !== '' ) {
result_Sid = result_Sid . substring ( 0 , result_Sid . length - 1 )
}
this . queryParams . params . salesDepName = result
console . log ( '选中名称:' + this . queryParams . params . salesDepName )
} ,
findOrgId ( id , options ) {
for ( var i = 0 ; i < options . length ; i ++ ) {
if ( id === options [ i ] . sid ) {
this . select_temp_Name = options [ i ] . name / / 保 存 找 到 的 内 容
this . select_temp_Sid = options [ i ] . sid
return true
} else {
/ / 判 断 是 否 最 后 一 级
if ( options [ i ] . children !== undefined && options [ i ] . children !== null ) {
/ / 不 是 的 话 查 询 下 一 级
if ( this . findOrgId ( id , options [ i ] . children ) ) {
return true
}
}
}
}
}
}
}
< / script >
< style scoped >
. app - container - copy {
margin : 5 px - 9 px ;
}
. app - container - copy {
margin : 5 px - 9 px ;
}
. searchbtn {
border : # 2 cab69 1 px solid ;
color : # 2 cab69 ;
}
. searchbtn {
border : # 2 cab69 1 px solid ;
color : # 2 cab69 ;
}
. line {
display : inline - block ;
margin : 0 px 15 px ;
}
. line {
display : inline - block ;
margin : 0 px 15 px ;
}
. salesDepNameStyle >>> . el - input__inner {
height : 32 px ! important ;
}
. salesDepNameStyle >>> . el - input__inner {
height : 32 px ! important ;
}
. salesDepNameStyle >>> . el - form - item__content {
margin - top : - 5 px ;
}
. salesDepNameStyle >>> . el - form - item__content {
margin - top : - 5 px ;
}
. listtop {
margin : 0 px 9 px ;
display : flex ;
justify - content : space - between ;
align - items : center ;
border : 1 px solid # dfe4ed ;
height : 40 px ;
}
. listtop {
margin : 0 px 9 px ;
display : flex ;
justify - content : space - between ;
align - items : center ;
border : 1 px solid # dfe4ed ;
height : 40 px ;
}
. searchcon {
margin : 0 px 9 px ;
}
. searchcon {
margin : 0 px 9 px ;
}
. listcon {
margin : 0 px 9 px ;
}
. listcon {
margin : 0 px 9 px ;
}
. tit {
margin - bottom : - 10 px ;
}
. tit {
margin - bottom : - 10 px ;
}
. pagination {
margin - bottom : - 10 px ;
}
. pagination {
margin - bottom : - 10 px ;
}
< / style >