|
@ -1,5 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="filterForDetailPage"> |
|
|
<div class="filterForDetailPage" v-if="dialogShow"> |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
title="明细查询" |
|
|
title="明细查询" |
|
|
:visible.sync="dialogShow" |
|
|
:visible.sync="dialogShow" |
|
@ -131,191 +131,192 @@ import * as interfaceApi from "@/api/wms-interface" |
|
|
import {getListDesById,getPageListForDetail} from "@/api/wms-api" |
|
|
import {getListDesById,getPageListForDetail} from "@/api/wms-api" |
|
|
import * as allUrlOption from '@/utils/baseData/urlOption' |
|
|
import * as allUrlOption from '@/utils/baseData/urlOption' |
|
|
export default { |
|
|
export default { |
|
|
name: 'filterForDetailPage', |
|
|
name: 'filterForDetailPage', |
|
|
mixins: [ |
|
|
mixins: [ |
|
|
tableMixins, |
|
|
tableMixins, |
|
|
TableHeaderMixins, |
|
|
TableHeaderMixins, |
|
|
mixins, |
|
|
mixins, |
|
|
filterSelectMixins, |
|
|
filterSelectMixins, |
|
|
LoadingMixins |
|
|
LoadingMixins |
|
|
], |
|
|
], |
|
|
components:{ |
|
|
components:{ |
|
|
currenDescriptions |
|
|
currenDescriptions |
|
|
}, |
|
|
|
|
|
props: { |
|
|
|
|
|
// 已app-main高度为100% 需要减掉的高度 |
|
|
|
|
|
setUTableHeight: { |
|
|
|
|
|
type: Number, |
|
|
|
|
|
default: 340 |
|
|
|
|
|
}, |
|
|
|
|
|
// 是否显示序号 |
|
|
|
|
|
isShowIndex:{ |
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
default: false |
|
|
|
|
|
}, |
|
|
}, |
|
|
// 复选框 |
|
|
props: { |
|
|
tableSelection: { |
|
|
// 已app-main高度为100% 需要减掉的高度 |
|
|
type: Boolean, |
|
|
setUTableHeight: { |
|
|
default: false |
|
|
type: Number, |
|
|
}, |
|
|
default: 340 |
|
|
cellStyle: { |
|
|
}, |
|
|
type: Function, |
|
|
// 是否显示序号 |
|
|
default: () => { |
|
|
isShowIndex:{ |
|
|
return Function; |
|
|
type: Boolean, |
|
|
} |
|
|
default: false |
|
|
}, |
|
|
}, |
|
|
// 超出内容是否提示 |
|
|
// 复选框 |
|
|
showOverflowTooltip:{ |
|
|
tableSelection: { |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
|
default: false, |
|
|
default: false |
|
|
}, |
|
|
}, |
|
|
|
|
|
cellStyle: { |
|
|
// 删除api |
|
|
type: Function, |
|
|
DeleteApi: { |
|
|
default: () => { |
|
|
|
|
|
return Function; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 超出内容是否提示 |
|
|
|
|
|
showOverflowTooltip:{ |
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
default: false, |
|
|
|
|
|
}, |
|
|
|
|
|
// 删除api |
|
|
|
|
|
DeleteApi: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
|
|
|
// 主表数据-表头 |
|
|
|
|
|
parentColumns:{ |
|
|
|
|
|
type: Array, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
|
|
|
showHandleButtons:{ |
|
|
|
|
|
type:Array, |
|
|
|
|
|
default:() => { |
|
|
|
|
|
//'add','edit'暂未处理操作 'delete'暂时隐藏 |
|
|
|
|
|
// showParent查看主表信息,fresh刷新,filter筛选,field字段设置 |
|
|
|
|
|
return ['showParent','fresh','filter','field']; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 父级展现列数,默认为2列展现 |
|
|
|
|
|
column: { |
|
|
|
|
|
type: Number, |
|
|
|
|
|
default: 2 |
|
|
|
|
|
}, |
|
|
|
|
|
// 父级展示方式,默认水平分布 |
|
|
|
|
|
direction: { |
|
|
type: String, |
|
|
type: String, |
|
|
default: null |
|
|
default: 'horizontal' |
|
|
}, |
|
|
}, |
|
|
// 列表数据-表头 |
|
|
rowMaxHeight:{ |
|
|
// listColumns:{ |
|
|
type:String, |
|
|
// type: Array, |
|
|
default:'calc(90vh - 450px)' |
|
|
// default: null |
|
|
}, |
|
|
// }, |
|
|
|
|
|
// 主表数据-表头 |
|
|
|
|
|
parentColumns:{ |
|
|
|
|
|
type: Array, |
|
|
|
|
|
default: null |
|
|
|
|
|
}, |
|
|
}, |
|
|
showHandleButtons:{ |
|
|
data () { |
|
|
type:Array, |
|
|
return { |
|
|
default:() => { |
|
|
dialogShow:true, |
|
|
//'add','edit'暂未处理操作 'delete'暂时隐藏 |
|
|
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//明细-列表 |
|
|
// showParent查看主表信息,fresh刷新,filter筛选,field字段设置 |
|
|
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',//明细-查看主表的连接id |
|
|
return ['showParent','fresh','filter','field']; |
|
|
URLOption_masterName:allUrlOption[this.$route.name].masterName,//明细-列表//明细-查看主表的连接title名称 |
|
|
|
|
|
URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//明细-查看主表 |
|
|
|
|
|
currenButtonData: [],//头部按钮 |
|
|
|
|
|
operaButtons:[],//操作列按钮 |
|
|
|
|
|
showParentDialog:false,//显示父级数据弹窗 |
|
|
|
|
|
showParentTitle:null,//显示父级数据弹窗-title |
|
|
|
|
|
showParentTableData:null,//显示父级数据弹窗-数据 |
|
|
|
|
|
showParentLoading:false,//显示父级数据弹窗-加载 |
|
|
|
|
|
listColumns:[],//表头数据 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 父级展现列数,默认为2列展现 |
|
|
activated(){ |
|
|
column: { |
|
|
// 解决切换页面的时候,遮罩层消失的问题 |
|
|
type: Number, |
|
|
this.dialogShow = false |
|
|
default: 2 |
|
|
this.$nextTick(() => { |
|
|
}, |
|
|
this.dialogShow = true |
|
|
// 父级展示方式,默认水平分布 |
|
|
}); |
|
|
direction: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: 'horizontal' |
|
|
|
|
|
}, |
|
|
|
|
|
rowMaxHeight:{ |
|
|
|
|
|
type:String, |
|
|
|
|
|
default:'calc(90vh - 450px)' |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
mounted(){ |
|
|
data () { |
|
|
this.paging() |
|
|
return { |
|
|
this.initHandleButtons() |
|
|
dialogShow:true, |
|
|
|
|
|
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//明细-列表 |
|
|
|
|
|
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',//明细-查看主表的连接id |
|
|
|
|
|
URLOption_masterName:allUrlOption[this.$route.name].masterName,//明细-列表//明细-查看主表的连接title名称 |
|
|
|
|
|
URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//明细-查看主表 |
|
|
|
|
|
currenButtonData: [],//头部按钮 |
|
|
|
|
|
operaButtons:[],//操作列按钮 |
|
|
|
|
|
showParentDialog:false,//显示父级数据弹窗 |
|
|
|
|
|
showParentTitle:null,//显示父级数据弹窗-title |
|
|
|
|
|
showParentTableData:null,//显示父级数据弹窗-数据 |
|
|
|
|
|
showParentLoading:false,//显示父级数据弹窗-加载 |
|
|
|
|
|
listColumns:[],//表头数据 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
mounted(){ |
|
|
|
|
|
this.paging() |
|
|
|
|
|
this.initHandleButtons() |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
rowDropForDetail(data,type){ |
|
|
|
|
|
this.listColumns = data |
|
|
|
|
|
this.$emit("rowDropForDetail", data,type) |
|
|
|
|
|
}, |
|
|
}, |
|
|
// 初始化显示按钮 |
|
|
methods: { |
|
|
initHandleButtons(){ |
|
|
rowDropForDetail(data,type){ |
|
|
// 头部按钮 |
|
|
this.listColumns = data |
|
|
let _arr_header = [] |
|
|
this.$emit("rowDropForDetail", data,type) |
|
|
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())} |
|
|
}, |
|
|
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())} |
|
|
// 初始化显示按钮 |
|
|
if(this.showHandleButtons.indexOf('fresh') >= 0){_arr_header.push(this.defaultFreshBtn())} |
|
|
initHandleButtons(){ |
|
|
if(this.showHandleButtons.indexOf('filter') >= 0){_arr_header.push(this.defaultFilterBtn())} |
|
|
// 头部按钮 |
|
|
this.currenButtonData = _arr_header |
|
|
let _arr_header = [] |
|
|
|
|
|
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())} |
|
|
|
|
|
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())} |
|
|
|
|
|
if(this.showHandleButtons.indexOf('fresh') >= 0){_arr_header.push(this.defaultFreshBtn())} |
|
|
|
|
|
if(this.showHandleButtons.indexOf('filter') >= 0){_arr_header.push(this.defaultFilterBtn())} |
|
|
|
|
|
this.currenButtonData = _arr_header |
|
|
|
|
|
|
|
|
// 操作列按钮 |
|
|
// 操作列按钮 |
|
|
let _arr_op = [] |
|
|
let _arr_op = [] |
|
|
if(this.showHandleButtons.indexOf('edit') >= 0){_arr_op.push('edit')} |
|
|
if(this.showHandleButtons.indexOf('edit') >= 0){_arr_op.push('edit')} |
|
|
if(this.showHandleButtons.indexOf('delete') >= 0){_arr_op.push('delete')} |
|
|
if(this.showHandleButtons.indexOf('delete') >= 0){_arr_op.push('delete')} |
|
|
if(this.showHandleButtons.indexOf('showParent') >= 0){_arr_op.push('showParent')} |
|
|
if(this.showHandleButtons.indexOf('showParent') >= 0){_arr_op.push('showParent')} |
|
|
this.operaButtons = _arr_op |
|
|
this.operaButtons = _arr_op |
|
|
}, |
|
|
}, |
|
|
// 关闭明细查询弹窗 |
|
|
// 关闭明细查询弹窗 |
|
|
closeDialog(data){ |
|
|
closeDialog(data){ |
|
|
this.dialogShow = false |
|
|
this.dialogShow = false |
|
|
this.$emit("closeDialog", data) |
|
|
this.$emit("closeDialog", data) |
|
|
}, |
|
|
}, |
|
|
// 获取列表 |
|
|
// 获取列表 |
|
|
paging(callback){ |
|
|
paging(callback){ |
|
|
this.Loading.tableLoading = true; |
|
|
this.Loading.tableLoading = true; |
|
|
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount |
|
|
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount |
|
|
getPageListForDetail(this.PageListParams,this.URLOption_detailList) |
|
|
getPageListForDetail(this.PageListParams,this.URLOption_detailList) |
|
|
.then(res=>{ |
|
|
.then(res=>{ |
|
|
// 表头处理 |
|
|
// 表头处理 |
|
|
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) |
|
|
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/')) |
|
|
let _Columns = this.initApiColumnsForDto(res.items[0],_parentName) |
|
|
let _Columns = this.initApiColumnsForDto(res.items[0],_parentName) |
|
|
this.listColumns = this.initTableColumns(_Columns,'detailPage_api') |
|
|
this.listColumns = this.initTableColumns(_Columns,'detailPage_api') |
|
|
// 页面数据处理 |
|
|
// 页面数据处理 |
|
|
if(res){ |
|
|
if(res){ |
|
|
|
|
|
this.Loading.tableLoading = false |
|
|
|
|
|
this.tableData = [] |
|
|
|
|
|
res.items.forEach(item=>{ |
|
|
|
|
|
item.deleteTipVisible = false |
|
|
|
|
|
this.tableData.push(item) |
|
|
|
|
|
}) |
|
|
|
|
|
this.totalCount = res.totalCount |
|
|
|
|
|
} |
|
|
|
|
|
this.pagingCallback(callback) |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err=>{ |
|
|
this.Loading.tableLoading = false |
|
|
this.Loading.tableLoading = false |
|
|
this.tableData = [] |
|
|
this.$message.error("数据获取失败") |
|
|
res.items.forEach(item=>{ |
|
|
}) |
|
|
item.deleteTipVisible = false |
|
|
}, |
|
|
this.tableData.push(item) |
|
|
// 查看主表信息 |
|
|
}) |
|
|
showParentHandleForDetail(data){ |
|
|
this.totalCount = res.totalCount |
|
|
this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息` |
|
|
} |
|
|
this.showParentDialog = true |
|
|
this.pagingCallback(callback) |
|
|
this.showParentLoading = true |
|
|
}) |
|
|
getListDesById(this.URLOption_parent,data[this.URLOption_masterId]) |
|
|
.catch(err=>{ |
|
|
.then(res => { |
|
|
this.Loading.tableLoading = false |
|
|
this.showParentTableData = res |
|
|
this.$message.error("数据获取失败") |
|
|
this.showParentLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
.catch(err => { |
|
|
// 查看主表信息 |
|
|
this.showParentLoading = false |
|
|
showParentHandleForDetail(data){ |
|
|
this.$message.error("主表信息获取失败!") |
|
|
this.showParentTitle = `${data[this.URLOption_masterName] || ''} 主表信息` |
|
|
}) |
|
|
this.showParentDialog = true |
|
|
}, |
|
|
this.showParentLoading = true |
|
|
// 编辑 |
|
|
getListDesById(this.URLOption_parent,data[this.URLOption_masterId]) |
|
|
editHandleForDetail(data){ |
|
|
.then(res => { |
|
|
console.log(data) |
|
|
this.showParentTableData = res |
|
|
}, |
|
|
this.showParentLoading = false |
|
|
// 删除 |
|
|
|
|
|
deleteHandleForDetail(data){ |
|
|
|
|
|
this.Loading.appMainLoading = true |
|
|
|
|
|
data.deleteTipVisible = false |
|
|
|
|
|
interfaceApi[this.DeleteApi](data.id).then(res => { |
|
|
|
|
|
this.$successMsg('删除成功!') |
|
|
|
|
|
this.oldSkipCount = 1 |
|
|
|
|
|
this.Loading.appMainLoading = false |
|
|
|
|
|
this.paging() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.Loading.appMainLoading = false |
|
|
|
|
|
this.$message.error("删除失败!") |
|
|
}) |
|
|
}) |
|
|
.catch(err => { |
|
|
}, |
|
|
this.showParentLoading = false |
|
|
} |
|
|
this.$message.error("主表信息获取失败!") |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 编辑 |
|
|
|
|
|
editHandleForDetail(data){ |
|
|
|
|
|
console.log(data) |
|
|
|
|
|
}, |
|
|
|
|
|
// 删除 |
|
|
|
|
|
deleteHandleForDetail(data){ |
|
|
|
|
|
this.Loading.appMainLoading = true |
|
|
|
|
|
data.deleteTipVisible = false |
|
|
|
|
|
interfaceApi[this.DeleteApi](data.id).then(res => { |
|
|
|
|
|
this.$successMsg('删除成功!') |
|
|
|
|
|
this.oldSkipCount = 1 |
|
|
|
|
|
this.Loading.appMainLoading = false |
|
|
|
|
|
this.paging() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.Loading.appMainLoading = false |
|
|
|
|
|
this.$message.error("删除失败!") |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|