Browse Source

明细按照后端分页及查询功能暂存

noToken
安虹睿 1 year ago
parent
commit
ead30cda3d
  1. 720
      PC/InterFace.Dash/src/components/commonTabel-drawer copy/index.vue
  2. 137
      PC/InterFace.Dash/src/components/commonTabel-drawer copy/style/index.scss
  3. 398
      PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue
  4. 15
      PC/InterFace.Dash/src/components/commonTabel-drawer/style/index.scss
  5. 2
      PC/InterFace.Dash/src/components/filterForDetailPage/index.vue
  6. 102
      PC/InterFace.Dash/src/mixins/TableMixins.js
  7. 4
      PC/InterFace.Dash/src/utils/detailsPageColumns_api/index.js
  8. 7
      PC/InterFace.Dash/src/utils/detailsTableColumns_api/index.js
  9. 1
      PC/InterFace.Dash/src/views/interfaceBoard/AsnMstr.vue

720
PC/InterFace.Dash/src/components/commonTabel-drawer copy/index.vue

@ -0,0 +1,720 @@
<template>
<el-drawer
v-loading="DrawerLoading"
v-if="drawer"
:visible="true"
:close-on-press-escape="false"
:wrapperClosable="false"
:with-header="false"
:modal="false"
size="100%"
>
<div class="drawer-heder">
<div class="heder-left">
<!-- <div class="heder-img">
<img
src="@/assets/img/drawerHeader.png"
alt=""
style="width: 100%; height: 100%"
/>
</div> -->
<div class="header-text">
<span>{{ propsData[title[0].prop] }}</span>
<span>{{ title[0].label }}</span>
</div>
</div>
<div class="heder-right">
<curren-Button
:Butttondata="Butttondata"
@tableButtonClick="tableButtonClick"
>
<template>
<el-dropdown
trigger="click"
@command="handleCommand"
v-if="JSON.stringify(dropdownData) != '{}'"
>
<el-button size="mini" icon="el-icon-more"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(item, index) in dropdownData"
:key="index"
:command="item.command"
>{{ item.label }}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template>
</curren-Button>
</div>
</div>
<div class="drawer-main">
<curren-tabs
:tabsData="dropdownTabs"
:activeName="firstTabs"
type="border-card"
@handleClick="handleClick"
>
<template slot-scope="scope">
<curren-descriptions
border
v-if="scope.value == 'xq'"
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="tabsDesTions"
:propsData="propsData"
>
</curren-descriptions>
<!-- 明细头部按钮 -->
<div
class="currenTabel-drawer-mx-header"
v-if="scope.value == 'mx' && detailHeaderButton"
>
<curren-Button
:Butttondata="detailHeaderButton"
@tableButtonClick="detailHeaderClick"
></curren-Button>
</div>
<!-- 字段设置弹窗 -->
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="'detail_api'"
:innerMaxHeight="'calc(90vh - 400px)'"
></rowDrop>
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
class="detailFiltersPopPage"
:showSearchOverall="detailFiltersVisible"
@getShowSearchOverall="getShowSearchOverall"
:showMoreSearch="true"
:tableColumns="tableColumns"
@overallSearchFormClick="detailFiltersSearch"
:filterActionOptions="filterActionOptions"
:httpOverallSearchData="detailSearchDataFE"
:disabledAction="true"
:disabledLogic="true"
>
<!-- 插槽预留 -->
<slot name="searchPrimarySlot"></slot>
</searchOverall>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
v-if="scope.value == 'mx'"
:isUpdate="isUpdate"
:tableBorder="true"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="showDetailColumnsSet ? 300 : 260"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:buttonOperationList="buttonOperationList"
@buttonOperationClick="buttonOperationClick"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 明细页码 -->
<pagination
v-if="scope.value == 'mx'"
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
@SizeChange="alterResultCountDetails"
@CurrentChange="alertoldSkipCountDetails"
:currentPageProps="currentPage"
></pagination>
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns -->
<umyTable
v-if="scope.value == 'hz'"
:tableBorder="true"
:tableData="propsData.summaryDetails"
:tableColumns="summaryTableColumns.length == 0 ? tableColumns : summaryTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展 -->
<umyTable
v-if="
scope.value == zdyValue &&
scope.value != 'xq' &&
scope.value != 'mx' &&
scope.value != 'hz' &&
scope.value != 'zwlcj'
"
:tableBorder="true"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展tree的形式 目前使用位置物品清单信息-子物品层级 todo:待优化-->
<currenTable
v-if="
scope.value == zdyValue &&
scope.value == 'zwlcj'
"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:treeProps="{children: 'children', hasChildren: 'hasChildren'}"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</currenTable>
</template>
</curren-tabs>
</div>
<div class="drawer-Shut" @click="drawerShut">
<el-button type="danger" size="mini">关闭</el-button>
</div>
<!-- 明细-查看详情 -->
<el-dialog
width="90%"
:modal-append-to-body="false"
:append-to-body="false"
:title="detailInfoTitle"
:visible.sync="displayDialog.detailInfoDialog"
:show-close="true"
>
<div>
<curren-descriptions
v-if="detailInfoTableData"
border
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="tableColumns"
:propsData="detailInfoTableData"
style="padding-bottom: 20px;"
></curren-descriptions>
</div>
</el-dialog>
</el-drawer>
</template>
<script>
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
} from "@/api/wms-api"
import searchOverall from "@/components/searchOverall"
import currenButton from "@/components/currenButton"
import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins";
export default {
name: 'currenTabel-drawer',
components: {
pagination,
currenButton,
currenDescriptions,
currenTabs,
currenTable,
searchOverall,
rowDrop
},
mixins: [
LoadingMixins,
],
props: {
//
buttonOperationList:{
type: Array,
default: null,
},
// -
showDetailColumnsSet:{
type: Boolean,
default: true
},
// -
showDetailFilters:{
type: Boolean,
default: true
},
// --
detailSearchDataFE:{
type: Object,
default: null
},
title: {
type: Array,
default: () => {
return []
}
},
DrawerLoading: {
type: Boolean,
default: true
},
drawer: {
type: Boolean,
default: false
},
dropdownData: {
type: Object,
default: () => {
return {}
}
},
propsData: {
type: Object,
default: () => {
return {}
}
},
tabsDesTions: {
type: Array,
default: () => {
return []
}
},
dropdownTabsData: {
type: Array,
default: () => {
return []
}
},
tableLoading: {
type: Boolean,
default: false
},
tableColumns: {
type: Array,
default: () => {
return []
}
},
summaryTableColumns: {
type: Array,
default: () => {
return []
}
},
Butttondata: {
type: Array,
default: () => {
return [{
type: 'warning',
icon: 'el-icon-edit',
label: '编辑',
name: 'edit',
size: 'mini'
}]
}
},
selectionTable: {
type: Boolean,
default: false
},
MaxResultCount: {
type: Number,
default: 0
},
totalCount: {
type: Number,
default: 0
},
currentPage: {
type: Number,
default: 0
},
// 2
column: {
type: Number,
default: 2
},
//
direction: {
type: String,
default: 'horizontal'
},
// tabs
firstTabs: {
type: String,
default: 'xq'
}
},
computed: {
dropdownTabs () {
// tabs
if (this.dropdownTabsData.length !== 0) {
return this.dropdownTabsData
} else {
//
// if (Object.keys(this.propsData).length != 0) {
if (Object.keys(this.propsData)) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
}]
// 使
if(this.propsData.details){
this.initDropdownTabsData.push({
label: "明细",
name: 'mx'
})
}
if(this.propsData.summaryDetails && this.propsData.summaryDetails.length > 0){
this.initDropdownTabsData.push({
label: "汇总",
name: 'hz'
})
}
}
return this.initDropdownTabsData
}
},
},
mounted () {
this.initDetailHeaderButton()
//
document.addEventListener('click',(e)=>{
if(!this.rowDropVisible)return
let _class = "rowDropNotHideItem"
let _hasParent = getParentNode(e.target,_class)
let _current_class = e.target._prevClass || e.target.className
let _hasCurrent = _current_class ? String(_current_class).includes(_class) : false
if(!_hasParent && !_hasCurrent){
this.closeRowDrop()
}
})
},
data () {
return {
detailHeaderButton:null,//-
detailInfoTableData:null,//-
detailInfoTitle:null,//-title
// table key
isUpdate: false,
// -
rowDropVisible: false,
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
// firstTabs:'xq',
initDropdownTabsData:[
{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
},
{
label: "汇总",
name: 'hz'
}
],
detailFiltersVisible:false,//
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
}
},
methods: {
// -
initDetailHeaderButton(){
this.detailHeaderButton = []
if(this.showDetailColumnsSet){this.detailHeaderButton.push(this.defaultFieldSettingBtn())}
if(this.showDetailFilters){this.detailHeaderButton.push(this.defaultFilterBtn())}
},
detailHeaderClick(val,item){
//
if(val == 'field'){
this.columnsSettingHandle()
}
//
if(val == 'filter'){
this.detailFiltersHandle()
}
},
// -
closeDetailInfo(val){
this.displayDialog.detailInfoDialog = val || false
},
// -
buttonOperationClick(row, item, index){
//
if(item.name == "info"){
this.displayDialog.detailInfoDialog = true
this.detailInfoTableData = row
let _name = allUrlOption[this.$route.name].detailInfoName
this.detailInfoTitle = _name ? row[_name] + ' 详情' : '详情'
}
this.$emit('buttonOperationClick',row, item, index)
},
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.isUpdate = !this.isUpdate
},
// -
columnsSettingHandle(){
this.rowDropVisible = !this.rowDropVisible
},
// -
detailFiltersHandle(){
this.detailFiltersVisible = !this.detailFiltersVisible
},
// -/showSearchOverall
getShowSearchOverall(val){
this.detailFiltersVisible = val || false
},
// -
detailFiltersSearch(options){
this.$emit('detailFiltersSearch', options)
},
// -
closeRowDrop() {
this.rowDropVisible = false
},
handleCommand (command) {
this.$emit('handleCommand', command)
},
drawerShut () {
this.closeDetailInfo(false)
this.$emit('drawerShut', false)
},
tableButtonClick (val) {
this.$emit('drawerbutton', val)
},
//
sortChange (data) {
this.$emit('sortChange', data)
},
//selection
handleSelectionChange (val) {
this.$emit("handleSelectionChange", val)
},
//nameemit
inlineDialog (row) {
this.$emit("inlineDialog", row)
},
//emit
alterResultCountDetails (val) {
this.$emit('alterResultCountDetails', val)
},
//emit
alertoldSkipCountDetails (val) {
this.$emit('alertoldSkipCountDetails', val)
},
buttonClick(row) {
this.$emit("buttonClick", row);
},
// tabs
handleClick (val) {
this.$emit("currenTabsChange", val);//tab
this.zdyValue = val.name
this.dropdownTabsData.forEach( item => {
if (item.name == val.name) {
let parent = this.$parent
parent.tableLoading = true
//
parent.firstTabs = val.name
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') {
this.zdyTableColumns = []
this.otherData = []
parent.tableLoading = false
} else {
this.zdyTableColumns = []
this.otherData = []
// this.firstTabs = val.name
// tab
if (item.functionName == 'getListByItemcode') {
let params = {
itemCode: this.propsData.code
}
getListByItemcode(params, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byItem') {
byItem(this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byProduct') {
byProduct({product:this.propsData.product}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byComponent') {
byComponent({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ----
else if (item.functionName == 'byComponentCJ') {
this.otherData = []
byComponentCJ({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.recursion(this.otherData)
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'bySupplierCode') {
bySupplierCode({supplierCode:this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocation') {
byLocation(this.propsData.code==null?this.propsData.locationCode:this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.o
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocationCode') {
byLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let itemData = []
itemData.push(res)
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = itemData
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ---
else if (item.functionName == 'relationByLocationCode') {
relationByLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// -, ,
else if(item.functionName == "purRecNoteCustomInfo"){
parent.Loading.DrawerLoading = true
purRecNoteCustomInfo( item.url,this.propsData.id).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.Loading.DrawerLoading = false
}).catch(err => {
console.log(err)
parent.Loading.DrawerLoading = false
})
}
// 退-TAB-
else if(item.functionName == "customerDismantleBackFlushNote"){
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = this.propsData.noteAndBackFlushDetails
}
}
}
})
},
//
recursion(val){
val.forEach(item => {
if(item.componentDTOs) {
item.children = item.componentDTOs
this.recursion(item.componentDTOs)
}
})
}
}
}
</script>
<style lang="scss" scoped>
// el-drawer
@import "./style/index.scss";
</style>

137
PC/InterFace.Dash/src/components/commonTabel-drawer copy/style/index.scss

@ -0,0 +1,137 @@
.el-drawer__wrapper {
z-index: 10 !important;
position: absolute;
left: 32%;
overflow: visible;
// height:calc(100% - 28px);
// top: 14px;
// right:14px
::v-deep .el-drawer {
height: 100%;
overflow: visible;
box-shadow: 0 8px 10px -5px rgb(0 0 0 / 15%), 0 16px 24px 2px rgb(0 0 0 / 9%), 0 6px 30px 5px rgb(0 0 0 / 7%);
.el-drawer__body {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.drawer-heder {
display: flex;
padding: 15px 10px;
justify-content: space-between;
align-items: center;
.heder-left {
display: flex;
justify-content: space-between;
.heder-img {
width: 40px;
height: 40px;
margin-right: 10px;
}
.header-text {
padding:0 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
span:nth-child(1) {
color: #333;
font-size: 22px;
}
span:nth-child(2) {
color: #999;
font-size: 16px;
}
}
}
}
.Descriptions {
padding: 0 10px;
}
.drawer-main {
// padding-top: 20px;
flex: 1;
overflow: hidden;
// background-color: #efefef;
padding: 10px 20px 20px 30px;
border-top: solid 5px #f6f6f6;
.el-tabs {
height: 100%;
display: flex;
flex-direction: column;
.el-tabs__header{
// padding-bottom: 5px ;
.el-tabs__nav{
z-index: auto !important;
}
}
.el-tabs__content {
flex: 1;
.el-tab-pane {
width: 100%;
height: 100%;
overflow-y: auto;
}
.el-descriptions-item__label {
padding-right: 40px;
}
}
}
}
.drawer-Shut {
width: 35px;
height: 100px;
position: absolute;
top: 200px;
left: -35px;
.el-button {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
::v-deep span {
font-size: 12px;
letter-spacing: 10px;
writing-mode: tb-rl;
}
}
}
}
}
}
::v-deep .el-tabs__nav-wrap::after{
content: unset !important;
}
.currenTabel-drawer-mx-header{
text-align: right;
padding: 0 10px 10px 0;
}
.detailFiltersPopPage{
position: absolute;
right: 0;
left: 0;
height: 240px;
.fullPageCover{
height: calc(100vh - 300px) !important;
}
}

398
PC/InterFace.Dash/src/components/commonTabel-drawer/index.vue

@ -11,13 +11,6 @@
>
<div class="drawer-heder">
<div class="heder-left">
<!-- <div class="heder-img">
<img
src="@/assets/img/drawerHeader.png"
alt=""
style="width: 100%; height: 100%"
/>
</div> -->
<div class="header-text">
<span>{{ propsData[title[0].prop] }}</span>
<span>{{ title[0].label }}</span>
@ -66,73 +59,28 @@
:propsData="propsData"
>
</curren-descriptions>
<!-- 明细头部按钮 -->
<div
class="currenTabel-drawer-mx-header"
v-if="scope.value == 'mx' && detailHeaderButton"
>
<curren-Button
:Butttondata="detailHeaderButton"
@tableButtonClick="detailHeaderClick"
></curren-Button>
</div>
<!-- 字段设置弹窗 -->
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="'detail_api'"
:innerMaxHeight="'calc(90vh - 400px)'"
></rowDrop>
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
class="detailFiltersPopPage"
:showSearchOverall="detailFiltersVisible"
@getShowSearchOverall="getShowSearchOverall"
:showMoreSearch="true"
:tableColumns="tableColumns"
@overallSearchFormClick="detailFiltersSearch"
:filterActionOptions="filterActionOptions"
:httpOverallSearchData="detailSearchDataFE"
:disabledAction="true"
:disabledLogic="true"
>
<!-- 插槽预留 -->
<slot name="searchPrimarySlot"></slot>
</searchOverall>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
<!-- 明细 包含分页 头部按钮等 -->
<tablePagination
v-if="scope.value == 'mx'"
:isUpdate="isUpdate"
:tableBorder="true"
:currenButtonData="detailHeaderButton"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="showDetailColumnsSet ? 300 : 260"
@sortChange="sortChange"
:setUTableHeight="showDetailColumnsSet && showDetailFilters ? 300 : 260"
@rowDrop="rowDrop"
:rowSource="'detail_api'"
:totalCount="totalCount"
:MaxResultCount="MaxResultCount"
@sortChange="sortChangeForDetail"
@alertoldSkipCount="alertoldSkipCountForDetail"
@alterResultCount="alterResultCountForDetail"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:buttonOperationList="buttonOperationList"
:currentPageProps="oldSkipCount"
@overallSearchFormClick="overallSearchClickForDetail"
:httpOverallSearchData="httpOverallSearchData"
@buttonOperationClick="buttonOperationClick"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 明细页码 -->
<pagination
v-if="scope.value == 'mx'"
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
@SizeChange="alterResultCountDetails"
@CurrentChange="alertoldSkipCountDetails"
:currentPageProps="currentPage"
></pagination>
:buttonOperationList="buttonOperationList"
:tableLoading="Loading.tableLoading"
></tablePagination>
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns -->
<umyTable
v-if="scope.value == 'hz'"
@ -229,7 +177,7 @@
</template>
<script>
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,getPageListForDetail
} from "@/api/wms-api"
import searchOverall from "@/components/searchOverall"
import currenButton from "@/components/currenButton"
@ -238,7 +186,6 @@ import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
import * as allUrlOption from '@/utils/baseData/urlOption'
import { LoadingMixins } from "@/mixins/LoadingMixins";
export default {
@ -271,11 +218,6 @@ export default {
type: Boolean,
default: true
},
// --
detailSearchDataFE:{
type: Object,
default: null
},
title: {
type: Array,
default: () => {
@ -408,27 +350,12 @@ export default {
},
mounted () {
this.initDetailHeaderButton()
//
document.addEventListener('click',(e)=>{
if(!this.rowDropVisible)return
let _class = "rowDropNotHideItem"
let _hasParent = getParentNode(e.target,_class)
let _current_class = e.target._prevClass || e.target.className
let _hasCurrent = _current_class ? String(_current_class).includes(_class) : false
if(!_hasParent && !_hasCurrent){
this.closeRowDrop()
}
})
},
data () {
return {
detailHeaderButton:null,//-
detailInfoTableData:null,//-
detailInfoTitle:null,//-title
// table key
isUpdate: false,
// -
rowDropVisible: false,
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
@ -447,33 +374,154 @@ export default {
name: 'hz'
}
],
detailFiltersVisible:false,//
filterActionOptions:[{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}],
//-
oldSkipCount: 1,
// -
httpOverallSearchData:null,
//-
PageListParams: {
condition: {
filters: []
},
Sorting: "",
SkipCount: 0,
MaxResultCount: 20,
},
//-id
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',
//-
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,
}
},
methods: {
// -
getDetailList(data,successFn,errorFn){
//
let _hasId = false
this.PageListParams.condition.filters.forEach(item=>{
if(item.column == this.URLOption_masterId){
_hasId = true
}
})
if(!_hasId){
this.PageListParams.condition.filters.push({
logic: "And",
column: this.URLOption_masterId,
action: "==",
value: data ? data.id : this.propsData.id
})
}
this.Loading.tableLoading = true
getPageListForDetail(this.PageListParams,this.URLOption_detailList)
.then(result => {
this.propsData.details = result.items
this.totalCount = result.totalCount
this.Loading.tableLoading = false
if(successFn)successFn()
})
.catch(err => {
this.Loading.tableLoading = false
if(errorFn)errorFn()
this.$message.error("数据获取失败")
})
},
// -
overallSearchForDetailHandle(options){
let _data_primary = options.data_primary,
_data_moreList = options.data_moreList,
_option_primary = options.option_primary,
_vm_quickly = options.vm_quickly,
_vm_moreList = options.vm_moreList
//
let _primary_filters = []
_option_primary.forEach(item=>{
if(_data_primary[item.prop] && String(_data_primary[item.prop]).length > 0){
let _item = {
action:item.action || '==',
column:item.prop,
logic:'And',
value:String(_data_primary[item.prop])
}
_primary_filters.push(_item)
}
})
//
let _moreList_filters = []
_data_moreList.filters.forEach(item=>{
if(String(item.column).length > 0 && String(item.value).length > 0){
_moreList_filters.push(item)
}
})
//
let _all_filters = []
_all_filters = _primary_filters.concat(_moreList_filters)
//
this.oldSkipCount = 1
this.Loading.tableLoading = true;
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount;
this.PageListParams.condition = {filters:_all_filters}
this.getDetailList(null,()=>{
//
if(_vm_quickly){_vm_quickly.searchNormalClear(true)}
//
if(_vm_moreList){_vm_moreList.changeMoreListShow(false)}
//
this.httpOverallSearchData = {}
this.httpOverallSearchData.params = JSON.parse(JSON.stringify(_data_primary))
this.httpOverallSearchData.moreList = JSON.parse(JSON.stringify(_data_moreList))
},()=>{
//
if(_vm_quickly){_vm_quickly.searchNormalClear(true)}
//
if(_vm_moreList){_vm_moreList.changeMoreListShow(false)}
})
},
// -
overallSearchClickForDetail(options){
let _item = options.item;
// + + +
if(
_item.name == 'search' || _item.name == 'moreList-search' ||
_item.name == 'reset' || _item.name == 'moreList-reset'
){
this.overallSearchForDetailHandle(options)
}
},
// -emit
alertoldSkipCountForDetail(val) {
this.oldSkipCount = val;
this.getDetailList();
},
// -emit
alterResultCountForDetail(val) {
this.PageListParams.MaxResultCount = val;
this.getDetailList();
},
// -
sortChangeForDetail(val) {
const {
prop,
order
} = val;
if (!prop || !order) {
this.PageListParams.Sorting = "";
this.oldSkipCount = 1;
this.getDetailList();
return;
}
let orderdata = order.substr(0, order.indexOf("c") + 1);
const props = prop.charAt(0).toUpperCase() + prop.slice(1)
this.PageListParams.Sorting = props + " " + orderdata.toUpperCase();
this.oldSkipCount = 1;
this.getDetailList();
},
// -
initDetailHeaderButton(){
this.detailHeaderButton = []
if(this.showDetailColumnsSet){this.detailHeaderButton.push(this.defaultFieldSettingBtn())}
if(this.showDetailFilters){this.detailHeaderButton.push(this.defaultFilterBtn())}
},
detailHeaderClick(val,item){
//
if(val == 'field'){
this.columnsSettingHandle()
}
//
if(val == 'filter'){
this.detailFiltersHandle()
}
},
// -
closeDetailInfo(val){
this.displayDialog.detailInfoDialog = val || false
@ -491,27 +539,6 @@ export default {
},
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.isUpdate = !this.isUpdate
},
// -
columnsSettingHandle(){
this.rowDropVisible = !this.rowDropVisible
},
// -
detailFiltersHandle(){
this.detailFiltersVisible = !this.detailFiltersVisible
},
// -/showSearchOverall
getShowSearchOverall(val){
this.detailFiltersVisible = val || false
},
// -
detailFiltersSearch(options){
this.$emit('detailFiltersSearch', options)
},
// -
closeRowDrop() {
this.rowDropVisible = false
},
handleCommand (command) {
this.$emit('handleCommand', command)
@ -579,117 +606,6 @@ export default {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byItem') {
byItem(this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byProduct') {
byProduct({product:this.propsData.product}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byComponent') {
byComponent({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ----
else if (item.functionName == 'byComponentCJ') {
this.otherData = []
byComponentCJ({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.recursion(this.otherData)
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'bySupplierCode') {
bySupplierCode({supplierCode:this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocation') {
byLocation(this.propsData.code==null?this.propsData.locationCode:this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.o
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocationCode') {
byLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let itemData = []
itemData.push(res)
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = itemData
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ---
else if (item.functionName == 'relationByLocationCode') {
relationByLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// -, ,
else if(item.functionName == "purRecNoteCustomInfo"){
parent.Loading.DrawerLoading = true
purRecNoteCustomInfo( item.url,this.propsData.id).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.Loading.DrawerLoading = false
}).catch(err => {
console.log(err)
parent.Loading.DrawerLoading = false
})
}
// 退-TAB-
else if(item.functionName == "customerDismantleBackFlushNote"){

15
PC/InterFace.Dash/src/components/commonTabel-drawer/style/index.scss

@ -120,18 +120,3 @@
::v-deep .el-tabs__nav-wrap::after{
content: unset !important;
}
.currenTabel-drawer-mx-header{
text-align: right;
padding: 0 10px 10px 0;
}
.detailFiltersPopPage{
position: absolute;
right: 0;
left: 0;
height: 240px;
.fullPageCover{
height: calc(100vh - 300px) !important;
}
}

2
PC/InterFace.Dash/src/components/filterForDetailPage/index.vue

@ -227,9 +227,9 @@ methods: {
//
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())}
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())}
this.currenButtonData = _arr_header
//

102
PC/InterFace.Dash/src/mixins/TableMixins.js

@ -113,26 +113,32 @@ export const tableMixins = {
this.displayDialog.detailsDialog = true;
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url).then(res => {
if (res.details) {
// 打印使用的全部数据存储
this.tableDataDetails = JSON.parse(JSON.stringify(res))
// 前端分页处理
this.propsData = this.detailListPageFromFE(res)
} else {
this.propsData = res
}
if (res.details) {
if(this.$refs.currenDrawer_Ref){
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{
this.inlineDialogCallback()
},()=>{
this.Loading.DrawerLoading = false
})
}
// 前端分页处理
// this.propsData = this.detailListPageFromFE(res)
}
}).catch(err => {
this.Loading.DrawerLoading = false
})
},
// 前端分页处理
detailListPageFromFE(data){
let linshiTableDataDetails = JSON.parse(JSON.stringify(data))
this.totalCountDetails = data.details.length
// 删除除当前页面最大数以外数据
linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails);
return linshiTableDataDetails
},
// detailListPageFromFE(data){
// let linshiTableDataDetails = JSON.parse(JSON.stringify(data))
// this.totalCountDetails = data.details.length
// // 删除除当前页面最大数以外数据
// linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails);
// return linshiTableDataDetails
// },
// 明细 分页 接收分页组件emit改变每页最大页数
alterResultCountDetails(val) {
this.Loading.DrawerLoading = true
@ -284,42 +290,42 @@ export const tableMixins = {
// this.getSupplierByCodesHandle_table()
},
// 筛选前端查询
detailFiltersSearch(options){
let _item = options.item;
// 重置
if(_item.name == 'reset' || _item.name == 'moreList-reset'){
this.propsData = this.detailListPageFromFE(this.tableDataDetails)
//关闭高级筛选
if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// 同步当前列表数据请求接口的筛选条件
this.detailSearchDataFE = {}
this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify([]))}
}
// 查询
if( _item.name == 'search' || _item.name == 'moreList-search'){
let _searchObj = {}
let searchData = options.data_moreList.filters;
console.log(299,searchData)
searchData.forEach(item=>{
_searchObj[item.column] = item.value
})
const productFilter = (data, params) => data.filter(function(item){
return Object.keys(params).every(function(key){
return item[key]!=undefined && item[key]==params[key] //可以相应修改条件
})
})
let _allData = JSON.parse(JSON.stringify(this.tableDataDetails))
let _filterList = productFilter(_allData.details,_searchObj)
_allData.details = _filterList
this.propsData = this.detailListPageFromFE(_allData)
//关闭高级筛选
if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// 同步当前列表数据请求接口的筛选条件
this.detailSearchDataFE = {}
this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify(searchData))}
}
// return res
},
// detailFiltersSearch(options){
// let _item = options.item;
// // 重置
// if(_item.name == 'reset' || _item.name == 'moreList-reset'){
// this.propsData = this.detailListPageFromFE(this.tableDataDetails)
// //关闭高级筛选
// if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// // 同步当前列表数据请求接口的筛选条件
// this.detailSearchDataFE = {}
// this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify([]))}
// }
// // 查询
// if( _item.name == 'search' || _item.name == 'moreList-search'){
// let _searchObj = {}
// let searchData = options.data_moreList.filters;
// console.log(299,searchData)
// searchData.forEach(item=>{
// _searchObj[item.column] = item.value
// })
// const productFilter = (data, params) => data.filter(function(item){
// return Object.keys(params).every(function(key){
// return item[key]!=undefined && item[key]==params[key] //可以相应修改条件
// })
// })
// let _allData = JSON.parse(JSON.stringify(this.tableDataDetails))
// let _filterList = productFilter(_allData.details,_searchObj)
// _allData.details = _filterList
// this.propsData = this.detailListPageFromFE(_allData)
// //关闭高级筛选
// if(options.vm_moreList){options.vm_moreList.changeMoreListShow(false)}
// // 同步当前列表数据请求接口的筛选条件
// this.detailSearchDataFE = {}
// this.detailSearchDataFE.moreList = {filters:JSON.parse(JSON.stringify(searchData))}
// }
// // return res
// },
// 点击抽屉,获取明细后全局通用操作
inlineDialogCallback(){
this.Loading.DrawerLoading = false

4
PC/InterFace.Dash/src/utils/detailsPageColumns_api/index.js

@ -6,7 +6,7 @@ import { initFromApiColumnsLable } from '@/utils/index'
export const AsnMstr = [
{ label: initFromApiColumnsLable('AsnDetAsnMstrId'), prop: "asnMstrId"},
{ label: initFromApiColumnsLable('AsnDetAsnNbr'), prop: "asnNbr" },
{ label: initFromApiColumnsLable('AsnDetEntireBarCode'), prop: "creationTime",type:'dateTime' },
{ label: initFromApiColumnsLable('AsnDetEntireBarCode'), prop: "entireBarCode" },
{ label: initFromApiColumnsLable('AsnDetLabelCode'), prop: "labelCode" },
{ label: initFromApiColumnsLable('AsnDetLocUm'), prop: "locUm" },
{ label: initFromApiColumnsLable('AsnDetLot'), prop: "lot" },
@ -16,7 +16,7 @@ export const AsnMstr = [
{ label: initFromApiColumnsLable('AsnDetPoLine'), prop: "poLine" },
{ label: initFromApiColumnsLable('AsnDetPoNbr'), prop: "poNbr" },
{ label: initFromApiColumnsLable('AsnDetPoUm'), prop: "poUm" },
{ label: initFromApiColumnsLable('AsnDetProductionDate'), prop: "productionDate" },
{ label: initFromApiColumnsLable('AsnDetProductionDate'), prop: "productionDate",type:'dateTime' },
{ label: initFromApiColumnsLable('AsnDetQty'), prop: "qty" },
{ label: initFromApiColumnsLable('AsnDetRemark'), prop: "remark" },
{ label: initFromApiColumnsLable('AsnDetStatus'), prop: "status" },

7
PC/InterFace.Dash/src/utils/detailsTableColumns_api/index.js

@ -1,12 +1,13 @@
// 此文件为【列表 - 明细】+【明细 - 列表】表头从接口缓存的表头
// 如果有父级id字段,请设置showProp,避免明细列表内可查询其他主表的明细
import { initFromApiColumnsLable } from '@/utils/index'
// AsnMstr
export const AsnMstr = [
{ label: initFromApiColumnsLable('AsnDetAsnMstrId'), prop: "asnMstrId"},
{ label: initFromApiColumnsLable('AsnDetAsnMstrId'), prop: "asnMstrId",showProp:true},
{ label: initFromApiColumnsLable('AsnDetAsnNbr'), prop: "asnNbr" },
{ label: initFromApiColumnsLable('AsnDetEntireBarCode'), prop: "creationTime",type:'dateTime' },
{ label: initFromApiColumnsLable('AsnDetEntireBarCode'), prop: "entireBarCode" },
{ label: initFromApiColumnsLable('AsnDetLabelCode'), prop: "labelCode" },
{ label: initFromApiColumnsLable('AsnDetLocUm'), prop: "locUm" },
{ label: initFromApiColumnsLable('AsnDetLot'), prop: "lot" },
@ -16,7 +17,7 @@ export const AsnMstr = [
{ label: initFromApiColumnsLable('AsnDetPoLine'), prop: "poLine" },
{ label: initFromApiColumnsLable('AsnDetPoNbr'), prop: "poNbr" },
{ label: initFromApiColumnsLable('AsnDetPoUm'), prop: "poUm" },
{ label: initFromApiColumnsLable('AsnDetProductionDate'), prop: "productionDate" },
{ label: initFromApiColumnsLable('AsnDetProductionDate'), prop: "productionDate",type:'dateTime' },
{ label: initFromApiColumnsLable('AsnDetQty'), prop: "qty" },
{ label: initFromApiColumnsLable('AsnDetRemark'), prop: "remark" },
{ label: initFromApiColumnsLable('AsnDetStatus'), prop: "status" },

1
PC/InterFace.Dash/src/views/interfaceBoard/AsnMstr.vue

@ -35,7 +35,6 @@
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
@detailFiltersSearch="detailFiltersSearch"
:detailSearchDataFE="detailSearchDataFE"
:Butttondata="[]"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"

Loading…
Cancel
Save